forked from mirrors/nixpkgs
Merge pull request #177704 from SaltyKitkat/logseq_use_nixpkgs_git
logseq: make dugite use the `git` in nixpkgs
This commit is contained in:
commit
1440ce3e79
|
@ -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 {
|
stdenv.mkDerivation rec {
|
||||||
pname = "logseq";
|
pname = "logseq";
|
||||||
|
@ -19,8 +19,7 @@ stdenv.mkDerivation rec {
|
||||||
dontConfigure = true;
|
dontConfigure = true;
|
||||||
dontBuild = true;
|
dontBuild = true;
|
||||||
|
|
||||||
nativeBuildInputs = [ makeWrapper autoPatchelfHook ];
|
nativeBuildInputs = [ makeWrapper ];
|
||||||
buildInputs = [ stdenv.cc.cc curl expat openssl zlib ];
|
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
runHook preInstall
|
runHook preInstall
|
||||||
|
@ -29,6 +28,12 @@ stdenv.mkDerivation rec {
|
||||||
cp -a ${appimageContents}/{locales,resources} $out/share/${pname}
|
cp -a ${appimageContents}/{locales,resources} $out/share/${pname}
|
||||||
cp -a ${appimageContents}/Logseq.desktop $out/share/applications/${pname}.desktop
|
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 \
|
substituteInPlace $out/share/applications/${pname}.desktop \
|
||||||
--replace Exec=Logseq Exec=${pname} \
|
--replace Exec=Logseq Exec=${pname} \
|
||||||
--replace Icon=Logseq Icon=$out/share/${pname}/resources/app/icons/logseq.png
|
--replace Icon=Logseq Icon=$out/share/${pname}/resources/app/icons/logseq.png
|
||||||
|
@ -37,8 +42,9 @@ stdenv.mkDerivation rec {
|
||||||
'';
|
'';
|
||||||
|
|
||||||
postFixup = ''
|
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} \
|
makeWrapper ${electron}/bin/electron $out/bin/${pname} \
|
||||||
--prefix PATH : ${lib.makeBinPath [ git ]} \
|
--set "LOCAL_GIT_DIRECTORY" ${git} \
|
||||||
--add-flags $out/share/${pname}/resources/app
|
--add-flags $out/share/${pname}/resources/app
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue