3
0
Fork 0
forked from mirrors/nixpkgs

gwenhywfar: Unify plugin directories

Having something like $out/lib/gwenhywfar/plugins/60 when on Nix is a
bit pointless, because we won't have something like a central plugin
directory which could contain plugins for older library versions.

Another reason to strip the effective shared object version is that we
really want to avoid the need to track and update the SO version on
every single update.

This makes it way easier to add support for libchipcard and/or other
related packages/plugins.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Cc: @cillianderoiste, @urkud
This commit is contained in:
aszlig 2016-06-02 16:29:16 +02:00
parent e5d6acb585
commit 468f931f87
No known key found for this signature in database
GPG key ID: D0EBD0EC8C2DC961
2 changed files with 34 additions and 2 deletions

View file

@ -16,11 +16,17 @@ stdenv.mkDerivation rec {
sha256 = "1x0isvpk43rq2zlyyb9p0kgjmqv7yq07vgkiprw3f5sjkykvxw6d";
};
postPatch = ''
sed -i -e '/^aqbanking_plugindir=/ {
c aqbanking_plugindir="\''${libdir}/gwenhywfar/plugins"
}' configure
'';
buildInputs = [ gmp gwenhywfar libtool libxml2 libxslt xmlsec zlib ];
nativeBuildInputs = [ pkgconfig ];
configureFlags = "--with-gwen-dir=${gwenhywfar}";
configureFlags = [ "--with-gwen-dir=${gwenhywfar}" ];
meta = with stdenv.lib; {
description = "An interface to banking tasks, file formats and country information";

View file

@ -2,7 +2,6 @@
stdenv.mkDerivation rec {
name = "gwenhywfar-${version}";
version = "4.15.3";
src = let
@ -15,6 +14,33 @@ stdenv.mkDerivation rec {
sha256 = "0fp67s932x66xfljb26zbrn8ambbc5y5c3hllr6l284nr63qf3ka";
};
postPatch = let
pluginSearchPaths = [
"/run/current-system/sw/lib/gwenhywfar/plugins"
".nix-profile/lib/gwenhywfar/plugins"
];
isRelative = path: builtins.substring 0 1 path != "/";
mkSearchPath = path: ''
p; g; s,\<PLUGINDIR\>,"${path}",g;
'' + stdenv.lib.optionalString (isRelative path) ''
s/AddPath(\(.*\));/AddRelPath(\1, GWEN_PathManager_RelModeHome);/g
'';
in ''
sed -i -e '/GWEN_PathManager_DefinePath.*GWEN_PM_PLUGINDIR/,/^#endif/ {
/^#if/,/^#endif/ {
H; /^#endif/ {
${stdenv.lib.concatMapStrings mkSearchPath pluginSearchPaths}
}
}
}' src/gwenhywfar.c
# Strip off the effective SO version from the path so that for example
# "lib/gwenhywfar/plugins/60" becomes just "lib/gwenhywfar/plugins".
sed -i -e '/^gwenhywfar_plugindir=/s,/\''${GWENHYWFAR_SO_EFFECTIVE},,' \
configure
'';
propagatedBuildInputs = [ gnutls libgcrypt ];
buildInputs = [ gtk qt4 ];