Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docker script to turn ceu into a binary file. #151

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.pyc
.*.swo
.*.swp
srlua/
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ LUA_EXE = lua5.3
CEU_EXE = /usr/local/bin/ceu
CEU_ARGS_ = --ceu-features-trace=true --ceu-err-unused=pass $(CEU_ARGS)
CC_ARGS_ = -llua5.3 -lpthread $(CC_ARGS)
GLUE_EXE = /usr/local/bin/glue
SRLUA_EXE = /usr/local/bin/srlua

###############################################################################
# DO NOT EDIT
Expand All @@ -17,6 +19,22 @@ compiler:
install:
install ./src/lua/ceu $(CEU_EXE)

docker-build:
sudo docker build -t ceu -f ./etc/ceu-binary/Dockerfile .

docker-install:
sudo docker run -v $(shell pwd)/bin:/ceu/bin/:z ceu

install-srlua:
git clone https://github.com/LuaDist/srlua.git
cd srlua && sed -i 's/-ansi//g; s/-llua/-llua5.3/g; s/gcc/gcc -static/g' Makefile && make
install ./srlua/glue $(GLUE_EXE)
install ./srlua/srlua $(SRLUA_EXE)

binary:
glue ./srlua/srlua ./src/lua/ceu ./bin/ceu.bin
chmod +x ./bin/ceu.bin

one:
ceu --pre --pre-input=$(CEU_SRC) --pre-args=\"-I./include\" \
--ceu $(CEU_ARGS_) --ceu-features-os=true \
Expand Down
12 changes: 12 additions & 0 deletions etc/ceu-binary/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM ubuntu:23.10

WORKDIR /ceu

RUN apt update
RUN apt install -y git lua5.3 lua-lpeg liblua5.3-0 liblua5.3-dev make

COPY . .

RUN ln -s /usr/include/lua5.3/* /usr/local/include/

CMD make && make install-srlua && make binary