about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/serf
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/serf')
-rw-r--r--nixpkgs/pkgs/development/libraries/serf/default.nix39
-rw-r--r--nixpkgs/pkgs/development/libraries/serf/scons.patch43
2 files changed, 82 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/serf/default.nix b/nixpkgs/pkgs/development/libraries/serf/default.nix
new file mode 100644
index 000000000000..2549704c1a8c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/serf/default.nix
@@ -0,0 +1,39 @@
+{ lib, stdenv, fetchurl, apr, scons, openssl, aprutil, zlib, libkrb5
+, pkg-config, libiconv }:
+
+stdenv.mkDerivation rec {
+  pname = "serf";
+  version = "1.3.9";
+
+  src = fetchurl {
+    url = "https://www.apache.org/dist/serf/${pname}-${version}.tar.bz2";
+    sha256 = "1k47gbgpp52049andr28y28nbwh9m36bbb0g8p0aka3pqlhjv72l";
+  };
+
+  nativeBuildInputs = [ pkg-config scons ];
+  buildInputs = [ apr openssl aprutil zlib libiconv ]
+    ++ lib.optional (!stdenv.isCygwin) libkrb5;
+
+  patches = [ ./scons.patch ];
+
+  prefixKey = "PREFIX=";
+
+  preConfigure = ''
+    sconsFlags+=" APR=$(echo ${apr.dev}/bin/*-config)"
+    sconsFlags+=" APU=$(echo ${aprutil.dev}/bin/*-config)"
+    sconsFlags+=" CC=$CC"
+    sconsFlags+=" OPENSSL=${openssl}"
+    sconsFlags+=" ZLIB=${zlib}"
+  '' + lib.optionalString (!stdenv.isCygwin) ''
+    sconsFlags+=" GSSAPI=${libkrb5.dev}"
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "HTTP client library based on APR";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ orivej raskin ];
+    platforms = platforms.linux ++ platforms.darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/serf/scons.patch b/nixpkgs/pkgs/development/libraries/serf/scons.patch
new file mode 100644
index 000000000000..acfece7ef5fe
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/serf/scons.patch
@@ -0,0 +1,43 @@
+diff --git a/SConstruct b/SConstruct
+index 4358a23..6ce7776 100644
+--- a/SConstruct
++++ b/SConstruct
+@@ -55,7 +55,7 @@ def RawListVariable(key, help, default):
+ # To be used to ensure a PREFIX directory is only created when installing.
+ def createPathIsDirCreateWithTarget(target):
+   def my_validator(key, val, env):
+-    build_targets = (map(str, BUILD_TARGETS))
++    build_targets = (list(map(str, BUILD_TARGETS)))
+     if target in build_targets:
+       return PathVariable.PathIsDirCreate(key, val, env)
+     else:
+@@ -155,6 +155,7 @@ if sys.platform == 'win32':
+ env = Environment(variables=opts,
+                   tools=('default', 'textfile',),
+                   CPPPATH=['.', ],
++                  ENV=os.environ,
+                   )
+ 
+ env.Append(BUILDERS = {
+@@ -163,9 +164,9 @@ env.Append(BUILDERS = {
+               suffix='.def', src_suffix='.h')
+   })
+ 
+-match = re.search('SERF_MAJOR_VERSION ([0-9]+).*'
+-                  'SERF_MINOR_VERSION ([0-9]+).*'
+-                  'SERF_PATCH_VERSION ([0-9]+)',
++match = re.search(b'SERF_MAJOR_VERSION ([0-9]+).*'
++                  b'SERF_MINOR_VERSION ([0-9]+).*'
++                  b'SERF_PATCH_VERSION ([0-9]+)',
+                   env.File('serf.h').get_contents(),
+                   re.DOTALL)
+ MAJOR, MINOR, PATCH = [int(x) for x in match.groups()]
+@@ -183,7 +184,7 @@ CALLOUT_OKAY = not (env.GetOption('clean') or env.GetOption('help'))
+ 
+ unknown = opts.UnknownVariables()
+ if unknown:
+-  print 'Warning: Used unknown variables:', ', '.join(unknown.keys())
++  print('Warning: Used unknown variables:', ', '.join(list(unknown.keys())))
+ 
+ apr = str(env['APR'])
+ apu = str(env['APU'])