standardnotes: patch pre-built node modules
This commit is contained in:
parent
bf0a52da05
commit
db8fa1117c
1 changed files with 17 additions and 2 deletions
|
@ -4,6 +4,9 @@
|
|||
, dpkg
|
||||
, makeWrapper
|
||||
, electron
|
||||
, libsecret
|
||||
, asar
|
||||
, glib
|
||||
, desktop-file-utils
|
||||
, callPackage
|
||||
}:
|
||||
|
@ -28,16 +31,28 @@ stdenv.mkDerivation rec {
|
|||
|
||||
dontBuild = true;
|
||||
|
||||
nativeBuildInputs = [ makeWrapper dpkg desktop-file-utils ];
|
||||
nativeBuildInputs = [ makeWrapper dpkg desktop-file-utils asar ];
|
||||
|
||||
unpackPhase = "dpkg-deb --fsys-tarfile $src | tar -x --no-same-permissions --no-same-owner";
|
||||
|
||||
installPhase = ''
|
||||
installPhase = let
|
||||
libPath = lib.makeLibraryPath [
|
||||
libsecret
|
||||
glib
|
||||
stdenv.cc.cc.lib
|
||||
];
|
||||
in
|
||||
''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/bin $out/share/standardnotes
|
||||
cp -R usr/share/{applications,icons} $out/share
|
||||
cp -R opt/Standard\ Notes/resources/app.asar $out/share/standardnotes/
|
||||
asar e $out/share/standardnotes/app.asar asar-unpacked
|
||||
find asar-unpacked -name '*.node' -exec patchelf \
|
||||
--add-rpath "${libPath}" \
|
||||
{} \;
|
||||
asar p asar-unpacked $out/share/standardnotes/app.asar
|
||||
|
||||
makeWrapper ${electron}/bin/electron $out/bin/standardnotes \
|
||||
--add-flags $out/share/standardnotes/app.asar
|
||||
|
|
Loading…
Reference in a new issue