voms: default to symlink $out/etc to /etc

This commit is contained in:
Shamrock Lee 2022-07-11 01:48:19 +08:00
parent 5a6722b0e1
commit f0b4a5da47

View file

@ -11,6 +11,10 @@
, gsoap
, openssl
, zlib
# Configuration overridable with .override
# If not null, the builder will
# move "$out/etc" to "$out/etc.orig" and symlink "$out/etc" to externalEtc.
, externalEtc ? "/etc"
}:
stdenv.mkDerivation rec{
@ -24,6 +28,10 @@ stdenv.mkDerivation rec{
hash = "sha256-FG4fHO2lsQ3t/ZaKT9xY+xqdQHfdtzi5ULtxLhdPnss=";
};
passthru = {
inherit externalEtc;
};
nativeBuildInputs = [
autoreconfHook
bison
@ -59,6 +67,13 @@ stdenv.mkDerivation rec{
"--with-gsoap-wsdl2h=${gsoap}/bin/wsdl2h"
];
postFixup = ''
${lib.optionalString (externalEtc != null) ''
mv "$out"/etc{,.orig}
ln -s ${lib.escapeShellArg externalEtc} "$out/etc"
''}
'';
meta = with lib; {
description = "The C/C++ VOMS server, client and APIs v2.x";
homepage = "https://italiangrid.github.io/voms/";