about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/libjson
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/libjson')
-rw-r--r--nixpkgs/pkgs/development/libraries/libjson/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/libjson/install-fix.patch12
2 files changed, 40 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/libjson/default.nix b/nixpkgs/pkgs/development/libraries/libjson/default.nix
new file mode 100644
index 000000000000..ba92bdd51655
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libjson/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, fetchurl, unzip }:
+let
+  version = "7.6.1";
+in stdenv.mkDerivation rec {
+  pname = "libjson";
+  inherit version;
+  src = fetchurl {
+    url = "mirror://sourceforge/libjson/libjson_${version}.zip";
+    sha256 = "0xkk5qc7kjcdwz9l04kmiz1nhmi7iszl3k165phf53h3a4wpl9h7";
+  };
+  patches = [ ./install-fix.patch ];
+  buildInputs = [ unzip ];
+  makeFlags = [ "prefix=$(out)" ];
+  preInstall = "mkdir -p $out/lib";
+
+  meta = with stdenv.lib; {
+    homepage = http://libjson.sourceforge.net/;
+    description = "A JSON reader and writer";
+    longDescription = ''
+      A JSON reader and writer which is super-efficient and
+      usually runs circles around other JSON libraries.
+      It's highly customizable to optimize for your particular project, and
+      very lightweight. For Windows, OSX, or Linux. Works in any language.
+    '';
+    platforms = platforms.unix;
+    license = licenses.bsd2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libjson/install-fix.patch b/nixpkgs/pkgs/development/libraries/libjson/install-fix.patch
new file mode 100644
index 000000000000..f074c8ba3aa5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libjson/install-fix.patch
@@ -0,0 +1,12 @@
+diff -Naur libjson-orig/makefile libjson/makefile
+--- libjson-orig/makefile	2012-05-30 05:15:42.000000000 -0400
++++ libjson/makefile	2013-08-15 09:17:41.154245534 -0400
+@@ -266,7 +266,7 @@
+ 	cp -r ./$(srcdir)/JSONDefs $(include_path)/$(libname_hdr)/$(srcdir)
+ 	chmod -R a+r $(include_path)/$(libname_hdr)
+ 	find  $(include_path)/$(libname_hdr) -type d -exec chmod a+x {} \;
+-	cp -rv $(srcdir)/Dependencies/ $(include_path)/$(libname_hdr)/$(srcdir)
++	cp -rv $(srcdir)/../Dependencies/ $(include_path)/$(libname_hdr)/$(srcdir)/..
+ 	@echo "Install header files: Done."
+ 
+ clean: banner