aboutsummaryrefslogtreecommitdiff
path: root/pusher/default.nix
diff options
context:
space:
mode:
authorstuebinm2021-02-25 17:05:32 +0100
committerstuebinm2021-02-25 17:05:32 +0100
commit86799d84ff58fd43488dcdd5b75d5a07c12ed973 (patch)
tree2798dfc268f69c57dc109ecf9a56b9f1cd8fcad8 /pusher/default.nix
parentbfae9d9bfa90a0189d943ca865fa046f510b9922 (diff)
parent90720751b638df1897a97942f50d3d30b6803c46 (diff)
Merge branch 'master' of https://gitlab.com/fediventure/workadventure-nix
Diffstat (limited to 'pusher/default.nix')
-rw-r--r--pusher/default.nix12
1 files changed, 10 insertions, 2 deletions
diff --git a/pusher/default.nix b/pusher/default.nix
index a5b84d5..1c41765 100644
--- a/pusher/default.nix
+++ b/pusher/default.nix
@@ -1,6 +1,8 @@
{ stdenv
, autoPatchelfHook
, makeWrapper
+, lib
+, getconf
, fetchzip
, fetchFromGitHub
@@ -8,7 +10,7 @@
, nodejs-14_x
, yarn2nix-moretea
-, workadventure-messages
+, workadventure
}:
let
@@ -60,17 +62,23 @@ yarn2nix-moretea.mkYarnPackage rec {
dontStrip = true;
+ # workadventureback below is a package name extracted from package.json,
+ # intended until upstream fixes that up.
buildPhase = ''
mkdir -p $out
- ln -s ${workadventure-messages.outPath}/generated deps/workadventureback/src/Messages/generated
+ ln -s ${workadventure.messages.outPath}/generated deps/workadventureback/src/Messages/generated
HOME=$TMPDIR yarn --offline run tsc
cp -r deps/workadventureback/dist $out/dist
+ rm -rf deps/workadventureback/{src,node_modules}
'';
postInstall = ''
# node-abi needs to the abi of the node here
+ # getconf is required for detect-libc (used by node-pre-gyp) to properly
+ # detect current libc
makeWrapper '${nodejs-14_x}/bin/node' "$out/bin/${pname}" \
--set NODE_PATH $out/libexec/workadventureback/node_modules \
+ --prefix PATH : ${lib.makeBinPath [ getconf ]} \
--add-flags "$out/dist/server.js"
'';
}