diff options
author | Mx Kookie <kookie@spacekookie.de> | 2020-10-31 19:35:09 +0100 |
---|---|---|
committer | Mx Kookie <kookie@spacekookie.de> | 2020-10-31 19:35:09 +0100 |
commit | c4625b175f8200f643fd6e11010932ea44c78433 (patch) | |
tree | bce3f89888c8ac3991fa5569a878a9eab6801ccc /infra/libkookie/nixpkgs/pkgs/development/ocaml-modules/optcomp | |
parent | 49f735974dd103039ddc4cb576bb76555164a9e7 (diff) | |
parent | d661aa56a8843e991261510c1bb28fdc2f6975ae (diff) |
Add 'infra/libkookie/' from commit 'd661aa56a8843e991261510c1bb28fdc2f6975ae'
git-subtree-dir: infra/libkookie
git-subtree-mainline: 49f735974dd103039ddc4cb576bb76555164a9e7
git-subtree-split: d661aa56a8843e991261510c1bb28fdc2f6975ae
Diffstat (limited to 'infra/libkookie/nixpkgs/pkgs/development/ocaml-modules/optcomp')
-rw-r--r-- | infra/libkookie/nixpkgs/pkgs/development/ocaml-modules/optcomp/META | 12 | ||||
-rw-r--r-- | infra/libkookie/nixpkgs/pkgs/development/ocaml-modules/optcomp/default.nix | 47 |
2 files changed, 59 insertions, 0 deletions
diff --git a/infra/libkookie/nixpkgs/pkgs/development/ocaml-modules/optcomp/META b/infra/libkookie/nixpkgs/pkgs/development/ocaml-modules/optcomp/META new file mode 100644 index 000000000000..8a942288f752 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/development/ocaml-modules/optcomp/META @@ -0,0 +1,12 @@ +# OASIS_START +# DO NOT EDIT (digest: ec844fa3189acb2a866b89a69d111ba4) +version = "1.6" +description = "Optional compilation with cpp-like directives" +requires = "camlp4" +archive(syntax, preprocessor) = "optcomp.cma" +archive(syntax, toploop) = "optcomp.cma" +archive(syntax, preprocessor, native) = "optcomp.cmxa" +archive(syntax, preprocessor, native, plugin) = "optcomp.cmxs" +exists_if = "optcomp.cma" +# OASIS_STOP + diff --git a/infra/libkookie/nixpkgs/pkgs/development/ocaml-modules/optcomp/default.nix b/infra/libkookie/nixpkgs/pkgs/development/ocaml-modules/optcomp/default.nix new file mode 100644 index 000000000000..c177ef52e151 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/development/ocaml-modules/optcomp/default.nix @@ -0,0 +1,47 @@ +{ stdenv, fetchurl, fetchpatch, ocaml, findlib, ocamlbuild, camlp4 }: + +stdenv.mkDerivation { + name = "ocaml-optcomp-1.6"; + src = fetchurl { + url = "https://github.com/diml/optcomp/archive/1.6.tar.gz"; + sha256 = "0hhhb2gisah1h22zlg5iszbgqxdd7x85cwd57bd4mfkx9l7dh8jh"; + }; + + patches = + let inherit (stdenv.lib) optional versionAtLeast; in + optional (versionAtLeast ocaml.version "4.02") (fetchpatch { + url = "https://github.com/diml/optcomp/commit/b7f809360c9794b383a4bc0492f6df381276b429.patch"; + sha256 = "1n095lk94jq1rwi0l24g2wbgms7249wdd31n0ji895dr6755s93y"; + }) + ; + + createFindlibDestdir = true; + + buildInputs = [ ocaml findlib ocamlbuild camlp4 ]; + + configurePhase = '' + cp ${./META} META + ''; + + buildPhase = '' + ocamlbuild src/optcomp.cmxs src/optcomp.cma src/optcomp_o.native src/optcomp_r.native + ''; + + installPhase = '' + mkdir -p $out/bin + cp _build/src/optcomp_o.native $out/bin/optcomp-o + cp _build/src/optcomp_r.native $out/bin/optcomp-r + ocamlfind install optcomp META _build/src/optcomp.{a,cma,cmxa,cmxs} _build/src/pa_optcomp.{cmi,cmx,mli} + ''; + + meta = { + homepage = "https://github.com/diml/optcomp"; + description = "Optional compilation for OCaml with cpp-like directives"; + license = stdenv.lib.licenses.bsd3; + platforms = ocaml.meta.platforms or []; + maintainers = [ + stdenv.lib.maintainers.gal_bolle + ]; + }; + +} |