sequoia-chameleon-gnupg: add wrappers to mimic gpg (#507547)
This commit is contained in:
+3
@@ -0,0 +1,3 @@
|
||||
#!@execlineb@ -s0
|
||||
pipeline -w { @sed@ -e "s|^gpg:OpenPGP:.*/bin/gpg$|gpg:OpenPGP:@out@/bin/gpg|" }
|
||||
@gpgconf@ $@
|
||||
@@ -1,12 +1,15 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
rustPlatform,
|
||||
fetchFromGitLab,
|
||||
pkg-config,
|
||||
makeWrapper,
|
||||
nettle,
|
||||
openssl,
|
||||
sqlite,
|
||||
gnupg,
|
||||
execline,
|
||||
gnused,
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
@@ -25,6 +28,7 @@ rustPlatform.buildRustPackage rec {
|
||||
nativeBuildInputs = [
|
||||
rustPlatform.bindgenHook
|
||||
pkg-config
|
||||
makeWrapper
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
@@ -33,6 +37,26 @@ rustPlatform.buildRustPackage rec {
|
||||
sqlite
|
||||
];
|
||||
|
||||
postInstall = ''
|
||||
# Wrap to find gpg-agent from GnuPG.
|
||||
makeWrapper $out/bin/gpg-sq $out/bin/gpg \
|
||||
--suffix PATH : ${lib.makeBinPath [ gnupg ]}
|
||||
makeWrapper $out/bin/gpgv-sq $out/bin/gpgv \
|
||||
--suffix PATH : ${lib.makeBinPath [ gnupg ]}
|
||||
|
||||
# Modify the output of gpgconf to resolve gpg to this package.
|
||||
substitute ${./gpgconf.el} $out/bin/gpgconf \
|
||||
--subst-var-by execlineb ${lib.getExe' execline "execlineb"} \
|
||||
--subst-var-by gpgconf ${lib.getExe' gnupg "gpgconf"} \
|
||||
--subst-var-by sed ${lib.getExe' gnused "sed"} \
|
||||
--subst-var out
|
||||
|
||||
# Additional wrappers.
|
||||
chmod +x $out/bin/gpgconf
|
||||
ln -s gpg $out/bin/gpg2
|
||||
ln -s ${lib.getExe' gnupg "gpg"} $out/bin/gpg-g10code
|
||||
'';
|
||||
|
||||
# gpgconf: error creating socket directory
|
||||
doCheck = false;
|
||||
|
||||
|
||||
@@ -108,14 +108,12 @@ stdenv.mkDerivation rec {
|
||||
cp "contrib/dmenu/passmenu" "$out/bin/"
|
||||
'';
|
||||
|
||||
wrapperPath = lib.makeBinPath (
|
||||
wrapperPathPrefix = lib.makeBinPath (
|
||||
[
|
||||
coreutils
|
||||
findutils
|
||||
getopt
|
||||
git
|
||||
gnugrep
|
||||
gnupg
|
||||
gnused
|
||||
tree
|
||||
which
|
||||
@@ -136,6 +134,11 @@ stdenv.mkDerivation rec {
|
||||
]
|
||||
);
|
||||
|
||||
wrapperPathSuffix = lib.makeBinPath [
|
||||
git
|
||||
gnupg
|
||||
];
|
||||
|
||||
postFixup = ''
|
||||
# Fix program name in --help
|
||||
substituteInPlace $out/bin/pass \
|
||||
@@ -143,13 +146,15 @@ stdenv.mkDerivation rec {
|
||||
|
||||
# Ensure all dependencies are in PATH
|
||||
wrapProgram $out/bin/pass \
|
||||
--prefix PATH : "${wrapperPath}"
|
||||
--prefix PATH : "${wrapperPathPrefix}" \
|
||||
--suffix PATH : "${wrapperPathSuffix}"
|
||||
''
|
||||
+ lib.optionalString dmenuSupport ''
|
||||
# We just wrap passmenu with the same PATH as pass. It doesn't
|
||||
# need all the tools in there but it doesn't hurt either.
|
||||
wrapProgram $out/bin/passmenu \
|
||||
--prefix PATH : "$out/bin:${wrapperPath}"
|
||||
--prefix PATH : "$out/bin:${wrapperPathPrefix}" \
|
||||
--suffix PATH : "${wrapperPathSuffix}"
|
||||
'';
|
||||
|
||||
# Turn "check" into "installcheck", since we want to test our pass,
|
||||
|
||||
Reference in New Issue
Block a user