diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 79b8b50ab79..f5b78342357 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -283,9 +283,11 @@ jobs: tar -xf $RUNNER_TEMP/neko_latest.tar.gz -C $RUNNER_TEMP NEKOPATH=`echo $RUNNER_TEMP/neko-*-*` sudo mkdir -p /usr/local/bin + sudo mkdir -p /usr/local/include sudo mkdir -p /usr/local/lib/neko sudo ln -s $NEKOPATH/{neko,nekoc,nekoml,nekotools} /usr/local/bin/ sudo ln -s $NEKOPATH/libneko.* /usr/local/lib/ + sudo ln -s $NEKOPATH/include/* /usr/local/include/ sudo ln -s $NEKOPATH/*.ndll /usr/local/lib/neko/ echo "NEKOPATH=$NEKOPATH" >> $GITHUB_ENV @@ -398,9 +400,11 @@ jobs: tar -xf $RUNNER_TEMP/neko_latest.tar.gz -C $RUNNER_TEMP NEKOPATH=`echo $RUNNER_TEMP/neko-*-*` sudo mkdir -p /usr/local/bin + sudo mkdir -p /usr/local/include sudo mkdir -p /usr/local/lib/neko sudo ln -s $NEKOPATH/{neko,nekoc,nekoml,nekotools} /usr/local/bin/ sudo ln -s $NEKOPATH/libneko.* /usr/local/lib/ + sudo ln -s $NEKOPATH/include/* /usr/local/include/ sudo ln -s $NEKOPATH/*.ndll /usr/local/lib/neko/ echo "NEKOPATH=$NEKOPATH" >> $GITHUB_ENV @@ -474,9 +478,11 @@ jobs: tar -xf $RUNNER_TEMP/neko_latest.tar.gz -C $RUNNER_TEMP NEKOPATH=`echo $RUNNER_TEMP/neko-*-*` sudo mkdir -p /usr/local/bin + sudo mkdir -p /usr/local/include sudo mkdir -p /usr/local/lib/neko sudo ln -s $NEKOPATH/{neko,nekoc,nekoml,nekotools} /usr/local/bin/ sudo ln -s $NEKOPATH/libneko.* /usr/local/lib/ + sudo ln -s $NEKOPATH/include/* /usr/local/include/ sudo ln -s $NEKOPATH/*.ndll /usr/local/lib/neko/ echo "NEKOPATH=$NEKOPATH" >> $GITHUB_ENV @@ -610,9 +616,11 @@ jobs: tar -xf $RUNNER_TEMP/neko_latest.tar.gz -C $RUNNER_TEMP NEKOPATH=`echo $RUNNER_TEMP/neko-*-*` sudo mkdir -p /usr/local/bin + sudo mkdir -p /usr/local/include sudo mkdir -p /usr/local/lib/neko sudo ln -s $NEKOPATH/{neko,nekoc,nekoml,nekotools} /usr/local/bin/ sudo ln -s $NEKOPATH/libneko.* /usr/local/lib/ + sudo ln -s $NEKOPATH/include/* /usr/local/include/ sudo ln -s $NEKOPATH/*.ndll /usr/local/lib/neko/ echo "NEKOPATH=$NEKOPATH" >> $GITHUB_ENV @@ -670,7 +678,7 @@ jobs: set -ex eval $(opam env) opam config exec -- make -s -j`sysctl -n hw.ncpu` STATICLINK=1 "LIB_PARAMS=/usr/local/lib/libz.a /usr/local/lib/libpcre2-8.a /usr/local/lib/libmbedtls.a /usr/local/lib/libmbedcrypto.a /usr/local/lib/libmbedx509.a -cclib '-framework Security -framework CoreFoundation'" haxe - opam config exec -- make -s haxelib + opam config exec -- arch -x86_64 make -s haxelib make -s package_unix package_installer_mac ls -l out otool -L ./haxe @@ -949,9 +957,11 @@ jobs: tar -xf $RUNNER_TEMP/neko_latest.tar.gz -C $RUNNER_TEMP NEKOPATH=`echo $RUNNER_TEMP/neko-*-*` sudo mkdir -p /usr/local/bin + sudo mkdir -p /usr/local/include sudo mkdir -p /usr/local/lib/neko sudo ln -s $NEKOPATH/{neko,nekoc,nekoml,nekotools} /usr/local/bin/ sudo ln -s $NEKOPATH/libneko.* /usr/local/lib/ + sudo ln -s $NEKOPATH/include/* /usr/local/include/ sudo ln -s $NEKOPATH/*.ndll /usr/local/lib/neko/ echo "NEKOPATH=$NEKOPATH" >> $GITHUB_ENV diff --git a/Earthfile b/Earthfile index dda473f6c60..af649bf118c 100644 --- a/Earthfile +++ b/Earthfile @@ -146,6 +146,7 @@ INSTALL_NEKO: ARG PREFIX=/usr/local RUN bash -c "ln -s \"$NEKOPATH\"/{neko,nekoc,nekoml,nekotools} \"$PREFIX/bin/\"" RUN bash -c "ln -s \"$NEKOPATH\"/libneko.* \"$PREFIX/lib/\"" + RUN bash -c "ln -s \"$NEKOPATH\"/*.h \"$PREFIX/include/\"" RUN mkdir -p "$PREFIX/lib/neko/" RUN bash -c "ln -s \"$NEKOPATH\"/*.ndll \"$PREFIX/lib/neko/\"" RUN ldconfig diff --git a/Makefile b/Makefile index a3b86a753a9..0588e7c5eb1 100644 --- a/Makefile +++ b/Makefile @@ -104,10 +104,24 @@ copy_haxetoolkit: /cygdrive/c/HaxeToolkit/haxe/haxe.exe cp $< $@ endif +ifeq ($(SYSTEM_NAME),Mac) +# This assumes that haxelib and neko will both be installed into INSTALL_DIR, +# which is the case when installing using the mac installer package +HAXELIB_LFLAGS= -Wl,-rpath,$(INSTALL_DIR)/lib +endif + +haxelib_unix: + cd $(CURDIR)/extra/haxelib_src && \ + HAXE_STD_PATH=$(CURDIR)/std $(CURDIR)/$(HAXE_OUTPUT) client.hxml && \ + nekotools boot -c run.n + $(CC) $(CURDIR)/extra/haxelib_src/run.c -o $(HAXELIB_OUTPUT) -lneko $(HAXELIB_LFLAGS) + # haxelib should depends on haxe, but we don't want to do that... -haxelib: - (cd $(CURDIR)/extra/haxelib_src && $(CURDIR)/$(HAXE_OUTPUT) client.hxml && nekotools boot run.n) - mv extra/haxelib_src/run$(EXTENSION) $(HAXELIB_OUTPUT) +ifeq ($(SYSTEM_NAME),Windows) +haxelib: haxelib_$(PLATFORM) +else +haxelib: haxelib_unix +endif tools: haxelib diff --git a/Makefile.win b/Makefile.win index 95500b63536..fdb34b4342b 100644 --- a/Makefile.win +++ b/Makefile.win @@ -53,6 +53,13 @@ PACKAGE_FILES=$(HAXE_OUTPUT) $(HAXELIB_OUTPUT) std \ "$$(cygcheck $(CURDIR)/$(HAXE_OUTPUT) | grep libmbedtls.dll | sed -e 's/^\s*//')" \ "$$(cygcheck $(CURDIR)/$(HAXE_OUTPUT) | grep libmbedx509.dll | sed -e 's/^\s*//')" +# haxelib should depends on haxe, but we don't want to do that... +haxelib_win: + cd $(CURDIR)/extra/haxelib_src && \ + HAXE_STD_PATH=$$(cygpath -m $(CURDIR)/std) $(CURDIR)/$(HAXE_OUTPUT) client.hxml && \ + nekotools boot run.n + mv extra/haxelib_src/run$(EXTENSION) $(HAXELIB_OUTPUT) + echo_package_files: echo $(PACKAGE_FILES) diff --git a/extra/github-actions/build-mac.yml b/extra/github-actions/build-mac.yml index 65dcc41b4d8..01de55b7171 100644 --- a/extra/github-actions/build-mac.yml +++ b/extra/github-actions/build-mac.yml @@ -49,7 +49,7 @@ set -ex eval $(opam env) opam config exec -- make -s -j`sysctl -n hw.ncpu` STATICLINK=1 "LIB_PARAMS=/usr/local/lib/libz.a /usr/local/lib/libpcre2-8.a /usr/local/lib/libmbedtls.a /usr/local/lib/libmbedcrypto.a /usr/local/lib/libmbedx509.a -cclib '-framework Security -framework CoreFoundation'" haxe - opam config exec -- make -s haxelib + opam config exec -- arch -x86_64 make -s haxelib make -s package_unix package_installer_mac ls -l out otool -L ./haxe diff --git a/extra/github-actions/install-neko-unix.yml b/extra/github-actions/install-neko-unix.yml index ab8eb43b2d9..5946d3c7fc0 100644 --- a/extra/github-actions/install-neko-unix.yml +++ b/extra/github-actions/install-neko-unix.yml @@ -6,9 +6,11 @@ tar -xf $RUNNER_TEMP/neko_latest.tar.gz -C $RUNNER_TEMP NEKOPATH=`echo $RUNNER_TEMP/neko-*-*` sudo mkdir -p /usr/local/bin + sudo mkdir -p /usr/local/include sudo mkdir -p /usr/local/lib/neko sudo ln -s $NEKOPATH/{neko,nekoc,nekoml,nekotools} /usr/local/bin/ sudo ln -s $NEKOPATH/libneko.* /usr/local/lib/ + sudo ln -s $NEKOPATH/include/* /usr/local/include/ sudo ln -s $NEKOPATH/*.ndll /usr/local/lib/neko/ echo "NEKOPATH=$NEKOPATH" >> $GITHUB_ENV