From 30c0c82af4439ec16550ed00b6a6291de60916fb Mon Sep 17 00:00:00 2001 From: Gabriel Francisco Date: Fri, 11 Aug 2023 15:53:31 -0300 Subject: [PATCH 1/2] fix macos build --- README.md | 4 ++-- build.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 8b1f0c1..fa4c076 100644 --- a/README.md +++ b/README.md @@ -158,7 +158,7 @@ git submodule update --init # download lua submodule npm i # install dependencies ``` -### Windows / Linux (Docker way) +### Windows / Linux / MacOS (Docker way) You need to install [docker](https://www.docker.com/) and ensure it is on your `PATH`. @@ -170,7 +170,7 @@ npm run build # build the js code/bridge npm test # ensure everything it's working fine ``` -### Ubuntu / Debian +### Ubuntu / Debian / MacOS You need to install [emscripten](https://emscripten.org/) and ensure it is on your `PATH`. diff --git a/build.sh b/build.sh index 871d1e5..d390eb1 100755 --- a/build.sh +++ b/build.sh @@ -12,7 +12,7 @@ else extension="$extension -O3 --closure 1" fi -sed -i "s/^#define LUA_32BITS\t0$/#define LUA_32BITS\t1/" ./lua/luaconf.h +sed -i '' "s/^#define LUA_32BITS\t0$/#define LUA_32BITS\t1/" ./lua/luaconf.h > /dev/null emcc \ -s WASM=1 $extension -o ./build/glue.js \ @@ -194,4 +194,4 @@ emcc \ ]" \ ${LUA_SRC} -sed -i "s/^#define LUA_32BITS\t1$/#define LUA_32BITS\t0/" ./lua/luaconf.h +sed -i '' "s/^#define LUA_32BITS\t1$/#define LUA_32BITS\t0/" ./lua/luaconf.h > /dev/null From b5091e22a6029eb99ccf1badd5e72414c66ee6b5 Mon Sep 17 00:00:00 2001 From: Gabriel Francisco Date: Fri, 11 Aug 2023 15:58:53 -0300 Subject: [PATCH 2/2] fix sed for linux --- build.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index d390eb1..3a0b940 100755 --- a/build.sh +++ b/build.sh @@ -12,7 +12,11 @@ else extension="$extension -O3 --closure 1" fi -sed -i '' "s/^#define LUA_32BITS\t0$/#define LUA_32BITS\t1/" ./lua/luaconf.h > /dev/null +if [[ "$OSTYPE" == "darwin"* ]]; then + sed -i '' "s/^#define LUA_32BITS\t0$/#define LUA_32BITS\t1/" ./lua/luaconf.h +else + sed -i "s/^#define LUA_32BITS\t0$/#define LUA_32BITS\t1/" ./lua/luaconf.h +fi emcc \ -s WASM=1 $extension -o ./build/glue.js \ @@ -194,4 +198,8 @@ emcc \ ]" \ ${LUA_SRC} -sed -i '' "s/^#define LUA_32BITS\t1$/#define LUA_32BITS\t0/" ./lua/luaconf.h > /dev/null +if [[ "$OSTYPE" == "darwin"* ]]; then + sed -i '' "s/^#define LUA_32BITS\t1$/#define LUA_32BITS\t0/" ./lua/luaconf.h +else + sed -i "s/^#define LUA_32BITS\t1$/#define LUA_32BITS\t0/" ./lua/luaconf.h +fi