about summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/seq
diff options
context:
space:
mode:
authorThéo Zimmermann <theo.zimmermann@univ-paris-diderot.fr>2019-04-19 14:54:27 +0200
committerVincent Laporte <vbgl@users.noreply.github.com>2019-05-04 13:55:10 +0200
commit10d7bfedaeb72325b5628678c056487319aae931 (patch)
treee20491c18477fbec5e1288853dfa6a31fc503542 /pkgs/development/ocaml-modules/seq
parent8bc70c937b3e28a28366ff3605e5cf293faf1e20 (diff)
downloadnixlib-10d7bfedaeb72325b5628678c056487319aae931.tar
nixlib-10d7bfedaeb72325b5628678c056487319aae931.tar.gz
nixlib-10d7bfedaeb72325b5628678c056487319aae931.tar.bz2
nixlib-10d7bfedaeb72325b5628678c056487319aae931.tar.lz
nixlib-10d7bfedaeb72325b5628678c056487319aae931.tar.xz
nixlib-10d7bfedaeb72325b5628678c056487319aae931.tar.zst
nixlib-10d7bfedaeb72325b5628678c056487319aae931.zip
ocaml-ng.ocamlPackages_4_07.seq: dummy package with just a META file
Imitate opam which installs the real seq package only for OCaml < 4.07 and only a META file for OCaml >= 4.07.
Diffstat (limited to 'pkgs/development/ocaml-modules/seq')
-rw-r--r--pkgs/development/ocaml-modules/seq/default.nix39
-rw-r--r--pkgs/development/ocaml-modules/seq/src-base/META4
2 files changed, 32 insertions, 11 deletions
diff --git a/pkgs/development/ocaml-modules/seq/default.nix b/pkgs/development/ocaml-modules/seq/default.nix
index f4918b420c40..7a50d1517db8 100644
--- a/pkgs/development/ocaml-modules/seq/default.nix
+++ b/pkgs/development/ocaml-modules/seq/default.nix
@@ -1,13 +1,22 @@
 { stdenv, fetchFromGitHub, ocaml, findlib, ocamlbuild }:
 
-stdenv.mkDerivation rec {
+stdenv.mkDerivation ({
   version = "0.1";
-  name = "ocaml${ocaml.version}-seq-${version}";
+  name = "ocaml${ocaml.version}-seq-0.1";
+
+  meta = {
+    license = stdenv.lib.licenses.lgpl21;
+    maintainers = [ stdenv.lib.maintainers.vbgl ];
+    homepage = "https://github.com/c-cube/seq";
+    inherit (ocaml.meta) platforms;
+  };
+
+} // (if stdenv.lib.versionOlder ocaml.version "4.07" then {
 
   src = fetchFromGitHub {
     owner = "c-cube";
     repo = "seq";
-    rev = version;
+    rev = "0.1";
     sha256 = "1cjpsc7q76yfgq9iyvswxgic4kfq2vcqdlmxjdjgd4lx87zvcwrv";
   };
 
@@ -15,11 +24,19 @@ stdenv.mkDerivation rec {
 
   createFindlibDestdir = true;
 
-  meta = {
-    description = "Compatibility package for OCaml’s standard iterator type starting from 4.07";
-    license = stdenv.lib.licenses.lgpl21;
-    maintainers = [ stdenv.lib.maintainers.vbgl ];
-    inherit (src.meta) homepage;
-    inherit (ocaml.meta) platforms;
-  };
-}
+  meta.description = "Compatibility package for OCaml’s standard iterator type starting from 4.07";
+
+} else {
+
+  src = ./src-base;
+
+  dontBuild = true;
+
+  installPhase = ''
+    mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib/seq
+    cp META $out/lib/ocaml/${ocaml.version}/site-lib/seq
+  '';
+
+  meta.description = "dummy backward-compatibility package for iterators";
+
+}))
diff --git a/pkgs/development/ocaml-modules/seq/src-base/META b/pkgs/development/ocaml-modules/seq/src-base/META
new file mode 100644
index 000000000000..06b95eff3f8d
--- /dev/null
+++ b/pkgs/development/ocaml-modules/seq/src-base/META
@@ -0,0 +1,4 @@
+name="seq"
+version="[distributed with OCaml 4.07 or above]"
+description="dummy backward-compatibility package for iterators"
+requires=""