Merge pull request #313957 from NixOS/backport-312495-to-release-24.05

[Backport release-24.05] hedgedoc: fix executing scripts
This commit is contained in:
Aleksana 2024-05-25 13:08:56 +08:00 committed by GitHub
commit 21f02582dc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -55,6 +55,10 @@ in stdenv.mkDerivation {
python3 # needed for sqlite node-gyp
];
buildInputs = [
nodejs
];
dontConfigure = true;
buildPhase = ''
@ -75,7 +79,8 @@ in stdenv.mkDerivation {
yarn --immutable-cache
yarn run build
rm bin/heroku
# Delete scripts that are not useful for NixOS
rm bin/{heroku,setup}
patchShebangs bin/*
runHook postBuild
@ -85,11 +90,10 @@ in stdenv.mkDerivation {
runHook preInstall
mkdir -p $out/share/hedgedoc
cp -r bin $out
cp -r {app.js,lib,locales,node_modules,package.json,public} $out/share/hedgedoc
cp -r {app.js,bin,lib,locales,node_modules,package.json,public} $out/share/hedgedoc
for bin in $out/bin/*; do
wrapProgram $bin \
for bin in $out/share/hedgedoc/bin/*; do
makeWrapper $bin $out/bin/$(basename $bin) \
--set NODE_ENV production \
--set NODE_PATH "$out/share/hedgedoc/lib/node_modules"
done