linux_xanmod: 5.11.14 -> 5.11.15
[NixPkgs.git] / pkgs / development / libraries / libproxy / default.nix
blobafe5b8dde132cb9e3c900eba56461033dfae8282
1 { lib, stdenv
2 , fetchFromGitHub
3 , pkg-config
4 , cmake
5 , zlib
6 , dbus
7 , networkmanager
8 , spidermonkey_68
9 , pcre
10 , gsettings-desktop-schemas
11 , glib
12 , makeWrapper
13 , python3
14 , SystemConfiguration
15 , CoreFoundation
16 , JavaScriptCore
19 stdenv.mkDerivation rec {
20   pname = "libproxy";
21   version = "0.4.17";
23   src = fetchFromGitHub {
24     owner = "libproxy";
25     repo = "libproxy";
26     rev = version;
27     sha256 = "0v8q4ln0pd5231kidpi8wpwh0chcjwcmawcki53czlpdrc09z96r";
28   };
30   outputs = [ "out" "dev" "py3" ];
32   nativeBuildInputs = [
33     pkg-config
34     cmake
35     makeWrapper
36   ];
38   buildInputs = [
39     pcre
40     python3
41     zlib
42   ] ++ (if stdenv.hostPlatform.isDarwin then [
43     SystemConfiguration
44     CoreFoundation
45     JavaScriptCore
46   ] else [
47     glib
48     spidermonkey_68
49     dbus
50     networkmanager
51   ]);
53   cmakeFlags = [
54     "-DWITH_MOZJS=ON"
55     "-DWITH_PYTHON2=OFF"
56     "-DPYTHON3_SITEPKG_DIR=${placeholder "py3"}/${python3.sitePackages}"
57   ];
59   postFixup = lib.optionalString stdenv.isLinux ''
60     # config_gnome3 uses the helper to find GNOME proxy settings
61     wrapProgram $out/libexec/pxgsettings --prefix XDG_DATA_DIRS : "${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}"
62   '';
64   doCheck = false; # fails 1 out of 10 tests
66   meta = with lib; {
67     platforms = platforms.linux ++ platforms.darwin;
68     license = licenses.lgpl21;
69     homepage = "http://libproxy.github.io/libproxy/";
70     description = "A library that provides automatic proxy configuration management";
71   };