codimd: fix build

This package broke during the update of `nodejs-10_x` to `v10.17.0`[1]
since `node-gyp` got updated from `3.8.0` to `5.0.3` during the NPM
update to `6.10.2`[2] which is bundled in the `nodejs` release tarball.

This `node-gyp`-version is used by the build script for `codimd` to
build several dependencies such as `node-sqlite3`. Older `node-gyp`
versions expected source headers for the compilation in `~/.node-gyp`,
with `node-gyp@5.0.3`, headers are declared by using the `--nodedir`
option.

[1] 7785f49b23
[2] e2291cf805
This commit is contained in:
Maximilian Bosch 2019-11-22 23:41:13 +01:00
parent 519448d2e3
commit ba307dd176
No known key found for this signature in database
GPG key ID: 091DBF4D1FC46B8E

View file

@ -35,14 +35,8 @@ yarn2nix.mkYarnPackage rec {
popd
pushd node_modules/sqlite3
export OLD_HOME="$HOME"
export HOME="$PWD"
mkdir -p .node-gyp/${nodejs.version}
echo 9 > .node-gyp/${nodejs.version}/installVersion
ln -s ${nodejs}/include .node-gyp/${nodejs.version}
npm run install
export HOME="$OLD_HOME"
unset OLD_HOME
export CPPFLAGS="-I${nodejs}/include/node"
npm run install --build-from-source --nodedir=${nodejs}/include/node
popd
npm run build