summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/expat
diff options
context:
space:
mode:
authorVincent Laporte <Vincent.Laporte@gmail.com>2017-11-01 23:32:41 +0000
committerVincent Laporte <Vincent.Laporte@gmail.com>2017-11-03 19:44:19 +0000
commitee23541f8981ddd85109130cf471f163f1f766b1 (patch)
tree18bc54371330fd59dfb0d38b1ff4a115587e0f3c /pkgs/development/ocaml-modules/expat
parent78eaae0204f8b9fe64339f5aa2e11dac60a5f6f6 (diff)
downloadnixlib-ee23541f8981ddd85109130cf471f163f1f766b1.tar
nixlib-ee23541f8981ddd85109130cf471f163f1f766b1.tar.gz
nixlib-ee23541f8981ddd85109130cf471f163f1f766b1.tar.bz2
nixlib-ee23541f8981ddd85109130cf471f163f1f766b1.tar.lz
nixlib-ee23541f8981ddd85109130cf471f163f1f766b1.tar.xz
nixlib-ee23541f8981ddd85109130cf471f163f1f766b1.tar.zst
nixlib-ee23541f8981ddd85109130cf471f163f1f766b1.zip
ocamlPackages.ocaml_expat: 0.9.1 -> 1.0.0
Diffstat (limited to 'pkgs/development/ocaml-modules/expat')
-rw-r--r--pkgs/development/ocaml-modules/expat/0.9.nix51
-rw-r--r--pkgs/development/ocaml-modules/expat/default.nix77
2 files changed, 80 insertions, 48 deletions
diff --git a/pkgs/development/ocaml-modules/expat/0.9.nix b/pkgs/development/ocaml-modules/expat/0.9.nix
new file mode 100644
index 000000000000..5fcc317d9408
--- /dev/null
+++ b/pkgs/development/ocaml-modules/expat/0.9.nix
@@ -0,0 +1,51 @@
+{stdenv, fetchurl, ocaml, findlib, ounit, expat}:
+
+let
+  pname = "ocaml-expat";
+  testcase = fetchurl {
+    url = "http://www.w3.org/TR/1998/REC-xml-19980210.xml";
+    sha256 = "00a3gsfvlkdhmcbziqhvpvy1zmcgbcihfqwcvl6ay03zf7gvw0k1";
+  };
+
+in
+
+stdenv.mkDerivation rec {
+  name = "${pname}-${version}";
+  version = "0.9.1";
+
+  src = fetchurl {
+    url = "http://www.xs4all.nl/~mmzeeman/ocaml/${pname}-${version}.tar.gz";
+    sha256 = "16n2j3y0jc9xgqyshw9plrwqnjiz30vnpbhahmgxlidbycw8rgjz";
+  };
+
+  buildInputs = [ocaml findlib ounit expat];
+
+  createFindlibDestdir = true;
+
+  patches = [ ./unittest.patch ];
+
+  postPatch = ''
+    substituteInPlace "unittest.ml" \
+      --replace "/home/maas/xml-samples/REC-xml-19980210.xml.txt" "${testcase}"
+    substituteInPlace Makefile --replace "EXPAT_LIBDIR=/usr/local/lib" "EXPAT_LIBDIR=${expat.out}/lib" \
+      --replace "EXPAT_INCDIR=/usr/local/include" "EXPAT_INCDIR=${expat.dev}/include" \
+      --replace "gcc" "\$(CC)"
+  '';
+
+  configurePhase = "true";  	# Skip configure
+
+  buildPhase = ''
+    make all allopt
+  '';
+
+  doCheck = true;
+
+  checkTarget = "testall";
+
+  meta = {
+    homepage = http://www.xs4all.nl/~mmzeeman/ocaml/;
+    description = "An ocaml wrapper for the Expat XML parsing library";
+    license = stdenv.lib.licenses.mit;
+    maintainers = [ stdenv.lib.maintainers.roconnor ];
+  };
+}
diff --git a/pkgs/development/ocaml-modules/expat/default.nix b/pkgs/development/ocaml-modules/expat/default.nix
index 5fcc317d9408..575ca45624f3 100644
--- a/pkgs/development/ocaml-modules/expat/default.nix
+++ b/pkgs/development/ocaml-modules/expat/default.nix
@@ -1,51 +1,32 @@
-{stdenv, fetchurl, ocaml, findlib, ounit, expat}:
-
-let
-  pname = "ocaml-expat";
-  testcase = fetchurl {
-    url = "http://www.w3.org/TR/1998/REC-xml-19980210.xml";
-    sha256 = "00a3gsfvlkdhmcbziqhvpvy1zmcgbcihfqwcvl6ay03zf7gvw0k1";
-  };
-
-in
+{ stdenv, fetchFromGitHub, expat, ocaml, findlib, ounit }:
 
 stdenv.mkDerivation rec {
-  name = "${pname}-${version}";
-  version = "0.9.1";
-
-  src = fetchurl {
-    url = "http://www.xs4all.nl/~mmzeeman/ocaml/${pname}-${version}.tar.gz";
-    sha256 = "16n2j3y0jc9xgqyshw9plrwqnjiz30vnpbhahmgxlidbycw8rgjz";
-  };
-
-  buildInputs = [ocaml findlib ounit expat];
-
-  createFindlibDestdir = true;
-
-  patches = [ ./unittest.patch ];
-
-  postPatch = ''
-    substituteInPlace "unittest.ml" \
-      --replace "/home/maas/xml-samples/REC-xml-19980210.xml.txt" "${testcase}"
-    substituteInPlace Makefile --replace "EXPAT_LIBDIR=/usr/local/lib" "EXPAT_LIBDIR=${expat.out}/lib" \
-      --replace "EXPAT_INCDIR=/usr/local/include" "EXPAT_INCDIR=${expat.dev}/include" \
-      --replace "gcc" "\$(CC)"
-  '';
-
-  configurePhase = "true";  	# Skip configure
-
-  buildPhase = ''
-    make all allopt
-  '';
-
-  doCheck = true;
-
-  checkTarget = "testall";
-
-  meta = {
-    homepage = http://www.xs4all.nl/~mmzeeman/ocaml/;
-    description = "An ocaml wrapper for the Expat XML parsing library";
-    license = stdenv.lib.licenses.mit;
-    maintainers = [ stdenv.lib.maintainers.roconnor ];
-  };
+	name = "ocaml${ocaml.version}-expat-${version}";
+	version = "1.0.0";
+
+	src = fetchFromGitHub {
+		owner = "whitequark";
+		repo = "ocaml-expat";
+		rev = "v${version}";
+		sha256 = "0rb47v08ra2hhh73p3d8sl4sizqwiwc37gnkl22b23sbwbjrpbz0";
+	};
+
+	prePatch = ''
+		substituteInPlace Makefile --replace "gcc" "\$(CC)"
+	'';
+
+	buildInputs = [ ocaml findlib expat ounit ];
+
+	doCheck = !stdenv.lib.versionAtLeast ocaml.version "4.06";
+	checkTarget = "testall";
+
+	createFindlibDestdir = true;
+
+	meta = {
+		description = "OCaml wrapper for the Expat XML parsing library";
+		license = stdenv.lib.licenses.mit;
+		maintainers = [ stdenv.lib.maintainers.vbgl ];
+		inherit (src.meta) homepage;
+		inherit (ocaml.meta) platforms;
+	};
 }