Commit f5211396 authored by Cédric Moreau's avatar Cédric Moreau
Browse files

[fix] release: leveldown compilation requires a patch

parent 4ada0d1f
......@@ -21,8 +21,14 @@ fi
# 1. Module name.
nw_copy() {
[[ -z ${1} ]] && exit 1
cp lib/binding/Release/node-webkit-v${NW_VERSION}-linux-x64/${1}.node \
lib/binding/Release/node-v${ADDON_VERSION}-linux-x64/${1}.node || exit 1
from_folder=lib/binding/Release/node-webkit-v${NW_VERSION}-linux-x64
if [[ ! -z ${2} ]]; then
from_folder=${2}
fi
local dest=lib/binding/Release/node-v${ADDON_VERSION}-linux-x64
mkdir -p ${dest}
cp ${from_folder}/${1}.node \
${dest}/${1}.node || exit 1
}
# Copy nw.js compiled module library to node libraries, prefixing with node_.
......@@ -31,8 +37,10 @@ nw_copy() {
# 1. Module name.
nw_copy_node() {
[[ -z ${1} ]] && exit 1
local dest=lib/binding/node-v${ADDON_VERSION}-linux-x64/
mkdir -p ${dest}
cp lib/binding/node-webkit-v${NW_VERSION}-linux-x64/node_${1}.node \
lib/binding/node-v${ADDON_VERSION}-linux-x64/node_${1}.node || exit 1
${dest}/node_${1}.node || exit 1
}
# Compile the module with nw.js.
......@@ -45,7 +53,7 @@ nw_compile() {
cd ${1} || exit 1
node-pre-gyp --runtime=node-webkit --target=${NW_VERSION} configure || exit 1
node-pre-gyp --runtime=node-webkit --target=${NW_VERSION} build || exit 1
[[ -z ${2} ]] || ${2} ${1}
[[ -z ${2} ]] || ${2} ${1} ${3}
cd ..
}
......@@ -170,6 +178,9 @@ rm -Rf .gitignore .git || exit 1 # Remove git files
echo ">> VM: building modules..."
yarn || exit 1
# Patch leveldown
cp $"${ROOT}/release/resources/leveldown-fix.json" "${RELEASES}/duniter/node_modules/leveldown/package.json" || exit 1
# Duniter UI
yarn add "duniter-ui@${DUNITER_UI_VER}" || exit 1
yarn --production || exit 1
......@@ -193,7 +204,7 @@ node-pre-gyp --runtime=node-webkit --target=$NW_VERSION configure \
cd "${RELEASES}/desktop_/node_modules/"
nw_compile wotb nw_copy
nw_compile naclb nw_copy
nw_compile leveldown nw_copy
nw_compile leveldown nw_copy "build/Release/"
nw_compile scryptb nw_copy
nw_compile sqlite3 nw_copy_node
......
......@@ -64,6 +64,9 @@ git checkout %DUNITER_TAG%
call npm cache clean
call npm install
echo "Patch de leveldown..."
move %cd%\node_modules\leveldown\package.json %cd%\node_modules\leveldown\package.json.back /s /e /Y
move %cd%\release\resources\leveldown-fix.json %cd%\node_modules\leveldown\package.json /s /e /Y
REM call npm test
echo "Ajout du module 1/1 (duniter-ui)..."
call npm install duniter-ui@1.7.x --save --production
......@@ -95,7 +98,11 @@ cd ../leveldown
call npm install --build-from-source
call node-pre-gyp --runtime=node-webkit --target=%NW_VERSION% --msvs_version=2015 configure
call node-pre-gyp --runtime=node-webkit --target=%NW_VERSION% --msvs_version=2015 build
copy %cd%\lib\binding\Release\node-webkit-%NW_RELEASE%-win32-x64\leveldown.node %cd%\lib\binding\Release\node-v%ADDON_VERSION%-win32-x64\leveldown.node /Y
mkdir %cd%\lib
mkdir %cd%\lib\binding
mkdir %cd%\lib\binding\Release
mkdir %cd%\lib\binding\Release\node-v%ADDON_VERSION%-win32-x64
copy %cd%\build\Release\leveldown.node %cd%\lib\binding\Release\node-v%ADDON_VERSION%-win32-x64\leveldown.node /Y
cd ../scryptb
call npm install --build-from-source
call node-pre-gyp --runtime=node-webkit --target=%NW_VERSION% --msvs_version=2015 configure
......
{
"name": "leveldown",
"description": "A low-level Node.js LevelDB binding",
"version": "4.0.1",
"contributors": [
"Rod Vagg <r@va.gg> (https://github.com/rvagg)",
"John Chesley <john@chesl.es> (https://github.com/chesles/)",
"Jake Verbaten <raynos2@gmail.com> (https://github.com/raynos)",
"Dominic Tarr <dominic.tarr@gmail.com> (https://github.com/dominictarr)",
"Max Ogden <max@maxogden.com> (https://github.com/maxogden)",
"Lars-Magnus Skog <ralphtheninja@riseup.net> (https://github.com/ralphtheninja)",
"David Björklund <david.bjorklund@gmail.com> (https://github.com/kesla)",
"Julian Gruber <julian@juliangruber.com> (https://github.com/juliangruber)",
"Paolo Fragomeni <paolo@async.ly> (https://github.com/hij1nx)",
"Anton Whalley <anton.whalley@nearform.com> (https://github.com/No9)",
"Matteo Collina <matteo.collina@gmail.com> (https://github.com/mcollina)",
"Pedro Teixeira <pedro.teixeira@gmail.com> (https://github.com/pgte)",
"James Halliday <mail@substack.net> (https://github.com/substack)",
"Gordon Hall <gordonh@member.fsf.org> (https://github.com/bookchin)",
"Yichao 'Peak' Ji <peakji@gmail.com> (https://github.com/peakji)",
"Meirion Hughes <crakinshot@yahoo.com> (https://github.com/meirionhughes)"
],
"repository": {
"type": "git",
"url": "https://github.com/level/leveldown.git"
},
"homepage": "https://github.com/level/leveldown",
"keywords": [
"leveldb",
"level"
],
"main": "leveldown.js",
"dependencies": {
"abstract-leveldown": "~5.0.0",
"bindings": "~1.3.0",
"fast-future": "~1.0.2",
"nan": "~2.10.0",
"prebuild-install": "^4.0.0"
},
"devDependencies": {
"async": "^2.0.1",
"delayed": "~1.0.1",
"du": "~0.1.0",
"faucet": "0.0.1",
"iota-array": "~1.0.0",
"lexicographic-integer": "~1.1.0",
"mkfiletree": "~1.0.1",
"monotonic-timestamp": "~0.0.8",
"optimist": "~0.6.1",
"prebuild": "^7.0.0",
"prebuild-ci": "^2.0.0",
"readfiletree": "~0.0.1",
"rimraf": "^2.6.1",
"slump": "~2.0.0",
"standard": "^11.0.1",
"tape": "^4.5.1",
"uuid": "^3.2.1",
"verify-travis-appveyor": "^3.0.0"
},
"scripts": {
"install": "prebuild-install || node-gyp rebuild",
"test": "standard && verify-travis-appveyor && (tape test/*-test.js | faucet) && prebuild-ci",
"rebuild": "prebuild --compile",
"prebuild": "prebuild --all --strip --verbose"
},
"binary": {
"module_name": "leveldown",
"module_path": "./lib/binding/{configuration}/{node_abi}-{platform}-{arch}/",
"remote_path": "./v{version}/{configuration}/",
"package_name": "{module_name}-v{version}-{node_abi}-{platform}-{arch}.tar.gz",
"host": "https://leveldown.s3-eu-central-1.amazonaws.com"
},
"license": "MIT",
"gypfile": true,
"engines": {
"node": ">=6"
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment