otadump: init at 0.1.2 (#329129)
[NixPkgs.git] / pkgs / by-name / gp / gpclient / package.nix
bloba662c56f718af4047a61899c9121319ec0a41bbb
2   rustPlatform,
3   glib-networking,
4   gpauth,
5   makeWrapper,
6   openconnect,
7   openssl,
8   perl,
9   vpnc-scripts,
12 rustPlatform.buildRustPackage rec {
13   pname = "gpclient";
15   inherit (gpauth) version src meta;
17   buildAndTestSubdir = "apps/gpclient";
18   cargoHash = "sha256-lKfcWKOxpXEB28JajypOdyJNxLIAI8udMlaEo+6pecQ=";
20   nativeBuildInputs = [
21     perl
22     makeWrapper
23   ];
24   buildInputs = [
25     gpauth
26     openconnect
27     openssl
28     glib-networking
29   ];
31   preConfigure = ''
32     substituteInPlace crates/gpapi/src/lib.rs \
33       --replace-fail /usr/bin/gpauth ${gpauth}/bin/gpauth
34     substituteInPlace crates/common/src/vpn_utils.rs \
35       --replace-fail /usr/sbin/vpnc-script ${vpnc-scripts}/bin/vpnc-script
36   '';
38   postInstall = ''
39     mkdir -p $out/share/applications
40     cp packaging/files/usr/share/applications/gpgui.desktop $out/share/applications/gpgui.desktop
41   '';
43   preFixup = ''
44     wrapProgram "$out/bin/gpclient" \
45       --prefix GIO_EXTRA_MODULES : ${glib-networking}/lib/gio/modules
46   '';
48   postFixup = ''
49     substituteInPlace $out/share/applications/gpgui.desktop \
50       --replace-fail /usr/bin/gpclient gpclient
51   '';