diff --git a/pkgs/development/libraries/aqbanking/default.nix b/pkgs/development/libraries/aqbanking/default.nix index ee985e70941..7fd511f4272 100644 --- a/pkgs/development/libraries/aqbanking/default.nix +++ b/pkgs/development/libraries/aqbanking/default.nix @@ -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"; diff --git a/pkgs/development/libraries/gwenhywfar/default.nix b/pkgs/development/libraries/gwenhywfar/default.nix index 8cec26139de..8fb96e078ac 100644 --- a/pkgs/development/libraries/gwenhywfar/default.nix +++ b/pkgs/development/libraries/gwenhywfar/default.nix @@ -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,\,"${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 ];