2021-10-08 15:17:17 +00:00
|
|
|
{ lib, stdenv, fetchurl, gnutls, openssl, libgcrypt, libgpg-error, pkg-config, gettext
|
2020-04-24 23:36:52 +00:00
|
|
|
, which
|
|
|
|
|
|
|
|
# GUI support
|
2024-01-02 11:29:13 +00:00
|
|
|
, gtk3, qt5
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
, pluginSearchPaths ? [
|
|
|
|
"/run/current-system/sw/lib/gwenhywfar/plugins"
|
|
|
|
".nix-profile/lib/gwenhywfar/plugins"
|
|
|
|
]
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2022-07-18 16:21:45 +00:00
|
|
|
inherit ((import ./sources.nix).gwenhywfar) hash releaseId version;
|
2020-04-24 23:36:52 +00:00
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
pname = "gwenhywfar";
|
|
|
|
inherit version;
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://www.aquamaniac.de/rdm/attachments/download/${releaseId}/${pname}-${version}.tar.gz";
|
2022-07-18 16:21:45 +00:00
|
|
|
inherit hash;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--with-openssl-includes=${openssl.dev}/include"
|
2022-04-03 18:54:34 +00:00
|
|
|
"--with-openssl-libs=${lib.getLib openssl}/lib"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
preConfigure = ''
|
2024-01-02 11:29:13 +00:00
|
|
|
configureFlagsArray+=("--with-guis=gtk3 qt5")
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
postPatch = let
|
|
|
|
isRelative = path: builtins.substring 0 1 path != "/";
|
|
|
|
mkSearchPath = path: ''
|
|
|
|
p; g; s,\<PLUGINDIR\>,"${path}",g;
|
2021-02-05 17:12:51 +00:00
|
|
|
'' + lib.optionalString (isRelative path) ''
|
2020-04-24 23:36:52 +00:00
|
|
|
s/AddPath(\(.*\));/AddRelPath(\1, GWEN_PathManager_RelModeHome);/g
|
|
|
|
'';
|
|
|
|
|
|
|
|
in ''
|
|
|
|
sed -i -e '/GWEN_PathManager_DefinePath.*GWEN_PM_PLUGINDIR/,/^#endif/ {
|
|
|
|
/^#if/,/^#endif/ {
|
|
|
|
H; /^#endif/ {
|
2021-02-05 17:12:51 +00:00
|
|
|
${lib.concatMapStrings mkSearchPath pluginSearchPaths}
|
2020-04-24 23:36:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}' 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
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config gettext which ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
buildInputs = [ gtk3 qt5.qtbase gnutls openssl libgcrypt libgpg-error ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-19 19:06:45 +00:00
|
|
|
dontWrapQtApps = true;
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "OS abstraction functions used by aqbanking and related tools";
|
2022-02-10 20:34:41 +00:00
|
|
|
homepage = "https://www.aquamaniac.de/rdm/projects/gwenhywfar";
|
|
|
|
license = licenses.lgpl21Plus;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ goibhniu ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|