Use Node JS for building duktape library (#248)

* Use Node JS for building duktape library

* Remove Python 2 dependency

* Inherit PATH from environment in Actions

Remove build cache of the msys2 installation in Travis CI.

* Remove old command
This commit is contained in:
Tindy X
2020-09-19 03:05:26 +08:00
committed by GitHub
parent 629b1bf222
commit c0b62062d9
3 changed files with 19 additions and 13 deletions

View File

@@ -49,10 +49,15 @@ jobs:
shell: msys2 {0}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2-beta
with:
node-version: '12'
- uses: msys2/setup-msys2@v2
with:
update: true
install: base-devel git mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-libevent mingw-w64-x86_64-pcre2 python2 python2-pip
install: base-devel git mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-libevent mingw-w64-x86_64-pcre2
msystem: MINGW64
path-type: inherit
- name: Build
run: bash scripts/build.windows.release.sh
- name: Upload
@@ -69,11 +74,15 @@ jobs:
shell: msys2 {0}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2-beta
with:
node-version: '12'
- uses: msys2/setup-msys2@v2
with:
update: true
install: base-devel git mingw-w64-i686-gcc mingw-w64-i686-cmake mingw-w64-i686-libevent mingw-w64-i686-pcre2 python2 python2-pip
install: base-devel git mingw-w64-i686-gcc mingw-w64-i686-cmake mingw-w64-i686-libevent mingw-w64-i686-pcre2
msystem: MINGW32
path-type: inherit
- name: Build
run: bash scripts/build.windows.release.sh
- name: Upload

View File

@@ -87,13 +87,13 @@ jobs:
- |-
[[ ! -f C:/tools/msys64/msys2_shell.cmd ]] && rm -rf C:/tools/msys64
choco uninstall -y mingw
choco upgrade --no-progress -y msys2
choco upgrade --no-progress -y msys2 nodejs
export msys2='cmd //C RefreshEnv.cmd '
export msys2+='& set MSYS=winsymlinks:nativestrict '
export msys2+='& C:\\tools\\msys64\\msys2_shell.cmd -defterm -no-start'
export mingw64="$msys2 -mingw64 -full-path -here -c "\"\$@"\" --"
export msys2+=" -msys2 -c "\"\$@"\" --"
$msys2 pacman --sync --noconfirm --needed base-devel git mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-libevent mingw-w64-x86_64-pcre2 python2 python2-pip
$msys2 pacman --sync --noconfirm --needed base-devel git mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-libevent mingw-w64-x86_64-pcre2
taskkill //IM gpg-agent.exe //F
export PATH=/C/tools/msys64/mingw64/bin:$PATH
export MAKE=make
@@ -103,7 +103,6 @@ jobs:
cache:
directories:
- $HOME/AppData/Local/Temp/chocolatey
- /C/tools/msys64
script:
- $mingw64 bash scripts/build.windows.release.sh
before_deploy:
@@ -122,13 +121,13 @@ jobs:
- |-
[[ ! -f C:/tools/msys64/msys2_shell.cmd ]] && rm -rf C:/tools/msys64
choco uninstall -y mingw
choco upgrade --no-progress -y msys2
choco upgrade --no-progress -y msys2 nodejs
export msys2='cmd //C RefreshEnv.cmd '
export msys2+='& set MSYS=winsymlinks:nativestrict '
export msys2+='& C:\\tools\\msys64\\msys2_shell.cmd -defterm -no-start'
export mingw32="$msys2 -mingw32 -full-path -here -c "\"\$@"\" --"
export msys2+=" -msys2 -c "\"\$@"\" --"
$msys2 pacman --sync --noconfirm --needed base-devel git mingw-w64-i686-gcc mingw-w64-i686-cmake mingw-w64-i686-libevent mingw-w64-i686-pcre2 python2 python2-pip
$msys2 pacman --sync --noconfirm --needed base-devel git mingw-w64-i686-gcc mingw-w64-i686-cmake mingw-w64-i686-libevent mingw-w64-i686-pcre2
taskkill //IM gpg-agent.exe //F
export PATH=/C/tools/msys64/mingw64/bin:$PATH
export MAKE=make
@@ -138,7 +137,6 @@ jobs:
cache:
directories:
- $HOME/AppData/Local/Temp/chocolatey
- /C/tools/msys64
script:
- $mingw32 bash scripts/build.windows.release.sh
before_deploy:

View File

@@ -15,10 +15,9 @@ cd ..
git clone https://github.com/svaarala/duktape --depth=1
cd duktape
pip2 install PyYAML
mkdir dist
python2 util/dist.py
cd dist/source/src
make -C src-tools
node src-tools/index.js dist --output-directory dist
cd dist/src
gcc -c -O3 -o duktape.o duktape.c
gcc -c -O3 -o duk_module_node.o -I. ../extras/module-node/duk_module_node.c
ar cr libduktape.a duktape.o
@@ -26,7 +25,7 @@ ar cr libduktape_module.a duk_module_node.o
install -m0644 ./*.a "$MINGW_PREFIX/lib"
install -m0644 ./duk*.h "$MINGW_PREFIX/include"
install -m0644 ../extras/module-node/duk_module_node.h "$MINGW_PREFIX/include"
cd ../../../..
cd ../../..
git clone https://github.com/Tencent/rapidjson --depth=1
cd rapidjson