Merge pull request #205057 from LoveIsGrief/logseq-run-appimage

logseq: Fix publishing graph
This commit is contained in:
Sandro 2023-01-31 15:45:51 +01:00 committed by GitHub
commit 32af394652
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 19 deletions

View file

@ -2,8 +2,8 @@
, stdenv
, fetchurl
, appimageTools
, appimage-run
, makeWrapper
, electron
, git
}:
@ -30,30 +30,23 @@ stdenv.mkDerivation rec {
installPhase = ''
runHook preInstall
mkdir -p $out/bin $out/share/${pname} $out/share/applications
cp -a ${appimageContents}/{locales,resources} $out/share/${pname}
mkdir -p $out/bin $out/share/${pname} $out/share/applications $out/share/${pname}/resources/app/icons
cp -a ${appimageContents}/resources/app/icons/logseq.png $out/share/${pname}/resources/app/icons/logseq.png
cp -a ${appimageContents}/Logseq.desktop $out/share/applications/${pname}.desktop
# remove the `git` in `dugite` because we want the `git` in `nixpkgs`
chmod +w -R $out/share/${pname}/resources/app/node_modules/dugite/git
chmod +w $out/share/${pname}/resources/app/node_modules/dugite
rm -rf $out/share/${pname}/resources/app/node_modules/dugite/git
chmod -w $out/share/${pname}/resources/app/node_modules/dugite
# set the env "LOCAL_GIT_DIRECTORY" for dugite so that we can use the git in nixpkgs
makeWrapper ${appimage-run}/bin/appimage-run $out/bin/logseq \
--set "LOCAL_GIT_DIRECTORY" ${git} \
--add-flags ${src}
# Make the desktop entry run the app using appimage-run
substituteInPlace $out/share/applications/${pname}.desktop \
--replace Exec=Logseq Exec=${pname} \
--replace Exec=Logseq "Exec=$out/bin/logseq" \
--replace Icon=Logseq Icon=$out/share/${pname}/resources/app/icons/logseq.png
runHook postInstall
'';
postFixup = ''
# set the env "LOCAL_GIT_DIRECTORY" for dugite so that we can use the git in nixpkgs
makeWrapper ${electron}/bin/electron $out/bin/${pname} \
--set "LOCAL_GIT_DIRECTORY" ${git} \
--add-flags $out/share/${pname}/resources/app
'';
passthru.updateScript = ./update.sh;
meta = with lib; {

View file

@ -2525,9 +2525,7 @@ with pkgs;
lilo = callPackage ../tools/misc/lilo { };
logseq = callPackage ../applications/misc/logseq {
electron = electron_20;
};
logseq = callPackage ../applications/misc/logseq { };
natls = callPackage ../tools/misc/natls { };