nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 rustPlatform,
4 glib-networking,
5 stdenv,
6 gpauth,
7 makeWrapper,
8 autoconf,
9 automake,
10 libtool,
11 openssl,
12 perl,
13 pkg-config,
14 vpnc-scripts,
15 glib,
16 pango,
17 cairo,
18 atk,
19 gtk3,
20 libxml2,
21 p11-kit,
22 lz4,
23 gnutls,
24}:
25
26rustPlatform.buildRustPackage {
27 pname = "gpclient";
28
29 inherit (gpauth)
30 src
31 version
32 cargoHash
33 meta
34 ;
35
36 buildAndTestSubdir = "apps/gpclient";
37
38 nativeBuildInputs = [
39 perl
40 makeWrapper
41 pkg-config
42
43 # used to build vendored openconnect
44 autoconf
45 automake
46 libtool
47 ];
48 buildInputs = [
49 gpauth
50 openssl
51 glib-networking
52 glib
53 pango
54 cairo
55 atk
56 gtk3
57
58 # used for vendored openconnect
59 libxml2
60 lz4
61 p11-kit
62 gnutls
63 ];
64
65 postPatch = ''
66 substituteInPlace crates/common/src/constants.rs \
67 --replace-fail /usr/bin/gpauth ${gpauth}/bin/gpauth
68 substituteInPlace crates/openconnect/src/vpn_utils.rs \
69 --replace-fail /usr/sbin/vpnc-script ${vpnc-scripts}/bin/vpnc-script
70 substituteInPlace packaging/files/usr/share/applications/gpgui.desktop \
71 --replace-fail /usr/bin/gpclient gpclient
72 '';
73
74 postInstall = lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
75 mkdir -p $out/share/applications
76 cp packaging/files/usr/share/applications/gpgui.desktop $out/share/applications/gpgui.desktop
77 '';
78
79 preFixup = ''
80 wrapProgram "$out/bin/gpclient" \
81 --prefix GIO_EXTRA_MODULES : ${glib-networking}/lib/gio/modules
82 '';
83}