Skip to content

Commit

Permalink
Replace Lua dependency with LuaJIT
Browse files Browse the repository at this point in the history
  • Loading branch information
wins1ey committed Mar 21, 2024
1 parent c3c4762 commit 8877a16
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: "Install dependencies"
run: |
sudo apt -y update
sudo apt -y install libgtk-3-dev libx11-dev libjansson-dev liblua5.4-dev
sudo apt -y install libgtk-3-dev libx11-dev libjansson-dev libluajit-5.1-dev
- name: "Run make clean and make"
run: make clean && make -j
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
TARGET := LAST

INC := `pkg-config --cflags gtk+-3.0 x11 jansson lua`
INC := `pkg-config --cflags gtk+-3.0 x11 jansson luajit`
CFLAGS := -std=gnu99 -O2 -pthread -Wall -Wno-unused-parameter
LDFLAGS := `pkg-config --libs gtk+-3.0 x11 jansson lua`
LDFLAGS := `pkg-config --libs gtk+-3.0 x11 jansson luajit`

SRC_DIR := ./src
OBJ_DIR := ./obj
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ LAST requires the following dependencies on your system to compile:
- `libgtk+-3.0`
- `x11`
- `libjansson`
- `lua`
- `luajit`

And to install:

Expand Down
4 changes: 2 additions & 2 deletions src/auto-splitter.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
#include <sys/stat.h>
#include <string.h>

#include <lua.h>
#include <lauxlib.h>
#include <luajit.h>
#include <lualib.h>
#include <lauxlib.h>

#include "memory.h"
#include "auto-splitter.h"
Expand Down
4 changes: 2 additions & 2 deletions src/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <string.h>
#include <sys/uio.h>

#include <lua.h>
#include <luajit.h>

#include "memory.h"
#include "process.h"
Expand Down Expand Up @@ -195,4 +195,4 @@ int read_address(lua_State* L)
}

return 1;
}
}
4 changes: 2 additions & 2 deletions src/memory.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#ifndef __MEMORY_H__
#define __MEMORY_H__

#include <lua.h>
#include <luajit.h>
#include <sys/uio.h>
#include <stdlib.h>

ssize_t process_vm_readv(int pid, struct iovec *mem_local, int liovcnt, struct iovec *mem_remote, int riovcnt, int flags);

int read_address(lua_State* L);

#endif /* __MEMORY_H__ */
#endif /* __MEMORY_H__ */
4 changes: 2 additions & 2 deletions src/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <unistd.h>
#include <signal.h>

#include <lua.h>
#include <luajit.h>

#include "process.h"
#include "auto-splitter.h"
Expand Down Expand Up @@ -116,4 +116,4 @@ int process_exists()
{
int result = kill(process.pid, 0);
return result == 0;
}
}
4 changes: 2 additions & 2 deletions src/process.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <stdint.h>

#include <lua.h>
#include <luajit.h>

struct last_process
{
Expand All @@ -19,4 +19,4 @@ int process_exists();
int find_process_id(lua_State* L);
int getPid(lua_State* L);

#endif /* __PROCESS_H__ */
#endif /* __PROCESS_H__ */

0 comments on commit 8877a16

Please sign in to comment.