about summary refs log tree commit diff
path: root/pkgs/applications
diff options
context:
space:
mode:
authorMario Rodas <marsam@users.noreply.github.com>2022-07-19 02:09:06 -0500
committerGitHub <noreply@github.com>2022-07-19 02:09:06 -0500
commit1440ce3e79dea5d5f08eb32204ec773fa8b1e77b (patch)
tree6345d69a5c038e9ca08b4f8d08802228d2ef0171 /pkgs/applications
parent0e94b17c6ae10cf7f38ca6d4558e3f6f4bac73bf (diff)
parent231b04201c2bd09f1c739343369400356c531242 (diff)
Merge pull request #177704 from SaltyKitkat/logseq_use_nixpkgs_git
logseq: make dugite use the `git` in nixpkgs
Diffstat (limited to 'pkgs/applications')
-rw-r--r--pkgs/applications/misc/logseq/default.nix14
1 files changed, 10 insertions, 4 deletions
diff --git a/pkgs/applications/misc/logseq/default.nix b/pkgs/applications/misc/logseq/default.nix
index e4e51d78fcab5..2f9996988e50d 100644
--- a/pkgs/applications/misc/logseq/default.nix
+++ b/pkgs/applications/misc/logseq/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchurl, appimageTools, makeWrapper, autoPatchelfHook, electron, git, curl, expat, gcc, openssl, zlib }:
+{ lib, stdenv, fetchurl, appimageTools, makeWrapper, electron, git }:
 
 stdenv.mkDerivation rec {
   pname = "logseq";
@@ -19,8 +19,7 @@ stdenv.mkDerivation rec {
   dontConfigure = true;
   dontBuild = true;
 
-  nativeBuildInputs = [ makeWrapper autoPatchelfHook ];
-  buildInputs = [ stdenv.cc.cc curl expat openssl zlib ];
+  nativeBuildInputs = [ makeWrapper ];
 
   installPhase = ''
     runHook preInstall
@@ -29,6 +28,12 @@ stdenv.mkDerivation rec {
     cp -a ${appimageContents}/{locales,resources} $out/share/${pname}
     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
+
     substituteInPlace $out/share/applications/${pname}.desktop \
       --replace Exec=Logseq Exec=${pname} \
       --replace Icon=Logseq Icon=$out/share/${pname}/resources/app/icons/logseq.png
@@ -37,8 +42,9 @@ stdenv.mkDerivation rec {
   '';
 
   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} \
-      --prefix PATH : ${lib.makeBinPath [ git ]} \
+      --set "LOCAL_GIT_DIRECTORY" ${git} \
       --add-flags $out/share/${pname}/resources/app
   '';