gnupg: format with nixfmt
This commit is contained in:
@@ -1,12 +1,33 @@
|
||||
{ lib, stdenv, fetchurl, buildPackages
|
||||
, pkg-config, texinfo
|
||||
, gettext, libassuan, libgcrypt, libgpg-error, libiconv, libksba, npth
|
||||
, adns, bzip2, gnutls, libusb1, openldap, readline, sqlite, zlib
|
||||
, enableMinimal ? false
|
||||
, withPcsc ? !enableMinimal, pcsclite
|
||||
, guiSupport ? stdenv.hostPlatform.isDarwin, pinentry
|
||||
, withTpm2Tss ? !stdenv.hostPlatform.isDarwin && !enableMinimal, tpm2-tss
|
||||
, nixosTests
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
fetchurl,
|
||||
buildPackages,
|
||||
pkg-config,
|
||||
texinfo,
|
||||
gettext,
|
||||
libassuan,
|
||||
libgcrypt,
|
||||
libgpg-error,
|
||||
libiconv,
|
||||
libksba,
|
||||
npth,
|
||||
adns,
|
||||
bzip2,
|
||||
gnutls,
|
||||
libusb1,
|
||||
openldap,
|
||||
readline,
|
||||
sqlite,
|
||||
zlib,
|
||||
enableMinimal ? false,
|
||||
withPcsc ? !enableMinimal,
|
||||
pcsclite,
|
||||
guiSupport ? stdenv.hostPlatform.isDarwin,
|
||||
pinentry,
|
||||
withTpm2Tss ? !stdenv.hostPlatform.isDarwin && !enableMinimal,
|
||||
tpm2-tss,
|
||||
nixosTests,
|
||||
}:
|
||||
|
||||
assert guiSupport -> !enableMinimal;
|
||||
@@ -21,12 +42,31 @@ stdenv.mkDerivation rec {
|
||||
};
|
||||
|
||||
depsBuildBuild = [ buildPackages.stdenv.cc ];
|
||||
nativeBuildInputs = [ pkg-config texinfo ];
|
||||
buildInputs = [
|
||||
gettext libassuan libgcrypt libgpg-error libiconv libksba npth
|
||||
] ++ lib.optionals (!enableMinimal) [
|
||||
adns bzip2 gnutls libusb1 openldap readline sqlite zlib
|
||||
] ++ lib.optionals withTpm2Tss [ tpm2-tss ];
|
||||
nativeBuildInputs = [
|
||||
pkg-config
|
||||
texinfo
|
||||
];
|
||||
buildInputs =
|
||||
[
|
||||
gettext
|
||||
libassuan
|
||||
libgcrypt
|
||||
libgpg-error
|
||||
libiconv
|
||||
libksba
|
||||
npth
|
||||
]
|
||||
++ lib.optionals (!enableMinimal) [
|
||||
adns
|
||||
bzip2
|
||||
gnutls
|
||||
libusb1
|
||||
openldap
|
||||
readline
|
||||
sqlite
|
||||
zlib
|
||||
]
|
||||
++ lib.optionals withTpm2Tss [ tpm2-tss ];
|
||||
|
||||
patches = [
|
||||
./fix-libusb-include-path.patch
|
||||
@@ -38,46 +78,54 @@ stdenv.mkDerivation rec {
|
||||
./v3-0001-Disallow-compressed-signatures-and-certificates.patch
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
sed -i 's,\(hkps\|https\)://keyserver.ubuntu.com,hkps://keys.openpgp.org,g' configure configure.ac doc/dirmngr.texi doc/gnupg.info-1
|
||||
'' + lib.optionalString (stdenv.hostPlatform.isLinux && withPcsc) ''
|
||||
postPatch =
|
||||
''
|
||||
sed -i 's,\(hkps\|https\)://keyserver.ubuntu.com,hkps://keys.openpgp.org,g' configure configure.ac doc/dirmngr.texi doc/gnupg.info-1
|
||||
''
|
||||
+ lib.optionalString (stdenv.hostPlatform.isLinux && withPcsc) ''
|
||||
sed -i 's,"libpcsclite\.so[^"]*","${lib.getLib pcsclite}/lib/libpcsclite.so",g' scd/scdaemon.c
|
||||
'';
|
||||
|
||||
configureFlags = [
|
||||
"--sysconfdir=/etc"
|
||||
"--with-libgpg-error-prefix=${libgpg-error.dev}"
|
||||
"--with-libgcrypt-prefix=${libgcrypt.dev}"
|
||||
"--with-libassuan-prefix=${libassuan.dev}"
|
||||
"--with-ksba-prefix=${libksba.dev}"
|
||||
"GPGRT_CONFIG=${lib.getDev libgpg-error}/bin/gpgrt-config"
|
||||
]
|
||||
++ lib.optional guiSupport "--with-pinentry-pgm=${pinentry}/${pinentry.binaryPath or "bin/pinentry"}"
|
||||
++ lib.optional withTpm2Tss "--with-tss=intel"
|
||||
++ lib.optional stdenv.hostPlatform.isDarwin "--disable-ccid-driver";
|
||||
configureFlags =
|
||||
[
|
||||
"--sysconfdir=/etc"
|
||||
"--with-libgpg-error-prefix=${libgpg-error.dev}"
|
||||
"--with-libgcrypt-prefix=${libgcrypt.dev}"
|
||||
"--with-libassuan-prefix=${libassuan.dev}"
|
||||
"--with-ksba-prefix=${libksba.dev}"
|
||||
"GPGRT_CONFIG=${lib.getDev libgpg-error}/bin/gpgrt-config"
|
||||
]
|
||||
++ lib.optional guiSupport "--with-pinentry-pgm=${pinentry}/${
|
||||
pinentry.binaryPath or "bin/pinentry"
|
||||
}"
|
||||
++ lib.optional withTpm2Tss "--with-tss=intel"
|
||||
++ lib.optional stdenv.hostPlatform.isDarwin "--disable-ccid-driver";
|
||||
|
||||
postInstall = if enableMinimal
|
||||
then ''
|
||||
rm -r $out/{libexec,sbin,share}
|
||||
for f in $(find $out/bin -type f -not -name gpg)
|
||||
do
|
||||
rm $f
|
||||
done
|
||||
'' else ''
|
||||
# add gpg2 symlink to make sure git does not break when signing commits
|
||||
ln -s $out/bin/gpg $out/bin/gpg2
|
||||
postInstall =
|
||||
if enableMinimal then
|
||||
''
|
||||
rm -r $out/{libexec,sbin,share}
|
||||
for f in $(find $out/bin -type f -not -name gpg)
|
||||
do
|
||||
rm $f
|
||||
done
|
||||
''
|
||||
else
|
||||
''
|
||||
# add gpg2 symlink to make sure git does not break when signing commits
|
||||
ln -s $out/bin/gpg $out/bin/gpg2
|
||||
|
||||
# Make libexec tools available in PATH
|
||||
for f in $out/libexec/; do
|
||||
if [[ "$(basename $f)" == "gpg-wks-client" ]]; then continue; fi
|
||||
ln -s $f $out/bin/$(basename $f)
|
||||
done
|
||||
# Make libexec tools available in PATH
|
||||
for f in $out/libexec/; do
|
||||
if [[ "$(basename $f)" == "gpg-wks-client" ]]; then continue; fi
|
||||
ln -s $f $out/bin/$(basename $f)
|
||||
done
|
||||
|
||||
for f in $out/libexec/; do
|
||||
if [[ "$(basename $f)" == "gpg-wks-client" ]]; then continue; fi
|
||||
ln -s $f $out/bin/$(basename $f)
|
||||
done
|
||||
'';
|
||||
for f in $out/libexec/; do
|
||||
if [[ "$(basename $f)" == "gpg-wks-client" ]]; then continue; fi
|
||||
ln -s $f $out/bin/$(basename $f)
|
||||
done
|
||||
'';
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
@@ -99,7 +147,10 @@ stdenv.mkDerivation rec {
|
||||
frontend applications and libraries are available. Version 2 of GnuPG
|
||||
also provides support for S/MIME.
|
||||
'';
|
||||
maintainers = with maintainers; [ fpletz sgo ];
|
||||
maintainers = with maintainers; [
|
||||
fpletz
|
||||
sgo
|
||||
];
|
||||
platforms = platforms.all;
|
||||
mainProgram = "gpg";
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user