gnugp: adding option for minimal build
Basically a flavour of gnugpg, which solely containts `bin/gnupg`.
This commit is contained in:
parent
9d87889b34
commit
d1270ac85b
@ -1,17 +1,17 @@
|
|||||||
{ fetchurl, fetchpatch, stdenv, pkgconfig, libgcrypt, libassuan, libksba
|
{ fetchurl, fetchpatch, stdenv, pkgconfig, libgcrypt, libassuan, libksba
|
||||||
, libgpgerror, libiconv, npth, gettext, texinfo, pcsclite, sqlite
|
, libgpgerror, libiconv, npth, gettext, texinfo, buildPackages
|
||||||
, buildPackages
|
|
||||||
|
|
||||||
# Each of the dependencies below are optional.
|
# Each of the dependencies below are optional.
|
||||||
# Gnupg can be built without them at the cost of reduced functionality.
|
# Gnupg can be built without them at the cost of reduced functionality.
|
||||||
, pinentry ? null, guiSupport ? false
|
, guiSupport ? true, enableMinimal ? false
|
||||||
, adns ? null, gnutls ? null, libusb ? null, openldap ? null
|
, adns ? null , bzip2 ? null , gnutls ? null , libusb ? null , openldap ? null
|
||||||
, readline ? null, zlib ? null, bzip2 ? null
|
, pcsclite ? null , pinentry ? null , readline ? null , sqlite ? null , zlib ?
|
||||||
|
null
|
||||||
}:
|
}:
|
||||||
|
|
||||||
with stdenv.lib;
|
with stdenv.lib;
|
||||||
|
|
||||||
assert guiSupport -> pinentry != null;
|
assert guiSupport -> pinentry != null && enableMinimal == false;
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "gnupg";
|
pname = "gnupg";
|
||||||
@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
|
|||||||
postPatch = ''
|
postPatch = ''
|
||||||
sed -i 's,hkps://hkps.pool.sks-keyservers.net,hkps://keys.openpgp.org,g' \
|
sed -i 's,hkps://hkps.pool.sks-keyservers.net,hkps://keys.openpgp.org,g' \
|
||||||
configure doc/dirmngr.texi doc/gnupg.info-1
|
configure doc/dirmngr.texi doc/gnupg.info-1
|
||||||
'' + stdenv.lib.optionalString stdenv.isLinux ''
|
'' + stdenv.lib.optionalString ( stdenv.isLinux && pcsclite != null) ''
|
||||||
sed -i 's,"libpcsclite\.so[^"]*","${stdenv.lib.getLib pcsclite}/lib/libpcsclite.so",g' scd/scdaemon.c
|
sed -i 's,"libpcsclite\.so[^"]*","${stdenv.lib.getLib pcsclite}/lib/libpcsclite.so",g' scd/scdaemon.c
|
||||||
''; #" fix Emacs syntax highlighting :-(
|
''; #" fix Emacs syntax highlighting :-(
|
||||||
|
|
||||||
@ -50,7 +50,14 @@ stdenv.mkDerivation rec {
|
|||||||
"--with-npth-prefix=${npth}"
|
"--with-npth-prefix=${npth}"
|
||||||
] ++ optional guiSupport "--with-pinentry-pgm=${pinentry}/${pinentryBinaryPath}";
|
] ++ optional guiSupport "--with-pinentry-pgm=${pinentry}/${pinentryBinaryPath}";
|
||||||
|
|
||||||
postInstall = ''
|
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 ''
|
||||||
mkdir -p $out/lib/systemd/user
|
mkdir -p $out/lib/systemd/user
|
||||||
for f in doc/examples/systemd-user/*.{service,socket} ; do
|
for f in doc/examples/systemd-user/*.{service,socket} ; do
|
||||||
substitute $f $out/lib/systemd/user/$(basename $f) \
|
substitute $f $out/lib/systemd/user/$(basename $f) \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user