diff options
author | Benjamin Staffin <benley@gmail.com> | 2018-07-22 15:20:37 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-22 15:20:37 -0400 |
commit | 815ae70556075b6ebb0f6456e4a99ea854c7b966 (patch) | |
tree | 10568233981f53b595a27a9b3970f5974716b97b /pkgs/applications/version-management/git-and-tools | |
parent | 4ea202d328d697c4453784c1faedf165b1591c3c (diff) | |
download | nixlib-815ae70556075b6ebb0f6456e4a99ea854c7b966.tar nixlib-815ae70556075b6ebb0f6456e4a99ea854c7b966.tar.gz nixlib-815ae70556075b6ebb0f6456e4a99ea854c7b966.tar.bz2 nixlib-815ae70556075b6ebb0f6456e4a99ea854c7b966.tar.lz nixlib-815ae70556075b6ebb0f6456e4a99ea854c7b966.tar.xz nixlib-815ae70556075b6ebb0f6456e4a99ea854c7b966.tar.zst nixlib-815ae70556075b6ebb0f6456e4a99ea854c7b966.zip |
gitFull: build libsecret credential helper (#43616)
...except on Darwin, where it won't be useful.
Diffstat (limited to 'pkgs/applications/version-management/git-and-tools')
-rw-r--r-- | pkgs/applications/version-management/git-and-tools/default.nix | 1 | ||||
-rw-r--r-- | pkgs/applications/version-management/git-and-tools/git/default.nix | 34 |
2 files changed, 21 insertions, 14 deletions
diff --git a/pkgs/applications/version-management/git-and-tools/default.nix b/pkgs/applications/version-management/git-and-tools/default.nix index c82a8d8ecc52..513ff4a8ecd5 100644 --- a/pkgs/applications/version-management/git-and-tools/default.nix +++ b/pkgs/applications/version-management/git-and-tools/default.nix @@ -38,6 +38,7 @@ let svnSupport = true; guiSupport = true; sendEmailSupport = !stdenv.isDarwin; + withLibsecret = !stdenv.isDarwin; }; # Git with SVN support, but without GUI. diff --git a/pkgs/applications/version-management/git-and-tools/git/default.nix b/pkgs/applications/version-management/git-and-tools/git/default.nix index 522a6fcd6a12..9ff0f4e6e9b9 100644 --- a/pkgs/applications/version-management/git-and-tools/git/default.nix +++ b/pkgs/applications/version-management/git-and-tools/git/default.nix @@ -12,6 +12,8 @@ , withpcre2 ? true , sendEmailSupport , darwin +, withLibsecret ? false +, pkgconfig, glib, libsecret }: assert sendEmailSupport -> perlSupport; @@ -64,7 +66,8 @@ stdenv.mkDerivation { ++ stdenv.lib.optionals perlSupport [ perl ] ++ stdenv.lib.optionals guiSupport [tcl tk] ++ stdenv.lib.optionals withpcre2 [ pcre2 ] - ++ stdenv.lib.optionals stdenv.isDarwin [ darwin.Security ]; + ++ stdenv.lib.optionals stdenv.isDarwin [ darwin.Security ] + ++ stdenv.lib.optionals withLibsecret [ pkgconfig glib libsecret ]; # required to support pthread_cancel() NIX_LDFLAGS = stdenv.lib.optionalString (!stdenv.cc.isClang) "-lgcc_s" @@ -90,12 +93,14 @@ stdenv.mkDerivation { ++ stdenv.lib.optionals stdenv.hostPlatform.isMusl ["NO_SYS_POLL_H=1" "NO_GETTEXT=YesPlease"] ++ stdenv.lib.optional withpcre2 "USE_LIBPCRE2=1"; - # build git-credential-osxkeychain if darwin - postBuild = stdenv.lib.optionalString stdenv.isDarwin '' - pushd $PWD/contrib/credential/osxkeychain/ - make - popd - ''; + + postBuild = '' + make -C contrib/subtree + '' + (stdenv.lib.optionalString stdenv.isDarwin '' + make -C contrib/credential/osxkeychain + '') + (stdenv.lib.optionalString withLibsecret '' + make -C contrib/credential/libsecret + ''); ## Install @@ -105,11 +110,15 @@ stdenv.mkDerivation { installFlags = "NO_INSTALL_HARDLINKS=1"; - preInstall = stdenv.lib.optionalString stdenv.isDarwin '' + preInstall = (stdenv.lib.optionalString stdenv.isDarwin '' mkdir -p $out/bin - cp -a $PWD/contrib/credential/osxkeychain/git-credential-osxkeychain $out/bin + ln -s $out/share/git/contrib/credential/osxkeychain/git-credential-osxkeychain $out/bin/ rm -f $PWD/contrib/credential/osxkeychain/git-credential-osxkeychain.o - ''; + '') + (stdenv.lib.optionalString withLibsecret '' + mkdir -p $out/bin + ln -s $out/share/git/contrib/credential/libsecret/git-credential-libsecret $out/bin/ + rm -f $PWD/contrib/credential/libsecret/git-credential-libsecret.o + ''); postInstall = '' @@ -118,10 +127,7 @@ stdenv.mkDerivation { } # Install git-subtree. - pushd contrib/subtree - make - make install ${stdenv.lib.optionalString withManual "install-doc"} - popd + make -C contrib/subtree install ${stdenv.lib.optionalString withManual "install-doc"} rm -rf contrib/subtree # Install contrib stuff. |