Skip to content

Commit 08c40e0

Browse files
committed
ports: lua
1 parent d21c958 commit 08c40e0

File tree

4 files changed

+31
-4
lines changed

4 files changed

+31
-4
lines changed

ports/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ You can either run `util/ports.sh` to build all the ports at once, or you can ru
1919
- vim (`ports/vim.sh`)
2020
- ncurses (`ports/ncurses.sh`)
2121
- tree (`ports/tree.sh`)
22+
- lua (`ports/lua.sh`)

ports/lua.diff

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/makefile b/makefile
2+
index 8506e93c..65874644 100644
3+
--- a/makefile
4+
+++ b/makefile
5+
@@ -77,7 +77,7 @@ MYLIBS= -ldl
6+
7+
8+
CC= gcc
9+
-CFLAGS= -Wall -O2 $(MYCFLAGS) -fno-stack-protector -fno-common -march=native
10+
+CFLAGS= -Wall -O2 $(MYCFLAGS) -fno-stack-protector -fno-common
11+
AR= ar rc
12+
RANLIB= ranlib
13+
RM= rm -f

ports/lua.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
mkdir -p ports/src
3+
cd ports/src
4+
git clone https://github.com/lua/lua
5+
cd lua
6+
git apply ../../lua.diff
7+
make CC=musl-gcc MYCFLAGS="-std=c99 -DLUA_USE_LINUX" MYLDFLAGS=-static -j$(nproc)
8+
cp lua ../../../root/usr/bin

util/ports.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
#!/bin/bash
2+
# IMPORTANT: run from the root of the repo!
23

3-
# The cwd has to be ports/.. for these to work
44
./ports/bash-prebuilt.sh
55
./ports/busybox.sh
66
./ports/doomgeneric.sh
77
./ports/figlet.sh
88
./ports/neofetch.sh
99
./ports/ncurses.sh
1010
./ports/vim.sh
11+
./ports/tree.sh
12+
./ports/lua.sh
1113

12-
echo "Cleaning up..."
13-
rm -rf ports/src/
14-
cd ..
14+
read -p "Clean up? (Y/n) " answer
15+
answer=${answer:-Y}
16+
if [[ "$answer" =~ ^[Yy]$ ]]; then
17+
echo "Cleaning up..."
18+
rm -rf ports/src/
19+
fi

0 commit comments

Comments
 (0)