nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib, stdenv
2, fetchFromGitHub
3, pkg-config
4, cmake
5, zlib
6, dbus
7, networkmanager
8, enableJavaScript ? stdenv.isDarwin || lib.meta.availableOn stdenv.hostPlatform spidermonkey_78
9, spidermonkey_78
10, pcre
11, gsettings-desktop-schemas
12, glib
13, makeWrapper
14, python3
15, SystemConfiguration
16, CoreFoundation
17, JavaScriptCore
18}:
19
20stdenv.mkDerivation rec {
21 pname = "libproxy";
22 version = "0.4.17";
23
24 src = fetchFromGitHub {
25 owner = "libproxy";
26 repo = "libproxy";
27 rev = version;
28 sha256 = "0v8q4ln0pd5231kidpi8wpwh0chcjwcmawcki53czlpdrc09z96r";
29 };
30
31 outputs = [ "out" "dev" "py3" ];
32
33 nativeBuildInputs = [
34 pkg-config
35 cmake
36 makeWrapper
37 ];
38
39 buildInputs = [
40 pcre
41 python3
42 zlib
43 ] ++ lib.optionals enableJavaScript [
44 (if stdenv.hostPlatform.isDarwin then JavaScriptCore else spidermonkey_78)
45 ] ++ (if stdenv.hostPlatform.isDarwin then [
46 SystemConfiguration
47 CoreFoundation
48 ] else [
49 glib
50 dbus
51 networkmanager
52 ]);
53
54 cmakeFlags = [
55 "-DWITH_PYTHON2=OFF"
56 "-DPYTHON3_SITEPKG_DIR=${placeholder "py3"}/${python3.sitePackages}"
57 ] ++ lib.optional (enableJavaScript && !stdenv.hostPlatform.isDarwin) "-DWITH_MOZJS=ON";
58
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 '';
63
64 doCheck = false; # fails 1 out of 10 tests
65
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 };
72}