diff options
Diffstat (limited to 'pkgs/development/ocaml-modules')
744 files changed, 24765 insertions, 0 deletions
diff --git a/pkgs/development/ocaml-modules/afl-persistent/default.nix b/pkgs/development/ocaml-modules/afl-persistent/default.nix new file mode 100644 index 00000000000..ba266ade830 --- /dev/null +++ b/pkgs/development/ocaml-modules/afl-persistent/default.nix @@ -0,0 +1,39 @@ +{ lib, stdenv, fetchFromGitHub, ocaml, findlib, opaline }: + +stdenv.mkDerivation rec { + pname = "afl-persistent"; + version = "1.3"; + name = "ocaml${ocaml.version}-${pname}-${version}"; + + src = fetchFromGitHub { + owner = "stedolan"; + repo = "ocaml-${pname}"; + rev = "v${version}"; + sha256 = "06yyds2vcwlfr2nd3gvyrazlijjcrd1abnvkfpkaadgwdw3qam1i"; + }; + + nativeBuildInputs = [ ocaml findlib ]; + + # don't run tests in buildPhase + # don't overwrite test binary + postPatch = '' + sed -i 's/ && \.\/test$//' build.sh + sed -i '/^ocamlopt.*test.ml -o test$/ s/$/2/' build.sh + patchShebangs build.sh + ''; + + buildPhase = "./build.sh"; + installPhase = '' + ${opaline}/bin/opaline -prefix $out -libdir $out/lib/ocaml/${ocaml.version}/site-lib/ ${pname}.install + ''; + + doCheck = true; + checkPhase = "./_build/test && ./_build/test2"; + + meta = with lib; { + homepage = "https://github.com/stedolan/ocaml-afl-persistent"; + description = "persistent-mode afl-fuzz for ocaml"; + license = licenses.mit; + maintainers = [ maintainers.sternenseemann ]; + }; +} diff --git a/pkgs/development/ocaml-modules/alcotest/default.nix b/pkgs/development/ocaml-modules/alcotest/default.nix new file mode 100644 index 00000000000..bb1b18e3ec1 --- /dev/null +++ b/pkgs/development/ocaml-modules/alcotest/default.nix @@ -0,0 +1,26 @@ +{ lib, buildDunePackage, fetchurl +, astring, cmdliner, fmt, uuidm, re, stdlib-shims, uutf +}: + +buildDunePackage rec { + pname = "alcotest"; + version = "1.4.0"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/mirage/alcotest/releases/download/${version}/alcotest-mirage-${version}.tbz"; + sha256 = "sha256:1h9yp44snb6sgm5g1x3wg4gwjscic7i56jf0j8jr07355pxwrami"; + }; + + propagatedBuildInputs = [ astring cmdliner fmt uuidm re stdlib-shims uutf ]; + + doCheck = true; + + meta = with lib; { + homepage = "https://github.com/mirage/alcotest"; + description = "A lightweight and colourful test framework"; + license = licenses.isc; + maintainers = [ maintainers.ericbmerritt ]; + }; +} diff --git a/pkgs/development/ocaml-modules/alcotest/lwt.nix b/pkgs/development/ocaml-modules/alcotest/lwt.nix new file mode 100644 index 00000000000..5a57dc0fcc2 --- /dev/null +++ b/pkgs/development/ocaml-modules/alcotest/lwt.nix @@ -0,0 +1,19 @@ +{ lib, buildDunePackage, alcotest, logs, ocaml_lwt, fmt +, re, cmdliner +}: + +buildDunePackage { + pname = "alcotest-lwt"; + + inherit (alcotest) version src useDune2; + + propagatedBuildInputs = [ alcotest logs ocaml_lwt fmt ]; + + doCheck = true; + checkInputs = [ re cmdliner ]; + + meta = alcotest.meta // { + description = "Lwt-based helpers for Alcotest"; + }; + +} diff --git a/pkgs/development/ocaml-modules/alcotest/mirage.nix b/pkgs/development/ocaml-modules/alcotest/mirage.nix new file mode 100644 index 00000000000..b4ba4246b2c --- /dev/null +++ b/pkgs/development/ocaml-modules/alcotest/mirage.nix @@ -0,0 +1,16 @@ +{ lib, buildDunePackage, alcotest, lwt, logs, mirage-clock, duration }: + +buildDunePackage { + pname = "alcotest-mirage"; + + inherit (alcotest) version src useDune2; + + propagatedBuildInputs = [ alcotest lwt logs mirage-clock duration ]; + + doCheck = true; + + meta = alcotest.meta // { + description = "Mirage implementation for Alcotest"; + maintainers = with lib.maintainers; [ ulrikstrid anmonteiro ]; + }; +} diff --git a/pkgs/development/ocaml-modules/angstrom-async/default.nix b/pkgs/development/ocaml-modules/angstrom-async/default.nix new file mode 100644 index 00000000000..8c9f97f81ab --- /dev/null +++ b/pkgs/development/ocaml-modules/angstrom-async/default.nix @@ -0,0 +1,19 @@ +{ lib, fetchFromGitHub, buildDunePackage, angstrom, async }: + +buildDunePackage rec { + pname = "angstrom-async"; + + inherit (angstrom) version useDune2 src; + + minimumOCamlVersion = "4.04.1"; + + propagatedBuildInputs = [ angstrom async ]; + + doCheck = true; + + meta = { + inherit (angstrom.meta) homepage license; + description = "Async support for Angstrom"; + maintainers = with lib.maintainers; [ romildo ]; + }; +} diff --git a/pkgs/development/ocaml-modules/angstrom-lwt-unix/default.nix b/pkgs/development/ocaml-modules/angstrom-lwt-unix/default.nix new file mode 100644 index 00000000000..1bb8833cf07 --- /dev/null +++ b/pkgs/development/ocaml-modules/angstrom-lwt-unix/default.nix @@ -0,0 +1,19 @@ +{ lib, fetchFromGitHub, buildDunePackage, angstrom, ocaml_lwt }: + +buildDunePackage rec { + pname = "angstrom-lwt-unix"; + + inherit (angstrom) version useDune2 src; + + minimumOCamlVersion = "4.03"; + + propagatedBuildInputs = [ angstrom ocaml_lwt ]; + + doCheck = true; + + meta = { + inherit (angstrom.meta) homepage license; + description = "Lwt_unix support for Angstrom"; + maintainers = with lib.maintainers; [ romildo ]; + }; +} diff --git a/pkgs/development/ocaml-modules/angstrom-unix/default.nix b/pkgs/development/ocaml-modules/angstrom-unix/default.nix new file mode 100644 index 00000000000..af72c7f8d2d --- /dev/null +++ b/pkgs/development/ocaml-modules/angstrom-unix/default.nix @@ -0,0 +1,19 @@ +{ lib, fetchFromGitHub, buildDunePackage, angstrom }: + +buildDunePackage rec { + pname = "angstrom-unix"; + + inherit (angstrom) version useDune2 src; + + minimumOCamlVersion = "4.03"; + + propagatedBuildInputs = [ angstrom ]; + + doCheck = true; + + meta = { + inherit (angstrom.meta) homepage license; + description = "Unix support for Angstrom"; + maintainers = with lib.maintainers; [ romildo ]; + }; +} diff --git a/pkgs/development/ocaml-modules/angstrom/default.nix b/pkgs/development/ocaml-modules/angstrom/default.nix new file mode 100644 index 00000000000..749a043e739 --- /dev/null +++ b/pkgs/development/ocaml-modules/angstrom/default.nix @@ -0,0 +1,28 @@ +{ lib, fetchFromGitHub, buildDunePackage, ocaml, ocaml-syntax-shims, alcotest, result, bigstringaf, ppx_let }: + +buildDunePackage rec { + pname = "angstrom"; + version = "0.15.0"; + useDune2 = true; + + minimumOCamlVersion = "4.04"; + + src = fetchFromGitHub { + owner = "inhabitedtype"; + repo = pname; + rev = version; + sha256 = "1hmrkdcdlkwy7rxhngf3cv3sa61cznnd9p5lmqhx20664gx2ibrh"; + }; + + checkInputs = [ alcotest ppx_let ]; + buildInputs = [ ocaml-syntax-shims ]; + propagatedBuildInputs = [ bigstringaf result ]; + doCheck = lib.versionAtLeast ocaml.version "4.05"; + + meta = { + homepage = "https://github.com/inhabitedtype/angstrom"; + description = "OCaml parser combinators built for speed and memory efficiency"; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ sternenseemann ]; + }; +} diff --git a/pkgs/development/ocaml-modules/ansiterminal/default.nix b/pkgs/development/ocaml-modules/ansiterminal/default.nix new file mode 100644 index 00000000000..edd40fb4df2 --- /dev/null +++ b/pkgs/development/ocaml-modules/ansiterminal/default.nix @@ -0,0 +1,29 @@ +{ lib, buildDunePackage, fetchFromGitHub }: + +buildDunePackage rec { + pname = "ANSITerminal"; + version = "0.8.2"; + + useDune2 = true; + + src = fetchFromGitHub { + owner = "Chris00"; + repo = pname; + rev = version; + sha256 = "0dyjischrgwlxqz1p5zbqq76jvk6pl1qj75i7ydhijssr9pj278d"; + }; + + doCheck = true; + + meta = with lib; { + description = "A module allowing to use the colors and cursor movements on ANSI terminals"; + longDescription = '' + ANSITerminal is a module allowing to use the colors and cursor + movements on ANSI terminals. It also works on the windows shell (but + this part is currently work in progress). + ''; + inherit (src.meta) homepage; + license = licenses.lgpl3; + maintainers = [ maintainers.jirkamarsik ]; + }; +} diff --git a/pkgs/development/ocaml-modules/apron/default.nix b/pkgs/development/ocaml-modules/apron/default.nix new file mode 100644 index 00000000000..bfef3d5b6c6 --- /dev/null +++ b/pkgs/development/ocaml-modules/apron/default.nix @@ -0,0 +1,42 @@ +{ stdenv, lib, fetchFromGitHub, perl, gmp, mpfr, ppl, ocaml, findlib, camlidl, mlgmpidl }: + +stdenv.mkDerivation rec { + pname = "ocaml${ocaml.version}-apron"; + version = "0.9.13"; + src = fetchFromGitHub { + owner = "antoinemine"; + repo = "apron"; + rev = "v${version}"; + sha256 = "14ymjahqdxj26da8wik9d5dzlxn81b3z1iggdl7rn2nn06jy7lvy"; + }; + + nativeBuildInputs = [ ocaml findlib perl ]; + buildInputs = [ gmp mpfr ppl camlidl ]; + propagatedBuildInputs = [ mlgmpidl ]; + + strictDeps = false; + + outputs = [ "out" "bin" "dev" ]; + + configurePhase = '' + runHook preConfigure + ./configure -prefix $out + mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib/stublibs + runHook postConfigure + ''; + + postInstall = '' + mkdir -p $dev/lib + mv $out/lib/ocaml $dev/lib/ + mkdir -p $bin + mv $out/bin $bin/ + ''; + + meta = { + license = lib.licenses.lgpl21; + homepage = "http://apron.cri.ensmp.fr/library/"; + maintainers = [ lib.maintainers.vbgl ]; + description = "Numerical abstract domain library"; + inherit (ocaml.meta) platforms; + }; +} diff --git a/pkgs/development/ocaml-modules/arp/default.nix b/pkgs/development/ocaml-modules/arp/default.nix new file mode 100644 index 00000000000..e1daca1bc38 --- /dev/null +++ b/pkgs/development/ocaml-modules/arp/default.nix @@ -0,0 +1,55 @@ +{ lib, buildDunePackage, fetchurl +, cstruct, ipaddr, macaddr, logs, lwt, duration +, mirage-time, mirage-protocols, mirage-profile +, alcotest, ethernet, fmt, mirage-vnetif, mirage-random +, mirage-random-test, mirage-clock-unix, mirage-time-unix +, bisect_ppx +}: + +buildDunePackage rec { + pname = "arp"; + version = "3.0.0"; + + src = fetchurl { + url = "https://github.com/mirage/${pname}/releases/download/v${version}/${pname}-v${version}.tbz"; + sha256 = "1x3l8v96ywc3wrcwbf0j04b8agap4fif0fz6ki2ndzx57yqcjszn"; + }; + + minimumOCamlVersion = "4.06"; + useDune2 = true; + + nativeBuildInputs = [ + bisect_ppx + ]; + + propagatedBuildInputs = [ + cstruct + duration + ipaddr + logs + lwt + macaddr + mirage-profile + mirage-protocols + mirage-time + ]; + + doCheck = true; + checkInputs = [ + alcotest + ethernet + mirage-clock-unix + mirage-profile + mirage-random + mirage-random-test + mirage-time-unix + mirage-vnetif + ]; + + meta = with lib; { + description = "Address Resolution Protocol purely in OCaml"; + homepage = "https://github.com/mirage/arp"; + license = licenses.isc; + maintainers = with maintainers; [ sternenseemann ]; + }; +} diff --git a/pkgs/development/ocaml-modules/asn1-combinators/default.nix b/pkgs/development/ocaml-modules/asn1-combinators/default.nix new file mode 100644 index 00000000000..289f6a6cba4 --- /dev/null +++ b/pkgs/development/ocaml-modules/asn1-combinators/default.nix @@ -0,0 +1,29 @@ +{ lib, buildDunePackage, fetchurl +, cstruct, zarith, bigarray-compat, stdlib-shims, ptime, alcotest +}: + +buildDunePackage rec { + minimumOCamlVersion = "4.05"; + + pname = "asn1-combinators"; + version = "0.2.5"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/mirleft/ocaml-asn1-combinators/releases/download/v${version}/asn1-combinators-v${version}.tbz"; + sha256 = "1pbcdwm12hnfpd1jv2b7cjfkj5r7h61xp2gr8dysb8waa455kwln"; + }; + + propagatedBuildInputs = [ cstruct zarith bigarray-compat stdlib-shims ptime ]; + + doCheck = true; + checkInputs = [ alcotest ]; + + meta = with lib; { + homepage = "https://github.com/mirleft/ocaml-asn1-combinators"; + description = "Combinators for expressing ASN.1 grammars in OCaml"; + license = licenses.isc; + maintainers = with maintainers; [ vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/astring/default.nix b/pkgs/development/ocaml-modules/astring/default.nix new file mode 100644 index 00000000000..f7478f93b91 --- /dev/null +++ b/pkgs/development/ocaml-modules/astring/default.nix @@ -0,0 +1,50 @@ +{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, topkg }: + +let + # Use astring 0.8.3 for OCaml < 4.05 + param = + if lib.versionAtLeast ocaml.version "4.05" + then { + version = "0.8.5"; + sha256 = "1ykhg9gd3iy7zsgyiy2p9b1wkpqg9irw5pvcqs3sphq71iir4ml6"; + } else { + version = "0.8.3"; + sha256 = "0ixjwc3plrljvj24za3l9gy0w30lsbggp8yh02lwrzw61ls4cri0"; + }; +in + +stdenv.mkDerivation { + pname = "ocaml${ocaml.version}-astring"; + inherit (param) version; + + src = fetchurl { + url = "https://erratique.ch/software/astring/releases/astring-${param.version}.tbz"; + inherit (param) sha256; + }; + + nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ]; + buildInputs = [ topkg ]; + + strictDeps = true; + + inherit (topkg) buildPhase installPhase; + + meta = { + homepage = "https://erratique.ch/software/astring"; + description = "Alternative String module for OCaml"; + longDescription = '' + Astring exposes an alternative String module for OCaml. This module tries + to balance minimality and expressiveness for basic, index-free, string + processing and provides types and functions for substrings, string sets + and string maps. + + Remaining compatible with the OCaml String module is a non-goal. + The String module exposed by Astring has exception safe functions, removes + deprecated and rarely used functions, alters some signatures and names, + adds a few missing functions and fully exploits OCaml's newfound string + immutability. + ''; + license = lib.licenses.isc; + maintainers = with lib.maintainers; [ sternenseemann ]; + }; +} diff --git a/pkgs/development/ocaml-modules/atd/default.nix b/pkgs/development/ocaml-modules/atd/default.nix new file mode 100644 index 00000000000..7468900e07e --- /dev/null +++ b/pkgs/development/ocaml-modules/atd/default.nix @@ -0,0 +1,33 @@ +{ lib, menhir, easy-format, fetchurl, buildDunePackage, which, re, nixosTests }: + +buildDunePackage rec { + pname = "atd"; + version = "2.2.1"; + + useDune2 = true; + + minimumOCamlVersion = "4.02"; + + src = fetchurl { + url = "https://github.com/ahrefs/atd/releases/download/2.2.1/atd-2.2.1.tbz"; + sha256 = "17jm79np69ixp53a4njxnlb1pg8sd1g47nm3nyki9clkc8d4qsyv"; + }; + + nativeBuildInputs = [ which menhir ]; + propagatedBuildInputs = [ easy-format re ]; + + strictDeps = true; + + doCheck = true; + + passthru.tests = { + smoke-test = nixosTests.atd; + }; + + meta = with lib; { + homepage = "https://github.com/mjambon/atd"; + description = "Syntax for cross-language type definitions"; + license = licenses.bsd3; + maintainers = with maintainers; [ aij jwilberding ]; + }; +} diff --git a/pkgs/development/ocaml-modules/atdgen/default.nix b/pkgs/development/ocaml-modules/atdgen/default.nix new file mode 100644 index 00000000000..2537c92d97a --- /dev/null +++ b/pkgs/development/ocaml-modules/atdgen/default.nix @@ -0,0 +1,26 @@ +{ buildDunePackage, atd, biniou, yojson }: + +let runtime = + buildDunePackage { + pname = "atdgen-runtime"; + inherit (atd) version useDune2 src; + + propagatedBuildInputs = [ biniou yojson ]; + + meta = { inherit (atd.meta) license; }; + } +; in + +buildDunePackage { + pname = "atdgen"; + inherit (atd) version useDune2 src; + + buildInputs = [ atd ]; + + propagatedBuildInputs = [ runtime ]; + + meta = { + description = "Generates efficient JSON serializers, deserializers and validators"; + inherit (atd.meta) license; + }; +} diff --git a/pkgs/development/ocaml-modules/awa/default.nix b/pkgs/development/ocaml-modules/awa/default.nix new file mode 100644 index 00000000000..d870ab86505 --- /dev/null +++ b/pkgs/development/ocaml-modules/awa/default.nix @@ -0,0 +1,40 @@ +{ lib, buildDunePackage, fetchurl +, ppx_sexp_conv, ppx_cstruct +, mirage-crypto, mirage-crypto-rng, mirage-crypto-pk +, x509, cstruct, cstruct-unix, cstruct-sexp, sexplib, eqaf +, rresult, mtime, logs, fmt, cmdliner, base64, hacl_x25519 +, zarith +}: + +buildDunePackage rec { + pname = "awa"; + version = "0.0.5"; + + minimumOCamlVersion = "4.07"; + useDune2 = true; + + src = fetchurl { + url = "https://github.com/mirage/awa-ssh/releases/download/v${version}/awa-${version}.tbz"; + sha256 = "14hqzmikp3hlynhs0wnwj2491106if183swsl7ldk4215a0b7ms4"; + }; + + nativeBuildInputs = [ ppx_cstruct ]; + + propagatedBuildInputs = [ + mirage-crypto mirage-crypto-rng mirage-crypto-pk x509 + cstruct cstruct-sexp sexplib mtime + logs base64 hacl_x25519 zarith + ppx_sexp_conv eqaf + ]; + + doCheck = true; + checkInputs = [ cstruct-unix cmdliner fmt ]; + + meta = with lib; { + description = "SSH implementation in OCaml"; + license = licenses.isc; + homepage = "https://github.com/mirage/awa-ssh"; + changelog = "https://github.com/mirage/awa-ssh/raw/v${version}/CHANGES.md"; + maintainers = [ maintainers.sternenseemann ]; + }; +} diff --git a/pkgs/development/ocaml-modules/awa/lwt.nix b/pkgs/development/ocaml-modules/awa/lwt.nix new file mode 100644 index 00000000000..00be799ddff --- /dev/null +++ b/pkgs/development/ocaml-modules/awa/lwt.nix @@ -0,0 +1,15 @@ +{ buildDunePackage, awa +, cstruct, mtime, lwt, cstruct-unix, mirage-crypto-rng +}: + +buildDunePackage { + pname = "awa-lwt"; + + inherit (awa) version src useDune2; + + propagatedBuildInputs = [ + awa cstruct mtime lwt cstruct-unix mirage-crypto-rng + ]; + + inherit (awa) meta; +} diff --git a/pkgs/development/ocaml-modules/awa/mirage.nix b/pkgs/development/ocaml-modules/awa/mirage.nix new file mode 100644 index 00000000000..4f9b425f8a0 --- /dev/null +++ b/pkgs/development/ocaml-modules/awa/mirage.nix @@ -0,0 +1,15 @@ +{ buildDunePackage, awa +, cstruct, mtime, lwt, mirage-flow, mirage-clock, logs +}: + +buildDunePackage { + pname = "awa-mirage"; + + inherit (awa) version src useDune2; + + propagatedBuildInputs = [ + awa cstruct mtime lwt mirage-flow mirage-clock logs + ]; + + inherit (awa) meta; +} diff --git a/pkgs/development/ocaml-modules/bap/curses_is_ncurses.patch b/pkgs/development/ocaml-modules/bap/curses_is_ncurses.patch new file mode 100644 index 00000000000..0b012848601 --- /dev/null +++ b/pkgs/development/ocaml-modules/bap/curses_is_ncurses.patch @@ -0,0 +1,32 @@ +From e6f6d1529d1725e8c1ed3c96eecc4aea43417aea Mon Sep 17 00:00:00 2001 +From: Matthew Maurer <matthew.r.maurer@gmail.com> +Date: Sun, 19 Apr 2020 15:50:01 -0700 +Subject: [PATCH] Remove attempt to work around libcurses dependency issues. + +BAP doesn't actually link against libcurses, LLVM does. By adding +-lcurses to this file, we accidentally broke linking on any systems +where LLVM got linked against libncurses (not libcurses) without a +libcurses compatibility shim. + +Overall, we should get -l flags from llvm-config, not attempt to +shoehorn them in later, as this is fragile. +--- + oasis/llvm | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/oasis/llvm b/oasis/llvm +index 966c407..fba3fb4 100644 +--- a/oasis/llvm ++++ b/oasis/llvm +@@ -31,7 +31,7 @@ Library bap_llvm + Bap_llvm_ogre_samples, + Bap_llvm_ogre_types + CCOpt: $cc_optimization +- CCLib: $llvm_lib $cxxlibs $llvm_ldflags -lcurses ++ CCLib: $llvm_lib $cxxlibs $llvm_ldflags -lncurses + CSources: llvm_disasm.h, + llvm_disasm.c, + llvm_stubs.c, +-- +2.22.0 + diff --git a/pkgs/development/ocaml-modules/bap/default.nix b/pkgs/development/ocaml-modules/bap/default.nix new file mode 100644 index 00000000000..ea009083e8d --- /dev/null +++ b/pkgs/development/ocaml-modules/bap/default.nix @@ -0,0 +1,80 @@ +{ lib, stdenv, fetchFromGitHub, fetchurl +, ocaml, findlib, ocamlbuild, ocaml_oasis +, bitstring, camlzip, cmdliner, core_kernel, ezjsonm, fileutils, ocaml_lwt, ocamlgraph, ocurl, re, uri, zarith, piqi, piqi-ocaml, uuidm, llvm, frontc, ounit, ppx_jane, parsexp +, utop, libxml2, ncurses +, linenoise +, ppx_bap +, ppx_bitstring +, yojson +, which, makeWrapper, writeText +, z3 +}: + +if !lib.versionAtLeast ocaml.version "4.08" +then throw "BAP is not available for OCaml ${ocaml.version}" +else + +stdenv.mkDerivation rec { + pname = "ocaml${ocaml.version}-bap"; + version = "2.2.0"; + src = fetchFromGitHub { + owner = "BinaryAnalysisPlatform"; + repo = "bap"; + rev = "v${version}"; + sha256 = "0c53sps6ba9n5cjdmapi8ylzlpcc11pksijp9swzlwgxyz5d276f"; + }; + + sigs = fetchurl { + url = "https://github.com/BinaryAnalysisPlatform/bap/releases/download/v${version}/sigs.zip"; + sha256 = "0d69jd28z4g64mglq94kj5imhmk5f6sgcsh9q2nij3b0arpcliwk"; + }; + + createFindlibDestdir = true; + + setupHook = writeText "setupHook.sh" '' + export CAML_LD_LIBRARY_PATH="''${CAML_LD_LIBRARY_PATH-}''${CAML_LD_LIBRARY_PATH:+:}''$1/lib/ocaml/${ocaml.version}/site-lib/ocaml${ocaml.version}-bap-${version}/" + export CAML_LD_LIBRARY_PATH="''${CAML_LD_LIBRARY_PATH-}''${CAML_LD_LIBRARY_PATH:+:}''$1/lib/ocaml/${ocaml.version}/site-lib/ocaml${ocaml.version}-bap-${version}-llvm-plugins/" + ''; + + nativeBuildInputs = [ which makeWrapper ocaml findlib ocamlbuild ocaml_oasis ]; + + buildInputs = [ linenoise + ounit + ppx_bitstring + z3 + utop libxml2 ncurses ]; + + propagatedBuildInputs = [ bitstring camlzip cmdliner ppx_bap core_kernel ezjsonm fileutils ocaml_lwt ocamlgraph ocurl re uri zarith piqi parsexp + piqi-ocaml uuidm frontc yojson ]; + + installPhase = '' + runHook preInstall + export OCAMLPATH=$OCAMLPATH:$OCAMLFIND_DESTDIR; + export PATH=$PATH:$out/bin + export CAML_LD_LIBRARY_PATH=''${CAML_LD_LIBRARY_PATH-}''${CAML_LD_LIBRARY_PATH:+:}$OCAMLFIND_DESTDIR/bap-plugin-llvm/:$OCAMLFIND_DESTDIR/bap/ + mkdir -p $out/lib/bap + make install + rm $out/bin/baptop + makeWrapper ${utop}/bin/utop $out/bin/baptop --prefix OCAMLPATH : $OCAMLPATH --prefix PATH : $PATH --add-flags "-ppx ppx-bap -short-paths -require \"bap.top\"" + wrapProgram $out/bin/bapbuild --prefix OCAMLPATH : $OCAMLPATH --prefix PATH : $PATH + ln -s $sigs $out/share/bap/sigs.zip + runHook postInstall + ''; + + disableIda = "--disable-ida"; + + patches = [ ./curses_is_ncurses.patch ]; + + preConfigure = '' + substituteInPlace oasis/elf-loader --replace bitstring.ppx ppx_bitstring + ''; + + configureFlags = [ "--enable-everything ${disableIda}" "--with-llvm-config=${llvm.dev}/bin/llvm-config" ]; + + meta = with lib; { + description = "Platform for binary analysis. It is written in OCaml, but can be used from other languages."; + homepage = "https://github.com/BinaryAnalysisPlatform/bap/"; + maintainers = [ maintainers.maurer ]; + license = licenses.mit; + }; +} diff --git a/pkgs/development/ocaml-modules/base64/default.nix b/pkgs/development/ocaml-modules/base64/default.nix new file mode 100644 index 00000000000..efb7f41b95d --- /dev/null +++ b/pkgs/development/ocaml-modules/base64/default.nix @@ -0,0 +1,26 @@ +{ lib, fetchurl, buildDunePackage, ocaml, alcotest, bos, rresult }: + +buildDunePackage rec { + pname = "base64"; + version = "3.5.0"; + + minimumOCamlVersion = "4.03"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/mirage/ocaml-base64/releases/download/v${version}/base64-v${version}.tbz"; + sha256 = "sha256-WJ3pwAV46/54QZismBjTWGxHSyMWts0+HEbMsfYq46Q="; + }; + + # otherwise fmt breaks evaluation + doCheck = lib.versionAtLeast ocaml.version "4.05"; + checkInputs = [ alcotest bos rresult ]; + + meta = { + homepage = "https://github.com/mirage/ocaml-base64"; + description = "Base64 encoding and decoding in OCaml"; + license = lib.licenses.isc; + maintainers = with lib.maintainers; [ vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/batteries/default.nix b/pkgs/development/ocaml-modules/batteries/default.nix new file mode 100644 index 00000000000..184f10a52be --- /dev/null +++ b/pkgs/development/ocaml-modules/batteries/default.nix @@ -0,0 +1,45 @@ +{ stdenv, lib, fetchFromGitHub, ocaml, findlib, ocamlbuild, qtest, num, ounit +, doCheck ? lib.versionAtLeast ocaml.version "4.08" && !stdenv.isAarch64 +}: + +if !lib.versionAtLeast ocaml.version "4.02" +then throw "batteries is not available for OCaml ${ocaml.version}" +else + +stdenv.mkDerivation rec { + pname = "ocaml${ocaml.version}-batteries"; + version = "3.4.0"; + + src = fetchFromGitHub { + owner = "ocaml-batteries-team"; + repo = "batteries-included"; + rev = "v${version}"; + sha256 = "sha256:1cd7475n1mxhq482aidmhh27mq5p2vmb8d9fkb1mlza9pz5z66yq"; + }; + + nativeBuildInputs = [ ocaml findlib ocamlbuild ]; + checkInputs = [ qtest ounit ]; + propagatedBuildInputs = [ num ]; + + strictDeps = !doCheck; + + inherit doCheck; + checkTarget = "test"; + + createFindlibDestdir = true; + + meta = { + homepage = "http://batteries.forge.ocamlcore.org/"; + description = "OCaml Batteries Included"; + longDescription = '' + A community-driven effort to standardize on an consistent, documented, + and comprehensive development platform for the OCaml programming + language. + ''; + license = lib.licenses.lgpl21Plus; + inherit (ocaml.meta) platforms; + maintainers = [ + lib.maintainers.maggesi + ]; + }; +} diff --git a/pkgs/development/ocaml-modules/benchmark/default.nix b/pkgs/development/ocaml-modules/benchmark/default.nix new file mode 100644 index 00000000000..c8016230724 --- /dev/null +++ b/pkgs/development/ocaml-modules/benchmark/default.nix @@ -0,0 +1,26 @@ +{ stdenv, lib, fetchzip, ocaml, findlib, ocamlbuild, ocaml_pcre }: + +stdenv.mkDerivation rec { + pname = "ocaml${ocaml.version}-benchmark"; + version = "1.4"; + + src = fetchzip { + url = "https://github.com/Chris00/ocaml-benchmark/releases/download/${version}/benchmark-${version}.tar.gz"; + sha256 = "16wi8ld7c3mq77ylpgbnj8qqqqimyzwxs47v06vyrwpma5pab5xa"; + }; + + nativeBuildInputs = [ ocaml findlib ocamlbuild ]; + buildInputs = [ ocaml_pcre ]; + + strictDeps = true; + + createFindlibDestdir = true; + + meta = { + homepage = "http://ocaml-benchmark.forge.ocamlcore.org/"; + platforms = ocaml.meta.platforms or []; + description = "Benchmark running times of code"; + license = lib.licenses.lgpl21; + maintainers = with lib.maintainers; [ volth ]; + }; +} diff --git a/pkgs/development/ocaml-modules/bheap/default.nix b/pkgs/development/ocaml-modules/bheap/default.nix new file mode 100644 index 00000000000..49e5c336d90 --- /dev/null +++ b/pkgs/development/ocaml-modules/bheap/default.nix @@ -0,0 +1,25 @@ +{ lib, buildDunePackage, fetchurl, stdlib-shims }: + +buildDunePackage rec { + pname = "bheap"; + version = "2.0.0"; + + src = fetchurl { + url = "https://github.com/backtracking/${pname}/releases/download/${version}/${pname}-${version}.tbz"; + sha256 = "0dpnpla20lgiicrxl2432m2fcr6y68msw3pnjxqb11xw6yrdfhsz"; + }; + + useDune2 = true; + + doCheck = true; + checkInputs = [ + stdlib-shims + ]; + + meta = with lib; { + description = "OCaml binary heap implementation by Jean-Christophe Filliatre"; + license = licenses.lgpl21Only; + maintainers = [ maintainers.sternenseemann ]; + homepage = "https://github.com/backtracking/bheap"; + }; +} diff --git a/pkgs/development/ocaml-modules/bigarray-compat/default.nix b/pkgs/development/ocaml-modules/bigarray-compat/default.nix new file mode 100644 index 00000000000..fd690cfdd5b --- /dev/null +++ b/pkgs/development/ocaml-modules/bigarray-compat/default.nix @@ -0,0 +1,24 @@ +{ lib, buildDunePackage, fetchFromGitHub }: + +buildDunePackage rec { + pname = "bigarray-compat"; + version = "1.0.0"; + + useDune2 = true; + + minimalOCamlVersion = "4.02"; + + src = fetchFromGitHub { + owner = "mirage"; + repo = pname; + rev = "v${version}"; + sha256 = "06j1dwlpisxshdd0nab4n4x266gg1s1n8na16lpgw3fvcznwnimz"; + }; + + meta = { + description = "Compatibility library to use Stdlib.Bigarray when possible"; + inherit (src.meta) homepage; + license = lib.licenses.isc; + maintainers = [ lib.maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/bigarray-overlap/default.nix b/pkgs/development/ocaml-modules/bigarray-overlap/default.nix new file mode 100644 index 00000000000..a5f5ae33ede --- /dev/null +++ b/pkgs/development/ocaml-modules/bigarray-overlap/default.nix @@ -0,0 +1,31 @@ +{ lib, buildDunePackage, fetchurl +, bigarray-compat, alcotest, astring, fpath, bos, findlib, pkg-config +}: + +buildDunePackage rec { + pname = "bigarray-overlap"; + version = "0.2.0"; + + src = fetchurl { + url = "https://github.com/dinosaure/overlap/releases/download/v${version}/bigarray-overlap-v${version}.tbz"; + sha256 = "1v86avafsbyxjccy0y9gny31s2jzb0kd42v3mhcalklx5f044lcy"; + }; + + minimumOCamlVersion = "4.07"; + useDune2 = true; + + strictDeps = !doCheck; + + propagatedBuildInputs = [ bigarray-compat ]; + + nativeBuildInputs = [ findlib pkg-config ]; + checkInputs = [ alcotest astring fpath bos ]; + doCheck = true; + + meta = with lib; { + homepage = "https://github.com/dinosaure/overlap"; + description = "A minimal library to know that 2 bigarray share physically the same memory or not"; + license = licenses.mit; + maintainers = [ maintainers.sternenseemann ]; + }; +} diff --git a/pkgs/development/ocaml-modules/bigstring/default.nix b/pkgs/development/ocaml-modules/bigstring/default.nix new file mode 100644 index 00000000000..f966e0b90b1 --- /dev/null +++ b/pkgs/development/ocaml-modules/bigstring/default.nix @@ -0,0 +1,27 @@ +{ lib, fetchFromGitHub, buildDunePackage }: + +buildDunePackage rec { + pname = "bigstring"; + version = "0.3"; + + useDune2 = true; + + minimumOCamlVersion = "4.03"; + + src = fetchFromGitHub { + owner = "c-cube"; + repo = "ocaml-bigstring"; + rev = version; + sha256 = "0bkxwdcswy80f6rmx5wjza92xzq4rdqsb4a9fm8aav8bdqx021n8"; + }; + + # Circular dependency with bigstring-unix + doCheck = false; + + meta = with lib; { + homepage = "https://github.com/c-cube/ocaml-bigstring"; + description = "Bigstring built on top of bigarrays, and convenient functions"; + license = licenses.bsd2; + maintainers = [ maintainers.alexfmpe ]; + }; +} diff --git a/pkgs/development/ocaml-modules/bigstringaf/default.nix b/pkgs/development/ocaml-modules/bigstringaf/default.nix new file mode 100644 index 00000000000..e8d36526d22 --- /dev/null +++ b/pkgs/development/ocaml-modules/bigstringaf/default.nix @@ -0,0 +1,32 @@ +{ lib, fetchFromGitHub, buildDunePackage, ocaml, alcotest, bigarray-compat, pkg-config }: + +buildDunePackage rec { + pname = "bigstringaf"; + version = "0.7.0"; + + useDune2 = true; + + minimumOCamlVersion = "4.03"; + + src = fetchFromGitHub { + owner = "inhabitedtype"; + repo = pname; + rev = version; + sha256 = "1q1sqxzdnlrpl95ccrhl7lwy3zswgd9rbn19ildclh0lyi2vazbj"; + }; + + # This currently fails with dune + strictDeps = false; + + nativeBuildInputs = [ pkg-config ]; + checkInputs = [ alcotest ]; + propagatedBuildInputs = [ bigarray-compat ]; + doCheck = lib.versionAtLeast ocaml.version "4.05"; + + meta = { + description = "Bigstring intrinsics and fast blits based on memcpy/memmove"; + license = lib.licenses.bsd3; + maintainers = [ lib.maintainers.vbgl ]; + inherit (src.meta) homepage; + }; +} diff --git a/pkgs/development/ocaml-modules/biniou/1.0.nix b/pkgs/development/ocaml-modules/biniou/1.0.nix new file mode 100644 index 00000000000..5a2e2ea9a7f --- /dev/null +++ b/pkgs/development/ocaml-modules/biniou/1.0.nix @@ -0,0 +1,39 @@ +{lib, stdenv, fetchurl, ocaml, findlib, easy-format}: +let + pname = "biniou"; + version = "1.0.9"; + webpage = "http://mjambon.com/${pname}.html"; +in + +assert lib.versionAtLeast (lib.getVersion ocaml) "3.11"; + +stdenv.mkDerivation rec { + + name = "${pname}-${version}"; + + src = fetchurl { + url = "http://mjambon.com/releases/${pname}/${name}.tar.gz"; + sha256 = "14j3hrhbjqxbizr1pr8fcig9dmfzhbjjwzwyc99fcsdic67w8izb"; + }; + + nativeBuildInputs = [ ocaml findlib ]; + buildInputs = [ easy-format ]; + + strictDeps = true; + + createFindlibDestdir = true; + + makeFlags = [ "PREFIX=$(out)" ]; + + preBuild = '' + mkdir $out/bin + ''; + + meta = with lib; { + description = "A binary data format designed for speed, safety, ease of use and backward compatibility as protocols evolve"; + homepage = webpage; + license = licenses.bsd3; + maintainers = [ maintainers.vbgl ]; + platforms = ocaml.meta.platforms or []; + }; +} diff --git a/pkgs/development/ocaml-modules/biniou/default.nix b/pkgs/development/ocaml-modules/biniou/default.nix new file mode 100644 index 00000000000..75725f13551 --- /dev/null +++ b/pkgs/development/ocaml-modules/biniou/default.nix @@ -0,0 +1,30 @@ +{ lib, fetchFromGitHub, buildDunePackage, easy-format }: + +buildDunePackage rec { + pname = "biniou"; + version = "1.2.1"; + + useDune2 = true; + + src = fetchFromGitHub { + owner = "ocaml-community"; + repo = pname; + rev = version; + sha256 = "0x2kiy809n1j0yf32l7hj102y628jp5jdrkbi3z7ld8jq04h1790"; + }; + + propagatedBuildInputs = [ easy-format ]; + + strictDeps = true; + + postPatch = '' + patchShebangs . + ''; + + meta = { + inherit (src.meta) homepage; + description = "Binary data format designed for speed, safety, ease of use and backward compatibility as protocols evolve"; + maintainers = [ lib.maintainers.vbgl ]; + license = lib.licenses.bsd3; + }; +} diff --git a/pkgs/development/ocaml-modules/biocaml/default.nix b/pkgs/development/ocaml-modules/biocaml/default.nix new file mode 100644 index 00000000000..596ed6161d7 --- /dev/null +++ b/pkgs/development/ocaml-modules/biocaml/default.nix @@ -0,0 +1,30 @@ +{ lib, buildDunePackage, fetchFromGitHub, fetchpatch +, ounit, async, base64, camlzip, cfstream +, core, ppx_jane, ppx_sexp_conv, rresult, uri, xmlm }: + +buildDunePackage rec { + pname = "biocaml"; + version = "0.11.1"; + + useDune2 = true; + + minimumOCamlVersion = "4.08"; + + src = fetchFromGitHub { + owner = "biocaml"; + repo = pname; + rev = "v${version}"; + sha256 = "1il84vvypgkhdyc2j5fmgh14a58069s6ijbd5dvyl2i7jdxaazji"; + }; + + buildInputs = [ ppx_jane ppx_sexp_conv ]; + checkInputs = [ ounit ]; + propagatedBuildInputs = [ async base64 camlzip cfstream core rresult uri xmlm ]; + + meta = with lib; { + description = "Bioinformatics library for Ocaml"; + homepage = "http://${pname}.org"; + maintainers = [ maintainers.bcdarwin ]; + license = licenses.gpl2; + }; +} diff --git a/pkgs/development/ocaml-modules/bisect_ppx/default.nix b/pkgs/development/ocaml-modules/bisect_ppx/default.nix new file mode 100644 index 00000000000..ddeda86e9bf --- /dev/null +++ b/pkgs/development/ocaml-modules/bisect_ppx/default.nix @@ -0,0 +1,28 @@ +{ lib, fetchFromGitHub, buildDunePackage, cmdliner, ppxlib }: + +buildDunePackage rec { + pname = "bisect_ppx"; + version = "2.6.1"; + + src = fetchFromGitHub { + owner = "aantron"; + repo = "bisect_ppx"; + rev = version; + sha256 = "sha256-YeLDlH3mUbVEY4OmzlrvSwVUav3uMtSsTFlOsQKnz84="; + }; + + minimumOCamlVersion = "4.08"; + useDune2 = true; + + buildInputs = [ + cmdliner + ppxlib + ]; + + meta = with lib; { + description = "Bisect_ppx is a code coverage tool for OCaml and Reason. It helps you test thoroughly by showing what's not tested."; + license = licenses.mit; + homepage = "https://github.com/aantron/bisect_ppx"; + maintainers = with maintainers; [ ]; + }; +} diff --git a/pkgs/development/ocaml-modules/bistro/default.nix b/pkgs/development/ocaml-modules/bistro/default.nix new file mode 100644 index 00000000000..348d1bb97d4 --- /dev/null +++ b/pkgs/development/ocaml-modules/bistro/default.nix @@ -0,0 +1,49 @@ +{ lib +, ocaml +, fetchFromGitHub +, buildDunePackage +, base64 +, bos +, core +, lwt_react +, ocamlgraph +, ppx_sexp_conv +, rresult +, sexplib +, tyxml +}: + +buildDunePackage rec { + pname = "bistro"; + version = "unstable-2021-11-13"; + + useDune2 = true; + + src = fetchFromGitHub { + owner = "pveber"; + repo = pname; + rev = "fb285b2c6d8adccda3c71e2293bceb01febd6624"; + sha256 = "sha256-JChDU1WH8W9Czkppx9SHiVIu9/7QFWJy2A89oksp0Ek="; + }; + + propagatedBuildInputs = [ + base64 + bos + core + lwt_react + ocamlgraph + ppx_sexp_conv + rresult + sexplib + tyxml + ]; + + minimalOCamlVersion = "4.12"; + + meta = { + inherit (src.meta) homepage; + description = "Build and execute typed scientific workflows"; + maintainers = [ lib.maintainers.vbgl ]; + license = lib.licenses.gpl2; + }; +} diff --git a/pkgs/development/ocaml-modules/bitstring/default.nix b/pkgs/development/ocaml-modules/bitstring/default.nix new file mode 100644 index 00000000000..12ed4ae787d --- /dev/null +++ b/pkgs/development/ocaml-modules/bitstring/default.nix @@ -0,0 +1,24 @@ +{ lib, fetchFromGitHub, buildDunePackage, stdlib-shims }: + +buildDunePackage rec { + pname = "bitstring"; + version = "4.1.0"; + + useDune2 = true; + + src = fetchFromGitHub { + owner = "xguerin"; + repo = pname; + rev = "v${version}"; + sha256 = "0mghsl8b2zd2676mh1r9142hymhvzy9cw8kgkjmirxkn56wbf56b"; + }; + + propagatedBuildInputs = [ stdlib-shims ]; + + meta = with lib; { + description = "This library adds Erlang-style bitstrings and matching over bitstrings as a syntax extension and library for OCaml"; + homepage = "https://github.com/xguerin/bitstring"; + license = licenses.lgpl21Plus; + maintainers = [ maintainers.maurer ]; + }; +} diff --git a/pkgs/development/ocaml-modules/bitstring/ppx.nix b/pkgs/development/ocaml-modules/bitstring/ppx.nix new file mode 100644 index 00000000000..4d391d3458d --- /dev/null +++ b/pkgs/development/ocaml-modules/bitstring/ppx.nix @@ -0,0 +1,22 @@ +{ lib, buildDunePackage, ocaml +, bitstring, ppxlib +, ounit +}: + +if !lib.versionAtLeast ppxlib.version "0.18.0" +then throw "ppx_bitstring is not available with ppxlib-${ppxlib.version}" +else + +buildDunePackage rec { + pname = "ppx_bitstring"; + inherit (bitstring) version useDune2 src; + + buildInputs = [ bitstring ppxlib ]; + + doCheck = lib.versionAtLeast ocaml.version "4.08"; + checkInputs = [ ounit ]; + + meta = bitstring.meta // { + description = "Bitstrings and bitstring matching for OCaml - PPX extension"; + }; +} diff --git a/pkgs/development/ocaml-modules/bitv/default.nix b/pkgs/development/ocaml-modules/bitv/default.nix new file mode 100644 index 00000000000..07649f3655b --- /dev/null +++ b/pkgs/development/ocaml-modules/bitv/default.nix @@ -0,0 +1,31 @@ +{ stdenv, lib, fetchFromGitHub, autoreconfHook, which, ocaml, findlib }: + +if !lib.versionAtLeast ocaml.version "4.02" +then throw "bitv is not available for OCaml ${ocaml.version}" +else + +stdenv.mkDerivation rec { + pname = "ocaml${ocaml.version}-bitv"; + version = "1.3"; + + src = fetchFromGitHub { + owner = "backtracking"; + repo = "bitv"; + rev = version; + sha256 = "sha256-sZwq6c10hBBS9tGvKlWD9GE3JBrZPByfDrXE6xIPcG4="; + }; + + nativeBuildInputs = [ autoreconfHook which ocaml findlib ]; + + strictDeps = true; + + createFindlibDestdir = true; + + meta = { + description = "A bit vector library for OCaml"; + license = lib.licenses.lgpl21; + homepage = "https://github.com/backtracking/bitv"; + maintainers = [ lib.maintainers.vbgl ]; + inherit (ocaml.meta) platforms; + }; +} diff --git a/pkgs/development/ocaml-modules/bls12-381/default.nix b/pkgs/development/ocaml-modules/bls12-381/default.nix new file mode 100644 index 00000000000..0568f899032 --- /dev/null +++ b/pkgs/development/ocaml-modules/bls12-381/default.nix @@ -0,0 +1,31 @@ +{ lib, buildDunePackage, fetchFromGitLab, ff-sig, zarith }: + +buildDunePackage rec { + pname = "bls12-381"; + version = "1.1.0"; + + src = fetchFromGitLab { + owner = "dannywillems"; + repo = "ocaml-bls12-381"; + rev = "22247018c0651ea62ae898c8ffcc388cc73f758f"; + sha256 = "ku6Rc+/lwFDoHTZTxgkhiF+kLkagi7944ntcu9vXWgI="; + }; + + useDune2 = true; + + minimalOCamlVersion = "4.08"; + + propagatedBuildInputs = [ + ff-sig + zarith + ]; + + doCheck = true; + + meta = { + homepage = "https://gitlab.com/dannywillems/ocaml-bls12-381"; + description = "OCaml binding for bls12-381 from librustzcash"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.ulrikstrid ]; + }; +} diff --git a/pkgs/development/ocaml-modules/bls12-381/gen.nix b/pkgs/development/ocaml-modules/bls12-381/gen.nix new file mode 100644 index 00000000000..7949fe20438 --- /dev/null +++ b/pkgs/development/ocaml-modules/bls12-381/gen.nix @@ -0,0 +1,31 @@ +{ lib, fetchFromGitLab, buildDunePackage, ff-sig, zarith }: + +buildDunePackage rec { + pname = "bls12-381-gen"; + version = "0.4.4"; + + src = fetchFromGitLab { + owner = "dannywillems"; + repo = "ocaml-bls12-381"; + rev = "${version}-legacy"; + sha256 = "qocIfQdv9rniOUykRulu2zWsqkzT0OrsGczgVKALRuk="; + }; + + useDune2 = true; + + minimalOCamlVersion = "4.08"; + + propagatedBuildInputs = [ + ff-sig + zarith + ]; + + doCheck = true; + + meta = { + homepage = "https://gitlab.com/dannywillems/ocaml-bls12-381"; + description = "Functors to generate BLS12-381 primitives based on stubs"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.ulrikstrid ]; + }; +} diff --git a/pkgs/development/ocaml-modules/bls12-381/legacy.nix b/pkgs/development/ocaml-modules/bls12-381/legacy.nix new file mode 100644 index 00000000000..c72157c677e --- /dev/null +++ b/pkgs/development/ocaml-modules/bls12-381/legacy.nix @@ -0,0 +1,38 @@ +{ lib +, buildDunePackage +, fetchFromGitLab +, bls12-381-gen +, ctypes +, ff-pbt +, ff-sig +, tezos-rust-libs +, zarith +, alcotest +}: + +buildDunePackage rec { + pname = "bls12-381-legacy"; + + inherit (bls12-381-gen) version src useDune2 doCheck; + + minimalOCamlVersion = "4.08"; + + propagatedBuildInputs = [ + bls12-381-gen + ctypes + ff-pbt + ff-sig + tezos-rust-libs + zarith + ]; + + checkInputs = [ + alcotest + ]; + + meta = { + homepage = "https://gitlab.com/dannywillems/ocaml-bls12-381"; + description = "UNIX version of BLS12-381 primitives, not implementating the virtual package bls12-381"; + license = lib.licenses.mit; + }; +} diff --git a/pkgs/development/ocaml-modules/bls12-381/unix.nix b/pkgs/development/ocaml-modules/bls12-381/unix.nix new file mode 100644 index 00000000000..3ac3bb5d99f --- /dev/null +++ b/pkgs/development/ocaml-modules/bls12-381/unix.nix @@ -0,0 +1,34 @@ +{ lib +, buildDunePackage +, bls12-381 +, hex +, integers +, zarith +, alcotest +, bisect_ppx +, ff-pbt +}: + +buildDunePackage { + pname = "bls12-381-unix"; + + inherit (bls12-381) version src useDune2 doCheck; + + propagatedBuildInputs = [ + bls12-381 + hex + integers + zarith + ]; + + checkInputs = [ + alcotest + bisect_ppx + ff-pbt + ]; + + meta = { + description = "UNIX version of BLS12-381 primitives implementing the virtual package bls12-381"; + license = lib.licenses.mit; + }; +} diff --git a/pkgs/development/ocaml-modules/bolt/default.nix b/pkgs/development/ocaml-modules/bolt/default.nix new file mode 100644 index 00000000000..46e3b6f16cc --- /dev/null +++ b/pkgs/development/ocaml-modules/bolt/default.nix @@ -0,0 +1,69 @@ +{ lib, stdenv, fetchurl, fetchpatch, ocaml, findlib, ocamlbuild, which, camlp4 }: + +let inherit (lib) getVersion versionAtLeast; in + +assert versionAtLeast (getVersion ocaml) "4.00.0"; +assert versionAtLeast (getVersion findlib) "1.3.3"; + +if versionAtLeast ocaml.version "4.06" +then throw "bolt is not available for OCaml ${ocaml.version}" +else + +stdenv.mkDerivation rec { + pname = "bolt"; + version = "1.4"; + + src = fetchurl { + url = "https://forge.ocamlcore.org/frs/download.php/1043/bolt-${version}.tar.gz"; + sha256 = "1c807wrpxra9sbb34lajhimwra28ldxv04m570567lh2b04n38zy"; + }; + + nativeBuildInputs = [ ocaml findlib ocamlbuild which camlp4 ]; + + strictDeps = true; + + patches = [ + (fetchpatch { + url = "https://raw.githubusercontent.com/ocaml/opam-repository/master/packages/bolt/bolt.1.4/files/opam.patch"; + sha256 = "08cl39r98w312sw23cskd5wian6zg20isn9ki41hnbcgkazhi7pb"; + }) + ]; + + postPatch = '' + patch myocamlbuild.ml <<EOF +70,74c70 +< let camlp4of = +< try +< let path_bin = Filename.concat (Sys.getenv "PATH_OCAML_PREFIX") "bin" in +< Filename.concat path_bin "camlp4of" +< with _ -> "camlp4of" in +--- +> let camlp4of = "camlp4of" in +EOF + ''; + + # The custom `configure` script does not expect the --prefix + # option. Installation is handled by ocamlfind. + dontAddPrefix = true; + dontAddStaticConfigureFlags = true; + configurePlatforms = [ ]; + + createFindlibDestdir = true; + + buildFlags = [ "all" ]; + + doCheck = true; + checkTarget = "tests"; + + meta = with lib; { + homepage = "http://bolt.x9c.fr"; + description = "A logging tool for the OCaml language"; + longDescription = '' + Bolt is a logging tool for the OCaml language. It is inspired by and + modeled after the famous log4j logging framework for Java. + ''; + license = licenses.lgpl3; + platforms = ocaml.meta.platforms or [ ]; + maintainers = [ maintainers.jirkamarsik ]; + }; +} diff --git a/pkgs/development/ocaml-modules/bos/default.nix b/pkgs/development/ocaml-modules/bos/default.nix new file mode 100644 index 00000000000..07d4d4864d8 --- /dev/null +++ b/pkgs/development/ocaml-modules/bos/default.nix @@ -0,0 +1,29 @@ +{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, topkg +, astring, fmt, fpath, logs, rresult +}: + +stdenv.mkDerivation rec { + pname = "ocaml${ocaml.version}-bos"; + version = "0.2.0"; + + src = fetchurl { + url = "https://erratique.ch/software/bos/releases/bos-${version}.tbz"; + sha256 = "1s10iqx8rgnxr5n93lf4blwirjf8nlm272yg5sipr7lsr35v49wc"; + }; + + nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ]; + buildInputs = [ topkg ]; + propagatedBuildInputs = [ astring fmt fpath logs rresult ]; + + strictDeps = true; + + inherit (topkg) buildPhase installPhase; + + meta = { + description = "Basic OS interaction for OCaml"; + homepage = "https://erratique.ch/software/bos"; + license = lib.licenses.isc; + maintainers = [ lib.maintainers.vbgl ]; + inherit (ocaml.meta) platforms; + }; +} diff --git a/pkgs/development/ocaml-modules/bz2/default.nix b/pkgs/development/ocaml-modules/bz2/default.nix new file mode 100644 index 00000000000..4ac0262e1ee --- /dev/null +++ b/pkgs/development/ocaml-modules/bz2/default.nix @@ -0,0 +1,40 @@ +{ lib, stdenv, fetchFromGitLab, ocaml, findlib, bzip2, autoreconfHook }: + +if !lib.versionAtLeast ocaml.version "4.02" +then throw "bz2 is not available for OCaml ${ocaml.version}" +else + +stdenv.mkDerivation rec { + pname = "ocaml${ocaml.version}-bz2"; + version = "0.7.0"; + + src = fetchFromGitLab { + owner = "irill"; + repo = "camlbz2"; + rev = version; + sha256 = "sha256-jBFEkLN2fbC3LxTu7C0iuhvNg64duuckBHWZoBxrV/U="; + }; + + autoreconfFlags = "-I ."; + + nativeBuildInputs = [ + autoreconfHook + ocaml + findlib + ]; + + propagatedBuildInputs = [ + bzip2 + ]; + + strictDeps = true; + + preInstall = "mkdir -p $OCAMLFIND_DESTDIR/stublibs"; + + meta = with lib; { + description = "OCaml bindings for the libbz2 (AKA, bzip2) (de)compression library"; + downloadPage = "https://gitlab.com/irill/camlbz2"; + license = licenses.lgpl21; + maintainers = with maintainers; [ ]; + }; +} diff --git a/pkgs/development/ocaml-modules/ca-certs-nss/default.nix b/pkgs/development/ocaml-modules/ca-certs-nss/default.nix new file mode 100644 index 00000000000..987c325ee00 --- /dev/null +++ b/pkgs/development/ocaml-modules/ca-certs-nss/default.nix @@ -0,0 +1,51 @@ +{ lib +, buildDunePackage +, fetchurl +, mirage-crypto +, mirage-clock +, x509 +, logs +, fmt +, bos +, astring +, cmdliner +, alcotest +}: + +buildDunePackage rec { + pname = "ca-certs-nss"; + version = "3.74"; + + minimumOCamlVersion = "4.08"; + + src = fetchurl { + url = "https://github.com/mirage/ca-certs-nss/releases/download/v${version}/ca-certs-nss-${version}.tbz"; + sha256 = "c95f5b2e36a0564e6f65421e0e197d7cfe600d19eb492f8f27c4841cbe68b231"; + }; + + useDune2 = true; + + propagatedBuildInputs = [ + mirage-crypto + mirage-clock + x509 + ]; + + buildInputs = [ + logs + fmt + bos + astring + cmdliner + ]; + + doCheck = true; + checkInputs = [ alcotest ]; + + meta = with lib; { + license = licenses.isc; + description = "X.509 trust anchors extracted from Mozilla's NSS"; + maintainers = [ maintainers.sternenseemann ]; + homepage = "https://github.com/mirage/ca-certs-nss"; + }; +} diff --git a/pkgs/development/ocaml-modules/ca-certs/default.nix b/pkgs/development/ocaml-modules/ca-certs/default.nix new file mode 100644 index 00000000000..ce8993b465e --- /dev/null +++ b/pkgs/development/ocaml-modules/ca-certs/default.nix @@ -0,0 +1,34 @@ +{ lib, buildDunePackage, fetchurl +, bos, fpath, rresult, ptime, mirage-crypto, x509, astring, logs +, cacert, alcotest +}: + +buildDunePackage rec { + pname = "ca-certs"; + version = "0.2.1"; + + minimumOCamlVersion = "4.07"; + + src = fetchurl { + url = "https://github.com/mirage/ca-certs/releases/download/v${version}/ca-certs-v${version}.tbz"; + sha256 = "d43109496a5129feff967d557c556af96f8b10456896a405c43b7cf0c35d0af3"; + }; + + useDune2 = true; + + propagatedBuildInputs = [ bos fpath rresult ptime mirage-crypto x509 astring logs ]; + + # Assumes nss-cacert < 3.74 https://github.com/mirage/ca-certs/issues/21 + doCheck = false; + checkInputs = [ + cacert # for /etc/ssl/certs/ca-bundle.crt + alcotest + ]; + + meta = with lib; { + description = "Detect root CA certificates from the operating system"; + maintainers = [ maintainers.sternenseemann ]; + license = licenses.isc; + homepage = "https://github.com/mirage/ca-certs"; + }; +} diff --git a/pkgs/development/ocaml-modules/cairo2/default.nix b/pkgs/development/ocaml-modules/cairo2/default.nix new file mode 100644 index 00000000000..1801a0679b5 --- /dev/null +++ b/pkgs/development/ocaml-modules/cairo2/default.nix @@ -0,0 +1,35 @@ +{ stdenv, lib, fetchurl, buildDunePackage, ocaml, dune-configurator, pkg-config, cairo +, ApplicationServices }: + +buildDunePackage rec { + pname = "cairo2"; + version = "0.6.2"; + + src = fetchurl { + url = "https://github.com/Chris00/ocaml-cairo/releases/download/${version}/cairo2-${version}.tbz"; + sha256 = "sha256-a7P1kiVmIwT6Fhtwxs29ffgO4iexsulxUoc9cnJmEK4="; + }; + + minimalOCamlVersion = "4.02"; + useDune2 = true; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ cairo dune-configurator ] ++ lib.optionals stdenv.isDarwin [ ApplicationServices ]; + + doCheck = !(stdenv.isDarwin + # https://github.com/Chris00/ocaml-cairo/issues/19 + || lib.versionAtLeast ocaml.version "4.10"); + + meta = with lib; { + homepage = "https://github.com/Chris00/ocaml-cairo"; + description = "Binding to Cairo, a 2D Vector Graphics Library"; + longDescription = '' + This is a binding to Cairo, a 2D graphics library with support for + multiple output devices. Currently supported output targets include + the X Window System, Quartz, Win32, image buffers, PostScript, PDF, + and SVG file output. + ''; + license = licenses.lgpl3; + maintainers = with maintainers; [ jirkamarsik vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/calendar/default.nix b/pkgs/development/ocaml-modules/calendar/default.nix new file mode 100644 index 00000000000..4c089b76f3e --- /dev/null +++ b/pkgs/development/ocaml-modules/calendar/default.nix @@ -0,0 +1,27 @@ +{ stdenv, lib, fetchurl, ocaml, findlib }: + +stdenv.mkDerivation rec { + pname = "ocaml-calendar"; + version = "2.5"; + + src = fetchurl { + url = "https://forge.ocamlcore.org/frs/download.php/915/calendar-${version}.tar.bz2"; + sha256 = "04pvhwb664g3s644c7v7419a3kvf5s3pynkhmk5j59dvlfm1yf0f"; + }; + + nativeBuildInputs = [ ocaml findlib ]; + + strictDeps = true; + + createFindlibDestdir = true; + + meta = { + homepage = "https://forge.ocamlcore.org/projects/calendar/"; + description = "An Objective Caml library managing dates and times"; + license = "LGPL"; + platforms = ocaml.meta.platforms or [ ]; + maintainers = [ + lib.maintainers.gal_bolle + ]; + }; +} diff --git a/pkgs/development/ocaml-modules/callipyge/default.nix b/pkgs/development/ocaml-modules/callipyge/default.nix new file mode 100644 index 00000000000..a9dfb80f2a1 --- /dev/null +++ b/pkgs/development/ocaml-modules/callipyge/default.nix @@ -0,0 +1,36 @@ +{ lib +, buildDunePackage +, fetchurl +, ocaml + +, alcotest +, eqaf +, fmt +}: + +buildDunePackage rec { + pname = "callipyge"; + version = "0.2"; + + src = fetchurl { + url = "https://github.com/oklm-wsh/Callipyge/releases/download/v${version}/${pname}-${version}.tbz"; + sha256 = "sha256-T/94a88xvK51TggjXecdKc9kyTE9aIyueIt5T24sZB0="; + }; + + useDune2 = true; + + minimumOCamlVersion = "4.03"; + + propagatedBuildInputs = [ fmt eqaf ]; + + # alcotest isn't available for OCaml < 4.05 due to fmt + doCheck = lib.versionAtLeast ocaml.version "4.05"; + checkInputs = [ alcotest ]; + + meta = { + homepage = "https://github.com/oklm-wsh/Callipyge"; + description = "Curve25519 in OCaml"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ fufexan ]; + }; +} diff --git a/pkgs/development/ocaml-modules/camlimages/4.2.4.nix b/pkgs/development/ocaml-modules/camlimages/4.2.4.nix new file mode 100644 index 00000000000..b44fd7db6b3 --- /dev/null +++ b/pkgs/development/ocaml-modules/camlimages/4.2.4.nix @@ -0,0 +1,76 @@ +{ stdenv +, lib +, fetchFromGitLab +, ocaml +, findlib +, omake +, graphicsmagick +, libpng +, libjpeg +, libexif +, libtiff +, libXpm +, freetype +, giflib +, ghostscript +}: + +lib.throwIfNot (lib.versionAtLeast ocaml.version "4.02" && lib.versionOlder ocaml.version "4.10") + "camlimages 4.2.4 is not available for OCaml ${ocaml.version}" + +stdenv.mkDerivation rec { + name = "ocaml${ocaml.version}-${pname}-${version}"; + pname = "camlimages"; + version = "4.2.4"; + + src = fetchFromGitLab { + owner = "camlspotter"; + repo = pname; + rev = "c4f0ec4178fd18cb85872181965c5f020c349160"; + sha256 = "17hvsql5dml7ialjcags8wphs7w6z88b2rgjir1382bg8vn62bkr"; + }; + + nativeBuildInputs = [ + omake + ocaml + findlib + graphicsmagick + ]; + + propagatedBuildInputs = [ + libpng + libjpeg + libexif + libtiff + libXpm + freetype + giflib + ghostscript + ]; + + buildPhase = '' + runHook preBuild + omake + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + omake install + runHook postInstall + ''; + + createFindlibDestdir = true; + + meta = with lib; { + # 4.2.5 requires OCaml >= 4.06 + branch = "4.2.4"; + homepage = "https://gitlab.com/camlspotter/camlimages"; + description = "OCaml image processing library"; + license = licenses.lgpl2Only; + maintainers = [ + maintainers.vbgl + maintainers.sternenseemann + ]; + }; +} diff --git a/pkgs/development/ocaml-modules/camlimages/default.nix b/pkgs/development/ocaml-modules/camlimages/default.nix new file mode 100644 index 00000000000..a83c7c474ac --- /dev/null +++ b/pkgs/development/ocaml-modules/camlimages/default.nix @@ -0,0 +1,32 @@ +{ lib, fetchFromGitLab, buildDunePackage, dune-configurator, cppo +, graphics, lablgtk, stdio +}: + +buildDunePackage rec { + pname = "camlimages"; + version = "5.0.4"; + + useDune2 = true; + + minimumOCamlVersion = "4.07"; + + src = fetchFromGitLab { + owner = "camlspotter"; + repo = pname; + rev = version; + sha256 = "1m2c76ghisg73dikz2ifdkrbkgiwa0hcmp21f2fm2rkbf02rq3f4"; + }; + + strictDeps = true; + + nativeBuildInputs = [ cppo ]; + buildInputs = [ dune-configurator graphics lablgtk stdio ]; + + meta = with lib; { + branch = "5.0"; + inherit (src.meta) homepage; + description = "OCaml image processing library"; + license = licenses.lgpl2; + maintainers = [ maintainers.vbgl maintainers.mt-caret ]; + }; +} diff --git a/pkgs/development/ocaml-modules/camlpdf/default.nix b/pkgs/development/ocaml-modules/camlpdf/default.nix new file mode 100644 index 00000000000..06456b9c930 --- /dev/null +++ b/pkgs/development/ocaml-modules/camlpdf/default.nix @@ -0,0 +1,32 @@ +{ lib, stdenv, fetchFromGitHub, which, ocaml, findlib }: + +if !lib.versionAtLeast ocaml.version "4.10" +then throw "camlpdf is not available for OCaml ${ocaml.version}" +else + +stdenv.mkDerivation rec { + version = "2.5"; + pname = "ocaml${ocaml.version}-camlpdf"; + + src = fetchFromGitHub { + owner = "johnwhitington"; + repo = "camlpdf"; + rev = "v${version}"; + sha256 = "sha256:1qmsa0xgi960y7r20mvf8hxiiml7l1908s4dm7nq262f19w51gsl"; + }; + + nativeBuildInputs = [ which ocaml findlib ]; + + strictDeps = true; + + preInstall = '' + mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib/stublibs + ''; + + meta = with lib; { + description = "An OCaml library for reading, writing and modifying PDF files"; + homepage = "https://github.com/johnwhitington/camlpdf"; + license = licenses.lgpl21Plus; + maintainers = with maintainers; [vbgl]; + }; +} diff --git a/pkgs/development/ocaml-modules/camlzip/META b/pkgs/development/ocaml-modules/camlzip/META new file mode 100644 index 00000000000..44c5168ae51 --- /dev/null +++ b/pkgs/development/ocaml-modules/camlzip/META @@ -0,0 +1,6 @@ +version="@VERSION@" +description="reading and writing ZIP, JAR and GZIP files" +requires="unix" +archive(byte)="zip.cma" +archive(native)="zip.cmxa" +linkopts = "" diff --git a/pkgs/development/ocaml-modules/camlzip/default.nix b/pkgs/development/ocaml-modules/camlzip/default.nix new file mode 100644 index 00000000000..8124b8d8e43 --- /dev/null +++ b/pkgs/development/ocaml-modules/camlzip/default.nix @@ -0,0 +1,70 @@ +{lib, stdenv, fetchurl, zlib, ocaml, findlib}: + +let + param = + if lib.versionAtLeast ocaml.version "4.02" + then { + version = "1.10"; + url = "https://github.com/xavierleroy/camlzip/archive/rel110.tar.gz"; + sha256 = "X0YcczaQ3lFeJEiTIgjSSZ1zi32KFMtmZsP0FFpyfbI="; + patches = []; + postPatchInit = '' + cp META-zip META-camlzip + echo 'directory="../zip"' >> META-camlzip + ''; + } else { + version = "1.05"; + download_id = "1037"; + url = "http://forge.ocamlcore.org/frs/download.php/${param.download_id}/camlzip-${param.version}.tar.gz"; + sha256 = "930b70c736ab5a7ed1b05220102310a0a2241564786657abe418e834a538d06b"; + patches = [./makefile_1_05.patch]; + postPatchInit = '' + substitute ${./META} META --subst-var-by VERSION "${param.version}" + ''; + }; +in + +stdenv.mkDerivation { + pname = "camlzip"; + version = param.version; + + src = fetchurl { + inherit (param) url; + inherit (param) sha256; + }; + + nativeBuildInputs = [ ocaml findlib ]; + + propagatedBuildInputs = [zlib]; + + strictDeps = true; + + inherit (param) patches; + + createFindlibDestdir = true; + + postPatch = param.postPatchInit + '' + substituteInPlace Makefile \ + --subst-var-by ZLIB_LIBDIR "${zlib.out}/lib" \ + --subst-var-by ZLIB_INCLUDE "${zlib.dev}/include" + ''; + + buildFlags = [ "all" "allopt" ]; + + postInstall = '' + ln -s $out/lib/ocaml/${ocaml.version}/site-lib/{,caml}zip + ''; + + meta = with lib; { + homepage = "http://cristal.inria.fr/~xleroy/software.html#camlzip"; + description = "A library for handling ZIP and GZIP files in OCaml"; + longDescription = '' + This Objective Caml library provides easy access to compressed files in + ZIP and GZIP format, as well as to Java JAR files. It provides functions + for reading from and writing to compressed files in these formats. + ''; + license = "LGPL+linking exceptions"; + platforms = ocaml.meta.platforms or []; + maintainers = with maintainers; [ maggesi ]; + }; +} diff --git a/pkgs/development/ocaml-modules/camlzip/makefile_1_05.patch b/pkgs/development/ocaml-modules/camlzip/makefile_1_05.patch new file mode 100644 index 00000000000..87d0c8bec33 --- /dev/null +++ b/pkgs/development/ocaml-modules/camlzip/makefile_1_05.patch @@ -0,0 +1,54 @@ +diff -Nuar camlzip-1.04/Makefile camlzip-1.04.nixpkgs/Makefile +--- camlzip-1.04/Makefile 2002-04-22 17:28:57.000000000 +0200 ++++ camlzip-1.04.nixpkgs/Makefile 2010-12-12 18:30:49.000000000 +0100 +@@ -4,14 +4,10 @@ + ZLIB_LIB=-lz + + # The directory containing the Zlib library (libz.a or libz.so) +-ZLIB_LIBDIR=/usr/local/lib ++ZLIB_LIBDIR=@ZLIB_LIBDIR@ + + # The directory containing the Zlib header file (zlib.h) +-ZLIB_INCLUDE=/usr/local/include +- +-# Where to install the library. By default: sub-directory 'zip' of +-# OCaml's standard library directory. +-INSTALLDIR=`$(OCAMLC) -where`/zip ++ZLIB_INCLUDE=@ZLIB_INCLUDE@ + + ### End of configuration section + +@@ -19,10 +15,13 @@ + OCAMLOPT=ocamlopt + OCAMLDEP=ocamldep + OCAMLMKLIB=ocamlmklib ++OCAMLFIND=ocamlfind + + OBJS=zlib.cmo zip.cmo gzip.cmo + C_OBJS=zlibstubs.o + ++LIBINSTALL_FILES = $(wildcard *.mli *.cmi *.cma *.cmxa *.a *.so) ++ + all: libcamlzip.a zip.cma + + allopt: libcamlzip.a zip.cmxa +@@ -55,18 +54,7 @@ + rm -f *.o *.a + + install: +- mkdir -p $(INSTALLDIR) +- cp zip.cma zip.cmi gzip.cmi zip.mli gzip.mli libcamlzip.a $(INSTALLDIR) +- if test -f dllcamlzip.so; then \ +- cp dllcamlzip.so $(INSTALLDIR); \ +- ldconf=`$(OCAMLC) -where`/ld.conf; \ +- installdir=$(INSTALLDIR); \ +- if test `grep -s -c $$installdir'$$' $$ldconf || :` = 0; \ +- then echo $$installdir >> $$ldconf; fi \ +- fi +- +-installopt: +- cp zip.cmxa zip.a zip.cmx gzip.cmx $(INSTALLDIR) ++ $(OCAMLFIND) install zip META $(LIBINSTALL_FILES) + + depend: + gcc -MM -I$(ZLIB_INCLUDE) *.c > .depend diff --git a/pkgs/development/ocaml-modules/camomile/0.8.2.nix b/pkgs/development/ocaml-modules/camomile/0.8.2.nix new file mode 100644 index 00000000000..43bbfe7b6a6 --- /dev/null +++ b/pkgs/development/ocaml-modules/camomile/0.8.2.nix @@ -0,0 +1,32 @@ +{stdenv, lib, fetchurl, ocaml, findlib, camlp4}: + +if lib.versionAtLeast ocaml.version "4.05" +then throw "camomile-0.8.2 is not available for OCaml ${ocaml.version}" +else + +stdenv.mkDerivation rec { + pname = "camomile"; + version = "0.8.2"; + + src = fetchurl { + url = "mirror://sourceforge/camomile/camomile-${version}.tar.bz2"; + sha256 = "0x43pjxx70kgip86mmdn08s97k4qzdqc8i79xfyyx28smy1bsa00"; + }; + + nativeBuildInputs = [ ocaml findlib camlp4 ]; + + strictDeps = true; + + createFindlibDestdir = true; + + meta = { + homepage = "http://camomile.sourceforge.net/"; + description = "A comprehensive Unicode library for OCaml"; + license = lib.licenses.lgpl21; + branch = "0.8.2"; + platforms = ocaml.meta.platforms or []; + maintainers = [ + lib.maintainers.maggesi + ]; + }; +} diff --git a/pkgs/development/ocaml-modules/camomile/0.8.5.nix b/pkgs/development/ocaml-modules/camomile/0.8.5.nix new file mode 100644 index 00000000000..e6395383698 --- /dev/null +++ b/pkgs/development/ocaml-modules/camomile/0.8.5.nix @@ -0,0 +1,32 @@ +{stdenv, lib, fetchurl, fetchpatch, ocaml, findlib, camlp4}: + +stdenv.mkDerivation { + pname = "camomile"; + version = "0.8.5"; + + src = fetchurl { + url = "https://github.com/yoriyuki/Camomile/releases/download/rel-0.8.5/camomile-0.8.5.tar.bz2"; + sha256 = "003ikpvpaliy5hblhckfmln34zqz0mk3y2m1fqvbjngh3h2np045"; + }; + + patches = [ (fetchpatch { + url = "https://raw.githubusercontent.com/ocaml/opam-repository/master/packages/camomile/camomile.0.8.5/files/4.05-typing-fix.patch"; + sha256 = "167279lia6qx62mdcyc5rjsi4gf4yi52wn9mhgd9y1v3754z7fwb"; + })]; + + nativeBuildInputs = [ocaml findlib camlp4 ]; + + strictDeps = true; + + createFindlibDestdir = true; + + meta = { + homepage = "https://github.com/yoriyuki/Camomile/tree/master/Camomile"; + description = "A comprehensive Unicode library for OCaml"; + license = lib.licenses.lgpl21; + platforms = ocaml.meta.platforms or []; + maintainers = [ + lib.maintainers.maggesi + ]; + }; +} diff --git a/pkgs/development/ocaml-modules/camomile/default.nix b/pkgs/development/ocaml-modules/camomile/default.nix new file mode 100644 index 00000000000..e5fe6702131 --- /dev/null +++ b/pkgs/development/ocaml-modules/camomile/default.nix @@ -0,0 +1,36 @@ +{ lib, fetchFromGitHub, buildDunePackage, ocaml, cppo }: + +buildDunePackage rec { + pname = "camomile"; + version = "1.0.2"; + + useDune2 = true; + + src = fetchFromGitHub { + owner = "yoriyuki"; + repo = pname; + rev = version; + sha256 = "00i910qjv6bpk0nkafp5fg97isqas0bwjf7m6rz11rsxilpalzad"; + }; + + nativeBuildInputs = [ cppo ]; + + strictDeps = true; + + configurePhase = '' + runHook preConfigure + ocaml configure.ml --share $out/share/camomile + runHook postConfigure + ''; + + postInstall = '' + echo "version = \"${version}\"" >> $out/lib/ocaml/${ocaml.version}/site-lib/camomile/META + ''; + + meta = { + inherit (src.meta) homepage; + maintainers = [ lib.maintainers.vbgl ]; + license = lib.licenses.lgpl21; + description = "A Unicode library for OCaml"; + }; +} diff --git a/pkgs/development/ocaml-modules/caqti/async.nix b/pkgs/development/ocaml-modules/caqti/async.nix new file mode 100644 index 00000000000..0e0da6a94bb --- /dev/null +++ b/pkgs/development/ocaml-modules/caqti/async.nix @@ -0,0 +1,11 @@ +{ lib, buildDunePackage, async_kernel, async_unix, caqti, core_kernel }: + +buildDunePackage { + pname = "caqti-async"; + useDune2 = true; + inherit (caqti) version src; + + propagatedBuildInputs = [ async_kernel async_unix caqti core_kernel ]; + + meta = caqti.meta // { description = "Async support for Caqti"; }; +} diff --git a/pkgs/development/ocaml-modules/caqti/default.nix b/pkgs/development/ocaml-modules/caqti/default.nix new file mode 100644 index 00000000000..d9606cda1fa --- /dev/null +++ b/pkgs/development/ocaml-modules/caqti/default.nix @@ -0,0 +1,26 @@ +{ lib, fetchFromGitHub, buildDunePackage, cppo, logs, ptime, uri }: + +buildDunePackage rec { + pname = "caqti"; + version = "1.5.1"; + useDune2 = true; + + minimumOCamlVersion = "4.04"; + + src = fetchFromGitHub { + owner = "paurkedal"; + repo = "ocaml-${pname}"; + rev = "v${version}"; + sha256 = "1vl61kdyj89whc3mh4k9bis6rbj9x2scf6hnv9afyalp4j65sqx1"; + }; + + nativeBuildInputs = [ cppo ]; + propagatedBuildInputs = [ logs ptime uri ]; + + meta = { + description = "Unified interface to relational database libraries"; + license = "LGPL-3.0-or-later WITH OCaml-LGPL-linking-exception"; + maintainers = with lib.maintainers; [ bcc32 ]; + homepage = "https://github.com/paurkedal/ocaml-caqti"; + }; +} diff --git a/pkgs/development/ocaml-modules/caqti/driver-mariadb.nix b/pkgs/development/ocaml-modules/caqti/driver-mariadb.nix new file mode 100644 index 00000000000..5f4f681540e --- /dev/null +++ b/pkgs/development/ocaml-modules/caqti/driver-mariadb.nix @@ -0,0 +1,13 @@ +{ lib, buildDunePackage, caqti, mariadb }: + +buildDunePackage { + pname = "caqti-driver-mariadb"; + useDune2 = true; + inherit (caqti) version src; + + propagatedBuildInputs = [ caqti mariadb ]; + + meta = caqti.meta // { + description = "MariaDB driver for Caqti using C bindings"; + }; +} diff --git a/pkgs/development/ocaml-modules/caqti/driver-postgresql.nix b/pkgs/development/ocaml-modules/caqti/driver-postgresql.nix new file mode 100644 index 00000000000..a1b427a5edf --- /dev/null +++ b/pkgs/development/ocaml-modules/caqti/driver-postgresql.nix @@ -0,0 +1,13 @@ +{ lib, buildDunePackage, caqti, postgresql }: + +buildDunePackage { + pname = "caqti-driver-postgresql"; + useDune2 = true; + inherit (caqti) version src; + + propagatedBuildInputs = [ caqti postgresql ]; + + meta = caqti.meta // { + description = "PostgreSQL driver for Caqti based on C bindings"; + }; +} diff --git a/pkgs/development/ocaml-modules/caqti/driver-sqlite3.nix b/pkgs/development/ocaml-modules/caqti/driver-sqlite3.nix new file mode 100644 index 00000000000..5282ba5ef50 --- /dev/null +++ b/pkgs/development/ocaml-modules/caqti/driver-sqlite3.nix @@ -0,0 +1,13 @@ +{ lib, buildDunePackage, caqti, ocaml_sqlite3 }: + +buildDunePackage { + pname = "caqti-driver-sqlite3"; + useDune2 = true; + inherit (caqti) version src; + + propagatedBuildInputs = [ caqti ocaml_sqlite3 ]; + + meta = caqti.meta // { + description = "Sqlite3 driver for Caqti using C bindings"; + }; +} diff --git a/pkgs/development/ocaml-modules/caqti/dynload.nix b/pkgs/development/ocaml-modules/caqti/dynload.nix new file mode 100644 index 00000000000..6ed86683728 --- /dev/null +++ b/pkgs/development/ocaml-modules/caqti/dynload.nix @@ -0,0 +1,13 @@ +{ lib, buildDunePackage, caqti }: + +buildDunePackage { + pname = "caqti-dynload"; + useDune2 = true; + inherit (caqti) version src; + + propagatedBuildInputs = [ caqti ]; + + meta = caqti.meta // { + description = "Dynamic linking of Caqti drivers using findlib.dynload"; + }; +} diff --git a/pkgs/development/ocaml-modules/caqti/lwt.nix b/pkgs/development/ocaml-modules/caqti/lwt.nix new file mode 100644 index 00000000000..f02fa377f80 --- /dev/null +++ b/pkgs/development/ocaml-modules/caqti/lwt.nix @@ -0,0 +1,11 @@ +{ lib, buildDunePackage, caqti, logs, lwt }: + +buildDunePackage { + pname = "caqti-lwt"; + useDune2 = true; + inherit (caqti) version src; + + propagatedBuildInputs = [ caqti logs lwt ]; + + meta = caqti.meta // { description = "Lwt support for Caqti"; }; +} diff --git a/pkgs/development/ocaml-modules/caqti/type-calendar.nix b/pkgs/development/ocaml-modules/caqti/type-calendar.nix new file mode 100644 index 00000000000..d2050e2cf47 --- /dev/null +++ b/pkgs/development/ocaml-modules/caqti/type-calendar.nix @@ -0,0 +1,14 @@ +{ lib, buildDunePackage, calendar, caqti }: + +buildDunePackage { + pname = "caqti-type-calendar"; + version = "1.2.0"; + useDune2 = true; + inherit (caqti) src; + + propagatedBuildInputs = [ calendar caqti ]; + + meta = caqti.meta // { + description = "Date and time field types using the calendar library"; + }; +} diff --git a/pkgs/development/ocaml-modules/carton/default.nix b/pkgs/development/ocaml-modules/carton/default.nix new file mode 100644 index 00000000000..6868ddc7851 --- /dev/null +++ b/pkgs/development/ocaml-modules/carton/default.nix @@ -0,0 +1,69 @@ +{ lib, buildDunePackage, fetchurl +, ke, duff, decompress, cstruct, optint, bigstringaf, stdlib-shims +, bigarray-compat, checkseum, logs, psq, fmt +, result, rresult, fpath, base64, bos, digestif, mmap, alcotest +, crowbar, alcotest-lwt, lwt, findlib, mirage-flow, cmdliner, hxd +}: + +buildDunePackage rec { + pname = "carton"; + version = "0.4.3"; + + useDune2 = true; + minimalOCamlVersion = "4.08"; + + src = fetchurl { + url = "https://github.com/mirage/ocaml-git/releases/download/${pname}-v${version}/${pname}-${pname}-v${version}.tbz"; + sha256 = "sha256:0qz9ds5761wx4m7ly3av843b6dii7lmjpx2nnyijv8rm8aw95jgr"; + }; + + # remove changelogs for mimic and the git* packages + postPatch = '' + rm CHANGES.md + ''; + + buildInputs = [ + cmdliner + digestif + mmap + result + rresult + fpath + bos + hxd + ]; + propagatedBuildInputs = [ + ke + duff + decompress + cstruct + optint + bigstringaf + stdlib-shims + bigarray-compat + checkseum + logs + psq + fmt + ]; + + doCheck = true; + nativeBuildInputs = [ + findlib + ]; + checkInputs = [ + base64 + alcotest + alcotest-lwt + crowbar + lwt + mirage-flow + ]; + + meta = with lib; { + description = "Implementation of PACKv2 file in OCaml"; + license = licenses.mit; + homepage = "https://github.com/mirage/ocaml-git"; + maintainers = [ maintainers.sternenseemann ]; + }; +} diff --git a/pkgs/development/ocaml-modules/carton/git.nix b/pkgs/development/ocaml-modules/carton/git.nix new file mode 100644 index 00000000000..4f7c880ae06 --- /dev/null +++ b/pkgs/development/ocaml-modules/carton/git.nix @@ -0,0 +1,28 @@ +{ buildDunePackage, carton, carton-lwt +, bigarray-compat, bigstringaf, lwt, fpath, result +, mmap, fmt, decompress, astring +, alcotest, alcotest-lwt, cstruct, logs +, mirage-flow, rresult, ke +}: + +buildDunePackage { + pname = "carton-git"; + + inherit (carton) version src useDune2 postPatch; + + propagatedBuildInputs = [ + carton + carton-lwt + bigarray-compat + bigstringaf + lwt + fpath + result + mmap + fmt + decompress + astring + ]; + + inherit (carton) meta; +} diff --git a/pkgs/development/ocaml-modules/carton/lwt.nix b/pkgs/development/ocaml-modules/carton/lwt.nix new file mode 100644 index 00000000000..17ba5dddf24 --- /dev/null +++ b/pkgs/development/ocaml-modules/carton/lwt.nix @@ -0,0 +1,46 @@ +{ buildDunePackage, carton +, lwt, decompress, optint, bigstringaf +, alcotest, alcotest-lwt, cstruct, fmt, logs +, mirage-flow, result, rresult, bigarray-compat +, ke, base64, bos, checkseum, digestif, fpath, mmap +, stdlib-shims +, git-binary # pkgs.git +}: + +buildDunePackage { + pname = "carton-lwt"; + + inherit (carton) version src useDune2 postPatch; + + propagatedBuildInputs = [ + carton + lwt + decompress + optint + bigstringaf + ]; + + doCheck = true; + checkInputs = [ + git-binary + alcotest + alcotest-lwt + cstruct + fmt + logs + mirage-flow + result + rresult + bigarray-compat + ke + base64 + bos + checkseum + digestif + fpath + mmap + stdlib-shims + ]; + + inherit (carton) meta; +} diff --git a/pkgs/development/ocaml-modules/cfstream/default.nix b/pkgs/development/ocaml-modules/cfstream/default.nix new file mode 100644 index 00000000000..62a29a5d414 --- /dev/null +++ b/pkgs/development/ocaml-modules/cfstream/default.nix @@ -0,0 +1,35 @@ +{ lib, buildDunePackage, fetchFromGitHub, m4, core_kernel, ounit }: + +buildDunePackage rec { + pname = "cfstream"; + version = "1.3.1"; + + useDune2 = true; + + minimumOCamlVersion = "4.04.1"; + + src = fetchFromGitHub { + owner = "biocaml"; + repo = pname; + rev = version; + sha256 = "0qnxfp6y294gjsccx7ksvwn9x5q20hi8sg24rjypzsdkmlphgdnd"; + }; + + patches = [ ./git_commit.patch ]; + + # This currently fails with dune + strictDeps = false; + + nativeBuildInputs = [ m4 ]; + checkInputs = [ ounit ]; + propagatedBuildInputs = [ core_kernel ]; + + doCheck = true; + + meta = with lib; { + inherit (src.meta) homepage; + description = "Simple Core-inspired wrapper for standard library Stream module"; + maintainers = [ maintainers.bcdarwin ]; + license = licenses.lgpl21; + }; +} diff --git a/pkgs/development/ocaml-modules/cfstream/git_commit.patch b/pkgs/development/ocaml-modules/cfstream/git_commit.patch new file mode 100644 index 00000000000..596cfdc7092 --- /dev/null +++ b/pkgs/development/ocaml-modules/cfstream/git_commit.patch @@ -0,0 +1,13 @@ +diff --git a/lib/dune b/lib/dune +index 2266b87..344c704 100644 +--- a/lib/dune ++++ b/lib/dune +@@ -8,7 +8,7 @@ + (rule + (targets GIT_COMMIT) + (deps (:x ../bin/git_commit.sh)) +- (action (with-stdout-to %{targets} (run %{x}))) ++ (action (with-stdout-to %{targets} (run echo None))) + ) + + (rule diff --git a/pkgs/development/ocaml-modules/chacha/default.nix b/pkgs/development/ocaml-modules/chacha/default.nix new file mode 100644 index 00000000000..21bae79ab5f --- /dev/null +++ b/pkgs/development/ocaml-modules/chacha/default.nix @@ -0,0 +1,41 @@ +{ lib +, buildDunePackage +, fetchurl +, ocaml + +, alcotest +, cstruct +, mirage-crypto +}: + +buildDunePackage rec { + pname = "chacha"; + version = "1.0.0"; + + src = fetchurl { + url = "https://github.com/abeaumont/ocaml-chacha/releases/download/${version}/${pname}-${version}.tbz"; + sha256 = "sha256-t8dOMQQDpje0QbuOhjSIa3xnXuXcxMVTLENa/rwdgA4="; + }; + + useDune2 = true; + + minimumOCamlVersion = "4.02"; + + propagatedBuildInputs = [ cstruct mirage-crypto ]; + + # alcotest isn't available for OCaml < 4.05 due to fmt + doCheck = lib.versionAtLeast ocaml.version "4.05"; + checkInputs = [ alcotest ]; + + meta = { + homepage = "https://github.com/abeaumont/ocaml-chacha"; + description = "ChaCha20, ChaCha12 and ChaCha8 encryption functions, in OCaml"; + longDescription = '' + An OCaml implementation of ChaCha functions, both ChaCha20 and the reduced + ChaCha8 and ChaCha12 functions. The hot loop is implemented in C for efficiency + reasons. + ''; + license = lib.licenses.bsd2; + maintainers = with lib.maintainers; [ fufexan ]; + }; +} diff --git a/pkgs/development/ocaml-modules/charInfo_width/default.nix b/pkgs/development/ocaml-modules/charInfo_width/default.nix new file mode 100644 index 00000000000..5b9814cea69 --- /dev/null +++ b/pkgs/development/ocaml-modules/charInfo_width/default.nix @@ -0,0 +1,20 @@ +{ lib, fetchzip, buildDunePackage, camomile, result }: + +buildDunePackage rec { + pname = "charInfo_width"; + version = "1.1.0"; + useDune2 = true; + src = fetchzip { + url = "https://bitbucket.org/zandoye/charinfo_width/get/${version}.tar.bz2"; + sha256 = "19mnq9a1yr16srqs8n6hddahr4f9d2gbpmld62pvlw1ps7nfrp9w"; + }; + + propagatedBuildInputs = [ camomile result ]; + + meta = { + homepage = "https://bitbucket.org/zandoye/charinfo_width/"; + description = "Determine column width for a character"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/checkseum/default.nix b/pkgs/development/ocaml-modules/checkseum/default.nix new file mode 100644 index 00000000000..3a07707a4cd --- /dev/null +++ b/pkgs/development/ocaml-modules/checkseum/default.nix @@ -0,0 +1,47 @@ +{ lib, fetchurl, buildDunePackage, dune-configurator, pkg-config +, bigarray-compat, optint +, fmt, rresult, bos, fpath, astring, alcotest +, withFreestanding ? false +, ocaml-freestanding +}: + +buildDunePackage rec { + version = "0.3.2"; + pname = "checkseum"; + + useDune2 = true; + + minimumOCamlVersion = "4.07"; + + src = fetchurl { + url = "https://github.com/mirage/checkseum/releases/download/v${version}/checkseum-v${version}.tbz"; + sha256 = "9cdd282ea1cfc424095d7284e39e4d0ad091de3c3f2580539d03f6966d45ccd5"; + }; + + buildInputs = [ dune-configurator ]; + nativeBuildInputs = [ pkg-config ]; + propagatedBuildInputs = [ + bigarray-compat + optint + ] ++ lib.optionals withFreestanding [ + ocaml-freestanding + ]; + + checkInputs = [ + alcotest + bos + astring + fmt + fpath + rresult + ]; + + doCheck = true; + + meta = { + homepage = "https://github.com/mirage/checkseum"; + description = "ADLER-32 and CRC32C Cyclic Redundancy Check"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/cil/default.nix b/pkgs/development/ocaml-modules/cil/default.nix new file mode 100644 index 00000000000..7a8a3f2e70a --- /dev/null +++ b/pkgs/development/ocaml-modules/cil/default.nix @@ -0,0 +1,35 @@ +{ lib, stdenv, fetchurl, perl, ocaml, findlib, ocamlbuild }: + +if lib.versionAtLeast ocaml.version "4.06" +then throw "cil is not available for OCaml ${ocaml.version}" +else + +stdenv.mkDerivation rec { + pname = "ocaml-cil"; + version = "1.7.3"; + + src = fetchurl { + url = "mirror://sourceforge/cil/cil-${version}.tar.gz"; + sha256 = "05739da0b0msx6kmdavr3y2bwi92jbh3szc35d7d8pdisa8g5dv9"; + }; + + nativeBuildInputs = [ perl ocaml findlib ocamlbuild ]; + + strictDeps = true; + + createFindlibDestdir = true; + + preConfigure = '' + substituteInPlace Makefile.in --replace 'MACHDEPCC=gcc' 'MACHDEPCC=$(CC)' + export FORCE_PERL_PREFIX=1 + ''; + prefixKey = "-prefix="; + + meta = with lib; { + homepage = "http://kerneis.github.io/cil/"; + description = "A front-end for the C programming language that facilitates program analysis and transformation"; + license = licenses.bsd3; + maintainers = [ maintainers.vbgl ]; + platforms = ocaml.meta.platforms or [ ]; + }; +} diff --git a/pkgs/development/ocaml-modules/cmdliner/default.nix b/pkgs/development/ocaml-modules/cmdliner/default.nix new file mode 100644 index 00000000000..9536cc25290 --- /dev/null +++ b/pkgs/development/ocaml-modules/cmdliner/default.nix @@ -0,0 +1,41 @@ +{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg, result }: + +let + pname = "cmdliner"; +in + +assert lib.versionAtLeast ocaml.version "4.01.0"; + +let param = + if lib.versionAtLeast ocaml.version "4.03" then { + version = "1.0.4"; + sha256 = "1h04q0zkasd0mw64ggh4y58lgzkhg6yhzy60lab8k8zq9ba96ajw"; + } else { + version = "1.0.2"; + sha256 = "18jqphjiifljlh9jg8zpl6310p3iwyaqphdkmf89acyaix0s4kj1"; + } +; in + +stdenv.mkDerivation rec { + name = "ocaml${ocaml.version}-${pname}-${version}"; + inherit (param) version; + + src = fetchurl { + url = "https://erratique.ch/software/${pname}/releases/${pname}-${version}.tbz"; + inherit (param) sha256; + }; + + nativeBuildInputs = [ ocaml ocamlbuild findlib topkg ]; + buildInputs = [ topkg ]; + propagatedBuildInputs = [ result ]; + + inherit (topkg) buildPhase installPhase; + + meta = with lib; { + homepage = "https://erratique.ch/software/cmdliner"; + description = "An OCaml module for the declarative definition of command line interfaces"; + license = licenses.bsd3; + platforms = ocaml.meta.platforms or []; + maintainers = [ maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/cohttp/async.nix b/pkgs/development/ocaml-modules/cohttp/async.nix new file mode 100644 index 00000000000..060d2c6fb6a --- /dev/null +++ b/pkgs/development/ocaml-modules/cohttp/async.nix @@ -0,0 +1,60 @@ +{ lib +, buildDunePackage +, ppx_sexp_conv +, base +, async +, async_kernel +, async_unix +, cohttp +, conduit-async +, uri +, uri-sexp +, logs +, fmt +, sexplib0 +, ipaddr +, magic-mime +, ounit +, mirage-crypto +, core +}: + +buildDunePackage { + pname = "cohttp-async"; + + inherit (cohttp) + version + src + minimumOCamlVersion + useDune2 + ; + + buildInputs = [ ppx_sexp_conv ]; + + propagatedBuildInputs = [ + cohttp + conduit-async + async_kernel + async_unix + async + base + magic-mime + logs + fmt + sexplib0 + uri + uri-sexp + ipaddr + ]; + + doCheck = true; + checkInputs = [ + ounit + mirage-crypto + core + ]; + + meta = cohttp.meta // { + description = "CoHTTP implementation for the Async concurrency library"; + }; +} diff --git a/pkgs/development/ocaml-modules/cohttp/default.nix b/pkgs/development/ocaml-modules/cohttp/default.nix new file mode 100644 index 00000000000..c1dc973d0ee --- /dev/null +++ b/pkgs/development/ocaml-modules/cohttp/default.nix @@ -0,0 +1,32 @@ +{ lib, fetchurl, buildDunePackage +, ppx_sexp_conv, base64, jsonm, re, stringext, uri-sexp +, ocaml, fmt, alcotest +}: + +buildDunePackage rec { + pname = "cohttp"; + version = "4.0.0"; + + useDune2 = true; + + minimumOCamlVersion = "4.08"; + + src = fetchurl { + url = "https://github.com/mirage/ocaml-cohttp/releases/download/v${version}/cohttp-v${version}.tbz"; + sha256 = "bd7aa4cd2c82744990ed7c49e3ee7a40324c64cb3d8509804809155e2bacd1d2"; + }; + + buildInputs = [ jsonm ppx_sexp_conv ]; + + propagatedBuildInputs = [ base64 re stringext uri-sexp ]; + + doCheck = lib.versionAtLeast ocaml.version "4.05"; + checkInputs = [ fmt alcotest ]; + + meta = { + description = "HTTP(S) library for Lwt, Async and Mirage"; + license = lib.licenses.isc; + maintainers = [ lib.maintainers.vbgl ]; + homepage = "https://github.com/mirage/ocaml-cohttp"; + }; +} diff --git a/pkgs/development/ocaml-modules/cohttp/lwt-unix.nix b/pkgs/development/ocaml-modules/cohttp/lwt-unix.nix new file mode 100644 index 00000000000..57885b0e65e --- /dev/null +++ b/pkgs/development/ocaml-modules/cohttp/lwt-unix.nix @@ -0,0 +1,28 @@ +{ lib, buildDunePackage, cohttp-lwt +, conduit-lwt-unix, conduit-lwt, ppx_sexp_conv +, cmdliner, fmt, logs, magic-mime +, ounit +, cacert +}: + +buildDunePackage { + pname = "cohttp-lwt-unix"; + inherit (cohttp-lwt) version src; + + useDune2 = true; + + buildInputs = [ cmdliner ppx_sexp_conv ]; + + propagatedBuildInputs = [ + cohttp-lwt conduit-lwt conduit-lwt-unix fmt logs magic-mime + ]; + + # TODO(@sternenseemann): fail for unknown reason + # https://github.com/mirage/ocaml-cohttp/issues/675#issuecomment-830692742 + doCheck = false; + checkInputs = [ ounit cacert ]; + + meta = cohttp-lwt.meta // { + description = "CoHTTP implementation for Unix and Windows using Lwt"; + }; +} diff --git a/pkgs/development/ocaml-modules/cohttp/lwt.nix b/pkgs/development/ocaml-modules/cohttp/lwt.nix new file mode 100644 index 00000000000..158aa3b27b2 --- /dev/null +++ b/pkgs/development/ocaml-modules/cohttp/lwt.nix @@ -0,0 +1,21 @@ +{ lib, buildDunePackage, cohttp, ocaml_lwt, uri, ppx_sexp_conv, logs, sexplib0 }: + +buildDunePackage { + pname = "cohttp-lwt"; + inherit (cohttp) + version + src + useDune2 + minimumOCamlVersion + ; + + buildInputs = [ ppx_sexp_conv ]; + + propagatedBuildInputs = [ + cohttp ocaml_lwt logs sexplib0 uri + ]; + + meta = cohttp.meta // { + description = "CoHTTP implementation using the Lwt concurrency library"; + }; +} diff --git a/pkgs/development/ocaml-modules/cohttp/mirage.nix b/pkgs/development/ocaml-modules/cohttp/mirage.nix new file mode 100644 index 00000000000..d2d3e945645 --- /dev/null +++ b/pkgs/development/ocaml-modules/cohttp/mirage.nix @@ -0,0 +1,23 @@ +{ buildDunePackage, cohttp, cohttp-lwt +, mirage-flow, mirage-channel, mirage-kv +, conduit, conduit-mirage, lwt +, astring, magic-mime +, ppx_sexp_conv +}: + +buildDunePackage { + pname = "cohttp-mirage"; + + inherit (cohttp) version src minimumOCamlVersion useDune2; + + nativeBuildInputs = [ ppx_sexp_conv ]; + + propagatedBuildInputs = [ + mirage-flow mirage-channel conduit conduit-mirage mirage-kv + lwt cohttp cohttp-lwt astring magic-mime + ]; + + meta = cohttp.meta // { + description = "CoHTTP implementation for the MirageOS unikernel"; + }; +} diff --git a/pkgs/development/ocaml-modules/coin/default.nix b/pkgs/development/ocaml-modules/coin/default.nix new file mode 100644 index 00000000000..f2e0919bdee --- /dev/null +++ b/pkgs/development/ocaml-modules/coin/default.nix @@ -0,0 +1,40 @@ +{ buildDunePackage +, fetchzip +, findlib +, lib +, menhir +, ocaml +, re +}: + +buildDunePackage rec { + pname = "coin"; + version = "0.1.3"; + minimalOCamlVersion = "4.03"; + + src = fetchzip { + url = "https://github.com/mirage/coin/releases/download/v${version}/coin-v${version}.tbz"; + sha256 = "06bfidvglyp9hzvr2xwbdx8wf26is2xrzc31fldzjf5ab0vd076p"; + }; + + postPatch = '' + substituteInPlace src/dune --replace 'ocaml} ' \ + 'ocaml} -I ${findlib}/lib/ocaml/${ocaml.version}/site-lib ' + ''; + + useDune2 = true; + + nativeBuildInputs = [ menhir findlib ]; + buildInputs = [ re ]; + + strictDeps = true; + + doCheck = true; + + meta = { + description = "A library to normalize an KOI8-{U,R} input to Unicode"; + license = lib.licenses.mit; + homepage = "https://github.com/mirage/coin"; + maintainers = with lib.maintainers; [ ]; + }; +} diff --git a/pkgs/development/ocaml-modules/color/default.nix b/pkgs/development/ocaml-modules/color/default.nix new file mode 100644 index 00000000000..84d2f11d862 --- /dev/null +++ b/pkgs/development/ocaml-modules/color/default.nix @@ -0,0 +1,29 @@ +{ lib +, fetchurl +, buildDunePackage +, gg +}: + +buildDunePackage rec { + pname = "color"; + version = "0.2.0"; + + useDune2 = true; + minimalOCamlVersion = "4.05"; + + src = fetchurl { + url = "https://github.com/anuragsoni/color/releases/download/${version}/color-${version}.tbz"; + sha256 = "0wg3a36i1a7fnz5pf57qzbdghwr6dzp7nnxyrz9m9765lxsn65ph"; + }; + + propagatedBuildInputs = [ + gg + ]; + + meta = with lib; { + description = "Converts between different color formats"; + license = licenses.mit; + maintainers = with maintainers; [ fgaz ]; + homepage = "https://github.com/anuragsoni/color"; + }; +} diff --git a/pkgs/development/ocaml-modules/comparelib/default.nix b/pkgs/development/ocaml-modules/comparelib/default.nix new file mode 100644 index 00000000000..1da631d683c --- /dev/null +++ b/pkgs/development/ocaml-modules/comparelib/default.nix @@ -0,0 +1,25 @@ +{ lib, buildOcaml, fetchFromGitHub, type_conv, camlp4 }: + +buildOcaml rec { + pname = "comparelib"; + version = "113.00.00"; + + minimumSupportedOcamlVersion = "4.00"; + + src = fetchFromGitHub { + owner = "janestreet"; + repo = "comparelib"; + rev = version; + sha256 = "sha256-gtJvXAUxiIt/L9bCzS+8wHcCQ+QpBubwcjDcyN0K2MA="; + }; + + buildInputs = [ camlp4 ]; + propagatedBuildInputs = [ type_conv ]; + + meta = with lib; { + homepage = "https://github.com/janestreet/comparelib"; + description = "Syntax extension for deriving \"compare\" functions automatically"; + license = licenses.asl20; + maintainers = [ maintainers.ericbmerritt ]; + }; +} diff --git a/pkgs/development/ocaml-modules/conduit/async.nix b/pkgs/development/ocaml-modules/conduit/async.nix new file mode 100644 index 00000000000..1be437b4ee7 --- /dev/null +++ b/pkgs/development/ocaml-modules/conduit/async.nix @@ -0,0 +1,30 @@ +{ lib, buildDunePackage, async, async_ssl, ppx_sexp_conv, ppx_here, uri, conduit +, core, ipaddr, ipaddr-sexp, sexplib +}: + +buildDunePackage { + pname = "conduit-async"; + inherit (conduit) + version + src + minimumOCamlVersion + useDune2 + ; + + buildInputs = [ ppx_sexp_conv ppx_here ]; + + propagatedBuildInputs = [ + async + async_ssl + conduit + uri + ipaddr + ipaddr-sexp + core + sexplib + ]; + + meta = conduit.meta // { + description = "A network connection establishment library for Async"; + }; +} diff --git a/pkgs/development/ocaml-modules/conduit/default.nix b/pkgs/development/ocaml-modules/conduit/default.nix new file mode 100644 index 00000000000..1dc28b2b5f7 --- /dev/null +++ b/pkgs/development/ocaml-modules/conduit/default.nix @@ -0,0 +1,27 @@ +{ lib, fetchurl, buildDunePackage +, ppx_sexp_conv, sexplib, astring, uri, logs +, ipaddr, ipaddr-sexp +}: + +buildDunePackage rec { + pname = "conduit"; + version = "4.0.2"; + useDune2 = true; + + minimumOCamlVersion = "4.03"; + + src = fetchurl { + url = "https://github.com/mirage/ocaml-conduit/releases/download/v${version}/conduit-v${version}.tbz"; + sha256 = "2a37ffaa352a1e145ef3d80ac28661213c69a741b238623e59f29e3d5a12c537"; + }; + + buildInputs = [ ppx_sexp_conv ]; + propagatedBuildInputs = [ astring ipaddr ipaddr-sexp sexplib uri logs ]; + + meta = { + description = "A network connection establishment library"; + license = lib.licenses.isc; + maintainers = with lib.maintainers; [ alexfmpe vbgl ]; + homepage = "https://github.com/mirage/ocaml-conduit"; + }; +} diff --git a/pkgs/development/ocaml-modules/conduit/lwt-unix.nix b/pkgs/development/ocaml-modules/conduit/lwt-unix.nix new file mode 100644 index 00000000000..ce6016012d7 --- /dev/null +++ b/pkgs/development/ocaml-modules/conduit/lwt-unix.nix @@ -0,0 +1,33 @@ +{ buildDunePackage +, conduit-lwt, ppx_sexp_conv, ocaml_lwt, uri, ipaddr, ipaddr-sexp, ca-certs, logs +, lwt_ssl, tls, lwt_log, ssl +}: + +buildDunePackage { + pname = "conduit-lwt-unix"; + inherit (conduit-lwt) version src minimumOCamlVersion useDune2; + + buildInputs = [ ppx_sexp_conv ]; + + propagatedBuildInputs = [ + conduit-lwt + ocaml_lwt + uri + ipaddr + ipaddr-sexp + tls + ca-certs + logs + lwt_ssl + ]; + + doCheck = true; + checkInputs = [ + lwt_log + ssl + ]; + + meta = conduit-lwt.meta // { + description = "A network connection establishment library for Lwt_unix"; + }; +} diff --git a/pkgs/development/ocaml-modules/conduit/lwt.nix b/pkgs/development/ocaml-modules/conduit/lwt.nix new file mode 100644 index 00000000000..2f18027a67b --- /dev/null +++ b/pkgs/development/ocaml-modules/conduit/lwt.nix @@ -0,0 +1,14 @@ +{ buildDunePackage, ppx_sexp_conv, conduit, ocaml_lwt, sexplib }: + +buildDunePackage { + pname = "conduit-lwt"; + inherit (conduit) version src useDune2 minimumOCamlVersion; + + buildInputs = [ ppx_sexp_conv ]; + + propagatedBuildInputs = [ conduit ocaml_lwt sexplib ]; + + meta = conduit.meta // { + description = "A network connection establishment library for Lwt"; + }; +} diff --git a/pkgs/development/ocaml-modules/conduit/mirage.nix b/pkgs/development/ocaml-modules/conduit/mirage.nix new file mode 100644 index 00000000000..d1f636be93c --- /dev/null +++ b/pkgs/development/ocaml-modules/conduit/mirage.nix @@ -0,0 +1,25 @@ +{ buildDunePackage, conduit-lwt +, ppx_sexp_conv, sexplib, uri, cstruct, mirage-stack, mirage-flow +, mirage-flow-combinators, mirage-random, mirage-time, mirage-clock +, dns-client, vchan, xenstore, tls, tls-mirage, ipaddr, ipaddr-sexp +, tcpip, ca-certs-nss +}: + +buildDunePackage { + pname = "conduit-mirage"; + + inherit (conduit-lwt) version src minimumOCamlVersion useDune2; + + nativeBuildInputs = [ ppx_sexp_conv ]; + + propagatedBuildInputs = [ + sexplib uri cstruct mirage-stack mirage-clock mirage-flow + mirage-flow-combinators mirage-random mirage-time + dns-client conduit-lwt vchan xenstore tls tls-mirage + ipaddr ipaddr-sexp tcpip ca-certs-nss + ]; + + meta = conduit-lwt.meta // { + description = "A network connection establishment library for MirageOS"; + }; +} diff --git a/pkgs/development/ocaml-modules/config-file/default.nix b/pkgs/development/ocaml-modules/config-file/default.nix new file mode 100644 index 00000000000..b9dde0e6425 --- /dev/null +++ b/pkgs/development/ocaml-modules/config-file/default.nix @@ -0,0 +1,25 @@ +{ stdenv, lib, fetchurl, ocaml, findlib, camlp4 }: + +stdenv.mkDerivation rec { + pname = "ocaml-config-file"; + version = "1.2"; + + src = fetchurl { + url = "https://forge.ocamlcore.org/frs/download.php/1387/config-file-${version}.tar.gz"; + sha256 = "1b02yxcnsjhr05ssh2br2ka4hxsjpdw34ldl3nk33wfnkwk7g67q"; + }; + + nativeBuildInputs = [ ocaml findlib camlp4 ]; + + strictDeps = true; + + createFindlibDestdir = true; + + meta = { + homepage = "http://config-file.forge.ocamlcore.org/"; + platforms = ocaml.meta.platforms or [ ]; + description = "An OCaml library used to manage the configuration file(s) of an application"; + license = lib.licenses.lgpl2Plus; + maintainers = with lib.maintainers; [ vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/containers/data.nix b/pkgs/development/ocaml-modules/containers/data.nix new file mode 100644 index 00000000000..29d7bbb26b0 --- /dev/null +++ b/pkgs/development/ocaml-modules/containers/data.nix @@ -0,0 +1,19 @@ +{ buildDunePackage, containers +, dune-configurator +, gen, iter, qcheck +}: + +buildDunePackage { + pname = "containers-data"; + + inherit (containers) src version doCheck useDune2; + + buildInputs = [ dune-configurator ]; + checkInputs = [ gen iter qcheck ]; + + propagatedBuildInputs = [ containers ]; + + meta = containers.meta // { + description = "A set of advanced datatypes for containers"; + }; +} diff --git a/pkgs/development/ocaml-modules/containers/default.nix b/pkgs/development/ocaml-modules/containers/default.nix new file mode 100644 index 00000000000..281fbfbfde8 --- /dev/null +++ b/pkgs/development/ocaml-modules/containers/default.nix @@ -0,0 +1,42 @@ +{ lib, fetchFromGitHub, buildDunePackage, ocaml +, dune-configurator +, either, seq +, gen, iter, ounit, qcheck, uutf +}: + +buildDunePackage rec { + version = "3.6.1"; + pname = "containers"; + + useDune2 = true; + + src = fetchFromGitHub { + owner = "c-cube"; + repo = "ocaml-containers"; + rev = "v${version}"; + sha256 = "sha256:1k8xrs3nki8g875sig9f5v6k4vwxrk5gn7ixrlkkys5ksbr4kis7"; + }; + + buildInputs = [ dune-configurator ]; + propagatedBuildInputs = [ either seq ]; + + checkInputs = [ gen iter ounit qcheck uutf ]; + + doCheck = lib.versionAtLeast ocaml.version "4.08"; + + meta = { + homepage = "https://github.com/c-cube/ocaml-containers"; + description = "A modular standard library focused on data structures"; + longDescription = '' + Containers is a standard library (BSD license) focused on data structures, + combinators and iterators, without dependencies on unix. Every module is + independent and is prefixed with 'CC' in the global namespace. Some modules + extend the stdlib (e.g. CCList provides safe map/fold_right/append, and + additional functions on lists). + + It also features optional libraries for dealing with strings, and + helpers for unix and threads. + ''; + license = lib.licenses.bsd2; + }; +} diff --git a/pkgs/development/ocaml-modules/cooltt/default.nix b/pkgs/development/ocaml-modules/cooltt/default.nix new file mode 100644 index 00000000000..2ece4543c2a --- /dev/null +++ b/pkgs/development/ocaml-modules/cooltt/default.nix @@ -0,0 +1,47 @@ +{ lib +, fetchFromGitHub +, buildDunePackage +, cmdliner +, menhir +, menhirLib +, ppx_deriving +, ppxlib +, uuseg +, uutf +}: + +buildDunePackage { + pname = "cooltt"; + version = "unstable-2021-05-25"; + + minimumOCamlVersion = "4.10"; + + useDune2 = true; + + src = fetchFromGitHub { + owner = "RedPRL"; + repo = "cooltt"; + rev = "8ac06cbf7e05417d777f3ac6a471fe3576249f79"; + sha256 = "sha256-JBLNJaRuP/gwlg8RS3cpOpzxChOVKfmFulf5HKhhHh4="; + }; + + nativeBuildInputs = [ + cmdliner + menhir + ppxlib + ]; + + propagatedBuildInputs = [ + menhirLib + ppx_deriving + uuseg + uutf + ]; + + meta = with lib; { + homepage = "https://github.com/RedPRL/cooltt"; + description = "A cool implementation of normalization by evaluation (nbe) & elaboration for Cartesian cubical type theory"; + license = licenses.asl20; + maintainers = with maintainers; [ fortuneteller2k ]; + }; +} diff --git a/pkgs/development/ocaml-modules/cow/default.nix b/pkgs/development/ocaml-modules/cow/default.nix new file mode 100644 index 00000000000..13ee99804d8 --- /dev/null +++ b/pkgs/development/ocaml-modules/cow/default.nix @@ -0,0 +1,30 @@ +{ lib, fetchurl, buildDunePackage, alcotest +, uri, xmlm, omd, ezjsonm }: + +buildDunePackage rec { + useDune2 = true; + minimumOCamlVersion = "4.02.3"; + + version = "2.4.0"; + pname = "cow"; + + src = fetchurl { + url = "https://github.com/mirage/ocaml-cow/releases/download/v${version}/cow-v${version}.tbz"; + sha256 = "1x77lwpskda4zyikwxh500xjn90pgdwz6jm7ca7f36pyav4vl6zx"; + }; + + propagatedBuildInputs = [ xmlm uri ezjsonm omd ]; + checkInputs = [ alcotest ]; + doCheck = true; + + meta = with lib; { + description = "Caml on the Web"; + longDescription = '' + Writing web-applications requires a lot of skills: HTML, XML, JSON and + Markdown, to name but a few! This library provides OCaml combinators + for these web formats. + ''; + license = licenses.isc; + maintainers = [ maintainers.sternenseemann ]; + }; +} diff --git a/pkgs/development/ocaml-modules/cpdf/default.nix b/pkgs/development/ocaml-modules/cpdf/default.nix new file mode 100644 index 00000000000..3f60263736e --- /dev/null +++ b/pkgs/development/ocaml-modules/cpdf/default.nix @@ -0,0 +1,40 @@ +{ lib, stdenv, fetchFromGitHub, ocaml, findlib, camlpdf, ncurses }: + +if !lib.versionAtLeast ocaml.version "4.10" +then throw "cpdf is not available for OCaml ${ocaml.version}" +else + +stdenv.mkDerivation rec { + pname = "ocaml${ocaml.version}-cpdf"; + version = "2.5"; + + src = fetchFromGitHub { + owner = "johnwhitington"; + repo = "cpdf-source"; + rev = "v${version}"; + sha256 = "sha256:1qmx229nij7g6qmiacmyy4mcgx3k9509p4slahivshqm79d6wiwl"; + }; + + nativeBuildInputs = [ ocaml findlib ]; + buildInputs = [ ncurses ]; + propagatedBuildInputs = [ camlpdf ]; + + strictDeps = true; + + preInstall = '' + mkdir -p $OCAMLFIND_DESTDIR + mkdir -p $out/bin + cp cpdf $out/bin + mkdir -p $out/share/ + cp -r doc $out/share + cp cpdfmanual.pdf $out/share/doc/cpdf/ + ''; + + meta = with lib; { + homepage = "https://www.coherentpdf.com/"; + platforms = ocaml.meta.platforms or []; + description = "PDF Command Line Tools"; + license = licenses.unfree; + maintainers = [ maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/cpu/default.nix b/pkgs/development/ocaml-modules/cpu/default.nix new file mode 100644 index 00000000000..33702ca1829 --- /dev/null +++ b/pkgs/development/ocaml-modules/cpu/default.nix @@ -0,0 +1,31 @@ +{ lib, stdenv, buildDunePackage, fetchFromGitHub, autoconf }: + +buildDunePackage rec { + pname = "cpu"; + version = "2.0.0"; + + useDune2 = true; + + src = fetchFromGitHub { + owner = "UnixJunkie"; + repo = pname; + rev = "v${version}"; + sha256 = "1vir6gh1bhvxgj2fcn69c38yhw3jgk7dyikmw789m5ld2csnyjiv"; + }; + + preConfigure = '' + autoconf + autoheader + ''; + + buildInputs = [ autoconf ]; + + hardeningDisable = lib.optional stdenv.isDarwin "strictoverflow"; + + meta = with lib; { + inherit (src.meta) homepage; + description = "Core pinning library"; + maintainers = [ maintainers.bcdarwin ]; + license = licenses.lgpl2; + }; +} diff --git a/pkgs/development/ocaml-modules/cpuid/default.nix b/pkgs/development/ocaml-modules/cpuid/default.nix new file mode 100644 index 00000000000..a0c28bc92d9 --- /dev/null +++ b/pkgs/development/ocaml-modules/cpuid/default.nix @@ -0,0 +1,22 @@ +{ lib, fetchurl, buildDunePackage }: + +buildDunePackage rec { + pname = "cpuid"; + version = "0.1.2"; + + useDune2 = true; + + minimumOCamlVersion = "4.03"; + + src = fetchurl { + url = "https://github.com/pqwy/cpuid/releases/download/v${version}/cpuid-v${version}.tbz"; + sha256 = "08ng4mva6qblb5ipkrxbr0my7ndkc4qwcbswkqgbgir864s74m93"; + }; + + meta = { + homepage = "https://github.com/pqwy/cpuid"; + description = "Detect CPU features from OCaml"; + license = lib.licenses.isc; + maintainers = [ lib.maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/crowbar/default.nix b/pkgs/development/ocaml-modules/crowbar/default.nix new file mode 100644 index 00000000000..3557c22bc14 --- /dev/null +++ b/pkgs/development/ocaml-modules/crowbar/default.nix @@ -0,0 +1,37 @@ +{ lib, stdenv, buildDunePackage, fetchFromGitHub, ocplib-endian, cmdliner, afl-persistent +, calendar, fpath, pprint, uutf, uunf, uucp }: + +buildDunePackage rec { + pname = "crowbar"; + version = "0.2"; + + useDune2 = true; + + src = fetchFromGitHub { + owner = "stedolan"; + repo = pname; + rev = "v${version}"; + sha256 = "0wjfc9irvirfkic32ivvj6qb7r838w08b0d3vmngigbjpjyc9b14"; + }; + + minimalOCamlVersion = "4.08"; + + # Fix tests with pprint ≥ 20220103 + patches = [ ./pprint.patch ]; + + # disable xmldiff tests, so we don't need to package unmaintained and legacy pkgs + postPatch = "rm -rf examples/xmldiff"; + + propagatedBuildInputs = [ ocplib-endian cmdliner afl-persistent ]; + checkInputs = [ calendar fpath pprint uutf uunf uucp ]; + # uunf is broken on aarch64 + doCheck = !stdenv.isAarch64; + + meta = with lib; { + description = "Property fuzzing for OCaml"; + homepage = "https://github.com/stedolan/crowbar"; + license = licenses.mit; + maintainers = [ maintainers.sternenseemann ]; + }; +} + diff --git a/pkgs/development/ocaml-modules/crowbar/pprint.patch b/pkgs/development/ocaml-modules/crowbar/pprint.patch new file mode 100644 index 00000000000..77fc073b77f --- /dev/null +++ b/pkgs/development/ocaml-modules/crowbar/pprint.patch @@ -0,0 +1,22 @@ +commit 77b5e54d33a66445f45ddc48577d835207be8cef +Author: Stephen Dolan <stephen.dolan@cl.cam.ac.uk> +Date: Fri Jun 12 19:34:51 2020 +0100 + + Unbreak small example logic + +diff --git a/examples/pprint/test_pprint.ml b/examples/pprint/test_pprint.ml +index 77789ef..44124e7 100644 +--- a/examples/pprint/test_pprint.ml ++++ b/examples/pprint/test_pprint.ml +@@ -1,9 +1,9 @@ +-open Crowbar + open PPrint ++open Crowbar + type t = (string * PPrint.document) + let doc = fix (fun doc -> choose [ + const ("", empty); +- const ("a", char 'a'); ++ const ("a", PPrint.char 'a'); + const ("123", string "123"); + const ("Hello", string "Hello"); + const ("awordwhichisalittlebittoolong", diff --git a/pkgs/development/ocaml-modules/cryptgps/default.nix b/pkgs/development/ocaml-modules/cryptgps/default.nix new file mode 100644 index 00000000000..aeaa87aaf75 --- /dev/null +++ b/pkgs/development/ocaml-modules/cryptgps/default.nix @@ -0,0 +1,39 @@ +{stdenv, lib, fetchurl, ocaml, findlib}: + +if lib.versionAtLeast ocaml.version "4.06" +then throw "cryptgps is not available for OCaml ${ocaml.version}" +else + +stdenv.mkDerivation { + pname = "ocaml-cryptgps"; + version = "0.2.1"; + + src = fetchurl { + url = "http://download.camlcity.org/download/cryptgps-0.2.1.tar.gz"; + sha256 = "1mp7i42cm9w9grmcsa69m3h1ycpn6a48p43y4xj8rsc12x9nav3s"; + }; + + nativeBuildInputs = [ ocaml findlib ]; + + strictDeps = true; + + dontConfigure = true; # Skip configure phase + + createFindlibDestdir = true; + + meta = { + homepage = "http://projects.camlcity.org/projects/cryptgps.html"; + description = "Cryptographic functions for OCaml"; + longDescription = '' + This library implements the symmetric cryptographic algorithms + Blowfish, DES, and 3DES. The algorithms are written in O'Caml, + i.e. this is not a binding to some C library, but the implementation + itself. + ''; + license = lib.licenses.mit; + platforms = ocaml.meta.platforms or []; + maintainers = [ + lib.maintainers.maggesi + ]; + }; +} diff --git a/pkgs/development/ocaml-modules/cryptokit/default.nix b/pkgs/development/ocaml-modules/cryptokit/default.nix new file mode 100644 index 00000000000..1b5a50b13b9 --- /dev/null +++ b/pkgs/development/ocaml-modules/cryptokit/default.nix @@ -0,0 +1,35 @@ +{ lib, buildDunePackage, fetchFromGitHub, zlib, dune-configurator, zarith, ncurses }: + +buildDunePackage rec { + pname = "cryptokit"; + version = "1.16.1"; + + useDune2 = true; + + src = fetchFromGitHub { + owner = "xavierleroy"; + repo = "cryptokit"; + rev = "release${lib.replaceStrings ["."] [""] version}"; + sha256 = "sha256-eDIzi16Al/mXCNos/lVqjZWCtdP9SllXnRfm4GBWMfA="; + }; + + # dont do autotools configuration, but do trigger findlib's preConfigure hook + configurePhase = '' + runHook preConfigure + runHook postConfigure + ''; + + buildInputs = [ dune-configurator ncurses ]; + propagatedBuildInputs = [ zarith zlib ]; + + doCheck = true; + + meta = { + homepage = "http://pauillac.inria.fr/~xleroy/software.html"; + description = "A library of cryptographic primitives for OCaml"; + license = lib.licenses.lgpl2Only; + maintainers = [ + lib.maintainers.maggesi + ]; + }; +} diff --git a/pkgs/development/ocaml-modules/csexp/default.nix b/pkgs/development/ocaml-modules/csexp/default.nix new file mode 100644 index 00000000000..664d9a773ab --- /dev/null +++ b/pkgs/development/ocaml-modules/csexp/default.nix @@ -0,0 +1,25 @@ +{ lib, fetchurl, buildDunePackage, result }: + +buildDunePackage rec { + pname = "csexp"; + version = "1.5.1"; + + src = fetchurl { + url = "https://github.com/ocaml-dune/csexp/releases/download/${version}/csexp-${version}.tbz"; + sha256 = "sha256-1gXkBl+pCliABEDvLzOi2TE5i/LCIGGorLffhFwKrAI="; + }; + + minimumOCamlVersion = "4.03"; + useDune2 = true; + + propagatedBuildInputs = [ + result + ]; + + meta = with lib; { + homepage = "https://github.com/ocaml-dune/csexp/"; + description = "Minimal support for Canonical S-expressions"; + license = licenses.mit; + maintainers = with maintainers; [ marsam ]; + }; +} diff --git a/pkgs/development/ocaml-modules/cstruct/async.nix b/pkgs/development/ocaml-modules/cstruct/async.nix new file mode 100644 index 00000000000..579f12776c0 --- /dev/null +++ b/pkgs/development/ocaml-modules/cstruct/async.nix @@ -0,0 +1,11 @@ +{ lib, buildDunePackage, cstruct, async_unix }: + +buildDunePackage rec { + pname = "cstruct-async"; + inherit (cstruct) src version meta useDune2; + + propagatedBuildInputs = [ + async_unix + cstruct + ]; +} diff --git a/pkgs/development/ocaml-modules/cstruct/default.nix b/pkgs/development/ocaml-modules/cstruct/default.nix new file mode 100644 index 00000000000..70f49ab1470 --- /dev/null +++ b/pkgs/development/ocaml-modules/cstruct/default.nix @@ -0,0 +1,28 @@ +{ lib, fetchurl, buildDunePackage, bigarray-compat, alcotest, ocaml }: + +buildDunePackage rec { + pname = "cstruct"; + version = "6.0.1"; + + useDune2 = true; + + minimumOCamlVersion = "4.03"; + + src = fetchurl { + url = "https://github.com/mirage/ocaml-cstruct/releases/download/v${version}/cstruct-v${version}.tbz"; + sha256 = "4a67bb8f042753453c59eabf0e47865631253ba694091ce6062aac05d47a9bed"; + }; + + propagatedBuildInputs = [ bigarray-compat ]; + + # alcotest isn't available for OCaml < 4.05 due to fmt + doCheck = lib.versionAtLeast ocaml.version "4.05"; + checkInputs = [ alcotest ]; + + meta = { + description = "Access C-like structures directly from OCaml"; + license = lib.licenses.isc; + homepage = "https://github.com/mirage/ocaml-cstruct"; + maintainers = [ lib.maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/cstruct/lwt.nix b/pkgs/development/ocaml-modules/cstruct/lwt.nix new file mode 100644 index 00000000000..df8941d1260 --- /dev/null +++ b/pkgs/development/ocaml-modules/cstruct/lwt.nix @@ -0,0 +1,14 @@ +{ lib, buildDunePackage, cstruct, lwt }: + +if !lib.versionAtLeast (cstruct.version or "1") "3" +then cstruct +else + +buildDunePackage { + pname = "cstruct-lwt"; + inherit (cstruct) version src useDune2 meta; + + minimumOCamlVersion = "4.03"; + + propagatedBuildInputs = [ cstruct lwt ]; +} diff --git a/pkgs/development/ocaml-modules/cstruct/ppx.nix b/pkgs/development/ocaml-modules/cstruct/ppx.nix new file mode 100644 index 00000000000..523a2c04f61 --- /dev/null +++ b/pkgs/development/ocaml-modules/cstruct/ppx.nix @@ -0,0 +1,19 @@ +{ lib, buildDunePackage, cstruct, sexplib, ppxlib, stdlib-shims +, ounit, cppo, ppx_sexp_conv, cstruct-unix, cstruct-sexp +}: + +if !lib.versionAtLeast (cstruct.version or "1") "3" +then cstruct +else + +buildDunePackage { + pname = "ppx_cstruct"; + inherit (cstruct) version src useDune2 meta; + + minimalOCamlVersion = "4.08"; + + propagatedBuildInputs = [ cstruct ppxlib sexplib stdlib-shims ]; + + doCheck = true; + checkInputs = [ ounit cppo ppx_sexp_conv cstruct-sexp cstruct-unix ]; +} diff --git a/pkgs/development/ocaml-modules/cstruct/sexp.nix b/pkgs/development/ocaml-modules/cstruct/sexp.nix new file mode 100644 index 00000000000..b04810e4803 --- /dev/null +++ b/pkgs/development/ocaml-modules/cstruct/sexp.nix @@ -0,0 +1,18 @@ +{ lib, buildDunePackage, ocaml, alcotest, cstruct, sexplib }: + +if !lib.versionAtLeast (cstruct.version or "1") "3" +then cstruct +else + +buildDunePackage rec { + pname = "cstruct-sexp"; + inherit (cstruct) version src useDune2 meta; + + minimumOCamlVersion = "4.03"; + + # alcotest is only available on OCaml >= 4.05 due to fmt + doCheck = lib.versionAtLeast ocaml.version "4.05"; + checkInputs = [ alcotest ]; + + propagatedBuildInputs = [ cstruct sexplib ]; +} diff --git a/pkgs/development/ocaml-modules/cstruct/unix.nix b/pkgs/development/ocaml-modules/cstruct/unix.nix new file mode 100644 index 00000000000..1ea27bb04de --- /dev/null +++ b/pkgs/development/ocaml-modules/cstruct/unix.nix @@ -0,0 +1,14 @@ +{ lib, buildDunePackage, cstruct }: + +if !lib.versionAtLeast (cstruct.version or "1") "3" +then cstruct +else + +buildDunePackage { + pname = "cstruct-unix"; + inherit (cstruct) version src useDune2 meta; + + minimumOCamlVersion = "4.06"; + + propagatedBuildInputs = [ cstruct ]; +} diff --git a/pkgs/development/ocaml-modules/csv/1.5.nix b/pkgs/development/ocaml-modules/csv/1.5.nix new file mode 100644 index 00000000000..cd298fb39a9 --- /dev/null +++ b/pkgs/development/ocaml-modules/csv/1.5.nix @@ -0,0 +1,34 @@ +{ lib, stdenv, fetchzip, ocaml, findlib, ocamlbuild }: + +stdenv.mkDerivation rec { + pname = "ocaml${ocaml.version}-csv"; + version = "1.5"; + + src = fetchzip { + url = "https://github.com/Chris00/ocaml-csv/releases/download/${version}/csv-${version}.tar.gz"; + sha256 = "1ca7jgg58j24pccs5fshis726s06fdcjshnwza5kwxpjgdbvc63g"; + }; + + nativeBuildInputs = [ ocaml findlib ocamlbuild ]; + + strictDeps = true; + + createFindlibDestdir = true; + + configurePhase = "ocaml setup.ml -configure --prefix $out --enable-tests"; + + buildPhase = "ocaml setup.ml -build"; + + doCheck = true; + checkPhase = "ocaml setup.ml -test"; + + installPhase = "ocaml setup.ml -install"; + + meta = with lib; { + description = "A pure OCaml library to read and write CSV files"; + homepage = "https://github.com/Chris00/ocaml-csv"; + license = licenses.lgpl21; + maintainers = [ maintainers.vbgl ]; + platforms = ocaml.meta.platforms or [ ]; + }; +} diff --git a/pkgs/development/ocaml-modules/csv/csvtool.nix b/pkgs/development/ocaml-modules/csv/csvtool.nix new file mode 100644 index 00000000000..12c0dfa160e --- /dev/null +++ b/pkgs/development/ocaml-modules/csv/csvtool.nix @@ -0,0 +1,16 @@ +{ lib, ocamlPackages }: + +let inherit (ocamlPackages) buildDunePackage csv uutf; in + +buildDunePackage { + pname = "csvtool"; + inherit (csv) src version useDune2; + + buildInputs = [ csv uutf ]; + + doCheck = true; + + meta = csv.meta // { + description = "Command line tool for handling CSV files"; + }; +} diff --git a/pkgs/development/ocaml-modules/csv/default.nix b/pkgs/development/ocaml-modules/csv/default.nix new file mode 100644 index 00000000000..d4c3d72a6d8 --- /dev/null +++ b/pkgs/development/ocaml-modules/csv/default.nix @@ -0,0 +1,20 @@ +{ lib, fetchurl, buildDunePackage }: + +buildDunePackage rec { + pname = "csv"; + version = "2.4"; + + src = fetchurl { + url = "https://github.com/Chris00/ocaml-${pname}/releases/download/${version}/csv-${version}.tbz"; + sha256 = "13m9n8mdss6jfbiw7d5bybxn4n85vmg4zw7dc968qrgjfy0w9zhk"; + }; + + useDune2 = true; + + meta = { + description = "A pure OCaml library to read and write CSV files"; + license = lib.licenses.lgpl21; + maintainers = [ lib.maintainers.vbgl ]; + homepage = "https://github.com/Chris00/ocaml-csv"; + }; +} diff --git a/pkgs/development/ocaml-modules/csv/lwt.nix b/pkgs/development/ocaml-modules/csv/lwt.nix new file mode 100644 index 00000000000..b0f771209aa --- /dev/null +++ b/pkgs/development/ocaml-modules/csv/lwt.nix @@ -0,0 +1,14 @@ +{ lib, buildDunePackage, ocaml, csv, ocaml_lwt }: + +if !lib.versionAtLeast ocaml.version "4.02" +then throw "csv-lwt is not available for OCaml ${ocaml.version}" +else + +buildDunePackage { + pname = "csv-lwt"; + inherit (csv) src version useDune2 meta; + + propagatedBuildInputs = [ csv ocaml_lwt ]; + + doCheck = lib.versionAtLeast ocaml.version "4.03"; +} diff --git a/pkgs/development/ocaml-modules/ctypes/default.nix b/pkgs/development/ocaml-modules/ctypes/default.nix new file mode 100644 index 00000000000..833ea45a869 --- /dev/null +++ b/pkgs/development/ocaml-modules/ctypes/default.nix @@ -0,0 +1,41 @@ +{ lib, stdenv, fetchFromGitHub, ocaml, findlib, libffi, pkg-config, ncurses, integers, bigarray-compat }: + +if !lib.versionAtLeast ocaml.version "4.02" +then throw "ctypes is not available for OCaml ${ocaml.version}" +else + +stdenv.mkDerivation rec { + pname = "ocaml${ocaml.version}-ctypes"; + version = "0.18.0"; + + src = fetchFromGitHub { + owner = "ocamllabs"; + repo = "ocaml-ctypes"; + rev = version; + sha256 = "sha256-eu5RAuPYC97IM4XUsUw3HQ1BJlEHQ+eBpsdUE6hd+Q8="; + }; + + nativeBuildInputs = [ pkg-config ocaml findlib ]; + buildInputs = [ ncurses ]; + propagatedBuildInputs = [ integers libffi bigarray-compat ]; + + strictDeps = true; + + buildPhase = '' + make XEN=false libffi.config ctypes-base ctypes-stubs + make XEN=false ctypes-foreign + ''; + + installPhase = '' + mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib/stublibs + make install XEN=false + ''; + + meta = with lib; { + homepage = "https://github.com/ocamllabs/ocaml-ctypes"; + description = "Library for binding to C libraries using pure OCaml"; + license = licenses.mit; + maintainers = [ maintainers.ericbmerritt ]; + inherit (ocaml.meta) platforms; + }; +} diff --git a/pkgs/development/ocaml-modules/cudf/default.nix b/pkgs/development/ocaml-modules/cudf/default.nix new file mode 100644 index 00000000000..fe9793ea532 --- /dev/null +++ b/pkgs/development/ocaml-modules/cudf/default.nix @@ -0,0 +1,50 @@ +{ lib, fetchurl, stdenv, ocaml, ocamlbuild, findlib, ocaml_extlib, glib, perl, pkg-config, stdlib-shims, ounit }: + +stdenv.mkDerivation { + pname = "ocaml${ocaml.version}-cudf"; + version = "0.9"; + + src = fetchurl { + url = "https://gforge.inria.fr/frs/download.php/36602/cudf-0.9.tar.gz"; + sha256 = "sha256-mTLk2V3OI1sUNIYv84nM3reiirf0AuozG5ZzLCmn4Rw="; + }; + + buildFlags = [ + "all" + "opt" + ]; + nativeBuildInputs = [ + findlib + ocaml + ocamlbuild + pkg-config + ]; + buildInputs = [ + glib + perl + stdlib-shims + ]; + propagatedBuildInputs = [ + ocaml_extlib + ]; + + checkTarget = [ + "all" + "test" + ]; + checkInputs = [ + ounit + ]; + doCheck = true; + + preInstall = "mkdir -p $OCAMLFIND_DESTDIR"; + installFlags = "BINDIR=$(out)/bin"; + + meta = with lib; { + description = "A library for CUDF format"; + homepage = "https://www.mancoosi.org/cudf/"; + downloadPage = "https://gforge.inria.fr/projects/cudf/"; + license = licenses.lgpl3; + maintainers = with maintainers; [ ]; + }; +} diff --git a/pkgs/development/ocaml-modules/curly/default.nix b/pkgs/development/ocaml-modules/curly/default.nix new file mode 100644 index 00000000000..20197e207af --- /dev/null +++ b/pkgs/development/ocaml-modules/curly/default.nix @@ -0,0 +1,39 @@ +{ stdenv, lib, buildDunePackage, fetchurl, ocaml +, result, alcotest, cohttp-lwt-unix, odoc, curl, cacert +}: + +buildDunePackage rec { + pname = "curly"; + version = "0.2.0"; + + minimumOCamlVersion = "4.02"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/rgrinberg/curly/releases/download/${version}/curly-${version}.tbz"; + sha256 = "07vqdrklar0d5i83ip7sjw2c1v18a9m3anw07vmi5ay29pxzal6k"; + }; + + propagatedBuildInputs = [ result ]; + checkInputs = [ alcotest cohttp-lwt-unix cacert ]; + # test dependencies are only available for >= 4.08 + # https://github.com/mirage/ca-certs/issues/16 + doCheck = lib.versionAtLeast ocaml.version "4.08" + # Some test fails in macOS sandbox + # > Fatal error: exception Unix.Unix_error(Unix.EPERM, "bind", "") + && !stdenv.isDarwin; + + postPatch = '' + substituteInPlace src/curly.ml \ + --replace "exe=\"curl\"" "exe=\"${curl}/bin/curl\"" + ''; + + meta = with lib; { + description = "Curly is a brain dead wrapper around the curl command line utility"; + homepage = "https://github.com/rgrinberg/curly"; + license = licenses.isc; + maintainers = [ maintainers.sternenseemann ]; + }; +} + diff --git a/pkgs/development/ocaml-modules/curses/default.nix b/pkgs/development/ocaml-modules/curses/default.nix new file mode 100644 index 00000000000..824f24ab955 --- /dev/null +++ b/pkgs/development/ocaml-modules/curses/default.nix @@ -0,0 +1,37 @@ +{ lib, stdenv, fetchFromGitHub, ocaml, findlib, ncurses }: + +stdenv.mkDerivation rec { + pname = "ocaml-curses"; + version = "1.0.8"; + + src = fetchFromGitHub { + owner = "mbacarella"; + repo = "curses"; + rev = version; + sha256 = "0yy3wf8i7jgvzdc40bni7mvpkvclq97cgb5fw265mrjj0iqpkqpd"; + }; + + propagatedBuildInputs = [ ncurses ]; + + nativeBuildInputs = [ ocaml findlib ]; + + # Fix build for recent ncurses versions + NIX_CFLAGS_COMPILE = "-DNCURSES_INTERNALS=1"; + + createFindlibDestdir = true; + + postPatch = '' + substituteInPlace curses.ml --replace "pp gcc" "pp $CC" + ''; + + buildPhase = "make all opt"; + + meta = with lib; { + description = "OCaml Bindings to curses/ncurses"; + homepage = "https://github.com/mbacarella/curses"; + license = licenses.lgpl21Plus; + changelog = "https://github.com/mbacarella/curses/raw/${version}/CHANGES"; + maintainers = [ maintainers.volth ]; + platforms = ocaml.meta.platforms or []; + }; +} diff --git a/pkgs/development/ocaml-modules/dap/default.nix b/pkgs/development/ocaml-modules/dap/default.nix new file mode 100644 index 00000000000..6d14945ee15 --- /dev/null +++ b/pkgs/development/ocaml-modules/dap/default.nix @@ -0,0 +1,35 @@ +{ lib, buildDunePackage, fetchurl +, angstrom-lwt-unix, lwt, logs, lwt_ppx, ppx_deriving_yojson, ppx_expect, ppx_here, react +}: + +buildDunePackage rec { + pname = "dap"; + version = "1.0.6"; + useDune2 = true; + src = fetchurl { + url = "https://github.com/hackwaly/ocaml-dap/releases/download/${version}/dap-${version}.tbz"; + sha256 = "1zq0f8429m38a4x3h9n3rv7n1vsfjbs72pfi5902a89qwyilkcp0"; + }; + + minimumOCamlVersion = "4.08"; + + buildInputs = [ + lwt_ppx + ]; + + propagatedBuildInputs = [ + angstrom-lwt-unix + logs + lwt + ppx_deriving_yojson + ppx_expect + ppx_here + react + ]; + + meta = { + description = "Debug adapter protocol"; + homepage = "https://github.com/hackwaly/ocaml-dap"; + license = lib.licenses.mit; + }; +} diff --git a/pkgs/development/ocaml-modules/data-encoding/default.nix b/pkgs/development/ocaml-modules/data-encoding/default.nix new file mode 100644 index 00000000000..f7036d38d38 --- /dev/null +++ b/pkgs/development/ocaml-modules/data-encoding/default.nix @@ -0,0 +1,46 @@ +{ lib +, fetchFromGitLab +, buildDunePackage +, ezjsonm +, zarith +, hex +, json-data-encoding +, json-data-encoding-bson +, alcotest +, crowbar +}: + +buildDunePackage { + pname = "data-encoding"; + version = "0.4.0"; + + src = fetchFromGitLab { + owner = "nomadic-labs"; + repo = "data-encoding"; + rev = "v0.4"; + sha256 = "1f88l9azpfk730hps5v6zlg4yyyyhj1gl27qy3cbbkzjc82d2rhx"; + }; + useDune2 = true; + + propagatedBuildInputs = [ + ezjsonm + zarith + hex + json-data-encoding + json-data-encoding-bson + ]; + + checkInputs = [ + alcotest + crowbar + ]; + + doCheck = true; + + meta = { + homepage = "https://gitlab.com/nomadic-labs/data-encoding"; + description = "Library of JSON and binary encoding combinators"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.ulrikstrid ]; + }; +} diff --git a/pkgs/development/ocaml-modules/dbf/default.nix b/pkgs/development/ocaml-modules/dbf/default.nix new file mode 100644 index 00000000000..d2dad611bf4 --- /dev/null +++ b/pkgs/development/ocaml-modules/dbf/default.nix @@ -0,0 +1,28 @@ +{ lib, buildDunePackage, fetchFromGitHub, ppx_cstruct, rresult, cstruct-unix +, core_kernel }: + +buildDunePackage rec { + pname = "dbf"; + version = "0.1.1"; + + minimalOCamlVersion = "4.08"; + + useDune2 = true; + + src = fetchFromGitHub { + owner = "pveber"; + repo = "dbf"; + rev = "${version}"; + sha256 = "sha256-h1K5YDLbXGEJi/quKXvSR0gZ+WkBzut7AsVFv+Bm8/g="; + }; + + buildInputs = [ ppx_cstruct ]; + propagatedBuildInputs = [ rresult cstruct-unix core_kernel ]; + + meta = with lib; { + description = "DBF format parsing"; + homepage = "https://github.com/pveber/dbf"; + license = licenses.isc; + maintainers = [ maintainers.deltadelta ]; + }; +} diff --git a/pkgs/development/ocaml-modules/decompress/default.nix b/pkgs/development/ocaml-modules/decompress/default.nix new file mode 100644 index 00000000000..7629349c1d1 --- /dev/null +++ b/pkgs/development/ocaml-modules/decompress/default.nix @@ -0,0 +1,30 @@ +{ lib, fetchurl, buildDunePackage +, checkseum, bigarray-compat, optint, cmdliner +, bigstringaf, alcotest, camlzip, base64, ctypes, fmt +}: + +buildDunePackage rec { + version = "1.4.2"; + pname = "decompress"; + + minimumOCamlVersion = "4.07"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/mirage/decompress/releases/download/v${version}/decompress-v${version}.tbz"; + sha256 = "822f125b46c87f4a902c334db8c86d4d5f33ebe978e93c40351a4d3269b95225"; + }; + + buildInputs = [ cmdliner ]; + propagatedBuildInputs = [ optint bigarray-compat checkseum ]; + checkInputs = [ alcotest bigstringaf ctypes fmt camlzip base64 ]; + doCheck = true; + + meta = { + description = "Pure OCaml implementation of Zlib"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.vbgl ]; + homepage = "https://github.com/mirage/decompress"; + }; +} diff --git a/pkgs/development/ocaml-modules/diet/default.nix b/pkgs/development/ocaml-modules/diet/default.nix new file mode 100644 index 00000000000..cd14d2a06af --- /dev/null +++ b/pkgs/development/ocaml-modules/diet/default.nix @@ -0,0 +1,28 @@ +{ lib, buildDunePackage, fetchurl, stdlib-shims, ounit }: + +buildDunePackage rec { + pname = "diet"; + version = "0.4"; + + useDune2 = true; + + src = fetchurl { + url = + "https://github.com/mirage/ocaml-diet/releases/download/v${version}/diet-v${version}.tbz"; + sha256 = "96acac2e4fdedb5f47dd8ad2562e723d85ab59cd1bd85554df21ec907b071741"; + }; + + minimumOCamlVersion = "4.03"; + + propagatedBuildInputs = [ stdlib-shims ]; + + doCheck = true; + checkInputs = [ ounit ]; + + meta = with lib; { + homepage = "https://github.com/mirage/ocaml-diet"; + description = "Simple implementation of Discrete Interval Encoding Trees"; + license = licenses.isc; + maintainers = with maintainers; [ ehmry ]; + }; +} diff --git a/pkgs/development/ocaml-modules/digestif/default.nix b/pkgs/development/ocaml-modules/digestif/default.nix new file mode 100644 index 00000000000..dba0bcb9269 --- /dev/null +++ b/pkgs/development/ocaml-modules/digestif/default.nix @@ -0,0 +1,38 @@ +{ lib, ocaml, fetchurl, buildDunePackage +, pkg-config, which +, bigarray-compat, eqaf, stdlib-shims +, alcotest, astring, bos, findlib, fpath +}: + +buildDunePackage rec { + pname = "digestif"; + version = "1.1.0"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/mirage/digestif/releases/download/v${version}/digestif-v${version}.tbz"; + sha256 = "01gwkbrznci4xdcbww4ysgsciz2qs0r8jsmhp0siwbcgcrf1jjv5"; + }; + + nativeBuildInputs = [ findlib which ]; + buildInputs = [ ocaml ]; + + propagatedBuildInputs = [ bigarray-compat eqaf stdlib-shims ]; + + strictDeps = !doCheck; + + checkInputs = [ alcotest astring bos fpath ]; + doCheck = lib.versionAtLeast ocaml.version "4.05"; + + postCheck = '' + ocaml -I ${findlib}/lib/ocaml/${ocaml.version}/site-lib/ test/test_runes.ml + ''; + + meta = { + description = "Simple hash algorithms in OCaml"; + homepage = "https://github.com/mirage/digestif"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/directories/default.nix b/pkgs/development/ocaml-modules/directories/default.nix new file mode 100644 index 00000000000..eae11953113 --- /dev/null +++ b/pkgs/development/ocaml-modules/directories/default.nix @@ -0,0 +1,33 @@ +{ lib, fetchFromGitHub, buildDunePackage }: + +buildDunePackage rec { + pname = "directories"; + version = "0.2"; + useDune2 = true; + + minimumOCamlVersion = "4.07"; + + src = fetchFromGitHub { + owner = "ocamlpro"; + repo = pname; + rev = version; + sha256 = "0s7ginh0g0fhw8xf9v58cx99a8q9jqsf4i0p134m5qzf84qpjwff"; + }; + + meta = { + homepage = "https://github.com/ocamlpro/directories"; + description = "An OCaml library that provides configuration, cache and data paths (and more!) following the suitable conventions on Linux, macOS and Windows"; + longDescription = '' + directories is an OCaml library that provides configuration, cache and + data paths (and more!) following the suitable conventions on Linux, macOS + and Windows. It is inspired by similar libraries for other languages such + as directories-jvm. + + The following conventions are used: XDG Base Directory Specification and + xdg-user-dirs on Linux, Known Folders on Windows, Standard Directories on + macOS. + ''; + license = lib.licenses.isc; + maintainers = with lib.maintainers; [ bcc32 ]; + }; +} diff --git a/pkgs/development/ocaml-modules/dispatch/default.nix b/pkgs/development/ocaml-modules/dispatch/default.nix new file mode 100644 index 00000000000..65baa3dc498 --- /dev/null +++ b/pkgs/development/ocaml-modules/dispatch/default.nix @@ -0,0 +1,29 @@ +{ lib, buildDunePackage, fetchFromGitHub, ocaml, alcotest, result }: + +buildDunePackage rec { + pname = "dispatch"; + version = "0.5.0"; + + useDune2 = true; + + src = fetchFromGitHub { + owner = "inhabitedtype"; + repo = "ocaml-dispatch"; + rev = version; + sha256 = "12r39ylbxc297cbwjadhd1ghxnwwcdzfjk68r97wim8hcgzxyxv4"; + }; + + propagatedBuildInputs = [ result ]; + + checkInputs = [ alcotest ]; + + doCheck = lib.versionAtLeast ocaml.version "4.05"; + + meta = { + inherit (src.meta) homepage; + license = lib.licenses.bsd3; + description = "Path-based dispatching for client- and server-side applications"; + maintainers = [ lib.maintainers.vbgl ]; + }; + +} diff --git a/pkgs/development/ocaml-modules/dns/certify.nix b/pkgs/development/ocaml-modules/dns/certify.nix new file mode 100644 index 00000000000..31b39d18225 --- /dev/null +++ b/pkgs/development/ocaml-modules/dns/certify.nix @@ -0,0 +1,33 @@ +{ buildDunePackage, dns, dns-tsig, dns-mirage, randomconv, x509 +, mirage-random, mirage-time, mirage-clock, mirage-stack +, logs, mirage-crypto-pk, mirage-crypto-rng, mirage-crypto-ec, lwt +}: + +buildDunePackage { + pname = "dns-certify"; + + inherit (dns) version src useDune2 minimumOCamlVersion; + + propagatedBuildInputs = [ + dns + dns-tsig + dns-mirage + randomconv + x509 + mirage-random + mirage-time + mirage-clock + mirage-stack + logs + mirage-crypto-pk + mirage-crypto-rng + mirage-crypto-ec + lwt + ]; + + doCheck = true; + + meta = dns.meta // { + description = "MirageOS let's encrypt certificate retrieval"; + }; +} diff --git a/pkgs/development/ocaml-modules/dns/cli.nix b/pkgs/development/ocaml-modules/dns/cli.nix new file mode 100644 index 00000000000..6e149180642 --- /dev/null +++ b/pkgs/development/ocaml-modules/dns/cli.nix @@ -0,0 +1,48 @@ +{ buildDunePackage, dns, dns-tsig, dns-client, dns-server, dns-certify +, rresult, bos, cmdliner, fpath, x509, mirage-crypto, mirage-crypto-pk +, mirage-crypto-rng, hex, ptime, mtime, logs, fmt, ipaddr, lwt +, randomconv, alcotest +}: + +buildDunePackage { + pname = "dns-cli"; + + minimumOCamlVersion = "4.08"; + + inherit (dns) version src useDune2; + + # no need to propagate as this is primarily + # an executable package + buildInputs = [ + dns + dns-tsig + dns-client + dns-server + dns-certify + rresult + bos + cmdliner + fpath + x509 + mirage-crypto + mirage-crypto-pk + mirage-crypto-rng + hex + ptime + mtime + logs + fmt + ipaddr + lwt + randomconv + ]; + + doCheck = true; + checkInputs = [ + alcotest + ]; + + meta = dns.meta // { + description = "Unix command line utilities using uDNS"; + }; +} diff --git a/pkgs/development/ocaml-modules/dns/client.nix b/pkgs/development/ocaml-modules/dns/client.nix new file mode 100644 index 00000000000..a6dc40de24e --- /dev/null +++ b/pkgs/development/ocaml-modules/dns/client.nix @@ -0,0 +1,20 @@ +{ lib, buildDunePackage, dns, ocaml_lwt, mirage-clock, mirage-time +, mirage-random, mirage-stack, mirage-crypto-rng, mtime, randomconv +, cstruct, fmt, logs, rresult, domain-name, ipaddr, alcotest }: + +buildDunePackage { + pname = "dns-client"; + inherit (dns) src version; + + useDune2 = true; + + propagatedBuildInputs = [ cstruct fmt logs dns rresult randomconv domain-name ipaddr + ocaml_lwt mirage-stack mirage-random mirage-time mirage-clock + mtime mirage-crypto-rng ]; + checkInputs = [ alcotest ]; + doCheck = true; + + meta = dns.meta // { + description = "Pure DNS resolver API"; + }; +} diff --git a/pkgs/development/ocaml-modules/dns/default.nix b/pkgs/development/ocaml-modules/dns/default.nix new file mode 100644 index 00000000000..8a5115f10f0 --- /dev/null +++ b/pkgs/development/ocaml-modules/dns/default.nix @@ -0,0 +1,29 @@ +{ lib, buildDunePackage, fetchurl, alcotest +, cstruct, domain-name, duration, gmap, ipaddr, logs, lru, metrics, ptime, rresult, astring, fmt +}: + +buildDunePackage rec { + pname = "dns"; + version = "5.0.1"; + + useDune2 = true; + minimumOCamlVersion = "4.07"; + + src = fetchurl { + url = "https://github.com/mirage/ocaml-dns/releases/download/v${version}/dns-v${version}.tbz"; + sha256 = "72c0a1a91c8e409bd448c8e0ea28d16d13177c326aea403ee1c30ddcb5969adc"; + }; + + propagatedBuildInputs = [ rresult astring fmt logs ptime domain-name gmap cstruct ipaddr lru duration metrics ]; + + doCheck = true; + checkInputs = lib.optional doCheck alcotest; + + meta = { + description = "An Domain Name System (DNS) library"; + homepage = "https://github.com/mirage/ocaml-dns"; + license = lib.licenses.bsd2; + maintainers = [ lib.maintainers.vbgl ]; + }; + +} diff --git a/pkgs/development/ocaml-modules/dns/mirage.nix b/pkgs/development/ocaml-modules/dns/mirage.nix new file mode 100644 index 00000000000..4a45abba68e --- /dev/null +++ b/pkgs/development/ocaml-modules/dns/mirage.nix @@ -0,0 +1,18 @@ +{ buildDunePackage, dns, mirage-stack, ipaddr, lwt }: + +buildDunePackage { + pname = "dns-mirage"; + + inherit (dns) version src useDune2 minimumOCamlVersion; + + propagatedBuildInputs = [ + dns + mirage-stack + ipaddr + lwt + ]; + + meta = dns.meta // { + description = "An opinionated Domain Name System (DNS) library"; + }; +} diff --git a/pkgs/development/ocaml-modules/dns/resolver.nix b/pkgs/development/ocaml-modules/dns/resolver.nix new file mode 100644 index 00000000000..121ecb588d0 --- /dev/null +++ b/pkgs/development/ocaml-modules/dns/resolver.nix @@ -0,0 +1,32 @@ +{ buildDunePackage, dns, dns-server, dns-mirage, lru, duration +, randomconv, lwt, mirage-time, mirage-clock, mirage-random +, alcotest +}: + +buildDunePackage { + pname = "dns-resolver"; + + inherit (dns) version src useDune2 minimumOCamlVersion; + + propagatedBuildInputs = [ + dns + dns-server + dns-mirage + lru + duration + randomconv + lwt + mirage-time + mirage-clock + mirage-random + ]; + + doCheck = true; + checkInputs = [ + alcotest + ]; + + meta = dns.meta // { + description = "DNS resolver business logic"; + }; +} diff --git a/pkgs/development/ocaml-modules/dns/server.nix b/pkgs/development/ocaml-modules/dns/server.nix new file mode 100644 index 00000000000..1dc001f5f80 --- /dev/null +++ b/pkgs/development/ocaml-modules/dns/server.nix @@ -0,0 +1,34 @@ +{ buildDunePackage, dns, dns-mirage, randomconv, duration, lwt +, mirage-time, mirage-clock, mirage-stack, metrics +, alcotest, mirage-crypto-rng, dns-tsig, base64 +}: + +buildDunePackage { + pname = "dns-server"; + + inherit (dns) version src useDune2 minimumOCamlVersion; + + propagatedBuildInputs = [ + dns + dns-mirage + randomconv + duration + lwt + mirage-time + mirage-clock + mirage-stack + metrics + ]; + + doCheck = true; + checkInputs = [ + alcotest + mirage-crypto-rng + dns-tsig + base64 + ]; + + meta = dns.meta // { + description = "DNS server, primary and secondary"; + }; +} diff --git a/pkgs/development/ocaml-modules/dns/stub.nix b/pkgs/development/ocaml-modules/dns/stub.nix new file mode 100644 index 00000000000..dfe623f1c50 --- /dev/null +++ b/pkgs/development/ocaml-modules/dns/stub.nix @@ -0,0 +1,33 @@ +{ buildDunePackage, dns, dns-client, dns-mirage, dns-resolver, dns-tsig +, dns-server, duration, randomconv, lwt, mirage-time, mirage-clock +, mirage-random, mirage-stack, metrics +}: + +buildDunePackage { + pname = "dns-stub"; + + inherit (dns) version src useDune2 minimumOCamlVersion; + + propagatedBuildInputs = [ + dns + dns-client + dns-mirage + dns-resolver + dns-tsig + dns-server + duration + randomconv + lwt + mirage-time + mirage-clock + mirage-random + mirage-stack + metrics + ]; + + doCheck = true; + + meta = dns.meta // { + description = "DNS stub resolver"; + }; +} diff --git a/pkgs/development/ocaml-modules/dns/tsig.nix b/pkgs/development/ocaml-modules/dns/tsig.nix new file mode 100644 index 00000000000..11786a21e0d --- /dev/null +++ b/pkgs/development/ocaml-modules/dns/tsig.nix @@ -0,0 +1,22 @@ +{ buildDunePackage, dns, mirage-crypto, base64, alcotest }: + +buildDunePackage { + pname = "dns-tsig"; + + inherit (dns) version src useDune2 minimumOCamlVersion; + + propagatedBuildInputs = [ + mirage-crypto + dns + base64 + ]; + + doCheck = true; + checkInputs = [ + alcotest + ]; + + meta = dns.meta // { + description = "TSIG support for DNS"; + }; +} diff --git a/pkgs/development/ocaml-modules/dolmen/default.nix b/pkgs/development/ocaml-modules/dolmen/default.nix new file mode 100644 index 00000000000..7a7a14192f9 --- /dev/null +++ b/pkgs/development/ocaml-modules/dolmen/default.nix @@ -0,0 +1,33 @@ +{ lib, fetchurl, buildDunePackage +, menhir, menhirLib +, fmt +}: + +buildDunePackage rec { + pname = "dolmen"; + version = "0.6"; + + useDune2 = true; + + minimalOCamlVersion = "4.08"; + + src = fetchurl { + url = "https://github.com/Gbury/dolmen/releases/download/v${version}/dolmen-v${version}.tbz"; + sha256 = "133l23mwxa9xy340izvk4zp5jqjz2cwsm2innsgs2kg85pd39c41"; + }; + + strictDeps = true; + + nativeBuildInputs = [ menhir ]; + propagatedBuildInputs = [ menhirLib fmt ]; + + # Testr are not compatible with menhir 20211128 + doCheck = false; + + meta = { + description = "An OCaml library providing clean and flexible parsers for input languages"; + license = lib.licenses.bsd2; + maintainers = [ lib.maintainers.vbgl ]; + homepage = "https://github.com/Gbury/dolmen"; + }; +} diff --git a/pkgs/development/ocaml-modules/dolog/default.nix b/pkgs/development/ocaml-modules/dolog/default.nix new file mode 100644 index 00000000000..599cc356031 --- /dev/null +++ b/pkgs/development/ocaml-modules/dolog/default.nix @@ -0,0 +1,30 @@ +{ stdenv, lib, fetchFromGitHub, ocaml, findlib, ocamlbuild }: + +stdenv.mkDerivation rec { + pname = "ocaml-dolog"; + version = "3.0"; + + src = fetchFromGitHub { + owner = "UnixJunkie"; + repo = "dolog"; + rev = "v${version}"; + sha256 = "sha256-6wfqT5sqo4YA8XoHH3QhG6/TyzzXCzqjmnPuBArRoj8="; + }; + + nativeBuildInputs = [ ocaml findlib ocamlbuild ]; + + strictDeps = true; + + createFindlibDestdir = true; + + doCheck = true; + checkTarget = "test"; + + meta = { + homepage = "https://github.com/UnixJunkie/dolog"; + description = "Minimalistic lazy logger in OCaml"; + platforms = ocaml.meta.platforms or [ ]; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/domain-name/default.nix b/pkgs/development/ocaml-modules/domain-name/default.nix new file mode 100644 index 00000000000..a34c06aa8ee --- /dev/null +++ b/pkgs/development/ocaml-modules/domain-name/default.nix @@ -0,0 +1,31 @@ +{ lib, buildDunePackage, fetchurl +, alcotest +, astring, fmt +}: + +buildDunePackage rec { + pname = "domain-name"; + version = "0.3.0"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/hannesm/domain-name/releases/download/v${version}/domain-name-v${version}.tbz"; + sha256 = "12kc9p2a2fi1ipc2hyhbzivxpph3npglxwdgvhd6v20rqqdyvnad"; + }; + + minimumOCamlVersion = "4.03"; + + checkInputs = [ alcotest ]; + + propagatedBuildInputs = [ astring fmt ]; + + doCheck = true; + + meta = { + homepage = "https://github.com/hannesm/domain-name"; + description = "RFC 1035 Internet domain names"; + license = lib.licenses.isc; + maintainers = [ lib.maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/dose3/default.nix b/pkgs/development/ocaml-modules/dose3/default.nix new file mode 100644 index 00000000000..daf5b3779d7 --- /dev/null +++ b/pkgs/development/ocaml-modules/dose3/default.nix @@ -0,0 +1,61 @@ +{ lib, buildDunePackage, fetchFromGitLab +, camlzip, ocamlgraph, parmap, re, stdlib-shims +, base64, bz2, ocaml_extlib, cudf +, dpkg, git, ocaml, ounit, python39, python39Packages +}: + +buildDunePackage rec { + pname = "dose3"; + version = "7.0.0"; + + src = fetchFromGitLab { + owner = "irill"; + repo = "dose3"; + rev = version; + sha256 = "sha256-K0fYSAWV48Rers/foDrEIqieyJ0PvpXkuYrFrZGBkkE="; + }; + + minimalOCamlVersion = "4.03"; + useDune2 = true; + + buildInputs = [ + parmap + ]; + + propagatedBuildInputs = [ + base64 + bz2 + camlzip + cudf + ocaml_extlib + ocamlgraph + re + stdlib-shims + ]; + + checkInputs = [ + dpkg # Replaces: conf-dpkg + git + ounit + python39 # Replaces: conf-python-3 + python39Packages.pyyaml # Replaces: conf-python3-yaml + ]; + doCheck = false; # Tests are failing. + # To enable tests use: lib.versionAtLeast ocaml.version "4.04"; + + meta = with lib; { + description = "Dose library (part of Mancoosi tools)"; + downloadPage = "https://gitlab.com/irill/dose3/"; + homepage = "https://www.mancoosi.org/software/"; + license = licenses.lgpl3Plus; + longDescription = '' + The dose suite provides libraries for handling package meta-data, and various tools for analyzing package relationships in a large package repository. + * dose-builddebcheck checks, given a collection of source package stanzas and a collection of binary package stanzas of Debian packages, whether the build-dependencies of each source package can be satisfied by the binary packages. + * dose-distcheck checks for every package of a distribution whether it is possible to satisfy its dependencies and conflicts within this distribution. + * ceve, a general metadata parser supporting different input formats (Debian, rpm, and others) and different output formats. + * dose-outdated, a Debian-specific tool for finding packages that are not installable with respect to a package repository, and that can only be made installable again by fixing the package itself. + * dose-challenged, a Debian-specific tool for checking which packages will certainly become uninstallable when some existing package is upgraded to a newer version. + * dose-deb-coinstall, a Debian-specific tool for checking whether a set of packages can be installed all together. + ''; + }; +} diff --git a/pkgs/development/ocaml-modules/dtoa/default.nix b/pkgs/development/ocaml-modules/dtoa/default.nix new file mode 100644 index 00000000000..44bc5d7498b --- /dev/null +++ b/pkgs/development/ocaml-modules/dtoa/default.nix @@ -0,0 +1,24 @@ +{ stdenv, lib, fetchurl, buildDunePackage }: + +buildDunePackage rec { + pname = "dtoa"; + version = "0.3.2"; + + useDune2 = true; + + minimumOCamlVersion = "4.02"; + + src = fetchurl { + url = "https://github.com/flowtype/ocaml-${pname}/releases/download/v${version}/${pname}-v${version}.tbz"; + sha256 = "0zkhn0rdq82g6gamsv6nkx6i44s8104nh6jg5xydazl9jl1704xn"; + }; + + hardeningDisable = lib.optional stdenv.cc.isClang "strictoverflow"; + + meta = with lib; { + homepage = "https://github.com/flowtype/ocaml-dtoa"; + description = "Converts OCaml floats into strings (doubles to ascii, \"d to a\"), using the efficient Grisu3 algorithm."; + license = licenses.mit; + maintainers = [ maintainers.eqyiel ]; + }; +} diff --git a/pkgs/development/ocaml-modules/duff/default.nix b/pkgs/development/ocaml-modules/duff/default.nix new file mode 100644 index 00000000000..a57f8564d9e --- /dev/null +++ b/pkgs/development/ocaml-modules/duff/default.nix @@ -0,0 +1,34 @@ +{ lib, fetchurl, buildDunePackage, fetchpatch +, stdlib-shims, bigarray-compat, fmt +, alcotest, hxd, crowbar, bigstringaf +}: + +buildDunePackage rec { + pname = "duff"; + version = "0.4"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/mirage/duff/releases/download/v${version}/duff-v${version}.tbz"; + sha256 = "4795e8344a2c2562e0ef6c44ab742334b5cd807637354715889741b20a461da4"; + }; + + propagatedBuildInputs = [ stdlib-shims bigarray-compat fmt ]; + + doCheck = true; + checkInputs = [ + alcotest + crowbar + hxd + bigstringaf + ]; + + + meta = { + description = "Pure OCaml implementation of libXdiff (Rabin’s fingerprint)"; + homepage = "https://github.com/mirage/duff"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/dum/default.nix b/pkgs/development/ocaml-modules/dum/default.nix new file mode 100644 index 00000000000..3faef36e8ec --- /dev/null +++ b/pkgs/development/ocaml-modules/dum/default.nix @@ -0,0 +1,29 @@ +{ lib, stdenv, fetchFromGitHub, ocaml, findlib +, easy-format +}: + +stdenv.mkDerivation rec { + pname = "ocaml${ocaml.version}-dum"; + version = "1.0.1"; + + src = fetchFromGitHub { + owner = "mjambon"; + repo = "dum"; + rev = "v${version}"; + sha256 = "0yrxl97szjc0s2ghngs346x3y0xszx2chidgzxk93frjjpsr1mlr"; + }; + + nativeBuildInputs = [ ocaml findlib ]; + propagatedBuildInputs = [ easy-format ]; + + strictDeps = true; + + createFindlibDestdir = true; + + meta = with lib; { + homepage = "https://github.com/mjambon/dum"; + description = "Inspect the runtime representation of arbitrary OCaml values"; + license = licenses.lgpl21Plus; + maintainers = [ maintainers.alexfmpe ]; + }; +} diff --git a/pkgs/development/ocaml-modules/dune-action-plugin/default.nix b/pkgs/development/ocaml-modules/dune-action-plugin/default.nix new file mode 100644 index 00000000000..65c55da6e3b --- /dev/null +++ b/pkgs/development/ocaml-modules/dune-action-plugin/default.nix @@ -0,0 +1,19 @@ +{ lib, buildDunePackage, dune_2, dune-glob, dune-private-libs }: + +buildDunePackage rec { + pname = "dune-action-plugin"; + inherit (dune_2) src version patches; + + useDune2 = true; + + dontAddPrefix = true; + + propagatedBuildInputs = [ dune-glob dune-private-libs ]; + + meta = with lib; { + inherit (dune_2.meta) homepage; + description = "API for writing dynamic Dune actions"; + maintainers = [ maintainers.marsam ]; + license = licenses.mit; + }; +} diff --git a/pkgs/development/ocaml-modules/dune-build-info/default.nix b/pkgs/development/ocaml-modules/dune-build-info/default.nix new file mode 100644 index 00000000000..5d9f105782b --- /dev/null +++ b/pkgs/development/ocaml-modules/dune-build-info/default.nix @@ -0,0 +1,17 @@ +{ lib, buildDunePackage, dune_2 }: + +buildDunePackage rec { + pname = "dune-build-info"; + inherit (dune_2) src version patches; + + useDune2 = true; + + dontAddPrefix = true; + + meta = with lib; { + inherit (dune_2.meta) homepage; + description = "Embed build information inside executables"; + maintainers = [ maintainers.bcdarwin ]; + license = licenses.mit; + }; +} diff --git a/pkgs/development/ocaml-modules/dune-configurator/default.nix b/pkgs/development/ocaml-modules/dune-configurator/default.nix new file mode 100644 index 00000000000..f5303db9a3b --- /dev/null +++ b/pkgs/development/ocaml-modules/dune-configurator/default.nix @@ -0,0 +1,21 @@ +{ lib, buildDunePackage, dune_2, csexp, result }: + +buildDunePackage rec { + pname = "dune-configurator"; + + useDune2 = true; + + inherit (dune_2) src version patches; + + minimumOCamlVersion = "4.03"; + + dontAddPrefix = true; + + propagatedBuildInputs = [ csexp result ]; + + meta = with lib; { + description = "Helper library for gathering system configuration"; + maintainers = [ maintainers.marsam ]; + license = licenses.mit; + }; +} diff --git a/pkgs/development/ocaml-modules/dune-glob/default.nix b/pkgs/development/ocaml-modules/dune-glob/default.nix new file mode 100644 index 00000000000..c7c6f9be4ee --- /dev/null +++ b/pkgs/development/ocaml-modules/dune-glob/default.nix @@ -0,0 +1,19 @@ +{ lib, buildDunePackage, dune_2, dune-private-libs }: + +buildDunePackage rec { + pname = "dune-glob"; + inherit (dune_2) src version patches; + + useDune2 = true; + + dontAddPrefix = true; + + propagatedBuildInputs = [ dune-private-libs ]; + + meta = with lib; { + inherit (dune_2.meta) homepage; + description = "Glob string matching language supported by dune"; + maintainers = [ maintainers.marsam ]; + license = licenses.mit; + }; +} diff --git a/pkgs/development/ocaml-modules/dune-private-libs/default.nix b/pkgs/development/ocaml-modules/dune-private-libs/default.nix new file mode 100644 index 00000000000..8a635efa3a5 --- /dev/null +++ b/pkgs/development/ocaml-modules/dune-private-libs/default.nix @@ -0,0 +1,19 @@ +{ lib, buildDunePackage, dune_2 }: + +buildDunePackage rec { + pname = "dune-private-libs"; + + useDune2 = true; + + inherit (dune_2) src version patches; + + minimumOCamlVersion = "4.08"; + + dontAddPrefix = true; + + meta = with lib; { + description = "Private libraries of Dune"; + maintainers = [ maintainers.marsam ]; + license = licenses.mit; + }; +} diff --git a/pkgs/development/ocaml-modules/dune-site/default.nix b/pkgs/development/ocaml-modules/dune-site/default.nix new file mode 100644 index 00000000000..9462393d269 --- /dev/null +++ b/pkgs/development/ocaml-modules/dune-site/default.nix @@ -0,0 +1,19 @@ +{ lib, buildDunePackage, dune_2, dune-private-libs }: + +buildDunePackage rec { + pname = "dune-site"; + inherit (dune_2) src version patches; + + useDune2 = true; + + dontAddPrefix = true; + + propagatedBuildInputs = [ dune-private-libs ]; + + meta = with lib; { + description = "A library for embedding location information inside executable and libraries"; + inherit (dune_2.meta) homepage; + maintainers = with lib.maintainers; [ ]; + license = licenses.mit; + }; +} diff --git a/pkgs/development/ocaml-modules/duration/default.nix b/pkgs/development/ocaml-modules/duration/default.nix new file mode 100644 index 00000000000..a547a919c31 --- /dev/null +++ b/pkgs/development/ocaml-modules/duration/default.nix @@ -0,0 +1,24 @@ +{ lib, buildDunePackage, ocaml, fetchurl, alcotest }: + +buildDunePackage rec { + pname = "duration"; + version = "0.1.3"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/hannesm/duration/releases/download/${version}/duration-${version}.tbz"; + sha256 = "0m9r0ayhpl98g9vdxrbjdcllns274jilic5v8xj1x7dphw21p95h"; + }; + + doCheck = lib.versionAtLeast ocaml.version "4.05"; + checkInputs = [ alcotest ]; + + meta = { + homepage = "https://github.com/hannesm/duration"; + description = "Conversions to various time units"; + license = lib.licenses.isc; + maintainers = [ lib.maintainers.vbgl ]; + }; + +} diff --git a/pkgs/development/ocaml-modules/dypgen/default.nix b/pkgs/development/ocaml-modules/dypgen/default.nix new file mode 100644 index 00000000000..64017bd65fe --- /dev/null +++ b/pkgs/development/ocaml-modules/dypgen/default.nix @@ -0,0 +1,38 @@ +{stdenv, lib, fetchurl, ocaml, findlib}: + +let + pname = "dypgen"; +in + +if lib.versionAtLeast ocaml.version "4.06" +then throw "${pname} is not available for OCaml ${ocaml.version}" +else + +stdenv.mkDerivation rec { + name = "${pname}-${version}"; + version = "20120619-1"; + + src = fetchurl { + url = "http://dypgen.free.fr/dypgen-20120619-1.tar.bz2"; + sha256 = "ecb53d6e469e9ec4d57ee6323ff498d45b78883ae13618492488e7c5151fdd97"; + }; + + nativeBuildInputs = [ ocaml findlib ]; + + strictDeps = true; + + createFindlibDestdir = true; + + buildPhase = '' + make + ''; + + makeFlags = [ "BINDIR=$(out)/bin" "MANDIR=$(out)/usr/share/man/man1" "DYPGENLIBDIR=$(out)/lib/ocaml/${ocaml.version}/site-lib" ]; + + meta = { + homepage = "http://dypgen.free.fr"; + description = "Dypgen GLR self extensible parser generator"; + license = lib.licenses.cecill-b; + platforms = ocaml.meta.platforms or []; + }; +} diff --git a/pkgs/development/ocaml-modules/earley/default.nix b/pkgs/development/ocaml-modules/earley/default.nix new file mode 100644 index 00000000000..c7b2d09d667 --- /dev/null +++ b/pkgs/development/ocaml-modules/earley/default.nix @@ -0,0 +1,28 @@ +{ lib, fetchFromGitHub, ocaml, buildDunePackage +, stdlib-shims +}: + +buildDunePackage rec { + version = "3.0.0"; + pname = "earley"; + src = fetchFromGitHub { + owner = "rlepigre"; + repo = "ocaml-earley"; + rev = version; + sha256 = "1vi58zdxchpw6ai0bz9h2ggcmg8kv57yk6qbx82lh47s5wb3mz5y"; + }; + + minimumOCamlVersion = "4.07"; + useDune2 = true; + + buildInputs = [ stdlib-shims ]; + + doCheck = true; + + meta = { + description = "Parser combinators based on Earley Algorithm"; + license = lib.licenses.cecill-b; + maintainers = [ lib.maintainers.vbgl ]; + homepage = "https://github.com/rlepigre/ocaml-earley"; + }; +} diff --git a/pkgs/development/ocaml-modules/earlybird/default.nix b/pkgs/development/ocaml-modules/earlybird/default.nix new file mode 100644 index 00000000000..a6a3648bec6 --- /dev/null +++ b/pkgs/development/ocaml-modules/earlybird/default.nix @@ -0,0 +1,30 @@ +{ lib, fetchurl, ocaml, buildDunePackage +, cmdliner, dap, fmt, iter, logs, lru, lwt_ppx, lwt_react, menhir, menhirLib, path_glob, ppx_deriving_yojson +}: + +if lib.versionAtLeast ocaml.version "4.13" +then throw "earlybird is not available for OCaml ${ocaml.version}" +else + +buildDunePackage rec { + pname = "earlybird"; + version = "1.1.0"; + + useDune2 = true; + + minimumOCamlVersion = "4.11"; + + src = fetchurl { + url = "https://github.com/hackwaly/ocamlearlybird/releases/download/${version}/${pname}-${version}.tbz"; + sha256 = "1pwzhcr3pw24ra4j4d23vz71h0psz4xkyp7b12l2wl1slxzjbrxa"; + }; + + buildInputs = [ cmdliner dap fmt iter logs lru lwt_ppx lwt_react menhir menhirLib path_glob ppx_deriving_yojson ]; + + meta = { + homepage = "https://github.com/hackwaly/ocamlearlybird"; + description = "OCaml debug adapter"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.romildo ]; + }; +} diff --git a/pkgs/development/ocaml-modules/easy-format/default.nix b/pkgs/development/ocaml-modules/easy-format/default.nix new file mode 100644 index 00000000000..a6e78977846 --- /dev/null +++ b/pkgs/development/ocaml-modules/easy-format/default.nix @@ -0,0 +1,29 @@ +{ lib, stdenv, fetchFromGitHub, ocaml, findlib }: + +stdenv.mkDerivation rec { + + pname = "easy-format"; + version = "1.2.0"; + + src = fetchFromGitHub { + owner = "mjambon"; + repo = "easy-format"; + rev = "v${version}"; + sha256 = "sha256-qf73+T9a+eDy78iZgpA08TjIo+lvjftfSkwyT3M96gE="; + }; + + nativeBuildInputs = [ ocaml findlib ]; + strictDeps = true; + + createFindlibDestdir = true; + + doCheck = true; + checkTarget = "test"; + + meta = with lib; { + description = "A high-level and functional interface to the Format module of the OCaml standard library"; + homepage = "https://github.com/ocaml-community/easy-format"; + license = licenses.bsd3; + maintainers = [ maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/eigen/default.nix b/pkgs/development/ocaml-modules/eigen/default.nix new file mode 100644 index 00000000000..47b002fd730 --- /dev/null +++ b/pkgs/development/ocaml-modules/eigen/default.nix @@ -0,0 +1,29 @@ +{ lib, stdenv, buildDunePackage, fetchFromGitHub, ctypes, libcxx }: + +buildDunePackage rec { + pname = "eigen"; + version = "0.2.0"; + + useDune2 = true; + + src = fetchFromGitHub { + owner = "owlbarn"; + repo = pname; + rev = version; + sha256 = "1zaw03as14hyvfpyj6bjrfbcxp2ljdbqcqqgm53kms244mig425f"; + }; + + minimumOCamlVersion = "4.02"; + + NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-I${lib.getDev libcxx}/include/c++/v1"; + + propagatedBuildInputs = [ ctypes ]; + + meta = with lib; { + inherit (src.meta) homepage; + description = "Minimal/incomplete Ocaml interface to Eigen3, mostly for Owl"; + platforms = platforms.x86_64; + maintainers = [ maintainers.bcdarwin ]; + license = licenses.mit; + }; +} diff --git a/pkgs/development/ocaml-modules/either/default.nix b/pkgs/development/ocaml-modules/either/default.nix new file mode 100644 index 00000000000..71d16c9674c --- /dev/null +++ b/pkgs/development/ocaml-modules/either/default.nix @@ -0,0 +1,20 @@ +{ lib, buildDunePackage, fetchurl }: + +buildDunePackage rec { + pname = "either"; + version = "1.0.0"; + + src = fetchurl { + url = "https://github.com/mirage/either/releases/download/${version}/either-${version}.tbz"; + sha256 = "bf674de3312dee7b7215f07df1e8a96eb3d679164b8a918cdd95b8d97e505884"; + }; + + useDune2 = true; + + meta = with lib; { + description = "Compatibility Either module"; + license = licenses.mit; + homepage = "https://github.com/mirage/either"; + maintainers = [ maintainers.sternenseemann ]; + }; +} diff --git a/pkgs/development/ocaml-modules/elina/default.nix b/pkgs/development/ocaml-modules/elina/default.nix new file mode 100644 index 00000000000..df7f140e545 --- /dev/null +++ b/pkgs/development/ocaml-modules/elina/default.nix @@ -0,0 +1,35 @@ +{ stdenv, lib, fetchurl, perl, gmp, mpfr, ocaml, findlib, camlidl, apron }: + +stdenv.mkDerivation rec { + version = "1.1"; + pname = "ocaml${ocaml.version}-elina"; + src = fetchurl { + url = "http://files.sri.inf.ethz.ch/elina-${version}.tar.gz"; + sha256 = "1nymykskq1yx87y4xl6hl9i4q6kv0qaq25rniqgl1bfn883p1ysc"; + }; + + nativeBuildInputs = [ perl ocaml findlib ]; + + propagatedBuildInputs = [ apron camlidl gmp mpfr ]; + + strictDeps = true; + + prefixKey = "--prefix "; + configureFlags = [ + "--use-apron" + "--use-opam" + "--apron-prefix" apron + ] + ++ lib.optional stdenv.isDarwin "--absolute-dylibs" + ; + + createFindlibDestdir = true; + + meta = { + description = "ETH LIbrary for Numerical Analysis"; + homepage = "http://elina.ethz.ch/"; + license = lib.licenses.lgpl3; + maintainers = [ lib.maintainers.vbgl ]; + inherit (ocaml.meta) platforms; + }; +} diff --git a/pkgs/development/ocaml-modules/eliom/default.nix b/pkgs/development/ocaml-modules/eliom/default.nix new file mode 100644 index 00000000000..e3af173edc9 --- /dev/null +++ b/pkgs/development/ocaml-modules/eliom/default.nix @@ -0,0 +1,79 @@ +{ stdenv +, lib +, fetchFromGitHub +, which +, ocsigen_server +, ocaml +, lwt_react +, opaline +, ocamlbuild +, ppx_deriving +, findlib +, js_of_ocaml-ocamlbuild +, js_of_ocaml-ppx +, js_of_ocaml-ppx_deriving_json +, js_of_ocaml-lwt +, js_of_ocaml-tyxml +, lwt_ppx +, ocamlnet +}: + +stdenv.mkDerivation rec { + pname = "eliom"; + version = "8.9.0"; + + src = fetchFromGitHub { + owner = "ocsigen"; + repo = "eliom"; + rev = version; + sha256 = "sha256-VNxzpVpXEGlixyjadbW0GjL83jcKV5TWd46UReNYO6w="; + }; + + nativeBuildInputs = [ + ocaml + which + findlib + opaline + ocamlbuild + ]; + buildInputs = [ + js_of_ocaml-ocamlbuild + js_of_ocaml-ppx_deriving_json + ocamlnet + ]; + + propagatedBuildInputs = [ + js_of_ocaml-lwt + js_of_ocaml-ppx + js_of_ocaml-tyxml + lwt_ppx + lwt_react + ocsigen_server + ppx_deriving + ]; + + strictDeps = true; + + installPhase = "opaline -prefix $out -libdir $OCAMLFIND_DESTDIR"; + + setupHook = [ ./setup-hook.sh ]; + + meta = { + homepage = "http://ocsigen.org/eliom/"; + description = "OCaml Framework for programming Web sites and client/server Web applications"; + + longDescription = ''Eliom is a framework for programming Web sites + and client/server Web applications. It introduces new concepts to + simplify programming common behaviours and uses advanced static + typing features of OCaml to check many properties of the Web site + at compile time. If you want to write a Web application, Eliom + makes possible to write the whole application as a single program + (client and server parts). A syntax extension is used to + distinguish both parts and the client side is compiled to JS using + Ocsigen Js_of_ocaml.''; + + license = lib.licenses.lgpl21; + + maintainers = [ lib.maintainers.gal_bolle ]; + }; +} diff --git a/pkgs/development/ocaml-modules/eliom/setup-hook.sh b/pkgs/development/ocaml-modules/eliom/setup-hook.sh new file mode 100644 index 00000000000..9868ab93f79 --- /dev/null +++ b/pkgs/development/ocaml-modules/eliom/setup-hook.sh @@ -0,0 +1,5 @@ +addOcsigenDistilleryTemplate() { + addToSearchPathWithCustomDelimiter : ELIOM_DISTILLERY_PATH $1/eliom-distillery-templates +} + +addEnvHooks "$hostOffset" addOcsigenDistilleryTemplate diff --git a/pkgs/development/ocaml-modules/elpi/default.nix b/pkgs/development/ocaml-modules/elpi/default.nix new file mode 100644 index 00000000000..0770f3a48d4 --- /dev/null +++ b/pkgs/development/ocaml-modules/elpi/default.nix @@ -0,0 +1,47 @@ +{ stdenv, lib, fetchzip, buildDunePackage, camlp5 +, re, perl, ncurses +, ppxlib, ppx_deriving +, ppxlib_0_15, ppx_deriving_0_15 +, version ? "1.14.1" +}: +with lib; +let fetched = import ../../../build-support/coq/meta-fetch/default.nix + {inherit lib stdenv fetchzip; } ({ + release."1.14.1".sha256 = "sha256-BZPVL8ymjrE9kVGyf6bpc+GA2spS5JBpkUtZi04nPis="; + release."1.13.7".sha256 = "10fnwz30bsvj7ii1vg4l1li5pd7n0qqmwj18snkdr5j9gk0apc1r"; + release."1.13.5".sha256 = "02a6r23mximrdvs6kgv6rp0r2dgk7zynbs99nn7lphw2c4189kka"; + release."1.13.1".sha256 = "12a9nbdvg9gybpw63lx3nw5wnxfznpraprb0wj3l68v1w43xq044"; + release."1.13.0".sha256 = "0dmzy058m1mkndv90byjaik6lzzfk3aaac7v84mpmkv6my23bygr"; + release."1.12.0".sha256 = "1agisdnaq9wrw3r73xz14yrq3wx742i6j8i5icjagqk0ypmly2is"; + release."1.11.4".sha256 = "1m0jk9swcs3jcrw5yyw5343v8mgax238cjb03s8gc4wipw1fn9f5"; + releaseRev = v: "v${v}"; + location = { domain = "github.com"; owner = "LPCIC"; repo = "elpi"; }; + }) version; +in +buildDunePackage rec { + pname = "elpi"; + inherit (fetched) version src; + + minimumOCamlVersion = "4.04"; + + buildInputs = [ perl ncurses ]; + + propagatedBuildInputs = [ camlp5 re ] + ++ (if lib.versionAtLeast version "1.13" + then [ ppxlib ppx_deriving ] + else [ ppxlib_0_15 ppx_deriving_0_15 ] + ); + + meta = { + description = "Embeddable λProlog Interpreter"; + license = licenses.lgpl21Plus; + maintainers = [ maintainers.vbgl ]; + homepage = "https://github.com/LPCIC/elpi"; + }; + + postPatch = '' + substituteInPlace elpi_REPL.ml --replace "tput cols" "${ncurses}/bin/tput cols" + ''; + + useDune2 = true; +} diff --git a/pkgs/development/ocaml-modules/emile/default.nix b/pkgs/development/ocaml-modules/emile/default.nix new file mode 100644 index 00000000000..d296e3de967 --- /dev/null +++ b/pkgs/development/ocaml-modules/emile/default.nix @@ -0,0 +1,39 @@ +{ lib, buildDunePackage, fetchurl, ocaml +, angstrom, ipaddr, base64, pecu, uutf +, alcotest, cmdliner +}: + +buildDunePackage rec { + pname = "emile"; + version = "1.1"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/dinosaure/emile/releases/download/v${version}/emile-v${version}.tbz"; + sha256 = "0r1141makr0b900aby1gn0fccjv1qcqgyxib3bzq8fxmjqwjan8p"; + }; + + buildInputs = [ cmdliner ]; + + propagatedBuildInputs = [ + angstrom + ipaddr + base64 + pecu + uutf + ]; + + # technically emile is available for ocaml >= 4.03, but alcotest + # and angstrom (fmt) are only available for >= 4.05. Disabling + # tests for < 4.05 at least improves the error message + doCheck = lib.versionAtLeast ocaml.version "4.05"; + checkInputs = [ alcotest ]; + + meta = with lib; { + description = "Parser of email address according RFC822"; + license = licenses.mit; + homepage = "https://github.com/dinosaure/emile"; + maintainers = [ maintainers.sternenseemann ]; + }; +} diff --git a/pkgs/development/ocaml-modules/encore/default.nix b/pkgs/development/ocaml-modules/encore/default.nix new file mode 100644 index 00000000000..5924845c4f4 --- /dev/null +++ b/pkgs/development/ocaml-modules/encore/default.nix @@ -0,0 +1,27 @@ +{ lib, buildDunePackage, fetchurl, ocaml +, fmt, bigstringaf, angstrom, alcotest }: + +buildDunePackage rec { + pname = "encore"; + version = "0.8"; + + minimumOCamlVersion = "4.07"; + + src = fetchurl { + url = "https://github.com/mirage/encore/releases/download/v${version}/encore-v${version}.tbz"; + sha256 = "a406bc9863b04bb424692045939d6c170a2bb65a98521ae5608d25b0559344f6"; + }; + + useDune2 = true; + + propagatedBuildInputs = [ angstrom fmt bigstringaf ]; + checkInputs = [ alcotest ]; + doCheck = true; + + meta = { + homepage = "https://github.com/mirage/encore"; + description = "Library to generate encoder/decoder which ensure isomorphism"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/enumerate/default.nix b/pkgs/development/ocaml-modules/enumerate/default.nix new file mode 100644 index 00000000000..9bedc421510 --- /dev/null +++ b/pkgs/development/ocaml-modules/enumerate/default.nix @@ -0,0 +1,31 @@ +{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, type_conv, camlp4 }: + +assert lib.versionAtLeast (lib.getVersion ocaml) "4.00"; + +if lib.versionAtLeast ocaml.version "4.06" +then throw "enumerate-111.08.00 is not available for OCaml ${ocaml.version}" +else + +stdenv.mkDerivation rec { + pname = "ocaml-enumerate"; + version = "111.08.00"; + + src = fetchurl { + url = "https://ocaml.janestreet.com/ocaml-core/${lib.versions.majorMinor version}.00/individual/enumerate-${version}.tar.gz"; + sha256 = "0b6mx5p01lcpimvak4wx6aj2119707wsfzd83rwgb91bhpgzh156"; + }; + + nativeBuildInputs = [ ocaml findlib ocamlbuild ]; + propagatedBuildInputs = [ type_conv camlp4 ]; + + strictDeps = true; + + createFindlibDestdir = true; + + meta = { + homepage = "https://ocaml.janestreet.com/"; + description = "Quotation expanders for enumerating finite types"; + license = lib.licenses.asl20; + platforms = ocaml.meta.platforms or [ ]; + }; +} diff --git a/pkgs/development/ocaml-modules/eqaf/default.nix b/pkgs/development/ocaml-modules/eqaf/default.nix new file mode 100644 index 00000000000..a3f64cb7bd9 --- /dev/null +++ b/pkgs/development/ocaml-modules/eqaf/default.nix @@ -0,0 +1,23 @@ +{ lib, fetchurl, buildDunePackage, cstruct, bigarray-compat }: + +buildDunePackage rec { + minimumOCamlVersion = "4.03"; + pname = "eqaf"; + version = "0.7"; + useDune2 = true; + + src = fetchurl { + url = "https://github.com/mirage/eqaf/releases/download/v${version}/eqaf-v${version}.tbz"; + sha256 = "1q09pwhs121vpficl2af1yzs4y7dd9bc1lcxbqyfc4x4m6p6drhh"; + }; + + propagatedBuildInputs = [ cstruct bigarray-compat ]; + + meta = { + description = "Constant time equal function to avoid timing attacks in OCaml"; + homepage = "https://github.com/mirage/eqaf"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.vbgl ]; + }; + +} diff --git a/pkgs/development/ocaml-modules/erm_xml/default.nix b/pkgs/development/ocaml-modules/erm_xml/default.nix new file mode 100644 index 00000000000..ebf9cdaad69 --- /dev/null +++ b/pkgs/development/ocaml-modules/erm_xml/default.nix @@ -0,0 +1,31 @@ +{ stdenv, lib, fetchFromGitHub, ocaml, findlib, ocamlbuild }: + +if !lib.versionAtLeast ocaml.version "4.02" +then throw "erm_xml is not available for OCaml ${ocaml.version}" +else + +stdenv.mkDerivation rec { + pname = "ocaml${ocaml.version}-erm_xml"; + version = "0.3+20180112"; + + src = fetchFromGitHub { + owner = "hannesm"; + repo = "xml"; + rev = "bbabdade807d8281fc48806da054b70dfe482479"; + sha256 = "sha256-OQdLTq9tJZc6XlcuPv2gxzYiQAUGd6AiBzfSi169XL0="; + }; + + nativeBuildInputs = [ ocaml findlib ocamlbuild ]; + + strictDeps = true; + + createFindlibDestdir = true; + + meta = { + homepage = "https://github.com/hannesm/xml"; + description = "XML Parser for discrete data"; + platforms = ocaml.meta.platforms or [ ]; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/erm_xmpp/default.nix b/pkgs/development/ocaml-modules/erm_xmpp/default.nix new file mode 100644 index 00000000000..1507154d2f6 --- /dev/null +++ b/pkgs/development/ocaml-modules/erm_xmpp/default.nix @@ -0,0 +1,47 @@ +{ stdenv, lib, fetchFromGitHub, ocaml, findlib, camlp4, ocamlbuild +, erm_xml, mirage-crypto, mirage-crypto-rng, base64 +}: + +stdenv.mkDerivation rec { + version = "0.3+20200317"; + pname = "ocaml${ocaml.version}-erm_xmpp"; + + src = fetchFromGitHub { + owner = "hannesm"; + repo = "xmpp"; + rev = "7fa5bea252671fd88625c6af109998b879ca564f"; + sha256 = "0spzyd9kbyizzwl8y3mq8z19zlkzxnkh2fppry4lyc7vaw7bqrwq"; + }; + + nativeBuildInputs = [ ocaml findlib ocamlbuild camlp4 ]; + buildInputs = [ camlp4 ]; + propagatedBuildInputs = [ erm_xml mirage-crypto mirage-crypto-rng base64 ]; + + strictDeps = true; + + configurePhase = '' + runHook preConfigure + ocaml setup.ml -configure --prefix $out + runHook postConfigure + ''; + buildPhase = '' + runHook preBuild + ocaml setup.ml -build + runHook postBuild + ''; + installPhase = '' + runHook preInstall + ocaml setup.ml -install + runHook postInstall + ''; + + createFindlibDestdir = true; + + meta = { + homepage = "https://github.com/hannesm/xmpp"; + description = "OCaml based XMPP implementation (fork)"; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ sternenseemann ]; + inherit (ocaml.meta) platforms; + }; +} diff --git a/pkgs/development/ocaml-modules/ethernet/default.nix b/pkgs/development/ocaml-modules/ethernet/default.nix new file mode 100644 index 00000000000..59c581e128a --- /dev/null +++ b/pkgs/development/ocaml-modules/ethernet/default.nix @@ -0,0 +1,42 @@ +{ lib, buildDunePackage, fetchurl +, rresult, cstruct, ppx_cstruct, mirage-net, mirage-protocols +, mirage-profile, macaddr, fmt, lwt, logs +}: + +buildDunePackage rec { + pname = "ethernet"; + version = "3.0.0"; + + minimumOCamlVersion = "4.08"; + + # necessary due to cstruct + useDune2 = true; + + src = fetchurl { + url = "https://github.com/mirage/${pname}/releases/download/v${version}/${pname}-v${version}.tbz"; + sha256 = "0a898vp9dw42majsvzzvs8pc6x4ns01wlwhwbacixliv6vv78ng9"; + }; + + nativeBuildInputs = [ + ppx_cstruct + ]; + + propagatedBuildInputs = [ + rresult + cstruct + mirage-net + mirage-protocols + macaddr + mirage-profile + fmt + lwt + logs + ]; + + meta = with lib; { + description = "OCaml Ethernet (IEEE 802.3) layer, used in MirageOS"; + homepage = "https://github.com/mirage/ethernet"; + license = licenses.isc; + maintainers = [ maintainers.sternenseemann ]; + }; +} 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 00000000000..326ffc60b1a --- /dev/null +++ b/pkgs/development/ocaml-modules/expat/0.9.nix @@ -0,0 +1,54 @@ +{stdenv, lib, 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"; + }; + + nativeBuildInputs = [ocaml findlib ]; + buildInputs = [ ounit expat]; + + strictDeps = true; + + 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)" + ''; + + dontConfigure = 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 = lib.licenses.mit; + maintainers = [ lib.maintainers.roconnor ]; + }; +} diff --git a/pkgs/development/ocaml-modules/expat/default.nix b/pkgs/development/ocaml-modules/expat/default.nix new file mode 100644 index 00000000000..6fb7927073d --- /dev/null +++ b/pkgs/development/ocaml-modules/expat/default.nix @@ -0,0 +1,35 @@ +{ stdenv, lib, fetchFromGitHub, expat, ocaml, findlib, ounit }: + +stdenv.mkDerivation rec { + pname = "ocaml${ocaml.version}-expat"; + version = "1.1.0"; + + src = fetchFromGitHub { + owner = "whitequark"; + repo = "ocaml-expat"; + rev = "v${version}"; + sha256 = "07wm9663z744ya6z2lhiz5hbmc76kkipg04j9vw9dqpd1y1f2x3q"; + }; + + prePatch = '' + substituteInPlace Makefile --replace "gcc" "\$(CC)" + ''; + + nativeBuildInputs = [ ocaml findlib ]; + buildInputs = [ expat ounit ]; + + strictDeps = true; + + doCheck = !lib.versionAtLeast ocaml.version "4.06"; + checkTarget = "testall"; + + createFindlibDestdir = true; + + meta = { + description = "OCaml wrapper for the Expat XML parsing library"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.vbgl ]; + inherit (src.meta) homepage; + inherit (ocaml.meta) platforms; + }; +} diff --git a/pkgs/development/ocaml-modules/expat/unittest.patch b/pkgs/development/ocaml-modules/expat/unittest.patch new file mode 100644 index 00000000000..489b745c503 --- /dev/null +++ b/pkgs/development/ocaml-modules/expat/unittest.patch @@ -0,0 +1,15 @@ +--- old/Makefile 2005-03-13 09:00:29.000000000 -0500 ++++ new/Makefile 2010-08-26 14:20:34.515785557 -0400 +@@ -67,10 +67,10 @@ + testall: test testopt + .PHONY: test + test: unittest +- ./unittest ++ LD_LIBRARY_PATH=. ./unittest + .PHONY: testopt + testopt: unittest.opt +- ./unittest.opt ++ LD_LIBRARY_PATH=. ./unittest.opt + unittest: all unittest.ml + $(OCAMLFIND) ocamlc -o unittest -package oUnit -ccopt -L. -linkpkg \ + $(ARCHIVE) unittest.ml diff --git a/pkgs/development/ocaml-modules/extlib/1.7.7.nix b/pkgs/development/ocaml-modules/extlib/1.7.7.nix new file mode 100644 index 00000000000..d27fe085569 --- /dev/null +++ b/pkgs/development/ocaml-modules/extlib/1.7.7.nix @@ -0,0 +1,14 @@ +# Older version of extlib for Haxe 4.0 and 4.1. +# May be replaceable by the next extlib + extlib-base64 release. +{ lib, fetchurl, ocaml, ocaml_extlib }: + +ocaml_extlib.overrideAttrs (x: rec { + version = "1.7.7"; + src = fetchurl { + url = "https://github.com/ygrek/ocaml-extlib/releases/download/${version}/extlib-${version}.tar.gz"; + sha256 = "1sxmzc1mx3kg62j8kbk0dxkx8mkf1rn70h542cjzrziflznap0s1"; + }; + meta = x.meta // { + broken = lib.versionAtLeast ocaml.version "4.12"; + }; +}) diff --git a/pkgs/development/ocaml-modules/extlib/default.nix b/pkgs/development/ocaml-modules/extlib/default.nix new file mode 100644 index 00000000000..7f50548f4b8 --- /dev/null +++ b/pkgs/development/ocaml-modules/extlib/default.nix @@ -0,0 +1,30 @@ +{ stdenv, lib, fetchurl, ocaml, findlib, cppo +# De facto, option minimal seems to be the default. See the README. +, minimal ? true +}: + +stdenv.mkDerivation rec { + pname = "ocaml${ocaml.version}-extlib"; + version = "1.7.8"; + + src = fetchurl { + url = "https://ygrek.org/p/release/ocaml-extlib/extlib-${version}.tar.gz"; + sha256 = "0npq4hq3zym8nmlyji7l5cqk6drx2rkcx73d60rxqh5g8dla8p4k"; + }; + + nativeBuildInputs = [ ocaml findlib cppo ]; + + strictDeps = true; + + createFindlibDestdir = true; + + makeFlags = lib.optional minimal "minimal=1"; + + meta = { + homepage = "https://github.com/ygrek/ocaml-extlib"; + description = "Enhancements to the OCaml Standard Library modules"; + license = lib.licenses.lgpl21Only; + platforms = ocaml.meta.platforms or []; + maintainers = [ lib.maintainers.sternenseemann ]; + }; +} diff --git a/pkgs/development/ocaml-modules/ezjsonm/default.nix b/pkgs/development/ocaml-modules/ezjsonm/default.nix new file mode 100644 index 00000000000..fd318705512 --- /dev/null +++ b/pkgs/development/ocaml-modules/ezjsonm/default.nix @@ -0,0 +1,22 @@ +{ lib, fetchurl, buildDunePackage, jsonm, hex, sexplib0 }: + +buildDunePackage rec { + pname = "ezjsonm"; + version = "1.2.0"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/mirage/ezjsonm/releases/download/v${version}/ezjsonm-v${version}.tbz"; + sha256 = "1q6cf63cc614lr141rzhm2w4rhi1snfqai6fmkhvfjs84hfbw2w7"; + }; + + propagatedBuildInputs = [ jsonm hex sexplib0 ]; + + meta = { + description = "An easy interface on top of the Jsonm library"; + homepage = "https://github.com/mirage/ezjsonm"; + license = lib.licenses.isc; + maintainers = with lib.maintainers; [ vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/ezxmlm/default.nix b/pkgs/development/ocaml-modules/ezxmlm/default.nix new file mode 100644 index 00000000000..b146b2349cd --- /dev/null +++ b/pkgs/development/ocaml-modules/ezxmlm/default.nix @@ -0,0 +1,33 @@ +{ lib, fetchurl, buildDunePackage, xmlm }: + +buildDunePackage rec { + pname = "ezxmlm"; + version = "1.1.0"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/mirage/ezxmlm/releases/download/v${version}/ezxmlm-v${version}.tbz"; + sha256 = "123dn4h993mlng9gzf4nc6mw75ja7ndcxkbkwfs48j5jk1z05j6d"; + }; + + propagatedBuildInputs = [ xmlm ]; + + meta = with lib; { + description = "Combinators to use with xmlm for parsing and selection"; + longDescription = '' + An "easy" interface on top of the xmlm library. This version provides + more convenient (but far less flexible) input and output functions + that go to and from [string] values. This avoids the need to write signal + code, which is useful for quick scripts that manipulate XML. + + More advanced users should go straight to the Xmlm library and use it + directly, rather than be saddled with the Ezxmlm interface. Since the + types in this library are more specific than Xmlm, it should interoperate + just fine with it if you decide to switch over. + ''; + maintainers = [ maintainers.carlosdagos ]; + homepage = "https://github.com/mirage/ezxmlm/"; + license = licenses.isc; + }; +} diff --git a/pkgs/development/ocaml-modules/facile/default.nix b/pkgs/development/ocaml-modules/facile/default.nix new file mode 100644 index 00000000000..df228603e9f --- /dev/null +++ b/pkgs/development/ocaml-modules/facile/default.nix @@ -0,0 +1,21 @@ +{ lib, fetchurl, buildDunePackage }: + +buildDunePackage rec { + pname = "facile"; + version = "1.1.4"; + + useDune2 = false; + + src = fetchurl { + url = "https://github.com/Emmanuel-PLF/facile/releases/download/${version}/facile-${version}.tbz"; + sha256 = "0jqrwmn6fr2vj2rrbllwxq4cmxykv7zh0y4vnngx29f5084a04jp"; + }; + + doCheck = true; + + meta = { + homepage = "http://opti.recherche.enac.fr/facile/"; + license = lib.licenses.lgpl21Plus; + description = "A Functional Constraint Library"; + }; +} diff --git a/pkgs/development/ocaml-modules/faraday/async.nix b/pkgs/development/ocaml-modules/faraday/async.nix new file mode 100644 index 00000000000..666eb684925 --- /dev/null +++ b/pkgs/development/ocaml-modules/faraday/async.nix @@ -0,0 +1,14 @@ +{ buildDunePackage, faraday, core, async }: + +buildDunePackage rec { + pname = "faraday-async"; + inherit (faraday) version src useDune2; + + minimumOCamlVersion = "4.08"; + + propagatedBuildInputs = [ faraday core async ]; + + meta = faraday.meta // { + description = "Async support for Faraday"; + }; +} diff --git a/pkgs/development/ocaml-modules/faraday/default.nix b/pkgs/development/ocaml-modules/faraday/default.nix new file mode 100644 index 00000000000..48a6a82a738 --- /dev/null +++ b/pkgs/development/ocaml-modules/faraday/default.nix @@ -0,0 +1,28 @@ +{ lib, fetchFromGitHub, buildDunePackage, ocaml, alcotest, bigstringaf }: + +buildDunePackage rec { + pname = "faraday"; + version = "0.7.2"; + + useDune2 = true; + + minimumOCamlVersion = "4.02"; + + src = fetchFromGitHub { + owner = "inhabitedtype"; + repo = pname; + rev = version; + sha256 = "0gdysszzk6b6npic4nhpdnz2nbq7rma6aml0rbn113bfh0rmb36x"; + }; + + checkInputs = [ alcotest ]; + propagatedBuildInputs = [ bigstringaf ]; + doCheck = lib.versionAtLeast ocaml.version "4.05"; + + meta = { + description = "Serialization library built for speed and memory efficiency"; + license = lib.licenses.bsd3; + maintainers = [ lib.maintainers.vbgl ]; + inherit (src.meta) homepage; + }; +} diff --git a/pkgs/development/ocaml-modules/faraday/lwt-unix.nix b/pkgs/development/ocaml-modules/faraday/lwt-unix.nix new file mode 100644 index 00000000000..23914de2657 --- /dev/null +++ b/pkgs/development/ocaml-modules/faraday/lwt-unix.nix @@ -0,0 +1,12 @@ +{ buildDunePackage, faraday, faraday-lwt, lwt }: + +buildDunePackage rec { + pname = "faraday-lwt-unix"; + inherit (faraday) version src useDune2 minimumOCamlVersion; + + propagatedBuildInputs = [ lwt faraday-lwt ]; + + meta = faraday.meta // { + description = "Lwt + Unix support for Faraday"; + }; +} diff --git a/pkgs/development/ocaml-modules/faraday/lwt.nix b/pkgs/development/ocaml-modules/faraday/lwt.nix new file mode 100644 index 00000000000..7fe7319575c --- /dev/null +++ b/pkgs/development/ocaml-modules/faraday/lwt.nix @@ -0,0 +1,12 @@ +{ buildDunePackage, faraday, lwt }: + +buildDunePackage rec { + pname = "faraday-lwt"; + inherit (faraday) version src useDune2 minimumOCamlVersion; + + propagatedBuildInputs = [ faraday lwt ]; + + meta = faraday.meta // { + description = "Lwt support for Faraday"; + }; +} diff --git a/pkgs/development/ocaml-modules/farfadet/default.nix b/pkgs/development/ocaml-modules/farfadet/default.nix new file mode 100644 index 00000000000..1ac5595a015 --- /dev/null +++ b/pkgs/development/ocaml-modules/farfadet/default.nix @@ -0,0 +1,34 @@ +{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, topkg +, faraday +}: + +if !lib.versionAtLeast ocaml.version "4.3" +then throw "farfadet is not available for OCaml ${ocaml.version}" +else + +stdenv.mkDerivation rec { + pname = "ocaml${ocaml.version}-farfadet"; + version = "0.3"; + + src = fetchurl { + url = "https://github.com/oklm-wsh/Farfadet/releases/download/v${version}/farfadet-${version}.tbz"; + sha256 = "0nlafnp0pwx0n4aszpsk6nvcvqi9im306p4jhx70si7k3xprlr2j"; + }; + + nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ]; + buildInputs = [ topkg ]; + + propagatedBuildInputs = [ faraday ]; + + strictDeps = true; + + inherit (topkg) buildPhase installPhase; + + meta = { + description = "A printf-like for Faraday library"; + homepage = "https://github.com/oklm-wsh/Farfadet"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.vbgl ]; + inherit (ocaml.meta) platforms; + }; +} diff --git a/pkgs/development/ocaml-modules/fdkaac/default.nix b/pkgs/development/ocaml-modules/fdkaac/default.nix new file mode 100644 index 00000000000..d794e4acce7 --- /dev/null +++ b/pkgs/development/ocaml-modules/fdkaac/default.nix @@ -0,0 +1,27 @@ +{ lib, fetchFromGitHub, buildDunePackage, dune-configurator +, fdk_aac +}: + +buildDunePackage rec { + pname = "fdkaac"; + version = "0.3.2"; + src = fetchFromGitHub { + owner = "savonet"; + repo = "ocaml-fdkaac"; + rev = version; + sha256 = "10i6hsjkrpw7zgx99zvvka3sapd7zy53k7z4b6khj9rdrbrgznv8"; + }; + + useDune2 = true; + + buildInputs = [ dune-configurator ]; + propagatedBuildInputs = [ fdk_aac ]; + + meta = { + description = "OCaml binding for the fdk-aac library"; + inherit (src.meta) homepage; + license = lib.licenses.gpl2Only; + maintainers = [ lib.maintainers.vbgl lib.maintainers.dandellion ]; + }; + +} diff --git a/pkgs/development/ocaml-modules/ff/default.nix b/pkgs/development/ocaml-modules/ff/default.nix new file mode 100644 index 00000000000..2a51b377e88 --- /dev/null +++ b/pkgs/development/ocaml-modules/ff/default.nix @@ -0,0 +1,32 @@ +{ lib, fetchFromGitLab, buildDunePackage, zarith, alcotest }: + +buildDunePackage rec { + pname = "ff"; + version = "0.4.0"; + + src = fetchFromGitLab { + owner = "dannywillems"; + repo = "ocaml-ff"; + rev = version; + sha256 = "1ik29srzkd0pl48p1si9p1c4f8vmx5rgm02yv2arj3vg0a1nfhdv"; + }; + + useDune2 = true; + + propagatedBuildInputs = [ + zarith + ]; + + checkInputs = [ + alcotest + ]; + + doCheck = true; + + meta = { + homepage = "https://gitlab.com/dannywillems/ocaml-ff"; + description = "OCaml implementation of Finite Field operations"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.ulrikstrid ]; + }; +} diff --git a/pkgs/development/ocaml-modules/ff/pbt.nix b/pkgs/development/ocaml-modules/ff/pbt.nix new file mode 100644 index 00000000000..e0363160dd7 --- /dev/null +++ b/pkgs/development/ocaml-modules/ff/pbt.nix @@ -0,0 +1,21 @@ +{ lib, fetchFromGitLab, buildDunePackage, zarith, ff-sig, alcotest }: + +buildDunePackage { + pname = "ff-pbt"; + inherit (ff-sig) version src doCheck useDune2; + + minimalOCamlVersion = "4.08"; + + checkInputs = [ + alcotest + ]; + + propagatedBuildInputs = [ + zarith + ff-sig + ]; + + meta = ff-sig.meta // { + description = "Property based testing library for finite fields over the package ff-sig"; + }; +} diff --git a/pkgs/development/ocaml-modules/ff/sig.nix b/pkgs/development/ocaml-modules/ff/sig.nix new file mode 100644 index 00000000000..a2c7ca0d0c6 --- /dev/null +++ b/pkgs/development/ocaml-modules/ff/sig.nix @@ -0,0 +1,27 @@ +{ lib, fetchFromGitLab, buildDunePackage, zarith }: + +buildDunePackage rec { + pname = "ff-sig"; + version = "0.6.1"; + src = fetchFromGitLab { + owner = "dannywillems"; + repo = "ocaml-ff"; + rev = version; + sha256 = "0p42ivyfbn1pwm18773y4ga9cm64ysha0rplzvrnhszg01anarc0"; + }; + + useDune2 = true; + + propagatedBuildInputs = [ + zarith + ]; + + doCheck = true; + + meta = { + homepage = "https://gitlab.com/dannywillems/ocaml-ff"; + description = "Minimal finite field signatures"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.ulrikstrid ]; + }; +} diff --git a/pkgs/development/ocaml-modules/ffmpeg/base.nix b/pkgs/development/ocaml-modules/ffmpeg/base.nix new file mode 100644 index 00000000000..77a6ef01ac9 --- /dev/null +++ b/pkgs/development/ocaml-modules/ffmpeg/base.nix @@ -0,0 +1,21 @@ +{ lib, fetchFromGitHub }: + +rec { + version = "1.1.0"; + + useDune2 = true; + + src = fetchFromGitHub { + owner = "savonet"; + repo = "ocaml-ffmpeg"; + rev = "v${version}"; + sha256 = "13rc3d0n963a28my5ahv78r82rh450hvbsc74mb6ld0r9v210r0p"; + }; + + meta = with lib; { + homepage = "https://github.com/savonet/ocaml-ffmpeg"; + description = "Bindings for the ffmpeg libraries"; + license = licenses.lgpl21Only; + maintainers = with maintainers; [ dandellion ]; + }; +} diff --git a/pkgs/development/ocaml-modules/ffmpeg/default.nix b/pkgs/development/ocaml-modules/ffmpeg/default.nix new file mode 100644 index 00000000000..7f0a5da34dd --- /dev/null +++ b/pkgs/development/ocaml-modules/ffmpeg/default.nix @@ -0,0 +1,36 @@ +{ lib, buildDunePackage, fetchFromGitHub, callPackage +, ffmpeg-base ? callPackage ./base.nix { } +, ffmpeg-avutil +, ffmpeg-avcodec +, ffmpeg-avfilter +, ffmpeg-swscale +, ffmpeg-swresample +, ffmpeg-av +, ffmpeg-avdevice +}: + +buildDunePackage { + pname = "ffmpeg"; + + minimalOCamlVersion = "4.08"; + + inherit (ffmpeg-base) version src useDune2; + + propagatedBuildInputs = [ + ffmpeg-avutil + ffmpeg-avcodec + ffmpeg-avfilter + ffmpeg-swscale + ffmpeg-swresample + ffmpeg-av + ffmpeg-avdevice + ]; + + # The tests fail + doCheck = false; + + meta = ffmpeg-base.meta // { + description = "Bindings for the ffmpeg libraries"; + }; + +} diff --git a/pkgs/development/ocaml-modules/ffmpeg/ffmpeg-av.nix b/pkgs/development/ocaml-modules/ffmpeg/ffmpeg-av.nix new file mode 100644 index 00000000000..e8d71aa321e --- /dev/null +++ b/pkgs/development/ocaml-modules/ffmpeg/ffmpeg-av.nix @@ -0,0 +1,22 @@ +{ lib, buildDunePackage, dune-configurator, pkg-config, fetchFromGitHub, callPackage +, ffmpeg-base ? callPackage ./base.nix { } +, ffmpeg-avutil, ffmpeg-avcodec, ffmpeg }: + +buildDunePackage { + pname = "ffmpeg-av"; + + minimalOCamlVersion = "4.08"; + + inherit (ffmpeg-base) version src useDune2; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ dune-configurator ]; + propagatedBuildInputs = [ ffmpeg-avutil ffmpeg-avcodec ffmpeg.dev ]; + + doCheck = true; + + meta = ffmpeg-base.meta // { + description = "Bindings for the ffmpeg libraries -- top-level helpers"; + }; + +} diff --git a/pkgs/development/ocaml-modules/ffmpeg/ffmpeg-avcodec.nix b/pkgs/development/ocaml-modules/ffmpeg/ffmpeg-avcodec.nix new file mode 100644 index 00000000000..8ee5428c473 --- /dev/null +++ b/pkgs/development/ocaml-modules/ffmpeg/ffmpeg-avcodec.nix @@ -0,0 +1,23 @@ +{ lib, buildDunePackage, dune-configurator, pkg-config, fetchFromGitHub, callPackage +, ffmpeg-base ? callPackage ./base.nix { } +, ffmpeg-avutil, ffmpeg +}: + +buildDunePackage { + pname = "ffmpeg-avcodec"; + + minimalOCamlVersion = "4.08"; + + inherit (ffmpeg-base) version src useDune2; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ dune-configurator ]; + propagatedBuildInputs = [ ffmpeg-avutil ffmpeg.dev ]; + + doCheck = true; + + meta = ffmpeg-base.meta // { + description = "Bindings for the ffmpeg avcodec library"; + }; + +} diff --git a/pkgs/development/ocaml-modules/ffmpeg/ffmpeg-avdevice.nix b/pkgs/development/ocaml-modules/ffmpeg/ffmpeg-avdevice.nix new file mode 100644 index 00000000000..e6641a6ca03 --- /dev/null +++ b/pkgs/development/ocaml-modules/ffmpeg/ffmpeg-avdevice.nix @@ -0,0 +1,23 @@ +{ lib, buildDunePackage, dune-configurator, pkg-config, fetchFromGitHub, callPackage +, ffmpeg-base ? callPackage ./base.nix { } +, ffmpeg-av, ffmpeg +}: + +buildDunePackage { + pname = "ffmpeg-avdevice"; + + minimalOCamlVersion = "4.08"; + + inherit (ffmpeg-base) version src useDune2; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ dune-configurator ]; + propagatedBuildInputs = [ ffmpeg-av ffmpeg.dev ]; + + doCheck = true; + + meta = ffmpeg-base.meta // { + description = "Bindings for the ffmpeg avdevice library"; + }; + +} diff --git a/pkgs/development/ocaml-modules/ffmpeg/ffmpeg-avfilter.nix b/pkgs/development/ocaml-modules/ffmpeg/ffmpeg-avfilter.nix new file mode 100644 index 00000000000..6479bbe55bf --- /dev/null +++ b/pkgs/development/ocaml-modules/ffmpeg/ffmpeg-avfilter.nix @@ -0,0 +1,23 @@ +{ lib, buildDunePackage, dune-configurator, pkg-config, fetchFromGitHub, callPackage +, ffmpeg-base ? callPackage ./base.nix { } +, ffmpeg-avutil, ffmpeg +}: + +buildDunePackage { + pname = "ffmpeg-avfilter"; + + minimalOCamlVersion = "4.08"; + + inherit (ffmpeg-base) version src useDune2; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ dune-configurator ]; + propagatedBuildInputs = [ ffmpeg-avutil ffmpeg.dev ]; + + doCheck = true; + + meta = ffmpeg-base.meta // { + description = "Bindings for the ffmpeg avfilter library"; + }; + +} diff --git a/pkgs/development/ocaml-modules/ffmpeg/ffmpeg-avutil.nix b/pkgs/development/ocaml-modules/ffmpeg/ffmpeg-avutil.nix new file mode 100644 index 00000000000..121fb115146 --- /dev/null +++ b/pkgs/development/ocaml-modules/ffmpeg/ffmpeg-avutil.nix @@ -0,0 +1,23 @@ +{ lib, buildDunePackage, dune-configurator, pkg-config, fetchFromGitHub, callPackage +, ffmpeg-base ? callPackage ./base.nix { } +, ffmpeg +}: + +buildDunePackage { + pname = "ffmpeg-avutil"; + + minimalOCamlVersion = "4.08"; + + inherit (ffmpeg-base) version src useDune2; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ dune-configurator ]; + propagatedBuildInputs = [ ffmpeg.dev ]; + + doCheck = true; + + meta = ffmpeg-base.meta // { + description = "Bindings for the ffmpeg avutil libraries"; + }; + +} diff --git a/pkgs/development/ocaml-modules/ffmpeg/ffmpeg-swresample.nix b/pkgs/development/ocaml-modules/ffmpeg/ffmpeg-swresample.nix new file mode 100644 index 00000000000..92011e48eab --- /dev/null +++ b/pkgs/development/ocaml-modules/ffmpeg/ffmpeg-swresample.nix @@ -0,0 +1,23 @@ +{ lib, buildDunePackage, dune-configurator, pkg-config, fetchFromGitHub, callPackage +, ffmpeg-base ? callPackage ./base.nix { } +, ffmpeg-avutil, ffmpeg-avcodec, ffmpeg +}: + +buildDunePackage { + pname = "ffmpeg-swresample"; + + minimalOCamlVersion = "4.08"; + + inherit (ffmpeg-base) version src useDune2; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ dune-configurator ]; + propagatedBuildInputs = [ ffmpeg-avutil ffmpeg-avcodec ffmpeg.dev ]; + + doCheck = true; + + meta = ffmpeg-base.meta // { + description = "Bindings for the ffmpeg swresample library"; + }; + +} diff --git a/pkgs/development/ocaml-modules/ffmpeg/ffmpeg-swscale.nix b/pkgs/development/ocaml-modules/ffmpeg/ffmpeg-swscale.nix new file mode 100644 index 00000000000..9d97b722551 --- /dev/null +++ b/pkgs/development/ocaml-modules/ffmpeg/ffmpeg-swscale.nix @@ -0,0 +1,22 @@ +{ lib, buildDunePackage, dune-configurator, pkg-config, fetchFromGitHub, callPackage +, ffmpeg-base ? callPackage ./base.nix { } +, ffmpeg-avutil, ffmpeg +}: + +buildDunePackage { + pname = "ffmpeg-swscale"; + + minimalOCamlVersion = "4.08"; + + inherit (ffmpeg-base) version src useDune2; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ dune-configurator ]; + propagatedBuildInputs = [ ffmpeg-avutil ffmpeg.dev ]; + + doCheck = true; + + meta = ffmpeg-base.meta // { + description = "Bindings for the ffmpeg swscale library"; + }; +} diff --git a/pkgs/development/ocaml-modules/fiat-p256/default.nix b/pkgs/development/ocaml-modules/fiat-p256/default.nix new file mode 100644 index 00000000000..c979fe682d3 --- /dev/null +++ b/pkgs/development/ocaml-modules/fiat-p256/default.nix @@ -0,0 +1,33 @@ +{ lib, buildDunePackage, fetchurl, alcotest, asn1-combinators, benchmark +, bigarray-compat, cstruct, eqaf, hex, ppx_deriving_yojson, rresult +, stdlib-shims, yojson, dune-configurator }: + +buildDunePackage rec { + pname = "fiat-p256"; + version = "0.2.1"; + useDune2 = true; + + src = fetchurl { + url = "https://github.com/mirage/fiat/releases/download/v${version}/${pname}-v${version}.tbz"; + sha256 = "0086h9qkvnqfm8acrxqbki54z619nj73x7f0d01v5vg2naznx7w9"; + }; + + # Make tests compatible with alcotest 1.4.0 + postPatch = '' + substituteInPlace test/wycheproof/test.ml --replace \ + 'Printf.ksprintf Alcotest.fail' 'Printf.ksprintf (fun s -> Alcotest.fail s)' + ''; + + buildInputs = [ dune-configurator ]; + propagatedBuildInputs = [ bigarray-compat cstruct eqaf hex ]; + checkInputs = [ alcotest asn1-combinators benchmark + ppx_deriving_yojson rresult stdlib-shims yojson ]; + doCheck = true; + + meta = with lib; { + description = "Primitives for Elliptic Curve Cryptography taken from Fiat"; + homepage = "https://github.com/mirage/fiat"; + license = licenses.mit; + maintainers = with maintainers; [ sternenseemann ]; + }; +} diff --git a/pkgs/development/ocaml-modules/fileutils/default.nix b/pkgs/development/ocaml-modules/fileutils/default.nix new file mode 100644 index 00000000000..819298ac8cf --- /dev/null +++ b/pkgs/development/ocaml-modules/fileutils/default.nix @@ -0,0 +1,30 @@ +{ lib, fetchurl, buildDunePackage, stdlib-shims, ounit }: + +buildDunePackage rec { + pname = "fileutils"; + version = "0.6.3"; + + src = fetchurl { + url = "https://github.com/gildor478/ocaml-fileutils/releases/download/v${version}/fileutils-v${version}.tbz"; + sha256 = "0qhlhc7fzcq0yfg1wyszsi0gyc4w9hyzmfv84aq9wc79i3283xgg"; + }; + + minimumOCamlVersion = "4.03"; + useDune2 = true; + + propagatedBuildInputs = [ + stdlib-shims + ]; + + checkInputs = [ + ounit + ]; + doCheck = true; + + meta = with lib; { + description = "OCaml API to manipulate real files (POSIX like) and filenames"; + homepage = "https://github.com/gildor478/ocaml-fileutils"; + license = licenses.lgpl21Plus; + maintainers = with maintainers; [ vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/fix/default.nix b/pkgs/development/ocaml-modules/fix/default.nix new file mode 100644 index 00000000000..e960167c869 --- /dev/null +++ b/pkgs/development/ocaml-modules/fix/default.nix @@ -0,0 +1,24 @@ +{ lib, fetchFromGitLab, buildDunePackage }: + +buildDunePackage rec { + pname = "fix"; + version = "20211231"; + + src = fetchFromGitLab { + domain = "gitlab.inria.fr"; + owner = "fpottier"; + repo = "fix"; + rev = "${version}"; + sha256 = "sha256-T/tbiC95yzPb60AiEcvMRU47D8xUZNN5C4X33Y1VB9E="; + }; + + minimumOCamlVersion = "4.03"; + useDune2 = true; + + meta = with lib; { + homepage = "https://gitlab.inria.fr/fpottier/fix/"; + description = "A simple OCaml module for computing the least solution of a system of monotone equations"; + license = licenses.lgpl2Only; + maintainers = with maintainers; [ vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/flac/default.nix b/pkgs/development/ocaml-modules/flac/default.nix new file mode 100644 index 00000000000..e08841ac32f --- /dev/null +++ b/pkgs/development/ocaml-modules/flac/default.nix @@ -0,0 +1,26 @@ +{ lib, buildDunePackage, fetchFromGitHub, dune-configurator, pkg-config, ogg, flac }: + +buildDunePackage rec { + pname = "flac"; + version = "0.3.0"; + + useDune2 = true; + + src = fetchFromGitHub { + owner = "savonet"; + repo = "ocaml-flac"; + rev = "v${version}"; + sha256 = "06gfbrp30sdxigzkix83y1b610ljzik6rrxmbl3ppmpx4dqlwnxa"; + }; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ dune-configurator ]; + propagatedBuildInputs = [ ogg flac.dev ]; + + meta = with lib; { + homepage = "https://github.com/savonet/ocaml-flac"; + description = "Bindings for flac"; + license = licenses.gpl2Only; + maintainers = with maintainers; [ dandellion ]; + }; +} diff --git a/pkgs/development/ocaml-modules/fmt/default.nix b/pkgs/development/ocaml-modules/fmt/default.nix new file mode 100644 index 00000000000..edf8d08eaab --- /dev/null +++ b/pkgs/development/ocaml-modules/fmt/default.nix @@ -0,0 +1,31 @@ +{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg, cmdliner, seq, stdlib-shims }: + +if !lib.versionAtLeast ocaml.version "4.05" +then throw "fmt is not available for OCaml ${ocaml.version}" +else + +stdenv.mkDerivation rec { + version = "0.8.9"; + pname = "ocaml${ocaml.version}-fmt"; + + src = fetchurl { + url = "https://erratique.ch/software/fmt/releases/fmt-${version}.tbz"; + sha256 = "0gkkkj4x678vxdda4xaw2dd44qjacavsvn5nx8gydfwah6pjbkxk"; + }; + + nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ]; + buildInputs = [ topkg ]; + propagatedBuildInputs = [ cmdliner seq stdlib-shims ]; + + strictDeps = true; + + inherit (topkg) buildPhase installPhase; + + meta = with lib; { + homepage = "https://erratique.ch/software/fmt"; + license = licenses.isc; + description = "OCaml Format pretty-printer combinators"; + inherit (ocaml.meta) platforms; + maintainers = [ maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/fontconfig/default.nix b/pkgs/development/ocaml-modules/fontconfig/default.nix new file mode 100644 index 00000000000..2eca9a4644b --- /dev/null +++ b/pkgs/development/ocaml-modules/fontconfig/default.nix @@ -0,0 +1,30 @@ +{ stdenv, lib, fetchFromGitHub, pkg-config, fontconfig, ocaml }: + +stdenv.mkDerivation { + pname = "ocaml-fontconfig"; + version = "unstable-2013-11-03"; + + src = fetchFromGitHub { + owner = "flh"; + repo = "ocaml-fontconfig"; + rev = "42daf1697ffcee9c89ee4be3103b6427f7a7b7e5"; + sha256 = "1fw6bzydmnyh2g4x35mcbg0hypnxqhynivk4nakcsx7prr8zr3yh"; + }; + + nativeBuildInputs = [ pkg-config ocaml ]; + buildInputs = [ fontconfig ]; + + strictDeps = true; + + makeFlags = [ + "OCAML_STDLIB_DIR=$(out)/lib/ocaml/${lib.getVersion ocaml}/site-lib/" + "OCAML_HAVE_OCAMLOPT=yes" + ]; + + meta = { + description = "Fontconfig bindings for OCaml"; + license = lib.licenses.gpl2Plus; + platforms = ocaml.meta.platforms or [ ]; + maintainers = with lib.maintainers; [ vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/fpath/default.nix b/pkgs/development/ocaml-modules/fpath/default.nix new file mode 100644 index 00000000000..53489f69cc3 --- /dev/null +++ b/pkgs/development/ocaml-modules/fpath/default.nix @@ -0,0 +1,32 @@ +{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, topkg, astring }: + +if !lib.versionAtLeast ocaml.version "4.03" +then throw "fpath is not available for OCaml ${ocaml.version}" +else + +stdenv.mkDerivation rec { + pname = "ocaml${ocaml.version}-fpath"; + version = "0.7.3"; + + src = fetchurl { + url = "https://erratique.ch/software/fpath/releases/fpath-${version}.tbz"; + sha256 = "03z7mj0sqdz465rc4drj1gr88l9q3nfs374yssvdjdyhjbqqzc0j"; + }; + + nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ]; + buildInputs = [ topkg ]; + + propagatedBuildInputs = [ astring ]; + + strictDeps = true; + + inherit (topkg) buildPhase installPhase; + + meta = { + description = "An OCaml module for handling file system paths with POSIX and Windows conventions"; + homepage = "https://erratique.ch/software/fpath"; + license = lib.licenses.isc; + maintainers = [ lib.maintainers.vbgl ]; + inherit (ocaml.meta) platforms; + }; +} diff --git a/pkgs/development/ocaml-modules/frontc/default.nix b/pkgs/development/ocaml-modules/frontc/default.nix new file mode 100644 index 00000000000..c05422497ee --- /dev/null +++ b/pkgs/development/ocaml-modules/frontc/default.nix @@ -0,0 +1,42 @@ +{ stdenv, lib, fetchurl, fetchpatch, fetchFromGitHub, ocaml, findlib }: + +let + meta_file = fetchurl { + url = "https://raw.githubusercontent.com/ocaml/opam-repository/3c191ae9356ca7b3b628f2707cfcb863db42480f/packages/FrontC/FrontC.3.4.1/files/META"; + sha256 = "0s2wsinycldk8y5p09xd0hsgbhckhy7bkghzl63bph6mwv64kq2d"; + }; +in + +stdenv.mkDerivation rec { + pname = "ocaml${ocaml.version}-FrontC"; + version = "3.4.1"; + + src = fetchFromGitHub { + owner = "BinaryAnalysisPlatform"; + repo = "FrontC"; + rev = "V_${lib.replaceStrings ["."] ["_"] version}"; + sha256 = "1dq5nks0c9gsbr1m8k39m1bniawr5hqcy1r8x5px7naa95ch06ak"; + }; + + nativeBuildInputs = [ ocaml findlib ]; + + strictDeps = true; + + meta = with lib; { + inherit (src.meta) homepage; + inherit (ocaml.meta) platforms; + description = "C Parsing Library"; + license = licenses.lgpl21; + maintainers = [ maintainers.maurer ]; + }; + + patches = [ (fetchpatch { + url = "https://raw.githubusercontent.com/ocaml/opam-repository/3c191ae9356ca7b3b628f2707cfcb863db42480f/packages/FrontC/FrontC.3.4.1/files/opam.patch"; + sha256 = "0v4f6740jbj1kxg1y03dzfa3x3gsrhv06wpzdj30gl4ki5fvj4hs"; + }) + ]; + + makeFlags = [ "PREFIX=$(out)" "OCAML_SITE=$(OCAMLFIND_DESTDIR)" ]; + + postInstall = "cp ${meta_file} $OCAMLFIND_DESTDIR/FrontC/META"; +} diff --git a/pkgs/development/ocaml-modules/functoria/default.nix b/pkgs/development/ocaml-modules/functoria/default.nix new file mode 100644 index 00000000000..4f108320399 --- /dev/null +++ b/pkgs/development/ocaml-modules/functoria/default.nix @@ -0,0 +1,29 @@ +{ lib, fetchurl, buildDunePackage, alcotest, cmdliner +, rresult, astring, fmt, ocamlgraph, logs, bos, fpath, ptime +}: + +buildDunePackage rec { + pname = "functoria"; + version = "3.1.1"; + + useDune2 = true; + + minimumOCamlVersion = "4.04"; + + src = fetchurl { + url = "https://github.com/mirage/${pname}/releases/download/v${version}/${pname}-v${version}.tbz"; + sha256 = "0bihxbq16zwsi7frk4b8wz8993mvy2ym3n6288jhv0n0gb7c2f7m"; + }; + + propagatedBuildInputs = [ cmdliner rresult astring fmt ocamlgraph logs bos fpath ptime ]; + checkInputs = [ alcotest ]; + + doCheck = true; + + meta = with lib; { + description = "A DSL to organize functor applications"; + homepage = "https://github.com/mirage/functoria"; + license = licenses.isc; + maintainers = [ maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/functoria/runtime.nix b/pkgs/development/ocaml-modules/functoria/runtime.nix new file mode 100644 index 00000000000..2ba13ce8738 --- /dev/null +++ b/pkgs/development/ocaml-modules/functoria/runtime.nix @@ -0,0 +1,17 @@ +{ lib, buildDunePackage, functoria, cmdliner, fmt, alcotest }: + +buildDunePackage { + pname = "functoria-runtime"; + + inherit (functoria) version useDune2 src; + + propagatedBuildInputs = [ cmdliner fmt ]; + checkInputs = [ alcotest functoria]; + doCheck = true; + + meta = with lib; { + inherit (functoria.meta) homepage license; + description = "Runtime support library for functoria-generated code"; + maintainers = [ maintainers.sternenseemann ]; + }; +} diff --git a/pkgs/development/ocaml-modules/functory/default.nix b/pkgs/development/ocaml-modules/functory/default.nix new file mode 100644 index 00000000000..a05472366a2 --- /dev/null +++ b/pkgs/development/ocaml-modules/functory/default.nix @@ -0,0 +1,39 @@ +{ lib, stdenv, fetchurl, ocaml, findlib }: + +assert lib.versionAtLeast (lib.getVersion ocaml) "3.11"; + +let param = + if lib.versionAtLeast ocaml.version "4.02" then { + version = "0.6"; + sha256 = "18wpyxblz9jh5bfp0hpffnd0q8cq1b0dqp0f36vhqydfknlnpx8y"; + } else { + version = "0.5"; + sha256 = "1j17rhifdjv1z262dma148ywg34x0zjn8vczdrnkwajsm4qg1hw3"; + }; +in + +stdenv.mkDerivation { + pname = "ocaml${ocaml.version}-functory"; + inherit (param) version; + + src = fetchurl { + url = "https://www.lri.fr/~filliatr/functory/download/functory-${param.version}.tar.gz"; + inherit (param) sha256; + }; + + nativeBuildInputs = [ ocaml findlib ]; + + strictDeps = true; + + installTargets = [ "ocamlfind-install" ]; + + createFindlibDestdir = true; + + meta = with lib; { + homepage = "https://www.lri.fr/~filliatr/functory/"; + description = "A distributed computing library for Objective Caml which facilitates distributed execution of parallelizable computations in a seamless fashion"; + license = licenses.lgpl21; + maintainers = [ maintainers.vbgl ]; + platforms = ocaml.meta.platforms or []; + }; +} diff --git a/pkgs/development/ocaml-modules/gapi-ocaml/default.nix b/pkgs/development/ocaml-modules/gapi-ocaml/default.nix new file mode 100644 index 00000000000..c417d94e294 --- /dev/null +++ b/pkgs/development/ocaml-modules/gapi-ocaml/default.nix @@ -0,0 +1,32 @@ +{ lib, fetchFromGitHub, buildDunePackage, ocaml +, cryptokit, ocamlnet, ocurl, yojson +, ounit +}: + +buildDunePackage rec { + pname = "gapi-ocaml"; + version = "0.4.2"; + + useDune2 = true; + + minimumOCamlVersion = "4.02"; + + src = fetchFromGitHub { + owner = "astrada"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-imicHOlNjPHHW/lcWRJmURafYZFe/6J3efKPJcel8J8="; + }; + + propagatedBuildInputs = [ cryptokit ocamlnet ocurl yojson ]; + + doCheck = lib.versionAtLeast ocaml.version "4.04"; + checkInputs = [ ounit ]; + + meta = { + description = "OCaml client for google services"; + homepage = "http://gapi-ocaml.forge.ocamlcore.org"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ bennofs ]; + }; +} diff --git a/pkgs/development/ocaml-modules/gen/default.nix b/pkgs/development/ocaml-modules/gen/default.nix new file mode 100644 index 00000000000..1c12f3ac5f8 --- /dev/null +++ b/pkgs/development/ocaml-modules/gen/default.nix @@ -0,0 +1,31 @@ +{ stdenv, lib, fetchFromGitHub, ocaml, findlib, ocamlbuild, qtest, ounit }: + +stdenv.mkDerivation rec { + version = "0.5"; + pname = "ocaml${ocaml.version}-gen"; + + src = fetchFromGitHub { + owner = "c-cube"; + repo = "gen"; + rev = version; + sha256 = "14b8vg914nb0yp1hgxzm29bg692m0gqncjj43b599s98s1cwl92h"; + }; + + nativeBuildInputs = [ ocaml findlib ocamlbuild ]; + buildInputs = lib.optionals doCheck [ qtest ounit ]; + strictDeps = true; + + configureFlags = lib.optional doCheck "--enable-tests"; + + doCheck = lib.versionAtLeast ocaml.version "4.08"; + checkTarget = "test"; + + createFindlibDestdir = true; + + meta = { + homepage = "https://github.com/c-cube/gen"; + description = "Simple, efficient iterators for OCaml"; + license = lib.licenses.bsd3; + inherit (ocaml.meta) platforms; + }; +} diff --git a/pkgs/development/ocaml-modules/genspio/default.nix b/pkgs/development/ocaml-modules/genspio/default.nix new file mode 100644 index 00000000000..963cd1dab13 --- /dev/null +++ b/pkgs/development/ocaml-modules/genspio/default.nix @@ -0,0 +1,34 @@ +{ lib, fetchFromGitHub, buildDunePackage +, nonstd, sosa +}: + +buildDunePackage rec { + pname = "genspio"; + version = "0.0.2"; + + useDune2 = false; + + src = fetchFromGitHub { + owner = "hammerlab"; + repo = pname; + rev = "${pname}.${version}"; + sha256 = "0cp6p1f713sfv4p2r03bzvjvakzn4ili7hf3a952b3w1k39hv37x"; + }; + + minimalOCamlVersion = "4.03"; + + propagatedBuildInputs = [ nonstd sosa ]; + + configurePhase = '' + ocaml please.mlt configure + ''; + + doCheck = true; + + meta = with lib; { + homepage = "https://smondet.gitlab.io/genspio-doc/"; + description = "Typed EDSL to generate POSIX Shell scripts"; + license = licenses.asl20; + maintainers = [ maintainers.alexfmpe ]; + }; +} diff --git a/pkgs/development/ocaml-modules/getopt/default.nix b/pkgs/development/ocaml-modules/getopt/default.nix new file mode 100644 index 00000000000..e3bf2fb5d64 --- /dev/null +++ b/pkgs/development/ocaml-modules/getopt/default.nix @@ -0,0 +1,30 @@ +{ lib, fetchzip, stdenv, ocaml, findlib, ocamlbuild }: + +stdenv.mkDerivation rec { + pname = "ocaml${ocaml.version}-getopt"; + version = "20120615"; + + src = fetchzip { + url = "https://download.ocamlcore.org/ocaml-getopt/ocaml-getopt/${version}/ocaml-getopt-${version}.tar.gz"; + sha256 = "0bng2mmdixpmj23xn8krlnaq66k22iclwz46r8zjrsrq3wcn1xgn"; + }; + + nativeBuildInputs = [ + ocaml + findlib + ocamlbuild + ]; + + strictDeps = true; + + doCheck = true; + createFindlibDestdir = true; + + meta = { + inherit (ocaml.meta) platforms; + homepage = "https://github.com/gildor478/ocaml-getopt"; + description = "Parsing of command line arguments (similar to GNU GetOpt) for OCaml"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.ulrikstrid ]; + }; +} diff --git a/pkgs/development/ocaml-modules/gg/default.nix b/pkgs/development/ocaml-modules/gg/default.nix new file mode 100644 index 00000000000..ec8bbb31617 --- /dev/null +++ b/pkgs/development/ocaml-modules/gg/default.nix @@ -0,0 +1,39 @@ +{ lib, stdenv, fetchurl, ocaml, findlib, topkg, ocamlbuild }: + +let + homepage = "https://erratique.ch/software/gg"; + version = "1.0.0"; +in + +lib.throwIfNot (lib.versionAtLeast ocaml.version "4.08") + "gg is not available for OCaml ${ocaml.version}" + +stdenv.mkDerivation { + + pname = "ocaml${ocaml.version}-gg"; + inherit version; + + src = fetchurl { + url = "${homepage}/releases/gg-${version}.tbz"; + sha256 = "sha256:0j7bpj8k17csnz6v6frkz9aycywsb7xmznnb31g8rbfk3626f3ci"; + }; + + nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ]; + buildInputs = [ topkg ]; + + inherit (topkg) buildPhase installPhase; + + meta = with lib; { + description = "Basic types for computer graphics in OCaml"; + longDescription = '' + Gg is an OCaml module providing basic types for computer graphics. It + defines types and functions for floats, vectors, points, sizes, + matrices, quaternions, axis aligned boxes, colors, color spaces, and + raster data. + ''; + inherit homepage; + inherit (ocaml.meta) platforms; + license = licenses.bsd3; + maintainers = [ maintainers.jirkamarsik ]; + }; +} diff --git a/pkgs/development/ocaml-modules/git/cohttp-unix.nix b/pkgs/development/ocaml-modules/git/cohttp-unix.nix new file mode 100644 index 00000000000..ac6d423d58a --- /dev/null +++ b/pkgs/development/ocaml-modules/git/cohttp-unix.nix @@ -0,0 +1,17 @@ +{ buildDunePackage, git, git-cohttp +, cohttp-lwt-unix, cohttp-lwt, fmt, lwt, result, rresult, uri +}: + +buildDunePackage { + pname = "git-cohttp-unix"; + + inherit (git) version src minimumOCamlVersion useDune2; + + propagatedBuildInputs = [ + git git-cohttp cohttp-lwt-unix cohttp-lwt fmt lwt result rresult uri + ]; + + meta = git.meta // { + description = "A package to use HTTP-based ocaml-git with Unix backend"; + }; +} diff --git a/pkgs/development/ocaml-modules/git/cohttp.nix b/pkgs/development/ocaml-modules/git/cohttp.nix new file mode 100644 index 00000000000..e9126ba4bec --- /dev/null +++ b/pkgs/development/ocaml-modules/git/cohttp.nix @@ -0,0 +1,19 @@ +{ buildDunePackage, git +, cohttp, cohttp-lwt, fmt, lwt, result, rresult, uri +, alcotest, alcotest-lwt, bigstringaf, cstruct, logs +, mirage-flow, ke +}: + +buildDunePackage rec { + pname = "git-cohttp"; + + inherit (git) version minimumOCamlVersion src useDune2; + + propagatedBuildInputs = [ + git cohttp cohttp-lwt fmt lwt result rresult uri + ]; + + meta = git.meta // { + description = "A package to use HTTP-based ocaml-git with Unix backend"; + }; +} diff --git a/pkgs/development/ocaml-modules/git/default.nix b/pkgs/development/ocaml-modules/git/default.nix new file mode 100644 index 00000000000..b359a397f31 --- /dev/null +++ b/pkgs/development/ocaml-modules/git/default.nix @@ -0,0 +1,45 @@ +{ stdenv, lib, fetchurl, buildDunePackage +, alcotest, mtime, mirage-crypto-rng, tls, git-binary +, angstrom, astring, cstruct, decompress, digestif, encore, duff, fmt, checkseum +, fpath, ke, logs, lwt, ocamlgraph, uri, rresult, base64, hxd +, result, bigstringaf, optint, mirage-flow, domain-name, emile +, mimic, carton, carton-lwt, carton-git, ipaddr, psq, crowbar, alcotest-lwt +}: + +buildDunePackage rec { + pname = "git"; + version = "3.5.0"; + + minimumOCamlVersion = "4.08"; + useDune2 = true; + + src = fetchurl { + url = "https://github.com/mirage/ocaml-git/releases/download/${version}/git-${version}.tbz"; + sha256 = "bcd5a0aef9957193cbaeeb17c22201e5ca4e815e67bbc696e88efdb38c25ec03"; + }; + + # remove changelog for the carton package + postPatch = '' + rm CHANGES.carton.md + ''; + + buildInputs = [ + base64 + ]; + propagatedBuildInputs = [ + angstrom astring checkseum cstruct decompress digestif encore duff fmt fpath + ke logs lwt ocamlgraph uri rresult result bigstringaf optint mirage-flow + domain-name emile mimic carton carton-lwt carton-git ipaddr psq hxd + ]; + checkInputs = [ + alcotest alcotest-lwt mtime mirage-crypto-rng tls git-binary crowbar + ]; + doCheck = !stdenv.isAarch64; + + meta = { + description = "Git format and protocol in pure OCaml"; + license = lib.licenses.isc; + maintainers = with lib.maintainers; [ sternenseemann vbgl ]; + homepage = "https://github.com/mirage/ocaml-git"; + }; +} diff --git a/pkgs/development/ocaml-modules/git/paf.nix b/pkgs/development/ocaml-modules/git/paf.nix new file mode 100644 index 00000000000..9db8c872798 --- /dev/null +++ b/pkgs/development/ocaml-modules/git/paf.nix @@ -0,0 +1,57 @@ +{ lib, buildDunePackage +, git +, mimic +, paf +, ca-certs-nss +, fmt +, ipaddr +, logs +, lwt +, mirage-clock +, mirage-stack +, mirage-time +, result +, rresult +, tls +, uri +, bigarray-compat +, bigstringaf +, domain-name +, httpaf +, mirage-flow +, tls-mirage +}: + +buildDunePackage { + pname = "git-paf"; + + inherit (git) version src minimumOCamlVersion useDune2; + + propagatedBuildInputs = [ + git + mimic + paf + ca-certs-nss + fmt + lwt + result + rresult + ipaddr + logs + mirage-clock + mirage-stack + mirage-time + tls + uri + bigarray-compat + bigstringaf + domain-name + httpaf + mirage-flow + tls-mirage + ]; + + meta = git.meta // { + description = "A package to use HTTP-based ocaml-git with MirageOS backend"; + }; +} diff --git a/pkgs/development/ocaml-modules/git/unix.nix b/pkgs/development/ocaml-modules/git/unix.nix new file mode 100644 index 00000000000..3e5f464cea0 --- /dev/null +++ b/pkgs/development/ocaml-modules/git/unix.nix @@ -0,0 +1,43 @@ +{ buildDunePackage, git +, mmap, rresult, result, bigstringaf +, fmt, bos, fpath, uri, digestif, logs, lwt, git-cohttp-unix +, mirage-clock, mirage-clock-unix, astring, awa, cmdliner +, cohttp-lwt-unix, decompress, domain-name, ipaddr, mtime +, tcpip, awa-mirage, mirage-flow +, alcotest, alcotest-lwt, base64, cstruct +, ke, mirage-crypto-rng, ocurl, git-binary +, ptime, mimic, ca-certs-nss, tls, tls-mirage +, cacert +}: + +buildDunePackage { + pname = "git-unix"; + inherit (git) version src minimumOCamlVersion; + + useDune2 = true; + + buildInputs = [ + awa awa-mirage cmdliner git-cohttp-unix + mirage-clock mirage-clock-unix tcpip + ]; + propagatedBuildInputs = [ + mmap rresult result bigstringaf + fmt bos fpath uri digestif logs lwt + astring cohttp-lwt-unix decompress + domain-name ipaddr mtime mirage-flow + cstruct ptime mimic ca-certs-nss + tls tls-mirage + ]; + checkInputs = [ + alcotest alcotest-lwt base64 ke + mirage-crypto-rng git-binary + cohttp-lwt-unix + cacert # sets up NIX_SSL_CERT_FILE + ]; + doCheck = true; + + meta = { + description = "Unix backend for the Git protocol(s)"; + inherit (git.meta) homepage license maintainers; + }; +} diff --git a/pkgs/development/ocaml-modules/gluten/default.nix b/pkgs/development/ocaml-modules/gluten/default.nix new file mode 100644 index 00000000000..fb6f85b1048 --- /dev/null +++ b/pkgs/development/ocaml-modules/gluten/default.nix @@ -0,0 +1,34 @@ +{ buildDunePackage +, bigstringaf +, faraday +, fetchurl +, lib +}: + +buildDunePackage rec { + pname = "gluten"; + version = "0.2.1"; + + src = fetchurl { + url = "https://github.com/anmonteiro/gluten/releases/download/${version}/gluten-${version}.tbz"; + sha256 = "1pl0mpcprz8hmaiv28p7w51qfcx7s76zdkak0vm5cazbjl38nc46"; + }; + + minimalOCamlVersion = "4.06"; + + useDune2 = true; + + propagatedBuildInputs = [ + bigstringaf + faraday + ]; + + doCheck = false; # No tests + + meta = { + description = "An implementation of a platform specific runtime code for driving network libraries based on state machines, such as http/af, h2 and websocketaf"; + license = lib.licenses.bsd3; + homepage = "https://github.com/anmonteiro/gluten"; + maintainers = with lib.maintainers; [ anmonteiro ]; + }; +} diff --git a/pkgs/development/ocaml-modules/gluten/lwt-unix.nix b/pkgs/development/ocaml-modules/gluten/lwt-unix.nix new file mode 100644 index 00000000000..f3986b05135 --- /dev/null +++ b/pkgs/development/ocaml-modules/gluten/lwt-unix.nix @@ -0,0 +1,17 @@ +{ buildDunePackage +, faraday-lwt-unix +, gluten +, gluten-lwt +, lwt_ssl +}: + +buildDunePackage rec { + pname = "gluten-lwt-unix"; + inherit (gluten) doCheck meta src useDune2 version; + + propagatedBuildInputs = [ + faraday-lwt-unix + gluten-lwt + lwt_ssl + ]; +} diff --git a/pkgs/development/ocaml-modules/gluten/lwt.nix b/pkgs/development/ocaml-modules/gluten/lwt.nix new file mode 100644 index 00000000000..e2643d61895 --- /dev/null +++ b/pkgs/development/ocaml-modules/gluten/lwt.nix @@ -0,0 +1,14 @@ +{ buildDunePackage +, gluten +, lwt +}: + +buildDunePackage rec { + pname = "gluten-lwt"; + inherit (gluten) doCheck meta src useDune2 version; + + propagatedBuildInputs = [ + gluten + lwt + ]; +} diff --git a/pkgs/development/ocaml-modules/gmap/default.nix b/pkgs/development/ocaml-modules/gmap/default.nix new file mode 100644 index 00000000000..407919f91bc --- /dev/null +++ b/pkgs/development/ocaml-modules/gmap/default.nix @@ -0,0 +1,26 @@ +{ lib, buildDunePackage, ocaml, fetchurl, alcotest }: + +buildDunePackage rec { + pname = "gmap"; + version = "0.3.0"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/hannesm/gmap/releases/download/${version}/gmap-${version}.tbz"; + sha256 = "073wa0lrb0jj706j87cwzf1a8d1ff14100mnrjs8z3xc4ri9xp84"; + }; + + minimumOCamlVersion = "4.03"; + + checkInputs = [ alcotest ]; + + doCheck = lib.versionAtLeast ocaml.version "4.05"; + + meta = { + description = "Heterogenous maps over a GADT"; + homepage = "https://github.com/hannesm/gmap"; + license = lib.licenses.isc; + maintainers = [ lib.maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/gmetadom/default.nix b/pkgs/development/ocaml-modules/gmetadom/default.nix new file mode 100644 index 00000000000..50be2adcb38 --- /dev/null +++ b/pkgs/development/ocaml-modules/gmetadom/default.nix @@ -0,0 +1,36 @@ +{stdenv, lib, fetchurl, ocaml, findlib, gdome2, libxslt, pkg-config}: + +let + pname = "gmetadom"; +in + +stdenv.mkDerivation rec { + name = "${pname}-${version}"; + version = "0.2.6"; + + src = fetchurl { + url = "mirror://sourceforge/project/${pname}/${pname}/${version}/${pname}-${version}.tar.gz"; + sha256 = "0skmlv0pnqvg99wzzzi1h4zhwzd82xg7xpkj1kwpfy7bzinjh7ig"; + }; + + patches = [ ./gcc-4.3.patch ]; + + dontDisableStatic = true; + + preConfigure='' + configureFlags="--with-ocaml-lib-prefix=$out/lib/ocaml/${ocaml.version}/site-lib" + ''; + + nativeBuildInputs = [ pkg-config ocaml findlib ]; + buildInputs = [ gdome2 libxslt]; + propagatedBuildInputs = [gdome2]; + + strictDeps = true; + + meta = { + homepage = "http://gmetadom.sourceforge.net/"; + description = "A collection of librares, each library providing a DOM implementation"; + license = lib.licenses.lgpl21Plus; + maintainers = [ lib.maintainers.roconnor ]; + }; +} diff --git a/pkgs/development/ocaml-modules/gmetadom/gcc-4.3.patch b/pkgs/development/ocaml-modules/gmetadom/gcc-4.3.patch new file mode 100644 index 00000000000..d8d1d463163 --- /dev/null +++ b/pkgs/development/ocaml-modules/gmetadom/gcc-4.3.patch @@ -0,0 +1,18 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## gcc-4.3.dpatch by Stefano Zacchiroli <zack@debian.org> +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: ensure sources build with gcc-4.3 + +@DPATCH@ +diff -urNad trunk~/src/shared/Traits.hh.in trunk/src/shared/Traits.hh.in +--- trunk~/src/shared/Traits.hh.in 2003-01-14 12:41:55.000000000 +0100 ++++ trunk/src/shared/Traits.hh.in 2008-05-01 15:45:39.000000000 +0200 +@@ -26,6 +26,7 @@ + */ + + #include <string> ++#include <cstring> + + #include "@DOM_NAMESPACE@Char.hh" + diff --git a/pkgs/development/ocaml-modules/gnuplot/default.nix b/pkgs/development/ocaml-modules/gnuplot/default.nix new file mode 100644 index 00000000000..038863aad97 --- /dev/null +++ b/pkgs/development/ocaml-modules/gnuplot/default.nix @@ -0,0 +1,26 @@ +{ lib, buildDunePackage, fetchFromGitHub, gnuplot, iso8601 }: + +buildDunePackage rec { + pname = "gnuplot"; + version = "0.7"; + + useDune2 = true; + + minimumOCamlVersion = "4.03"; + + src = fetchFromGitHub { + owner = "c-cube"; + repo = "ocaml-${pname}"; + rev = "v${version}"; + sha256 = "02pzi3lb57ysrdsba743s3vmnapjbxgq8ynlzpxbbs6cn1jj6ch9"; + }; + + propagatedBuildInputs = [ gnuplot iso8601 ]; + + meta = with lib; { + inherit (src.meta) homepage; + description = "Ocaml bindings to Gnuplot"; + maintainers = [ maintainers.bcdarwin ]; + license = licenses.lgpl21; + }; +} diff --git a/pkgs/development/ocaml-modules/graphics/default.nix b/pkgs/development/ocaml-modules/graphics/default.nix new file mode 100644 index 00000000000..38db74fc9fa --- /dev/null +++ b/pkgs/development/ocaml-modules/graphics/default.nix @@ -0,0 +1,23 @@ +{ lib, fetchurl, buildDunePackage, dune-configurator, libX11 }: + +buildDunePackage rec { + + pname = "graphics"; + version = "5.1.2"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/ocaml/graphics/releases/download/${version}/graphics-${version}.tbz"; + sha256 = "sha256-QA/YHSPxy0FGuWl5NCwkeXHdVPWHn/0vgOx80CEuMtQ="; + }; + + buildInputs = [ dune-configurator ]; + propagatedBuildInputs = [ libX11 ]; + + meta = { + homepage = "https://github.com/ocaml/graphics"; + description = "A set of portable drawing primitives"; + license = lib.licenses.lgpl2; + }; +} diff --git a/pkgs/development/ocaml-modules/graphql/cohttp.nix b/pkgs/development/ocaml-modules/graphql/cohttp.nix new file mode 100644 index 00000000000..09f4757041a --- /dev/null +++ b/pkgs/development/ocaml-modules/graphql/cohttp.nix @@ -0,0 +1,26 @@ +{ lib, buildDunePackage, ocaml-crunch +, astring, cohttp, digestif, graphql, ocplib-endian +, alcotest, cohttp-lwt-unix, graphql-lwt +}: + +buildDunePackage rec { + pname = "graphql-cohttp"; + + inherit (graphql) version src; + + useDune2 = true; + + nativeBuildInputs = [ ocaml-crunch ]; + propagatedBuildInputs = [ astring cohttp digestif graphql ocplib-endian ]; + + checkInputs = lib.optionals doCheck [ alcotest cohttp-lwt-unix graphql-lwt ]; + + doCheck = true; + + meta = graphql.meta // { + description = "Run GraphQL servers with “cohttp”"; + }; + +} + + diff --git a/pkgs/development/ocaml-modules/graphql/default.nix b/pkgs/development/ocaml-modules/graphql/default.nix new file mode 100644 index 00000000000..f3adfdc87a9 --- /dev/null +++ b/pkgs/development/ocaml-modules/graphql/default.nix @@ -0,0 +1,18 @@ +{ buildDunePackage, alcotest, graphql_parser, rresult, yojson }: + +buildDunePackage rec { + pname = "graphql"; + + inherit (graphql_parser) version useDune2 src; + + propagatedBuildInputs = [ graphql_parser rresult yojson ]; + + checkInputs = [ alcotest ]; + + doCheck = true; + + meta = graphql_parser.meta // { + description = "Build GraphQL schemas and execute queries against them"; + }; + +} diff --git a/pkgs/development/ocaml-modules/graphql/lwt.nix b/pkgs/development/ocaml-modules/graphql/lwt.nix new file mode 100644 index 00000000000..187856da0d6 --- /dev/null +++ b/pkgs/development/ocaml-modules/graphql/lwt.nix @@ -0,0 +1,19 @@ +{ buildDunePackage, alcotest, graphql, ocaml_lwt }: + +buildDunePackage rec { + pname = "graphql-lwt"; + + inherit (graphql) version useDune2 src; + + propagatedBuildInputs = [ graphql ocaml_lwt ]; + + checkInputs = [ alcotest ]; + + doCheck = true; + + meta = graphql.meta // { + description = "Build GraphQL schemas with Lwt support"; + }; + +} + diff --git a/pkgs/development/ocaml-modules/graphql/parser.nix b/pkgs/development/ocaml-modules/graphql/parser.nix new file mode 100644 index 00000000000..62f8ca1ef12 --- /dev/null +++ b/pkgs/development/ocaml-modules/graphql/parser.nix @@ -0,0 +1,30 @@ +{ lib, buildDunePackage, fetchurl, alcotest, fmt, menhir, re }: + +buildDunePackage rec { + pname = "graphql_parser"; + version = "0.13.0"; + + useDune2 = true; + + minimumOCamlVersion = "4.03"; + + src = fetchurl { + url = "https://github.com/andreas/ocaml-graphql-server/releases/download/${version}/graphql-${version}.tbz"; + sha256 = "0gb5y99ph0nz5y3pc1gxq1py4wji2hyf2ydbp0hv23v00n50hpsm"; + }; + + nativeBuildInputs = [ menhir ]; + propagatedBuildInputs = [ fmt re ]; + + checkInputs = [ alcotest ]; + + doCheck = true; + + meta = { + homepage = "https://github.com/andreas/ocaml-graphql-server"; + description = "Library for parsing GraphQL queries"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.vbgl ]; + }; + +} diff --git a/pkgs/development/ocaml-modules/graphql_ppx/default.nix b/pkgs/development/ocaml-modules/graphql_ppx/default.nix new file mode 100644 index 00000000000..aa149d60e4d --- /dev/null +++ b/pkgs/development/ocaml-modules/graphql_ppx/default.nix @@ -0,0 +1,37 @@ +{ lib, buildDunePackage, fetchFromGitHub, alcotest, reason +, ppxlib +, yojson }: + +buildDunePackage rec { + pname = "graphql_ppx"; + version = "1.2.0"; + + minimalOCamlVersion = "4.08"; + + src = fetchFromGitHub { + owner = "reasonml-community"; + repo = "graphql-ppx"; + rev = "v${version}"; + sha256 = "1fymmvk616wv5xkwfdmqibdgfl47ry6idc5wfh20a3mz9mpaa13s"; + }; + + buildInputs = [ ppxlib ]; + + propagatedBuildInputs = [ + reason + yojson + ]; + + checkInputs = [ alcotest ]; + + doCheck = true; + + useDune2 = true; + + meta = { + homepage = "https://github.com/reasonml-community/graphql_ppx"; + description = "GraphQL PPX rewriter for Bucklescript/ReasonML"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ Zimmi48 jtcoolen ]; + }; +} diff --git a/pkgs/development/ocaml-modules/gsl/default.nix b/pkgs/development/ocaml-modules/gsl/default.nix new file mode 100644 index 00000000000..eacdda27f43 --- /dev/null +++ b/pkgs/development/ocaml-modules/gsl/default.nix @@ -0,0 +1,25 @@ +{ lib, stdenv, fetchurl, buildDunePackage, pkg-config, gsl, darwin, dune-configurator }: + +buildDunePackage rec { + pname = "gsl"; + version = "1.24.3"; + + useDune2 = true; + + minimumOCamlVersion = "4.08"; + + src = fetchurl { + url = "https://github.com/mmottl/gsl-ocaml/releases/download/${version}/gsl-${version}.tbz"; + sha256 = "1mpzcgbrha2l8iikqbmn32668v2mnnsykxg5n5jgs0qnskn2nvrn"; + }; + + buildInputs = [ dune-configurator gsl pkg-config ]; + propagatedBuildInputs = lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Accelerate ]; + + meta = with lib; { + homepage = "https://mmottl.github.io/gsl-ocaml/"; + description = "OCaml bindings to the GNU Scientific Library"; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/h2/default.nix b/pkgs/development/ocaml-modules/h2/default.nix new file mode 100644 index 00000000000..dd96e0ecc44 --- /dev/null +++ b/pkgs/development/ocaml-modules/h2/default.nix @@ -0,0 +1,59 @@ +{ buildDunePackage +, lib +, fetchFromGitHub +, ocaml +, hpack +, angstrom +, faraday +, base64 +, psq +, httpaf +, alcotest +, yojson +, hex +}: + +let + http2-frame-test-case = fetchFromGitHub { + owner = "http2jp"; + repo = "http2-frame-test-case"; + rev = "5c67db0d4d68e1fb7d3a241d6e01fc04d981f465"; + sha256 = "16yyb37f8mk9saw7ndjs5is67yq7qa6b6y7k0c75ibxi4n9aw1r3"; + }; +in + +buildDunePackage rec { + pname = "h2"; + + inherit (hpack) + version + src + useDune2 + ; + + minimumOCamlVersion = "4.06"; + + propagatedBuildInputs = [ + angstrom + faraday + base64 + psq + hpack + httpaf + ]; + + # Tests fail with 4.06 + doCheck = lib.versionAtLeast ocaml.version "4.07"; + preCheck = '' + ln -s "${http2-frame-test-case}" lib_test/http2-frame-test-case + ''; + checkInputs = [ + alcotest + yojson + hex + ]; + + meta = hpack.meta // { + description = "A high-performance, memory-efficient, and scalable HTTP/2 library for OCaml"; + }; +} diff --git a/pkgs/development/ocaml-modules/hack_parallel/default.nix b/pkgs/development/ocaml-modules/hack_parallel/default.nix new file mode 100644 index 00000000000..f9bc6777212 --- /dev/null +++ b/pkgs/development/ocaml-modules/hack_parallel/default.nix @@ -0,0 +1,26 @@ +{ lib, fetchFromGitHub, buildDunePackage, core, core_kernel, pkg-config, sqlite +}: +buildDunePackage rec { + pname = "hack_parallel"; + version = "1.0.1"; + useDune2 = true; + minimumOcamlVersion = "4.04.1"; + + src = fetchFromGitHub { + owner = "rvantonder"; + repo = "hack_parallel"; + rev = version; + sha256 = "0qjlkw35r4q2cm0n2x0i73zvx1xgrp6axaia2nm8zxpm49mid629"; + }; + + nativeBuildInputs = [ pkg-config ]; + + buildInputs = [ core core_kernel sqlite ]; + + meta = { + description = + "Core parallel and shared memory library used by Hack, Flow, and Pyre"; + license = lib.licenses.mit; + homepage = "https://github.com/rvantonder/hack_parallel"; + }; +} diff --git a/pkgs/development/ocaml-modules/hacl-star/default.nix b/pkgs/development/ocaml-modules/hacl-star/default.nix new file mode 100644 index 00000000000..004aa5c9a44 --- /dev/null +++ b/pkgs/development/ocaml-modules/hacl-star/default.nix @@ -0,0 +1,20 @@ +{ lib, buildDunePackage, hacl-star-raw, zarith, cppo }: + +buildDunePackage { + pname = "hacl-star"; + + inherit (hacl-star-raw) version src meta doCheck minimalOCamlVersion; + + useDune2 = true; + + propagatedBuildInputs = [ + hacl-star-raw + zarith + ]; + + nativeBuildInputs = [ + cppo + ]; + + strictDeps = true; +} diff --git a/pkgs/development/ocaml-modules/hacl-star/raw.nix b/pkgs/development/ocaml-modules/hacl-star/raw.nix new file mode 100644 index 00000000000..58fa1eb0021 --- /dev/null +++ b/pkgs/development/ocaml-modules/hacl-star/raw.nix @@ -0,0 +1,55 @@ +{ lib, which, stdenv, fetchzip, ocaml, findlib, hacl-star, ctypes, cppo }: + +stdenv.mkDerivation rec { + pname = "ocaml${ocaml.version}-hacl-star-raw"; + version = "0.4.5"; + + src = fetchzip { + url = "https://github.com/project-everest/hacl-star/releases/download/ocaml-v${version}/hacl-star.${version}.tar.gz"; + sha256 = "1330vgbf5krlkvifby96kyk13xhmihajk2w5hgf2761jrljmnnrs"; + stripRoot = false; + }; + + sourceRoot = "./source/raw"; + + minimalOCamlVersion = "4.08"; + + postPatch = '' + patchShebangs ./ + ''; + + preInstall = '' + mkdir -p $OCAMLFIND_DESTDIR/stublibs + ''; + + installTargets = "install-hacl-star-raw"; + + dontAddPrefix = true; + dontAddStaticConfigureFlags = true; + configurePlatforms = []; + + nativeBuildInputs = [ + which + ocaml + findlib + ]; + + propagatedBuildInputs = [ + ctypes + ]; + + checkInputs = [ + cppo + ]; + + strictDeps = true; + + doCheck = true; + + meta = { + description = "Auto-generated low-level OCaml bindings for EverCrypt/HACL*"; + license = lib.licenses.asl20; + maintainers = [ lib.maintainers.ulrikstrid ]; + platforms = ocaml.meta.platforms; + }; +} diff --git a/pkgs/development/ocaml-modules/hacl_x25519/default.nix b/pkgs/development/ocaml-modules/hacl_x25519/default.nix new file mode 100644 index 00000000000..46a04a51fca --- /dev/null +++ b/pkgs/development/ocaml-modules/hacl_x25519/default.nix @@ -0,0 +1,24 @@ +{ lib, buildDunePackage, fetchurl, benchmark, cstruct +, alcotest , eqaf, hex, ppx_blob, ppx_deriving_yojson, stdlib-shims, yojson }: + +buildDunePackage rec { + pname = "hacl_x25519"; + version = "0.2.0"; + + src = fetchurl { + url = "https://github.com/mirage/hacl/releases/download/v${version}/${pname}-v${version}.tbz"; + sha256 = "0ppq56i2yhxzz38w120aynnkx10kncl86zvqip9zx0v4974k3k4x"; + }; + + useDune2 = true; + propagatedBuildInputs = [ eqaf cstruct ]; + checkInputs = [ alcotest benchmark hex ppx_blob ppx_deriving_yojson stdlib-shims yojson ]; + doCheck = true; + + meta = with lib; { + description = "Primitives for Elliptic Curve Cryptography taken from Project Everest"; + homepage = "https://github.com/mirage/hacl"; + license = licenses.mit; + maintainers = with maintainers; [ sternenseemann ]; + }; +} diff --git a/pkgs/development/ocaml-modules/hashcons/default.nix b/pkgs/development/ocaml-modules/hashcons/default.nix new file mode 100644 index 00000000000..2bfaced1155 --- /dev/null +++ b/pkgs/development/ocaml-modules/hashcons/default.nix @@ -0,0 +1,23 @@ +{ lib, fetchFromGitHub, buildDunePackage }: + +buildDunePackage rec { + pname = "hashcons"; + version = "1.4"; + + src = fetchFromGitHub { + owner = "backtracking"; + repo = "ocaml-${pname}"; + rev = "d733325eeb55878bed285120c2c088daf78f0e2b"; + sha256 = "0h4pvwj34pndaw3pajkhl710ywwinhc9pqimgllfmkl37wz2d8zq"; + }; + + useDune2 = true; + + doCheck = true; + + meta = { + description = "OCaml hash-consing library"; + license = lib.licenses.lgpl21; + maintainers = [ lib.maintainers.ulrikstrid ]; + }; +} diff --git a/pkgs/development/ocaml-modules/herelib/default.nix b/pkgs/development/ocaml-modules/herelib/default.nix new file mode 100644 index 00000000000..f9267ede60a --- /dev/null +++ b/pkgs/development/ocaml-modules/herelib/default.nix @@ -0,0 +1,26 @@ +{ lib, buildOcaml, fetchFromGitHub, camlp4 }: + +buildOcaml rec { + version = "112.35.00"; + pname = "herelib"; + + minimumSupportedOcamlVersion = "4.00"; + + src = fetchFromGitHub { + owner = "janestreet"; + repo = "herelib"; + rev = version; + sha256 = "sha256-EuMhHu2na3lcpsJ1wMVOgBr6VKndlonq8jgAW01eelI="; + }; + + strictDeps = true; + + buildInputs = [ camlp4 ]; + + meta = with lib; { + homepage = "https://github.com/janestreet/herelib"; + description = "Syntax extension for inserting the current location"; + license = licenses.asl20; + maintainers = [ maintainers.ericbmerritt ]; + }; +} diff --git a/pkgs/development/ocaml-modules/hex/default.nix b/pkgs/development/ocaml-modules/hex/default.nix new file mode 100644 index 00000000000..4a6123ebd3a --- /dev/null +++ b/pkgs/development/ocaml-modules/hex/default.nix @@ -0,0 +1,25 @@ +{ lib, fetchurl, buildDunePackage, bigarray-compat, cstruct }: + +buildDunePackage rec { + pname = "hex"; + version = "1.4.0"; + + useDune2 = true; + + minimumOCamlVersion = "4.02"; + + src = fetchurl { + url = "https://github.com/mirage/ocaml-${pname}/releases/download/v${version}/hex-v${version}.tbz"; + sha256 = "07b9y0lmnflsslkrm6xilkj40n8sf2hjqkyqghnk7sw5l0plkqsp"; + }; + + propagatedBuildInputs = [ bigarray-compat cstruct ]; + doCheck = true; + + meta = { + description = "Mininal OCaml library providing hexadecimal converters"; + homepage = "https://github.com/mirage/ocaml-hex"; + license = lib.licenses.isc; + maintainers = with lib.maintainers; [ vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/hidapi/default.nix b/pkgs/development/ocaml-modules/hidapi/default.nix new file mode 100644 index 00000000000..44b1d5f150a --- /dev/null +++ b/pkgs/development/ocaml-modules/hidapi/default.nix @@ -0,0 +1,32 @@ +{ pkgs, lib, fetchurl, buildDunePackage, pkg-config, dune-configurator +, bigstring, +}: + +buildDunePackage rec { + pname = "hidapi"; + version = "1.1.1"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/vbmithr/ocaml-hidapi/releases/download/${version}/${pname}-${version}.tbz"; + sha256 = "1j7rd7ajrzla76r3sxljx6fb18f4f4s3jd7vhv59l2ilxyxycai2"; + }; + + strictDeps = true; + + minimumOCamlVersion = "4.03"; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ pkgs.hidapi dune-configurator ]; + propagatedBuildInputs = [ bigstring ]; + + doCheck = true; + + meta = with lib; { + homepage = "https://github.com/vbmithr/ocaml-hidapi"; + description = "Bindings to Signal11's hidapi library"; + license = licenses.isc; + maintainers = [ maintainers.alexfmpe ]; + }; +} diff --git a/pkgs/development/ocaml-modules/higlo/default.nix b/pkgs/development/ocaml-modules/higlo/default.nix new file mode 100644 index 00000000000..19b2fa8942a --- /dev/null +++ b/pkgs/development/ocaml-modules/higlo/default.nix @@ -0,0 +1,25 @@ +{ lib, buildDunePackage, fetchFromGitLab, sedlex_2, xtmpl }: + +buildDunePackage rec { + pname = "higlo"; + version = "0.8"; + useDune2 = true; + src = fetchFromGitLab { + domain = "framagit.org"; + owner = "zoggy"; + repo = "higlo"; + rev = version; + sha256 = "sha256:09hsbwy5asacgh4gdj0vjpy4kzfnq3qji9szbsbyswsf1nbyczir"; + }; + + propagatedBuildInputs = [ sedlex_2 xtmpl ]; + + meta = with lib; { + description = "OCaml library for syntax highlighting"; + inherit (src.meta) homepage; + license = licenses.lgpl3; + maintainers = with maintainers; [ regnat ]; + }; +} + + diff --git a/pkgs/development/ocaml-modules/hkdf/default.nix b/pkgs/development/ocaml-modules/hkdf/default.nix new file mode 100644 index 00000000000..9832a5f4c41 --- /dev/null +++ b/pkgs/development/ocaml-modules/hkdf/default.nix @@ -0,0 +1,26 @@ +{ lib, buildDunePackage, fetchurl, cstruct, mirage-crypto, alcotest }: + +buildDunePackage rec { + pname = "hkdf"; + version = "1.0.4"; + + minimumOCamlVersion = "4.07"; + + src = fetchurl { + url = "https://github.com/hannesm/ocaml-${pname}/releases/download/v${version}/${pname}-v${version}.tbz"; + sha256 = "0nzx6vzbc1hh6vx1ly8df4b16lgps6zjpp9mjycsnnn49bddc9mr"; + }; + + useDune2 = true; + + propagatedBuildInputs = [ cstruct mirage-crypto ]; + checkInputs = [ alcotest ]; + doCheck = true; + + meta = with lib; { + description = "HMAC-based Extract-and-Expand Key Derivation Function (RFC 5869)"; + homepage = "https://github.com/hannesm/ocaml-hkdf"; + license = licenses.mit; + maintainers = with maintainers; [ sternenseemann ]; + }; +} diff --git a/pkgs/development/ocaml-modules/hmap/default.nix b/pkgs/development/ocaml-modules/hmap/default.nix new file mode 100644 index 00000000000..d0ae47031b2 --- /dev/null +++ b/pkgs/development/ocaml-modules/hmap/default.nix @@ -0,0 +1,44 @@ +{ stdenv +, lib +, fetchurl +, findlib +, ocaml +, ocamlbuild +, topkg +}: + +let + minimumSupportedOcamlVersion = "4.02.0"; +in +assert lib.versionOlder minimumSupportedOcamlVersion ocaml.version; + +stdenv.mkDerivation rec { + pname = "hmap"; + version = "0.8.1"; + name = "ocaml${ocaml.version}-${pname}-${version}"; + + src = fetchurl { + url = "http://erratique.ch/software/hmap/releases/${pname}-${version}.tbz"; + sha256 = "10xyjy4ab87z7jnghy0wnla9wrmazgyhdwhr4hdmxxdn28dxn03a"; + }; + + nativeBuildInputs = [ ocaml ocamlbuild findlib topkg ]; + buildInputs = [ topkg ]; + + strictDeps = true; + + inherit (topkg) installPhase; + + buildPhase = "${topkg.run} build --tests true"; + + doCheck = true; + + checkPhase = "${topkg.run} test"; + + meta = { + description = "Heterogeneous value maps for OCaml"; + homepage = "https://erratique.ch/software/hmap"; + license = lib.licenses.isc; + maintainers = [ lib.maintainers.pmahoney ]; + }; +} diff --git a/pkgs/development/ocaml-modules/hpack/default.nix b/pkgs/development/ocaml-modules/hpack/default.nix new file mode 100644 index 00000000000..ec967312b87 --- /dev/null +++ b/pkgs/development/ocaml-modules/hpack/default.nix @@ -0,0 +1,37 @@ +{ buildDunePackage +, lib +, fetchurl +, angstrom +, faraday +}: + +buildDunePackage rec { + pname = "hpack"; + version = "0.8.0"; + + src = fetchurl { + url = "https://github.com/anmonteiro/ocaml-h2/releases/download/${version}/h2-${version}.tbz"; + sha256 = "0qcn3yvyz0h419fjg9nb20csfmwmh3ihz0zb0jfzdycf5w4mlry6"; + }; + + useDune2 = true; + minimumOCamlVersion = "4.04"; + + propagatedBuildInputs = [ + angstrom + faraday + ]; + + # circular dependency + doCheck = false; + + meta = { + license = lib.licenses.bsd3; + description = "An HPACK (Header Compression for HTTP/2) implementation in OCaml"; + homepage = "https://github.com/anmonteiro/ocaml-h2"; + maintainers = with lib.maintainers; [ + sternenseemann + anmonteiro + ]; + }; +} diff --git a/pkgs/development/ocaml-modules/httpaf/default.nix b/pkgs/development/ocaml-modules/httpaf/default.nix new file mode 100644 index 00000000000..94cee795b93 --- /dev/null +++ b/pkgs/development/ocaml-modules/httpaf/default.nix @@ -0,0 +1,28 @@ +{ lib, fetchFromGitHub, fetchpatch, buildDunePackage +, angstrom, faraday, alcotest +}: + +buildDunePackage rec { + pname = "httpaf"; + version = "0.7.1"; + + useDune2 = true; + + src = fetchFromGitHub { + owner = "inhabitedtype"; + repo = pname; + rev = version; + sha256 = "0zk78af3qyvf6w66mg8sxygr6ndayzqw5s3zfxibvn121xwni26z"; + }; + + checkInputs = [ alcotest ]; + propagatedBuildInputs = [ angstrom faraday ]; + doCheck = true; + + meta = { + description = "A high-performance, memory-efficient, and scalable web server for OCaml"; + license = lib.licenses.bsd3; + maintainers = [ lib.maintainers.vbgl ]; + inherit (src.meta) homepage; + }; +} diff --git a/pkgs/development/ocaml-modules/hxd/default.nix b/pkgs/development/ocaml-modules/hxd/default.nix new file mode 100644 index 00000000000..0b05a83dd7e --- /dev/null +++ b/pkgs/development/ocaml-modules/hxd/default.nix @@ -0,0 +1,39 @@ +{ lib, buildDunePackage, fetchurl +, ocaml, dune-configurator, cmdliner +, lwt, withLwt ? lib.versionAtLeast ocaml.version "4.07" +}: + +buildDunePackage rec { + pname = "hxd"; + version = "0.3.1"; + + useDune2 = true; + + minimumOCamlVersion = "4.06"; + + src = fetchurl { + url = "https://github.com/dinosaure/hxd/releases/download/v${version}/hxd-v${version}.tbz"; + sha256 = "1c226c91e17cd329dec0c287bfd20f36302aa533069ff9c6ced32721f96b29bc"; + }; + + # ignore yes stderr output due to trapped SIGPIPE + postPatch = '' + sed -i 's|yes ".\+"|& 2> /dev/null|' test/*.t + ''; + + propagatedBuildInputs = lib.optional withLwt lwt; + + buildInputs = [ + cmdliner + dune-configurator + ]; + + doCheck = true; + + meta = with lib; { + description = "Hexdump in OCaml"; + homepage = "https://github.com/dinosaure/hxd"; + license = licenses.mit; + maintainers = [ maintainers.sternenseemann ]; + }; +} diff --git a/pkgs/development/ocaml-modules/imagelib/default.nix b/pkgs/development/ocaml-modules/imagelib/default.nix new file mode 100644 index 00000000000..580db48769e --- /dev/null +++ b/pkgs/development/ocaml-modules/imagelib/default.nix @@ -0,0 +1,28 @@ +{ lib, fetchurl, buildDunePackage +, decompress, stdlib-shims, alcotest +}: + +buildDunePackage rec { + minimumOCamlVersion = "4.07"; + version = "20210511"; + pname = "imagelib"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/rlepigre/ocaml-imagelib/releases/download/${version}/imagelib-${version}.tbz"; + sha256 = "1cb94ea3731dc994c205940c9434543ce3f2470cdcb2e93a3e02ed793e80d480"; + }; + + propagatedBuildInputs = [ decompress stdlib-shims ]; + + doCheck = true; + checkInputs = [ alcotest ]; + + meta = { + description = "Image formats such as PNG and PPM in OCaml"; + license = lib.licenses.lgpl3; + maintainers = [ lib.maintainers.vbgl ]; + homepage = "https://github.com/rlepigre/ocaml-imagelib"; + }; +} diff --git a/pkgs/development/ocaml-modules/index/default.nix b/pkgs/development/ocaml-modules/index/default.nix new file mode 100644 index 00000000000..3dc4a9856f9 --- /dev/null +++ b/pkgs/development/ocaml-modules/index/default.nix @@ -0,0 +1,48 @@ +{ lib, fetchurl, buildDunePackage +, repr, ppx_repr, fmt, logs, mtime, stdlib-shims +, cmdliner, progress, semaphore-compat, optint +, alcotest, crowbar, re, lru +}: + +buildDunePackage rec { + pname = "index"; + version = "1.6.0"; + + src = fetchurl { + url = "https://github.com/mirage/index/releases/download/${version}/index-${version}.tbz"; + sha256 = "sha256:150mcsh8vj2hapfnxbjmacanjy4avrv8yk1lyaxmqj3fpmn1y32y"; + }; + + minimalOCamlVersion = "4.08"; + useDune2 = true; + + buildInputs = [ + stdlib-shims + ]; + propagatedBuildInputs = [ + cmdliner + fmt + logs + mtime + ppx_repr + progress + repr + semaphore-compat + optint + lru + ]; + + checkInputs = [ + alcotest + crowbar + re + ]; + doCheck = true; + + meta = with lib; { + description = "A platform-agnostic multi-level index"; + homepage = "https://github.com/mirage/index"; + license = licenses.mit; + maintainers = with maintainers; [ vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/inifiles/default.nix b/pkgs/development/ocaml-modules/inifiles/default.nix new file mode 100644 index 00000000000..cbeae7bca83 --- /dev/null +++ b/pkgs/development/ocaml-modules/inifiles/default.nix @@ -0,0 +1,33 @@ +{ stdenv, lib, fetchurl, fetchpatch, ocaml, findlib, ocaml_pcre }: + +stdenv.mkDerivation rec { + pname = "ocaml${ocaml.version}-inifiles"; + version = "1.2"; + + src = fetchurl { + url = "mirror://ubuntu/pool/universe/o/ocaml-inifiles/ocaml-inifiles_${version}.orig.tar.gz"; + sha256 = "0jhzgiypmh6hwsv1zpiq77fi0cvcmwbiy5x0yg7mz6p3dh1dmkns"; + }; + + patches = [ + (fetchpatch { + url = "https://raw.githubusercontent.com/ocaml/opam-repository/master/packages/ocaml-inifiles/ocaml-inifiles.1.2/files/ocaml-inifiles.diff"; + sha256 = "037kk3172s187w8vwsykdxlpklxzc7m7np57sapk499d8adzdgwn"; + }) + ]; + + nativeBuildInputs = [ ocaml findlib ]; + propagatedBuildInputs = [ ocaml_pcre ]; + + strictDeps = true; + + buildFlags = [ "all" "opt" ]; + + createFindlibDestdir = true; + + meta = { + description = "A small OCaml library to read and write .ini files"; + license = lib.licenses.lgpl21Plus; + inherit (ocaml.meta) platforms; + }; +} diff --git a/pkgs/development/ocaml-modules/inotify/default.nix b/pkgs/development/ocaml-modules/inotify/default.nix new file mode 100644 index 00000000000..d1c6dc37616 --- /dev/null +++ b/pkgs/development/ocaml-modules/inotify/default.nix @@ -0,0 +1,48 @@ +{ stdenv, lib, fetchFromGitHub, fetchpatch, ocaml, findlib, ocamlbuild +, ocaml_lwt # optional lwt support +, ounit, fileutils # only for tests +}: + +stdenv.mkDerivation rec { + version = "2.3"; + pname = "ocaml${ocaml.version}-inotify"; + + src = fetchFromGitHub { + owner = "whitequark"; + repo = "ocaml-inotify"; + rev = "v${version}"; + sha256 = "1s6vmqpx19hxzsi30jvp3h7p56rqnxfhfddpcls4nz8sqca1cz5y"; + }; + + patches = [ (fetchpatch { + url = "https://github.com/whitequark/ocaml-inotify/commit/716c8002cc1652f58eb0c400ae92e04003cba8c9.patch"; + sha256 = "04lfxrrsmk2mc704kaln8jqx93jc4bkxhijmfy2d4cmk1cim7r6k"; + }) ]; + + nativeBuildInputs = [ ocaml findlib ocamlbuild ]; + buildInputs = [ ocaml_lwt ]; + checkInputs = [ ounit fileutils ]; + + # Otherwise checkInputs can't be found + strictDeps = false; + + configureFlags = [ "--enable-lwt" + (lib.optionalString doCheck "--enable-tests") ]; + + postConfigure = lib.optionalString doCheck '' + echo '<lib_test/test_inotify_lwt.*>: pkg_threads' | tee -a _tags + ''; + + doCheck = true; + checkTarget = "test"; + + createFindlibDestdir = true; + + meta = { + description = "Bindings for Linux’s filesystem monitoring interface, inotify"; + license = lib.licenses.lgpl21; + maintainers = [ lib.maintainers.vbgl ]; + inherit (src.meta) homepage; + platforms = lib.platforms.linux; + }; +} diff --git a/pkgs/development/ocaml-modules/integers/default.nix b/pkgs/development/ocaml-modules/integers/default.nix new file mode 100644 index 00000000000..ed5ccbedb64 --- /dev/null +++ b/pkgs/development/ocaml-modules/integers/default.nix @@ -0,0 +1,23 @@ +{ lib, fetchFromGitHub, buildDunePackage, ocaml }: + +buildDunePackage rec { + pname = "integers"; + version = "0.5.1"; + + useDune2 = lib.versionAtLeast ocaml.version "4.08"; + + src = fetchFromGitHub { + owner = "ocamllabs"; + repo = "ocaml-integers"; + rev = version; + sha256 = "0by5pc851fk7ccxqy1w2qc5jwn9z8whyqhs5gxlm5986vr9msnyi"; + }; + + meta = { + description = "Various signed and unsigned integer types for OCaml"; + license = lib.licenses.mit; + homepage = "https://github.com/ocamllabs/ocaml-integers"; + changelog = "https://github.com/ocamllabs/ocaml-integers/raw/${version}/CHANGES.md"; + maintainers = [ lib.maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/io-page/default.nix b/pkgs/development/ocaml-modules/io-page/default.nix new file mode 100644 index 00000000000..9685e27d0b8 --- /dev/null +++ b/pkgs/development/ocaml-modules/io-page/default.nix @@ -0,0 +1,25 @@ +{ lib, fetchurl, buildDunePackage, cstruct, bigarray-compat, ounit }: + +buildDunePackage rec { + pname = "io-page"; + version = "2.3.0"; + + useDune2 = true; + minimumOCamlVersion = "4.02.3"; + + src = fetchurl { + url = "https://github.com/mirage/${pname}/releases/download/v${version}/${pname}-v${version}.tbz"; + sha256 = "1hx27pwf419hrhwaw9cphbnl8akz8yy73hqj49l15g2k7shah1cn"; + }; + + propagatedBuildInputs = [ cstruct bigarray-compat ]; + checkInputs = [ ounit ]; + doCheck = true; + + meta = { + homepage = "https://github.com/mirage/io-page"; + license = lib.licenses.isc; + description = "IO memory page library for Mirage backends"; + maintainers = with lib.maintainers; [ vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/io-page/unix.nix b/pkgs/development/ocaml-modules/io-page/unix.nix new file mode 100644 index 00000000000..843451b3086 --- /dev/null +++ b/pkgs/development/ocaml-modules/io-page/unix.nix @@ -0,0 +1,17 @@ +{ lib, buildDunePackage, io-page, cstruct, ounit }: + +buildDunePackage { + pname = "io-page-unix"; + + inherit (io-page) version src useDune2 minimumOCamlVersion; + + propagatedBuildInputs = [ cstruct io-page ]; + checkInputs = [ ounit ]; + doCheck = true; + + meta = with lib; { + inherit (io-page.meta) homepage license; + description = "Support for efficient handling of I/O memory pages on Unix"; + maintainers = [ maintainers.sternenseemann ]; + }; +} diff --git a/pkgs/development/ocaml-modules/ipaddr/cstruct.nix b/pkgs/development/ocaml-modules/ipaddr/cstruct.nix new file mode 100644 index 00000000000..d1386230452 --- /dev/null +++ b/pkgs/development/ocaml-modules/ipaddr/cstruct.nix @@ -0,0 +1,17 @@ +{ lib, buildDunePackage +, ipaddr, cstruct +}: + +buildDunePackage rec { + pname = "ipaddr-cstruct"; + + inherit (ipaddr) version src useDune2 minimumOCamlVersion; + + propagatedBuildInputs = [ ipaddr cstruct ]; + + doCheck = true; + + meta = ipaddr.meta // { + description = "A library for manipulation of IP address representations using Cstructs"; + }; +} diff --git a/pkgs/development/ocaml-modules/ipaddr/default.nix b/pkgs/development/ocaml-modules/ipaddr/default.nix new file mode 100644 index 00000000000..3090066c2f4 --- /dev/null +++ b/pkgs/development/ocaml-modules/ipaddr/default.nix @@ -0,0 +1,20 @@ +{ lib, buildDunePackage +, macaddr, domain-name, stdlib-shims +, ounit, ppx_sexp_conv +}: + +buildDunePackage rec { + pname = "ipaddr"; + + inherit (macaddr) version src useDune2 minimumOCamlVersion; + + propagatedBuildInputs = [ macaddr domain-name stdlib-shims ]; + + checkInputs = [ ppx_sexp_conv ounit ]; + doCheck = true; + + meta = macaddr.meta // { + description = "A library for manipulation of IP (and MAC) address representations "; + maintainers = with lib.maintainers; [ alexfmpe ericbmerritt ]; + }; +} diff --git a/pkgs/development/ocaml-modules/ipaddr/sexp.nix b/pkgs/development/ocaml-modules/ipaddr/sexp.nix new file mode 100644 index 00000000000..1ede3c064ad --- /dev/null +++ b/pkgs/development/ocaml-modules/ipaddr/sexp.nix @@ -0,0 +1,18 @@ +{ lib, buildDunePackage +, ipaddr, ipaddr-cstruct, ounit, ppx_sexp_conv +}: + +buildDunePackage rec { + pname = "ipaddr-sexp"; + + inherit (ipaddr) version src useDune2 minimumOCamlVersion; + + propagatedBuildInputs = [ ipaddr ]; + + checkInputs = [ ipaddr-cstruct ounit ppx_sexp_conv ]; + doCheck = true; + + meta = ipaddr.meta // { + description = "A library for manipulation of IP address representations usnig sexp"; + }; +} diff --git a/pkgs/development/ocaml-modules/iri/default.nix b/pkgs/development/ocaml-modules/iri/default.nix new file mode 100644 index 00000000000..6a00fb453df --- /dev/null +++ b/pkgs/development/ocaml-modules/iri/default.nix @@ -0,0 +1,26 @@ +{ lib, buildDunePackage, fetchFromGitLab +, sedlex_2, uunf, uutf +}: + +buildDunePackage rec { + pname = "iri"; + version = "0.6.0"; + useDune2 = true; + + src = fetchFromGitLab { + domain = "framagit.org"; + owner = "zoggy"; + repo = "ocaml-iri"; + rev = version; + sha256 = "sha256:0zk8nnwcyljkc1a556byncv6cn1vqhk4267z1lm15flh1k7chyax"; + }; + + propagatedBuildInputs = [ sedlex_2 uunf uutf ]; + + meta = { + description = "IRI (RFC3987) native OCaml implementation"; + license = lib.licenses.lgpl3; + maintainers = [ lib.maintainers.vbgl ]; + inherit (src.meta) homepage; + }; +} diff --git a/pkgs/development/ocaml-modules/irmin-watcher/default.nix b/pkgs/development/ocaml-modules/irmin-watcher/default.nix new file mode 100644 index 00000000000..82818b39492 --- /dev/null +++ b/pkgs/development/ocaml-modules/irmin-watcher/default.nix @@ -0,0 +1,25 @@ +{ lib, fetchurl, buildDunePackage +, astring, fmt, logs, ocaml_lwt +}: + +buildDunePackage rec { + pname = "irmin-watcher"; + version = "0.4.1"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/mirage/irmin-watcher/releases/download/${version}/irmin-watcher-${version}.tbz"; + sha256 = "00d4ph4jbsw6adp3zqdrwi099hfcf7p1xzi0685qr7bgcmandjfv"; + }; + + propagatedBuildInputs = [ astring fmt logs ocaml_lwt ]; + + meta = { + homepage = "https://github.com/mirage/irmin-watcher"; + description = "Portable Irmin watch backends using FSevents or Inotify"; + license = lib.licenses.isc; + maintainers = [ lib.maintainers.vbgl ]; + }; + +} diff --git a/pkgs/development/ocaml-modules/irmin/chunk.nix b/pkgs/development/ocaml-modules/irmin/chunk.nix new file mode 100644 index 00000000000..0014bbbcfcb --- /dev/null +++ b/pkgs/development/ocaml-modules/irmin/chunk.nix @@ -0,0 +1,18 @@ +{ lib, buildDunePackage, irmin, irmin-test, alcotest }: + +buildDunePackage rec { + + pname = "irmin-chunk"; + inherit (irmin) version src useDune2; + + propagatedBuildInputs = [ irmin ]; + + doCheck = true; + checkInputs = [ alcotest irmin-test ]; + + meta = irmin.meta // { + description = "Irmin backend which allow to store values into chunks"; + }; + +} + diff --git a/pkgs/development/ocaml-modules/irmin/containers.nix b/pkgs/development/ocaml-modules/irmin/containers.nix new file mode 100644 index 00000000000..76383099a41 --- /dev/null +++ b/pkgs/development/ocaml-modules/irmin/containers.nix @@ -0,0 +1,27 @@ +{ buildDunePackage +, irmin, irmin-unix, irmin-git, ppx_irmin, lwt, mtime +, alcotest, alcotest-lwt, cacert +}: + +buildDunePackage { + pname = "irmin-containers"; + + inherit (ppx_irmin) src version useDune2; + + nativeBuildInputs = [ + ppx_irmin + ]; + + propagatedBuildInputs = [ + irmin irmin-unix irmin-git ppx_irmin lwt mtime + ]; + + doCheck = true; + checkInputs = [ + alcotest alcotest-lwt cacert + ]; + + meta = ppx_irmin.meta // { + description = "Mergeable Irmin data structures"; + }; +} diff --git a/pkgs/development/ocaml-modules/irmin/default.nix b/pkgs/development/ocaml-modules/irmin/default.nix new file mode 100644 index 00000000000..447024f6e12 --- /dev/null +++ b/pkgs/development/ocaml-modules/irmin/default.nix @@ -0,0 +1,35 @@ +{ lib, buildDunePackage +, astring, digestif, fmt, jsonm, logs, ocaml_lwt, ocamlgraph, uri +, repr, ppx_irmin, bheap, uutf +}: + +buildDunePackage { + pname = "irmin"; + + inherit (ppx_irmin) src version; + + useDune2 = true; + minimumOCamlVersion = "4.08"; + + propagatedBuildInputs = [ + astring + digestif + fmt + jsonm + logs + ocaml_lwt + ocamlgraph + uri + repr + bheap + ppx_irmin + uutf + ]; + + # circular dependency on irmin-mem + doCheck = false; + + meta = ppx_irmin.meta // { + description = "A distributed database built on the same principles as Git"; + }; +} diff --git a/pkgs/development/ocaml-modules/irmin/fs.nix b/pkgs/development/ocaml-modules/irmin/fs.nix new file mode 100644 index 00000000000..0e9596751b8 --- /dev/null +++ b/pkgs/development/ocaml-modules/irmin/fs.nix @@ -0,0 +1,23 @@ +{ lib, buildDunePackage, irmin, irmin-test }: + +buildDunePackage rec { + + pname = "irmin-fs"; + + inherit (irmin) version src; + + propagatedBuildInputs = [ irmin ]; + + useDune2 = true; + + checkInputs = lib.optional doCheck irmin-test; + + doCheck = true; + + meta = irmin.meta // { + description = "Generic file-system backend for Irmin"; + }; + +} + + diff --git a/pkgs/development/ocaml-modules/irmin/git.nix b/pkgs/development/ocaml-modules/irmin/git.nix new file mode 100644 index 00000000000..d477c932928 --- /dev/null +++ b/pkgs/development/ocaml-modules/irmin/git.nix @@ -0,0 +1,38 @@ +{ lib, buildDunePackage +, git, irmin, irmin-test, ppx_irmin, git-cohttp-unix, git-unix +, digestif, cstruct, fmt, astring, fpath, logs, lwt, uri +, mtime, alcotest, cacert +}: + +buildDunePackage { + + pname = "irmin-git"; + + inherit (irmin) version src; + + useDune2 = true; + + propagatedBuildInputs = [ + git + irmin + ppx_irmin + digestif + cstruct + fmt + astring + fpath + logs + lwt + uri + ]; + + checkInputs = [ mtime alcotest git-cohttp-unix git-unix irmin-test cacert ]; + + doCheck = true; + + meta = irmin.meta // { + description = "Git backend for Irmin"; + }; + +} + diff --git a/pkgs/development/ocaml-modules/irmin/graphql.nix b/pkgs/development/ocaml-modules/irmin/graphql.nix new file mode 100644 index 00000000000..03c8f1eca29 --- /dev/null +++ b/pkgs/development/ocaml-modules/irmin/graphql.nix @@ -0,0 +1,32 @@ +{ lib, buildDunePackage, cohttp-lwt, graphql-cohttp, graphql-lwt, irmin +, alcotest, alcotest-lwt, logs, yojson, cohttp-lwt-unix, cacert +}: + +buildDunePackage rec { + + pname = "irmin-graphql"; + + inherit (irmin) version src; + + useDune2 = true; + + propagatedBuildInputs = [ cohttp-lwt graphql-cohttp graphql-lwt irmin ]; + + doCheck = true; + checkInputs = [ + alcotest + alcotest-lwt + logs + cohttp-lwt-unix + yojson + cacert + ]; + + meta = irmin.meta // { + description = "GraphQL server for Irmin"; + }; + +} + + + diff --git a/pkgs/development/ocaml-modules/irmin/http.nix b/pkgs/development/ocaml-modules/irmin/http.nix new file mode 100644 index 00000000000..7bfae998202 --- /dev/null +++ b/pkgs/development/ocaml-modules/irmin/http.nix @@ -0,0 +1,28 @@ +{ lib, buildDunePackage, cohttp-lwt, irmin, webmachine +, checkseum, git-unix, irmin-git, irmin-test, digestif, git-cohttp-unix +, cacert +}: + +buildDunePackage rec { + + pname = "irmin-http"; + + inherit (irmin) version src; + + useDune2 = true; + + propagatedBuildInputs = [ cohttp-lwt irmin webmachine ]; + + checkInputs = [ + digestif checkseum git-cohttp-unix git-unix irmin-git irmin-test cacert + ]; + + doCheck = true; + + meta = irmin.meta // { + description = "HTTP client and server for Irmin"; + }; + +} + + diff --git a/pkgs/development/ocaml-modules/irmin/layers.nix b/pkgs/development/ocaml-modules/irmin/layers.nix new file mode 100644 index 00000000000..40410b004ae --- /dev/null +++ b/pkgs/development/ocaml-modules/irmin/layers.nix @@ -0,0 +1,18 @@ +{ buildDunePackage, irmin, mtime, logs, lwt }: + +buildDunePackage { + pname = "irmin-layers"; + + inherit (irmin) version src useDune2; + + propagatedBuildInputs = [ + irmin + mtime + logs + lwt + ]; + + meta = irmin.meta // { + description = "Combine different Irmin stores into a single, layered store"; + }; +} diff --git a/pkgs/development/ocaml-modules/irmin/mirage-git.nix b/pkgs/development/ocaml-modules/irmin/mirage-git.nix new file mode 100644 index 00000000000..e33b766bd4c --- /dev/null +++ b/pkgs/development/ocaml-modules/irmin/mirage-git.nix @@ -0,0 +1,27 @@ +{ buildDunePackage, irmin-mirage, irmin-git +, mirage-kv, cohttp, conduit-lwt, conduit-mirage +, git-paf, fmt, git, lwt, mirage-clock, uri +}: + +buildDunePackage { + pname = "irmin-mirage-git"; + + inherit (irmin-mirage) version src useDune2; + + propagatedBuildInputs = [ + irmin-mirage + irmin-git + mirage-kv + cohttp + conduit-lwt + conduit-mirage + git-paf + fmt + git + lwt + mirage-clock + uri + ]; + + inherit (irmin-mirage) meta; +} diff --git a/pkgs/development/ocaml-modules/irmin/mirage-graphql.nix b/pkgs/development/ocaml-modules/irmin/mirage-graphql.nix new file mode 100644 index 00000000000..d550b9c924b --- /dev/null +++ b/pkgs/development/ocaml-modules/irmin/mirage-graphql.nix @@ -0,0 +1,21 @@ +{ buildDunePackage, irmin-mirage, irmin-graphql +, mirage-clock, cohttp-lwt, lwt, uri, git +}: + +buildDunePackage { + pname = "irmin-mirage-graphql"; + + inherit (irmin-mirage) version src useDune2; + + propagatedBuildInputs = [ + irmin-mirage + irmin-graphql + mirage-clock + cohttp-lwt + lwt + uri + git + ]; + + inherit (irmin-mirage) meta; +} diff --git a/pkgs/development/ocaml-modules/irmin/mirage.nix b/pkgs/development/ocaml-modules/irmin/mirage.nix new file mode 100644 index 00000000000..675c8a3fdd2 --- /dev/null +++ b/pkgs/development/ocaml-modules/irmin/mirage.nix @@ -0,0 +1,15 @@ +{ buildDunePackage, irmin, fmt, ptime, mirage-clock }: + +buildDunePackage { + pname = "irmin-mirage"; + + inherit (irmin) version src useDune2; + + propagatedBuildInputs = [ + irmin fmt ptime mirage-clock + ]; + + meta = irmin.meta // { + description = "MirageOS-compatible Irmin stores"; + }; +} diff --git a/pkgs/development/ocaml-modules/irmin/pack.nix b/pkgs/development/ocaml-modules/irmin/pack.nix new file mode 100644 index 00000000000..5955dda8ed9 --- /dev/null +++ b/pkgs/development/ocaml-modules/irmin/pack.nix @@ -0,0 +1,25 @@ +{ lib, buildDunePackage +, alcotest-lwt, index, irmin, irmin-layers, irmin-test, ocaml_lwt, fpath, optint +}: + +buildDunePackage rec { + minimumOCamlVersion = "4.02.3"; + + pname = "irmin-pack"; + + inherit (irmin) version src; + + useDune2 = true; + + buildInputs = [ fpath ]; + propagatedBuildInputs = [ index irmin irmin-layers ocaml_lwt optint ]; + + checkInputs = [ alcotest-lwt irmin-test ]; + + doCheck = true; + + meta = irmin.meta // { + description = "Irmin backend which stores values in a pack file"; + }; + +} diff --git a/pkgs/development/ocaml-modules/irmin/ppx.nix b/pkgs/development/ocaml-modules/irmin/ppx.nix new file mode 100644 index 00000000000..2eecc3a1e5e --- /dev/null +++ b/pkgs/development/ocaml-modules/irmin/ppx.nix @@ -0,0 +1,27 @@ +{ lib, fetchurl, buildDunePackage, ppxlib, ppx_repr }: + +buildDunePackage rec { + pname = "ppx_irmin"; + version = "2.9.1"; + + src = fetchurl { + url = "https://github.com/mirage/irmin/releases/download/${version}/irmin-${version}.tbz"; + sha256 = "10r7j4z4gx3dp48lavjhpb1cam27n6ch751amslb0drphy53l00n"; + }; + + minimumOCamlVersion = "4.08"; + + useDune2 = true; + + propagatedBuildInputs = [ + ppx_repr + ppxlib + ]; + + meta = { + homepage = "https://irmin.org/"; + description = "PPX deriver for Irmin generics"; + license = lib.licenses.isc; + maintainers = with lib.maintainers; [ vbgl sternenseemann ]; + }; +} diff --git a/pkgs/development/ocaml-modules/irmin/test.nix b/pkgs/development/ocaml-modules/irmin/test.nix new file mode 100644 index 00000000000..90141d925e6 --- /dev/null +++ b/pkgs/development/ocaml-modules/irmin/test.nix @@ -0,0 +1,21 @@ +{ buildDunePackage +, alcotest, cmdliner, irmin, metrics-unix, mtime, irmin-layers +}: + +buildDunePackage { + + pname = "irmin-test"; + + inherit (irmin) version src; + + useDune2 = true; + + propagatedBuildInputs = [ + alcotest cmdliner irmin metrics-unix mtime irmin-layers + ]; + + meta = irmin.meta // { + description = "Irmin test suite"; + }; + +} diff --git a/pkgs/development/ocaml-modules/irmin/unix.nix b/pkgs/development/ocaml-modules/irmin/unix.nix new file mode 100644 index 00000000000..89cf36979bd --- /dev/null +++ b/pkgs/development/ocaml-modules/irmin/unix.nix @@ -0,0 +1,32 @@ +{ lib, buildDunePackage +, checkseum, cmdliner, git-unix, git-cohttp-unix, yaml, fpath +, irmin, irmin-fs, irmin-git, irmin-graphql, irmin-http +, irmin-pack, irmin-watcher, irmin-test, cacert +}: + +buildDunePackage rec { + + pname = "irmin-unix"; + + inherit (irmin) version src; + + useDune2 = true; + + propagatedBuildInputs = [ + checkseum cmdliner git-unix yaml fpath + irmin irmin-fs irmin-git irmin-graphql irmin-http + irmin-pack irmin-watcher git-cohttp-unix + ]; + + checkInputs = [ + irmin-test cacert + ]; + + doCheck = true; + + meta = irmin.meta // { + description = "Unix backends for Irmin"; + }; + +} + diff --git a/pkgs/development/ocaml-modules/iso8601/default.nix b/pkgs/development/ocaml-modules/iso8601/default.nix new file mode 100644 index 00000000000..ff9ce94bbbd --- /dev/null +++ b/pkgs/development/ocaml-modules/iso8601/default.nix @@ -0,0 +1,27 @@ +{ stdenv, lib, fetchFromGitHub, ocaml, findlib, ocamlbuild }: + +stdenv.mkDerivation rec { + pname = "ocaml-iso8601"; + version = "0.2.4"; + + src = fetchFromGitHub { + owner = "sagotch"; + repo = "ISO8601.ml"; + rev = version; + sha256 = "sha256-sXnYAJcU88797orzzfbA2XG91Lk8mDV677J1Am5o7Xo="; + }; + + nativeBuildInputs = [ ocaml findlib ocamlbuild ]; + + strictDeps = true; + + createFindlibDestdir = true; + + meta = { + homepage = "https://ocaml-community.github.io/ISO8601.ml/"; + description = "ISO 8601 and RFC 3999 date parsing for OCaml"; + license = lib.licenses.mit; + platforms = ocaml.meta.platforms or [ ]; + maintainers = with lib.maintainers; [ vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/iter/default.nix b/pkgs/development/ocaml-modules/iter/default.nix new file mode 100644 index 00000000000..4fa7e42c5d5 --- /dev/null +++ b/pkgs/development/ocaml-modules/iter/default.nix @@ -0,0 +1,35 @@ +{ lib, fetchFromGitHub, buildDunePackage, ocaml, dune-configurator +, mdx, qtest, result +}: + +buildDunePackage rec { + pname = "iter"; + version = "1.3"; + + useDune2 = true; + + src = fetchFromGitHub { + owner = "c-cube"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256:0xgkplpbi41sw0yv1wfd12cfbybls6cal8qxddmd9x8khgk5s3vx"; + }; + + buildInputs = [ dune-configurator ]; + propagatedBuildInputs = [ result ]; + + doCheck = lib.versionAtLeast ocaml.version "4.08"; + checkInputs = [ mdx.bin qtest ]; + + meta = { + homepage = "https://github.com/c-cube/sequence"; + description = "Simple sequence (iterator) datatype and combinators"; + longDescription = '' + Simple sequence datatype, intended to transfer a finite number of + elements from one data structure to another. Some transformations on sequences, + like `filter`, `map`, `take`, `drop` and `append` can be performed before the + sequence is iterated/folded on. + ''; + license = lib.licenses.bsd2; + }; +} diff --git a/pkgs/development/ocaml-modules/janestreet/0.12.nix b/pkgs/development/ocaml-modules/janestreet/0.12.nix new file mode 100644 index 00000000000..c3b4b0c6d70 --- /dev/null +++ b/pkgs/development/ocaml-modules/janestreet/0.12.nix @@ -0,0 +1,509 @@ +{ self +, openssl +}: + +with self; + +{ + + ocaml-compiler-libs = janePackage { + pname = "ocaml-compiler-libs"; + hash = "0g9y1ljjsj1nw0lz460ivb6qmz9vhcmfl8krlmqfrni6pc7b0r6f"; + meta.description = "OCaml compiler libraries repackaged"; + }; + + sexplib0 = janePackage { + pname = "sexplib0"; + hash = "13xdd0pvypxqn0ldwdgikmlinrp3yfh8ixknv1xrpxbx3np4qp0g"; + meta.description = "Library containing the definition of S-expressions and some base converters"; + }; + + base = janePackage { + pname = "base"; + version = "0.12.2"; + hash = "0gl89zpgsf3n30nb6v5cns27g2bfg4rf3s2427gqvwbkr5gcf7ri"; + meta.description = "Full standard library replacement for OCaml"; + propagatedBuildInputs = [ sexplib0 ]; + buildInputs = [ dune_1 ]; + }; + + stdio = janePackage { + pname = "stdio"; + hash = "1pn8jjcb79n6crpw7dkp68s4lz2mw103lwmfslil66f05jsxhjhg"; + meta.description = "Standard IO library for OCaml"; + propagatedBuildInputs = [ base ]; + }; + + ppx_sexp_conv = janePackage { + pname = "ppx_sexp_conv"; + hash = "0idzp1kzds0gnilschzs9ydi54if8y5xpn6ajn710vkipq26qcld"; + meta.description = "[@@deriving] plugin to generate S-expression conversion functions"; + propagatedBuildInputs = [ ppxlib ]; + }; + + ppx_here = janePackage { + pname = "ppx_here"; + hash = "07qbchwif1i9ii8z7v1bib57d3mjv0b27i8iixw78i83wnsycmdx"; + meta.description = "Expands [%here] into its location"; + propagatedBuildInputs = [ ppxlib ]; + }; + + ppx_compare = janePackage { + pname = "ppx_compare"; + hash = "0n1ax4k2smhps9hc2v58lc06a0fgimwvbi1aj4x78vwh5j492bys"; + meta.description = "Generation of comparison functions from types"; + propagatedBuildInputs = [ ppxlib ]; + }; + + ppx_assert = janePackage { + pname = "ppx_assert"; + hash = "0as6mzr6ki2a9d4k6132p9dskn0qssla1s7j5rkzp75bfikd0ip8"; + meta.description = "Assert-like extension nodes that raise useful errors on failure"; + propagatedBuildInputs = [ ppx_compare ppx_here ppx_sexp_conv ]; + }; + + ppx_inline_test = janePackage { + pname = "ppx_inline_test"; + hash = "0nyz411zim94pzbxm2l2v2l9jishcxwvxhh142792g2s18r4vn50"; + meta.description = "Syntax extension for writing in-line tests in ocaml code"; + propagatedBuildInputs = [ ppxlib ]; + }; + + ppx_custom_printf = janePackage { + pname = "ppx_custom_printf"; + version = "0.12.1"; + hash = "0q7591agvd3qy9ihhbyk4db48r0ng7yxspfj8afxxiawl7k5bas6"; + meta.description = "Printf-style format-strings for user-defined string conversion"; + propagatedBuildInputs = [ ppx_sexp_conv ]; + }; + + fieldslib = janePackage { + pname = "fieldslib"; + hash = "0dlgr7cimqmjlcymk3bdcyzqzvdy12q5lqa844nqix0k2ymhyphf"; + meta.description = "Syntax extension to define first class values representing record fields, to get and set record fields, iterate and fold over all fields of a record and create new record values"; + propagatedBuildInputs = [ base ]; + }; + + ppx_fields_conv = janePackage { + pname = "ppx_fields_conv"; + hash = "0flrdyxdfcqcmdrbipxdjq0s3djdgs7z5pvjdycsvs6czbixz70v"; + meta.description = "Generation of accessor and iteration functions for ocaml records"; + propagatedBuildInputs = [ fieldslib ppxlib ]; + }; + + variantslib = janePackage { + pname = "variantslib"; + hash = "1cclb5magk63gyqmkci8abhs05g2pyhyr60a2c1bvmig0faqcnsf"; + meta.description = "Part of Jane Street's Core library"; + propagatedBuildInputs = [ base ]; + }; + + ppx_variants_conv = janePackage { + pname = "ppx_variants_conv"; + hash = "05j9bgra8xq6fcp12ch3z9vjrk139p2wrcjjcs4h52n5hhc8vzbz"; + meta.description = "Generation of accessor and iteration functions for ocaml variant types"; + propagatedBuildInputs = [ variantslib ppxlib ]; + }; + + ppx_expect = janePackage { + pname = "ppx_expect"; + hash = "1wawsbjfkri4sw52n8xqrzihxc3xfpdicv3ahz83a1rsn4lb8j5q"; + meta.description = "Cram like framework for OCaml"; + propagatedBuildInputs = [ ppx_assert ppx_custom_printf ppx_fields_conv ppx_inline_test ppx_variants_conv re ]; + }; + + ppx_enumerate = janePackage { + pname = "ppx_enumerate"; + hash = "08zfpq6bdm5lh7xj9k72iz9f2ihv3aznl3nypw3x78vz1chj8dqa"; + meta.description = "Generate a list containing all values of a finite type"; + propagatedBuildInputs = [ ppxlib ]; + }; + + ppx_hash = janePackage { + pname = "ppx_hash"; + hash = "1dfsfvhiyp1mnf24mr93svpdn432kla0y7x631lssacxxp2sadbg"; + meta.description = "A ppx rewriter that generates hash functions from type expressions and definitions"; + propagatedBuildInputs = [ ppx_compare ppx_sexp_conv ]; + }; + + ppx_js_style = janePackage { + pname = "ppx_js_style"; + hash = "1lz931m3qdv3yzqy6dnb8fq1d99r61w0n7cwf3b9fl9rhk0pggwh"; + meta.description = "Code style checker for Jane Street Packages"; + propagatedBuildInputs = [ octavius ppxlib ]; + }; + + ppx_base = janePackage { + pname = "ppx_base"; + hash = "0vd96rp2l084iamkwmvizzhl9625cagjb6gzzbir06czii5mlq2p"; + meta.description = "Base set of ppx rewriters"; + propagatedBuildInputs = [ ppx_enumerate ppx_hash ppx_js_style ]; + }; + + ppx_bench = janePackage { + pname = "ppx_bench"; + hash = "1ib81irawxzq091bmpi50z0kmpx6z2drg14k2xcgmwbb1d4063xn"; + meta.description = "Syntax extension for writing in-line benchmarks in ocaml code"; + propagatedBuildInputs = [ ppx_inline_test ]; + }; + + ppx_sexp_message = janePackage { + pname = "ppx_sexp_message"; + hash = "0yskd6v48jc6wa0nhg685kylh1n9qb6b7d1wglr9wnhl9sw990mc"; + meta.description = "A ppx rewriter for easy construction of s-expressions"; + propagatedBuildInputs = [ ppx_here ppx_sexp_conv ]; + }; + + splittable_random = janePackage { + pname = "splittable_random"; + hash = "1wpyz7807cgj8b50gdx4rw6f1zsznp4ni5lzjbnqdwa66na6ynr4"; + meta.description = "PRNG that can be split into independent streams"; + propagatedBuildInputs = [ base ppx_assert ppx_bench ppx_sexp_message ]; + }; + + ppx_let = janePackage { + pname = "ppx_let"; + hash = "146dmyzkbmafa3giz69gpxccvdihg19cvk4xsg8krbbmlkvdda22"; + meta.description = "Monadic let-bindings"; + propagatedBuildInputs = [ ppxlib ]; + }; + + base_quickcheck = janePackage { + pname = "base_quickcheck"; + hash = "1la6qgq1zwmfyq1hqy6i337w435ym5yqgx2ygk86qip6nws0s6r3"; + meta.description = "Randomized testing framework, designed for compatibility with Base"; + propagatedBuildInputs = [ ppx_base ppx_fields_conv ppx_let splittable_random ]; + }; + + ppx_stable = janePackage { + pname = "ppx_stable"; + hash = "15zvf66wlkvz0yd4bkvndkpq74dj20jv1qkljp9n52hh7d0f9ykh"; + meta.description = "Stable types conversions generator"; + propagatedBuildInputs = [ ppxlib ]; + }; + + bin_prot = janePackage { + pname = "bin_prot"; + hash = "0hh6s7g9s004z35hsr8z6nw5phlcvcd6g2q3bj4f0s1s0anlsswm"; + meta.description = "A binary protocol generator"; + propagatedBuildInputs = [ ppx_compare ppx_custom_printf ppx_fields_conv ppx_variants_conv ]; + }; + + ppx_bin_prot = janePackage { + pname = "ppx_bin_prot"; + version = "0.12.1"; + hash = "1j0kjgmv58dmg3x5dj5zrfbm920rwq21lvkkaqq493y76cd0x8xg"; + meta.description = "Generation of bin_prot readers and writers from types"; + propagatedBuildInputs = [ bin_prot ppx_here ]; + }; + + ppx_fail = janePackage { + pname = "ppx_fail"; + hash = "0krsv6z9gi0ifxmw5ss6gwn108qhywyhbs41an10x9d5zpgf4l1n"; + meta.description = "Add location to calls to failwiths"; + propagatedBuildInputs = [ ppx_here ]; + }; + + jst-config = janePackage { + pname = "jst-config"; + hash = "0yxcz13vda1mdh9ah7qqxwfxpcqang5sgdssd8721rszbwqqaw93"; + meta.description = "Compile-time configuration for Jane Street libraries"; + buildInputs = [ dune_1 ppx_assert ]; + }; + + ppx_optcomp = janePackage { + pname = "ppx_optcomp"; + hash = "0bdbx01kz0174g1szdhv3mcfqxqqf2frxq7hk13xaf6fsz04kwmj"; + meta.description = "Optional compilation for OCaml"; + propagatedBuildInputs = [ ppxlib ]; + }; + + jane-street-headers = janePackage { + pname = "jane-street-headers"; + hash = "0qa4llf812rjqa8nb63snmy8d8ny91p3anwhb50afb7vjaby8m34"; + meta.description = "Jane Street C header files"; + }; + + time_now = janePackage { + pname = "time_now"; + hash = "169mgsb3rja4j1j9nj5xa7bbkd21p9kfpskqz0wjf9x2fpxqsniq"; + meta.description = "Reports the current time"; + buildInputs = [ jst-config ppx_optcomp ]; + propagatedBuildInputs = [ jane-street-headers base ppx_base ]; + }; + + ppx_module_timer = janePackage { + pname = "ppx_module_timer"; + hash = "0yziakm7f4c894na76k1z4bp7azy82xc33mh36fj761w1j9zy3wm"; + meta.description = "Ppx rewriter that records top-level module startup times"; + propagatedBuildInputs = [ time_now ]; + }; + + ppx_optional = janePackage { + pname = "ppx_optional"; + hash = "07i0iipbd5xw2bc604qkwlcxmhncfpm3xmrr6svyj2ij86pyssh8"; + meta.description = "Pattern matching on flat options"; + propagatedBuildInputs = [ ppxlib ]; + }; + + ppx_pipebang = janePackage { + pname = "ppx_pipebang"; + hash = "1p4pdpl8h2bblbhpn5nk17ri4rxpz0aih0gffg3cl1186irkj0xj"; + meta.description = "A ppx rewriter that inlines reverse application operators `|>` and `|!`"; + propagatedBuildInputs = [ ppxlib ]; + }; + + ppx_sexp_value = janePackage { + pname = "ppx_sexp_value"; + hash = "1mg81834a6dx1x7x9zb9wc58438cabjjw08yhkx6i386hxfy891p"; + meta.description = "A ppx rewriter that simplifies building s-expressions from ocaml values"; + propagatedBuildInputs = [ ppx_here ppx_sexp_conv ]; + }; + + typerep = janePackage { + pname = "typerep"; + hash = "1psl6gsk06a62szh60y5sc1s92xpmrl1wpw3rhha09v884b7arbc"; + meta.description = "Typerep is a library for runtime types"; + propagatedBuildInputs = [ base ]; + }; + + ppx_typerep_conv = janePackage { + pname = "ppx_typerep_conv"; + hash = "09vik6qma1id44k8nz87y48l9wbjhqhap1ar1hpfdfkjai1hrzzq"; + meta.description = "Generation of runtime types from type declarations"; + propagatedBuildInputs = [ ppxlib typerep ]; + }; + + ppx_jane = janePackage { + pname = "ppx_jane"; + hash = "1a2602isqzsh640q20qbmarx0sc316mlsqc3i25ysv2kdyhh0kyw"; + meta.description = "Standard Jane Street ppx rewriters"; + propagatedBuildInputs = [ base_quickcheck ppx_bench ppx_bin_prot ppx_expect ppx_fail ppx_module_timer ppx_optcomp ppx_optional ppx_pipebang ppx_sexp_value ppx_stable ppx_typerep_conv ]; + }; + + base_bigstring = janePackage { + pname = "base_bigstring"; + hash = "0rbgyg511847fbnxad40prz2dyp4da6sffzyzl88j18cxqxbh1by"; + meta.description = "String type based on [Bigarray], for use in I/O and C-bindings"; + propagatedBuildInputs = [ ppx_jane ]; + }; + + parsexp = janePackage { + pname = "parsexp"; + hash = "1974i9s2c2n03iffxrm6ncwbd2gg6j6avz5jsxfd35scc2zxcd4l"; + meta.description = "S-expression parsing library"; + propagatedBuildInputs = [ base sexplib0 ]; + }; + + sexplib = janePackage { + pname = "sexplib"; + hash = "0780klc5nnv0ij6aklzra517cfnfkjdlp8ylwjrqwr8dl9rvxza2"; + meta.description = "Library for serializing OCaml values to and from S-expressions"; + propagatedBuildInputs = [ num parsexp ]; + }; + + core_kernel = janePackage { + pname = "core_kernel"; + version = "0.12.2"; + hash = "0c85bjvadrb4pmjcg0gjk3bkkgka62r90pjm690mjvcbbv5zjxzj"; + meta.description = "System-independent part of Core"; + buildInputs = [ jst-config ]; + propagatedBuildInputs = [ base_bigstring sexplib ]; + }; + + spawn = janePackage { + pname = "spawn"; + version = "0.13.0"; + hash = "1w003k1kw1lmyiqlk58gkxx8rac7dchiqlz6ah7aj7bh49b36ppf"; + meta.description = "Spawning sub-processes"; + buildInputs = [ ppx_expect ]; + }; + + core = janePackage { + pname = "core"; + version = "0.12.3"; + hash = "1vmjqiafkg45hqfvahx6jnlaww1q4a4215k8znbgprf0qn3zymnj"; + meta.description = "System-independent part of Core"; + buildInputs = [ jst-config ]; + propagatedBuildInputs = [ core_kernel spawn ]; + }; + + async_kernel = janePackage { + pname = "async_kernel"; + hash = "1d9illx7vvpblj1i2r9y0f2yff2fbhy3rp4hhvamq1n9n3lvxmh2"; + meta.description = "Monadic concurrency library"; + propagatedBuildInputs = [ core_kernel ]; + }; + + protocol_version_header = janePackage { + pname = "protocol_version_header"; + hash = "14vqhx3r84rlfhcjq52gxdqksckiaswlck9s47g7y2z1lsc17v7r"; + meta.description = "Protocol versioning"; + propagatedBuildInputs = [ core_kernel ]; + }; + + async_rpc_kernel = janePackage { + pname = "async_rpc_kernel"; + hash = "1znhqbzx4fp58i7dbcgyv5rx7difbhb5d8cbqzv96yqvbn67lsjk"; + meta.description = "Platform-independent core of Async RPC library"; + propagatedBuildInputs = [ async_kernel protocol_version_header ]; + }; + + async_unix = janePackage { + pname = "async_unix"; + hash = "09h10rdyykbm88n6r9nb5a22mlb6vcxa04q6hvrcr0kys6qhhqmb"; + meta.description = "Monadic concurrency library"; + propagatedBuildInputs = [ async_kernel core ]; + }; + + async_extra = janePackage { + pname = "async_extra"; + hash = "10j4mwlyqvf67yrp5dwd857llqjinpnnykmlzw2gpmks9azxk6mh"; + meta.description = "Monadic concurrency library"; + propagatedBuildInputs = [ async_rpc_kernel async_unix ]; + }; + + textutils = janePackage { + pname = "textutils"; + hash = "0302awqihf3abib9mvzvn4g8m364hm6jxry1r3kc01hzybhy9acq"; + meta.description = "Text output utilities"; + propagatedBuildInputs = [ core ]; + }; + + async = janePackage { + pname = "async"; + hash = "0pk7z3h2gi21nfchvmjz2wx516bynf9vgwf84zf5qhvlvqqsmyrx"; + meta.description = "Monadic concurrency library"; + propagatedBuildInputs = [ async_extra textutils ]; + }; + + async_ssl = janePackage { + pname = "async_ssl"; + hash = "02ard8x5q5c42d9jdqmyzfx624yjq8cxxmvq3zb82hf6p8cc57ml"; + meta = { + description = "An Async-pipe-based interface with OpenSSL"; + # ctypes no longer works with dune 1 + # dune 2 no longer supports jbuild + broken = true; + }; + propagatedBuildInputs = [ async ctypes openssl ]; + }; + + async_find = janePackage { + pname = "async_find"; + hash = "0qsz9f15s5rlk6za10s810v6nlkdxg2g9p1827lcpa7nhjcpi673"; + meta.description = "Directory traversal with Async"; + propagatedBuildInputs = [ async ]; + }; + + re2 = janePackage { + pname = "re2"; + hash = "1sw32lb0y501y971ij7287796lvfhs0nfgla895r74ymfks2rcjb"; + meta.description = "OCaml bindings for RE2, Google's regular expression library"; + propagatedBuildInputs = [ core_kernel ]; + prePatch = '' + substituteInPlace src/re2_c/dune --replace 'CXX=g++' 'CXX=c++' + substituteInPlace src/dune --replace '(cxx_flags (:standard \ -pedantic) (-I re2_c/libre2))' '(cxx_flags (:standard \ -pedantic) (-I re2_c/libre2) (-x c++))' + ''; + }; + + shell = janePackage { + pname = "shell"; + hash = "158857rdr6qgglc5iksg0l54jgf51b5lmsw7nlazpxwdwc9fcn5n"; + meta.description = "Yet another implementation of fork&exec and related functionality"; + buildInputs = [ jst-config ]; + propagatedBuildInputs = [ re2 textutils ]; + }; + + async_shell = janePackage { + pname = "async_shell"; + hash = "0cxln9hkc3cy522la9yi9p23qjwl69kqmadsq4lnjh5bxdad06sv"; + meta.description = "Shell helpers for Async"; + propagatedBuildInputs = [ async shell ]; + }; + + core_bench = janePackage { + pname = "core_bench"; + hash = "00hyzbbj19dkcw0vhfnc8w0ca3zkjriwwvl00ssa0a2g9mygijdm"; + meta.description = "Benchmarking library"; + propagatedBuildInputs = [ textutils ]; + }; + + core_extended = janePackage { + pname = "core_extended"; + hash = "1gwx66235irpf5krb1r25a3c7w52qhmass8hp7rdv89il9jn49w4"; + meta.description = "Extra components that are not as closely vetted or as stable as Core"; + propagatedBuildInputs = [ core ]; + }; + + sexp_pretty = janePackage { + pname = "sexp_pretty"; + hash = "06hdsaszc5cd7fphiblbn4r1sh36xgjwf2igzr2rvlzqs7jiv2v4"; + meta.description = "S-expression pretty-printer"; + propagatedBuildInputs = [ ppx_base re sexplib ]; + }; + + expect_test_helpers_kernel = janePackage { + pname = "expect_test_helpers_kernel"; + hash = "18ya187y2i2hfxr771sd9vy5jdsa30vhs56yjdhwk06v01b2fzbq"; + meta.description = "Helpers for writing expectation tests"; + buildInputs = [ ppx_jane ]; + propagatedBuildInputs = [ core_kernel sexp_pretty ]; + }; + + expect_test_helpers = janePackage { + pname = "expect_test_helpers"; + hash = "0ixqck2lnsmz107yw0q2sr8va80skjpldx7lz4ymjiq2vsghk0rb"; + meta.description = "Async helpers for writing expectation tests"; + propagatedBuildInputs = [ async expect_test_helpers_kernel ]; + }; + + patience_diff = janePackage { + pname = "patience_diff"; + hash = "055kd3piadjnplip8c8q99ssh79d4irmhg2wng7aida5pbqp2p9f"; + meta.description = "Diff library using Bram Cohen's patience diff algorithm"; + propagatedBuildInputs = [ core_kernel ]; + }; + + ecaml = janePackage { + pname = "ecaml"; + hash = "0n9xi6agc3lgyj2nsi10cbif0xwn57xyaranad9r285rmbxrgjh7"; + meta.description = "Library for writing Emacs plugin in OCaml"; + propagatedBuildInputs = [ async expect_test_helpers_kernel ]; + }; + + ### Packages at version 0.11, with dependencies at version 0.12 + + configurator = janePackage { + pname = "configurator"; + version = "0.11.0"; + hash = "0h686630cscav7pil8c3w0gbh6rj4b41dvbnwmicmlkc746q5bfk"; + propagatedBuildInputs = [ stdio ]; + meta.description = "Helper library for gathering system configuration"; + }; + + ppx_core = janePackage { + pname = "ppx_core"; + version = "0.11.0"; + hash = "11hgm9mxig4cm3c827f6dns9mjv3pf8g6skf10x0gw9xnp1dmzmx"; + propagatedBuildInputs = [ ppxlib ]; + meta.description = "Deprecated (see ppxlib)"; + }; + + ppx_driver = janePackage { + pname = "ppx_driver"; + version = "0.11.0"; + hash = "00kfx6js2kxk57k4v7hiqvwk7h35whgjihnxf75m82rnaf4yzvfi"; + propagatedBuildInputs = [ ppxlib ]; + meta.description = "Deprecated (see ppxlib)"; + }; + + ppx_type_conv = janePackage { + pname = "ppx_type_conv"; + version = "0.11.0"; + hash = "04dbrglqqhkas25cpjz8xhjcbpk141c35qggzw66bn69izczfmaf"; + propagatedBuildInputs = [ ppxlib ]; + meta.description = "Deprecated (see ppxlib)"; + }; + +} diff --git a/pkgs/development/ocaml-modules/janestreet/0.14.nix b/pkgs/development/ocaml-modules/janestreet/0.14.nix new file mode 100644 index 00000000000..2f9aeea1d62 --- /dev/null +++ b/pkgs/development/ocaml-modules/janestreet/0.14.nix @@ -0,0 +1,888 @@ +{ self +, fetchpatch +, lib +, openssl +, zstd +}: + +with self; + +{ + + accessor = janePackage { + pname = "accessor"; + version = "0.14.1"; + minimumOCamlVersion = "4.09"; + hash = "0wm2081kzd5zsqs516cn3f975bnnmnyynv8fa818gmfa65i6mxm8"; + meta.description = "A library that makes it nicer to work with nested functional data structures"; + propagatedBuildInputs = [ higher_kinded ]; + }; + + accessor_async = janePackage { + pname = "accessor_async"; + version = "0.14.1"; + minimumOCamlVersion = "4.09"; + hash = "1193hzvlzm7vcl9p67fs8al2pvkw9n2wz009m2l3lp35mrx8aq1w"; + meta.description = "Accessors for Async types, for use with the Accessor library"; + propagatedBuildInputs = [ accessor_core async_kernel ]; + }; + + accessor_base = janePackage { + pname = "accessor_base"; + version = "0.14.1"; + minimumOCamlVersion = "4.09"; + hash = "1xjbvvijkyw4dlys47x4896y3kqm2zn0yg60cqrp57i2dwxg0nsj"; + meta.description = "Accessors for Base types, for use with the Accessor library"; + propagatedBuildInputs = [ ppx_accessor ]; + }; + + accessor_core = janePackage { + minimumOCamlVersion = "4.09"; + pname = "accessor_core"; + version = "0.14.1"; + hash = "1cdkv34m6czhacivpbb2sasj83fgcid6gnqk30ig9i84z8nh2gw2"; + meta.description = "Accessors for Core types, for use with the Accessor library"; + meta.broken = true; # Not compatible with ppxlib ≥ 0.23 + propagatedBuildInputs = [ accessor_base core_kernel ]; + }; + + async = janePackage { + pname = "async"; + hash = "086v93div4h9l02n7wzv3xx3i6xvddazydm9qlfa72ad55x3vzy0"; + meta.description = "Monadic concurrency library"; + propagatedBuildInputs = [ async_rpc_kernel async_unix textutils ]; + doCheck = false; # we don't have netkit_sockets + }; + + async_extra = janePackage { + pname = "async_extra"; + hash = "16cnz9h4jkc3b0837s5z0iv92q7n5nw77g8qshq8pwq639y8ail4"; + meta.description = "Monadic concurrency library"; + propagatedBuildInputs = [ async_kernel ]; + }; + + async_find = janePackage { + pname = "async_find"; + hash = "0vlcpdr15bgrwrmixvs6ij88kvk8vzzrijz3zm0svxih0naf8ylx"; + meta.description = "Directory traversal with Async"; + propagatedBuildInputs = [ async ]; + }; + + async_inotify = janePackage { + pname = "async_inotify"; + hash = "0i0hf7nsir316ijixdj43qf0p3b6yapvcm2jzp7bhpf4r2kxislv"; + meta.description = "Async wrapper for inotify"; + propagatedBuildInputs = [ async_find inotify ]; + }; + + async_interactive = janePackage { + pname = "async_interactive"; + hash = "1cnmv9mipa6k6xd303ngdbxmiab2202f3w3pgq8l1970w8hb78il"; + meta.description = "Utilities for building simple command-line based user interfaces"; + propagatedBuildInputs = [ async ]; + }; + + async_js = janePackage { + pname = "async_js"; + hash = "0rld8792lfwbinn9rhrgacivz49vppgy29smpqnvpga89wchjv0v"; + meta.description = "A small library that provide Async support for JavaScript platforms"; + buildInputs = [ js_of_ocaml-ppx ]; + propagatedBuildInputs = [ async_rpc_kernel js_of_ocaml uri-sexp ]; + }; + + async_kernel = janePackage { + pname = "async_kernel"; + hash = "17giakwl0xhyxvxrkn12dwjdghc53q8px81z7cc3k6f102bsbdy6"; + meta.description = "Monadic concurrency library"; + propagatedBuildInputs = [ core_kernel ]; + }; + + async_rpc_kernel = janePackage { + pname = "async_rpc_kernel"; + hash = "1bwq3gkq057dd1fhrqz9kqq8a956nn87zaxvr0qcpiczzjv3zmvm"; + meta.description = "Platform-independent core of Async RPC library"; + propagatedBuildInputs = [ async_kernel protocol_version_header ]; + }; + + async_sendfile = janePackage { + pname = "async_sendfile"; + hash = "1w3gwwpgfzqjhblxnxh64g64q6kgjzzxx90inswfhycc88pnvdna"; + meta.description = "Thin wrapper around [Linux_ext.sendfile] to send full files"; + propagatedBuildInputs = [ async_unix ]; + }; + + async_shell = janePackage { + pname = "async_shell"; + hash = "1r00z620nqv2jxz2xrp2gsyc30h8dd2w9qsnys2fkqbgpxlbgdc7"; + meta.description = "Shell helpers for Async"; + propagatedBuildInputs = [ async shell ]; + }; + + async_smtp = janePackage { + pname = "async_smtp"; + hash = "1xf3illn7vikdxldpnc29n4z8sv9f0wsdgdvl4iv93qlvjk8gzck"; + meta.description = "SMTP client and server"; + propagatedBuildInputs = [ async_extra async_inotify async_sendfile async_shell async_ssl email_message resource_cache re2_stable sexp_macro ]; + }; + + async_ssl = janePackage { + pname = "async_ssl"; + hash = "0ykys3ckpsx5crfgj26v2q3gy6wf684aq0bfb4q8p92ivwznvlzy"; + meta.description = "Async wrappers for SSL"; + buildInputs = [ dune-configurator ]; + propagatedBuildInputs = [ async ctypes openssl ]; + # in ctypes.foreign 0.18.0 threaded and unthreaded have been merged + postPatch = '' + substituteInPlace bindings/dune \ + --replace "ctypes.foreign.threaded" "ctypes.foreign" + ''; + }; + + async_unix = janePackage { + pname = "async_unix"; + hash = "1wgnr0vdsknqrfnf6irmwnvyngndsnvvl1sfnj3v6fhwk4nswnrs"; + meta.description = "Monadic concurrency library"; + propagatedBuildInputs = [ async_kernel core ]; + }; + + base = janePackage { + pname = "base"; + version = "0.14.1"; + hash = "1hizjxmiqlj2zzkwplzjamw9rbnl0kh44sxgjpzdij99qnfkzylf"; + minimumOCamlVersion = "4.07"; + meta.description = "Full standard library replacement for OCaml"; + buildInputs = [ dune-configurator ]; + propagatedBuildInputs = [ sexplib0 ]; + checkInputs = [ alcotest ]; + }; + + base_bigstring = janePackage { + pname = "base_bigstring"; + hash = "1ald2m7qywhxbygv58dzpgaj54p38zn0aiqd1z7i95kf3bsnsjqa"; + minimumOCamlVersion = "4.07"; + meta.description = "String type based on [Bigarray], for use in I/O and C-bindings"; + propagatedBuildInputs = [ ppx_jane ]; + }; + + base_quickcheck = janePackage { + pname = "base_quickcheck"; + version = "0.14.1"; + hash = "0apq3d9xb0zdaqsl4cjk5skyig57ff1plndb2mh0nn3czvfhifxs"; + minimumOCamlVersion = "4.04.2"; + meta.description = "Randomized testing framework, designed for compatibility with Base"; + propagatedBuildInputs = [ ppx_base ppx_fields_conv ppx_let ppx_sexp_value splittable_random ]; + }; + + bignum = janePackage { + pname = "bignum"; + hash = "009ygr64q810p9iq4mykzz4ci00i5mzgpmq35jiyaiqm27bjam21"; + propagatedBuildInputs = [ core_kernel zarith zarith_stubs_js ]; + meta.description = "Core-flavoured wrapper around zarith's arbitrary-precision rationals"; + }; + + bin_prot = janePackage { + pname = "bin_prot"; + hash = "1qyqbfp4zdc2jb87370cdgancisqffhf9x60zgh2m31kqik8annr"; + minimumOCamlVersion = "4.04.2"; + meta.description = "A binary protocol generator"; + propagatedBuildInputs = [ ppx_compare ppx_custom_printf ppx_fields_conv ppx_optcomp ppx_variants_conv ]; + }; + + bonsai = janePackage { + pname = "bonsai"; + hash = "0k4grabwqc9sy4shzp77bgfvyajvvc0l8qq89ia7cvlwvly7gv6a"; + meta.description = "A library for building dynamic webapps, using Js_of_ocaml"; + buildInputs = [ ppx_pattern_bind ]; + propagatedBuildInputs = [ incr_dom ]; + }; + + cinaps = janePackage { + pname = "cinaps"; + hash = "0ms1j2kh7i5slyw9v4w9kdz52dkwl5gqcnvn89prgimhk2vmichj"; + minimumOCamlVersion = "4.07"; + meta.description = "Trivial metaprogramming tool"; + propagatedBuildInputs = [ re ]; + checkInputs = [ ppx_jane ]; + # This currently fails with dune + strictDeps = false; + }; + + core = janePackage { + pname = "core"; + version = "0.14.1"; + hash = "1isrcl07nkmdm6akqsqs9z8s6zvva2lvg47kaagy7gsbyszrqb82"; + meta.description = "System-independent part of Core"; + buildInputs = [ jst-config ]; + propagatedBuildInputs = [ core_kernel spawn timezone ]; + doCheck = false; # we don't have quickcheck_deprecated + }; + + core_bench = janePackage { + pname = "core_bench"; + hash = "04h6hzxk347pqyrrbgqrw9576sq4yf70fgq9xam3kajrqwdh3dhx"; + meta.description = "Benchmarking library"; + propagatedBuildInputs = [ textutils ]; + }; + + core_extended = janePackage { + pname = "core_extended"; + hash = "1pbm6xbc3h0fhrymyr1yb9b1jk7n88gfi3pylqz2cs8haxr2pb3a"; + meta.description = "Extra components that are not as closely vetted or as stable as Core"; + propagatedBuildInputs = [ core ]; + }; + + core_kernel = janePackage { + pname = "core_kernel"; + version = "0.14.1"; + hash = "0pikg4ln6177gbs0jfix7xj50zlcm7058h64lxnd7wspnj7mq8sd"; + meta.description = "System-independent part of Core"; + buildInputs = [ jst-config ]; + propagatedBuildInputs = [ base_bigstring sexplib ]; + doCheck = false; # we don't have quickcheck_deprecated + }; + + csvfields = janePackage { + pname = "csvfields"; + hash = "09jmz6y6nwd96dcx6g8ydicxssi72v1ks276phbc9n19wwg9hkaz"; + propagatedBuildInputs = [ core num ]; + meta.description = "Runtime support for ppx_xml_conv and ppx_csv_conv"; + }; + + delimited_parsing = janePackage { + pname = "delimited_parsing"; + hash = "1dnr5wqacryx1kj38i9iifc3457pchr887xphzz2nhlbizq3d7qa"; + propagatedBuildInputs = [ async core_extended ]; + meta.description = "Parsing of character (e.g., comma) separated and fixed-width values"; + }; + + ecaml = janePackage { + pname = "ecaml"; + hash = "052qglpwzrx3c4gy3zr6dmsmfbi5gj4fs2jhx9yrsqb9hj8g36mj"; + meta.description = "Library for writing Emacs plugin in OCaml"; + propagatedBuildInputs = [ async expect_test_helpers_core ]; + }; + + email_message = janePackage { + pname = "email_message"; + hash = "0k8hjkq91ikl7wjxs04k523jbkhl6q4abj6v0lzlbjiybmrpp69n"; + meta.description = "E-mail message parser"; + propagatedBuildInputs = [ angstrom async base64 cryptokit magic-mime re2 ]; + }; + + expect_test_helpers_async = janePackage { + pname = "expect_test_helpers_async"; + hash = "175sjkx3b10d8vacp369rv53nxbiaxw1xhwy832g7ffk1by8l2m1"; + meta.description = "Async helpers for writing expectation tests"; + propagatedBuildInputs = [ async expect_test_helpers_core ]; + }; + + expect_test_helpers_core = janePackage { + pname = "expect_test_helpers_core"; + hash = "1drl15akp4jz4wf26dr2y2nblvnhz14xsnb3ai8dg45y711svs2i"; + meta.description = "Helpers for writing expectation tests"; + propagatedBuildInputs = [ core_kernel sexp_pretty ]; + }; + + fieldslib = janePackage { + pname = "fieldslib"; + hash = "0nxx35lrb4f6zfs5l80a7cg7azf19c6g31vn9qjjpaxf6lgkck2n"; + minimumOCamlVersion = "4.04.2"; + meta.description = "Syntax extension to define first class values representing record fields, to get and set record fields, iterate and fold over all fields of a record and create new record values"; + propagatedBuildInputs = [ base ]; + }; + + higher_kinded = janePackage { + pname = "higher_kinded"; + version = "0.14.1"; + minimumOCamlVersion = "4.09"; + hash = "05jvxgqsx3j2v8rqpd91ah76dgc1q2dz38kjklmx0vms4r4gvlsx"; + meta.description = "A library with an encoding of higher kinded types in OCaml"; + propagatedBuildInputs = [ base ppx_jane ]; + }; + + incr_dom = janePackage { + pname = "incr_dom"; + hash = "0mi98cwi4npdh5vvcz0pb4sbb9j9dydl52s51rswwc3kn8mipxfx"; + meta.description = "A library for building dynamic webapps, using Js_of_ocaml"; + buildInputs = [ js_of_ocaml-ppx ]; + propagatedBuildInputs = [ async_js incr_map incr_select virtual_dom ]; + }; + + incr_map = janePackage { + pname = "incr_map"; + hash = "0s0s7qfydvvvnqby4v5by5jdnd5kxqsdr65mhm11w4fn125skryz"; + meta.description = "Helpers for incremental operations on map like data structures"; + buildInputs = [ ppx_pattern_bind ]; + propagatedBuildInputs = [ incremental ]; + }; + + incr_select = janePackage { + pname = "incr_select"; + hash = "18ril6z57mw89gzc9zhz6p1phwm1xr6phppicvqpqmi0skvvnrg6"; + meta.description = "Handling of large set of incremental outputs from a single input"; + propagatedBuildInputs = [ incremental ]; + }; + + incremental = janePackage { + pname = "incremental"; + hash = "0nyaiy7r2spvn2ij9z5rghd5gbjk1y3ai4jn0i8q81arp7cf6zc7"; + meta.description = "Library for incremental computations"; + propagatedBuildInputs = [ core_kernel ]; + }; + + jane-street-headers = janePackage { + pname = "jane-street-headers"; + hash = "12n40mlgjnc09fxc0hp0npsxdlxja2w828683zpb32nrzqkg6z4c"; + minimumOCamlVersion = "4.04.2"; + meta.description = "Jane Street C header files"; + }; + + jst-config = janePackage { + pname = "jst-config"; + hash = "0hzw0crgj0kjxsvr10wng7gqy948v98hnijh30lgq3v62jdsjra8"; + meta.description = "Compile-time configuration for Jane Street libraries"; + buildInputs = [ dune-configurator ppx_assert stdio ]; + }; + + ocaml-compiler-libs = janePackage { + pname = "ocaml-compiler-libs"; + version = "0.12.3"; + minimumOCamlVersion = "4.04.1"; + hash = "00nrar7h2pyflbdiq6wwwrb4k5jh9iff0jllihzm6ms8d5pspsg5"; + meta.description = "OCaml compiler libraries repackaged"; + }; + + parsexp = janePackage { + pname = "parsexp"; + version = "0.14.1"; + hash = "1nr0ncb8l2mkk8pqzknr7fsqw5kpz8y102kyv5bc0x7c36v0d4zy"; + minimumOCamlVersion = "4.04.2"; + meta.description = "S-expression parsing library"; + propagatedBuildInputs = [ base sexplib0 ]; + }; + + patience_diff = janePackage { + pname = "patience_diff"; + hash = "1np88s226ndhbwynpdqygrycahp8m1mx28f1xk54kvds8znnq2i0"; + meta.description = "Diff library using Bram Cohen's patience diff algorithm"; + propagatedBuildInputs = [ core_kernel ]; + }; + + posixat = janePackage { + pname = "posixat"; + hash = "0aana1lzq4514kna7hr301b5iv6gcg6zhgrx8s8vaad1q38yfp6c"; + minimumOCamlVersion = "4.07"; + propagatedBuildInputs = [ ppx_optcomp ppx_sexp_conv ]; + meta.description = "Binding to the posix *at functions"; + }; + + ppx_accessor = janePackage { + pname = "ppx_accessor"; + version = "0.14.3"; + minimumOCamlVersion = "4.09"; + hash = "sha256:1c8blzh2f34vbm1z3mnvh670c6vda70chw805n2hmkd9j46l0cll"; + meta.description = "[@@deriving] plugin to generate accessors for use with the Accessor libraries"; + propagatedBuildInputs = [ accessor ]; + }; + + ppx_assert = janePackage { + pname = "ppx_assert"; + hash = "03mzgm4smrczp5dg3mpr6zc2v6a54n0r01k4ww820yrr25hcf8ip"; + minimumOCamlVersion = "4.04.2"; + meta.description = "Assert-like extension nodes that raise useful errors on failure"; + propagatedBuildInputs = [ ppx_cold ppx_compare ppx_here ppx_sexp_conv ]; + }; + + ppx_base = janePackage { + pname = "ppx_base"; + hash = "1wv3q0qyghm0c5izq03y97lv3czqk116059mg62wx6valn22a000"; + minimumOCamlVersion = "4.04.2"; + meta.description = "Base set of ppx rewriters"; + propagatedBuildInputs = [ ppx_cold ppx_enumerate ppx_hash ppx_js_style ]; + }; + + ppx_bench = janePackage { + pname = "ppx_bench"; + version = "0.14.1"; + hash = "12r7jgqgpb4i4cry3rgyl2nmxcscs5w7mmk06diz7i49r27p96im"; + minimumOCamlVersion = "4.04.2"; + meta.description = "Syntax extension for writing in-line benchmarks in ocaml code"; + propagatedBuildInputs = [ ppx_inline_test ]; + }; + + ppx_bin_prot = janePackage { + pname = "ppx_bin_prot"; + hash = "1qryjxhyz3kn5jz5wm62j59lhjhd1mp7nbsj0np9qnbpapnnr1zg"; + minimumOCamlVersion = "4.04.2"; + meta.description = "Generation of bin_prot readers and writers from types"; + propagatedBuildInputs = [ bin_prot ppx_here ]; + doCheck = false; # circular dependency with ppx_jane + }; + + ppx_cold = janePackage { + pname = "ppx_cold"; + hash = "0ciqs6f9ab73gq4krj14xzzba4ydcxph214m87i1s0xp25hwxr8v"; + minimumOCamlVersion = "4.04.2"; + meta.description = "Expands [@cold] into [@inline never][@specialise never][@local never]"; + propagatedBuildInputs = [ ppxlib ]; + }; + + ppx_compare = janePackage { + pname = "ppx_compare"; + hash = "11pj76dimx2f7l8m85myzp6yzx9xcg0bqi97s7ayssvkckm57390"; + minimumOCamlVersion = "4.04.2"; + meta.description = "Generation of comparison functions from types"; + propagatedBuildInputs = [ ppxlib base ]; + doCheck = false; # test build rule broken + }; + + ppx_custom_printf = janePackage { + pname = "ppx_custom_printf"; + version = "0.14.1"; + hash = "0c1m65kn27zvwmfwy7kk46ga76yw2a3ik9jygpy1b6nn6pi026w9"; + minimumOCamlVersion = "4.04.2"; + meta.description = "Printf-style format-strings for user-defined string conversion"; + propagatedBuildInputs = [ ppx_sexp_conv ]; + }; + + ppx_enumerate = janePackage { + pname = "ppx_enumerate"; + hash = "1sriid4vh10p80wwvn46v1g16m646qw5r5xzwlymyz5gbvq2zf40"; + minimumOCamlVersion = "4.04.2"; + meta.description = "Generate a list containing all values of a finite type"; + propagatedBuildInputs = [ ppxlib ]; + }; + + ppx_expect = janePackage { + pname = "ppx_expect"; + version = "0.14.1"; + hash = "0vbbnjrzpyk5p0js21lafr6fcp2wqka89p1876rdf472cmg0l7fv"; + minimumOCamlVersion = "4.04.2"; + meta.description = "Cram like framework for OCaml"; + propagatedBuildInputs = [ ppx_here ppx_inline_test re ]; + doCheck = false; # circular dependency with ppx_jane + }; + + ppx_fields_conv = janePackage { + pname = "ppx_fields_conv"; + version = "0.14.2"; + hash = "1zwirwqry24b48bg7d4yc845hvcirxyymzbw95aaxdcck84d30n8"; + minimumOCamlVersion = "4.04.2"; + meta.description = "Generation of accessor and iteration functions for ocaml records"; + propagatedBuildInputs = [ fieldslib ppxlib ]; + }; + + ppx_fixed_literal = janePackage { + pname = "ppx_fixed_literal"; + hash = "0s7rb4dhz4ibhh42a9sfxjj3zbwfyfmaihr92hpdv5j9xqn3n8mi"; + minimumOCamlVersion = "4.04.2"; + meta.description = "Simpler notation for fixed point literals"; + propagatedBuildInputs = [ ppxlib ]; + }; + + ppx_hash = janePackage { + pname = "ppx_hash"; + hash = "1zf03xdrg4jig7pdcrdpbabyjkdpifb31z2z1bf9wfdawybdhwkq"; + minimumOCamlVersion = "4.04.2"; + meta.description = "A ppx rewriter that generates hash functions from type expressions and definitions"; + propagatedBuildInputs = [ ppx_compare ppx_sexp_conv ]; + }; + + ppx_here = janePackage { + pname = "ppx_here"; + hash = "09zcyigaalqccs9s0h7n0535clgfmqb9s4p1jbgcqji9zj8w426s"; + minimumOCamlVersion = "4.04.2"; + meta.description = "Expands [%here] into its location"; + propagatedBuildInputs = [ ppxlib ]; + doCheck = false; # test build rules broken + }; + + ppx_inline_test = janePackage { + pname = "ppx_inline_test"; + version = "0.14.1"; + hash = "1ajdna1m9l1l3nfigyy33zkfa3yarfr6s086jdw2pcfwlq1fhhl4"; + minimumOCamlVersion = "4.04.2"; + meta.description = "Syntax extension for writing in-line tests in ocaml code"; + propagatedBuildInputs = [ ppxlib time_now ]; + doCheck = false; # test build rules broken + }; + + ppx_jane = janePackage { + pname = "ppx_jane"; + hash = "1kk238fvrcylymwm7xwc7llbyspmx1y662ypq00vy70g112rir7j"; + minimumOCamlVersion = "4.04.2"; + meta.description = "Standard Jane Street ppx rewriters"; + propagatedBuildInputs = [ base_quickcheck ppx_bin_prot ppx_expect ppx_fixed_literal ppx_module_timer ppx_optcomp ppx_optional ppx_pipebang ppx_stable ppx_string ppx_typerep_conv ppx_variants_conv ]; + }; + + ppx_js_style = janePackage { + pname = "ppx_js_style"; + version = "0.14.1"; + hash = "16ax6ww9h36xyn9acbm8zxv0ajs344sm37lgj2zd2bvgsqv24kxj"; + minimumOCamlVersion = "4.04.2"; + meta.description = "Code style checker for Jane Street Packages"; + propagatedBuildInputs = [ octavius ppxlib ]; + }; + + ppx_let = janePackage { + pname = "ppx_let"; + hash = "1jq3g88xv9g6y9im67hiig3cfn5anwwnq09mp7yn7a86ha5r9w3i"; + minimumOCamlVersion = "4.04.2"; + meta.description = "Monadic let-bindings"; + propagatedBuildInputs = [ ppxlib ]; + }; + + ppx_log = janePackage { + pname = "ppx_log"; + hash = "10hnr5lpww3fw0bnidzngalbgy0j1wvz1g5ki9c9h558pnpvsazr"; + minimumOCamlVersion = "4.08.0"; + meta.description = "Ppx_sexp_message-like extension nodes for lazily rendering log messages"; + propagatedBuildInputs = [ async_unix ppx_jane sexplib ]; + }; + + ppx_module_timer = janePackage { + pname = "ppx_module_timer"; + hash = "163q1rpblwv82fxwyf0p4j9zpsj0jzvkfmzb03r0l49gqhn89mp6"; + minimumOCamlVersion = "4.04.2"; + meta.description = "Ppx rewriter that records top-level module startup times"; + propagatedBuildInputs = [ time_now ]; + }; + + ppx_optcomp = janePackage { + pname = "ppx_optcomp"; + version = "0.14.3"; + hash = "1iflgfzs23asw3k6098v84al5zqx59rx2qjw0mhvk56avlx71pkw"; + minimumOCamlVersion = "4.04.2"; + meta.description = "Optional compilation for OCaml"; + propagatedBuildInputs = [ ppxlib ]; + }; + + ppx_optional = janePackage { + pname = "ppx_optional"; + hash = "1d7rsdqiccxp2w4ykb9klarddm2qrrym3brbnhzx2hm78iyj3hzv"; + minimumOCamlVersion = "4.04.2"; + meta.description = "Pattern matching on flat options"; + propagatedBuildInputs = [ ppxlib ]; + }; + + ppx_pattern_bind = janePackage { + pname = "ppx_pattern_bind"; + hash = "0yxkwnn30nxgrspi191zma95bgrh134aqh2bnpj3wg0245ki55zv"; + minimumOCamlVersion = "4.07"; + meta.description = "A ppx for writing fast incremental bind nodes in a pattern match"; + propagatedBuildInputs = [ ppx_let ]; + }; + + ppx_pipebang = janePackage { + pname = "ppx_pipebang"; + hash = "0450b3p2rpnnn5yyvbkcd3c33jr2z0dp8blwxddaj2lv7nzl5dzf"; + minimumOCamlVersion = "4.04.2"; + meta.description = "A ppx rewriter that inlines reverse application operators `|>` and `|!`"; + propagatedBuildInputs = [ ppxlib ]; + }; + + ppx_python = janePackage { + pname = "ppx_python"; + hash = "0gk4nqz4i9v3hwjg5mvgpgwj0dfcgpyc7ikba93cafyhn6fy83zk"; + meta.description = "A [@@deriving] plugin to generate Python conversion functions "; + # Compatibility with ppxlib 0.23 + patches = fetchpatch { + url = "https://github.com/janestreet/ppx_python/commit/b2fe0040cc39fa6164de868f8a20edb38d81170e.patch"; + sha256 = "sha256:1mrdwp0zw3dqavzx3ffrmzq5cdlninyf67ksavfzxb8gb16w6zpz"; + }; + propagatedBuildInputs = [ ppx_base ppxlib pyml ]; + }; + + ppx_sexp_conv = janePackage { + pname = "ppx_sexp_conv"; + version = "0.14.3"; + minimumOCamlVersion = "4.04.2"; + hash = "0dbri9d00ydi0dw1cavswnqdmhjaaz80vap29ns2lr6mhhlvyjmj"; + meta.description = "[@@deriving] plugin to generate S-expression conversion functions"; + propagatedBuildInputs = [ ppxlib sexplib0 base ]; + }; + + ppx_sexp_message = janePackage { + pname = "ppx_sexp_message"; + version = "0.14.1"; + hash = "1lvsr0d68kakih1ll33hy6dxbjkly6lmky4q6z0h0hrcbd6z48k4"; + minimumOCamlVersion = "4.04.2"; + meta.description = "A ppx rewriter for easy construction of s-expressions"; + propagatedBuildInputs = [ ppx_here ppx_sexp_conv ]; + }; + + ppx_sexp_value = janePackage { + pname = "ppx_sexp_value"; + hash = "1d1c92pyypqkd9473d59j0sfppxvcxggbc62w8bkqnbxrdmvirn9"; + minimumOCamlVersion = "4.04.2"; + meta.description = "A ppx rewriter that simplifies building s-expressions from ocaml values"; + propagatedBuildInputs = [ ppx_here ppx_sexp_conv ]; + }; + + ppx_stable = janePackage { + pname = "ppx_stable"; + version = "0.14.1"; + hash = "1sp1kn23qr0pfypa4ilvhqq5y11y13xpfygfl582ra9kik5xqfa1"; + minimumOCamlVersion = "4.04.2"; + meta.description = "Stable types conversions generator"; + propagatedBuildInputs = [ ppxlib ]; + }; + + ppx_string = janePackage { + pname = "ppx_string"; + version = "0.14.1"; + minimumOCamlVersion = "4.04.2"; + hash = "0a8khmg0y32kyn3q6idwgh0d6d1s6ms1w75gj3dzng0v7y4h6jx4"; + meta.description = "Ppx extension for string interpolation"; + propagatedBuildInputs = [ ppx_base ppxlib stdio ]; + }; + + ppx_typerep_conv = janePackage { + pname = "ppx_typerep_conv"; + version = "0.14.2"; + minimumOCamlVersion = "4.04.2"; + hash = "0yk9vkpnwr8labgfncqdi4rfkj88d8mb3cr8m4gdqpi3f2r27hf0"; + meta.description = "Generation of runtime types from type declarations"; + propagatedBuildInputs = [ ppxlib typerep ]; + }; + + ppx_variants_conv = janePackage { + pname = "ppx_variants_conv"; + version = "0.14.2"; + minimumOCamlVersion = "4.04.2"; + hash = "1p11fiz4m160hs0xzg4g9rxchp053sz3s3d1lyciqixad1xi47a4"; + meta.description = "Generation of accessor and iteration functions for ocaml variant types"; + propagatedBuildInputs = [ variantslib ppxlib ]; + }; + + protocol_version_header = janePackage { + pname = "protocol_version_header"; + hash = "0lfblv2yqw01bl074ga6vxii0p9mqwlqw1g9b9z7pfdva9wqilrd"; + meta.description = "Protocol versioning"; + propagatedBuildInputs = [ core_kernel ]; + }; + + pythonlib = janePackage { + pname = "pythonlib"; + hash = "0qr0mh9jiv1ham5zlz9i4im23a1vh6x1yp6dp2db2s4icmfph639"; + meta.description = "A library to help writing wrappers around ocaml code for python"; + meta.broken = lib.versionAtLeast ocaml.version "4.13"; + propagatedBuildInputs = [ ppx_expect ppx_let ppx_python stdio typerep ]; + }; + + re2 = janePackage { + pname = "re2"; + hash = "1j7dizls6lkz3i9dgf8nq2fm382mfbrmz72ci066zl3hkgdq8xwc"; + meta.description = "OCaml bindings for RE2, Google's regular expression library"; + propagatedBuildInputs = [ core_kernel ]; + prePatch = '' + substituteInPlace src/re2_c/dune --replace 'CXX=g++' 'CXX=c++' + substituteInPlace src/dune --replace '(cxx_flags (:standard \ -pedantic) (-I re2_c/libre2))' '(cxx_flags (:standard \ -pedantic) (-I re2_c/libre2) (-x c++))' + ''; + }; + + re2_stable = janePackage { + pname = "re2_stable"; + hash = "0kjc0ff6b3509s3b9n4q8ilb06d5fngdh3z58cm95vg7zkcas9w3"; + meta.description = "Re2_stable adds an incomplete but stable serialization of Re2"; + propagatedBuildInputs = [ core re2 ]; + }; + + resource_cache = janePackage { + pname = "resource_cache"; + hash = "197z9s535q74h00365ydhggg7hyzpyqvislgwwyi69sl1vy6dr0j"; + meta.description = "General resource cache"; + propagatedBuildInputs = [ async_rpc_kernel ]; + }; + + sexp = janePackage { + pname = "sexp"; + hash = "1x08pyrkd78233kgj70wxlc79w6jjhfrjdamm2xr7jzdc8ycfigf"; + propagatedBuildInputs = [ + async + core + csvfields + re2 + sexp_diff_kernel + sexp_macro + sexp_pretty + sexp_select + ]; + patches = ./sexp.patch; + meta.description = "S-expression swiss knife"; + }; + + sexp_diff_kernel = janePackage { + pname = "sexp_diff_kernel"; + hash = "1pljcs019hs2ffhhb7rjh3xz7cbrk8vsv967jzmip3rv9w21c9kh"; + propagatedBuildInputs = [ core_kernel ]; + meta.description = "Code for computing the diff of two sexps"; + }; + + sexp_macro = janePackage { + pname = "sexp_macro"; + hash = "1ih1g7vpb1j8vhzm9a5mjrrzgqrhjqdhf6vjrg8kxfqg5i5b8nyx"; + propagatedBuildInputs = [ async sexplib ]; + meta.description = "Sexp macros"; + }; + + sexp_pretty = janePackage { + pname = "sexp_pretty"; + hash = "0dax0wm511zgvr7p6kcd5gygi58118by7hsv7hymy8ldfcky5cwd"; + minimumOCamlVersion = "4.07"; + meta.description = "S-expression pretty-printer"; + propagatedBuildInputs = [ ppx_base re sexplib ]; + }; + + sexp_select = janePackage { + pname = "sexp_select"; + hash = "1lchhfqw4afw38fnarwylqc2qp7k6xwx3j7m9gy8ygjgd0vgd729"; + minimumOCamlVersion = "4.07"; + propagatedBuildInputs = [ base ppx_jane ]; + meta.description = "A library to use CSS-style selectors to traverse sexp trees"; + }; + + sexplib0 = janePackage { + pname = "sexplib0"; + hash = "06sb3zqhb3dwqsmn15d769hfgqwqhxnm52iqim9l767gvlwpmibb"; + minimumOCamlVersion = "4.04.2"; + meta.description = "Library containing the definition of S-expressions and some base converters"; + }; + + sexplib = janePackage { + pname = "sexplib"; + hash = "03c3j1ihx4pjbb0x3arrcif3wvp3iva2ivnywhiak4mbbslgsnzr"; + minimumOCamlVersion = "4.04.2"; + meta.description = "Library for serializing OCaml values to and from S-expressions"; + propagatedBuildInputs = [ num parsexp ]; + }; + + shell = janePackage { + pname = "shell"; + hash = "1c4zmpf6s1lk7nficip32c324if6zhm62h9h03d84zgvhvymi0r1"; + meta.description = "Yet another implementation of fork&exec and related functionality"; + buildInputs = [ jst-config ]; + propagatedBuildInputs = [ textutils ]; + checkInputs = [ ounit ]; + # This currently fails with dune + strictDeps = false; + }; + + shexp = janePackage { + pname = "shexp"; + hash = "1h6hsnbg6bk32f8iv6kd6im4mv2pjsjpd1mjsfx80p1n9273xack"; + minimumOCamlVersion = "4.07"; + propagatedBuildInputs = [ posixat spawn ]; + meta.description = "Process library and s-expression based shell"; + }; + + spawn = janePackage { + pname = "spawn"; + version = "0.13.0"; + minimumOCamlVersion = "4.02.3"; + hash = "1w003k1kw1lmyiqlk58gkxx8rac7dchiqlz6ah7aj7bh49b36ppf"; + meta.description = "Spawning sub-processes"; + buildInputs = [ ppx_expect ]; + doCheck = false; # tests are broken on NixOS (absolute paths) + }; + + splay_tree = janePackage { + pname = "splay_tree"; + hash = "1xbzzbqb054hl1v1zcgfwdgzqihni3a0dmvrric9xggmgn4ycmqq"; + meta.description = "A splay tree implementation"; + propagatedBuildInputs = [ core_kernel ]; + }; + + splittable_random = janePackage { + pname = "splittable_random"; + hash = "0ax988b1wc7km8khg4s6iphbz16y1rssh7baigxfyw3ldp0agk14"; + meta.description = "PRNG that can be split into independent streams"; + propagatedBuildInputs = [ base ppx_assert ppx_bench ppx_sexp_message ]; + }; + + stdio = janePackage { + pname = "stdio"; + hash = "0vv6d8absy4hvjd1babv7avpsdlvjpnd5hq691h39d0h3pvs6l98"; + minimumOCamlVersion = "4.04.2"; + meta.description = "Standard IO library for OCaml"; + propagatedBuildInputs = [ base ]; + }; + + textutils = janePackage { + pname = "textutils"; + hash = "1ggd0530lc5dkc419y3xw1wb52b4b5j3z78991gn5yxf2s50a8d4"; + meta.description = "Text output utilities"; + propagatedBuildInputs = [ core ]; + }; + + time_now = janePackage { + pname = "time_now"; + hash = "1lyq8zdz93hvpi4hpxh88kds30k5ljil8js9clcqyxrldp5n9mw0"; + minimumOCamlVersion = "4.04.2"; + meta.description = "Reports the current time"; + buildInputs = [ jst-config ppx_optcomp ]; + propagatedBuildInputs = [ jane-street-headers base ppx_base ]; + }; + + timezone = janePackage { + pname = "timezone"; + hash = "0zf075k94nk2wxnzpxia7pnm655damwp1b58xf2s9disia1ydxg7"; + meta.description = "Time-zone handling"; + propagatedBuildInputs = [ core_kernel ]; + }; + + topological_sort = janePackage { + pname = "topological_sort"; + hash = "17iz7956zln31p0xnm3jlhj863zi84bcx41jylzf7gk23qsm95m8"; + meta.description = "Topological sort algorithm"; + propagatedBuildInputs = [ ppx_jane stdio ]; + }; + + typerep = janePackage { + pname = "typerep"; + hash = "0wc7h853ka3s3lxxgm61ypidl0lzgc9abdkil6f72anl0c417y90"; + minimumOCamlVersion = "4.04.2"; + meta.description = "Typerep is a library for runtime types"; + propagatedBuildInputs = [ base ]; + }; + + variantslib = janePackage { + pname = "variantslib"; + hash = "0vy0hpiaawmydh08nqlwjx52pasp74383yi0pshwbdxin99n9mxd"; + minimumOCamlVersion = "4.04.2"; + meta.description = "Part of Jane Street's Core library"; + propagatedBuildInputs = [ base ]; + }; + + vcaml = janePackage { + pname = "vcaml"; + hash = "0ykwrn8bvwx26ad4wb36jw9xnlwsdpnnx88396laxvcfimrp13qs"; + meta.description = "OCaml bindings for the Neovim API"; + propagatedBuildInputs = [ angstrom-async async_extra faraday ]; + }; + + virtual_dom = janePackage { + pname = "virtual_dom"; + hash = "0vcydxx0jhbd5hbriahgp947mc7n3xymyrsfny1c4adk6aaq3c5w"; + meta.description = "OCaml bindings for the virtual-dom library"; + buildInputs = [ js_of_ocaml-ppx ]; + propagatedBuildInputs = [ core_kernel js_of_ocaml lambdasoup tyxml ]; + }; + + zarith_stubs_js = janePackage { + pname = "zarith_stubs_js"; + hash = "16p4bn5spkrx31fr4np945v9mwdq55706v3wl19s5fy6x83gvb86"; + minimumOCamlVersion = "4.04.2"; + meta.description = "Javascripts stubs for the Zarith library"; + doCheck = false; # requires workspace with zarith + }; + + zstandard = janePackage { + pname = "zstandard"; + hash = "1vf76v5m9wsh5f77w9z4i8sxm05wr5digyi95x4wvzdi7q3qg6m8"; + meta.description = "OCaml bindings to Zstandard"; + buildInputs = [ ppx_jane ]; + propagatedBuildInputs = [ core ctypes zstd ]; + }; + +} diff --git a/pkgs/development/ocaml-modules/janestreet/default.nix b/pkgs/development/ocaml-modules/janestreet/default.nix new file mode 100644 index 00000000000..ee906a72250 --- /dev/null +++ b/pkgs/development/ocaml-modules/janestreet/default.nix @@ -0,0 +1,601 @@ +{ self +, openssl +}: + +with self; + +{ + + ocaml-compiler-libs = janePackage { + pname = "ocaml-compiler-libs"; + hash = "03jds7bszh8wwpfwxb3dg0gyr1j1872wxwx1xqhry5ir0i84bg0s"; + meta.description = "OCaml compiler libraries repackaged"; + }; + + sexplib0 = janePackage { + pname = "sexplib0"; + meta.description = "Library containing the definition of S-expressions and some base converters"; + hash = "07v3ggyss7xhfv14bjk1n87sr42iqwj4cgjiv2lcdfkqk49i2bmi"; + }; + + parsexp = janePackage { + pname = "parsexp"; + hash = "1nyq23s5igd8cf3n4qxprjvhbmb6ighb3fy5mw7hxl0mdgsw5fvz"; + propagatedBuildInputs = [ sexplib0 ]; + meta.description = "S-expression parsing library"; + }; + + sexplib = janePackage { + pname = "sexplib"; + meta.description = "Library for serializing OCaml values to and from S-expressions"; + hash = "1qfl0m04rpcjvc4yw1hzh6r16jpwmap0sa9ax6zjji67dz4szpyb"; + propagatedBuildInputs = [ num parsexp ]; + }; + + base = janePackage { + version = "0.11.1"; + pname = "base"; + hash = "0j6xb4265jr41vw4fjzak6yr8s30qrnzapnc6rl1dxy8bjai0nir"; + propagatedBuildInputs = [ sexplib0 ]; + meta.description = "Full standard library replacement for OCaml"; + }; + + stdio = janePackage { + pname = "stdio"; + hash = "1facajqhvq34g2wrg368y0ajxd6lrj5b3lyzyj0jhdmraxajjcwn"; + propagatedBuildInputs = [ base ]; + meta.description = "Standard IO library for OCaml"; + }; + + configurator = janePackage { + pname = "configurator"; + hash = "0h686630cscav7pil8c3w0gbh6rj4b41dvbnwmicmlkc746q5bfk"; + propagatedBuildInputs = [ stdio ]; + meta.description = "Helper library for gathering system configuration"; + }; + + ppx_compare = janePackage { + pname = "ppx_compare"; + version = "0.11.1"; + hash = "06bq4m1bsm4jlx4g7wh5m99qky7xm4c2g52kaz6pv25hdn5agi2m"; + buildInputs = [ ppxlib ]; + propagatedBuildInputs = [ base ppx_deriving ]; + meta.description = "Generation of comparison functions from types"; + }; + + ppx_sexp_conv = janePackage { + pname = "ppx_sexp_conv"; + version = "0.11.2"; + hash = "0pqwnqy1xp309wvdcaax4lg02yk64lq2w03mbgfvf6ps5ry4gis9"; + propagatedBuildInputs = [ sexplib0 ppxlib ppx_deriving ]; + meta.description = "Generation of S-expression conversion functions from type definitions"; + }; + + variantslib = janePackage { + pname = "variantslib"; + hash = "0hbsk34ghc28h8pzbma923ma2bgnz8lzrgcqqx9bzg161jl4s4r3"; + buildInputs = [ ppxlib ]; + propagatedBuildInputs = [ base ]; + meta.description = "OCaml variants as first class values"; + }; + + ppx_variants_conv = janePackage { + pname = "ppx_variants_conv"; + version = "0.11.1"; + hash = "1yc0gsds5m2nv39zga8nnrca2n75rkqy5dz4xj1635ybz20hhbjd"; + buildInputs = [ ppxlib ]; + propagatedBuildInputs = [ ppx_deriving variantslib ]; + meta.description = "Generation of accessor and iteration functions for OCaml variant types"; + }; + + fieldslib = janePackage { + pname = "fieldslib"; + hash = "1yvjvfax56lmn2lxbykcmhgmxypws1vp9lhnyb8bhbavsv8yc6da"; + propagatedBuildInputs = [ ppxlib ]; + meta.description = "OCaml record fields as first class values"; + }; + + ppx_fields_conv = janePackage { + pname = "ppx_fields_conv"; + hash = "1bb9cmn4js7p3qh8skzyik1pcz6sj1k4xkhf12fg1bjmb5fd0jx1"; + propagatedBuildInputs = [ fieldslib ]; + meta.description = "Generation of accessor and iteration functions for OCaml records"; + }; + + ppx_custom_printf = janePackage { + pname = "ppx_custom_printf"; + hash = "1dvjzvaxhx53jqwrrlxdckwl1azrhs9kvwb48mhgd0jnz65ny726"; + propagatedBuildInputs = [ ppx_sexp_conv ]; + meta.description = "Printf-style format-strings for user-defined string conversion"; + }; + + bin_prot = janePackage { + pname = "bin_prot"; + hash = "1mgbyzsr8h0y4s4j9dv7hsdrxyzhhjww5khwg2spi2my7ia95m0l"; + propagatedBuildInputs = [ ppx_compare ppx_custom_printf ppx_fields_conv ppx_variants_conv ]; + meta.description = "Binary protocol generator"; + }; + + jane-street-headers = janePackage { + pname = "jane-street-headers"; + hash = "0kij4c7qxrja787f3sm3z6mzr322486h2djrlyhnl66vp8hrv8si"; + meta.description = "Jane Street header files"; + }; + + ppx_here = janePackage { + pname = "ppx_here"; + hash = "04njv8s4n54x9rg0012ymd6y6lrnqprnh0f0f6s0jcp79q7mv43i"; + buildInputs = [ ppxlib ]; + meta.description = "Expands [%here] into its location"; + }; + + ppx_assert = janePackage { + pname = "ppx_assert"; + hash = "0qbdrl0rj0midnb6sdyaz00s0d4nb8zrrdf565lcdsi1rbnyrzan"; + buildInputs = [ ppx_here ]; + propagatedBuildInputs = [ ppx_compare ppx_sexp_conv ]; + meta.description = "Assert-like extension nodes that raise useful errors on failure"; + }; + + ppx_hash = janePackage { + version = "0.11.1"; + pname = "ppx_hash"; + hash = "1p0ic6aijxlrdggpmycj12q3cy9xksbq2vq727215maz4snvlf5p"; + propagatedBuildInputs = [ ppx_compare ppx_sexp_conv ]; + meta.description = "A ppx rewriter that generates hash functions from type expressions and definitions"; + }; + + ppx_inline_test = janePackage { + pname = "ppx_inline_test"; + hash = "11n94fz1asjf5vqdgriv0pvsa5lbfpqcyk525c7816w23vskcvq6"; + buildInputs = [ ppxlib ]; + propagatedBuildInputs = [ base ]; + meta.description = "Syntax extension for writing in-line tests in OCaml code"; + }; + + ppx_sexp_message = janePackage { + pname = "ppx_sexp_message"; + hash = "0d94pf0mrmyp905ncgj4w6cc6zpm4nlib6nclslhgs89pxpzg6a0"; + buildInputs = [ ppx_here ]; + propagatedBuildInputs = [ ppx_sexp_conv ]; + meta.description = "A ppx rewriter for easy construction of s-expressions"; + }; + + typerep = janePackage { + pname = "typerep"; + hash = "00j4by75fl9niqvlpiyw6ymlmlmgfzysm8w25cj5wsfsh4yrgr74"; + propagatedBuildInputs = [ base ]; + meta.description = "Runtime types for OCaml"; + }; + + ppx_typerep_conv = janePackage { + version = "0.11.1"; + pname = "ppx_typerep_conv"; + hash = "0a13dpfrrg0rsm8qni1bh7pqcda30l70z8r6yzi5a64bmwk7g5ah"; + buildInputs = [ ppxlib ]; + propagatedBuildInputs = [ ppx_deriving typerep ]; + meta.description = "Generation of runtime types from type declarations"; + }; + + ppx_js_style = janePackage { + pname = "ppx_js_style"; + hash = "1cwqyrkykc8wi60grbid1w072fcvf7k0hd387jz7mxfw44qyb85g"; + propagatedBuildInputs = [ ppxlib octavius ]; + meta.description = "Code style checker for Jane Street Packages"; + }; + + ppx_enumerate = janePackage { + version = "0.11.1"; + pname = "ppx_enumerate"; + hash = "0spx9k1v7vjjb6sigbfs69yndgq76v114jhxvzjmffw7q989cyhr"; + buildInputs = [ ppxlib ]; + propagatedBuildInputs = [ ppx_deriving ]; + meta.description = "Generate a list containing all values of a finite type"; + }; + + ppx_base = janePackage { + pname = "ppx_base"; + hash = "079caqjbxk1d33hy69017n3dwslqy52alvzjddwpdjb04vjadlk6"; + propagatedBuildInputs = [ ppx_compare ppx_enumerate ppx_hash ppx_js_style ]; + meta.description = "Base set of ppx rewriters"; + }; + + ppx_bench = janePackage { + pname = "ppx_bench"; + hash = "0z98r6y4lpj6dy265m771ylx126hq3v1zjsk74yqvpwwd63gx3jz"; + buildInputs = [ ppxlib ppx_inline_test ]; + meta.description = "Syntax extension for writing in-line benchmarks in OCaml code"; + }; + + ppx_bin_prot = janePackage { + version = "0.11.1"; + pname = "ppx_bin_prot"; + hash = "1h60i75bzvhna1axyn662gyrzhh441l79vl142d235i5x31dmnkz"; + buildInputs = [ ppxlib ppx_here ]; + propagatedBuildInputs = [ bin_prot ]; + meta.description = "Generation of bin_prot readers and writers from types"; + }; + + ppx_expect = janePackage { + pname = "ppx_expect"; + hash = "1g0r67vfw9jr75pybiw4ysfiswlzyfpbj0gl91rx62gqdhjh1pga"; + buildInputs = [ ppx_assert ppx_custom_printf ppx_fields_conv ppx_here ppx_variants_conv re ]; + propagatedBuildInputs = [ fieldslib ppx_compare ppx_inline_test ppx_sexp_conv ]; + meta.description = "Cram like framework for OCaml"; + }; + + ppx_fail = janePackage { + pname = "ppx_fail"; + hash = "0d0xadcl7mhp81kspcd2b0nh75h34w5a6s6j9qskjjbjif87wiix"; + buildInputs = [ ppxlib ppx_here ]; + meta.description = "Add location to calls to failwiths"; + }; + + ppx_let = janePackage { + pname = "ppx_let"; + hash = "1ckzwljlb78cdf6xxd24nddnmsihvjrnq75r1b255aj3xgkzsygx"; + propagatedBuildInputs = [ base ppxlib ]; + meta.description = "Monadic let-bindings"; + }; + + ppx_optcomp = janePackage { + pname = "ppx_optcomp"; + hash = "1rahkjq6vpffs7wdz1crgbxkdnlfkj1i3j12c2andy4fhj49glcm"; + buildInputs = [ ppxlib ]; + propagatedBuildInputs = [ ppx_deriving ]; + meta.description = "Optional compilation for OCaml"; + }; + + ppx_optional = janePackage { + pname = "ppx_optional"; + hash = "0aw3hvrsdjpw4ik7rf15ghak31vhdr1lgpphr18mj76rnlrhirmx"; + propagatedBuildInputs = [ ppxlib ]; + meta.description = "Pattern matching on flat options"; + }; + + ppx_pipebang = janePackage { + pname = "ppx_pipebang"; + hash = "0smgq587amlr3hivbbg153p83dj37w30cssp9cffc0v8kg84lfhr"; + buildInputs = [ ppxlib ]; + meta.description = "A ppx rewriter that inlines reverse application operators |> and |!"; + }; + + ppx_sexp_value = janePackage { + pname = "ppx_sexp_value"; + hash = "107zwb580nrmc0l03dl3y3hf12s3c1vv8b8mz6sa4k5afp3s9nkl"; + buildInputs = [ ppx_here ]; + propagatedBuildInputs = [ ppx_sexp_conv ]; + meta.description = "A ppx rewriter that simplifies building s-expressions from OCaml values"; + }; + + ppx_jane = janePackage { + pname = "ppx_jane"; + hash = "0l1p6llaa60mrc5p9400cqv9yy6h76x5wfq3z1cx5xawy0yz4vlb"; + buildInputs = [ ppxlib ]; + propagatedBuildInputs = [ ppx_assert ppx_base ppx_bench ppx_bin_prot ppx_expect ppx_fail ppx_here ppx_let ppx_optcomp ppx_optional ppx_pipebang ppx_sexp_message ppx_sexp_value ppx_typerep_conv ]; + meta.description = "Standard Jane Street ppx rewriters"; + }; + + splittable_random = janePackage { + pname = "splittable_random"; + hash = "1yrvpm6g62f8k6ihccxhfxpvmxbqxhi7p790a8jkdmyfdd1l6z73"; + propagatedBuildInputs = [ ppx_jane ]; + meta.description = "PRNG that can be split into independent streams"; + }; + + core_kernel = janePackage { + version = "0.11.1"; + pname = "core_kernel"; + hash = "1dg7ygy7i64c5gaakb1cp1b26p9ks81vbxmb8fd7jff2q60j2z2g"; + propagatedBuildInputs = [ configurator jane-street-headers sexplib splittable_random ]; + meta.description = "Jane Street's standard library overlay (kernel)"; + }; + + spawn = janePackage { + version = "0.12.0"; + pname = "spawn"; + hash = "0amgj7g9sjlbjivn1mg7yjdmxd21hgp4a0ak2zrm95dmm4gi846i"; + meta.description = "Spawning sub-processes"; + }; + + core = janePackage { + version = "0.11.3"; + pname = "core"; + hash = "0pzl8n09z4f3i7z2wq4cjxfqrr8mj6xcdp7rbg0nxap2zdhjgvrq"; + propagatedBuildInputs = [ core_kernel spawn ]; + meta.description = "Jane Street's standard library overlay"; + }; + + textutils_kernel = janePackage { + pname = "textutils_kernel"; + hash = "0s1ps7h54vgl76pll3y5qa1bw8f4h8wxc8mg8jq6bz8vxvl0dfv4"; + propagatedBuildInputs = [ core_kernel ]; + meta.description = "The subset of textutils using only core_kernel and working in javascript"; + }; + + textutils = janePackage { + pname = "textutils"; + hash = "1jmhpaihnndf4pr8xsk7ws70n4mvv34ry0ggqqpfs3wb2vkcdg6j"; + propagatedBuildInputs = [ core textutils_kernel ]; + meta.description = "Text output utilities"; + }; + + re2 = janePackage { + pname = "re2"; + hash = "0bl65d0nmvr7k1mkkcc4aai86l5qzgn1xxwmszshpwhaz87cqghd"; + propagatedBuildInputs = [ core_kernel ]; + prePatch = '' + substituteInPlace src/re2_c/jbuild --replace 'CXX=g++' 'CXX=c++' + substituteInPlace src/jbuild --replace '(cxx_flags ((:standard \ -pedantic) (-I re2_c/libre2)))' '(cxx_flags ((:standard \ -pedantic) (-I re2_c/libre2) (-x c++)))' + ''; + meta.description = "OCaml bindings for RE2"; + }; + + core_extended = janePackage { + pname = "core_extended"; + hash = "1fvnr6zkpbl48dl7nn3j1dpsrr6bi00iqh282wg5lgdhcsjbc0dy"; + propagatedBuildInputs = [ core re re2 textutils ]; + postPatch = '' + patchShebangs src/discover.sh + ''; + meta.description = "Jane Street Capital's standard library overlay"; + }; + + async_kernel = janePackage { + version = "0.11.1"; + pname = "async_kernel"; + hash = "1ssv0gqbdns6by1wdjrrs35cj1c1n1qcfkxs8hj04b7x89wzvf1q"; + propagatedBuildInputs = [ core_kernel ]; + meta.description = "Jane Street Capital's asynchronous execution library (core)"; + }; + + protocol_version_header = janePackage { + pname = "protocol_version_header"; + hash = "159qmkb0dsfmr1lv2ly50aqszpm24bvrm3sw07n2zhkxgy6q613z"; + propagatedBuildInputs = [ core_kernel ocaml-migrate-parsetree ]; + meta.description = "Protocol aware version negotiation"; + }; + + async_rpc_kernel = janePackage { + pname = "async_rpc_kernel"; + hash = "0wl7kp30qxkalk91q5pja9agsvvmdjvb2q7s3m79dlvwwi11l33y"; + propagatedBuildInputs = [ core_kernel async_kernel protocol_version_header ]; + meta.description = "Platform-independent core of Async RPC library"; + }; + + async_unix = janePackage { + pname = "async_unix"; + hash = "1y5za5fdh0x82zdjigxci9zm9jnpfd2lfgpjcq4rih3s28f16sf7"; + propagatedBuildInputs = [ core async_kernel ]; + meta.description = "Jane Street Capital's asynchronous execution library (unix)"; + }; + + async_extra = janePackage { + version = "0.11.1"; + pname = "async_extra"; + hash = "0dmplvqf41820rm5i0l9bx1xmmdlq8zsszi36y2rkjna8991f7s2"; + propagatedBuildInputs = [ async_rpc_kernel async_unix ]; + meta.description = "Jane Street's asynchronous execution library (extra)"; + }; + + async = janePackage { + pname = "async"; + hash = "1i05hzk4mhzj1mw98b2bdbxhnq03jvhkkkw4d948i6265jzrrbv5"; + propagatedBuildInputs = [ async_extra ]; + meta.description = "Jane Street Capital's asynchronous execution library"; + }; + + async_find = janePackage { + pname = "async_find"; + hash = "0s0qafx74ri1vr2vv3iy1j7s3p6gp7vyg0mw5g17iafk0w6lv2iq"; + propagatedBuildInputs = [ async ]; + meta.description = "Directory traversal with Async"; + }; + + async_interactive = janePackage { + pname = "async_interactive"; + hash = "01rlfcylpiak6a2n6q3chp73cvkhvb65n906dj0flmxmagn7dxd1"; + propagatedBuildInputs = [ async ]; + meta.description = "Utilities for building simple command-line based user interfaces"; + }; + + async_parallel = janePackage { + pname = "async_parallel"; + hash = "0hak8ba3rfzqhz5hz2annqmsv5bkqzdihhafp0f58ryrlskafwag"; + propagatedBuildInputs = [ async ]; + meta.description = "Distributed computing library"; + }; + + async_shell = janePackage { + pname = "async_shell"; + hash = "1jb01ygfnhabsy72xlcg11vp7rr37sg555sm0k3yxl4r5az3y2ay"; + propagatedBuildInputs = [ core_extended async ]; + meta.description = "Shell helpers for Async"; + }; + + async_ssl = janePackage { + pname = "async_ssl"; + hash = "1p83fzfla4rb820irdrz3f2hp8kq5zrhw47rqmfv6qydlca1bq64"; + propagatedBuildInputs = [ async ctypes openssl ]; + meta = { + description = "Async wrappers for SSL"; + # ctypes no longer works with dune 1 + # dune 2 no longer supports jbuild + broken = true; + }; + }; + + sexp_pretty = janePackage { + pname = "sexp_pretty"; + hash = "0xskahjggbwvvb82fn0jp1didxbgpmgks76xhwp9s3vqkhgz6918"; + propagatedBuildInputs = [ ppx_base re sexplib ]; + meta.description = "S-expression pretty-printer"; + }; + + expect_test_helpers_kernel = janePackage { + pname = "expect_test_helpers_kernel"; + hash = "0m113vq4m1xm3wmwa08r6qjc7p5f0y3ss8s4i2z591ycgs2fxzlj"; + propagatedBuildInputs = [ core_kernel sexp_pretty ]; + meta.description = "Helpers for writing expectation tests"; + }; + + expect_test_helpers = janePackage { + pname = "expect_test_helpers"; + hash = "13n6h7mimwkbsjdix96ghfrmxjd036m4h4zgl8qag00aacqclvpi"; + propagatedBuildInputs = [ async expect_test_helpers_kernel ]; + meta.description = "Async helpers for writing expectation tests"; + }; + + cinaps = janePackage { + pname = "cinaps"; + hash = "0f8cx4xkkk4wqpcbvva8kxdndbgawljp17dwppc6zpjpkjl8s84j"; + propagatedBuildInputs = [ re ]; + meta.description = "Trivial Metaprogramming tool using the OCaml toplevel"; + }; + + command_rpc = janePackage { + pname = "command_rpc"; + hash = "111v4km0ds8ixmpmwg9ck36ap97400mqzhijf57kj6wfwgzcmr2g"; + propagatedBuildInputs = [ async ]; + meta.description = "Utilities for Versioned RPC communication with a child process over stdin and stdout"; + }; + + # Deprecated libraries + + ppx_ast = janePackage { + pname = "ppx_ast"; + hash = "125bzswcwr3nb26ss8ydh8z4218c8fi3s2kvgqp1j1fhc5wwzqgj"; + propagatedBuildInputs = [ ppxlib ]; + meta.description = "Deprecated (see ppxlib)"; + }; + + ppx_core = janePackage { + pname = "ppx_core"; + hash = "11hgm9mxig4cm3c827f6dns9mjv3pf8g6skf10x0gw9xnp1dmzmx"; + propagatedBuildInputs = [ ppxlib ]; + meta.description = "Deprecated (see ppxlib)"; + }; + + ppx_driver = janePackage { + pname = "ppx_driver"; + hash = "00kfx6js2kxk57k4v7hiqvwk7h35whgjihnxf75m82rnaf4yzvfi"; + propagatedBuildInputs = [ ppxlib ]; + meta.description = "Deprecated (see ppxlib)"; + }; + + ppx_metaquot = janePackage { + pname = "ppx_metaquot"; + hash = "1vz8bi56jsz8w0894vgbfsfvmdyh5k1dgv45l8vhkks0s7d3ldji"; + propagatedBuildInputs = [ ppxlib ]; + meta.description = "Deprecated (see ppxlib)"; + }; + + ppx_traverse = janePackage { + pname = "ppx_traverse"; + hash = "1p2n5da4mxh9fk4gvxlibc706bs5xwkbppxd1x0ip1vln5pabbq5"; + propagatedBuildInputs = [ ppxlib ]; + meta.description = "Deprecated (see ppxlib)"; + }; + + ppx_traverse_builtins = janePackage { + pname = "ppx_traverse_builtins"; + hash = "0qlf7i8h8k3a9h8nhb0ki3y1knr6wgbm24f1qaqni53fpvzv0pfb"; + propagatedBuildInputs = [ ppxlib ]; + meta.description = "Deprecated (see ppxlib)"; + }; + + ppx_type_conv = janePackage { + pname = "ppx_type_conv"; + hash = "04dbrglqqhkas25cpjz8xhjcbpk141c35qggzw66bn69izczfmaf"; + propagatedBuildInputs = [ ppxlib ]; + meta.description = "Deprecated (see ppxlib)"; + }; + + # Miscellaneous Jane Street packages + + core_bench = janePackage { + pname = "core_bench"; + hash = "10i28ssfdqxxhq0rvnlp581lr1cq2apkhmm8j83fksjkmbxcrasc"; + propagatedBuildInputs = [ core_extended ]; + meta.description = "Micro-benchmarking library for OCaml"; + }; + + csvfields = janePackage { + pname = "csvfields"; + hash = "10zw4fjlniivfdzzz79lnbvcjnhk5y16m1p8mn4xbs23n6mbix0f"; + propagatedBuildInputs = [ core expect_test_helpers ]; + meta.description = "Runtime support for ppx_xml_conv and ppx_csv_conv"; + }; + + ecaml = janePackage { + pname = "ecaml"; + hash = "1is5156q59s427x3q5nh9wsi8h1x77670bmyilqxasy39yway7g8"; + propagatedBuildInputs = [ async expect_test_helpers_kernel ]; + meta.description = "Writing Emacs plugin in OCaml"; + }; + + incremental_kernel = janePackage { + version = "0.11.1"; + pname = "incremental_kernel"; + hash = "1qp9dqncx2h0np0rndqaic4dna8f1dlkqnbjfcdhcim5dp2vg4x6"; + propagatedBuildInputs = [ core_kernel ]; + meta.description = "Library for incremental computations depending only on core_kernel"; + }; + + incremental = janePackage { + pname = "incremental"; + hash = "1xchd3v4kj56wixjrsnj7m7l0374cgkzybihs2b62mn65xf6n7ki"; + propagatedBuildInputs = [ core incremental_kernel ]; + meta.description = "Library for incremental computations"; + }; + + incr_map = janePackage { + pname = "incr_map"; + hash = "01vx9aldxpigz5ah9h337xcw73a7r8449v8l2xbralljhs0zglx9"; + propagatedBuildInputs = [ incremental_kernel ]; + meta.description = "Helpers for incremental operations on map like data structures"; + }; + + parsexp_io = janePackage { + pname = "parsexp_io"; + hash = "0rhdl40jiirvv6fhgjk50n8wzs3jly5d8dyyyfgpjgl39mwkjjnb"; + propagatedBuildInputs = [ parsexp ppx_js_style ]; + meta.description = "S-expression parsing library (IO functions)"; + }; + + patience_diff = janePackage { + pname = "patience_diff"; + hash = "0q7a64fgg97qcd6d8c45gyz63x5vq004axxqvvfg92b8f3x2plx4"; + propagatedBuildInputs = [ core_kernel ]; + meta.description = "Tool and library implementing patience diff"; + }; + + posixat = janePackage { + pname = "posixat"; + hash = "04rs4sl0r4rg9m6l9kkqkmc4n87sv4a4w9ibq4zsjk9j4n6r2df8"; + propagatedBuildInputs = [ ppx_optcomp ppx_sexp_conv sexplib ]; + meta.description = "Binding to the posix *at functions"; + }; + + rpc_parallel = janePackage { + pname = "rpc_parallel"; + hash = "13dx59x73i8mkwv2qkh8gx6kk8arlvghj57k1jdscdmzmyqc9gvn"; + propagatedBuildInputs = [ async ]; + meta.description = "Type-safe library for building parallel applications"; + }; + + shexp = janePackage { + version = "0.11.1"; + pname = "shexp"; + hash = "06yssp7bsmabaxvw9bqxyrsji1gkvl7if5adba3v6h4kilqy7rqg"; + propagatedBuildInputs = [ posixat spawn ]; + meta.description = "Process library and s-expression based shell"; + }; + + topological_sort = janePackage { + pname = "topological_sort"; + hash = "1qnz5b1rs45lsl1ycxd1lglpmh8444gy5khhdp5fvxy987zkzklz"; + propagatedBuildInputs = [ core_kernel ]; + meta.description = "Topological sort algorithm"; + }; +} diff --git a/pkgs/development/ocaml-modules/janestreet/janePackage.nix b/pkgs/development/ocaml-modules/janestreet/janePackage.nix new file mode 100644 index 00000000000..da268757601 --- /dev/null +++ b/pkgs/development/ocaml-modules/janestreet/janePackage.nix @@ -0,0 +1,25 @@ +{ lib, fetchFromGitHub, buildDunePackage, defaultVersion ? "0.11.0" }: + +{ pname, version ? defaultVersion, hash, buildInputs ? [], ...}@args: + +buildDunePackage (args // { + inherit version buildInputs; + + useDune2 = false; + + minimalOCamlVersion = "4.04"; + + src = fetchFromGitHub { + owner = "janestreet"; + repo = pname; + rev = "v${version}"; + sha256 = hash; + }; + + strictDeps = true; + + meta = { + license = lib.licenses.asl20; + homepage = "https://github.com/janestreet/${pname}"; + } // args.meta; +}) diff --git a/pkgs/development/ocaml-modules/janestreet/janePackage_0_12.nix b/pkgs/development/ocaml-modules/janestreet/janePackage_0_12.nix new file mode 100644 index 00000000000..5b918683570 --- /dev/null +++ b/pkgs/development/ocaml-modules/janestreet/janePackage_0_12.nix @@ -0,0 +1,25 @@ +{ lib, fetchFromGitHub, buildDunePackage, defaultVersion ? "0.12.0" }: + +{ pname, version ? defaultVersion, hash, ...}@args: + +buildDunePackage (args // { + inherit version; + + useDune2 = false; + + minimalOCamlVersion = "4.07"; + + src = fetchFromGitHub { + owner = "janestreet"; + repo = pname; + rev = "v${version}"; + sha256 = hash; + }; + + strictDeps = true; + + meta = { + license = lib.licenses.mit; + homepage = "https://github.com/janestreet/${pname}"; + } // args.meta; +}) diff --git a/pkgs/development/ocaml-modules/janestreet/janePackage_0_14.nix b/pkgs/development/ocaml-modules/janestreet/janePackage_0_14.nix new file mode 100644 index 00000000000..d124baea897 --- /dev/null +++ b/pkgs/development/ocaml-modules/janestreet/janePackage_0_14.nix @@ -0,0 +1,31 @@ +{ lib, fetchFromGitHub, buildDunePackage, defaultVersion ? "0.14.0" }: + +{ pname +, version ? defaultVersion +, hash +, minimumOCamlVersion ? "4.08" +, doCheck ? true +, buildInputs ? [] +, strictDeps ? true +, ...}@args: + +buildDunePackage (args // { + useDune2 = true; + inherit version buildInputs strictDeps; + + inherit minimumOCamlVersion; + + src = fetchFromGitHub { + owner = "janestreet"; + repo = pname; + rev = "v${version}"; + sha256 = hash; + }; + + inherit doCheck; + + meta = { + license = lib.licenses.mit; + homepage = "https://github.com/janestreet/${pname}"; + } // args.meta; +}) diff --git a/pkgs/development/ocaml-modules/janestreet/old.nix b/pkgs/development/ocaml-modules/janestreet/old.nix new file mode 100644 index 00000000000..8b4a6ed5296 --- /dev/null +++ b/pkgs/development/ocaml-modules/janestreet/old.nix @@ -0,0 +1,639 @@ +{ self +, super +, lib +, stdenv +, openssl +}: + +let + inherit (super) + janePackage + ocaml + ocamlbuild + cryptokit + ctypes + magic-mime + ocaml-migrate-parsetree + octavius + ounit + ppx_deriving + re + zarith + num + ; + +in + +with self; + +{ + + # Jane Street packages, up to ppx_core + + sexplib = janePackage { + pname = "sexplib"; + meta.description = "Automated S-expression conversion"; + version = "0.10.0"; + hash = "1agw649n0rnf6h4y2dr1zs1970nncxgjmf90848vbxv8y9im4yy2"; + buildInputs = [ num ]; + }; + + base = janePackage { + pname = "base"; + version = "0.9.4"; + hash = "0x85xi66b4zwlbdwmyc99zcmawgpp75gxqbl55rr67awavw162rw"; + propagatedBuildInputs = [ sexplib ]; + meta.description = "Full standard library replacement for OCaml"; + }; + + ocaml-compiler-libs = janePackage { + pname = "ocaml-compiler-libs"; + hash = "1jz3nfrb6295sj4xj1j0zld8mhfj0xy2k4vlp9yf9sh3748n090l"; + meta.description = "OCaml compiler libraries repackaged"; + }; + + ppx_ast = janePackage ({ + pname = "ppx_ast"; + propagatedBuildInputs = [ ocaml-compiler-libs ocaml-migrate-parsetree ]; + meta.description = "OCaml AST used by Jane Street ppx rewriters"; + } // (if lib.versionAtLeast ocaml.version "4.06" + then { + version = "0.9.2"; + hash = "1h4qf26rg23z21rrw83fakiavw9km7174p3830pg0gg4bwakvba0"; + } else { + version = "0.9.1"; + hash = "0a9rxwavy2748k0yd4db3hg1ypq7mpqnwq9si5a5qdiclgkhcggw"; + } + )); + + ppx_traverse_builtins = janePackage { + pname = "ppx_traverse_builtins"; + hash = "10ajvz02ka6qimlfrq7py4ljhk8awqkga6240kn8j046b4xfyxzi"; + meta.description = "Builtins for Ppx_traverse"; + }; + + stdio = janePackage { + pname = "stdio"; + version = "0.9.1"; + hash = "13rj3ii0rvmklfim9ild0ib44ssdadig7a9ccjbz22m0pw84a1sx"; + propagatedBuildInputs = [ base ]; + meta.description = "Standard IO library for OCaml"; + }; + + ppx_core = janePackage { + pname = "ppx_core"; + hash = "15400zxxkqdimmjpdjcs36gcbxbrhylmaczlzwd6x65v1h9aydz3"; + propagatedBuildInputs = [ ppx_ast ppx_traverse_builtins stdio ]; + meta.description = "Jane Street's standard library for ppx rewriters"; + }; + + # Jane Street packages, up to ppx_base + + ppx_optcomp = janePackage { + pname = "ppx_optcomp"; + hash = "1wfj6fnh92s81yncq7yyhmax7j6zpjj1sg1f3qa1f9c5kf4kkzrd"; + propagatedBuildInputs = [ ppx_core ]; + meta.description = "Optional compilation for OCaml"; + }; + + ppx_driver = janePackage { + pname = "ppx_driver"; + version = "0.9.1"; + hash = "1amz49x6v4sh1v2my6618cah0zv5i7jmsapbk9ydps6419g5asay"; + buildInputs = [ ocamlbuild ]; + propagatedBuildInputs = [ ppx_optcomp ]; + meta.description = "Feature-full driver for OCaml AST transformers"; + }; + + ppx_metaquot = janePackage { + pname = "ppx_metaquot"; + hash = "15qfd3s4x2pz006nx5316laxd3gqqi472x432qg4rfx4yh3vn31k"; + propagatedBuildInputs = [ ppx_driver ]; + meta.description = "Metaquotations for ppx_ast"; + }; + + ppx_type_conv = janePackage { + pname = "ppx_type_conv"; + hash = "0a0gxjvjiql9vg37k0akn8xr5724nv3xb7v37xpidv7ld927ks7p"; + propagatedBuildInputs = [ ppx_metaquot ppx_deriving ]; + meta.description = "Support Library for type-driven code generators"; + }; + + ppx_sexp_conv = janePackage { + pname = "ppx_sexp_conv"; + hash = "03cg2sym0wvpd5l7q4w9bclp589z5byygwsmnnq9h1ih56cmd55l"; + propagatedBuildInputs = [ ppx_type_conv sexplib ]; + meta.description = "Generation of S-expression conversion functions from type definitions"; + }; + + ppx_compare = janePackage { + pname = "ppx_compare"; + hash = "0wrszpvn1nms5sb5rb29p7z1wmqyd15gfzdj4ax8f843p5ywx3w9"; + propagatedBuildInputs = [ ppx_type_conv ]; + meta.description = "Generation of comparison functions from types"; + }; + + ppx_enumerate = janePackage { + pname = "ppx_enumerate"; + hash = "1dfy86j2z12p5n9yrwaakx1ngphs5246vxy279kz6i6j34cwxm46"; + propagatedBuildInputs = [ ppx_type_conv ]; + meta.description = "Generate a list containing all values of a finite type"; + }; + + ppx_hash = janePackage { + pname = "ppx_hash"; + hash = "1w1riy2sqd9i611sc5f5z2rqqgjl2gvvkzi5xibpv309nacnl01d"; + propagatedBuildInputs = [ ppx_compare ppx_sexp_conv ]; + meta.description = "A ppx rewriter that generates hash functions from type expressions and definitions"; + }; + + ppx_js_style = janePackage { + pname = "ppx_js_style"; + hash = "09k02b1l2r7svf9l3ls69h8xydsyiang2ziigxnny2i7gy7b0w59"; + propagatedBuildInputs = [ ppx_metaquot octavius ]; + meta.description = "Code style checker for Jane Street Packages"; + }; + + ppx_base = janePackage { + pname = "ppx_base"; + hash = "0qikfzbkd2wyxfrvizz6rgi6vg4ykvxkivacj4gr178dbgfl5if3"; + propagatedBuildInputs = [ ppx_enumerate ppx_hash ppx_js_style ]; + meta.description = "Base set of ppx rewriters"; + }; + + # Jane Street packages, up to ppx_bin_prot + + fieldslib = janePackage { + pname = "fieldslib"; + hash = "1wxh59888l1bfz9ipnbcas58gwg744icaixzdbsg4v8f7wymc501"; + propagatedBuildInputs = [ ppx_driver ]; + meta.description = "OCaml record fields as first class values"; + }; + + variantslib = janePackage { + pname = "variantslib"; + hash = "0kj53n62193j58q9vip8lfhhyf6w9d25wyvxzc163hx5m68yw0fz"; + propagatedBuildInputs = [ ppx_driver ]; + meta.description = "OCaml variants as first class values"; + }; + + ppx_traverse = janePackage { + pname = "ppx_traverse"; + hash = "1sdqgwyq0w71i03vhc5jq4jk6rsbgwhvain48fnrllpkb5kj2la2"; + propagatedBuildInputs = [ ppx_type_conv ]; + meta.description = "Automatic generation of open recursion classes"; + }; + + ppx_custom_printf = janePackage { + pname = "ppx_custom_printf"; + hash = "0cjy2c2c5g3qxqvwx1yb6p7kbmmpnpb1hll55f7a44x215lg8x19"; + propagatedBuildInputs = [ ppx_sexp_conv ppx_traverse ]; + meta.description = "Printf-style format-strings for user-defined string conversion"; + }; + + ppx_fields_conv = janePackage { + pname = "ppx_fields_conv"; + hash = "0qp8zgmk58iskzrkf4g06i471kg6lrh3wqpy9klrb8pp9mg0xr9z"; + propagatedBuildInputs = [ fieldslib ppx_type_conv ]; + meta.description = "Generation of accessor and iteration functions for OCaml records"; + }; + + ppx_variants_conv = janePackage { + pname = "ppx_variants_conv"; + hash = "1xayhyglgbdjqvb9123kjbwjcv0a3n3302nb0j7g8gmja8w5y834"; + propagatedBuildInputs = [ ppx_type_conv variantslib ]; + meta.description = "Generation of accessor and iteration functions for OCaml variant types"; + }; + + bin_prot = janePackage { + pname = "bin_prot"; + version = "0.9.1"; + hash = "1bgcmkgz6b5i522996x589zsaiy5b3h37887lwbqvpps8by2ayvk"; + propagatedBuildInputs = [ ppx_compare ppx_custom_printf ppx_fields_conv ppx_variants_conv ]; + meta.description = "Binary protocol generator"; + }; + + ppx_here = janePackage { + pname = "ppx_here"; + hash = "0pjscw5ydxgy4fcxakgsazpp09ka057w5n2fp2dpkv2k5gil6rzh"; + propagatedBuildInputs = [ ppx_driver ]; + meta.description = "Expands [%here] into its location"; + }; + + ppx_bin_prot = janePackage { + pname = "ppx_bin_prot"; + hash = "0qw9zqrc5yngzrzpk9awnlnd68xrb7wz5lq807c80ibxk0xvnqn3"; + propagatedBuildInputs = [ ppx_here bin_prot ]; + meta.description = "Generation of bin_prot readers and writers from types"; + }; + + # Jane Street packages, up to ppx_jane + + ppx_assert = janePackage { + pname = "ppx_assert"; + hash = "1s5c75wkc46nlcwmgic5h7f439s26ssrzrcil501c5kpib2hlv6z"; + propagatedBuildInputs = [ ppx_sexp_conv ppx_here ppx_compare ]; + meta.description = "Assert-like extension nodes that raise useful errors on failure"; + }; + + ppx_inline_test = janePackage { + pname = "ppx_inline_test"; + version = "0.9.2"; + hash = "17j36ihiqprbpa2bk02449k93vaidid2sly5djrk848ccjq8n5aa"; + propagatedBuildInputs = [ ppx_metaquot ]; + meta.description = "Syntax extension for writing in-line tests in OCaml code"; + }; + + typerep = janePackage { + pname = "typerep"; + hash = "0hlc0xiznli1k6azv2mhm1s4xghhxqqd957np7828bfp7r8n2jy3"; + propagatedBuildInputs = [ base ]; + meta.description = "Runtime types for OCaml"; + }; + + ppx_bench = janePackage { + pname = "ppx_bench"; + hash = "1qk4y6c2mpw7bqjppi2nam74vs2sc89wzq162j92wsqxyqsv4p93"; + propagatedBuildInputs = [ ppx_inline_test ]; + meta.description = "Syntax extension for writing in-line benchmarks in OCaml code"; + }; + + ppx_expect = janePackage { + pname = "ppx_expect"; + hash = "1bik53k51wcqv088f0h10n3ms9h51yvg6ha3g1s903i2bxr3xs6b"; + propagatedBuildInputs = [ ppx_inline_test ppx_fields_conv ppx_custom_printf ppx_assert ppx_variants_conv re ]; + meta.description = "Cram like framework for OCaml"; + }; + + ppx_fail = janePackage { + pname = "ppx_fail"; + hash = "0qz0vlazasjyg7cv3iwpzxlvsah3zmn9dzd029xxqr1bji067s32"; + propagatedBuildInputs = [ ppx_here ppx_metaquot ]; + meta.description = "Add location to calls to failwiths"; + }; + + ppx_let = janePackage { + pname = "ppx_let"; + hash = "1b914a5nynwxjvfx42v61yigvjhnd548m4yqjfchf38dmqi1f4nr"; + propagatedBuildInputs = [ ppx_driver ]; + meta.description = "Monadic let-bindings"; + }; + + ppx_optional = janePackage { + pname = "ppx_optional"; + hash = "1vknsarxba0zcp5k2jb31wfpvqrv3bpanxbahfl5s2fwspsfdc82"; + propagatedBuildInputs = [ ppx_metaquot ]; + meta.description = "Pattern matching on flat options"; + }; + + ppx_pipebang = janePackage { + pname = "ppx_pipebang"; + hash = "1wyfyyjvyi94ds1p90l60wdr85q2v3fq1qdf3gnv9zjfy6sb0g9h"; + propagatedBuildInputs = [ ppx_metaquot ]; + meta.description = "A ppx rewriter that inlines reverse application operators |> and |!"; + }; + + ppx_sexp_message = janePackage { + pname = "ppx_sexp_message"; + hash = "0r0skyr1zf2jh48xrxbs45gzywynhlivkq24xwc0qq435fmc2jqv"; + propagatedBuildInputs = [ ppx_sexp_conv ppx_here ]; + meta.description = "A ppx rewriter for easy construction of s-expressions"; + }; + + ppx_sexp_value = janePackage { + pname = "ppx_sexp_value"; + hash = "0hha5mmx700m8fy9g4znb8278l09chgwlpshny83vsmmzgq2jhah"; + propagatedBuildInputs = [ ppx_sexp_conv ppx_here ]; + meta.description = "A ppx rewriter that simplifies building s-expressions from OCaml values"; + }; + + ppx_typerep_conv = janePackage { + pname = "ppx_typerep_conv"; + hash = "0bzgfpbqijwxm8x9jq1zb4xi5sbzymk17lw5rylri3hf84p60aq1"; + propagatedBuildInputs = [ ppx_type_conv typerep ]; + meta.description = "Generation of runtime types from type declarations"; + }; + + ppx_jane = janePackage { + pname = "ppx_jane"; + hash = "16m5iw0qyp452nqj83kd0g0x3rw40lrz7392hwpd4di1wi6v2qzc"; + propagatedBuildInputs = [ ppx_base ppx_bench ppx_bin_prot ppx_expect ppx_fail ppx_let ppx_optional ppx_pipebang ppx_sexp_message ppx_sexp_value ppx_typerep_conv ]; + meta.description = "Standard Jane Street ppx rewriters"; + }; + + # Jane Street packages, up to core + + configurator = janePackage { + pname = "configurator"; + version = "0.9.1"; + hash = "1q0s0ghcrcrxdj6zr9zr27g7sr4qr9l14kizjphwqwwvgbzawdix"; + propagatedBuildInputs = [ ppx_base ]; + meta.description = "Helper library for gathering system configuration"; + }; + + jane-street-headers = janePackage { + pname = "jane-street-headers"; + hash = "0cdab6sblsidjbwvyvmspykyhqh44rpsjzi2djbfd5m4vh2h14gy"; + meta.description = "Jane Street header files"; + }; + + core_kernel = janePackage { + pname = "core_kernel"; + hash = "05iwvggx9m81x7ijgv9gcv5znf5rmsmb76dg909bm9gkr3hbh7wh"; + propagatedBuildInputs = [ configurator jane-street-headers ppx_jane ]; + meta.description = "Jane Street's standard library overlay (kernel)"; + }; + + spawn = janePackage { + pname = "spawn"; + hash = "1w53b8ni06ajj62yaqjy0pkbm952l0m5fzr088yk15078qaxsnb5"; + meta.description = "Spawning sub-processes"; + }; + + core = janePackage { + pname = "core"; + version = "0.9.1"; + hash = "1643r0namsgj8xwfr9niimcdwyyq4ddiwd02d73ipb4a8710aqi8"; + propagatedBuildInputs = [ core_kernel spawn ]; + meta.description = "Jane Street's standard library overlay"; + }; + + # Jane Street packages, up to core_extended + + re2 = janePackage { + pname = "re2"; + hash = "1qmhl3yd6y0lq401rz72b1bsbpglb0wighpxn3x8y1ixq415p4xi"; + propagatedBuildInputs = [ core_kernel ]; + meta = { + description = "OCaml bindings for RE2"; + broken = stdenv.isDarwin; + }; + }; + + textutils = janePackage { + pname = "textutils"; + hash = "1y6j2qw7rc8d80343lfv1dygnfrhn2qllz57mx28pl5kan743f6d"; + propagatedBuildInputs = [ core ]; + meta.description = "Text output utilities"; + }; + + core_extended = janePackage { + pname = "core_extended"; + hash = "05cnzzj0kigz9c9gsmd6mfar82wmkbqm9qzrydb80sy2fz5b30rk"; + propagatedBuildInputs = [ core re2 textutils ]; + postPatch = '' + patchShebangs src/discover.sh + ''; + meta = { + description = "Jane Street Capital's standard library overlay"; + }; + }; + + # Jane Street async packages + + async_kernel = janePackage { + pname = "async_kernel"; + hash = "1zwxhzy7f9900rcjls2fql9cpfmwrcah3fazzdz4h2i51f41w62x"; + propagatedBuildInputs = [ core_kernel ]; + meta.description = "Jane Street Capital's asynchronous execution library (core)"; + }; + + async_rpc_kernel = janePackage { + pname = "async_rpc_kernel"; + hash = "1xk3s6s3xkj182p10kig2cqy8md6znif3v661h9cd02n8s57c40b"; + propagatedBuildInputs = [ core_kernel async_kernel ]; + meta.description = "Platform-independent core of Async RPC library"; + }; + + async_unix = janePackage { + pname = "async_unix"; + hash = "0yd4z28j5vdj2zxqi0fkgh2ic1s9h740is2dk0raga0zr5a1z03d"; + propagatedBuildInputs = [ core async_kernel ]; + meta.description = "Jane Street Capital's asynchronous execution library (unix)"; + }; + + async_extra = janePackage { + pname = "async_extra"; + hash = "0rpy5lc5dh5mir7flq1jrppd8imby8wyw191yg4nmklg28xp5sx0"; + propagatedBuildInputs = [ async_rpc_kernel async_unix ]; + meta.description = "Jane Street's asynchronous execution library (extra)"; + }; + + async = janePackage { + pname = "async"; + hash = "10ykzym19srgdiikj0s74dndx5nk15hjq1r2hc61iz48f6caxkb1"; + propagatedBuildInputs = [ async_extra ]; + meta.description = "Jane Street Capital's asynchronous execution library"; + }; + + async_find = janePackage { + pname = "async_find"; + hash = "11dmhdzgf5kn4m0cm6zr28wpwhi2kr4lak9nmgxbrxsq28bcncxq"; + propagatedBuildInputs = [ async ]; + meta.description = "Directory traversal with Async"; + }; + + async_interactive = janePackage { + pname = "async_interactive"; + hash = "1mmqqp6bi2wg7bmgf0sw34jn3iyl5kbm200dax8yqq6rfprcs49j"; + propagatedBuildInputs = [ async ]; + meta.description = "Utilities for building simple command-line based user interfaces"; + }; + + async_parallel = janePackage { + pname = "async_parallel"; + hash = "0mdprhr1pv4g65g10gr3gaifrzknsdgarwfdbjlvhzfs86075kyn"; + propagatedBuildInputs = [ async ]; + meta.description = "Distributed computing library"; + }; + + async_shell = janePackage { + pname = "async_shell"; + hash = "02clpz3xv3i5avzifwalylb9gfxzpgnr8bnlfsjixxfk2m7kvsj2"; + propagatedBuildInputs = [ core_extended async ]; + meta = { + description = "Shell helpers for Async"; + }; + }; + + async_ssl = janePackage { + pname = "async_ssl"; + hash = "01w3bg38q61lc3hfh8jsr0sy1ylyv0m6g6h9yvsk8ngj6qk70nss"; + propagatedBuildInputs = [ async ctypes openssl ]; + meta.description = "Async wrappers for SSL"; + }; + + # Jane Street packages, up to expect_test_helpers + + sexp_pretty = janePackage { + pname = "sexp_pretty"; + hash = "1bx8va468j5b813m0vsh1jzgb6h2qnnjfmjlf2hb82sarv8lllfx"; + propagatedBuildInputs = [ ppx_base re ]; + meta.description = "S-expression pretty-printer"; + }; + + expect_test_helpers_kernel = janePackage { + pname = "expect_test_helpers_kernel"; + hash = "1ycqir8sqgq5nialnrfg29nqn0cqg6jjpgv24drdycdhqf5r2zg6"; + propagatedBuildInputs = [ core_kernel sexp_pretty ]; + meta.description = "Helpers for writing expectation tests"; + }; + + expect_test_helpers = janePackage { + pname = "expect_test_helpers"; + hash = "0rsh6rwbqfcrqisk8jp7srlnicsadbzrs02ri6zyx0p3lmznw5r2"; + propagatedBuildInputs = [ async expect_test_helpers_kernel ]; + meta.description = "Async helpers for writing expectation tests"; + }; + + # Miscellaneous Jane Street packages + + bignum = janePackage { + pname = "bignum"; + hash = "0g80mzsi7vc1kq4mzha8y9nl95h6cd041vix3wjrqgkdvb1qd4f3"; + propagatedBuildInputs = [ core_kernel zarith ]; + meta.description = "Core-flavoured wrapper around zarith's arbitrary-precision rationals"; + }; + + cinaps = janePackage { + pname = "cinaps"; + hash = "02fpjiwrygkpx2q4jfldhbqh0mqxmf955wizr8k4vmsq4wsis0p5"; + propagatedBuildInputs = [ re ]; + meta.description = "Trivial Metaprogramming tool using the OCaml toplevel"; + }; + + command_rpc = janePackage { + pname = "command_rpc"; + hash = "0w58z9jkz5qzbvf33wrzhfshzdvnrphj6dq8dmi52ykhfvxm7824"; + propagatedBuildInputs = [ async ]; + meta.description = "Utilities for Versioned RPC communication with a child process over stdin and stdout"; + }; + + core_bench = janePackage { + pname = "core_bench"; + hash = "1m2q7217nmcsck29i59djkm0h6z3aj0i01niijzr5f6ilbnmyd3h"; + propagatedBuildInputs = [ core_extended ]; + meta = { + description = "Micro-benchmarking library for OCaml"; + }; + }; + + core_profiler = janePackage { + pname = "core_profiler"; + hash = "1ir2v3wdfbf5xzqcma16asc73mkx2q6dzq5y1bx6q1rpa7iznx44"; + propagatedBuildInputs = [ core_extended ]; + meta = { + description = "Profiling library"; + }; + }; + + csvfields = janePackage { + pname = "csvfields"; + hash = "0lbvs1kwl22ryxhw6s089f6683hj2920bn518mvr22rnv7qijy0v"; + propagatedBuildInputs = [ core ]; + meta.description = "Runtime support for ppx_xml_conv and ppx_csv_conv"; + }; + + ecaml = janePackage { + pname = "ecaml"; + hash = "1a2534bzbwgpm71aj3sm71sm0lkcjdfjj1mk91p1pg9kxn8c5x4i"; + propagatedBuildInputs = [ async ]; + meta.description = "Writing Emacs plugin in OCaml"; + }; + + email_message = janePackage { + pname = "email_message"; + hash = "0cpaf6wn5g883bxdz029bksvrfzih99m7hzbb30fhqglmpmmkniz"; + propagatedBuildInputs = [ async core_extended cryptokit magic-mime ounit ]; + meta = { + description = "E-mail message parser"; + }; + }; + + incremental_kernel = janePackage { + pname = "incremental_kernel"; + hash = "0zq48wbgqcflh84n10iygi8aa3f0zzmgc7r0jwvsyg7i8zccgvf5"; + propagatedBuildInputs = [ core_kernel ]; + meta.description = "Library for incremental computations depending only on core_kernel"; + }; + + incremental = janePackage { + pname = "incremental"; + hash = "05sx8ia46v4dlvzcn7xgjcwxvbd0wmvv9r2bpvniapjnwr1nvcfh"; + propagatedBuildInputs = [ core incremental_kernel ]; + meta.description = "Library for incremental computations"; + }; + + incr_map = janePackage { + pname = "incr_map"; + hash = "0358qg9irxbbhn18laqww3mn43mdwvlbr0h2mvg3vdbb2c5jp4fv"; + propagatedBuildInputs = [ incremental_kernel ]; + meta.description = "Helpers for incremental operations on map like data structures"; + }; + + ocaml_plugin = janePackage { + pname = "ocaml_plugin"; + hash = "0q33swnlx9p1gcn1aj95501kapb7cnbzbsavid69csczwmzcxr14"; + buildInputs = [ ocamlbuild ]; + propagatedBuildInputs = [ async ]; + meta.description = "Automatically build and dynlink ocaml source files"; + }; + + parsexp = janePackage { + pname = "parsexp"; + hash = "0brrifvnfqbfk873v6y5b2jixs2d73hpispj9r440kca5cfsv23b"; + propagatedBuildInputs = [ ppx_compare ppx_fields_conv ppx_js_style ppx_sexp_value ]; + meta.description = "S-expression parsing library"; + }; + + parsexp_io = janePackage { + pname = "parsexp_io"; + hash = "0gcmh4dg48xgszladq92yhk1hf492zf0smz462xrwknzlfdkz6a5"; + propagatedBuildInputs = [ parsexp ]; + meta.description = "S-expression parsing library (IO functions)"; + }; + + patience_diff = janePackage { + pname = "patience_diff"; + hash = "0vpx9xj1ich5qmj3m26vlmix3nsdj7pd1xzhqwbc7ad2kqwy3grg"; + propagatedBuildInputs = [ core_kernel ]; + meta.description = "Tool and library implementing patience diff"; + }; + + posixat = janePackage { + pname = "posixat"; + hash = "0ak93dyzi6sc6gb0j07fj85b24d8bv6g2hm7jj5xwb39kjwh51jl"; + propagatedBuildInputs = [ ppx_sexp_conv ]; + meta.description = "Binding to the posix *at functions"; + meta.broken = lib.versionAtLeast ocaml.version "4.05"; + }; + + rpc_parallel = janePackage { + pname = "rpc_parallel"; + hash = "0s72msl2p27bz0knjlpgy5qwp0w4z76cq801ps0sab35f8jjfs38"; + propagatedBuildInputs = [ async ]; + meta.description = "Type-safe library for building parallel applications"; + }; + + shexp = janePackage { + pname = "shexp"; + hash = "1fkz4l9z4i0fz2kccd5blm2j9x2x4z6y1cn29wjmc3spqfxbq37y"; + propagatedBuildInputs = [ posixat spawn ]; + meta.description = "Process library and s-expression based shell"; + }; + + topological_sort = janePackage { + pname = "topological_sort"; + hash = "1d64fyq0clsgham9p1f5rk01z8pxalglp92xmqw2iznyw0vxhvsy"; + propagatedBuildInputs = [ core_kernel ]; + meta.description = "Topological sort algorithm"; + }; + + typerep_extended = janePackage { + pname = "typerep_extended"; + hash = "15gq8mrvlipd616rffr3f0wqw5d0ijnnizix610g2d5viirh0j9p"; + propagatedBuildInputs = [ core_kernel ]; + meta.description = "Runtime types for OCaml (Extended)"; + }; + +} diff --git a/pkgs/development/ocaml-modules/janestreet/sexp.patch b/pkgs/development/ocaml-modules/janestreet/sexp.patch new file mode 100644 index 00000000000..e56ce6508db --- /dev/null +++ b/pkgs/development/ocaml-modules/janestreet/sexp.patch @@ -0,0 +1,30 @@ +diff --git a/lazy_list/src/dune b/lazy_list/src/dune +index f1650ad..df90914 100644 +--- a/lazy_list/src/dune ++++ b/lazy_list/src/dune +@@ -1,2 +1,3 @@ + (library (name lazy_list) (libraries core_kernel) ++ (public_name sexp.lazy_list) + (preprocess (pps ppx_jane))) +\ No newline at end of file +diff --git a/sexp_app/pattern/dune b/sexp_app/pattern/dune +index b7d2c3b..baf136b 100644 +--- a/sexp_app/pattern/dune ++++ b/sexp_app/pattern/dune +@@ -1,4 +1,5 @@ + (library (name sexp_app_pattern) (libraries core re2 sexplib str) ++ (public_name sexp.sexp_app_pattern) + (preprocess (pps ppx_jane))) + + (ocamllex lexer) +diff --git a/sexp_app/src/dune b/sexp_app/src/dune +index b91ff40..a07a4e7 100644 +--- a/sexp_app/src/dune ++++ b/sexp_app/src/dune +@@ -1,4 +1,5 @@ + (library (name sexp_app) (libraries core lazy_list re2 sexplib str) ++ (public_name sexp.sexp_app) + (preprocess (pps ppx_jane -allow-unannotated-ignores))) + + (ocamllex csv_lexeme) +\ No newline at end of file diff --git a/pkgs/development/ocaml-modules/javalib/Makefile.config.example.patch b/pkgs/development/ocaml-modules/javalib/Makefile.config.example.patch new file mode 100644 index 00000000000..c06144a75c0 --- /dev/null +++ b/pkgs/development/ocaml-modules/javalib/Makefile.config.example.patch @@ -0,0 +1,9 @@ +--- javalib-2.3-orig/Makefile.config.example 2013-10-30 08:35:30.000000000 +0100 ++++ javalib-2.3/Makefile.config.example 2014-07-06 17:32:29.799398394 +0200 +@@ -1,6 +1,3 @@ +-export OCAMLFIND_DESTDIR=$(LOCALDEST) +-export OCAMLPATH=$(LOCALDEST) +- + OCAMLC = $(FINDER) ocamlc $(FLAGS) + OCAMLOPT = $(FINDER) ocamlopt $(OPT_FLAGS) + OCAMLDOC = $(FINDER) ocamldoc diff --git a/pkgs/development/ocaml-modules/javalib/configure.sh.patch b/pkgs/development/ocaml-modules/javalib/configure.sh.patch new file mode 100644 index 00000000000..67e019b277a --- /dev/null +++ b/pkgs/development/ocaml-modules/javalib/configure.sh.patch @@ -0,0 +1,11 @@ +--- javalib-2.3-orig/configure.sh 2013-10-30 08:35:30.000000000 +0100 ++++ javalib-2.3/configure.sh 2014-07-06 17:28:39.025066199 +0200 +@@ -44,7 +44,7 @@ + DESTDIR= + # The ocamlpath variable for the compiler to locate the locally-installed + # packages (depends on LOCALDEST) +-OCAMLPATH= ++#OCAMLPATH= + # The packages that need to be made in addition to Savalib / Sawja + MAKEDEP= + # The packages that need to be made in addition to Savalib / Sawja diff --git a/pkgs/development/ocaml-modules/javalib/default.nix b/pkgs/development/ocaml-modules/javalib/default.nix new file mode 100644 index 00000000000..ccd3fa19a92 --- /dev/null +++ b/pkgs/development/ocaml-modules/javalib/default.nix @@ -0,0 +1,50 @@ +{ lib +, stdenv +, fetchFromGitHub +, which +, ocaml +, findlib +, camlzip +, extlib +}: + +if !lib.versionAtLeast ocaml.version "4.04" +then throw "javalib is not available for OCaml ${ocaml.version}" +else + +stdenv.mkDerivation rec { + pname = "ocaml${ocaml.version}-javalib"; + version = "3.2.1"; + + src = fetchFromGitHub { + owner = "javalib-team"; + repo = "javalib"; + rev = "v${version}"; + sha256 = "sha256-du1h+S+A7CetMXofsYxdGeSsobCgspDB9oUE9WNUbbo="; + }; + + nativeBuildInputs = [ which ocaml findlib ]; + + strictDeps = true; + + patches = [ ./configure.sh.patch ./Makefile.config.example.patch ]; + + createFindlibDestdir = true; + + preConfigure = "patchShebangs ./configure.sh"; + + configureScript = "./configure.sh"; + dontAddPrefix = "true"; + dontAddStaticConfigureFlags = true; + configurePlatforms = [ ]; + + propagatedBuildInputs = [ camlzip extlib ]; + + meta = with lib; { + description = "A library that parses Java .class files into OCaml data structures"; + homepage = "https://javalib-team.github.io/javalib/"; + license = licenses.lgpl3; + maintainers = [ maintainers.vbgl ]; + inherit (ocaml.meta) platforms; + }; +} diff --git a/pkgs/development/ocaml-modules/jingoo/default.nix b/pkgs/development/ocaml-modules/jingoo/default.nix new file mode 100644 index 00000000000..cc2c65009ff --- /dev/null +++ b/pkgs/development/ocaml-modules/jingoo/default.nix @@ -0,0 +1,31 @@ +{ lib, buildDunePackage, fetchFromGitHub +, menhir, ppxlib, ppx_deriving, re, uutf, uucp, ounit2 }: + +buildDunePackage rec { + pname = "jingoo"; + version = "1.4.2"; + + useDune2 = true; + + minimumOCamlVersion = "4.04"; + + src = fetchFromGitHub { + owner = "tategakibunko"; + repo = "jingoo"; + rev = "v${version}"; + sha256 = "0q947aik4i4z5wjllhwlkxh60qczwgra21yyrrzwhi9y5bnf8346"; + }; + + buildInputs = [ menhir ]; + propagatedBuildInputs = [ ppxlib ppx_deriving re uutf uucp ]; + checkInputs = [ ounit2 ]; + doCheck = true; + + + meta = with lib; { + homepage = "https://github.com/tategakibunko/jingoo"; + description = "OCaml template engine almost compatible with jinja2"; + license = licenses.mit; + maintainers = [ maintainers.ericbmerritt ]; + }; +} diff --git a/pkgs/development/ocaml-modules/json-data-encoding/bson.nix b/pkgs/development/ocaml-modules/json-data-encoding/bson.nix new file mode 100644 index 00000000000..d131acf4b48 --- /dev/null +++ b/pkgs/development/ocaml-modules/json-data-encoding/bson.nix @@ -0,0 +1,21 @@ +{ lib, buildDunePackage, json-data-encoding, ocplib-endian, crowbar, alcotest }: + +buildDunePackage { + pname = "json-data-encoding-bson"; + + inherit (json-data-encoding) version src useDune2 doCheck; + + propagatedBuildInputs = [ + json-data-encoding + ocplib-endian + ]; + + checkInputs = [ + crowbar + alcotest + ]; + + meta = json-data-encoding.meta // { + description = "Type-safe encoding to and decoding from JSON (bson support)"; + }; +} diff --git a/pkgs/development/ocaml-modules/json-data-encoding/default.nix b/pkgs/development/ocaml-modules/json-data-encoding/default.nix new file mode 100644 index 00000000000..69fbdb6ed1c --- /dev/null +++ b/pkgs/development/ocaml-modules/json-data-encoding/default.nix @@ -0,0 +1,32 @@ +{ lib, fetchFromGitLab, buildDunePackage, uri, crowbar, alcotest }: + +buildDunePackage rec { + pname = "json-data-encoding"; + version = "0.10"; + minimalOCamlVersion = "4.10"; + src = fetchFromGitLab { + owner = "nomadic-labs"; + repo = "json-data-encoding"; + rev = "${version}"; + sha256 = "0m0xx382wr44wz7gxf7mpfjx2w287pvqhg2lfvzmclfq3y5iy6mx"; + }; + useDune2 = true; + + propagatedBuildInputs = [ + uri + ]; + + checkInputs = [ + crowbar + alcotest + ]; + + doCheck = true; + + meta = { + homepage = "https://gitlab.com/nomadic-labs/json-data-encoding"; + description = "Type-safe encoding to and decoding from JSON"; + license = lib.licenses.lgpl3; + maintainers = [ lib.maintainers.ulrikstrid ]; + }; +} diff --git a/pkgs/development/ocaml-modules/jsonm/default.nix b/pkgs/development/ocaml-modules/jsonm/default.nix new file mode 100644 index 00000000000..2b9c9918382 --- /dev/null +++ b/pkgs/development/ocaml-modules/jsonm/default.nix @@ -0,0 +1,27 @@ +{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, topkg, uutf }: + +stdenv.mkDerivation rec { + pname = "ocaml${ocaml.version}-jsonm"; + version = "1.0.1"; + + src = fetchurl { + url = "https://erratique.ch/software/jsonm/releases/jsonm-${version}.tbz"; + sha256 = "1176dcmxb11fnw49b7yysvkjh0kpzx4s48lmdn5psq9vshp5c29w"; + }; + + nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ]; + buildInputs = [ topkg ]; + propagatedBuildInputs = [ uutf ]; + + strictDeps = true; + + inherit (topkg) buildPhase installPhase; + + meta = { + description = "An OCaml non-blocking streaming codec to decode and encode the JSON data format"; + homepage = "https://erratique.ch/software/jsonm"; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ vbgl ]; + platforms = ocaml.meta.platforms or []; + }; +} diff --git a/pkgs/development/ocaml-modules/junit/alcotest.nix b/pkgs/development/ocaml-modules/junit/alcotest.nix new file mode 100644 index 00000000000..85abaf7f872 --- /dev/null +++ b/pkgs/development/ocaml-modules/junit/alcotest.nix @@ -0,0 +1,14 @@ +{ buildDunePackage, junit, alcotest }: + +buildDunePackage ({ + pname = "junit_alcotest"; + + inherit (junit) src version meta useDune2; + + propagatedBuildInputs = [ + junit + alcotest + ]; + + doCheck = false; # 2 tests fail: 1) "Test with unexpected exception"; 2) "with wrong result"; +}) diff --git a/pkgs/development/ocaml-modules/junit/default.nix b/pkgs/development/ocaml-modules/junit/default.nix new file mode 100644 index 00000000000..4c1df880ec8 --- /dev/null +++ b/pkgs/development/ocaml-modules/junit/default.nix @@ -0,0 +1,26 @@ +{ lib, fetchurl, buildDunePackage, ptime, tyxml }: + +buildDunePackage (rec { + pname = "junit"; + version = "2.0.2"; + + src = fetchurl { + url = "https://github.com/Khady/ocaml-junit/releases/download/${version}/junit-${version}.tbz"; + sha256 = "00bbx5j8vsy9fqbc04xa3lsalaxicirmbczr65bllfk1afv43agx"; + }; + + propagatedBuildInputs = [ + ptime + tyxml + ]; + + useDune2 = true; + doCheck = true; + + meta = with lib; { + description = "ocaml-junit is an OCaml package for the creation of JUnit XML reports, proving a typed API to produce valid reports acceptable to Jenkins, comes with packages supporting OUnit and Alcotest."; + license = licenses.gpl3; + maintainers = with maintainers; [ ]; + homepage = "https://github.com/Khady/ocaml-junit"; + }; +}) diff --git a/pkgs/development/ocaml-modules/junit/ounit.nix b/pkgs/development/ocaml-modules/junit/ounit.nix new file mode 100644 index 00000000000..5f261b07236 --- /dev/null +++ b/pkgs/development/ocaml-modules/junit/ounit.nix @@ -0,0 +1,14 @@ +{ buildDunePackage, junit, ounit }: + +buildDunePackage ({ + pname = "junit_ounit"; + + inherit (junit) src version meta useDune2; + + propagatedBuildInputs = [ + junit + ounit + ]; + + doCheck = true; +}) diff --git a/pkgs/development/ocaml-modules/jwto/default.nix b/pkgs/development/ocaml-modules/jwto/default.nix new file mode 100644 index 00000000000..3950c13d3fc --- /dev/null +++ b/pkgs/development/ocaml-modules/jwto/default.nix @@ -0,0 +1,35 @@ +{ lib, buildDunePackage, fetchFromGitHub, alcotest, cryptokit, fmt, yojson +, ppxlib +, base64, re, ppx_deriving }: + +buildDunePackage rec { + pname = "jwto"; + version = "0.3.0"; + + useDune2 = true; + + minimumOCamlVersion = "4.05"; + + src = fetchFromGitHub { + owner = "sporto"; + repo = "jwto"; + rev = version; + sha256 = "1p799zk8j9c0002xzi2x7ndj1bzqf14744ampcqndrjnsi7mq71s"; + }; + + buildInputs = [ ppxlib ]; + + propagatedBuildInputs = + [ cryptokit fmt yojson base64 re ppx_deriving ]; + + checkInputs = [ alcotest ]; + + doCheck = true; + + meta = { + homepage = "https://github.com/sporto/jwto"; + description = "JSON Web Tokens (JWT) for OCaml"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ Zimmi48 jtcoolen ]; + }; +} diff --git a/pkgs/development/ocaml-modules/kafka/default.nix b/pkgs/development/ocaml-modules/kafka/default.nix new file mode 100644 index 00000000000..7636942033a --- /dev/null +++ b/pkgs/development/ocaml-modules/kafka/default.nix @@ -0,0 +1,24 @@ +{ lib, fetchurl, buildDunePackage +, rdkafka, zlib }: + +buildDunePackage rec { + pname = "kafka"; + version = "0.5"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/didier-wenzek/ocaml-kafka/releases/download/${version}/kafka-${version}.tbz"; + sha256 = "0m9212yap0a00hd0f61i4y4fna3141p77qj3mm7jl1h4q60jdhvy"; + }; + + propagatedBuildInputs = [ rdkafka zlib ]; + + meta = with lib; { + homepage = "https://github.com/didier-wenzek/ocaml-kafka"; + description = "OCaml bindings for Kafka"; + license = licenses.mit; + maintainers = [ maintainers.vbgl ]; + }; +} + diff --git a/pkgs/development/ocaml-modules/kafka/lwt.nix b/pkgs/development/ocaml-modules/kafka/lwt.nix new file mode 100644 index 00000000000..a6cef66b276 --- /dev/null +++ b/pkgs/development/ocaml-modules/kafka/lwt.nix @@ -0,0 +1,19 @@ +{ buildDunePackage +, kafka +, lwt +, cmdliner +}: + +buildDunePackage rec { + pname = "kafka_lwt"; + + inherit (kafka) version useDune2 src; + + buildInputs = [ cmdliner ]; + + propagatedBuildInputs = [ kafka lwt ]; + + meta = kafka.meta // { + description = "OCaml bindings for Kafka, Lwt bindings"; + }; +} diff --git a/pkgs/development/ocaml-modules/ke/default.nix b/pkgs/development/ocaml-modules/ke/default.nix new file mode 100644 index 00000000000..f14383207ea --- /dev/null +++ b/pkgs/development/ocaml-modules/ke/default.nix @@ -0,0 +1,30 @@ +{ lib, buildDunePackage, fetchurl +, bigarray-compat, fmt +, alcotest, bigstringaf +}: + +buildDunePackage rec { + pname = "ke"; + version = "0.4"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/mirage/ke/releases/download/v${version}/ke-v${version}.tbz"; + sha256 = "13c9xy60vmq29mnwpg3h3zgl6gjbjfwbx1s0crfc6xwvark0zxnx"; + }; + + propagatedBuildInputs = [ bigarray-compat fmt ]; + + checkInputs = [ alcotest bigstringaf ]; + doCheck = true; + + minimumOCamlVersion = "4.03"; + + meta = { + description = "Fast implementation of queue in OCaml"; + homepage = "https://github.com/mirage/ke"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/lablgl/META.patch b/pkgs/development/ocaml-modules/lablgl/META.patch new file mode 100644 index 00000000000..bf5b2184ac0 --- /dev/null +++ b/pkgs/development/ocaml-modules/lablgl/META.patch @@ -0,0 +1,18 @@ +diff -r 562eb6ecb8ca META +--- a/META Wed Oct 01 20:09:24 2014 +0100 ++++ b/META Wed Oct 01 20:22:15 2014 +0100 +@@ -1,6 +1,5 @@ +-description "Bindings for OpenGL" ++description="Bindings for OpenGL" + version="1.05" +-directory="+lablGL" + archive(byte) = "lablgl.cma" + archive(native) = "lablgl.cmxa" + +@@ -16,4 +15,4 @@ + requires = "lablgl" + archive(byte) = "lablglut.cma" + archive(native) = "lablglut.cmxa" +-) +\ No newline at end of file ++) diff --git a/pkgs/development/ocaml-modules/lablgl/Makefile.config.patch b/pkgs/development/ocaml-modules/lablgl/Makefile.config.patch new file mode 100644 index 00000000000..3d880c00947 --- /dev/null +++ b/pkgs/development/ocaml-modules/lablgl/Makefile.config.patch @@ -0,0 +1,67 @@ +diff -Naur lablGL.ori/Makefile.config lablGL/Makefile.config +--- lablGL.ori/Makefile.config 1970-01-01 01:00:00.000000000 +0100 ++++ lablGL/Makefile.config 2013-06-02 08:13:10.000000000 +0200 +@@ -0,0 +1,63 @@ ++# LablGL and Togl configuration file ++# ++# Please have a look at the config/Makefile in the Objective Caml distribution, ++# or at the labltklink script to get the information needed here ++# ++ ++##### Adjust these always ++ ++# Uncomment if you have the fast ".opt" compilers ++#CAMLC = ocamlc.opt ++#CAMLOPT = ocamlopt.opt ++ ++# Where to put the lablgl script ++BINDIR = @BINDIR@ ++ ++# Where to find X headers ++XINCLUDES = @XINCLUDES@ ++# X libs (for broken RTLD_GLOBAL: e.g. FreeBSD 4.0) ++#XLIBS = -L/usr/X11R6/lib -lXext -lXmu -lX11 -lXi ++ ++# Where to find Tcl/Tk headers ++# This must the same version as for LablTk ++TKINCLUDES = @TKINCLUDES@ ++# Tcl/Tk libs (for broken RTLD_GLOBAL: e.g. FreeBSD 4.0) ++#TKLIBS = -L/usr/local/lib -ltk84 -ltcl84 ++ ++# Where to find OpenGL/Mesa/Glut headers and libraries ++GLINCLUDES = ++GLLIBS = -lGL -lGLU ++GLUTLIBS = -lglut ++# The following libraries may be required (try to add them one at a time) ++#GLLIBS = -lGL -lGLU -lXmu -lXext -lXi -lcipher -lpthread ++ ++# How to index a library after installing (ranlib required on MacOSX) ++RANLIB = : ++#RANLIB = ranlib ++ ++##### Uncomment these for windows ++#TKLIBS = tk83.lib tcl83.lib gdi32.lib user32.lib ++#GLLIBS = opengl32.lib glu32.lib ++#TOOLCHAIN = msvc ++#XA = .lib ++#XB = .bat ++#XE = .exe ++#XO = .obj ++#XS = .dll ++ ++##### Adjust these if non standard ++ ++# The Objective Caml library directory ++#LIBDIR = `ocamlc -where` ++ ++# Where to put dlls (if dynamic loading available) ++DLLDIR = @DLLDIR@ ++ ++# Where to put LablGL (standard) ++INSTALLDIR = @INSTALLDIR@ ++ ++# Where is Togl (default) ++#TOGLDIR = Togl ++ ++# C Compiler options ++#COPTS = -c -O diff --git a/pkgs/development/ocaml-modules/lablgl/default.nix b/pkgs/development/ocaml-modules/lablgl/default.nix new file mode 100644 index 00000000000..85c27f93a09 --- /dev/null +++ b/pkgs/development/ocaml-modules/lablgl/default.nix @@ -0,0 +1,48 @@ +{ lib, stdenv, fetchFromGitHub, ocaml, findlib, libGLU, libGL, freeglut } : + +if !lib.versionAtLeast ocaml.version "4.03" +then throw "lablgl is not available for OCaml ${ocaml.version}" +else + +stdenv.mkDerivation rec { + pname = "ocaml${ocaml.version}-lablgl"; + version = "1.06"; + + src = fetchFromGitHub { + owner = "garrigue"; + repo = "lablgl"; + rev = "v${version}"; + sha256 = "sha256:141kc816iv59z96738i3vn9m9iw9g2zhi45hk4cchpwd99ar5l6k"; + }; + + nativeBuildInputs = [ ocaml findlib ]; + buildInputs = [ freeglut ]; + propagatedBuildInputs = [ libGLU libGL ]; + + patches = [ ./Makefile.config.patch ./META.patch ]; + + preConfigure = '' + mkdir -p $out/bin + mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib/stublibs + substituteInPlace Makefile.config \ + --subst-var-by BINDIR $out/bin/ \ + --subst-var-by INSTALLDIR $out/lib/ocaml/${ocaml.version}/site-lib/lablgl/ \ + --subst-var-by DLLDIR $out/lib/ocaml/${ocaml.version}/site-lib/stublibs/ \ + --subst-var-by TKINCLUDES "" \ + --subst-var-by XINCLUDES "" + ''; + + buildFlags = [ "lib" "libopt" "glut" "glutopt" ]; + + postInstall = '' + cp ./META $out/lib/ocaml/${ocaml.version}/site-lib/lablgl + ''; + + meta = with lib; { + homepage = "http://wwwfun.kurims.kyoto-u.ac.jp/soft/lsl/lablgl.html"; + description = "OpenGL bindings for ocaml"; + license = licenses.gpl2; + maintainers = with maintainers; [ pSub vbgl ]; + broken = stdenv.isDarwin; + }; +} diff --git a/pkgs/development/ocaml-modules/lablgtk-extras/1.4.nix b/pkgs/development/ocaml-modules/lablgtk-extras/1.4.nix new file mode 100644 index 00000000000..bcf82e1c384 --- /dev/null +++ b/pkgs/development/ocaml-modules/lablgtk-extras/1.4.nix @@ -0,0 +1,25 @@ +{ stdenv, lib, fetchurl, ocaml, findlib, camlp4, config-file, lablgtk, xmlm }: + +stdenv.mkDerivation rec { + pname = "ocaml-lablgtk-extras"; + version = "1.4"; + + src = fetchurl { + url = "http://forge.ocamlcore.org/frs/download.php/1282/lablgtkextras-${version}.tar.gz"; + sha256 = "09fqxwdib7r9yxynknc9gv3jw2hnhj5cak7q5jngk6m8rzvmhfcc"; + }; + + nativeBuildInputs = [ ocaml findlib camlp4 ]; + propagatedBuildInputs = [ config-file lablgtk xmlm ]; + + createFindlibDestdir = true; + + meta = { + platforms = ocaml.meta.platforms or [ ]; + maintainers = with lib.maintainers; [ vbgl ]; + homepage = "http://gtk-extras.forge.ocamlcore.org/"; + description = "A collection of libraries and modules useful when developing OCaml/LablGtk2 applications"; + license = lib.licenses.lgpl2Plus; + branch = "1.4"; + }; +} diff --git a/pkgs/development/ocaml-modules/lablgtk-extras/default.nix b/pkgs/development/ocaml-modules/lablgtk-extras/default.nix new file mode 100644 index 00000000000..736e345dfb3 --- /dev/null +++ b/pkgs/development/ocaml-modules/lablgtk-extras/default.nix @@ -0,0 +1,31 @@ +{ stdenv, lib, fetchFromGitLab, ocaml, findlib, camlp4, config-file, lablgtk, xmlm }: + +if !lib.versionAtLeast ocaml.version "4.02" +|| lib.versionAtLeast ocaml.version "4.13" +then throw "lablgtk-extras is not available for OCaml ${ocaml.version}" +else + +stdenv.mkDerivation rec { + version = "1.6"; + pname = "ocaml${ocaml.version}-lablgtk-extras"; + src = fetchFromGitLab { + domain = "framagit.org"; + owner = "zoggy"; + repo = "lablgtk-extras"; + rev = "release-${version}"; + sha256 = "1bbdp5j18s582mmyd7qiaq1p08g2ag4gl7x65pmzahbhg719hjda"; + }; + + nativeBuildInputs = [ ocaml findlib camlp4 ]; + propagatedBuildInputs = [ config-file lablgtk xmlm ]; + + createFindlibDestdir = true; + + meta = { + inherit (ocaml.meta) platforms; + maintainers = with lib.maintainers; [ vbgl ]; + homepage = "https://framagit.org/zoggy/lablgtk-extras/"; + description = "A collection of libraries and modules useful when developing OCaml/LablGtk2 applications"; + license = lib.licenses.lgpl2Plus; + }; +} diff --git a/pkgs/development/ocaml-modules/lablgtk/2.14.0.nix b/pkgs/development/ocaml-modules/lablgtk/2.14.0.nix new file mode 100644 index 00000000000..f37c3b5c6f9 --- /dev/null +++ b/pkgs/development/ocaml-modules/lablgtk/2.14.0.nix @@ -0,0 +1,41 @@ +{ stdenv, lib, fetchurl, ocaml, findlib, pkg-config, gtk2, libgnomecanvas, gtksourceview, camlp4 }: + +if lib.versionAtLeast ocaml.version "4.04" +then throw "lablgtk-2.14 is not available for OCaml ${ocaml.version}" else + +let + pname = "lablgtk"; +in + +stdenv.mkDerivation (rec { + name = "${pname}-${version}"; + version = "2.14.0"; + + src = fetchurl { + url = "https://forge.ocamlcore.org/frs/download.php/561/${name}.tar.gz"; + sha256 = "1fnh0amm7lwgyjdhmlqgsp62gwlar1140425yc1j6inwmgnsp0a9"; + }; + + nativeBuildInputs = [ pkg-config ocaml findlib camlp4 ]; + buildInputs = [ gtk2 libgnomecanvas gtksourceview ]; + + configureFlags = [ "--with-libdir=$(out)/lib/ocaml/${ocaml.version}/site-lib" ]; + buildFlags = [ "world" ]; + + preInstall = '' + mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib + export OCAMLPATH=$out/lib/ocaml/${ocaml.version}/site-lib/:$OCAMLPATH + ''; + + meta = { + branch = "2.14"; + platforms = ocaml.meta.platforms or []; + maintainers = [ + lib.maintainers.maggesi + lib.maintainers.roconnor + ]; + homepage = "http://wwwfun.kurims.kyoto-u.ac.jp/soft/lsl/lablgtk.html"; + description = "LablGTK is is an Objective Caml interface to GTK"; + license = lib.licenses.lgpl21Plus; + }; +}) diff --git a/pkgs/development/ocaml-modules/lablgtk/default.nix b/pkgs/development/ocaml-modules/lablgtk/default.nix new file mode 100644 index 00000000000..36ade6979c3 --- /dev/null +++ b/pkgs/development/ocaml-modules/lablgtk/default.nix @@ -0,0 +1,48 @@ +{ lib, stdenv, fetchurl, fetchFromGitHub, ocaml, findlib, pkg-config, gtk2, libgnomecanvas, gtksourceview }: + +let param = + let check = lib.versionAtLeast ocaml.version; in + if check "4.06" then rec { + version = "2.18.12"; + src = fetchFromGitHub { + owner = "garrigue"; + repo = "lablgtk"; + rev = version; + sha256 = "sha256:0asib87c42apwf1ln8541x6i3mvyajqbarifvz11in0mqn5k7g7h"; + }; + } else if check "3.12" then { + version = "2.18.5"; + src = fetchurl { + url = "https://forge.ocamlcore.org/frs/download.php/1627/lablgtk-2.18.5.tar.gz"; + sha256 = "0cyj6sfdvzx8hw7553lhgwc0krlgvlza0ph3dk9gsxy047dm3wib"; + }; + } else throw "lablgtk is not available for OCaml ${ocaml.version}"; +in + +stdenv.mkDerivation { + pname = "lablgtk"; + inherit (param) version src; + + nativeBuildInputs = [ pkg-config ocaml findlib ]; + buildInputs = [ gtk2 libgnomecanvas gtksourceview ]; + + configureFlags = [ "--with-libdir=$(out)/lib/ocaml/${ocaml.version}/site-lib" ]; + buildFlags = [ "world" ]; + + preInstall = '' + mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib + export OCAMLPATH=$out/lib/ocaml/${ocaml.version}/site-lib/:$OCAMLPATH + ''; + + dontStrip = true; + + meta = with lib; { + platforms = ocaml.meta.platforms or []; + maintainers = with maintainers; [ + maggesi roconnor vbgl + ]; + homepage = "http://lablgtk.forge.ocamlcore.org/"; + description = "An OCaml interface to GTK"; + license = licenses.lgpl21Plus; + }; +} diff --git a/pkgs/development/ocaml-modules/lablgtk3/default.nix b/pkgs/development/ocaml-modules/lablgtk3/default.nix new file mode 100644 index 00000000000..81fb51d1f1e --- /dev/null +++ b/pkgs/development/ocaml-modules/lablgtk3/default.nix @@ -0,0 +1,33 @@ +{ lib, fetchFromGitHub, fetchpatch, pkg-config, buildDunePackage, dune-configurator, gtk3, cairo2 }: + +buildDunePackage rec { + version = "3.1.2"; + pname = "lablgtk3"; + + useDune2 = true; + + minimalOCamlVersion = "4.05"; + + src = fetchFromGitHub { + owner = "garrigue"; + repo = "lablgtk"; + rev = version; + sha256 = "sha256:0b17w9qb1f02h3313cm62mrqlhwxficppzm72n7sf8mmwrylxbm7"; + }; + + patches = [ (fetchpatch { + name = "dune-project.patch"; + url = "https://raw.githubusercontent.com/ocaml/opam-repository/10a48cb9fab88f67f6cb70280e0fec035c32d41c/packages/lablgtk3/lablgtk3.3.1.2/files/dune-project.patch"; + sha256 = "03jf5hclqdq7iq84djaqcnfnnnd7z3hb48rr8n1gyxzjyx86b3fh"; + }) ]; + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ dune-configurator ]; + propagatedBuildInputs = [ gtk3 cairo2 ]; + + meta = { + description = "OCaml interface to GTK 3"; + homepage = "http://lablgtk.forge.ocamlcore.org/"; + license = lib.licenses.lgpl21; + maintainers = [ lib.maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/lablgtk3/gtkspell3.nix b/pkgs/development/ocaml-modules/lablgtk3/gtkspell3.nix new file mode 100644 index 00000000000..b037f7d989f --- /dev/null +++ b/pkgs/development/ocaml-modules/lablgtk3/gtkspell3.nix @@ -0,0 +1,8 @@ +{ buildDunePackage, gtkspell3, lablgtk3 }: + +buildDunePackage { + pname = "lablgtk3-gtkspell3"; + buildInputs = [ gtkspell3 ] ++ lablgtk3.buildInputs; + propagatedBuildInputs = [ lablgtk3 ]; + inherit (lablgtk3) src version useDune2 meta nativeBuildInputs; +} diff --git a/pkgs/development/ocaml-modules/lablgtk3/sourceview3.nix b/pkgs/development/ocaml-modules/lablgtk3/sourceview3.nix new file mode 100644 index 00000000000..a0560029880 --- /dev/null +++ b/pkgs/development/ocaml-modules/lablgtk3/sourceview3.nix @@ -0,0 +1,8 @@ +{ buildDunePackage, gtksourceview, lablgtk3 }: + +buildDunePackage { + pname = "lablgtk3-sourceview3"; + buildInputs = lablgtk3.buildInputs ++ [ gtksourceview ]; + propagatedBuildInputs = [ lablgtk3 ]; + inherit (lablgtk3) src version useDune2 meta nativeBuildInputs; +} diff --git a/pkgs/development/ocaml-modules/labltk/default.nix b/pkgs/development/ocaml-modules/labltk/default.nix new file mode 100644 index 00000000000..56e79ffc590 --- /dev/null +++ b/pkgs/development/ocaml-modules/labltk/default.nix @@ -0,0 +1,82 @@ +{ stdenv, lib, makeWrapper, fetchzip, ocaml, findlib, tcl, tk }: + +let + params = + let mkNewParam = { version, sha256, rev ? version }: { + inherit version; + src = fetchzip { + url = "https://github.com/garrigue/labltk/archive/${rev}.tar.gz"; + inherit sha256; + }; + }; in + rec { + "4.06" = mkNewParam { + version = "8.06.4"; + rev = "labltk-8.06.4"; + sha256 = "03xwnnnahb2rf4siymzqyqy8zgrx3h26qxjgbp5dh1wdl7n02c7g"; + }; + "4.07" = mkNewParam { + version = "8.06.5"; + rev = "1b71e2c6f3ae6847d3d5e79bf099deb7330fb419"; + sha256 = "02vchmrm3izrk7daldd22harhgrjhmbw6i1pqw6hmfmrmrypypg2"; + }; + _8_06_7 = mkNewParam { + version = "8.06.7"; + sha256 = "1cqnxjv2dvw9csiz4iqqyx6rck04jgylpglk8f69kgybf7k7xk2h"; + }; + "4.08" = _8_06_7; + "4.09" = _8_06_7; + "4.10" = mkNewParam { + version = "8.06.8"; + sha256 = "0lfjc7lscq81ibqb3fcybdzs2r1i2xl7rsgi7linq46a0pcpkinw"; + }; + "4.11" = mkNewParam { + version = "8.06.9"; + sha256 = "1k42k3bjkf22gk39lwwzqzfhgjyhxnclslldrzpg5qy1829pbnc0"; + }; + "4.12" = mkNewParam { + version = "8.06.10"; + sha256 = "06cck7wijq4zdshzhxm6jyl8k3j0zglj2axsyfk6q1sq754zyf4a"; + }; + "4.13" = mkNewParam { + version = "8.06.11"; + sha256 = "1zjpg9jvs6i9jvbgn6zgispwqiv8rxvaszxcx9ha9fax3wzhv9qy"; + }; + }; + param = params . ${lib.versions.majorMinor ocaml.version} + or (throw "labltk is not available for OCaml ${ocaml.version}"); +in + +stdenv.mkDerivation rec { + inherit (param) version src; + pname = "ocaml${ocaml.version}-labltk"; + + nativeBuildInputs = [ ocaml findlib makeWrapper ]; + buildInputs = [ tcl tk ]; + + configureFlags = [ "--use-findlib" "--installbindir" "$(out)/bin" ]; + dontAddPrefix = true; + dontAddStaticConfigureFlags = true; + configurePlatforms = []; + + buildFlags = [ "all" "opt" ]; + + createFindlibDestdir = true; + + postInstall = '' + mkdir -p $OCAMLFIND_DESTDIR/stublibs + mv $OCAMLFIND_DESTDIR/labltk/dlllabltk.so $OCAMLFIND_DESTDIR/stublibs/ + for p in $out/bin/* + do + wrapProgram $p --set CAML_LD_LIBRARY_PATH $OCAMLFIND_DESTDIR/stublibs + done + ''; + + meta = { + description = "OCaml interface to Tcl/Tk, including OCaml library explorer OCamlBrowser"; + homepage = "http://labltk.forge.ocamlcore.org/"; + license = lib.licenses.lgpl21; + inherit (ocaml.meta) platforms; + maintainers = [ lib.maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/lacaml/default.nix b/pkgs/development/ocaml-modules/lacaml/default.nix new file mode 100644 index 00000000000..fc2327b736e --- /dev/null +++ b/pkgs/development/ocaml-modules/lacaml/default.nix @@ -0,0 +1,31 @@ +{ lib, stdenv, fetchurl, darwin, buildDunePackage, dune-configurator +, lapack, blas +}: + +assert (!blas.isILP64) && (!lapack.isILP64); + +buildDunePackage rec { + pname = "lacaml"; + version = "11.0.8"; + + useDune2 = true; + + minimumOCamlVersion = "4.08"; + + src = fetchurl { + url = "https://github.com/mmottl/lacaml/releases/download/${version}/lacaml-${version}.tbz"; + sha256 = "1i47wqnd9iy6ndbi9zfahpb592gahp6im26rgpwch13vgzk3kifd"; + }; + + buildInputs = [ dune-configurator ]; + propagatedBuildInputs = [ lapack blas ] ++ + lib.optionals stdenv.isDarwin + [ darwin.apple_sdk.frameworks.Accelerate ]; + + meta = with lib; { + homepage = "https://mmottl.github.io/lacaml"; + description = "OCaml bindings for BLAS and LAPACK"; + license = licenses.lgpl21Plus; + maintainers = [ maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/lambda-term/default.nix b/pkgs/development/ocaml-modules/lambda-term/default.nix new file mode 100644 index 00000000000..b7ed4f24b1d --- /dev/null +++ b/pkgs/development/ocaml-modules/lambda-term/default.nix @@ -0,0 +1,50 @@ +{ lib, fetchFromGitHub, buildDunePackage, ocaml, zed, lwt_log, lwt_react, mew_vi }: + +let params = + if lib.versionAtLeast ocaml.version "4.08" then { + version = "3.2.0"; + sha256 = "sha256:048k26644wq5wlwk0j179dxrxyz9nxqqq4vvhyh6pqpgxdajd44i"; + } else { + version = "3.1.0"; + sha256 = "1k0ykiz0vhpyyj9fkss29ajas4fh1xh449j702xkvayqipzj1mkg"; + } +; in + +buildDunePackage rec { + pname = "lambda-term"; + inherit (params) version; + + useDune2 = true; + + src = fetchFromGitHub { + owner = "ocaml-community"; + repo = pname; + rev = version; + inherit (params) sha256; + }; + + propagatedBuildInputs = [ zed lwt_log lwt_react mew_vi ]; + + meta = { description = "Terminal manipulation library for OCaml"; + longDescription = '' + Lambda-term is a cross-platform library for + manipulating the terminal. It provides an abstraction for keys, + mouse events, colors, as well as a set of widgets to write + curses-like applications. + + The main objective of lambda-term is to provide a higher level + functional interface to terminal manipulation than, for example, + ncurses, by providing a native OCaml interface instead of bindings to + a C library. + + Lambda-term integrates with zed to provide text edition facilities in + console applications. + ''; + + inherit (src.meta) homepage; + license = lib.licenses.bsd3; + maintainers = [ + lib.maintainers.gal_bolle + ]; + }; +} diff --git a/pkgs/development/ocaml-modules/lambdasoup/default.nix b/pkgs/development/ocaml-modules/lambdasoup/default.nix new file mode 100644 index 00000000000..d7d0028b2c1 --- /dev/null +++ b/pkgs/development/ocaml-modules/lambdasoup/default.nix @@ -0,0 +1,30 @@ +{ lib, fetchFromGitHub, buildDunePackage, ocaml, markup, ounit2 }: + +buildDunePackage rec { + pname = "lambdasoup"; + version = "0.7.3"; + + minimalOCamlVersion = "4.02"; + + useDune2 = true; + + src = fetchFromGitHub { + owner = "aantron"; + repo = pname; + rev = version; + sha256 = "sha256:1wclkn1pl0d150dw0xswb29jc7y1q9mhipff1pnsc1hli3pyvvb7"; + }; + + propagatedBuildInputs = [ markup ]; + + doCheck = lib.versionAtLeast ocaml.version "4.04"; + checkInputs = [ ounit2 ]; + + meta = { + description = "Functional HTML scraping and rewriting with CSS in OCaml"; + homepage = "https://aantron.github.io/lambdasoup/"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.vbgl ]; + }; + +} diff --git a/pkgs/development/ocaml-modules/lens/default.nix b/pkgs/development/ocaml-modules/lens/default.nix new file mode 100644 index 00000000000..c9cd5572bc7 --- /dev/null +++ b/pkgs/development/ocaml-modules/lens/default.nix @@ -0,0 +1,30 @@ +{ lib, fetchFromGitHub, ppx_deriving, ppxlib, buildDunePackage, ounit }: + +buildDunePackage rec { + pname = "lens"; + version = "1.2.5"; + + useDune2 = true; + + src = fetchFromGitHub { + owner = "pdonadeo"; + repo = "ocaml-lens"; + rev = "v${version}"; + sha256 = "1k23n7pa945fk6nbaq6nlkag5kg97wsw045ghz4gqp8b9i2im3vn"; + }; + + minimalOCamlVersion = "4.10"; + buildInputs = [ ppx_deriving ppxlib ]; + + doCheck = true; + checkInputs = [ ounit ]; + + meta = with lib; { + homepage = "https://github.com/pdonadeo/ocaml-lens"; + description = "Functional lenses"; + license = licenses.bsd3; + maintainers = with maintainers; [ + kazcw + ]; + }; +} diff --git a/pkgs/development/ocaml-modules/letsencrypt/app.nix b/pkgs/development/ocaml-modules/letsencrypt/app.nix new file mode 100644 index 00000000000..de1dbbb8c84 --- /dev/null +++ b/pkgs/development/ocaml-modules/letsencrypt/app.nix @@ -0,0 +1,47 @@ +{ lib +, buildDunePackage +, letsencrypt +, letsencrypt-dns +, cmdliner +, cohttp-lwt-unix +, logs +, fmt +, lwt +, mirage-crypto-rng +, ptime +, bos +, fpath +, randomconv +, cstruct +}: + +buildDunePackage { + pname = "letsencrypt-app"; + + inherit (letsencrypt) + src + version + useDune2 + minimumOCamlVersion + ; + + buildInputs = [ + letsencrypt + letsencrypt-dns + cmdliner + cohttp-lwt-unix + logs + fmt + lwt + mirage-crypto-rng + ptime + bos + fpath + randomconv + cstruct + ]; + + meta = letsencrypt.meta // { + description = "An ACME client implementation of the ACME protocol (RFC 8555) for OCaml"; + }; +} diff --git a/pkgs/development/ocaml-modules/letsencrypt/default.nix b/pkgs/development/ocaml-modules/letsencrypt/default.nix new file mode 100644 index 00000000000..a0646517b1b --- /dev/null +++ b/pkgs/development/ocaml-modules/letsencrypt/default.nix @@ -0,0 +1,63 @@ +{ buildDunePackage +, lib +, fetchurl +, asn1-combinators +, uri +, base64 +, logs +, fmt +, lwt +, mirage-crypto +, mirage-crypto-ec +, mirage-crypto-pk +, mirage-crypto-rng +, x509 +, yojson +, ounit +, ptime +, domain-name +, cstruct +}: + +buildDunePackage rec { + pname = "letsencrypt"; + version = "0.4.1"; + + src = fetchurl { + url = "https://github.com/mmaker/ocaml-letsencrypt/releases/download/v${version}/letsencrypt-v${version}.tbz"; + sha256 = "f90875f5c9bdcab4c8be5ec7ebe9ea763030fa708e02857300996bb16e7c2070"; + }; + + minimumOCamlVersion = "4.08"; + useDune2 = true; + + buildInputs = [ + fmt + ptime + domain-name + ]; + + propagatedBuildInputs = [ + logs + yojson + lwt + base64 + mirage-crypto + mirage-crypto-ec + mirage-crypto-pk + asn1-combinators + x509 + uri + cstruct + ]; + + doCheck = true; + checkInputs = [ ounit ]; + + meta = { + description = "ACME implementation in OCaml"; + license = lib.licenses.bsd2; + maintainers = [ lib.maintainers.sternenseemann ]; + homepage = "https://github.com/mmaker/ocaml-letsencrypt"; + }; +} diff --git a/pkgs/development/ocaml-modules/letsencrypt/dns.nix b/pkgs/development/ocaml-modules/letsencrypt/dns.nix new file mode 100644 index 00000000000..99058f48d06 --- /dev/null +++ b/pkgs/development/ocaml-modules/letsencrypt/dns.nix @@ -0,0 +1,35 @@ +{ lib +, buildDunePackage +, letsencrypt +, logs +, fmt +, lwt +, dns +, dns-tsig +, domain-name +}: + +buildDunePackage { + pname = "letsencrypt-dns"; + + inherit (letsencrypt) + version + src + useDune2 + minimumOCamlVersion + ; + + propagatedBuildInputs = [ + letsencrypt + dns + dns-tsig + domain-name + logs + lwt + fmt + ]; + + meta = letsencrypt.meta // { + description = "A DNS solver for the ACME implementation in OCaml"; + }; +} diff --git a/pkgs/development/ocaml-modules/linenoise/default.nix b/pkgs/development/ocaml-modules/linenoise/default.nix new file mode 100644 index 00000000000..eaeb053239e --- /dev/null +++ b/pkgs/development/ocaml-modules/linenoise/default.nix @@ -0,0 +1,26 @@ +{ lib, fetchFromGitHub, buildDunePackage, result }: + +buildDunePackage rec { + pname = "linenoise"; + version = "1.3.0"; + + useDune2 = true; + + minimumOCamlVersion = "4.02"; + + src = fetchFromGitHub { + owner = "fxfactorial"; + repo = "ocaml-${pname}"; + rev = "v${version}"; + sha256 = "0m9mm1arsawi5w5aqm57z41sy1wfxvhfgbdiw7hzy631i391144g"; + }; + + propagatedBuildInputs = [ result ]; + + meta = { + description = "OCaml bindings to linenoise"; + license = lib.licenses.bsd3; + maintainers = [ lib.maintainers.vbgl ]; + inherit (src.meta) homepage; + }; +} diff --git a/pkgs/development/ocaml-modules/llvm/default.nix b/pkgs/development/ocaml-modules/llvm/default.nix new file mode 100644 index 00000000000..9ab3d906ab1 --- /dev/null +++ b/pkgs/development/ocaml-modules/llvm/default.nix @@ -0,0 +1,46 @@ +{ stdenv, lib, python2, cmake, libllvm, ocaml, findlib, ctypes }: + +let version = lib.getVersion libllvm; in + +stdenv.mkDerivation { + pname = "ocaml-llvm"; + inherit version; + + inherit (libllvm) src; + + nativeBuildInputs = [ cmake python2 ocaml findlib ]; + buildInputs = [ ctypes ]; + propagatedBuildInputs = [ libllvm ]; + + strictDeps = true; + + cmakeFlags = [ + "-DBUILD_SHARED_LIBS=YES" # fixes bytecode builds + "-DLLVM_OCAML_OUT_OF_TREE=TRUE" + "-DLLVM_OCAML_INSTALL_PATH=${placeholder "out"}/ocaml" + "-DLLVM_OCAML_EXTERNAL_LLVM_LIBDIR=${lib.getLib libllvm}/lib" + ]; + + buildFlags = [ "ocaml_all" ]; + + installFlags = [ "-C" "bindings/ocaml" ]; + + postInstall = '' + mkdir -p $OCAMLFIND_DESTDIR/ + mv $out/ocaml $OCAMLFIND_DESTDIR/llvm + mv $OCAMLFIND_DESTDIR/llvm/META{.llvm,} + mv $OCAMLFIND_DESTDIR/llvm/stublibs $OCAMLFIND_DESTDIR/stublibs + ''; + + passthru = { + inherit libllvm; + }; + + meta = { + inherit (libllvm.meta) license homepage; + platforms = ocaml.meta.platforms or []; + description = "OCaml bindings distributed with LLVM"; + maintainers = with lib.maintainers; [ vbgl ]; + }; + +} diff --git a/pkgs/development/ocaml-modules/logs/default.nix b/pkgs/development/ocaml-modules/logs/default.nix new file mode 100644 index 00000000000..4359f09ebd3 --- /dev/null +++ b/pkgs/development/ocaml-modules/logs/default.nix @@ -0,0 +1,42 @@ +{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild +, topkg, result, lwt, cmdliner, fmt +, js_of_ocaml +, jsooSupport ? true +}: +let + pname = "logs"; + webpage = "https://erratique.ch/software/${pname}"; +in + +if !lib.versionAtLeast ocaml.version "4.03" +then throw "logs is not available for OCaml ${ocaml.version}" +else + +stdenv.mkDerivation rec { + name = "ocaml${ocaml.version}-${pname}-${version}"; + version = "0.7.0"; + + src = fetchurl { + url = "${webpage}/releases/${pname}-${version}.tbz"; + sha256 = "1jnmd675wmsmdwyb5mx5b0ac66g4c6gpv5s4mrx2j6pb0wla1x46"; + }; + + nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ]; + buildInputs = [ fmt cmdliner lwt topkg ] + ++ lib.optional jsooSupport js_of_ocaml; + propagatedBuildInputs = [ result ]; + + strictDeps = true; + + buildPhase = "${topkg.run} build --with-js_of_ocaml ${lib.boolToString jsooSupport}"; + + inherit (topkg) installPhase; + + meta = with lib; { + description = "Logging infrastructure for OCaml"; + homepage = webpage; + inherit (ocaml.meta) platforms; + maintainers = [ maintainers.sternenseemann ]; + license = licenses.isc; + }; +} diff --git a/pkgs/development/ocaml-modules/lru/default.nix b/pkgs/development/ocaml-modules/lru/default.nix new file mode 100644 index 00000000000..ec78ec91012 --- /dev/null +++ b/pkgs/development/ocaml-modules/lru/default.nix @@ -0,0 +1,25 @@ +{ lib, fetchurl, buildDunePackage, ocaml, psq, qcheck-alcotest }: + +buildDunePackage rec { + pname = "lru"; + version = "0.3.0"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/pqwy/lru/releases/download/v${version}/lru-v${version}.tbz"; + sha256 = "1ab9rd7cq15ml8x0wjl44wy99h5z7x4g9vkkz4i2d7n84ghy7vw4"; + }; + + propagatedBuildInputs = [ psq ]; + + doCheck = lib.versionAtLeast ocaml.version "4.08"; + checkInputs = [ qcheck-alcotest ]; + + meta = { + homepage = "https://github.com/pqwy/lru"; + description = "Scalable LRU caches for OCaml"; + maintainers = [ lib.maintainers.vbgl ]; + license = lib.licenses.isc; + }; +} diff --git a/pkgs/development/ocaml-modules/lua-ml/default.nix b/pkgs/development/ocaml-modules/lua-ml/default.nix new file mode 100644 index 00000000000..586fc395064 --- /dev/null +++ b/pkgs/development/ocaml-modules/lua-ml/default.nix @@ -0,0 +1,36 @@ +{ stdenv, lib, fetchFromGitHub, ocaml, findlib, ocamlbuild, opaline }: + +if !lib.versionAtLeast ocaml.version "4.07" +then throw "lua-ml is not available for OCaml ${ocaml.version}" +else + +stdenv.mkDerivation rec { + pname = "lua-ml"; + name = "ocaml${ocaml.version}-${pname}-${version}"; + version = "0.9.1"; + + src = fetchFromGitHub { + owner = "lindig"; + repo = pname; + rev = version; + sha256 = "04lv98nxmzanvyn4c0k6k0ax29f5xfdl8qzpf5hwadslq213a044"; + }; + + nativeBuildInputs = [ opaline ocaml findlib ocamlbuild ]; + + strictDeps = true; + + buildFlags = [ "lib" ]; + + installPhase = '' + opaline -prefix $out -libdir $OCAMLFIND_DESTDIR + ''; + + meta = { + description = "An embeddable Lua 2.5 interpreter implemented in OCaml"; + inherit (src.meta) homepage; + inherit (ocaml.meta) platforms; + license = lib.licenses.bsd2; + maintainers = [ lib.maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/lustre-v6/default.nix b/pkgs/development/ocaml-modules/lustre-v6/default.nix new file mode 100644 index 00000000000..4eeb01e9f3b --- /dev/null +++ b/pkgs/development/ocaml-modules/lustre-v6/default.nix @@ -0,0 +1,28 @@ +{ lib, buildDunePackage, fetchurl, ocaml_extlib, lutils, rdbg }: + +buildDunePackage rec { + pname = "lustre-v6"; + version = "6.103.3"; + + useDune2 = true; + + minimalOCamlVersion = "4.05"; + + src = fetchurl { + url = "http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/pool/lustre-v6.6.103.3.tgz"; + sha512 = "8d452184ee68edda1b5a50717e6a5b13fb21f9204634fc5898280e27a1d79c97a6e7cc04424fc22f34cdd02ed3cc8774dca4f982faf342980b5f9fe0dc1a017d"; + }; + + propagatedBuildInputs = [ + ocaml_extlib + lutils + rdbg + ]; + + meta = with lib; { + homepage = "https://www-verimag.imag.fr/lustre-v6.html"; + description = "Lustre V6 compiler"; + license = lib.licenses.cecill21; + maintainers = [ lib.maintainers.delta ]; + }; +} diff --git a/pkgs/development/ocaml-modules/lutils/default.nix b/pkgs/development/ocaml-modules/lutils/default.nix new file mode 100644 index 00000000000..492a987dc9c --- /dev/null +++ b/pkgs/development/ocaml-modules/lutils/default.nix @@ -0,0 +1,25 @@ +{ lib, buildDunePackage, fetchurl, num }: + +buildDunePackage rec { + pname = "lutils"; + version = "1.51.2"; + + useDune2 = true; + + minimalOCamlVersion = "4.02"; + + src = fetchurl { + url = "http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/pool/lutils.1.51.2.tgz"; + sha512 = "f94696be379c62e888410ec3d940c888ca4b607cf59c2e364e93a2a694da65ebe6d531107198b795e80eecc3c6865eedb02659c7e7c4e15c9b28d74aa35d09f8"; + }; + + propagatedBuildInputs = [ + num + ]; + + meta = with lib; { + homepage = "https://gricad-gitlab.univ-grenoble-alpes.fr/verimag/synchrone/lutils/"; + description = "Tools and libs shared by Verimag/synchronous tools (lustre, lutin, rdbg)"; + license = lib.licenses.cecill21; + }; +} diff --git a/pkgs/development/ocaml-modules/luv/default.nix b/pkgs/development/ocaml-modules/luv/default.nix new file mode 100644 index 00000000000..4b11e8df985 --- /dev/null +++ b/pkgs/development/ocaml-modules/luv/default.nix @@ -0,0 +1,35 @@ +{ lib, buildDunePackage, fetchurl +, ctypes, result +, alcotest +, file +}: + +buildDunePackage rec { + pname = "luv"; + version = "0.5.11"; + useDune2 = true; + + src = fetchurl { + url = "https://github.com/aantron/luv/releases/download/${version}/luv-${version}.tar.gz"; + sha256 = "sha256-zOz0cxGzhLi3Q36qyStNCz8JGXHtECQfZysMKiyKOkM="; + }; + + postConfigure = '' + for f in src/c/vendor/configure/{ltmain.sh,configure}; do + substituteInPlace "$f" --replace /usr/bin/file file + done + ''; + + nativeBuildInputs = [ file ]; + propagatedBuildInputs = [ ctypes result ]; + checkInputs = [ alcotest ]; + doCheck = true; + + meta = with lib; { + homepage = "https://github.com/aantron/luv"; + description = "Binding to libuv: cross-platform asynchronous I/O"; + # MIT-licensed, extra licenses apply partially to libuv vendor + license = with licenses; [ mit bsd2 bsd3 cc-by-sa-40 ]; + maintainers = with maintainers; [ locallycompact sternenseemann ]; + }; +} diff --git a/pkgs/development/ocaml-modules/lwt-canceler/default.nix b/pkgs/development/ocaml-modules/lwt-canceler/default.nix new file mode 100644 index 00000000000..97b27157265 --- /dev/null +++ b/pkgs/development/ocaml-modules/lwt-canceler/default.nix @@ -0,0 +1,27 @@ +{ lib, fetchFromGitLab, buildDunePackage, lwt }: + +buildDunePackage rec { + pname = "lwt-canceler"; + version = "0.3"; + + src = fetchFromGitLab { + owner = "nomadic-labs"; + repo = "lwt-canceler"; + rev = "v${version}"; + sha256 = "1xbb7012hp901b755kxmfgg293rz34rkhwzg2z9i6sakwd7i0h9p"; + }; + useDune2 = true; + + propagatedBuildInputs = [ + lwt + ]; + + doCheck = true; + + meta = { + homepage = "https://gitlab.com/nomadic-labs/lwt-canceler"; + description = "Cancellation synchronization object"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.ulrikstrid ]; + }; +} diff --git a/pkgs/development/ocaml-modules/lwt-dllist/default.nix b/pkgs/development/ocaml-modules/lwt-dllist/default.nix new file mode 100644 index 00000000000..b28981b1b77 --- /dev/null +++ b/pkgs/development/ocaml-modules/lwt-dllist/default.nix @@ -0,0 +1,27 @@ +{ lib, buildDunePackage, fetchurl, lwt, ocaml }: + +buildDunePackage rec { + pname = "lwt-dllist"; + version = "1.0.1"; + + useDune2 = true; + + minimumOCamlVersion = "4.02"; + + src = fetchurl { + url = "https://github.com/mirage/${pname}/releases/download/v${version}/${pname}-v${version}.tbz"; + sha256 = "e86ce75e40f00d51514cf8b2e71e5184c4cb5dae96136be24613406cfc0dba6e"; + }; + + checkInputs = [ + lwt + ]; + doCheck = lib.versionAtLeast ocaml.version "4.03"; + + meta = with lib; { + description = "Mutable doubly-linked list with Lwt iterators"; + homepage = "https://github.com/mirage/lwt-dllist"; + license = licenses.mit; + maintainers = [ maintainers.sternenseemann ]; + }; +} diff --git a/pkgs/development/ocaml-modules/lwt-exit/default.nix b/pkgs/development/ocaml-modules/lwt-exit/default.nix new file mode 100644 index 00000000000..a2a6f14524f --- /dev/null +++ b/pkgs/development/ocaml-modules/lwt-exit/default.nix @@ -0,0 +1,35 @@ +{ lib +, fetchFromGitLab +, buildDunePackage +, lwt +, ptime +}: + +buildDunePackage rec { + pname = "lwt-exit"; + version = "1.0"; + src = fetchFromGitLab { + owner = "nomadic-labs"; + repo = pname; + rev = "${version}"; + sha256 = "1k763bmj1asj9ijar39rh3h1d59rckmsf21h2y8966lgglsf42bd"; + }; + + useDune2 = true; + + minimalOCamlVersion = "4.08"; + + propagatedBuildInputs = [ + lwt + ptime + ]; + + # for some reason this never exits + doCheck = false; + + meta = { + description = "An opinionated clean-exit and signal-handling library for Lwt programs"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.ulrikstrid ]; + }; +} diff --git a/pkgs/development/ocaml-modules/lwt-watcher/default.nix b/pkgs/development/ocaml-modules/lwt-watcher/default.nix new file mode 100644 index 00000000000..23caa894736 --- /dev/null +++ b/pkgs/development/ocaml-modules/lwt-watcher/default.nix @@ -0,0 +1,30 @@ +{ lib +, fetchFromGitLab +, buildDunePackage +, lwt +}: + +buildDunePackage rec { + pname = "lwt-watcher"; + version = "0.1"; + src = fetchFromGitLab { + owner = "nomadic-labs"; + repo = pname; + rev = "v${version}"; + sha256 = "0kaf7py02i0dn9rvrbzxh4ljfg059wc8xvm093m9wy7lsa68rax9"; + }; + + useDune2 = true; + + propagatedBuildInputs = [ + lwt + ]; + + doCheck = true; + + meta = { + description = "One-to-many broadcast in Lwt"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.ulrikstrid ]; + }; +} diff --git a/pkgs/development/ocaml-modules/lwt/camlp4.nix b/pkgs/development/ocaml-modules/lwt/camlp4.nix new file mode 100644 index 00000000000..e48d7cfa185 --- /dev/null +++ b/pkgs/development/ocaml-modules/lwt/camlp4.nix @@ -0,0 +1,29 @@ +{ lib, fetchFromGitHub, buildDunePackage, camlp4 }: + +buildDunePackage rec { + pname = "lwt_camlp4"; + version = "unstable-2018-03-25"; + + src = fetchFromGitHub { + owner = "ocsigen"; + repo = pname; + rev = "45f25a081e01071ab566924b48ba5f7553bb33ac"; + sha256 = "1lv8z6ljfy47yvxmwf5jrvc5d3dc90r1n291x53j161sf22ddrk9"; + }; + + useDune2 = false; + + minimalOCamlVersion = "4.02"; + + propagatedBuildInputs = [ camlp4 ]; + + preBuild = "rm META.lwt_camlp4"; + + meta = { + description = "Camlp4 syntax extension for Lwt (deprecated)"; + license = lib.licenses.lgpl21; + inherit (src.meta) homepage; + maintainers = [ lib.maintainers.vbgl ]; + }; +} + diff --git a/pkgs/development/ocaml-modules/lwt/default.nix b/pkgs/development/ocaml-modules/lwt/default.nix new file mode 100644 index 00000000000..96e3abc2674 --- /dev/null +++ b/pkgs/development/ocaml-modules/lwt/default.nix @@ -0,0 +1,36 @@ +{ lib, fetchFromGitHub, pkg-config, ncurses, libev, buildDunePackage, ocaml +, cppo, dune-configurator, ocplib-endian, result +, mmap, seq +, ocaml-syntax-shims +}: + +let inherit (lib) optional versionAtLeast; in + +buildDunePackage rec { + pname = "lwt"; + version = "5.4.1"; + + useDune2 = true; + + src = fetchFromGitHub { + owner = "ocsigen"; + repo = "lwt"; + rev = version; + sha256 = "sha256-XpoRKcdNo2j05Gxm5wmKSdwqimFDSWvmLyooPYTHAjM="; + }; + + strictDeps = true; + + nativeBuildInputs = [ pkg-config cppo ] + ++ optional (!versionAtLeast ocaml.version "4.08") ocaml-syntax-shims; + buildInputs = [ dune-configurator ] + ++ optional (!versionAtLeast ocaml.version "4.07") ncurses; + propagatedBuildInputs = [ libev mmap ocplib-endian seq result ]; + + meta = { + homepage = "https://ocsigen.org/lwt/"; + description = "A cooperative threads library for OCaml"; + maintainers = [ lib.maintainers.vbgl ]; + license = lib.licenses.mit; + }; +} diff --git a/pkgs/development/ocaml-modules/lwt/ppx.nix b/pkgs/development/ocaml-modules/lwt/ppx.nix new file mode 100644 index 00000000000..1ba21af864b --- /dev/null +++ b/pkgs/development/ocaml-modules/lwt/ppx.nix @@ -0,0 +1,31 @@ +{ fetchFromGitHub, buildDunePackage, lwt, ppxlib }: + +buildDunePackage { + pname = "lwt_ppx"; + version = "2.0.2"; + + useDune2 = true; + + minimumOCamlVersion = "4.04"; + + # `lwt_ppx` has a different release cycle than Lwt, but it's included in + # one of its release bundles. + # Because there could exist an Lwt release _without_ a `lwt_ppx` release, + # this `src` field doesn't inherit from the Lwt derivation. + # + # This is particularly useful for overriding Lwt without breaking `lwt_ppx`, + # as new Lwt releases may contain broken `lwt_ppx` code. + src = fetchFromGitHub { + owner = "ocsigen"; + repo = "lwt"; + rev = "5.4.0"; + sha256 = "sha256-rRivROVbQbXkHWen1n8+9AwrRJaOK0Fhyilw29T7was="; + }; + + propagatedBuildInputs = [ lwt ppxlib ]; + + meta = { + description = "Ppx syntax extension for Lwt"; + inherit (lwt.meta) license homepage maintainers; + }; +} diff --git a/pkgs/development/ocaml-modules/lwt_log/default.nix b/pkgs/development/ocaml-modules/lwt_log/default.nix new file mode 100644 index 00000000000..9213e1af94f --- /dev/null +++ b/pkgs/development/ocaml-modules/lwt_log/default.nix @@ -0,0 +1,26 @@ +{ lib, fetchFromGitHub, buildDunePackage, lwt }: + +buildDunePackage rec { + pname = "lwt_log"; + version = "1.1.1"; + + useDune2 = true; + + minimumOCamlVersion = "4.02"; + + src = fetchFromGitHub { + owner = "aantron"; + repo = pname; + rev = version; + sha256 = "1n12i1rmn9cjn6p8yr6qn5dwbrwvym7ckr7bla04a1xnq8qlcyj7"; + }; + + propagatedBuildInputs = [ lwt ]; + + meta = { + description = "Lwt logging library (deprecated)"; + homepage = "https://github.com/aantron/lwt_log"; + license = lib.licenses.lgpl21; + maintainers = [ lib.maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/lwt_react/default.nix b/pkgs/development/ocaml-modules/lwt_react/default.nix new file mode 100644 index 00000000000..f6f2bc0f4ef --- /dev/null +++ b/pkgs/development/ocaml-modules/lwt_react/default.nix @@ -0,0 +1,24 @@ +{ lib, buildDunePackage, fetchFromGitHub, cppo, lwt, react }: + +buildDunePackage { + pname = "lwt_react"; + version = "1.1.5"; + + useDune2 = true; + + src = fetchFromGitHub { + owner = "ocsigen"; + repo = "lwt"; + rev = "5.5.0"; + sha256 = "sha256:1jbjz2rsz3j56k8vh5qlmm87hhkr250bs2m3dvpy9vsri8rkzj9z"; + }; + + nativeBuildInputs = [ cppo ]; + + propagatedBuildInputs = [ lwt react ]; + + meta = { + description = "Helpers for using React with Lwt"; + inherit (lwt.meta) homepage license maintainers; + }; +} diff --git a/pkgs/development/ocaml-modules/lwt_ssl/default.nix b/pkgs/development/ocaml-modules/lwt_ssl/default.nix new file mode 100644 index 00000000000..64decd8e5d6 --- /dev/null +++ b/pkgs/development/ocaml-modules/lwt_ssl/default.nix @@ -0,0 +1,25 @@ +{ lib, fetchFromGitHub, buildDunePackage, ssl, lwt }: + +buildDunePackage rec { + pname = "lwt_ssl"; + version = "1.1.3"; + + minimumOCamlVersion = "4.02"; + useDune2 = true; + + src = fetchFromGitHub { + owner = "aantron"; + repo = "lwt_ssl"; + rev = version; + sha256 = "sha256-d/jkTI/D2LVi9nrndRGgqg6ca1FcmRKknR7YXyA7gWw="; + }; + + propagatedBuildInputs = [ ssl lwt ]; + + meta = { + homepage = "https://github.com/aantron/lwt_ssl"; + description = "OpenSSL binding with concurrent I/O"; + license = lib.licenses.lgpl21; + maintainers = [ lib.maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/macaddr/cstruct.nix b/pkgs/development/ocaml-modules/macaddr/cstruct.nix new file mode 100644 index 00000000000..14323040892 --- /dev/null +++ b/pkgs/development/ocaml-modules/macaddr/cstruct.nix @@ -0,0 +1,19 @@ +{ lib, buildDunePackage +, macaddr, cstruct +}: + +buildDunePackage { + pname = "macaddr-cstruct"; + + inherit (macaddr) version src minimumOCamlVersion; + + useDune2 = true; + + propagatedBuildInputs = [ macaddr cstruct ]; + + doCheck = true; + + meta = macaddr.meta // { + description = "A library for manipulation of MAC address representations using Cstructs"; + }; +} diff --git a/pkgs/development/ocaml-modules/macaddr/default.nix b/pkgs/development/ocaml-modules/macaddr/default.nix new file mode 100644 index 00000000000..f81529ed3a2 --- /dev/null +++ b/pkgs/development/ocaml-modules/macaddr/default.nix @@ -0,0 +1,27 @@ +{ lib, fetchurl, buildDunePackage +, ppx_sexp_conv, ounit +}: + +buildDunePackage rec { + pname = "macaddr"; + version = "5.2.0"; + + useDune2 = true; + + minimumOCamlVersion = "4.04"; + + src = fetchurl { + url = "https://github.com/mirage/ocaml-ipaddr/releases/download/v${version}/ipaddr-v${version}.tbz"; + sha256 = "f98d237cc1f783a0ba7dff0c6c69b5f519fec056950e3e3e7c15e5511ee5b7ec"; + }; + + checkInputs = [ ppx_sexp_conv ounit ]; + doCheck = true; + + meta = with lib; { + homepage = "https://github.com/mirage/ocaml-ipaddr"; + description = "A library for manipulation of MAC address representations"; + license = licenses.isc; + maintainers = [ maintainers.alexfmpe ]; + }; +} diff --git a/pkgs/development/ocaml-modules/macaddr/sexp.nix b/pkgs/development/ocaml-modules/macaddr/sexp.nix new file mode 100644 index 00000000000..35cc7c6b440 --- /dev/null +++ b/pkgs/development/ocaml-modules/macaddr/sexp.nix @@ -0,0 +1,20 @@ +{ lib, buildDunePackage +, macaddr, ppx_sexp_conv, macaddr-cstruct, ounit +}: + +buildDunePackage { + pname = "macaddr-sexp"; + + inherit (macaddr) version src minimumOCamlVersion; + + useDune2 = true; + + propagatedBuildInputs = [ ppx_sexp_conv ]; + + checkInputs = [ macaddr-cstruct ounit ]; + doCheck = true; + + meta = macaddr.meta // { + description = "A library for manipulation of MAC address representations using sexp"; + }; +} diff --git a/pkgs/development/ocaml-modules/macaque/default.nix b/pkgs/development/ocaml-modules/macaque/default.nix new file mode 100644 index 00000000000..d47c0c4f11c --- /dev/null +++ b/pkgs/development/ocaml-modules/macaque/default.nix @@ -0,0 +1,28 @@ +{ lib, stdenv, fetchFromGitHub, ocaml, findlib, ocamlbuild, pgocaml, camlp4 }: + +stdenv.mkDerivation rec { + pname = "ocaml-macaque"; + version = "0.7.2"; + + src = fetchFromGitHub { + owner = "ocsigen"; + repo = "macaque"; + rev = version; + sha256 = "sha256-W9ZFaINYYtIikKy/ZqdlKeFQSA7DQT9plc3+ZhlSIJI="; + }; + + nativeBuildInputs = [ ocaml findlib ocamlbuild camlp4 ]; + propagatedBuildInputs = [ pgocaml camlp4 ]; + + strictDeps = true; + + createFindlibDestdir = true; + + meta = with lib; { + description = "Macros for Caml Queries"; + homepage = "https://github.com/ocsigen/macaque"; + license = licenses.lgpl2; + platforms = ocaml.meta.platforms or [ ]; + maintainers = with maintainers; [ vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/magic-mime/default.nix b/pkgs/development/ocaml-modules/magic-mime/default.nix new file mode 100644 index 00000000000..15628bcf26c --- /dev/null +++ b/pkgs/development/ocaml-modules/magic-mime/default.nix @@ -0,0 +1,21 @@ +{ lib, fetchurl, buildDunePackage }: + +buildDunePackage rec { + pname = "magic-mime"; + version = "1.1.3"; + + src = fetchurl { + url = "https://github.com/mirage/ocaml-magic-mime/releases/download/v${version}/magic-mime-v${version}.tbz"; + sha256 = "1xqjs8bba567yzrzgnr88j5ck97d36zw68zr9v29liya37k6rcvz"; + }; + + minimalOCamlVersion = "4.03"; + useDune2 = true; + + meta = with lib; { + description = "Convert file extensions to MIME types"; + homepage = "https://github.com/mirage/ocaml-magic-mime"; + license = licenses.isc; + maintainers = with maintainers; [ vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/magick/default.nix b/pkgs/development/ocaml-modules/magick/default.nix new file mode 100644 index 00000000000..87c43fb6869 --- /dev/null +++ b/pkgs/development/ocaml-modules/magick/default.nix @@ -0,0 +1,34 @@ +{ stdenv, lib, fetchurl, which, pkg-config, ocaml, findlib, imagemagick }: + +if lib.versionAtLeast ocaml.version "4.06" +then throw "magick is not available for OCaml ${ocaml.version}" +else + +stdenv.mkDerivation rec { + pname = "ocaml-magick"; + version = "0.34"; + + src = fetchurl { + url = "http://www.linux-nantes.org/~fmonnier/OCaml/ImageMagick/ImageMagick/OCaml-ImageMagick-${version}.tgz"; + sha256 = "0gn9l2qdr8gby2x8c2mb59x1kipb2plr45rbq6ymcxyi0wmzfh3q"; + }; + + nativeBuildInputs = [ which pkg-config ocaml findlib ]; + buildInputs = [ imagemagick ]; + + strictDeps = true; + + createFindlibDestdir = true; + + preConfigure = "substituteInPlace Makefile --replace gcc $CC"; + + installTargets = [ "find_install" ]; + + meta = { + homepage = "http://www.linux-nantes.org/~fmonnier/OCaml/ImageMagick/"; + description = "ImageMagick Binding for OCaml"; + license = lib.licenses.mit; + platforms = imagemagick.meta.platforms; + maintainers = with lib.maintainers; [ vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/mariadb/default.nix b/pkgs/development/ocaml-modules/mariadb/default.nix new file mode 100644 index 00000000000..2c3c7c423ac --- /dev/null +++ b/pkgs/development/ocaml-modules/mariadb/default.nix @@ -0,0 +1,26 @@ +{ lib, fetchFromGitHub, buildOasisPackage +, ctypes, mariadb, libmysqlclient }: + +buildOasisPackage rec { + pname = "mariadb"; + version = "1.1.4"; + + minimumOCamlVersion = "4.07.0"; + + src = fetchFromGitHub { + owner = "andrenth"; + repo = "ocaml-mariadb"; + rev = version; + sha256 = "1rxqvxr6sv4x2hsi05qm9jz0asaq969m71db4ckl672rcql1kwbr"; + }; + + buildInputs = [ mariadb libmysqlclient ]; + propagatedBuildInputs = [ ctypes ]; + + meta = { + description = "OCaml bindings for MariaDB"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ bcc32 ]; + homepage = "https://github.com/andrenth/ocaml-mariadb"; + }; +} diff --git a/pkgs/development/ocaml-modules/markup/default.nix b/pkgs/development/ocaml-modules/markup/default.nix new file mode 100644 index 00000000000..8d35ae641a6 --- /dev/null +++ b/pkgs/development/ocaml-modules/markup/default.nix @@ -0,0 +1,28 @@ +{ lib, buildDunePackage, fetchFromGitHub, ocaml, uchar, uutf, ounit2 }: + +buildDunePackage rec { + pname = "markup"; + version = "1.0.0"; + + useDune2 = true; + + src = fetchFromGitHub { + owner = "aantron"; + repo = "markup.ml"; + rev = version; + sha256 = "sha256-yapjqAcn0XSC6Guoj69sXNpLZ2urXANkWhcafpPLEyY="; + }; + + propagatedBuildInputs = [ uchar uutf ]; + + checkInputs = [ ounit2 ]; + doCheck = lib.versionAtLeast ocaml.version "4.04"; + + meta = with lib; { + homepage = "https://github.com/aantron/markup.ml/"; + description = "A pair of best-effort parsers implementing the HTML5 and XML specifications"; + license = licenses.mit; + maintainers = with maintainers; [ gal_bolle ]; + }; + +} diff --git a/pkgs/development/ocaml-modules/mccs/default.nix b/pkgs/development/ocaml-modules/mccs/default.nix new file mode 100644 index 00000000000..beadceff02b --- /dev/null +++ b/pkgs/development/ocaml-modules/mccs/default.nix @@ -0,0 +1,29 @@ +{ lib, fetchFromGitHub, buildDunePackage, cudf }: + +buildDunePackage rec { + pname = "mccs"; + version = "1.1+13"; + + src = fetchFromGitHub { + owner = "AltGr"; + repo = "ocaml-mccs"; + rev = version; + sha256 = "sha256-K249E9qkWNK4BC+ynaR3bVEyu9Tk8iCE7GptKk/aVJc="; + }; + + useDune2 = true; + + buildInputs = [ + cudf + ]; + + doCheck = true; + + meta = with lib; { + description = "A library providing a multi criteria CUDF solver, part of MANCOOSI project."; + downloadPage = "https://github.com/AltGr/ocaml-mccs"; + homepage = "https://www.i3s.unice.fr/~cpjm/misc/"; + license = with licenses; [ lgpl21 gpl3 ]; + maintainers = with maintainers; [ ]; + }; +} diff --git a/pkgs/development/ocaml-modules/mdx/default.nix b/pkgs/development/ocaml-modules/mdx/default.nix new file mode 100644 index 00000000000..09f505c0e25 --- /dev/null +++ b/pkgs/development/ocaml-modules/mdx/default.nix @@ -0,0 +1,40 @@ +{ lib, fetchurl, buildDunePackage, ocaml +, alcotest +, astring, cmdliner, cppo, fmt, logs, ocaml-version, odoc-parser, ocaml_lwt, re, result, csexp +, pandoc}: + +buildDunePackage rec { + pname = "mdx"; + version = "2.1.0"; + useDune2 = true; + + minimalOCamlVersion = "4.08"; + + src = fetchurl { + url = "https://github.com/realworldocaml/mdx/releases/download/${version}/mdx-${version}.tbz"; + sha256 = "sha256-ol1zy8LODDYdcnv/jByE0pnqJ5ujQuMALq3v9y7td/o="; + }; + + nativeBuildInputs = [ cppo ]; + buildInputs = [ cmdliner ]; + propagatedBuildInputs = [ astring fmt logs result csexp ocaml-version odoc-parser re ]; + checkInputs = [ alcotest ocaml_lwt pandoc ]; + + doCheck = true; + + outputs = [ "bin" "lib" "out" ]; + + installPhase = '' + runHook preInstall + dune install --prefix=$bin --libdir=$lib/lib/ocaml/${ocaml.version}/site-lib ${pname} + runHook postInstall + ''; + + meta = { + homepage = "https://github.com/realworldocaml/mdx"; + description = "Executable OCaml code blocks inside markdown files"; + changelog = "https://github.com/realworldocaml/mdx/raw/${version}/CHANGES.md"; + license = lib.licenses.isc; + maintainers = [ lib.maintainers.romildo ]; + }; +} diff --git a/pkgs/development/ocaml-modules/menhir/default.nix b/pkgs/development/ocaml-modules/menhir/default.nix new file mode 100644 index 00000000000..1938206361e --- /dev/null +++ b/pkgs/development/ocaml-modules/menhir/default.nix @@ -0,0 +1,17 @@ +{ lib, fetchFromGitLab, buildDunePackage +, menhirLib, menhirSdk +}: + +buildDunePackage rec { + pname = "menhir"; + + minimalOCamlVersion = "4.03"; + + inherit (menhirLib) version src useDune2; + + buildInputs = [ menhirLib menhirSdk ]; + + meta = menhirSdk.meta // { + description = "A LR(1) parser generator for OCaml"; + }; +} diff --git a/pkgs/development/ocaml-modules/menhir/lib.nix b/pkgs/development/ocaml-modules/menhir/lib.nix new file mode 100644 index 00000000000..4d27fe32738 --- /dev/null +++ b/pkgs/development/ocaml-modules/menhir/lib.nix @@ -0,0 +1,29 @@ +{ lib, fetchFromGitLab, buildDunePackage }: + +buildDunePackage rec { + pname = "menhirLib"; + version = "20211128"; + + src = fetchFromGitLab { + domain = "gitlab.inria.fr"; + owner = "fpottier"; + repo = "menhir"; + rev = version; + sha256 = "sha256-L/zfjPZfn9L7qqqqJGk3Ge52rvujOVPiL8jxfH5R60g="; + }; + + useDune2 = true; + + meta = with lib; { + homepage = "http://pauillac.inria.fr/~fpottier/menhir/"; + description = "Runtime support library for parsers generated by Menhir"; + longDescription = '' + Menhir is a LR(1) parser generator for the Objective Caml programming + language. That is, Menhir compiles LR(1) grammar specifications down + to OCaml code. Menhir was designed and implemented by François Pottier + and Yann Régis-Gianas. + ''; + license = with licenses; [ lgpl2Only ]; + maintainers = with maintainers; [ vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/menhir/sdk.nix b/pkgs/development/ocaml-modules/menhir/sdk.nix new file mode 100644 index 00000000000..0e60849494c --- /dev/null +++ b/pkgs/development/ocaml-modules/menhir/sdk.nix @@ -0,0 +1,15 @@ +{ lib, fetchFromGitLab, buildDunePackage +, menhirLib +}: + +buildDunePackage rec { + pname = "menhirSdk"; + + inherit (menhirLib) version src useDune2; + + meta = menhirLib.meta // { + description = "Compile-time library for auxiliary tools related to Menhir"; + license = with lib.licenses; [ gpl2Only ]; + }; +} + diff --git a/pkgs/development/ocaml-modules/merlin-extend/default.nix b/pkgs/development/ocaml-modules/merlin-extend/default.nix new file mode 100644 index 00000000000..9cb35f34c1c --- /dev/null +++ b/pkgs/development/ocaml-modules/merlin-extend/default.nix @@ -0,0 +1,24 @@ +{ lib, buildDunePackage, fetchurl, cppo }: + +buildDunePackage rec { + pname = "merlin-extend"; + version = "0.6"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/let-def/merlin-extend/releases/download/v${version}/merlin-extend-v${version}.tbz"; + sha256 = "0hvc4mz92x3rl2dxwrhvhzwl4gilnyvvwcqgr45vmdpyjyp3dwn2"; + }; + + strictDeps = true; + + nativeBuildInputs = [ cppo ]; + + meta = with lib; { + homepage = "https://github.com/let-def/merlin-extend"; + description = "SDK to extend Merlin"; + license = licenses.mit; + maintainers = [ maintainers.volth ]; + }; +} diff --git a/pkgs/development/ocaml-modules/metrics/default.nix b/pkgs/development/ocaml-modules/metrics/default.nix new file mode 100644 index 00000000000..58fcab5313a --- /dev/null +++ b/pkgs/development/ocaml-modules/metrics/default.nix @@ -0,0 +1,29 @@ +{ lib, fetchurl, buildDunePackage, alcotest, fmt }: + +buildDunePackage rec { + pname = "metrics"; + version = "0.2.0"; + + useDune2 = true; + + minimumOCamlVersion = "4.04"; + + src = fetchurl { + url = "https://github.com/mirage/metrics/releases/download/${version}/metrics-${version}.tbz"; + sha256 = "0j215cji3n78lghzi9m6kgr3r1s91v681hfnn7cgybb31d7gjkqg"; + }; + + propagatedBuildInputs = [ fmt ]; + + checkInputs = [ alcotest ]; + + doCheck = true; + + meta = { + description = "Metrics infrastructure for OCaml"; + homepage = "https://github.com/mirage/metrics"; + license = lib.licenses.isc; + maintainers = [ lib.maintainers.vbgl ]; + }; + +} diff --git a/pkgs/development/ocaml-modules/metrics/influx.nix b/pkgs/development/ocaml-modules/metrics/influx.nix new file mode 100644 index 00000000000..8394ec0c0f9 --- /dev/null +++ b/pkgs/development/ocaml-modules/metrics/influx.nix @@ -0,0 +1,14 @@ +{ buildDunePackage, metrics +, astring, duration, fmt, lwt +}: + +buildDunePackage rec { + pname = "metrics-influx"; + inherit (metrics) version useDune2 src; + + propagatedBuildInputs = [ astring duration fmt lwt metrics ]; + + meta = metrics.meta // { + description = "Influx reporter for the Metrics library"; + }; +} diff --git a/pkgs/development/ocaml-modules/metrics/lwt.nix b/pkgs/development/ocaml-modules/metrics/lwt.nix new file mode 100644 index 00000000000..7085ff58148 --- /dev/null +++ b/pkgs/development/ocaml-modules/metrics/lwt.nix @@ -0,0 +1,14 @@ +{ buildDunePackage, logs, ocaml_lwt, metrics }: + +buildDunePackage { + pname = "metrics-lwt"; + + inherit (metrics) version useDune2 src; + + propagatedBuildInputs = [ logs ocaml_lwt metrics ]; + + meta = metrics.meta // { + description = "Lwt backend for the Metrics library"; + }; + +} diff --git a/pkgs/development/ocaml-modules/metrics/mirage.nix b/pkgs/development/ocaml-modules/metrics/mirage.nix new file mode 100644 index 00000000000..4a891505ac7 --- /dev/null +++ b/pkgs/development/ocaml-modules/metrics/mirage.nix @@ -0,0 +1,14 @@ +{ buildDunePackage, metrics, metrics-influx +, cstruct, ipaddr, logs, lwt, mirage-clock, mirage-stack +}: + +buildDunePackage { + pname = "metrics-mirage"; + inherit (metrics) version useDune2 src; + + propagatedBuildInputs = [ cstruct ipaddr logs lwt metrics metrics-influx mirage-clock mirage-stack ]; + + meta = metrics.meta // { + description = "Mirage backend for the Metrics library"; + }; +} diff --git a/pkgs/development/ocaml-modules/metrics/unix.nix b/pkgs/development/ocaml-modules/metrics/unix.nix new file mode 100644 index 00000000000..5a7bae1b29f --- /dev/null +++ b/pkgs/development/ocaml-modules/metrics/unix.nix @@ -0,0 +1,19 @@ +{ buildDunePackage, gnuplot, ocaml_lwt, metrics, metrics-lwt, mtime, uuidm }: + +buildDunePackage rec { + + pname = "metrics-unix"; + + inherit (metrics) version useDune2 src; + + propagatedBuildInputs = [ gnuplot ocaml_lwt metrics mtime uuidm ]; + + checkInputs = [ metrics-lwt ]; + + doCheck = true; + + meta = metrics.meta // { + description = "Unix backend for the Metrics library"; + }; + +} diff --git a/pkgs/development/ocaml-modules/mew/default.nix b/pkgs/development/ocaml-modules/mew/default.nix new file mode 100644 index 00000000000..819bb020050 --- /dev/null +++ b/pkgs/development/ocaml-modules/mew/default.nix @@ -0,0 +1,27 @@ +{ lib, buildDunePackage, fetchFromGitHub +, result, trie +}: + +buildDunePackage rec { + pname = "mew"; + version = "0.1.0"; + + useDune2 = true; + + src = fetchFromGitHub { + owner = "kandu"; + repo = pname; + rev = version; + sha256 = "0417xsghj92v3xa5q4dk4nzf2r4mylrx2fd18i7cg3nzja65nia2"; + }; + + propagatedBuildInputs = [ result trie ]; + + meta = { + inherit (src.meta) homepage; + license = lib.licenses.mit; + description = "Modal Editing Witch"; + maintainers = [ lib.maintainers.vbgl ]; + }; + +} diff --git a/pkgs/development/ocaml-modules/mew_vi/default.nix b/pkgs/development/ocaml-modules/mew_vi/default.nix new file mode 100644 index 00000000000..39228585fe3 --- /dev/null +++ b/pkgs/development/ocaml-modules/mew_vi/default.nix @@ -0,0 +1,27 @@ +{ lib, buildDunePackage, fetchFromGitHub +, mew, react +}: + +buildDunePackage rec { + pname = "mew_vi"; + version = "0.5.0"; + + useDune2 = true; + + src = fetchFromGitHub { + owner = "kandu"; + repo = pname; + rev = version; + sha256 = "0lihbf822k5zasl60w5mhwmdkljlq49c9saayrws7g4qc1j353r8"; + }; + + propagatedBuildInputs = [ mew react ]; + + meta = { + inherit (src.meta) homepage; + license = lib.licenses.mit; + description = "Modal Editing Witch, VI interpreter"; + maintainers = [ lib.maintainers.vbgl ]; + }; + +} diff --git a/pkgs/development/ocaml-modules/mimic/default.nix b/pkgs/development/ocaml-modules/mimic/default.nix new file mode 100644 index 00000000000..ea163642703 --- /dev/null +++ b/pkgs/development/ocaml-modules/mimic/default.nix @@ -0,0 +1,43 @@ +{ lib, buildDunePackage, fetchurl +, fmt, mirage-flow, result, rresult, cstruct, logs, ke, lwt +, alcotest, alcotest-lwt, bigstringaf, bigarray-compat +}: + +buildDunePackage rec { + pname = "mimic"; + version = "0.0.3"; + + minimumOCamlVersion = "4.08"; + useDune2 = true; + + src = fetchurl { + url = "https://github.com/dinosaure/mimic/releases/download/${version}/mimic-${version}.tbz"; + sha256 = "e4743cd2e4f8242eb1ce9d8086fd2affba0eb6a62131309ffa279108bd3dbbcb"; + }; + + propagatedBuildInputs = [ + fmt + lwt + mirage-flow + result + rresult + logs + ]; + + doCheck = true; + checkInputs = [ + alcotest + alcotest-lwt + bigstringaf + bigarray-compat + cstruct + ke + ]; + + meta = with lib; { + description = "A simple protocol dispatcher"; + license = licenses.isc; + homepage = "https://github.com/mirage/ocaml-git"; + maintainers = [ maintainers.sternenseemann ]; + }; +} diff --git a/pkgs/development/ocaml-modules/minisat/default.nix b/pkgs/development/ocaml-modules/minisat/default.nix new file mode 100644 index 00000000000..433431d8f9c --- /dev/null +++ b/pkgs/development/ocaml-modules/minisat/default.nix @@ -0,0 +1,24 @@ +{ lib, buildDunePackage, fetchFromGitHub }: + +buildDunePackage rec { + pname = "minisat"; + version = "0.4"; + + useDune2 = true; + + minimumOCamlVersion = "4.05"; + + src = fetchFromGitHub { + owner = "c-cube"; + repo = "ocaml-minisat"; + rev = "v${version}"; + sha256 = "009jncrvnl9synxx6jnm6gp0cs7zlj71z22zz7bs1750b0jrfm2r"; + }; + + meta = { + homepage = "https://c-cube.github.io/ocaml-minisat/"; + description = "Simple bindings to Minisat-C"; + license = lib.licenses.bsd2; + maintainers = with lib.maintainers; [ mgttlinger ]; + }; +} diff --git a/pkgs/development/ocaml-modules/mirage-block-ramdisk/default.nix b/pkgs/development/ocaml-modules/mirage-block-ramdisk/default.nix new file mode 100644 index 00000000000..7e8ebba73eb --- /dev/null +++ b/pkgs/development/ocaml-modules/mirage-block-ramdisk/default.nix @@ -0,0 +1,34 @@ +{ lib, fetchurl, buildDunePackage, io-page, io-page-unix, mirage-block, alcotest +, mirage-block-combinators }: + +buildDunePackage rec { + pname = "mirage-block-ramdisk"; + version = "0.5"; + + useDune2 = true; + + src = fetchurl { + url = + "https://github.com/mirage/mirage-block-ramdisk/releases/download/${version}/mirage-block-ramdisk-${version}.tbz"; + sha256 = "cc0e814fd54efe7a5b7a8c5eb1c04e2dece751b7d8dee2d95908a0768896e8af"; + }; + + # Make tests compatible with alcotest 1.4.0 + postPatch = '' + substituteInPlace test/tests.ml --replace 'Fmt.kstrf Alcotest.fail' 'Fmt.kstrf (fun s -> Alcotest.fail s)' + ''; + + minimumOCamlVersion = "4.06"; + + propagatedBuildInputs = [ io-page mirage-block ]; + + doCheck = true; + checkInputs = [ alcotest io-page-unix mirage-block-combinators ]; + + meta = with lib; { + description = "In-memory BLOCK device for MirageOS"; + homepage = "https://github.com/mirage/mirage-block-ramdisk"; + license = licenses.isc; + maintainers = with maintainers; [ ehmry ]; + }; +} diff --git a/pkgs/development/ocaml-modules/mirage-block-unix/default.nix b/pkgs/development/ocaml-modules/mirage-block-unix/default.nix new file mode 100644 index 00000000000..a24c4c9e821 --- /dev/null +++ b/pkgs/development/ocaml-modules/mirage-block-unix/default.nix @@ -0,0 +1,29 @@ +{ lib, fetchurl, buildDunePackage, cstruct-lwt, diet, io-page-unix, logs +, mirage-block, ounit, rresult, uri }: + +buildDunePackage rec { + pname = "mirage-block-unix"; + version = "2.12.1"; + + useDune2 = true; + + src = fetchurl { + url = + "https://github.com/mirage/mirage-block-unix/releases/download/v${version}/mirage-block-unix-v${version}.tbz"; + sha256 = "4fc0ccea3c06c654e149c0f0e1c2a6f19be4e3fe1afd293c6a0dba1b56b3b8c4"; + }; + + minimumOCamlVersion = "4.06"; + + propagatedBuildInputs = [ cstruct-lwt logs mirage-block rresult uri ]; + + doCheck = true; + checkInputs = [ diet io-page-unix ounit ]; + + meta = with lib; { + description = "MirageOS disk block driver for Unix"; + homepage = "https://github.com/mirage/mirage-block-unix"; + license = licenses.isc; + maintainers = with maintainers; [ ehmry ]; + }; +} diff --git a/pkgs/development/ocaml-modules/mirage-block/combinators.nix b/pkgs/development/ocaml-modules/mirage-block/combinators.nix new file mode 100644 index 00000000000..4787373c1e3 --- /dev/null +++ b/pkgs/development/ocaml-modules/mirage-block/combinators.nix @@ -0,0 +1,25 @@ +{ buildDunePackage, fetchpatch, mirage-block, io-page, logs }: + +buildDunePackage rec { + pname = "mirage-block-combinators"; + inherit (mirage-block) version src useDune2; + + patches = [ + (fetchpatch { + name = "cstruct-6.0.0-compat.patch"; + url = "https://github.com/mirage/mirage-block/pull/49/commits/ff54105b21fb32d0d6977b419db0776e6c2ea166.patch"; + sha256 = "0bwgypnsyn4d9b46q6r7kh5qfcy58db7krs6z5zw83hc7y20y2sd"; + }) + ]; + + propagatedBuildInputs = [ mirage-block io-page logs ]; + + meta = mirage-block.meta // { + description = "Block signatures and implementations for MirageOS using Lwt"; + longDescription = '' + This repo contains generic operations over Mirage `BLOCK` devices. + This package is specialised to the Lwt concurrency library for IO. + ''; + }; + +} diff --git a/pkgs/development/ocaml-modules/mirage-block/default.nix b/pkgs/development/ocaml-modules/mirage-block/default.nix new file mode 100644 index 00000000000..28eb4d6b28e --- /dev/null +++ b/pkgs/development/ocaml-modules/mirage-block/default.nix @@ -0,0 +1,24 @@ +{ lib, fetchurl, buildDunePackage +, cstruct, lwt, mirage-device +}: + +buildDunePackage rec { + pname = "mirage-block"; + version = "2.0.1"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/mirage/mirage-block/releases/download/v${version}/mirage-block-v${version}.tbz"; + sha256 = "1wp8wmixaz9i2sbvq6nkx903lbnpdgb2w404pz1wk8kcg9p3ilcc"; + }; + + propagatedBuildInputs = [ cstruct lwt mirage-device ]; + + meta = with lib; { + description = "Block signatures and implementations for MirageOS"; + homepage = "https://github.com/mirage/mirage-block"; + license = licenses.isc; + maintainers = with maintainers; [ vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/mirage-bootvar-unix/default.nix b/pkgs/development/ocaml-modules/mirage-bootvar-unix/default.nix new file mode 100644 index 00000000000..d34513afef9 --- /dev/null +++ b/pkgs/development/ocaml-modules/mirage-bootvar-unix/default.nix @@ -0,0 +1,24 @@ +{ lib, fetchurl, buildDunePackage +, lwt, parse-argv +}: + +buildDunePackage rec { + pname = "mirage-bootvar-unix"; + version = "0.1.0"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/mirage/mirage-bootvar-unix/releases/download/${version}/mirage-bootvar-unix-${version}.tbz"; + sha256 = "0r92s6y7nxg0ci330a7p0hii4if51iq0sixn20cnm5j4a2clprbf"; + }; + + propagatedBuildInputs = [ lwt parse-argv ]; + + meta = { + description = "Unix implementation of MirageOS Bootvar interface"; + homepage = "https://github.com/mirage/mirage-bootvar-unix"; + license = lib.licenses.isc; + maintainers = [ lib.maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/mirage-bootvar-xen/default.nix b/pkgs/development/ocaml-modules/mirage-bootvar-xen/default.nix new file mode 100644 index 00000000000..c280853488d --- /dev/null +++ b/pkgs/development/ocaml-modules/mirage-bootvar-xen/default.nix @@ -0,0 +1,34 @@ +{ lib +, buildDunePackage +, fetchurl +, mirage-xen +, parse-argv +, lwt +}: + +buildDunePackage rec { + pname = "mirage-bootvar-xen"; + version = "0.8.0"; + + minimumOCamlVersion = "4.08"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/mirage/mirage-bootvar-xen/releases/download/v${version}/mirage-bootvar-xen-v${version}.tbz"; + sha256 = "0nk80giq9ng3svbnm68fjby2f1dnarddm3lk7mw7w59av71q0rcv"; + }; + + propagatedBuildInputs = [ + mirage-xen + lwt + parse-argv + ]; + + meta = with lib; { + description = "Handle boot-time arguments for Xen platform"; + license = licenses.isc; + maintainers = [ maintainers.sternenseemann ]; + homepage = "https://github.com/mirage/mirage-bootvar-xen"; + }; +} diff --git a/pkgs/development/ocaml-modules/mirage-channel/default.nix b/pkgs/development/ocaml-modules/mirage-channel/default.nix new file mode 100644 index 00000000000..227e821e192 --- /dev/null +++ b/pkgs/development/ocaml-modules/mirage-channel/default.nix @@ -0,0 +1,33 @@ +{ lib, fetchurl, buildDunePackage +, cstruct, logs, lwt, mirage-flow +, alcotest, mirage-flow-combinators +}: + +buildDunePackage rec { + pname = "mirage-channel"; + version = "4.0.1"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/mirage/mirage-channel/releases/download/v${version}/mirage-channel-v${version}.tbz"; + sha256 = "0wmb2zhiyp8n78xgcspcsyd19bhcml3kyli2caw3778wc1gyvfpc"; + }; + + # Make tests compatible with alcotest 1.4.0 + postPatch = '' + substituteInPlace test/test_channel.ml --replace 'Fmt.kstrf Alcotest.fail' 'Fmt.kstrf (fun s -> Alcotest.fail s)' + ''; + + propagatedBuildInputs = [ cstruct logs lwt mirage-flow ]; + + doCheck = true; + checkInputs = [ alcotest mirage-flow-combinators ]; + + meta = { + description = "Buffered channels for MirageOS FLOW types"; + license = lib.licenses.isc; + maintainers = [ lib.maintainers.vbgl ]; + homepage = "https://github.com/mirage/mirage-channel"; + }; +} diff --git a/pkgs/development/ocaml-modules/mirage-clock/default.nix b/pkgs/development/ocaml-modules/mirage-clock/default.nix new file mode 100644 index 00000000000..de8cfd311e5 --- /dev/null +++ b/pkgs/development/ocaml-modules/mirage-clock/default.nix @@ -0,0 +1,24 @@ +{ lib, buildDunePackage, fetchurl }: + +buildDunePackage rec { + pname = "mirage-clock"; + version = "3.1.0"; + + useDune2 = true; + + minimumOCamlVersion = "4.06"; + + src = fetchurl { + url = "https://github.com/mirage/mirage-clock/releases/download/v${version}/mirage-clock-v${version}.tbz"; + sha256 = "0cqa07aqkamw0dvis1fl46brvk81zvb92iy5076ik62gv9n5a0mn"; + }; + + meta = { + description = "Libraries and module types for portable clocks"; + homepage = "https://github.com/mirage/mirage-clock"; + license = lib.licenses.isc; + maintainers = [ lib.maintainers.vbgl ]; + }; +} + + diff --git a/pkgs/development/ocaml-modules/mirage-clock/freestanding.nix b/pkgs/development/ocaml-modules/mirage-clock/freestanding.nix new file mode 100644 index 00000000000..ef278f1cd25 --- /dev/null +++ b/pkgs/development/ocaml-modules/mirage-clock/freestanding.nix @@ -0,0 +1,23 @@ +{ lib +, buildDunePackage +, mirage-clock +}: + +buildDunePackage { + pname = "mirage-clock-freestanding"; + + inherit (mirage-clock) + version + src + useDune2 + minimumOCamlVersion + ; + + propagatedBuildInputs = [ + mirage-clock + ]; + + meta = mirage-clock.meta // { + description = "Paravirtual implementation of the MirageOS Clock interface"; + }; +} diff --git a/pkgs/development/ocaml-modules/mirage-clock/unix.nix b/pkgs/development/ocaml-modules/mirage-clock/unix.nix new file mode 100644 index 00000000000..355cffaaa15 --- /dev/null +++ b/pkgs/development/ocaml-modules/mirage-clock/unix.nix @@ -0,0 +1,15 @@ +{ buildDunePackage, mirage-clock, dune-configurator }: + +buildDunePackage { + pname = "mirage-clock-unix"; + + inherit (mirage-clock) version useDune2 src; + + buildInputs = [ dune-configurator ]; + + propagatedBuildInputs = [ mirage-clock ]; + + meta = mirage-clock.meta // { + description = "Unix-based implementation for the MirageOS Clock interface"; + }; +} diff --git a/pkgs/development/ocaml-modules/mirage-console/default.nix b/pkgs/development/ocaml-modules/mirage-console/default.nix new file mode 100644 index 00000000000..986084c3f54 --- /dev/null +++ b/pkgs/development/ocaml-modules/mirage-console/default.nix @@ -0,0 +1,26 @@ +{ lib, fetchurl, buildDunePackage +, lwt, mirage-device, mirage-flow +}: + +buildDunePackage rec { + pname = "mirage-console"; + version = "4.0.0"; + + minimumOCamlVersion = "4.08"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/mirage/mirage-console/releases/download/v${version}/mirage-console-v${version}.tbz"; + sha256 = "11nwfd4kmmdzkrkhbakdi3cxhk8vi98l17960rgcf85c602gw6vp"; + }; + + propagatedBuildInputs = [ lwt mirage-device mirage-flow ]; + + meta = { + description = "Implementations of Mirage console devices"; + homepage = "https://github.com/mirage/mirage-console"; + license = lib.licenses.isc; + maintainers = [ lib.maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/mirage-console/unix.nix b/pkgs/development/ocaml-modules/mirage-console/unix.nix new file mode 100644 index 00000000000..dea613511a2 --- /dev/null +++ b/pkgs/development/ocaml-modules/mirage-console/unix.nix @@ -0,0 +1,17 @@ +{ buildDunePackage, mirage-console, lwt, cstruct, cstruct-lwt }: + +buildDunePackage { + pname = "mirage-console-unix"; + + inherit (mirage-console) version src useDune2 minimumOCamlVersion; + + propagatedBuildInputs = [ + mirage-console + cstruct + cstruct-lwt + ]; + + meta = mirage-console.meta // { + description = "Implementation of Mirage consoles for Unix"; + }; +} diff --git a/pkgs/development/ocaml-modules/mirage-crypto/default.nix b/pkgs/development/ocaml-modules/mirage-crypto/default.nix new file mode 100644 index 00000000000..c942972597a --- /dev/null +++ b/pkgs/development/ocaml-modules/mirage-crypto/default.nix @@ -0,0 +1,42 @@ +{ lib, fetchurl, buildDunePackage, ounit, cstruct, dune-configurator, eqaf, pkg-config +, withFreestanding ? false +, ocaml-freestanding +}: + +buildDunePackage rec { + minimumOCamlVersion = "4.08"; + + pname = "mirage-crypto"; + version = "0.10.5"; + + src = fetchurl { + url = "https://github.com/mirage/mirage-crypto/releases/download/v${version}/mirage-crypto-v${version}.tbz"; + sha256 = "sha256-eeKMSRZrBiTzWLv80P5LeouPib24uTigk2HLtORKpJU="; + }; + + useDune2 = true; + + doCheck = true; + checkInputs = [ ounit ]; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ dune-configurator ]; + propagatedBuildInputs = [ + cstruct eqaf + ] ++ lib.optionals withFreestanding [ + ocaml-freestanding + ]; + + strictDeps = !doCheck; + + meta = with lib; { + homepage = "https://github.com/mirage/mirage-crypto"; + description = "Simple symmetric cryptography for the modern age"; + license = [ + licenses.isc # default license + licenses.bsd2 # mirage-crypto-rng-mirage + licenses.mit # mirage-crypto-ec + ]; + maintainers = with maintainers; [ sternenseemann ]; + }; +} diff --git a/pkgs/development/ocaml-modules/mirage-crypto/ec.nix b/pkgs/development/ocaml-modules/mirage-crypto/ec.nix new file mode 100644 index 00000000000..5506243ec3a --- /dev/null +++ b/pkgs/development/ocaml-modules/mirage-crypto/ec.nix @@ -0,0 +1,58 @@ +{ lib +, ocaml +, buildDunePackage +, mirage-crypto +, dune-configurator +, pkg-config +, cstruct +, mirage-crypto-rng +, mirage-crypto-pk +, hex +, alcotest +, asn1-combinators +, ppx_deriving_yojson +, ppx_deriving +, yojson +, withFreestanding ? false +, ocaml-freestanding +}: + +buildDunePackage rec { + pname = "mirage-crypto-ec"; + + inherit (mirage-crypto) + minimumOCamlVersion + src + version + useDune2; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ + ocaml + dune-configurator + ]; + propagatedBuildInputs = [ + cstruct + mirage-crypto + mirage-crypto-rng + ] ++ lib.optionals withFreestanding [ + ocaml-freestanding + ]; + + strictDeps = !doCheck; + + doCheck = true; + checkInputs = [ + hex + alcotest + asn1-combinators + ppx_deriving_yojson + ppx_deriving + yojson + mirage-crypto-pk + ]; + + meta = mirage-crypto.meta // { + description = "Elliptic Curve Cryptography with primitives taken from Fiat"; + }; +} diff --git a/pkgs/development/ocaml-modules/mirage-crypto/pk.nix b/pkgs/development/ocaml-modules/mirage-crypto/pk.nix new file mode 100644 index 00000000000..9a2b9c98e45 --- /dev/null +++ b/pkgs/development/ocaml-modules/mirage-crypto/pk.nix @@ -0,0 +1,21 @@ +{ buildDunePackage, ounit, randomconv, mirage-crypto, mirage-crypto-rng +, cstruct, sexplib0, zarith, eqaf, gmp }: + +buildDunePackage rec { + pname = "mirage-crypto-pk"; + + inherit (mirage-crypto) version src useDune2 minimumOCamlVersion; + + buildInputs = [ gmp ]; + propagatedBuildInputs = [ cstruct mirage-crypto mirage-crypto-rng + zarith eqaf sexplib0 ]; + + strictDeps = !doCheck; + + doCheck = true; + checkInputs = [ ounit randomconv ]; + + meta = mirage-crypto.meta // { + description = "Simple public-key cryptography for the modern age"; + }; +} diff --git a/pkgs/development/ocaml-modules/mirage-crypto/rng-async.nix b/pkgs/development/ocaml-modules/mirage-crypto/rng-async.nix new file mode 100644 index 00000000000..91da7aa5681 --- /dev/null +++ b/pkgs/development/ocaml-modules/mirage-crypto/rng-async.nix @@ -0,0 +1,27 @@ +{ lib, buildDunePackage +, mirage-crypto, mirage-crypto-rng +, dune-configurator, async, logs +}: + +buildDunePackage { + pname = "mirage-crypto-rng-async"; + + inherit (mirage-crypto) useDune2 version minimumOCamlVersion src; + + buildInputs = [ + dune-configurator + ]; + + propagatedBuildInputs = [ + async + logs + mirage-crypto + mirage-crypto-rng + ]; + + strictDeps = true; + + meta = mirage-crypto.meta // { + description = "Feed the entropy source in an Async-friendly way"; + }; +} diff --git a/pkgs/development/ocaml-modules/mirage-crypto/rng-mirage.nix b/pkgs/development/ocaml-modules/mirage-crypto/rng-mirage.nix new file mode 100644 index 00000000000..8d67ade9b46 --- /dev/null +++ b/pkgs/development/ocaml-modules/mirage-crypto/rng-mirage.nix @@ -0,0 +1,22 @@ +{ buildDunePackage, mirage-crypto-rng, duration, cstruct, mirage-runtime +, mirage-time, mirage-clock, mirage-unix, mirage-time-unix, mirage-clock-unix +, logs, lwt +}: + +buildDunePackage rec { + pname = "mirage-crypto-rng-mirage"; + + inherit (mirage-crypto-rng) version src useDune2 minimumOCamlVersion; + + doCheck = true; + checkInputs = [ mirage-unix mirage-clock-unix mirage-time-unix ]; + + propagatedBuildInputs = [ duration cstruct mirage-crypto-rng mirage-runtime + mirage-time mirage-clock logs lwt ]; + + strictDeps = !doCheck; + + meta = mirage-crypto-rng.meta // { + description = "Entropy collection for a cryptographically secure PRNG"; + }; +} diff --git a/pkgs/development/ocaml-modules/mirage-crypto/rng.nix b/pkgs/development/ocaml-modules/mirage-crypto/rng.nix new file mode 100644 index 00000000000..2281f10580c --- /dev/null +++ b/pkgs/development/ocaml-modules/mirage-crypto/rng.nix @@ -0,0 +1,20 @@ +{ buildDunePackage, mirage-crypto, ounit, randomconv, dune-configurator +, cstruct, duration, logs, mtime, ocaml_lwt }: + +buildDunePackage rec { + pname = "mirage-crypto-rng"; + + inherit (mirage-crypto) version src useDune2 minimumOCamlVersion; + + doCheck = true; + checkInputs = [ ounit randomconv ]; + + buildInputs = [ dune-configurator ]; + propagatedBuildInputs = [ cstruct mirage-crypto duration logs mtime ocaml_lwt ]; + + strictDeps = !doCheck; + + meta = mirage-crypto.meta // { + description = "A cryptographically secure PRNG"; + }; +} diff --git a/pkgs/development/ocaml-modules/mirage-device/default.nix b/pkgs/development/ocaml-modules/mirage-device/default.nix new file mode 100644 index 00000000000..d233277b7a7 --- /dev/null +++ b/pkgs/development/ocaml-modules/mirage-device/default.nix @@ -0,0 +1,24 @@ +{ lib, buildDunePackage, fetchurl, fmt, ocaml_lwt }: + +buildDunePackage rec { + pname = "mirage-device"; + version = "2.0.0"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/mirage/mirage-device/releases/download/v${version}/mirage-device-v${version}.tbz"; + sha256 = "18alxyi6wlxqvb4lajjlbdfkgcajsmklxi9xqmpcz07j51knqa04"; + }; + + propagatedBuildInputs = [ fmt ocaml_lwt ]; + + meta = { + description = "Abstract devices for MirageOS"; + homepage = "https://github.com/mirage/mirage-device"; + license = lib.licenses.isc; + maintainers = [ lib.maintainers.vbgl ]; + }; +} + + diff --git a/pkgs/development/ocaml-modules/mirage-flow/combinators.nix b/pkgs/development/ocaml-modules/mirage-flow/combinators.nix new file mode 100644 index 00000000000..d4904e77430 --- /dev/null +++ b/pkgs/development/ocaml-modules/mirage-flow/combinators.nix @@ -0,0 +1,13 @@ +{ buildDunePackage, mirage-flow, fmt, ocaml_lwt, logs, cstruct, mirage-clock }: + +buildDunePackage { + pname = "mirage-flow-combinators"; + + inherit (mirage-flow) version useDune2 src; + + propagatedBuildInputs = [ ocaml_lwt logs cstruct mirage-clock mirage-flow ]; + + meta = mirage-flow.meta // { + description = "Flow implementations and combinators for MirageOS specialized to lwt"; + }; +} diff --git a/pkgs/development/ocaml-modules/mirage-flow/default.nix b/pkgs/development/ocaml-modules/mirage-flow/default.nix new file mode 100644 index 00000000000..d6ba6603596 --- /dev/null +++ b/pkgs/development/ocaml-modules/mirage-flow/default.nix @@ -0,0 +1,25 @@ +{ lib, buildDunePackage, fetchurl, cstruct, fmt, ocaml_lwt }: + +buildDunePackage rec { + pname = "mirage-flow"; + version = "2.0.1"; + + useDune2 = true; + minimumOCamlVersion = "4.05"; + + src = fetchurl { + url = "https://github.com/mirage/mirage-flow/releases/download/v${version}/mirage-flow-v${version}.tbz"; + sha256 = "13v05x34six0z6bc2is8qhvbxk4knxh80ardi5x4rl738vlq3mn9"; + }; + + propagatedBuildInputs = [ cstruct fmt ocaml_lwt ]; + + meta = { + description = "Flow implementations and combinators for MirageOS"; + homepage = "https://github.com/mirage/mirage-flow"; + license = lib.licenses.isc; + maintainers = [ lib.maintainers.vbgl ]; + }; +} + + diff --git a/pkgs/development/ocaml-modules/mirage-flow/unix.nix b/pkgs/development/ocaml-modules/mirage-flow/unix.nix new file mode 100644 index 00000000000..0bd3e42ad37 --- /dev/null +++ b/pkgs/development/ocaml-modules/mirage-flow/unix.nix @@ -0,0 +1,22 @@ +{ buildDunePackage, fmt, logs, mirage-flow, ocaml_lwt, cstruct +, alcotest, mirage-flow-combinators }: + +buildDunePackage { + pname = "mirage-flow-unix"; + + inherit (mirage-flow) version useDune2 src; + + # Make tests compatible with alcotest 1.4.0 + postPatch = '' + substituteInPlace test/test.ml --replace 'Fmt.kstrf Alcotest.fail' 'Fmt.kstrf (fun s -> Alcotest.fail s)' + ''; + + propagatedBuildInputs = [ fmt logs mirage-flow ocaml_lwt cstruct ]; + + doCheck = true; + checkInputs = [ alcotest mirage-flow-combinators ]; + + meta = mirage-flow.meta // { + description = "Flow implementations and combinators for MirageOS on Unix"; + }; +} diff --git a/pkgs/development/ocaml-modules/mirage-fs/default.nix b/pkgs/development/ocaml-modules/mirage-fs/default.nix new file mode 100644 index 00000000000..d8cfddff313 --- /dev/null +++ b/pkgs/development/ocaml-modules/mirage-fs/default.nix @@ -0,0 +1,24 @@ +{ lib, fetchurl, buildDunePackage +, cstruct, fmt, lwt, mirage-device, mirage-kv +}: + +buildDunePackage rec { + pname = "mirage-fs"; + version = "3.0.1"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/mirage/mirage-fs/releases/download/v${version}/mirage-fs-v${version}.tbz"; + sha256 = "0px18bgk528vr7iw78r0j3z4sdcz684sfcj47ibbly2adbvd64yk"; + }; + + propagatedBuildInputs = [ cstruct fmt lwt mirage-device mirage-kv ]; + + meta = { + description = "MirageOS signatures for filesystem devices"; + homepage = "https://github.com/mirage/mirage-fs"; + license = lib.licenses.isc; + maintainers = [ lib.maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/mirage-kv/default.nix b/pkgs/development/ocaml-modules/mirage-kv/default.nix new file mode 100644 index 00000000000..20d83e16641 --- /dev/null +++ b/pkgs/development/ocaml-modules/mirage-kv/default.nix @@ -0,0 +1,28 @@ +{ lib, fetchurl, buildDunePackage +, fmt, mirage-device +, alcotest +}: + +buildDunePackage rec { + pname = "mirage-kv"; + version = "3.0.1"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/mirage/mirage-kv/releases/download/v${version}/mirage-kv-v${version}.tbz"; + sha256 = "1n736sjvdd8rkbc2b5jm9sn0w6hvhjycma5328r0l03v24vk5cki"; + }; + + propagatedBuildInputs = [ fmt mirage-device ]; + + doCheck = true; + checkInputs = [ alcotest ]; + + meta = { + description = "MirageOS signatures for key/value devices"; + homepage = "https://github.com/mirage/mirage-kv"; + license = lib.licenses.isc; + maintainers = [ lib.maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/mirage-logs/default.nix b/pkgs/development/ocaml-modules/mirage-logs/default.nix new file mode 100644 index 00000000000..2a7670ce372 --- /dev/null +++ b/pkgs/development/ocaml-modules/mirage-logs/default.nix @@ -0,0 +1,28 @@ +{ lib, fetchurl, buildDunePackage +, logs, lwt, mirage-clock, mirage-profile, ptime +, alcotest +}: + +buildDunePackage rec { + pname = "mirage-logs"; + version = "1.2.0"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/mirage/mirage-logs/releases/download/v${version}/mirage-logs-v${version}.tbz"; + sha256 = "0h0amzjxy067jljscib7fvw5q8k0adqa8m86affha9hq5jsh07a1"; + }; + + propagatedBuildInputs = [ logs lwt mirage-clock mirage-profile ptime ]; + + doCheck = true; + checkInputs = [ alcotest ]; + + meta = { + description = "A reporter for the Logs library that writes log messages to stderr, using a Mirage `CLOCK` to add timestamps"; + homepage = "https://github.com/mirage/mirage-logs"; + license = lib.licenses.isc; + maintainers = [ lib.maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/mirage-nat/default.nix b/pkgs/development/ocaml-modules/mirage-nat/default.nix new file mode 100644 index 00000000000..9d4bbc88c2c --- /dev/null +++ b/pkgs/development/ocaml-modules/mirage-nat/default.nix @@ -0,0 +1,50 @@ +{ lib, buildDunePackage, fetchurl +, ipaddr, cstruct, lwt, logs, lru +, tcpip, ethernet, stdlib-shims +, alcotest, mirage-clock-unix +, ppxlib, ppx_deriving +}: + +buildDunePackage rec { + pname = "mirage-nat"; + version = "2.2.5"; + + minimumOCamlVersion = "4.08"; + + # due to cstruct + useDune2 = true; + + src = fetchurl { + url = "https://github.com/mirage/${pname}/releases/download/v${version}/${pname}-v${version}.tbz"; + sha256 = "01xp0z4mywhawz7rxizi9ph342mqqwyfa5hqgvs8lhqzcym5d104"; + }; + + buildInputs = [ + ppxlib + ]; + + propagatedBuildInputs = [ + ipaddr + cstruct + lwt + logs + lru + tcpip + ethernet + stdlib-shims + ppx_deriving + ]; + + doCheck = true; + checkInputs = [ + alcotest + mirage-clock-unix + ]; + + meta = with lib; { + description = "Mirage-nat is a library for network address translation to be used with MirageOS"; + homepage = "https://github.com/mirage/${pname}"; + license = licenses.isc; + maintainers = [ maintainers.sternenseemann ]; + }; +} diff --git a/pkgs/development/ocaml-modules/mirage-net-xen/default.nix b/pkgs/development/ocaml-modules/mirage-net-xen/default.nix new file mode 100644 index 00000000000..0d7a7e53fb1 --- /dev/null +++ b/pkgs/development/ocaml-modules/mirage-net-xen/default.nix @@ -0,0 +1,39 @@ +{ lib +, buildDunePackage +, netchannel +, ppx_sexp_conv +, lwt +, cstruct +, mirage-net +, mirage-xen +, io-page +, lwt-dllist +, logs +}: + +buildDunePackage { + pname = "mirage-net-xen"; + + inherit (netchannel) + src + version + useDune2 + minimumOCamlVersion + meta + ; + + nativeBuildInputs = [ + ppx_sexp_conv + ]; + + propagatedBuildInputs = [ + lwt + cstruct + netchannel + mirage-net + mirage-xen + io-page + lwt-dllist + logs + ]; +} diff --git a/pkgs/development/ocaml-modules/mirage-net/default.nix b/pkgs/development/ocaml-modules/mirage-net/default.nix new file mode 100644 index 00000000000..a29727d7ee1 --- /dev/null +++ b/pkgs/development/ocaml-modules/mirage-net/default.nix @@ -0,0 +1,24 @@ +{ lib, fetchurl, buildDunePackage +, cstruct, fmt, lwt, macaddr, mirage-device +}: + +buildDunePackage rec { + pname = "mirage-net"; + version = "3.0.1"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/mirage/mirage-net/releases/download/v${version}/mirage-net-v${version}.tbz"; + sha256 = "0yfvl0fgs7xy5i7kkparaa7a315a2h7kb1z24fmmnwnyaji57dg3"; + }; + + propagatedBuildInputs = [ cstruct fmt lwt macaddr mirage-device ]; + + meta = { + description = "Network signatures for MirageOS"; + homepage = "https://github.com/mirage/mirage-net"; + license = lib.licenses.isc; + maintainers = [ lib.maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/mirage-profile/default.nix b/pkgs/development/ocaml-modules/mirage-profile/default.nix new file mode 100644 index 00000000000..c6ca730bf3c --- /dev/null +++ b/pkgs/development/ocaml-modules/mirage-profile/default.nix @@ -0,0 +1,26 @@ +{ lib, fetchurl, buildDunePackage +, ppx_cstruct +, cstruct, lwt +}: + +buildDunePackage rec { + pname = "mirage-profile"; + version = "0.9.1"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/mirage/mirage-profile/releases/download/v${version}/mirage-profile-v${version}.tbz"; + sha256 = "0lh3591ad4v7nxpd410b75idmgdq668mqdilvkg4avrwqw1wzdib"; + }; + + buildInputs = [ ppx_cstruct ]; + propagatedBuildInputs = [ cstruct lwt ]; + + meta = with lib; { + description = "Collect runtime profiling information in CTF format"; + homepage = "https://github.com/mirage/mirage-profile"; + license = licenses.bsd2; + maintainers = with maintainers; [ vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/mirage-protocols/default.nix b/pkgs/development/ocaml-modules/mirage-protocols/default.nix new file mode 100644 index 00000000000..9f144bd2d7e --- /dev/null +++ b/pkgs/development/ocaml-modules/mirage-protocols/default.nix @@ -0,0 +1,24 @@ +{ lib, buildDunePackage, fetchurl, duration, ipaddr, mirage-device, mirage-flow }: + +buildDunePackage rec { + pname = "mirage-protocols"; + version = "5.0.0"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/mirage/mirage-protocols/releases/download/v${version}/mirage-protocols-v${version}.tbz"; + sha256 = "1bd6zgxhq2qliyzzarfvaj3ksr20ryghxq6h24i2hha7rwim63bk"; + }; + + propagatedBuildInputs = [ duration ipaddr mirage-device mirage-flow ]; + + meta = { + description = "MirageOS signatures for network protocols"; + homepage = "https://github.com/mirage/mirage-protocols"; + license = lib.licenses.isc; + maintainers = [ lib.maintainers.vbgl ]; + }; +} + + diff --git a/pkgs/development/ocaml-modules/mirage-random-test/default.nix b/pkgs/development/ocaml-modules/mirage-random-test/default.nix new file mode 100644 index 00000000000..81d75db7725 --- /dev/null +++ b/pkgs/development/ocaml-modules/mirage-random-test/default.nix @@ -0,0 +1,30 @@ +{ lib, buildDunePackage, fetchurl +, cstruct, mirage-random +}: + +buildDunePackage rec { + pname = "mirage-random-test"; + version = "0.1.0"; + + minimumOCamlVersion = "4.06"; + + # due to cstruct + useDune2 = true; + + src = fetchurl { + url = "https://github.com/mirage/${pname}/releases/download/v${version}/${pname}-v${version}.tbz"; + sha256 = "1jmjyb9a4v7l0xxgdwpr9zshzr8xk3hybra6y2dp51anbwk8kv46"; + }; + + propagatedBuildInputs = [ + cstruct + mirage-random + ]; + + meta = with lib; { + description = "Stub random device implementation for testing"; + homepage = "https://github.com/mirage/mirage-random"; + license = licenses.isc; + maintainers = [ maintainers.sternenseemann ]; + }; +} diff --git a/pkgs/development/ocaml-modules/mirage-random/default.nix b/pkgs/development/ocaml-modules/mirage-random/default.nix new file mode 100644 index 00000000000..defde0ba89f --- /dev/null +++ b/pkgs/development/ocaml-modules/mirage-random/default.nix @@ -0,0 +1,22 @@ +{ lib, buildDunePackage, fetchurl, cstruct }: + +buildDunePackage rec { + pname = "mirage-random"; + version = "2.0.0"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/mirage/mirage-random/releases/download/v${version}/mirage-random-v${version}.tbz"; + sha256 = "0qj41d5smkkkbjwsnz71bhhj94d2cwv53rf3j4rhky0pqbkidnv1"; + }; + + propagatedBuildInputs = [ cstruct ]; + + meta = { + description = "Random signatures for MirageOS"; + homepage = "https://github.com/mirage/mirage-random"; + license = lib.licenses.isc; + maintainers = [ lib.maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/mirage-stack/default.nix b/pkgs/development/ocaml-modules/mirage-stack/default.nix new file mode 100644 index 00000000000..dbcba59c479 --- /dev/null +++ b/pkgs/development/ocaml-modules/mirage-stack/default.nix @@ -0,0 +1,22 @@ +{ lib, buildDunePackage, fetchurl, mirage-protocols }: + +buildDunePackage rec { + pname = "mirage-stack"; + version = "2.2.0"; + useDune2 = true; + + src = fetchurl { + url = "https://github.com/mirage/mirage-stack/releases/download/v${version}/mirage-stack-v${version}.tbz"; + sha256 = "1qhi0ghcj4j3hw7yqn085ac6n18b6b66z5ih3k8p79m4cvn7cdq0"; + }; + + propagatedBuildInputs = [ mirage-protocols ]; + + meta = { + description = "MirageOS signatures for network stacks"; + homepage = "https://github.com/mirage/mirage-stack"; + license = lib.licenses.isc; + maintainers = [ lib.maintainers.vbgl ]; + }; +} + diff --git a/pkgs/development/ocaml-modules/mirage-time/default.nix b/pkgs/development/ocaml-modules/mirage-time/default.nix new file mode 100644 index 00000000000..2e91bda61d6 --- /dev/null +++ b/pkgs/development/ocaml-modules/mirage-time/default.nix @@ -0,0 +1,24 @@ +{ lib, buildDunePackage, fetchurl, ocaml_lwt }: + +buildDunePackage rec { + minimumOCamlVersion = "4.06"; + + pname = "mirage-time"; + version = "2.0.1"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/mirage/mirage-time/releases/download/v${version}/mirage-time-v${version}.tbz"; + sha256 = "1w6mm4g7fc19cs0ncs0s9fsnb1k1s04qqzs9bsqvq8ngsb90cbh0"; + }; + + propagatedBuildInputs = [ ocaml_lwt ]; + + meta = with lib; { + homepage = "https://github.com/mirage/mirage-time"; + description = "Time operations for MirageOS"; + license = licenses.isc; + maintainers = with maintainers; [ sternenseemann ]; + }; +} diff --git a/pkgs/development/ocaml-modules/mirage-time/unix.nix b/pkgs/development/ocaml-modules/mirage-time/unix.nix new file mode 100644 index 00000000000..c19ca30fe02 --- /dev/null +++ b/pkgs/development/ocaml-modules/mirage-time/unix.nix @@ -0,0 +1,13 @@ +{ buildDunePackage, fetchurl, mirage-time, ocaml_lwt, duration }: + +buildDunePackage { + pname = "mirage-time-unix"; + + inherit (mirage-time) src useDune2 version minimumOCamlVersion; + + propagatedBuildInputs = [ mirage-time ocaml_lwt duration ]; + + meta = mirage-time.meta // { + description = "Time operations for MirageOS on Unix"; + }; +} diff --git a/pkgs/development/ocaml-modules/mirage-unix/default.nix b/pkgs/development/ocaml-modules/mirage-unix/default.nix new file mode 100644 index 00000000000..1e6dc0ef144 --- /dev/null +++ b/pkgs/development/ocaml-modules/mirage-unix/default.nix @@ -0,0 +1,23 @@ +{ lib, buildDunePackage, fetchurl, ocaml_lwt, duration, mirage-runtime, io-page-unix }: + +buildDunePackage rec { + pname = "mirage-unix"; + version = "4.0.0"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/mirage/${pname}/releases/download/v${version}/${pname}-v${version}.tbz"; + sha256 = "0kyd83bkpjhn382b4mw3a4325xr8vms78znxqvifpcyfvfnlx7hj"; + }; + + propagatedBuildInputs = [ ocaml_lwt duration mirage-runtime io-page-unix ]; + doCheck = true; + + meta = with lib; { + homepage = "https://github.com/mirage/mirage-unix"; + description = "Unix core platform libraries for MirageOS"; + license = licenses.isc; + maintainers = with maintainers; [ sternenseemann ]; + }; +} diff --git a/pkgs/development/ocaml-modules/mirage-vnetif/default.nix b/pkgs/development/ocaml-modules/mirage-vnetif/default.nix new file mode 100644 index 00000000000..876bc1a9817 --- /dev/null +++ b/pkgs/development/ocaml-modules/mirage-vnetif/default.nix @@ -0,0 +1,40 @@ +{ lib, buildDunePackage, fetchurl +, lwt, mirage-time, mirage-clock, mirage-net +, cstruct, ipaddr, macaddr, mirage-profile +, duration, logs +}: + +buildDunePackage rec { + pname = "mirage-vnetif"; + version = "0.5.0"; + + minimumOCamlVersion = "4.06"; + + # due to cstruct + useDune2 = true; + + src = fetchurl { + url = "https://github.com/mirage/${pname}/releases/download/v${version}/${pname}-v${version}.tbz"; + sha256 = "0cpqwf51v2cpz41dfqxabf3bsabwyl6a0h0v2ncrn33q58i60m5q"; + }; + + propagatedBuildInputs = [ + lwt + mirage-net + mirage-time + mirage-clock + cstruct + ipaddr + macaddr + mirage-profile + duration + logs + ]; + + meta = with lib; { + description = "Virtual network interface and software switch for Mirage"; + homepage = "https://github.com/mirage/${pname}"; + license = licenses.isc; + maintainers = [ maintainers.sternenseemann ]; + }; +} diff --git a/pkgs/development/ocaml-modules/mirage-xen/default.nix b/pkgs/development/ocaml-modules/mirage-xen/default.nix new file mode 100644 index 00000000000..0d53d0f9c3b --- /dev/null +++ b/pkgs/development/ocaml-modules/mirage-xen/default.nix @@ -0,0 +1,78 @@ +{ lib +, buildDunePackage +, fetchurl +, pkg-config +, cstruct +, lwt +, shared-memory-ring-lwt +, xenstore +, lwt-dllist +, mirage-profile +, mirage-runtime +, logs +, fmt +, ocaml-freestanding +, bheap +, duration +, io-page +}: + +buildDunePackage rec { + pname = "mirage-xen"; + version = "6.0.0"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/mirage/mirage-xen/releases/download/v${version}/mirage-xen-v${version}.tbz"; + sha256 = "f991e972059b27993c287ad010d9281fee061efaa1dd475d0955179f93710fbd"; + }; + + patches = [ + ./makefile-no-opam.patch + ./pkg-config.patch + ]; + + # can't handle OCAMLFIND_DESTDIR with substituteAll + postPatch = '' + substituteInPlace lib/bindings/mirage-xen.pc \ + --replace "@out@" "$out" \ + --replace "@OCAMLFIND_DESTDIR@" "$OCAMLFIND_DESTDIR" + ''; + + minimumOCamlVersion = "4.08"; + + nativeBuildInputs = [ + pkg-config + ]; + + propagatedBuildInputs = [ + cstruct + lwt + shared-memory-ring-lwt + xenstore + lwt-dllist + mirage-profile + mirage-runtime + io-page + logs + fmt + bheap + duration + (ocaml-freestanding.override { target = "xen"; }) + ]; + + # Move pkg-config files into their well-known location. + # This saves us an extra setup hook and causes no issues + # since we patch all relative paths out of the .pc file. + postInstall = '' + mv $OCAMLFIND_DESTDIR/pkgconfig $out/lib/pkgconfig + ''; + + meta = with lib; { + description = "Xen core platform libraries for MirageOS"; + license = licenses.isc; + maintainers = [ maintainers.sternenseemann ]; + homepage = "https://github.com/mirage/mirage-xen"; + }; +} diff --git a/pkgs/development/ocaml-modules/mirage-xen/makefile-no-opam.patch b/pkgs/development/ocaml-modules/mirage-xen/makefile-no-opam.patch new file mode 100644 index 00000000000..905e6efc3f4 --- /dev/null +++ b/pkgs/development/ocaml-modules/mirage-xen/makefile-no-opam.patch @@ -0,0 +1,12 @@ +diff --git a/lib/bindings/Makefile b/lib/bindings/Makefile +index 4e413c0..67c7bdc 100644 +--- a/lib/bindings/Makefile ++++ b/lib/bindings/Makefile +@@ -1,4 +1,6 @@ +-PKG_CONFIG_PATH := $(shell opam config var prefix)/lib/pkgconfig ++ifneq (, $(shell command -v opam)) ++ PKG_CONFIG_PATH ?= $(shell opam config var prefix)/lib/pkgconfig ++endif + + CC ?= cc + FREESTANDING_CFLAGS := $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) pkg-config --cflags ocaml-freestanding) diff --git a/pkgs/development/ocaml-modules/mirage-xen/pkg-config.patch b/pkgs/development/ocaml-modules/mirage-xen/pkg-config.patch new file mode 100644 index 00000000000..19205cf7ee4 --- /dev/null +++ b/pkgs/development/ocaml-modules/mirage-xen/pkg-config.patch @@ -0,0 +1,13 @@ +diff --git a/lib/bindings/mirage-xen.pc b/lib/bindings/mirage-xen.pc +index a03a217..8499aa4 100644 +--- a/lib/bindings/mirage-xen.pc ++++ b/lib/bindings/mirage-xen.pc +@@ -1,6 +1,6 @@ +-prefix=${pcfiledir}/../.. ++prefix=@out@ + exec_prefix=${prefix} +-libdir=${exec_prefix}/lib ++libdir=@OCAMLFIND_DESTDIR@ + + Name: mirage-xen + Version: 6.0.0 diff --git a/pkgs/development/ocaml-modules/mirage/default.nix b/pkgs/development/ocaml-modules/mirage/default.nix new file mode 100644 index 00000000000..6b8bcb1fbe9 --- /dev/null +++ b/pkgs/development/ocaml-modules/mirage/default.nix @@ -0,0 +1,40 @@ +{ lib, buildDunePackage, ocaml, alcotest +, functoria, mirage-runtime, bos +, ipaddr, astring, logs, stdlib-shims +}: + +buildDunePackage rec { + pname = "mirage"; + inherit (mirage-runtime) version src; + + minimumOCamlVersion = "4.08"; + + useDune2 = true; + + outputs = [ "out" "dev" ]; + + propagatedBuildInputs = [ + ipaddr + functoria + mirage-runtime + bos + astring + logs + stdlib-shims + ]; + + doCheck = true; + checkInputs = [ + alcotest + ]; + + installPhase = '' + runHook preInstall + dune install --prefix=$out --libdir=$dev/lib/ocaml/${ocaml.version}/site-lib/ ${pname} + runHook postInstall + ''; + + meta = mirage-runtime.meta // { + description = "The MirageOS library operating system"; + }; +} diff --git a/pkgs/development/ocaml-modules/mirage/runtime.nix b/pkgs/development/ocaml-modules/mirage/runtime.nix new file mode 100644 index 00000000000..ce50ffd2c3a --- /dev/null +++ b/pkgs/development/ocaml-modules/mirage/runtime.nix @@ -0,0 +1,27 @@ +{ lib, buildDunePackage, fetchurl, ipaddr, functoria-runtime +, fmt, logs, ocaml_lwt, alcotest }: + +buildDunePackage rec { + pname = "mirage-runtime"; + version = "3.10.7"; + + useDune2 = true; + + minimumOCamlVersion = "4.08"; + + src = fetchurl { + url = "https://github.com/mirage/mirage/releases/download/v${version}/mirage-v${version}.tbz"; + sha256 = "fec4492239c6d1fdd73db4da0782e33e66202e19595bf1d52aa98972296cc72d"; + }; + + propagatedBuildInputs = [ ipaddr functoria-runtime fmt logs ocaml_lwt ]; + checkInputs = [ alcotest ]; + doCheck = true; + + meta = with lib; { + homepage = "https://github.com/mirage/mirage"; + description = "The base MirageOS runtime library, part of every MirageOS unikernel"; + license = licenses.isc; + maintainers = with maintainers; [ sternenseemann ]; + }; +} diff --git a/pkgs/development/ocaml-modules/mirage/types-lwt.nix b/pkgs/development/ocaml-modules/mirage/types-lwt.nix new file mode 100644 index 00000000000..ac232b0be6e --- /dev/null +++ b/pkgs/development/ocaml-modules/mirage/types-lwt.nix @@ -0,0 +1,13 @@ +{ lib, buildDunePackage, mirage-types +}: + +buildDunePackage { + pname = "mirage-types-lwt"; + inherit (mirage-types) version src useDune2; + + propagatedBuildInputs = [ mirage-types ]; + + meta = mirage-types.meta // { + description = "Lwt module type definitions for MirageOS applications"; + }; +} diff --git a/pkgs/development/ocaml-modules/mirage/types.nix b/pkgs/development/ocaml-modules/mirage/types.nix new file mode 100644 index 00000000000..f30a9e263bb --- /dev/null +++ b/pkgs/development/ocaml-modules/mirage/types.nix @@ -0,0 +1,19 @@ +{ lib, buildDunePackage, mirage +, mirage-block, mirage-channel, mirage-clock, mirage-console, mirage-device +, mirage-flow, mirage-fs, mirage-kv, mirage-net, mirage-protocols, mirage-random +, mirage-stack, mirage-time +}: + +buildDunePackage { + pname = "mirage-types"; + inherit (mirage) src version useDune2; + + propagatedBuildInputs = [ mirage-block mirage-channel mirage-clock + mirage-console mirage-device mirage-flow mirage-fs mirage-kv mirage-net + mirage-protocols mirage-random mirage-stack mirage-time + ]; + + meta = mirage.meta // { + description = "Module type definitions for MirageOS applications"; + }; +} diff --git a/pkgs/development/ocaml-modules/mlgmp/META b/pkgs/development/ocaml-modules/mlgmp/META new file mode 100644 index 00000000000..e132e179b33 --- /dev/null +++ b/pkgs/development/ocaml-modules/mlgmp/META @@ -0,0 +1,7 @@ +name="gmp" +version="@VERSION@" +description="bindings to GNU MP library" +archive(byte)="gmp.cma" +archive(native)="gmp.cmxa" +requires="" + diff --git a/pkgs/development/ocaml-modules/mlgmp/default.nix b/pkgs/development/ocaml-modules/mlgmp/default.nix new file mode 100644 index 00000000000..a396549d76f --- /dev/null +++ b/pkgs/development/ocaml-modules/mlgmp/default.nix @@ -0,0 +1,42 @@ +{stdenv, lib, fetchurl, ocaml, findlib, gmp, mpfr, ncurses }: + +if lib.versionAtLeast ocaml.version "4.03" +then throw "mlgmp is not available for OCaml ${ocaml.version}" else + +let + pname = "mlgmp"; +in + +stdenv.mkDerivation rec { + name = "${pname}-${version}"; + version = "20120224"; + + src = fetchurl { + url = "http://www-verimag.imag.fr/~monniaux/download/${pname}_${version}.tar.gz"; + sha256 = "3ce1a53fa452ff5a9ba618864d3bc46ef32190b57202d1e996ca7df837ad4f24"; + }; + + makeFlags = [ + "DESTDIR=$(out)/lib/ocaml/${ocaml.version}/site-lib/gmp" + ]; + + preConfigure = "make clean"; + nativeBuildInputs = [ocaml findlib ]; + buildInputs = [ gmp mpfr ncurses]; + + strictDeps = true; + + createFindlibDestdir = true; + + propagatedbuildInputs = [gmp mpfr ncurses]; + + postInstall = '' + cp ${./META} $out/lib/ocaml/${ocaml.version}/site-lib/gmp/META + ''; + + meta = { + homepage = "http://opam.ocamlpro.com/pkg/mlgmp.20120224.html"; + description = "OCaml bindings to GNU MP library"; + license = "Free software ?"; + }; +} diff --git a/pkgs/development/ocaml-modules/mlgmpidl/default.nix b/pkgs/development/ocaml-modules/mlgmpidl/default.nix new file mode 100644 index 00000000000..d12329b811e --- /dev/null +++ b/pkgs/development/ocaml-modules/mlgmpidl/default.nix @@ -0,0 +1,38 @@ +{ stdenv, lib, fetchFromGitHub, perl, ocaml, findlib, camlidl, gmp, mpfr }: + +stdenv.mkDerivation rec { + pname = "ocaml${ocaml.version}-mlgmpidl"; + version = "1.2.12"; + src = fetchFromGitHub { + owner = "nberth"; + repo = "mlgmpidl"; + rev = version; + sha256 = "17xqiclaqs4hmnb92p9z6z9a1xfr31vcn8nlnj8ykk57by31vfza"; + }; + + nativeBuildInputs = [ perl ocaml findlib mpfr camlidl ]; + buildInputs = [ gmp mpfr ]; + + strictDeps = true; + + prefixKey = "-prefix "; + configureFlags = [ + "--gmp-prefix ${gmp.dev}" + "--mpfr-prefix ${mpfr.dev}" + ]; + + postConfigure = '' + sed -i Makefile \ + -e 's|/bin/rm|rm|' + mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib/stublibs + ''; + + + meta = { + description = "OCaml interface to the GMP library"; + homepage = "https://www.inrialpes.fr/pop-art/people/bjeannet/mlxxxidl-forge/mlgmpidl/"; + license = lib.licenses.lgpl21; + inherit (ocaml.meta) platforms; + maintainers = [ lib.maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/mmap/default.nix b/pkgs/development/ocaml-modules/mmap/default.nix new file mode 100644 index 00000000000..b13639150b0 --- /dev/null +++ b/pkgs/development/ocaml-modules/mmap/default.nix @@ -0,0 +1,20 @@ +{ lib, buildDunePackage, fetchurl }: + +buildDunePackage rec { + pname = "mmap"; + version = "1.1.0"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/mirage/mmap/releases/download/v${version}/mmap-v${version}.tbz"; + sha256 = "0l6waidal2n8mkdn74avbslvc10sf49f5d889n838z03pra5chsc"; + }; + + meta = { + homepage = "https://github.com/mirage/mmap"; + description = "Function for mapping files in memory"; + license = lib.licenses.lgpl21; + maintainers = [ lib.maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/mparser/default.nix b/pkgs/development/ocaml-modules/mparser/default.nix new file mode 100644 index 00000000000..5f63a98a130 --- /dev/null +++ b/pkgs/development/ocaml-modules/mparser/default.nix @@ -0,0 +1,21 @@ +{ lib, fetchFromGitHub, buildDunePackage }: + +buildDunePackage rec { + pname = "mparser"; + version = "1.3"; + useDune2 = true; + + src = fetchFromGitHub { + owner = "murmour"; + repo = "mparser"; + rev = version; + sha256 = "16j19v16r42gcsii6a337zrs5cxnf12ig0vaysxyr7sq5lplqhkx"; + }; + + meta = { + description = "A simple monadic parser combinator OCaml library"; + license = lib.licenses.lgpl21Plus; + homepage = "https://github.com/murmour/mparser"; + maintainers = [ lib.maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/mparser/pcre.nix b/pkgs/development/ocaml-modules/mparser/pcre.nix new file mode 100644 index 00000000000..0f26e140ed8 --- /dev/null +++ b/pkgs/development/ocaml-modules/mparser/pcre.nix @@ -0,0 +1,12 @@ +{ fetchFromGitHub, buildDunePackage, ocaml_pcre, mparser }: + +buildDunePackage rec { + pname = "mparser-pcre"; + useDune2 = true; + + inherit (mparser) src version; + + propagatedBuildInputs = [ ocaml_pcre mparser ]; + + meta = mparser.meta // { description = "PCRE-based regular expressions"; }; +} diff --git a/pkgs/development/ocaml-modules/mrmime/default.nix b/pkgs/development/ocaml-modules/mrmime/default.nix new file mode 100644 index 00000000000..a5c2a68ee47 --- /dev/null +++ b/pkgs/development/ocaml-modules/mrmime/default.nix @@ -0,0 +1,74 @@ +{ afl-persistent +, alcotest +, angstrom +, base64 +, bigarray-compat +, bigarray-overlap +, bigstringaf +, buildDunePackage +, emile +, fetchzip +, fmt +, fpath +, hxd +, ipaddr +, jsonm +, ke +, lib +, mirage-crypto-rng +, pecu +, prettym +, ptime +, rosetta +, rresult +, unstrctrd +, uutf +}: + +buildDunePackage rec { + pname = "mrmime"; + version = "0.5.0"; + + src = fetchzip { + url = "https://github.com/mirage/mrmime/releases/download/v${version}/mrmime-v${version}.tbz"; + sha256 = "14k67v0b39b8jq3ny2ymi8g8sqx2gd81mlzsjphdzdqnlx6fk716"; + }; + + useDune2 = true; + + propagatedBuildInputs = [ + angstrom + base64 + emile + fmt + ipaddr + ke + pecu + prettym + ptime + rosetta + rresult + unstrctrd + uutf + afl-persistent + bigarray-compat + bigarray-overlap + bigstringaf + fpath + mirage-crypto-rng + ]; + + checkInputs = [ + alcotest + hxd + jsonm + ]; + doCheck = true; + + meta = { + description = "Parser and generator of mail in OCaml"; + license = lib.licenses.mit; + homepage = "https://github.com/mirage/mrmime"; + maintainers = with lib.maintainers; [ ]; + }; +} diff --git a/pkgs/development/ocaml-modules/mtime/default.nix b/pkgs/development/ocaml-modules/mtime/default.nix new file mode 100644 index 00000000000..ace29633964 --- /dev/null +++ b/pkgs/development/ocaml-modules/mtime/default.nix @@ -0,0 +1,43 @@ +{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, topkg, js_of_ocaml +, jsooSupport ? lib.versionAtLeast ocaml.version "4.03" +}: + +with lib; + +let param = + if versionAtLeast ocaml.version "4.03" + then { + version = "1.2.0"; + sha256 = "0zm1jvqkz3ghznfsm3bbv9q2zinp9grggdf7k9phjazjvny68xb8"; + } else { + version = "0.8.4"; + sha256 = "1adm8sc3lkjly99hyi5gqnxas748k7h62ljgn8x423nkn8gyp8dh"; + }; +in + +stdenv.mkDerivation { + pname = "ocaml${ocaml.version}-mtime"; + inherit (param) version; + + src = fetchurl { + url = "https://erratique.ch/software/mtime/releases/mtime-${param.version}.tbz"; + inherit (param) sha256; + }; + + nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ]; + buildInputs = [ topkg ] ++ optional jsooSupport js_of_ocaml; + + strictDeps = true; + + buildPhase = "${topkg.buildPhase} --with-js_of_ocaml ${boolToString jsooSupport}"; + + inherit (topkg) installPhase; + + meta = { + description = "Monotonic wall-clock time for OCaml"; + homepage = "https://erratique.ch/software/mtime"; + inherit (ocaml.meta) platforms; + maintainers = [ maintainers.vbgl ]; + license = licenses.bsd3; + }; +} diff --git a/pkgs/development/ocaml-modules/mustache/default.nix b/pkgs/development/ocaml-modules/mustache/default.nix new file mode 100644 index 00000000000..b16dfd48481 --- /dev/null +++ b/pkgs/development/ocaml-modules/mustache/default.nix @@ -0,0 +1,26 @@ +{ lib, buildDunePackage, fetchFromGitHub, ezjsonm, menhir, menhirLib, ounit }: + +buildDunePackage rec { + pname = "mustache"; + version = "3.1.0"; + useDune2 = true; + src = fetchFromGitHub { + owner = "rgrinberg"; + repo = "ocaml-mustache"; + rev = "v${version}"; + sha256 = "19v8rk8d8lkfm2rmhdawfgadji6wa267ir5dprh4w9l1sfj8a1py"; + }; + + buildInputs = [ ezjsonm menhir ]; + propagatedBuildInputs = [ menhirLib ]; + + doCheck = true; + checkInputs = [ ounit ]; + + meta = { + description = "Mustache logic-less templates in OCaml"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.vbgl ]; + inherit (src.meta) homepage; + }; +} diff --git a/pkgs/development/ocaml-modules/mysql/default.nix b/pkgs/development/ocaml-modules/mysql/default.nix new file mode 100644 index 00000000000..c980984a26c --- /dev/null +++ b/pkgs/development/ocaml-modules/mysql/default.nix @@ -0,0 +1,46 @@ +{ stdenv, lib, fetchurl, fetchpatch, ocaml, findlib, libmysqlclient }: + +# TODO: la versione stabile da' un errore di compilazione dovuto a +# qualche cambiamento negli header .h +# TODO: compilazione di moduli dipendenti da zip, ssl, tcl, gtk, gtk2 + +let + pname = "ocaml-mysql"; +in + +stdenv.mkDerivation rec { + name = "${pname}-${version}"; + version = "1.2.1"; + + src = fetchurl { + url = "http://ygrek.org.ua/p/release/ocaml-mysql/${name}.tar.gz"; + sha256 = "06mb2bq7v37wn0lza61917zqgb4bsg1xxb73myjyn88p6khl6yl2"; + }; + + configureFlags = [ + "--prefix=$out" + "--libdir=$out/lib/ocaml/${ocaml.version}/site-lib/mysql" + ]; + + nativeBuildInputs = [ ocaml findlib ]; + + createFindlibDestdir = true; + + propagatedBuildInputs = [ libmysqlclient ]; + + strictDeps = true; + + patches = [ + (fetchpatch { + url = "https://github.com/ygrek/ocaml-mysql/compare/v1.2.1...d6d1b3b262ae2cf493ef56f1dd7afcf663a70a26.patch"; + sha256 = "0018s2wcrvbsw9yaqmwq500qmikwffrgdp5xg9b8v7ixhd4gi6hn"; + }) + ]; + + meta = { + homepage = "http://ocaml-mysql.forge.ocamlcore.org"; + description = "Bindings for interacting with MySQL databases from ocaml"; + license = lib.licenses.lgpl21Plus; + maintainers = [ lib.maintainers.roconnor ]; + }; +} diff --git a/pkgs/development/ocaml-modules/netchannel/default.nix b/pkgs/development/ocaml-modules/netchannel/default.nix new file mode 100644 index 00000000000..e7b021d6fbe --- /dev/null +++ b/pkgs/development/ocaml-modules/netchannel/default.nix @@ -0,0 +1,55 @@ +{ lib +, buildDunePackage +, fetchurl +, ppx_sexp_conv +, ppx_cstruct +, lwt +, mirage-net +, io-page +, mirage-xen +, ipaddr +, mirage-profile +, shared-memory-ring +, sexplib +, logs +, rresult +}: + +buildDunePackage rec { + pname = "netchannel"; + version = "2.0.0"; + + useDune2 = true; + + minimumOCamlVersion = "4.08"; + + src = fetchurl { + url = "https://github.com/mirage/mirage-net-xen/releases/download/v${version}/mirage-net-xen-v${version}.tbz"; + sha256 = "ec3906ef1804ef6a9e36b91f4ae73ce4849e9e0d1d36a80fe66b5f905fab93ad"; + }; + + nativeBuildInputs = [ + ppx_cstruct + ]; + + propagatedBuildInputs = [ + ppx_sexp_conv + lwt + mirage-net + io-page + mirage-xen + ipaddr + mirage-profile + shared-memory-ring + sexplib + logs + rresult + ]; + + meta = with lib; { + description = "Network device for reading and writing Ethernet frames via then Xen netfront/netback protocol"; + license = licenses.isc; + maintainers = [ maintainers.sternenseemann ]; + homepage = "https://github.com/mirage/mirage-net-xen"; + }; +} diff --git a/pkgs/development/ocaml-modules/nocrypto/default.nix b/pkgs/development/ocaml-modules/nocrypto/default.nix new file mode 100644 index 00000000000..d179c8c1c90 --- /dev/null +++ b/pkgs/development/ocaml-modules/nocrypto/default.nix @@ -0,0 +1,73 @@ +{ stdenv, lib, fetchurl, fetchpatch, ocaml, findlib, ocamlbuild, topkg +, cpuid, ocb-stubblr, sexplib +, cstruct, zarith, ppx_sexp_conv, ppx_deriving, writeScriptBin +, cstruct-lwt ? null +}: + +with lib; +let + withLwt = cstruct-lwt != null; + # the build system will call 'cc' with no way to override + # this is wrong when we're cross-compiling, so insert a wrapper + cc-wrapper = writeScriptBin "cc" '' + set -e + $CC "$@" + ''; +in + +if !versionAtLeast ocaml.version "4.08" +then throw "nocrypto is not available for OCaml ${ocaml.version}" +else + +stdenv.mkDerivation rec { + pname = "ocaml${ocaml.version}-nocrypto"; + version = "0.5.4"; + + src = fetchurl { + url = "https://github.com/mirleft/ocaml-nocrypto/releases/download/v${version}/nocrypto-${version}.tbz"; + sha256 = "0zshi9hlhcz61n5z1k6fx6rsi0pl4xgahsyl2jp0crqkaf3hqwlg"; + }; + + patches = [ + (fetchpatch { + url = "https://raw.githubusercontent.com/ocaml/opam-repository/master/packages/nocrypto/nocrypto.0.5.4-1/files/0001-add-missing-runtime-dependencies-in-_tags.patch"; + sha256 = "1asybwj3rl07b4q4cxwy80a7j17j0i5vzz77p38hymilhc2ky7xn"; + }) + (fetchpatch { + url = "https://raw.githubusercontent.com/ocaml/opam-repository/master/packages/nocrypto/nocrypto.0.5.4-1/files/0002-add-ppx_sexp_conv-as-a-runtime-dependency-in-the-pac.patch"; + sha256 = "0zmp64n5fgkawpkyw0vv0bg0i2c3xbsxqy17vwy92nf5rbardi1r"; + }) + (fetchpatch { + url = "https://raw.githubusercontent.com/ocaml/opam-repository/master/packages/nocrypto/nocrypto.0.5.4-1/files/0003-Auto-detect-ppx_sexp_conv-runtime-library.patch"; + sha256 = "0lngbg5gyd5gs56lbjh6g86cps1y8x1xsqzi0vi1v28al1gn5dhw"; + }) + (fetchpatch { + url = "https://raw.githubusercontent.com/ocaml/opam-repository/master/packages/nocrypto/nocrypto.0.5.4-1/files/0004-pack-package-workaround-ocamlbuild-272.patch"; + sha256 = "16k0w78plvqhl17qiqq1mckxhhcdysqgs94l54a1bn0l6fx3rvb9"; + }) + (fetchpatch { + url = "https://raw.githubusercontent.com/ocaml/opam-repository/master/packages/nocrypto/nocrypto.0.5.4-1/files/0005-use-modern-cstruct-findlib.patch"; + sha256 = "021k38zbdidw6g7j4vjxlnbsrnzq07bnavxzdjq23nbwlifs2nq9"; + }) + (fetchpatch { + url = "https://raw.githubusercontent.com/ocaml/opam-repository/master/packages/nocrypto/nocrypto.0.5.4-1/files/0006-explicit-dependency-on-sexplib.patch"; + sha256 = "15kd0qgi96yxr3qkmaqny591l0s6qmwpprxd5xdx9qwv72hq813z"; + }) + ]; + + nativeBuildInputs = [ ocaml findlib ocamlbuild cc-wrapper ]; + buildInputs = [ topkg cpuid ocb-stubblr ocamlbuild ]; + propagatedBuildInputs = [ cstruct ppx_deriving ppx_sexp_conv sexplib zarith ] ++ optional withLwt cstruct-lwt; + + strictDeps = true; + + buildPhase = "${topkg.buildPhase} --accelerate false --with-lwt ${boolToString withLwt}"; + inherit (topkg) installPhase; + + meta = { + homepage = "https://github.com/mirleft/ocaml-nocrypto"; + description = "Simplest possible crypto to support TLS"; + license = lib.licenses.bsd2; + maintainers = with lib.maintainers; [ vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/noise/default.nix b/pkgs/development/ocaml-modules/noise/default.nix new file mode 100644 index 00000000000..59ca274c88d --- /dev/null +++ b/pkgs/development/ocaml-modules/noise/default.nix @@ -0,0 +1,60 @@ +{ lib +, buildDunePackage +, fetchurl + +, callipyge +, chacha +, digestif +, hex +, lwt +, lwt_ppx +, nocrypto +, ounit +, ppxlib +, ppx_let +, ppx_deriving +, ppx_deriving_yojson +}: + +buildDunePackage rec { + pname = "noise"; + version = "0.2.0"; + + src = fetchurl { + url = "https://github.com/emillon/ocaml-noise/releases/download/v${version}/${pname}-v${version}.tbz"; + sha256 = "sha256-fe3pT7fsuF2hCvXpInsRg6OvARs/eAh1Un454s1osDs="; + }; + + useDune2 = true; + + minimumOCamlVersion = "4.04"; + + nativeBuildInputs = [ + ppxlib + ppx_deriving + ppx_let + ]; + + propagatedBuildInputs = [ + callipyge + chacha + digestif + hex + nocrypto + ]; + + doCheck = true; + checkInputs = [ + lwt + lwt_ppx + ounit + ppx_deriving_yojson + ]; + + meta = { + homepage = "https://github.com/emillon/ocaml-noise"; + description = "OCaml implementation of the Noise Protocol Framework"; + license = lib.licenses.bsd2; + maintainers = with lib.maintainers; [ fufexan ]; + }; +} diff --git a/pkgs/development/ocaml-modules/nonstd/default.nix b/pkgs/development/ocaml-modules/nonstd/default.nix new file mode 100644 index 00000000000..82b1feed540 --- /dev/null +++ b/pkgs/development/ocaml-modules/nonstd/default.nix @@ -0,0 +1,24 @@ +{ lib, fetchzip, buildDunePackage }: + +buildDunePackage rec { + pname = "nonstd"; + version = "0.0.3"; + + useDune2 = false; + + minimalOCamlVersion = "4.02"; + + src = fetchzip { + url = "https://bitbucket.org/smondet/${pname}/get/${pname}.${version}.tar.gz"; + sha256 = "0ccjwcriwm8fv29ij1cnbc9win054kb6pfga3ygzdbjpjb778j46"; + }; + + doCheck = true; + + meta = with lib; { + homepage = "https://bitbucket.org/smondet/nonstd"; + description = "Non-standard mini-library"; + license = licenses.isc; + maintainers = [ maintainers.alexfmpe ]; + }; +} diff --git a/pkgs/development/ocaml-modules/notty/default.nix b/pkgs/development/ocaml-modules/notty/default.nix new file mode 100644 index 00000000000..1598b2ee5cd --- /dev/null +++ b/pkgs/development/ocaml-modules/notty/default.nix @@ -0,0 +1,41 @@ +{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, topkg, ocb-stubblr +, result, uucp, uuseg, uutf +, lwt ? null }: + +with lib; + +if !versionAtLeast ocaml.version "4.05" +then throw "notty is not available for OCaml ${ocaml.version}" +else + +let withLwt = lwt != null; in + +stdenv.mkDerivation rec { + version = "0.2.2"; + pname = "ocaml${ocaml.version}-notty"; + + src = fetchurl { + url = "https://github.com/pqwy/notty/releases/download/v${version}/notty-${version}.tbz"; + sha256 = "1y3hx8zjri3x50nyiqal5gak1sw54gw3xssrqbj7srinvkdmrz1q"; + }; + + nativeBuildInputs = [ ocaml findlib ocamlbuild ]; + buildInputs = [ ocb-stubblr topkg ocamlbuild ]; + propagatedBuildInputs = [ result uucp uuseg uutf ] ++ + optional withLwt lwt; + + strictDeps = true; + + buildPhase = topkg.buildPhase + + " --with-lwt ${boolToString withLwt}"; + + inherit (topkg) installPhase; + + meta = { + homepage = "https://github.com/pqwy/notty"; + inherit (ocaml.meta) platforms; + description = "Declarative terminal graphics for OCaml"; + license = licenses.isc; + maintainers = with maintainers; [ sternenseemann ]; + }; +} diff --git a/pkgs/development/ocaml-modules/npy/default.nix b/pkgs/development/ocaml-modules/npy/default.nix new file mode 100644 index 00000000000..5ba6cb08cc6 --- /dev/null +++ b/pkgs/development/ocaml-modules/npy/default.nix @@ -0,0 +1,29 @@ +{ lib, buildDunePackage, fetchFromGitHub, numpy, camlzip }: + +buildDunePackage rec { + pname = "npy"; + version = "0.0.9"; + + useDune2 = true; + + minimumOCamlVersion = "4.06"; + + src = fetchFromGitHub { + owner = "LaurentMazare"; + repo = "${pname}-ocaml"; + rev = version; + sha256 = "1fryglkm20h6kdqjl55b7065b34bdg3g3p6j0jv33zvd1m5888m1"; + }; + + propagatedBuildInputs = [ camlzip ]; + checkInputs = [ numpy ]; + + doCheck = true; + + meta = with lib; { + inherit (src.meta) homepage; + description = "OCaml implementation of the Npy format spec"; + maintainers = [ maintainers.bcdarwin ]; + license = licenses.asl20; + }; +} diff --git a/pkgs/development/ocaml-modules/num/default.nix b/pkgs/development/ocaml-modules/num/default.nix new file mode 100644 index 00000000000..1f978a90df4 --- /dev/null +++ b/pkgs/development/ocaml-modules/num/default.nix @@ -0,0 +1,31 @@ +{ stdenv, lib, fetchFromGitHub, fetchpatch, ocaml, findlib, withStatic ? false }: + +stdenv.mkDerivation rec { + version = "1.1"; + pname = "ocaml${ocaml.version}-num"; + src = fetchFromGitHub { + owner = "ocaml"; + repo = "num"; + rev = "v${version}"; + sha256 = "0a4mhxgs5hi81d227aygjx35696314swas0vzy3ig809jb7zq4h0"; + }; + + patches = [ (fetchpatch { + url = "https://github.com/ocaml/num/commit/6d4c6d476c061298e6385e8a0864f083194b9307.patch"; + sha256 = "18zlvb5n327q8y3c52js5dvyy29ssld1l53jqng8m9w1k24ypi0b"; + }) + ] ++ lib.optional withStatic ./enable-static.patch; + + nativeBuildInputs = [ ocaml findlib ]; + + strictDeps = true; + + createFindlibDestdir = true; + + meta = { + description = "Legacy Num library for arbitrary-precision integer and rational arithmetic"; + license = lib.licenses.lgpl21; + inherit (ocaml.meta) platforms; + inherit (src.meta) homepage; + }; +} diff --git a/pkgs/development/ocaml-modules/num/enable-static.patch b/pkgs/development/ocaml-modules/num/enable-static.patch new file mode 100644 index 00000000000..be3ca197f4e --- /dev/null +++ b/pkgs/development/ocaml-modules/num/enable-static.patch @@ -0,0 +1,12 @@ +diff -u a/src/Makefile b/src/Makefile +--- a/src/Makefile ++++ b/src/Makefile +@@ -45,7 +45,7 @@ + endif + + libnums.$(A): $(COBJS) +- $(OCAMLMKLIB) -oc nums $(COBJS) ++ $(OCAMLMKLIB) -custom -oc nums $(COBJS) + + nums.cma: $(CMOS) + $(OCAMLMKLIB) -o nums -oc nums -linkall $(CMOS) diff --git a/pkgs/development/ocaml-modules/ocaml-cairo/META.patch b/pkgs/development/ocaml-modules/ocaml-cairo/META.patch new file mode 100644 index 00000000000..ba6e5927b00 --- /dev/null +++ b/pkgs/development/ocaml-modules/ocaml-cairo/META.patch @@ -0,0 +1,16 @@ +diff -Naur cairo-ocaml-1.2.0.ori/META cairo-ocaml-1.2.0/META +--- cairo-ocaml-1.2.0.ori/META 1970-01-01 01:00:00.000000000 +0100 ++++ cairo-ocaml-1.2.0/META 2013-06-04 03:31:32.000000000 +0200 +@@ -0,0 +1,12 @@ ++name = "cairo-ocaml" ++description = "Bindings to the cairo library." ++version = "@VERSION@" ++archive(byte) = "cairo.cma" ++archive(native) = "cairo.cmxa" ++requires = "bigarray" ++ ++package "lablgtk2" ( ++ requires = "cairo lablgtk2" ++ archive(byte) = "cairo_lablgtk.cma" ++ archive(native) = "cairo_lablgtk.cmxa" ++) diff --git a/pkgs/development/ocaml-modules/ocaml-cairo/default.nix b/pkgs/development/ocaml-modules/ocaml-cairo/default.nix new file mode 100644 index 00000000000..6748619d492 --- /dev/null +++ b/pkgs/development/ocaml-modules/ocaml-cairo/default.nix @@ -0,0 +1,48 @@ +{stdenv, lib, fetchurl, automake, ocaml, autoconf, gnum4, pkg-config, freetype, lablgtk, unzip, cairo, findlib, gdk-pixbuf, gtk2, pango }: + +let + pname = "ocaml-cairo"; +in + +if lib.versionAtLeast ocaml.version "4.06" +then throw "${pname} is not available for OCaml ${ocaml.version}" +else + +stdenv.mkDerivation rec { + name = "${pname}-${version}"; + version = "1.2.0"; + + src = fetchurl { + url = "http://cgit.freedesktop.org/cairo-ocaml/snapshot/cairo-ocaml-${version}.zip"; + sha256 = "0l4p9bp6kclr570mxma8wafibr1g5fsjj8h10yr4b507g0hmlh0l"; + }; + + patches = [ ./META.patch ]; + + nativeBuildInputs = [ pkg-config unzip ocaml automake gnum4 autoconf findlib ]; + buildInputs = [ freetype lablgtk cairo gdk-pixbuf gtk2 pango ]; + + createFindlibDestdir = true; + + preConfigure = '' + aclocal -I support + autoconf + export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE `pkg-config --cflags cairo gdk-pixbuf glib gtk+ pango`" + export LABLGTKDIR=${lablgtk}/lib/ocaml/${ocaml.version}/site-lib/lablgtk2 + cp ${lablgtk}/lib/ocaml/${ocaml.version}/site-lib/lablgtk2/pango.ml ./src + cp ${lablgtk}/lib/ocaml/${ocaml.version}/site-lib/lablgtk2/gaux.ml ./src + ''; + + postInstall = '' + cp META $out/lib/ocaml/${ocaml.version}/site-lib/cairo/ + ''; + + makeFlags = [ "INSTALLDIR=$(out)/lib/ocaml/${ocaml.version}/site-lib/cairo" ]; + + meta = { + homepage = "http://cairographics.org/cairo-ocaml"; + description = "ocaml bindings for cairo library"; + license = lib.licenses.gpl2; + platforms = ocaml.meta.platforms or []; + }; +} diff --git a/pkgs/development/ocaml-modules/ocaml-freestanding/configurable-binding.patch b/pkgs/development/ocaml-modules/ocaml-freestanding/configurable-binding.patch new file mode 100644 index 00000000000..25a7b92f01f --- /dev/null +++ b/pkgs/development/ocaml-modules/ocaml-freestanding/configurable-binding.patch @@ -0,0 +1,49 @@ +commit b273c9f7ab10475787db4d6e09bd4b71b374d0ec +Author: sternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org> +Date: Thu Mar 18 01:28:46 2021 +0100 + + Let user specify solo5-binding to use + + This is a little feature for the configure script I wanted to have for + the NixOS package: It allows the user to set PKG_CONFIG_DEPS before + running configure.sh to disable the autodetection mechanism. This is + useful for NixOS as we have all bindings bundled in the solo5 package, + so the result would also be solo5-bindings-xen. Additionally, it allows + us to do the binding selection declaratively and minimize the risk of + accidentally switching backend. + + PKG_CONFIG_DEPS seems like a bit of an unappropriate variable name for a + user “interface”, let me know if you want a dedicated environment + variable for this in case there will be more PKG_CONFIG_DEPS. + +diff --git a/configure.sh b/configure.sh +index c254f7b..c675a02 100755 +--- a/configure.sh ++++ b/configure.sh +@@ -11,13 +11,19 @@ if pkg_exists solo5-bindings-hvt solo5-bindings-spt solo5-bindings-virtio solo5- + echo "ERROR: Only one of solo5-bindings-hvt, solo5-bindings-spt, solo5-bindings-virtio, solo5-bindings-muen, solo5-bindings-genode, solo5-bindings-xen can be installed." 1>&2 + exit 1 + fi +-PKG_CONFIG_DEPS= +-pkg_exists solo5-bindings-hvt && PKG_CONFIG_DEPS=solo5-bindings-hvt +-pkg_exists solo5-bindings-spt && PKG_CONFIG_DEPS=solo5-bindings-spt +-pkg_exists solo5-bindings-muen && PKG_CONFIG_DEPS=solo5-bindings-muen +-pkg_exists solo5-bindings-virtio && PKG_CONFIG_DEPS=solo5-bindings-virtio +-pkg_exists solo5-bindings-genode && PKG_CONFIG_DEPS=solo5-bindings-genode +-pkg_exists solo5-bindings-xen && PKG_CONFIG_DEPS=solo5-bindings-xen ++if [ -z "${PKG_CONFIG_DEPS}" ]; then ++ PKG_CONFIG_DEPS= ++ pkg_exists solo5-bindings-hvt && PKG_CONFIG_DEPS=solo5-bindings-hvt ++ pkg_exists solo5-bindings-spt && PKG_CONFIG_DEPS=solo5-bindings-spt ++ pkg_exists solo5-bindings-muen && PKG_CONFIG_DEPS=solo5-bindings-muen ++ pkg_exists solo5-bindings-virtio && PKG_CONFIG_DEPS=solo5-bindings-virtio ++ pkg_exists solo5-bindings-genode && PKG_CONFIG_DEPS=solo5-bindings-genode ++ pkg_exists solo5-bindings-xen && PKG_CONFIG_DEPS=solo5-bindings-xen ++else ++ pkg_exists "${PKG_CONFIG_DEPS}" \ ++ || (echo "ERROR: ${PKG_CONFIG_DEPS} is not installed" 1>&2; exit 1) \ ++ || exit 1 ++fi + if [ -z "${PKG_CONFIG_DEPS}" ]; then + echo "ERROR: No supported Solo5 bindings package found." 1>&2 + echo "ERROR: solo5-bindings-hvt, solo5-bindings-spt, solo5-bindings-virtio, solo5-bindings-muen, solo5-bindings-genode or solo5-bindings-xen must be installed." 1>&2 diff --git a/pkgs/development/ocaml-modules/ocaml-freestanding/default.nix b/pkgs/development/ocaml-modules/ocaml-freestanding/default.nix new file mode 100644 index 00000000000..942d69e5919 --- /dev/null +++ b/pkgs/development/ocaml-modules/ocaml-freestanding/default.nix @@ -0,0 +1,78 @@ +{ lib +, stdenv +, fetchFromGitHub +, ocaml +, pkg-config +, solo5 +, target ? "xen" +}: + +# note: this is not technically an ocaml-module, +# but can be built with different compilers, so +# the ocamlPackages set is very useful. + +let + pname = "ocaml-freestanding"; +in + +if lib.versionOlder ocaml.version "4.08" +then builtins.throw "${pname} is not available for OCaml ${ocaml.version}" +else + +stdenv.mkDerivation rec { + name = "ocaml${ocaml.version}-${pname}-${version}"; + inherit pname; + version = "0.6.5"; + + src = fetchFromGitHub { + owner = "mirage"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256:1mbyjzwcs64n7i3xkkyaxgl3r46drbl0gkqf3fqgm2kh3q03638l"; + }; + + postUnpack = '' + # get ocaml-src from the ocaml drv instead of via ocamlfind + mkdir -p "${src.name}/ocaml" + tar --strip-components=1 -xf ${ocaml.src} -C "${src.name}/ocaml" + ''; + + patches = [ + ./no-opam.patch + ./configurable-binding.patch + ]; + + nativeBuildInputs = [ + ocaml + pkg-config + ]; + + propagatedBuildInputs = [ solo5 ]; + + configurePhase = '' + runHook preConfigure + env PKG_CONFIG_DEPS=solo5-bindings-${target} sh configure.sh + runHook postConfigure + ''; + + installPhase = '' + runHook preInstall + ./install.sh "$out" + runHook postInstall + ''; + + meta = with lib; { + description = "Freestanding OCaml runtime"; + license = licenses.mit; + maintainers = [ maintainers.sternenseemann ]; + homepage = "https://github.com/mirage/ocaml-freestanding"; + platforms = builtins.map ({ arch, os }: "${arch}-${os}") + (cartesianProductOfSets { + arch = [ "aarch64" "x86_64" ]; + os = [ "linux" ]; + } ++ [ + { arch = "x86_64"; os = "freebsd"; } + { arch = "x86_64"; os = "openbsd"; } + ]); + }; +} diff --git a/pkgs/development/ocaml-modules/ocaml-freestanding/no-opam.patch b/pkgs/development/ocaml-modules/ocaml-freestanding/no-opam.patch new file mode 100644 index 00000000000..45f271ec0f2 --- /dev/null +++ b/pkgs/development/ocaml-modules/ocaml-freestanding/no-opam.patch @@ -0,0 +1,47 @@ +commit 637b7ce639d54e617170433aa9596176b167d085 +Author: sternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org> +Date: Thu Mar 18 01:07:49 2021 +0100 + + Allow building without ocamlfind and opam + + This change is the result of my first go at packaging ocaml-freestanding + for NixOS. Our build infrastructure for ocaml there is completely + independent of opam at the moment, so depending on opam for the build + time is not an option, especially in this case where the information it + would give us would be garbage. + + Fortunately the build environment plays nicely with pkg-config which is + already heavily used by ocaml-freestanding. This patch leaves pkg-config + to its own devices if opam is not present (it can be assisted by a + manually set PKG_CONFIG_PATH environment variable). + + Additionally, in configure.sh we check if the target ocaml source + directory already exists. This allows for building ocaml-freestanding + without the ocaml-src package (which would be unnecessarily cumbersome + to package for NixOS) and ocamlfind (one less dependency is always a + nice bonus). The Makefile needs no fix since the target ocaml/Makefile + won't be built if it's already present. + +diff --git a/configure.sh b/configure.sh +index 4d154ed..c254f7b 100755 +--- a/configure.sh ++++ b/configure.sh +@@ -1,6 +1,8 @@ + #!/bin/sh + +-export PKG_CONFIG_PATH=$(opam config var prefix)/lib/pkgconfig ++if command -v opam &> /dev/null; then ++ export PKG_CONFIG_PATH=$(opam config var prefix)/lib/pkgconfig ++fi + pkg_exists() { + pkg-config --exists "$@" + } +@@ -21,7 +23,7 @@ if [ -z "${PKG_CONFIG_DEPS}" ]; then + echo "ERROR: solo5-bindings-hvt, solo5-bindings-spt, solo5-bindings-virtio, solo5-bindings-muen, solo5-bindings-genode or solo5-bindings-xen must be installed." 1>&2 + exit 1 + fi +-ocamlfind query ocaml-src >/dev/null || exit 1 ++[ -e "$(dirname "$0")/ocaml" ] || ocamlfind query ocaml-src >/dev/null || exit 1 + + FREESTANDING_CFLAGS="$(pkg-config --cflags ${PKG_CONFIG_DEPS})" + BUILD_ARCH="$(uname -m)" diff --git a/pkgs/development/ocaml-modules/ocaml-gettext/camomile.nix b/pkgs/development/ocaml-modules/ocaml-gettext/camomile.nix new file mode 100644 index 00000000000..012f3b61ff3 --- /dev/null +++ b/pkgs/development/ocaml-modules/ocaml-gettext/camomile.nix @@ -0,0 +1,16 @@ +{ buildDunePackage, ocaml_gettext, camomile, ounit, fileutils }: + +buildDunePackage { + pname = "gettext-camomile"; + inherit (ocaml_gettext) src version useDune2; + + propagatedBuildInputs = [ camomile ocaml_gettext ]; + + doCheck = true; + checkInputs = [ ounit fileutils ]; + + meta = ocaml_gettext.meta // { + description = "Internationalization library using camomile (i18n)"; + }; + +} diff --git a/pkgs/development/ocaml-modules/ocaml-gettext/default.nix b/pkgs/development/ocaml-modules/ocaml-gettext/default.nix new file mode 100644 index 00000000000..7525a10030e --- /dev/null +++ b/pkgs/development/ocaml-modules/ocaml-gettext/default.nix @@ -0,0 +1,32 @@ +{ lib, fetchurl, buildDunePackage, cppo, gettext, fileutils, ounit }: + +buildDunePackage rec { + pname = "gettext"; + version = "0.4.2"; + + minimumOCamlVersion = "4.03"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/gildor478/ocaml-gettext/releases/download/v${version}/gettext-v${version}.tbz"; + sha256 = "19ynsldb21r539fiwz1f43apsdnx7hj2a2d9qr9wg2hva9y2qrwb"; + }; + + buildInputs = [ cppo ]; + + propagatedBuildInputs = [ gettext fileutils ]; + + doCheck = true; + + checkInputs = [ ounit ]; + + dontStrip = true; + + meta = with lib; { + description = "OCaml Bindings to gettext"; + homepage = "https://github.com/gildor478/ocaml-gettext"; + license = licenses.lgpl21; + maintainers = [ maintainers.volth ]; + }; +} diff --git a/pkgs/development/ocaml-modules/ocaml-gettext/stub.nix b/pkgs/development/ocaml-modules/ocaml-gettext/stub.nix new file mode 100644 index 00000000000..51e902b9140 --- /dev/null +++ b/pkgs/development/ocaml-modules/ocaml-gettext/stub.nix @@ -0,0 +1,16 @@ +{ buildDunePackage, ocaml_gettext, dune-configurator, ounit }: + +buildDunePackage rec { + + pname = "gettext-stub"; + + inherit (ocaml_gettext) src version useDune2 meta; + + buildInputs = [ dune-configurator ]; + + propagatedBuildInputs = [ ocaml_gettext ]; + + doCheck = true; + + checkInputs = [ ounit ]; +} diff --git a/pkgs/development/ocaml-modules/ocaml-libvirt/default.nix b/pkgs/development/ocaml-modules/ocaml-libvirt/default.nix new file mode 100644 index 00000000000..b4410981afb --- /dev/null +++ b/pkgs/development/ocaml-modules/ocaml-libvirt/default.nix @@ -0,0 +1,34 @@ +{ lib, stdenv, fetchFromGitLab, libvirt, autoreconfHook, pkg-config, ocaml, findlib, perl }: + +stdenv.mkDerivation rec { + pname = "ocaml-libvirt"; + version = "0.6.1.5"; + + src = fetchFromGitLab { + owner = "libvirt"; + repo = "libvirt-ocaml"; + rev = "v${version}"; + sha256 = "0xpkdmknk74yqxgw8z2w8b7ss8hpx92xnab5fsqg2byyj55gzf2k"; + }; + + propagatedBuildInputs = [ libvirt ]; + + nativeBuildInputs = [ autoreconfHook pkg-config findlib perl ocaml ]; + + strictDeps = true; + + buildFlags = [ "all" "opt" "CPPFLAGS=-Wno-error" ]; + installTargets = "install-opt"; + preInstall = '' + # Fix 'dllmllibvirt.so' install failure into non-existent directory. + mkdir -p $OCAMLFIND_DESTDIR/stublibs + ''; + + meta = with lib; { + description = "OCaml bindings for libvirt"; + homepage = "https://libvirt.org/ocaml/"; + license = licenses.gpl2; + maintainers = [ maintainers.volth ]; + platforms = ocaml.meta.platforms or []; + }; +} diff --git a/pkgs/development/ocaml-modules/ocaml-lsp/default.nix b/pkgs/development/ocaml-modules/ocaml-lsp/default.nix new file mode 100644 index 00000000000..602f5eb77fe --- /dev/null +++ b/pkgs/development/ocaml-modules/ocaml-lsp/default.nix @@ -0,0 +1,22 @@ +{ lib, buildDunePackage, jsonrpc, lsp, re, makeWrapper, dot-merlin-reader, spawn }: + +buildDunePackage { + pname = "ocaml-lsp-server"; + inherit (jsonrpc) version src; + useDune2 = true; + + inherit (lsp) preBuild; + + buildInputs = lsp.buildInputs ++ [ lsp re ] + ++ lib.optional (lib.versionAtLeast jsonrpc.version "1.9") spawn; + + nativeBuildInputs = [ makeWrapper ]; + + postInstall = '' + wrapProgram $out/bin/ocamllsp --prefix PATH : ${dot-merlin-reader}/bin + ''; + + meta = jsonrpc.meta // { + description = "OCaml Language Server Protocol implementation"; + }; +} diff --git a/pkgs/development/ocaml-modules/ocaml-lsp/jsonrpc.nix b/pkgs/development/ocaml-modules/ocaml-lsp/jsonrpc.nix new file mode 100644 index 00000000000..4f192fe20ec --- /dev/null +++ b/pkgs/development/ocaml-modules/ocaml-lsp/jsonrpc.nix @@ -0,0 +1,56 @@ +{ buildDunePackage +, stdlib-shims +, ppx_yojson_conv_lib +, ocaml-syntax-shims +, yojson +, result +, fetchurl +, lib +, ocaml +}: + +let params = + if lib.versionAtLeast ocaml.version "4.13" + then { + version = "1.10.3"; + sha256 = "sha256-o6wQc7Byi5T0vbARF3LAq69/9wMkOZRQ6rcVa/rBUfE="; + } else if lib.versionAtLeast ocaml.version "4.12" + then { + version = "1.9.0"; + sha256 = "sha256:1ac44n6g3rf84gvhcca545avgf9vpkwkkkm0s8ipshfhp4g4jikh"; + } else { + version = "1.4.1"; + sha256 = "1ssyazc0yrdng98cypwa9m3nzfisdzpp7hqnx684rqj8f0g3gs6f"; + } +; in + +buildDunePackage rec { + pname = "jsonrpc"; + inherit (params) version; + src = fetchurl { + url = "https://github.com/ocaml/ocaml-lsp/releases/download/${version}/jsonrpc-${version}.tbz"; + inherit (params) sha256; + }; + + useDune2 = true; + minimalOCamlVersion = "4.06"; + + buildInputs = + if lib.versionAtLeast version "1.7.0" then + [ ] + else + [ yojson stdlib-shims ocaml-syntax-shims ]; + + propagatedBuildInputs = + if lib.versionAtLeast version "1.7.0" then + [ ] + else + [ ppx_yojson_conv_lib result ]; + + meta = with lib; { + description = "Jsonrpc protocol implementation in OCaml"; + license = licenses.isc; + platforms = platforms.unix; + maintainers = with maintainers; [ symphorien marsam ]; + }; +} diff --git a/pkgs/development/ocaml-modules/ocaml-lsp/lsp.nix b/pkgs/development/ocaml-modules/ocaml-lsp/lsp.nix new file mode 100644 index 00000000000..cd01116b820 --- /dev/null +++ b/pkgs/development/ocaml-modules/ocaml-lsp/lsp.nix @@ -0,0 +1,59 @@ +{ buildDunePackage +, lib +, cppo +, stdlib-shims +, ppx_yojson_conv_lib +, ocaml-syntax-shims +, jsonrpc +, omd +, octavius +, dune-build-info +, uutf +, re +, pp +, csexp +, cmdliner +, ocamlformat-rpc-lib +}: + +buildDunePackage rec { + pname = "lsp"; + inherit (jsonrpc) version src; + useDune2 = true; + minimumOCamlVersion = + if lib.versionAtLeast version "1.7.0" then + "4.12" + else + "4.06"; + + # unvendor some (not all) dependencies. + # They are vendored by upstream only because it is then easier to install + # ocaml-lsp without messing with your opam switch, but nix should prevent + # this type of problems without resorting to vendoring. + preBuild = '' + rm -r ocaml-lsp-server/vendor/{octavius,uutf,omd,cmdliner} + ''; + + buildInputs = + if lib.versionAtLeast version "1.7.0" then + [ pp re ppx_yojson_conv_lib octavius dune-build-info omd cmdliner ocamlformat-rpc-lib ] + else + [ cppo + ppx_yojson_conv_lib + ocaml-syntax-shims + octavius + dune-build-info + omd + cmdliner + ]; + + propagatedBuildInputs = [ + csexp + jsonrpc + uutf + ] ++ lib.optional (lib.versionOlder version "1.7.0") stdlib-shims; + + meta = jsonrpc.meta // { + description = "LSP protocol implementation in OCaml"; + }; +} diff --git a/pkgs/development/ocaml-modules/ocaml-migrate-parsetree/1.8.x.nix b/pkgs/development/ocaml-modules/ocaml-migrate-parsetree/1.8.x.nix new file mode 100644 index 00000000000..009d95992fb --- /dev/null +++ b/pkgs/development/ocaml-modules/ocaml-migrate-parsetree/1.8.x.nix @@ -0,0 +1,28 @@ +{ lib, fetchFromGitHub, buildDunePackage, ocaml, result, ppx_derivers }: + +if lib.versionOlder "4.13" ocaml.version +then throw "ocaml-migrate-parsetree-1.8 is not available for OCaml ${ocaml.version}" +else + +buildDunePackage rec { + pname = "ocaml-migrate-parsetree"; + version = "1.8.0"; + + useDune2 = lib.versionAtLeast ocaml.version "4.08"; + + src = fetchFromGitHub { + owner = "ocaml-ppx"; + repo = pname; + rev = "v${version}"; + sha256 = "16x8sxc4ygxrr1868qpzfqyrvjf3hfxvjzmxmf6ibgglq7ixa2nq"; + }; + + propagatedBuildInputs = [ ppx_derivers result ]; + + meta = { + description = "Convert OCaml parsetrees between different major versions"; + license = lib.licenses.lgpl21; + maintainers = [ lib.maintainers.vbgl ]; + inherit (src.meta) homepage; + }; +} diff --git a/pkgs/development/ocaml-modules/ocaml-migrate-parsetree/2.x.nix b/pkgs/development/ocaml-modules/ocaml-migrate-parsetree/2.x.nix new file mode 100644 index 00000000000..9f4979d7563 --- /dev/null +++ b/pkgs/development/ocaml-modules/ocaml-migrate-parsetree/2.x.nix @@ -0,0 +1,22 @@ +{ lib, fetchurl, buildDunePackage }: + +buildDunePackage rec { + pname = "ocaml-migrate-parsetree"; + version = "2.3.0"; + + useDune2 = true; + + minimalOCamlVersion = "4.02"; + + src = fetchurl { + url = "https://github.com/ocaml-ppx/${pname}/releases/download/v${version}/${pname}-${version}.tbz"; + sha256 = "sha256:02mzh1rcvc2xpq4iz01z7kvzsgxns3774ggxi96f147i8yr2d08h"; + }; + + meta = { + description = "Convert OCaml parsetrees between different major versions"; + license = lib.licenses.lgpl21; + maintainers = with lib.maintainers; [ vbgl sternenseemann ]; + homepage = "https://github.com/ocaml-ppx/ocaml-migrate-parsetree"; + }; +} diff --git a/pkgs/development/ocaml-modules/ocaml-monadic/default.nix b/pkgs/development/ocaml-modules/ocaml-monadic/default.nix new file mode 100644 index 00000000000..9a6dd1f7cb6 --- /dev/null +++ b/pkgs/development/ocaml-modules/ocaml-monadic/default.nix @@ -0,0 +1,26 @@ +{ lib, fetchFromGitHub, buildDunePackage +, ppxlib +}: + +buildDunePackage rec { + pname = "ocaml-monadic"; + version = "0.5.0"; + + useDune2 = true; + + src = fetchFromGitHub { + owner = "zepalmer"; + repo = pname; + rev = version; + sha256 = "1ynv3yhdqmkhkgnz6c5kv6ryjcc934sdvw9rhh8rjg2dlzlffgbw"; + }; + + buildInputs = [ ppxlib ]; + + meta = { + inherit (src.meta) homepage; + description = "A PPX extension to provide an OCaml-friendly monadic syntax"; + license = lib.licenses.bsd3; + maintainers = [ lib.maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/ocaml-print-intf/default.nix b/pkgs/development/ocaml-modules/ocaml-print-intf/default.nix new file mode 100644 index 00000000000..5180b58601a --- /dev/null +++ b/pkgs/development/ocaml-modules/ocaml-print-intf/default.nix @@ -0,0 +1,31 @@ +{ lib +, fetchFromGitHub +, buildDunePackage +, dune-build-info +, bos +}: +let + author = "avsm"; + pname = "ocaml-print-intf"; + version = "1.2.0"; +in +buildDunePackage rec { + inherit pname version; + useDune2 = true; + + src = fetchFromGitHub { + owner = author; + repo = pname; + rev = "v${version}"; + sha256 = "0hw4gl7irarcywibdjqxmrga8f7yj52wgy7sc7n0wyy74jzxb8np"; + }; + + buildInputs = [ dune-build-info bos ]; + + meta = with lib; { + description = "Pretty print an OCaml cmi/cmt/cmti file in human-readable OCaml signature form "; + homepage = "https://github.com/${author}/${pname}"; + license = lib.licenses.isc; + maintainers = [ lib.maintainers.nerdypepper ]; + }; +} diff --git a/pkgs/development/ocaml-modules/ocaml-protoc/default.nix b/pkgs/development/ocaml-modules/ocaml-protoc/default.nix new file mode 100644 index 00000000000..5abb026032b --- /dev/null +++ b/pkgs/development/ocaml-modules/ocaml-protoc/default.nix @@ -0,0 +1,30 @@ +{ lib, fetchFromGitHub, buildDunePackage +, stdlib-shims +}: + +buildDunePackage rec { + pname = "ocaml-protoc"; + version = "2.0.2"; + + useDune2 = true; + + minimumOCamlVersion = "4.02"; + + src = fetchFromGitHub { + owner = "mransan"; + repo = "ocaml-protoc"; + rev = version; + sha256 = "1vlnjqqpypmjhlyrxfzla79y4ilmc9ggz311giy6vmh4cyzl29h3"; + }; + + buildInputs = [ stdlib-shims ]; + + doCheck = true; + + meta = with lib; { + homepage = "https://github.com/mransan/ocaml-protoc"; + description = "A Protobuf Compiler for OCaml"; + license = licenses.mit; + maintainers = [ maintainers.vyorkin ]; + }; +} diff --git a/pkgs/development/ocaml-modules/ocaml-r/default.nix b/pkgs/development/ocaml-modules/ocaml-r/default.nix new file mode 100644 index 00000000000..fcee63de3b5 --- /dev/null +++ b/pkgs/development/ocaml-modules/ocaml-r/default.nix @@ -0,0 +1,46 @@ +{ lib, fetchFromGitHub, buildDunePackage, pkg-config, dune-configurator, stdio, R +, alcotest +}: + +buildDunePackage rec { + pname = "ocaml-r"; + version = "0.4.0"; + + useDune2 = true; + + minimumOCamlVersion = "4.08"; + + src = fetchFromGitHub { + owner = "pveber"; + repo = pname; + rev = "v${version}"; + sha256 = "10is2s148kfh3g0pwniyzp5mh48k57ldvn8gm86469zvgxyij1ri"; + }; + + # Without the following patch, stub generation fails with: + # > Fatal error: exception (Failure "not supported: osVersion") + preConfigure = '' + substituteInPlace stubgen/stubgen.ml --replace \ + 'failwithf "not supported: %s" name ()' \ + 'sprintf "(* not supported: %s *)" name' + substituteInPlace lib/config/discover.ml --replace \ + ' libRmath"' '"' + ''; + + # This currently fails with dune + strictDeps = false; + + nativeBuildInputs = [ pkg-config R ]; + buildInputs = [ dune-configurator stdio R ]; + + doCheck = true; + checkInputs = [ alcotest ]; + + meta = { + description = "OCaml bindings for the R interpreter"; + inherit (src.meta) homepage; + license = lib.licenses.gpl3; + maintainers = [ lib.maintainers.bcdarwin ]; + }; + +} diff --git a/pkgs/development/ocaml-modules/ocaml-result/default.nix b/pkgs/development/ocaml-modules/ocaml-result/default.nix new file mode 100644 index 00000000000..2fda6f1440b --- /dev/null +++ b/pkgs/development/ocaml-modules/ocaml-result/default.nix @@ -0,0 +1,24 @@ +{ lib, buildDunePackage, fetchurl, ocaml }: + +buildDunePackage rec { + pname = "result"; + version = "1.5"; + + useDune2 = lib.versionAtLeast ocaml.version "4.08"; + + src = fetchurl { + url = "https://github.com/janestreet/result/releases/download/${version}/result-${version}.tbz"; + sha256 = "0cpfp35fdwnv3p30a06wd0py3805qxmq3jmcynjc3x2qhlimwfkw"; + }; + + meta = { + homepage = "https://github.com/janestreet/result"; + description = "Compatibility Result module"; + longDescription = '' + Projects that want to use the new result type defined in OCaml >= 4.03 + while staying compatible with older version of OCaml should use the + Result module defined in this library. + ''; + license = lib.licenses.bsd3; + }; +} diff --git a/pkgs/development/ocaml-modules/ocaml-sat-solvers/default.nix b/pkgs/development/ocaml-modules/ocaml-sat-solvers/default.nix new file mode 100644 index 00000000000..c7779b098e7 --- /dev/null +++ b/pkgs/development/ocaml-modules/ocaml-sat-solvers/default.nix @@ -0,0 +1,24 @@ +{ lib, fetchFromGitHub, buildOasisPackage, minisat }: + +buildOasisPackage rec { + pname = "ocaml-sat-solvers"; + version = "0.4"; + + minimumOCamlVersion = "4.03.0"; + + src = fetchFromGitHub { + owner = "tcsprojects"; + repo = "ocaml-sat-solvers"; + rev = "v${version}"; + sha256 = "1hxr16cyl1p1k1cik848mqrysq95wxmlykpm93a99pn55mp28938"; + }; + + propagatedBuildInputs = [ minisat ]; + + meta = { + homepage = "https://github.com/tcsprojects/ocaml-sat-solvers"; + description = "SAT Solvers For OCaml"; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ mgttlinger ]; + }; +} diff --git a/pkgs/development/ocaml-modules/ocaml-syntax-shims/default.nix b/pkgs/development/ocaml-modules/ocaml-syntax-shims/default.nix new file mode 100644 index 00000000000..374efd8b2b9 --- /dev/null +++ b/pkgs/development/ocaml-modules/ocaml-syntax-shims/default.nix @@ -0,0 +1,24 @@ +{ lib, buildDunePackage, fetchurl }: + +buildDunePackage rec { + minimumOCamlVersion = "4.02.3"; + + pname = "ocaml-syntax-shims"; + version = "1.0.0"; + + src = fetchurl { + url = "https://github.com/ocaml-ppx/${pname}/releases/download/${version}/${pname}-${version}.tbz"; + sha256 = "1j7848khli4p7j8i2kmnvhdnhcwhy3zgdpf5ds5ic30ax69y3cl9"; + }; + + useDune2 = true; + + doCheck = true; + + meta = with lib; { + homepage = "https://github.com/ocaml-ppx/ocaml-syntax-shims"; + description = "Backport new syntax to older OCaml versions"; + license = licenses.mit; + maintainers = with maintainers; [ sternenseemann ]; + }; +} diff --git a/pkgs/development/ocaml-modules/ocaml-version/default.nix b/pkgs/development/ocaml-modules/ocaml-version/default.nix new file mode 100644 index 00000000000..aeb9c9dc699 --- /dev/null +++ b/pkgs/development/ocaml-modules/ocaml-version/default.nix @@ -0,0 +1,21 @@ +{ lib, fetchurl, buildDunePackage }: + +buildDunePackage rec { + pname = "ocaml-version"; + version = "3.4.0"; + + src = fetchurl { + url = "https://github.com/ocurrent/ocaml-version/releases/download/v${version}/ocaml-version-v${version}.tbz"; + sha256 = "sha256-2MG+tejY67dxC19DTOZqPsi3UrHk1rqHxP4nRSvbiiU="; + }; + + minimumOCamlVersion = "4.07"; + useDune2 = true; + + meta = with lib; { + description = "Manipulate, parse and generate OCaml compiler version strings"; + homepage = "https://github.com/ocurrent/ocaml-version"; + license = licenses.isc; + maintainers = with maintainers; [ vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/ocamlformat-rpc-lib/default.nix b/pkgs/development/ocaml-modules/ocamlformat-rpc-lib/default.nix new file mode 100644 index 00000000000..9a1d26f21f0 --- /dev/null +++ b/pkgs/development/ocaml-modules/ocamlformat-rpc-lib/default.nix @@ -0,0 +1,23 @@ +{ lib, fetchurl, buildDunePackage, csexp, sexplib0 }: + +buildDunePackage rec { + pname = "ocamlformat-rpc-lib"; + version = "0.19.0"; + + src = fetchurl { + url = "https://github.com/ocaml-ppx/ocamlformat/releases/download/${version}/ocamlformat-${version}.tbz"; + sha256 = "sha256-YvxGqujwpKM85/jXcm1xCb/2Fepvy1DRSC8h0g7lD0Y="; + }; + + minimumOCamlVersion = "4.08"; + useDune2 = true; + + propagatedBuildInputs = [ csexp sexplib0 ]; + + meta = with lib; { + homepage = "https://github.com/ocaml-ppx/ocamlformat"; + description = "Auto-formatter for OCaml code (RPC mode)"; + license = licenses.mit; + maintainers = with maintainers; [ Zimmi48 marsam ]; + }; +} diff --git a/pkgs/development/ocaml-modules/ocamlfuse/default.nix b/pkgs/development/ocaml-modules/ocamlfuse/default.nix new file mode 100644 index 00000000000..13ac62f6451 --- /dev/null +++ b/pkgs/development/ocaml-modules/ocamlfuse/default.nix @@ -0,0 +1,28 @@ +{ lib, buildDunePackage, fetchFromGitHub, camlidl, fuse, dune-configurator }: + +buildDunePackage rec { + pname = "ocamlfuse"; + version = "2.7.1_cvs7"; + + src = fetchFromGitHub { + owner = "astrada"; + repo = "ocamlfuse"; + rev = "v${version}"; + sha256 = "6nmPXZx38hBGlg+gV9nnlRpPfeSAqDj4zBPcjUNvTRo="; + }; + + # This currently fails with dune + strictDeps = false; + + nativeBuildInputs = [ camlidl ]; + buildInputs = [ dune-configurator ]; + propagatedBuildInputs = [ camlidl fuse ]; + + meta = { + homepage = "https://sourceforge.net/projects/ocamlfuse"; + description = "OCaml bindings for FUSE"; + license = lib.licenses.gpl2; + platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [ bennofs ]; + }; +} diff --git a/pkgs/development/ocaml-modules/ocamlgraph/default.nix b/pkgs/development/ocaml-modules/ocamlgraph/default.nix new file mode 100644 index 00000000000..4c71246cf9c --- /dev/null +++ b/pkgs/development/ocaml-modules/ocamlgraph/default.nix @@ -0,0 +1,26 @@ +{ lib, fetchurl, buildDunePackage, stdlib-shims }: + +buildDunePackage rec { + pname = "ocamlgraph"; + version = "2.0.0"; + + src = fetchurl { + url = "https://github.com/backtracking/ocamlgraph/releases/download/${version}/ocamlgraph-${version}.tbz"; + sha256 = "029692bvdz3hxpva9a2jg5w5381fkcw55ysdi8424lyyjxvjdzi0"; + }; + + minimalOCamlVersion = "4.03"; + useDune2 = true; + + propagatedBuildInputs = [ + stdlib-shims + ]; + + meta = with lib; { + homepage = "http://ocamlgraph.lri.fr/"; + downloadPage = "https://github.com/backtracking/ocamlgraph"; + description = "Graph library for OCaml"; + license = licenses.gpl2Oss; + maintainers = with maintainers; [ kkallio ]; + }; +} diff --git a/pkgs/development/ocaml-modules/ocamlgraph/gtk.nix b/pkgs/development/ocaml-modules/ocamlgraph/gtk.nix new file mode 100644 index 00000000000..1aa438ffa44 --- /dev/null +++ b/pkgs/development/ocaml-modules/ocamlgraph/gtk.nix @@ -0,0 +1,12 @@ +{ buildDunePackage, lablgtk, ocamlgraph, stdlib-shims, ... }: + +buildDunePackage rec { + pname = "ocamlgraph_gtk"; + inherit (ocamlgraph) version src useDune2 meta; + + propagatedBuildInputs = [ + lablgtk + ocamlgraph + stdlib-shims + ]; +} diff --git a/pkgs/development/ocaml-modules/ocamlmake/default.nix b/pkgs/development/ocaml-modules/ocamlmake/default.nix new file mode 100644 index 00000000000..a2071a9dfaa --- /dev/null +++ b/pkgs/development/ocaml-modules/ocamlmake/default.nix @@ -0,0 +1,30 @@ +{stdenv, lib, fetchurl}: + +let + + version = "6.37.0"; + sha256 = "99ff58080ed154cc4bd70f915fe4760dffb026a1c0447caa0b3bdb982b24b0a8"; + +in stdenv.mkDerivation { + pname = "ocaml-make"; + inherit version; + + src = fetchurl { + url = "https://bitbucket.org/mmottl/ocaml-makefile/downloads/ocaml-makefile-${version}.tar.gz"; + inherit sha256; + }; + + installPhase = '' + mkdir -p "$out/include/" + cp OCamlMakefile "$out/include/" + ''; + + setupHook = ./setup-hook.sh; + + meta = { + homepage = "http://www.ocaml.info/home/ocaml_sources.html"; + description = "Generic OCaml Makefile for GNU Make"; + license = "LGPL"; + platforms = lib.platforms.unix; + }; +} diff --git a/pkgs/development/ocaml-modules/ocamlmake/setup-hook.sh b/pkgs/development/ocaml-modules/ocamlmake/setup-hook.sh new file mode 100644 index 00000000000..6d950437016 --- /dev/null +++ b/pkgs/development/ocaml-modules/ocamlmake/setup-hook.sh @@ -0,0 +1,5 @@ +addOcamlMakefile () { + export OCAMLMAKEFILE="@out@/include/OCamlMakefile" +} + +addEnvHooks "$targetOffset" addOcamlMakefile diff --git a/pkgs/development/ocaml-modules/ocamlnat/default.nix b/pkgs/development/ocaml-modules/ocamlnat/default.nix new file mode 100644 index 00000000000..66bd00707ad --- /dev/null +++ b/pkgs/development/ocaml-modules/ocamlnat/default.nix @@ -0,0 +1,47 @@ +{stdenv, lib, fetchurl, ocaml, findlib, ounit}: + +# https://github.com/bmeurer/ocamlnat/issues/3 +assert lib.versionOlder ocaml.version "4"; + +stdenv.mkDerivation rec { + pname = "ocamlnat"; + version = "0.1.1"; + + src = fetchurl { + url = "http://benediktmeurer.de/files/source/${pname}-${version}.tar.bz2"; + sha256 = "0dyvy0j6f47laxhnadvm71z1py9hz9zd49hamf6bij99cggb2ij1"; + }; + + nativeBuildInputs = [ocaml findlib ]; + buildInputs = [ ounit]; + + strictDeps = true; + + prefixKey = "--prefix "; + + doCheck = true; + + checkTarget = "test"; + + createFindlibDestdir = true; + + meta = { + description = "OCaml native toplevel"; + homepage = "http://benediktmeurer.de/ocamlnat/"; + license = lib.licenses.qpl; + longDescription = '' + The ocamlnat project provides a new native code OCaml toplevel + ocamlnat, which is mostly compatible to the byte code toplevel ocaml, + but up to 100 times faster. It is based on the optimizing native code + compiler, the native runtime and an earlier prototype by Alain + Frisch. It is build upon Just-In-Time techniques and currently + supports Unix-like systems (i.e. Linux, BSD or macOS) running on + x86 or x86-64 processors. Support for additional architectures and + operating systems is planned, but not yet available. + ''; + platforms = ocaml.meta.platforms or []; + maintainers = [ + lib.maintainers.maggesi + ]; + }; +} diff --git a/pkgs/development/ocaml-modules/ocamlnet/default.nix b/pkgs/development/ocaml-modules/ocamlnet/default.nix new file mode 100644 index 00000000000..d435d7a0484 --- /dev/null +++ b/pkgs/development/ocaml-modules/ocamlnet/default.nix @@ -0,0 +1,55 @@ +{ stdenv, lib, fetchurl, pkg-config, which, ncurses, ocaml, findlib, ocaml_pcre, camlzip +, gnutls, nettle +}: + +if lib.versionOlder ocaml.version "4.02" +then throw "ocamlnet is not available for OCaml ${ocaml.version}" +else + +stdenv.mkDerivation rec { + pname = "ocaml${ocaml.version}-ocamlnet"; + version = "4.1.9"; + + src = fetchurl { + url = "http://download.camlcity.org/download/ocamlnet-${version}.tar.gz"; + sha256 = "1vlwxjxr946gdl61a1d7yk859cijq45f60dhn54ik3w4g6cx33pr"; + }; + + nativeBuildInputs = [ pkg-config which ocaml findlib ]; + buildInputs = [ ncurses ocaml_pcre camlzip gnutls nettle ]; + + strictDeps = true; + + createFindlibDestdir = true; + + dontAddPrefix = true; + dontAddStaticConfigureFlags = true; + configurePlatforms = []; + + preConfigure = '' + configureFlagsArray=( + -bindir $out/bin + -enable-gnutls + -enable-zip + -enable-pcre + -disable-gtk2 + -with-nethttpd + -datadir $out/lib/ocaml/${ocaml.version}/ocamlnet + ) + ''; + + buildPhase = '' + make all + make opt + ''; + + meta = { + homepage = "http://projects.camlcity.org/projects/ocamlnet.html"; + description = "A library implementing Internet protocols (http, cgi, email, etc.) for OCaml"; + license = "Most Ocamlnet modules are released under the zlib/png license. The HTTP server module Nethttpd is, however, under the GPL."; + platforms = ocaml.meta.platforms or []; + maintainers = [ + lib.maintainers.maggesi + ]; + }; +} diff --git a/pkgs/development/ocaml-modules/ocamlsdl/default.nix b/pkgs/development/ocaml-modules/ocamlsdl/default.nix new file mode 100644 index 00000000000..3482aa37e75 --- /dev/null +++ b/pkgs/development/ocaml-modules/ocamlsdl/default.nix @@ -0,0 +1,31 @@ +{stdenv, lib, fetchurl, ocaml, pkg-config, findlib, SDL, SDL_image, SDL_mixer, SDL_ttf, SDL_gfx, lablgl }: + +let + pname = "ocamlsdl"; +in + +if lib.versionAtLeast ocaml.version "4.06" +then throw "${pname} is not available for OCaml ${ocaml.version}" +else + +stdenv.mkDerivation rec { + name = "${pname}-${version}"; + version = "0.9.1"; + + src = fetchurl { + url = "mirror://sourceforge/project/ocamlsdl/OCamlSDL/ocamlsdl-0.9.1/ocamlsdl-0.9.1.tar.gz"; + sha256 = "abfb295b263dc11e97fffdd88ea1a28b46df8cc2b196777093e4fe7f509e4f8f"; + }; + + nativeBuildInputs = [ pkg-config ocaml findlib ]; + buildInputs = [ SDL SDL_image SDL_mixer SDL_ttf SDL_gfx lablgl ]; + + propagatedBuildInputs = [ SDL SDL_image SDL_mixer SDL_ttf SDL_gfx pkg-config ]; + createFindlibDestdir = true; + + meta = { + homepage = "http://ocamlsdl.sourceforge.net/"; + description = "OCaml bindings for SDL 1.2"; + license = lib.licenses.lgpl21; + }; +} diff --git a/pkgs/development/ocaml-modules/ocb-stubblr/default.nix b/pkgs/development/ocaml-modules/ocb-stubblr/default.nix new file mode 100644 index 00000000000..fcd63ced7a8 --- /dev/null +++ b/pkgs/development/ocaml-modules/ocb-stubblr/default.nix @@ -0,0 +1,31 @@ +{ stdenv, lib, fetchzip, ocaml, findlib, ocamlbuild, topkg, astring }: + +stdenv.mkDerivation rec { + pname = "ocaml${ocaml.version}-ocb-stubblr"; + version = "0.1.0"; + + src = fetchzip { + url = "https://github.com/pqwy/ocb-stubblr/releases/download/v${version}/ocb-stubblr-${version}.tbz"; + name = "src.tar.bz"; + sha256 = "0hpds1lkq4j8wgslv7hnirgfrjmqi36h5rarpw9mwf24gfp5ays2"; + }; + + patches = [ ./pkg-config.patch ]; + + nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ]; + buildInputs = [ topkg ocamlbuild ]; + + propagatedBuildInputs = [ astring ]; + + strictDeps = true; + + inherit (topkg) buildPhase installPhase; + + meta = { + description = "OCamlbuild plugin for C stubs"; + homepage = "https://github.com/pqwy/ocb-stubblr"; + license = lib.licenses.isc; + inherit (ocaml.meta) platforms; + maintainers = [ lib.maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/ocb-stubblr/pkg-config.patch b/pkgs/development/ocaml-modules/ocb-stubblr/pkg-config.patch new file mode 100644 index 00000000000..d86b3f8da9f --- /dev/null +++ b/pkgs/development/ocaml-modules/ocb-stubblr/pkg-config.patch @@ -0,0 +1,25 @@ +--- a/src/ocb_stubblr.ml 1970-01-01 00:00:01.000000000 +0000 ++++ b/src/ocb_stubblr.ml 2016-12-04 11:10:10.000000000 +0000 +@@ -31,20 +31,9 @@ + + (* XXX Would be nice to move pkg-config results to a build artefact. *) + +- let opam_prefix = +- let cmd = "opam config var prefix" in +- lazy ( try run_and_read cmd with Failure _ -> +- error_msgf "error running opam") +- +- let var = "PKG_CONFIG_PATH" +- +- let path () = +- Lazy.force opam_prefix / "lib" / "pkgconfig" :: +- (try [Sys.getenv var] with Not_found -> []) |> String.concat ~sep:":" +- + let run ~flags package = +- let cmd = strf "%s=%s pkg-config %s %s 2>/dev/null" +- var (path ()) package (String.concat ~sep:" " flags) in ++ let cmd = strf "pkg-config %s %s 2>/dev/null" ++ package (String.concat ~sep:" " flags) in + try `Res (run_and_read cmd) with Failure _ -> `Nonexistent + end + diff --git a/pkgs/development/ocaml-modules/ocf/default.nix b/pkgs/development/ocaml-modules/ocf/default.nix new file mode 100644 index 00000000000..30f589e7561 --- /dev/null +++ b/pkgs/development/ocaml-modules/ocf/default.nix @@ -0,0 +1,24 @@ +{ lib, buildDunePackage, fetchFromGitLab, yojson }: + +buildDunePackage rec { + pname = "ocf"; + version = "0.8.0"; + useDune2 = true; + minimalOCamlVersion = "4.03"; + src = fetchFromGitLab { + domain = "framagit.org"; + owner = "zoggy"; + repo = "ocf"; + rev = version; + sha256 = "sha256:00ap3q5yjqmpk87lxqv1j2wkc7583ynhjr1jjrfn9r0j2h9pfd60"; + }; + + propagatedBuildInputs = [ yojson ]; + + meta = with lib; { + description = "OCaml library to read and write configuration options in JSON syntax"; + homepage = "https://zoggy.frama.io/ocf/"; + license = licenses.lgpl3; + maintainers = with maintainers; [ regnat ]; + }; +} diff --git a/pkgs/development/ocaml-modules/ocf/ppx.nix b/pkgs/development/ocaml-modules/ocf/ppx.nix new file mode 100644 index 00000000000..0b1f6998cca --- /dev/null +++ b/pkgs/development/ocaml-modules/ocf/ppx.nix @@ -0,0 +1,14 @@ +{ buildDunePackage, ocf, ppxlib }: + +buildDunePackage { + pname = "ocf_ppx"; + minimalOCamlVersion = "4.11"; + + inherit (ocf) src version useDune2; + + buildInputs = [ ppxlib ocf ]; + + meta = ocf.meta // { + description = "Preprocessor for Ocf library"; + }; +} diff --git a/pkgs/development/ocaml-modules/ocp-ocamlres/default.nix b/pkgs/development/ocaml-modules/ocp-ocamlres/default.nix new file mode 100644 index 00000000000..763617be132 --- /dev/null +++ b/pkgs/development/ocaml-modules/ocp-ocamlres/default.nix @@ -0,0 +1,34 @@ +{ stdenv, lib, fetchFromGitHub, ocaml, findlib, astring, pprint }: + +if !lib.versionAtLeast ocaml.version "4.02" +then throw "ocp-ocamlres is not available for OCaml ${ocaml.version}" +else + +stdenv.mkDerivation rec { + pname = "ocaml${ocaml.version}-ocp-ocamlres"; + version = "0.4"; + src = fetchFromGitHub { + owner = "OCamlPro"; + repo = "ocp-ocamlres"; + rev = "v${version}"; + sha256 = "0smfwrj8qhzknhzawygxi0vgl2af4vyi652fkma59rzjpvscqrnn"; + }; + + nativeBuildInputs = [ ocaml findlib ]; + buildInputs = [ astring pprint ]; + + strictDeps = true; + + createFindlibDestdir = true; + + installFlags = [ "BINDIR=$(out)/bin" ]; + preInstall = "mkdir -p $out/bin"; + + meta = { + description = "A simple tool and library to embed files and directories inside OCaml executables"; + license = lib.licenses.lgpl3Plus; + homepage = "https://www.typerex.org/ocp-ocamlres.html"; + maintainers = [ lib.maintainers.vbgl ]; + inherit (ocaml.meta) platforms; + }; +} diff --git a/pkgs/development/ocaml-modules/ocplib-endian/default.nix b/pkgs/development/ocaml-modules/ocplib-endian/default.nix new file mode 100644 index 00000000000..c0bccbd65a6 --- /dev/null +++ b/pkgs/development/ocaml-modules/ocplib-endian/default.nix @@ -0,0 +1,24 @@ +{ lib, buildDunePackage, fetchFromGitHub, cppo }: + +buildDunePackage rec { + version = "1.1"; + pname = "ocplib-endian"; + + src = fetchFromGitHub { + owner = "OCamlPro"; + repo = "ocplib-endian"; + rev = version; + sha256 = "sha256-zKsSkhlZBXSqPtw+/WN3pwo9plM9rDZfMbGVfosqb10="; + }; + + useDune2 = true; + + nativeBuildInputs = [ cppo ]; + + meta = with lib; { + description = "Optimised functions to read and write int16/32/64"; + homepage = "https://github.com/OCamlPro/ocplib-endian"; + license = licenses.lgpl21; + maintainers = with maintainers; [ vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/ocplib-json-typed/browser.nix b/pkgs/development/ocaml-modules/ocplib-json-typed/browser.nix new file mode 100644 index 00000000000..8db892f325e --- /dev/null +++ b/pkgs/development/ocaml-modules/ocplib-json-typed/browser.nix @@ -0,0 +1,15 @@ +{ buildDunePackage, ocplib-json-typed, js_of_ocaml }: + +buildDunePackage { + pname = "ocplib-json-typed-browser"; + inherit (ocplib-json-typed) version src; + useDune2 = true; + + propagatedBuildInputs = [ ocplib-json-typed js_of_ocaml ]; + + meta = { + description = "A Json_repr interface over JavaScript's objects"; + inherit (ocplib-json-typed.meta) homepage license maintainers; + }; +} + diff --git a/pkgs/development/ocaml-modules/ocplib-json-typed/bson.nix b/pkgs/development/ocaml-modules/ocplib-json-typed/bson.nix new file mode 100644 index 00000000000..f95a25d25f2 --- /dev/null +++ b/pkgs/development/ocaml-modules/ocplib-json-typed/bson.nix @@ -0,0 +1,13 @@ +{ buildDunePackage, ocplib-json-typed, ocplib-endian }: + +buildDunePackage { + pname = "ocplib-json-typed-bson"; + inherit (ocplib-json-typed) version useDune2 src; + + propagatedBuildInputs = [ ocplib-json-typed ocplib-endian ]; + + meta = { + description = "A Json_repr compatible implementation of the JSON compatible subset of BSON"; + inherit (ocplib-json-typed.meta) homepage license maintainers; + }; +} diff --git a/pkgs/development/ocaml-modules/ocplib-json-typed/default.nix b/pkgs/development/ocaml-modules/ocplib-json-typed/default.nix new file mode 100644 index 00000000000..75554d25bf2 --- /dev/null +++ b/pkgs/development/ocaml-modules/ocplib-json-typed/default.nix @@ -0,0 +1,22 @@ +{ lib, buildDunePackage, fetchFromGitHub, uri }: + +buildDunePackage rec { + pname = "ocplib-json-typed"; + version = "0.7.1"; + useDune2 = true; + src = fetchFromGitHub { + owner = "OCamlPro"; + repo = "ocplib-json-typed"; + rev = "v${version}"; + sha256 = "1gv0vqqy9lh7isaqg54b3lam2sh7nfjjazi6x7zn6bh5f77g1p5q"; + }; + + propagatedBuildInputs = [ uri ]; + + meta = { + description = "A collection of type-aware JSON utilities for OCaml"; + license = lib.licenses.lgpl21; + maintainers = [ lib.maintainers.vbgl ]; + inherit (src.meta) homepage; + }; +} diff --git a/pkgs/development/ocaml-modules/ocplib-simplex/default.nix b/pkgs/development/ocaml-modules/ocplib-simplex/default.nix new file mode 100644 index 00000000000..474f69546d1 --- /dev/null +++ b/pkgs/development/ocaml-modules/ocplib-simplex/default.nix @@ -0,0 +1,33 @@ +{ stdenv, lib, fetchFromGitHub, autoreconfHook, ocaml, findlib }: + +let + pname = "ocplib-simplex"; + version = "0.4"; +in + +stdenv.mkDerivation { + name = "ocaml${ocaml.version}-${pname}-${version}"; + + src = fetchFromGitHub { + owner = "OCamlPro-Iguernlala"; + repo = pname; + rev = "v${version}"; + sha256 = "09niyidrjzrj8g1qwx4wgsdf5m6cwrnzg7zsgala36jliic4di60"; + }; + + nativeBuildInputs = [ autoreconfHook ocaml findlib ]; + + strictDeps = true; + + installFlags = [ "LIBDIR=$(OCAMLFIND_DESTDIR)" ]; + + createFindlibDestdir = true; + + meta = { + description = "An OCaml library implementing a simplex algorithm, in a functional style, for solving systems of linear inequalities"; + homepage = "https://github.com/OCamlPro-Iguernlala/ocplib-simplex"; + inherit (ocaml.meta) platforms; + license = lib.licenses.lgpl21; + maintainers = [ lib.maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/ocsigen-deriving/default.nix b/pkgs/development/ocaml-modules/ocsigen-deriving/default.nix new file mode 100644 index 00000000000..480ea6daf20 --- /dev/null +++ b/pkgs/development/ocaml-modules/ocsigen-deriving/default.nix @@ -0,0 +1,46 @@ +{ stdenv +, lib +, fetchFromGitHub +, ocaml +, findlib +, ocamlbuild +, oasis +, camlp4 +, num +}: + +if !lib.versionAtLeast ocaml.version "4.03" +then throw "ocsigen-deriving is not available of OCaml ${ocaml.version}" +else + +stdenv.mkDerivation rec { + pname = "ocaml${ocaml.version}-ocsigen-deriving"; + version = "0.8.2"; + + src = fetchFromGitHub { + owner = "ocsigen"; + repo = "deriving"; + rev = version; + sha256 = "sha256:09rp9mrr551na0nmclpxddlrkb6l2d7763xv14xfx467kff3z0wf"; + }; + + createFindlibDestdir = true; + + nativeBuildInputs = [ ocaml findlib ocamlbuild oasis camlp4 ]; + buildInputs = [ oasis camlp4 ocamlbuild num ]; + + strictDeps = true; + + meta = { + homepage = "https://github.com/ocsigen/deriving"; + description = "Extension to OCaml for deriving functions from type declarations"; + license = lib.licenses.mit; + inherit (ocaml.meta) platforms; + maintainers = with lib.maintainers; [ + gal_bolle + vbgl + ]; + }; + + +} diff --git a/pkgs/development/ocaml-modules/ocsigen-server/default.nix b/pkgs/development/ocaml-modules/ocsigen-server/default.nix new file mode 100644 index 00000000000..67ec458a122 --- /dev/null +++ b/pkgs/development/ocaml-modules/ocsigen-server/default.nix @@ -0,0 +1,74 @@ +{ lib, buildDunePackage, fetchFromGitHub, which, ocaml, lwt_react, ssl, lwt_ssl +, bigstringaf, lwt, cstruct, mirage-crypto, zarith, mirage-crypto-ec, ptime, mirage-crypto-rng, mtime, ca-certs +, cohttp, cohttp-lwt-unix, hmap +, lwt_log, ocaml_pcre, cryptokit, xml-light, ipaddr +, pgocaml, camlzip, ocaml_sqlite3 +, makeWrapper +}: + +let mkpath = p: + "${p}/lib/ocaml/${ocaml.version}/site-lib/stublibs"; +in + +let caml_ld_library_path = + lib.concatMapStringsSep ":" mkpath [ + bigstringaf lwt ssl cstruct mirage-crypto zarith mirage-crypto-ec ptime mirage-crypto-rng mtime ca-certs cryptokit ocaml_pcre + ] +; in + +buildDunePackage rec { + version = "4.0.1"; + pname = "ocsigenserver"; + + useDune2 = true; + minimalOCamlVersion = "4.08"; + + src = fetchFromGitHub { + owner = "ocsigen"; + repo = "ocsigenserver"; + rev = version; + sha256 = "0pid4irkmdmx1d6n2rvcvx5mnljl3hazzdqc3bql72by35izfac6"; + }; + + nativeBuildInputs = [ makeWrapper which ]; + buildInputs = [ lwt_react pgocaml camlzip ocaml_sqlite3 ]; + + propagatedBuildInputs = [ cohttp cohttp-lwt-unix cryptokit hmap ipaddr lwt_log lwt_ssl + ocaml_pcre xml-light + ]; + + configureFlags = [ "--root $(out)" "--prefix /" "--temproot ''" ]; + + dontAddPrefix = true; + dontAddStaticConfigureFlags = true; + configurePlatforms = []; + + postConfigure = '' + make -C src confs + ''; + + postInstall = '' + make install.files + ''; + + postFixup = + '' + rm -rf $out/var/run + wrapProgram $out/bin/ocsigenserver \ + --suffix CAML_LD_LIBRARY_PATH : "${caml_ld_library_path}" + ''; + + dontPatchShebangs = true; + + meta = { + homepage = "http://ocsigen.org/ocsigenserver/"; + description = "A full featured Web server"; + longDescription ='' + A full featured Web server. It implements most features of the HTTP protocol, and has a very powerful extension mechanism that make very easy to plug your own OCaml modules for generating pages. + ''; + license = lib.licenses.lgpl21Only; + platforms = ocaml.meta.platforms or []; + maintainers = [ lib.maintainers.gal_bolle ]; + }; + +} diff --git a/pkgs/development/ocaml-modules/ocsigen-start/default.nix b/pkgs/development/ocaml-modules/ocsigen-start/default.nix new file mode 100644 index 00000000000..118138dc8fd --- /dev/null +++ b/pkgs/development/ocaml-modules/ocsigen-start/default.nix @@ -0,0 +1,40 @@ +{ stdenv, lib, fetchFromGitHub, ocaml, findlib, ocsigen-toolkit, pgocaml_ppx, safepass, yojson +, cohttp-lwt-unix, eliom +, resource-pooling +, ocamlnet +}: + +stdenv.mkDerivation rec { + pname = "ocaml${ocaml.version}-ocsigen-start"; + version = "4.3.0"; + + nativeBuildInputs = [ ocaml findlib eliom ]; + propagatedBuildInputs = [ pgocaml_ppx safepass ocsigen-toolkit yojson resource-pooling cohttp-lwt-unix ocamlnet ]; + + strictDeps = true; + + patches = [ ./templates-dir.patch ]; + + src = fetchFromGitHub { + owner = "ocsigen"; + repo = "ocsigen-start"; + rev = version; + sha256 = "0lkl59dwzyqq2lyr46fyjr27ms0fp9h59xfsn37faaavdd7v0h98"; + }; + + preInstall = '' + mkdir -p $OCAMLFIND_DESTDIR + ''; + + meta = { + homepage = "http://ocsigen.org/ocsigen-start"; + description = "Eliom application skeleton"; + longDescription ='' + An Eliom application skeleton, ready to use to build your own application with users, (pre)registration, notifications, etc. + ''; + license = lib.licenses.lgpl21Only; + inherit (ocaml.meta) platforms; + maintainers = [ lib.maintainers.gal_bolle ]; + }; + +} diff --git a/pkgs/development/ocaml-modules/ocsigen-start/templates-dir.patch b/pkgs/development/ocaml-modules/ocsigen-start/templates-dir.patch new file mode 100644 index 00000000000..38365a26b99 --- /dev/null +++ b/pkgs/development/ocaml-modules/ocsigen-start/templates-dir.patch @@ -0,0 +1,13 @@ +diff --git a/scripts/install.sh b/scripts/install.sh +index f88ae11..d6aae70 100755 +--- a/scripts/install.sh ++++ b/scripts/install.sh +@@ -11,9 +11,9 @@ fi + + TPL_DIR=$1 + TPL_NAME=$2 +-DEST0=$DESTDIR/$(eliom-distillery -dir) ++DEST0=$out/eliom-distillery-templates + DEST=$DEST0/$TPL_NAME + + mkdir -p $DEST0 diff --git a/pkgs/development/ocaml-modules/ocsigen-toolkit/default.nix b/pkgs/development/ocaml-modules/ocsigen-toolkit/default.nix new file mode 100644 index 00000000000..1b2dd72a2ec --- /dev/null +++ b/pkgs/development/ocaml-modules/ocsigen-toolkit/default.nix @@ -0,0 +1,40 @@ +{ stdenv, lib, fetchFromGitHub, ocaml, findlib, opaline +, calendar, eliom, js_of_ocaml-ppx_deriving_json +}: + +stdenv.mkDerivation rec { + pname = "ocsigen-toolkit"; + name = "ocaml${ocaml.version}-${pname}-${version}"; + version = "3.0.1"; + + propagatedBuildInputs = [ calendar js_of_ocaml-ppx_deriving_json eliom ]; + nativeBuildInputs = [ ocaml findlib opaline eliom ]; + + strictDeps = true; + + installPhase = '' + runHook preInstall + mkdir -p $OCAMLFIND_DESTDIR + export OCAMLPATH=$out/lib/ocaml/${ocaml.version}/site-lib/:$OCAMLPATH + make install + opaline -prefix $out + runHook postInstall + ''; + + src = fetchFromGitHub { + owner = "ocsigen"; + repo = pname; + rev = version; + sha256 = "1yx50ja2wcs5vfy4rk9szgwccpnihkjn14i4ywchx4yr4ppr00fm"; + }; + + meta = { + homepage = "http://ocsigen.org/ocsigen-toolkit/"; + description = " User interface widgets for Ocsigen applications"; + license = lib.licenses.lgpl21; + maintainers = [ lib.maintainers.gal_bolle ]; + inherit (ocaml.meta) platforms; + }; + + +} diff --git a/pkgs/development/ocaml-modules/octavius/default.nix b/pkgs/development/ocaml-modules/octavius/default.nix new file mode 100644 index 00000000000..a4124df6664 --- /dev/null +++ b/pkgs/development/ocaml-modules/octavius/default.nix @@ -0,0 +1,25 @@ +{ lib, fetchFromGitHub, buildDunePackage, ocaml }: + +buildDunePackage rec { + pname = "octavius"; + version = "1.2.2"; + + src = fetchFromGitHub { + owner = "ocaml-doc"; + repo = "octavius"; + rev = "v${version}"; + sha256 = "sha256-/S6WpIo1c5J9uM3xgtAM/elhnsl0XimnIFsKy3ootbA="; + }; + + minimumOCamlVersion = "4.03"; + useDune2 = lib.versionAtLeast ocaml.version "4.08"; + + doCheck = true; + + meta = with lib; { + description = "Ocamldoc comment syntax parser"; + homepage = "https://github.com/ocaml-doc/octavius"; + license = licenses.isc; + maintainers = with maintainers; [ vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/ocurl/default.nix b/pkgs/development/ocaml-modules/ocurl/default.nix new file mode 100644 index 00000000000..5e815d4dca6 --- /dev/null +++ b/pkgs/development/ocaml-modules/ocurl/default.nix @@ -0,0 +1,30 @@ +{ stdenv, lib, pkg-config, ocaml, findlib, fetchurl, curl, ncurses, lwt }: + +if lib.versionOlder ocaml.version "4.02" +then throw "ocurl is not available for OCaml ${ocaml.version}" +else + +stdenv.mkDerivation rec { + pname = "ocurl"; + version = "0.9.1"; + + src = fetchurl { + url = "http://ygrek.org.ua/p/release/ocurl/ocurl-${version}.tar.gz"; + sha256 = "0n621cxb9012pj280c7821qqsdhypj8qy9qgrah79dkh6a8h2py6"; + }; + + nativeBuildInputs = [ pkg-config ocaml findlib ]; + buildInputs = [ ncurses ]; + propagatedBuildInputs = [ curl lwt ]; + + strictDeps = true; + + createFindlibDestdir = true; + meta = { + description = "OCaml bindings to libcurl"; + license = lib.licenses.mit; + homepage = "http://ygrek.org.ua/p/ocurl/"; + maintainers = with lib.maintainers; [ bennofs ]; + platforms = ocaml.meta.platforms or [ ]; + }; +} diff --git a/pkgs/development/ocaml-modules/odate/default.nix b/pkgs/development/ocaml-modules/odate/default.nix new file mode 100644 index 00000000000..8967a381547 --- /dev/null +++ b/pkgs/development/ocaml-modules/odate/default.nix @@ -0,0 +1,31 @@ +{ lib, buildDunePackage, fetchFromGitHub +, menhir +}: + +buildDunePackage rec { + pname = "odate"; + version = "0.6"; + + useDune2 = true; + + minimumOCamlVersion = "4.07"; + + src = fetchFromGitHub { + owner = "hhugo"; + repo = pname; + rev = version; + sha256 = "1dk33lr0g2jnia2gqsm6nnc7nf256qgkm3v30w477gm6y2ppfm3h"; + }; + + strictDeps = true; + + nativeBuildInputs = [ menhir ]; + + meta = { + description = "Date and duration in OCaml"; + inherit (src.meta) homepage; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.vbgl ]; + }; + +} diff --git a/pkgs/development/ocaml-modules/odn/default.nix b/pkgs/development/ocaml-modules/odn/default.nix new file mode 100644 index 00000000000..66fc5d1f187 --- /dev/null +++ b/pkgs/development/ocaml-modules/odn/default.nix @@ -0,0 +1,37 @@ +{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, type_conv, ounit, camlp4 }: + +if lib.versionAtLeast ocaml.version "4.06" +then throw "ocaml-data-notation is not available for OCaml ${ocaml.version}" +else + +stdenv.mkDerivation rec { + pname = "ocaml-data-notation"; + version = "0.0.11"; + + src = fetchurl { + url = "https://forge.ocamlcore.org/frs/download.php/1310/ocaml-data-notation-${version}.tar.gz"; + sha256 = "09a8zdyifpc2nl4hdvg9206142y31cq95ajgij011s1qcg3z93lj"; + }; + + nativeBuildInputs = [ ocaml findlib ocamlbuild ]; + buildInputs = [ type_conv ounit camlp4 ]; + + strictDeps = true; + + createFindlibDestdir = true; + + configurePhase = "ocaml setup.ml -configure"; + buildPhase = "ocaml setup.ml -build"; + installPhase = "ocaml setup.ml -install"; + + meta = with lib; { + description = "Store data using OCaml notation"; + homepage = "https://forge.ocamlcore.org/projects/odn/"; + license = licenses.lgpl21; + platforms = ocaml.meta.platforms or [ ]; + maintainers = with maintainers; [ + vbgl + maggesi + ]; + }; +} diff --git a/pkgs/development/ocaml-modules/odoc-parser/default.nix b/pkgs/development/ocaml-modules/odoc-parser/default.nix new file mode 100644 index 00000000000..7a2b5abd974 --- /dev/null +++ b/pkgs/development/ocaml-modules/odoc-parser/default.nix @@ -0,0 +1,35 @@ +{ lib, fetchurl, buildDunePackage, astring, result , version ? "1.0.0" }: + +let param = { + "1.0.0" = { + sha256 = "sha256-tqoI6nGp662bK+vE2h7aDXE882dObVfRBFnZNChueqE="; + }; + "0.9.0" = { + sha256 = "sha256-3w2tG605v03mvmZsS2O5c71y66O3W+n3JjFxIbXwvXk="; + }; +}."${version}"; in + +let v = version; in +buildDunePackage rec { + pname = "odoc-parser"; + inherit version; + + minimumOCamlVersion = "4.02"; + + src = fetchurl { + url = "https://github.com/ocaml-doc/odoc-parser/releases/download/${version}/odoc-parser-${version}.tbz"; + inherit (param) sha256; + }; + + useDune2 = true; + + buildInputs = [ astring result ]; + + meta = { + description = "Parser for Ocaml documentation comments"; + license = lib.licenses.isc; + maintainers = [ lib.maintainers.marsam ]; + homepage = "https://github.com/ocaml-doc/odoc-parser"; + changelog = "https://github.com/ocaml-doc/odoc-parser/raw/${version}/CHANGES.md"; + }; +} diff --git a/pkgs/development/ocaml-modules/odoc/default.nix b/pkgs/development/ocaml-modules/odoc/default.nix new file mode 100644 index 00000000000..68c06cc4c6f --- /dev/null +++ b/pkgs/development/ocaml-modules/odoc/default.nix @@ -0,0 +1,30 @@ +{ lib, fetchurl, buildDunePackage, ocaml +, astring, cmdliner, cppo, fpath, result, tyxml +, markup, alcotest, yojson, sexplib, jq +}: + +buildDunePackage rec { + pname = "odoc"; + version = "1.5.3"; + + minimumOCamlVersion = "4.02"; + + src = fetchurl { + url = "https://github.com/ocaml/odoc/releases/download/${version}/odoc-${version}.tbz"; + sha256 = "0idzidmz7y10xkwcf4aih0mdvkipxk1gzi4anhnbbi2q2s0nzdzj"; + }; + + useDune2 = true; + + buildInputs = [ astring cmdliner cppo fpath result tyxml ]; + + checkInputs = [ alcotest markup yojson sexplib jq ]; + doCheck = lib.versionAtLeast ocaml.version "4.05"; + + meta = { + description = "A documentation generator for OCaml"; + license = lib.licenses.isc; + maintainers = [ lib.maintainers.vbgl ]; + homepage = "https://github.com/ocaml/odoc"; + }; +} diff --git a/pkgs/development/ocaml-modules/ogg/default.nix b/pkgs/development/ocaml-modules/ogg/default.nix new file mode 100644 index 00000000000..e1e1df6c2a0 --- /dev/null +++ b/pkgs/development/ocaml-modules/ogg/default.nix @@ -0,0 +1,25 @@ +{ lib, buildDunePackage, fetchFromGitHub, dune-configurator, libogg }: + +buildDunePackage rec { + pname = "ogg"; + version = "0.7.1"; + + useDune2 = true; + + src = fetchFromGitHub { + owner = "savonet"; + repo = "ocaml-ogg"; + rev = "v${version}"; + sha256 = "0z3z0816rxq8wdjw51plzn8lmilic621ilk4x9wpnr0axmnl3wqb"; + }; + + buildInputs = [ dune-configurator ]; + propagatedBuildInputs = [ libogg ]; + + meta = with lib; { + homepage = "https://github.com/savonet/ocaml-ogg"; + description = "Bindings to libogg"; + license = licenses.lgpl21Only; + maintainers = with maintainers; [ dandellion ]; + }; +} diff --git a/pkgs/development/ocaml-modules/omd/default.nix b/pkgs/development/ocaml-modules/omd/default.nix new file mode 100644 index 00000000000..b9797e257ab --- /dev/null +++ b/pkgs/development/ocaml-modules/omd/default.nix @@ -0,0 +1,31 @@ +{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild }: + +stdenv.mkDerivation rec { + pname = "ocaml${ocaml.version}-omd"; + version = "1.3.1"; + + src = fetchurl { + url = "https://github.com/Chris00/omd/releases/download/${version}/omd-${version}.tar.gz"; + sha256 = "1sgdgzpx96br7npj8mh91cli5mqmzsjpngwm7x4212n3k1d0ivwa"; + }; + + nativeBuildInputs = [ ocaml findlib ocamlbuild ]; + + strictDeps = true; + + createFindlibDestdir = true; + + configurePhase = '' + runHook preConfigure + ocaml setup.ml -configure --prefix $out + runHook postConfigure + ''; + + meta = { + description = "Extensible Markdown library and tool in OCaml"; + homepage = "https://github.com/ocaml/omd"; + license = lib.licenses.isc; + maintainers = [ lib.maintainers.vbgl ]; + inherit (ocaml.meta) platforms; + }; +} diff --git a/pkgs/development/ocaml-modules/opam-core/default.nix b/pkgs/development/ocaml-modules/opam-core/default.nix new file mode 100644 index 00000000000..3106fe83fd7 --- /dev/null +++ b/pkgs/development/ocaml-modules/opam-core/default.nix @@ -0,0 +1,22 @@ +{ lib, buildDunePackage, unzip +, opam, ocamlgraph, re, cppo }: + +buildDunePackage rec { + pname = "opam-core"; + + inherit (opam) src version; + + useDune2 = true; + + nativeBuildInputs = [ unzip cppo ]; + propagatedBuildInputs = [ ocamlgraph re ]; + + # get rid of check for curl at configure time + # opam-core does not call curl at run time + configureFlags = [ "--disable-checks" ]; + + meta = opam.meta // { + description = "Small standard library extensions, and generic system interaction modules used by opam"; + maintainers = with lib.maintainers; [ sternenseemann ]; + }; +} diff --git a/pkgs/development/ocaml-modules/opam-file-format/default.nix b/pkgs/development/ocaml-modules/opam-file-format/default.nix new file mode 100644 index 00000000000..d0ec77c4556 --- /dev/null +++ b/pkgs/development/ocaml-modules/opam-file-format/default.nix @@ -0,0 +1,22 @@ +{ lib, fetchFromGitHub, buildDunePackage }: + +buildDunePackage rec { + pname = "opam-file-format"; + version = "2.1.3"; + + src = fetchFromGitHub { + owner = "ocaml"; + repo = pname; + rev = version; + sha256 = "1fxhppdmrysr2nb5z3c448h17np48f3ga9jih33acj78r4rdblcs"; + }; + + useDune2 = true; + + meta = with lib; { + description = "Parser and printer for the opam file syntax"; + license = licenses.lgpl21; + maintainers = with maintainers; [ vbgl ]; + homepage = "https://github.com/ocaml/opam-file-format/"; + }; +} diff --git a/pkgs/development/ocaml-modules/opam-format/default.nix b/pkgs/development/ocaml-modules/opam-format/default.nix new file mode 100644 index 00000000000..fdb8ba33d5e --- /dev/null +++ b/pkgs/development/ocaml-modules/opam-format/default.nix @@ -0,0 +1,23 @@ +{ lib, buildDunePackage, unzip, opam-core, opam-file-format }: + +buildDunePackage rec { + pname = "opam-format"; + + useDune2 = true; + + inherit (opam-core) src version; + + minimumOCamlVersion = "4.02.3"; + + # get rid of check for curl at configure time + # opam-format does not call curl at run time + configureFlags = [ "--disable-checks" ]; + + nativeBuildInputs = [ unzip ]; + propagatedBuildInputs = [ opam-core opam-file-format ]; + + meta = opam-core.meta // { + description = "Definition of opam datastructures and its file interface"; + maintainers = with lib.maintainers; [ sternenseemann ]; + }; +} diff --git a/pkgs/development/ocaml-modules/opam-repository/default.nix b/pkgs/development/ocaml-modules/opam-repository/default.nix new file mode 100644 index 00000000000..ff9ad75fad8 --- /dev/null +++ b/pkgs/development/ocaml-modules/opam-repository/default.nix @@ -0,0 +1,27 @@ +{ lib, buildDunePackage, unzip, opam-format, curl }: + +buildDunePackage rec { + pname = "opam-repository"; + + minimumOCamlVersion = "4.02"; + + useDune2 = true; + + inherit (opam-format) src version; + + patches = [ ./download-tool.patch ]; + postPatch = '' + substituteInPlace src/repository/opamRepositoryConfig.ml \ + --replace "SUBSTITUTE_NIXOS_CURL_PATH" "\"${curl}/bin/curl\"" + ''; + + strictDeps = true; + + nativeBuildInputs = [ unzip curl ]; + propagatedBuildInputs = [ opam-format ]; + + meta = opam-format.meta // { + description = "OPAM repository and remote sources handling, including curl/wget, rsync, git, mercurial, darcs backends"; + maintainers = with lib.maintainers; [ sternenseemann ]; + }; +} diff --git a/pkgs/development/ocaml-modules/opam-repository/download-tool.patch b/pkgs/development/ocaml-modules/opam-repository/download-tool.patch new file mode 100644 index 00000000000..9cc5f43f34f --- /dev/null +++ b/pkgs/development/ocaml-modules/opam-repository/download-tool.patch @@ -0,0 +1,37 @@ +diff --git a/src/repository/opamRepositoryConfig.ml b/src/repository/opamRepositoryConfig.ml +index c2954c1d..528fc621 100644 +--- a/src/repository/opamRepositoryConfig.ml ++++ b/src/repository/opamRepositoryConfig.ml +@@ -27,31 +27,7 @@ type 'a options_fun = + 'a + + let default = { +- download_tool = lazy ( +- let os = OpamStd.Sys.os () in +- try +- let curl = "curl", `Curl in +- let tools = +- match os with +- | Darwin -> ["wget", `Default; curl] +- | FreeBSD -> ["fetch", `Default ; curl] +- | OpenBSD -> ["ftp", `Default; curl] +- | _ -> [curl; "wget", `Default] +- in +- let cmd, kind = +- List.find (fun (c,_) -> OpamSystem.resolve_command c <> None) tools +- in +- [ CIdent cmd, None ], kind +- with Not_found -> +- OpamConsole.error_and_exit `Configuration_error +- "Could not find a suitable download command. Please make sure you \ +- have %s installed, or specify a custom command through variable \ +- OPAMFETCH." +- (match os with +- | FreeBSD -> "fetch" +- | OpenBSD -> "ftp" +- | _ -> "either \"curl\" or \"wget\"") +- ); ++ download_tool = lazy ([ CIdent SUBSTITUTE_NIXOS_CURL_PATH, None ], `Curl); + validation_hook = None; + retries = 3; + force_checksums = None; diff --git a/pkgs/development/ocaml-modules/opam-state/default.nix b/pkgs/development/ocaml-modules/opam-state/default.nix new file mode 100644 index 00000000000..d841631dfd0 --- /dev/null +++ b/pkgs/development/ocaml-modules/opam-state/default.nix @@ -0,0 +1,21 @@ +{ lib, buildDunePackage, unzip, opam, opam-repository }: + +buildDunePackage rec { + pname = "opam-state"; + + inherit (opam) src version; + + useDune2 = true; + + # get rid of check for curl at configure time + # opam-state does not call curl at run time + configureFlags = [ "--disable-checks" ]; + + nativeBuildInputs = [ unzip ]; + propagatedBuildInputs = [ opam-repository ]; + + meta = opam.meta // { + description = "OPAM development library handling the ~/.opam hierarchy, repository and switch states"; + maintainers = with lib.maintainers; [ sternenseemann ]; + }; +} diff --git a/pkgs/development/ocaml-modules/opium/default.nix b/pkgs/development/ocaml-modules/opium/default.nix new file mode 100644 index 00000000000..5db3d1b4a24 --- /dev/null +++ b/pkgs/development/ocaml-modules/opium/default.nix @@ -0,0 +1,32 @@ +{ buildDunePackage + +, ppx_sexp_conv +, ppx_fields_conv + +, cmdliner +, cohttp-lwt-unix +, logs +, magic-mime +, opium_kernel +, stringext + +, alcotest +}: + +buildDunePackage { + pname = "opium"; + inherit (opium_kernel) version src meta minimumOCamlVersion; + + useDune2 = true; + + doCheck = true; + + buildInputs = [ + ppx_sexp_conv ppx_fields_conv + alcotest + ]; + + propagatedBuildInputs = [ + opium_kernel cmdliner cohttp-lwt-unix magic-mime logs stringext + ]; +} diff --git a/pkgs/development/ocaml-modules/opium_kernel/default.nix b/pkgs/development/ocaml-modules/opium_kernel/default.nix new file mode 100644 index 00000000000..c7bfe1e7306 --- /dev/null +++ b/pkgs/development/ocaml-modules/opium_kernel/default.nix @@ -0,0 +1,43 @@ +{ lib +, buildDunePackage +, fetchurl + +, ppx_fields_conv +, ppx_sexp_conv + +, cohttp-lwt +, ezjsonm +, hmap +, sexplib +}: + +buildDunePackage rec { + pname = "opium_kernel"; + version = "0.18.0"; + + useDune2 = true; + + minimumOCamlVersion = "4.04.1"; + + src = fetchurl { + url = "https://github.com/rgrinberg/opium/releases/download/${version}/opium-${version}.tbz"; + sha256 = "0a2y9gw55psqhqli3a5ps9mfdab8r46fnbj882r2sp366sfcy37q"; + }; + + doCheck = true; + + buildInputs = [ + ppx_sexp_conv ppx_fields_conv + ]; + + propagatedBuildInputs = [ + hmap cohttp-lwt ezjsonm sexplib + ]; + + meta = { + description = "Sinatra like web toolkit for OCaml based on cohttp & lwt"; + homepage = "https://github.com/rgrinberg/opium"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.pmahoney ]; + }; +} diff --git a/pkgs/development/ocaml-modules/opti/default.nix b/pkgs/development/ocaml-modules/opti/default.nix new file mode 100644 index 00000000000..4ce5087912d --- /dev/null +++ b/pkgs/development/ocaml-modules/opti/default.nix @@ -0,0 +1,22 @@ +{ lib, fetchurl, buildDunePackage }: + +buildDunePackage rec { + pname = "opti"; + version = "1.0.3"; + + useDune2 = true; + + minimumOCamlVersion = "4.02"; + + src = fetchurl { + url = "https://github.com/magnusjonsson/opti/releases/download/${version}/opti-${version}.tbz"; + sha256 = "ed9ba56dc06e9d2b1bf097964cc65ea37db787d4f239c13d0dd74693f5b50a1e"; + }; + + meta = with lib; { + description = "DSL to generate fast incremental C code from declarative specifications"; + license = licenses.bsd3; + maintainers = [ maintainers.jmagnusj ]; + homepage = "https://github.com/magnusjonsson/opti"; + }; +} diff --git a/pkgs/development/ocaml-modules/optint/default.nix b/pkgs/development/ocaml-modules/optint/default.nix new file mode 100644 index 00000000000..2227f6e033c --- /dev/null +++ b/pkgs/development/ocaml-modules/optint/default.nix @@ -0,0 +1,20 @@ +{ lib, buildDunePackage, fetchurl }: + +buildDunePackage rec { + minimumOCamlVersion = "4.07"; + version = "0.1.0"; + pname = "optint"; + src = fetchurl { + url = "https://github.com/mirage/optint/releases/download/v${version}/optint-v${version}.tbz"; + sha256 = "27847660223c16cc7eaf8fcd9d5589a0b802114330a2529578f8007d3b01185d"; + }; + + useDune2 = true; + + meta = { + homepage = "https://github.com/mirage/optint"; + description = "Abstract type of integer between x64 and x86 architecture"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/opus/default.nix b/pkgs/development/ocaml-modules/opus/default.nix new file mode 100644 index 00000000000..30e461b9f9a --- /dev/null +++ b/pkgs/development/ocaml-modules/opus/default.nix @@ -0,0 +1,26 @@ +{ lib, buildDunePackage, fetchFromGitHub, dune-configurator, pkg-config, ogg, libopus }: + +buildDunePackage rec { + pname = "opus"; + version = "0.2.1"; + + useDune2 = true; + + src = fetchFromGitHub { + owner = "savonet"; + repo = "ocaml-opus"; + rev = "v${version}"; + sha256 = "09mgnprhhs1adqm25c0qjhknswbh6va3jknq06fnp1jszszcjf4s"; + }; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ dune-configurator ]; + propagatedBuildInputs = [ ogg libopus.dev ]; + + meta = with lib; { + homepage = "https://github.com/savonet/ocaml-opus"; + description = "Bindings to libopus"; + license = licenses.gpl2Only; + maintainers = with maintainers; [ dandellion ]; + }; +} diff --git a/pkgs/development/ocaml-modules/otfm/default.nix b/pkgs/development/ocaml-modules/otfm/default.nix new file mode 100644 index 00000000000..91d91bdc46f --- /dev/null +++ b/pkgs/development/ocaml-modules/otfm/default.nix @@ -0,0 +1,41 @@ +{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg, uutf, result }: + +let + pname = "otfm"; + version = "0.3.0"; + webpage = "https://erratique.ch/software/${pname}"; +in + +assert lib.versionAtLeast ocaml.version "4.01.0"; + +stdenv.mkDerivation { + + name = "ocaml-${pname}-${version}"; + + src = fetchurl { + url = "${webpage}/releases/${pname}-${version}.tbz"; + sha256 = "054s82539k3kc9na6s47g3scsl04icjahpas7pv5351jmsgqcq3k"; + }; + + nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ]; + buildInputs = [ topkg ]; + + propagatedBuildInputs = [ uutf result ]; + + strictDeps = true; + + inherit (topkg) buildPhase installPhase; + + meta = with lib; { + description = "OpenType font decoder for OCaml"; + longDescription = '' + Otfm is an in-memory decoder for the OpenType font data format. It + provides low-level access to font tables and functions to decode some + of them. + ''; + homepage = webpage; + platforms = ocaml.meta.platforms or []; + license = licenses.bsd3; + maintainers = [ maintainers.jirkamarsik ]; + }; +} diff --git a/pkgs/development/ocaml-modules/otoml/default.nix b/pkgs/development/ocaml-modules/otoml/default.nix new file mode 100644 index 00000000000..c3f53fc611e --- /dev/null +++ b/pkgs/development/ocaml-modules/otoml/default.nix @@ -0,0 +1,34 @@ +{ lib, fetchFromGitHub, buildDunePackage +, menhir +, menhirLib +, uutf +}: + +buildDunePackage rec { + pname = "otoml"; + version = "0.9.0"; + + useDune2 = true; + + minimalOCamlVersion = "4.08"; + + src = fetchFromGitHub { + owner = "dmbaturin"; + repo = pname; + rev = version; + sha256 = "0l0c60rzgk11y8xq05kr8q9hkzb3c8vi995mq84x98ys73wb42j3"; + }; + + strictDeps = true; + + nativeBuildInputs = [ menhir ]; + + propagatedBuildInputs = [ menhirLib uutf ]; + + meta = { + description = "A TOML parsing and manipulation library for OCaml"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.vbgl ]; + inherit (src.meta) homepage; + }; +} diff --git a/pkgs/development/ocaml-modules/otr/default.nix b/pkgs/development/ocaml-modules/otr/default.nix new file mode 100644 index 00000000000..d2ed78d51b8 --- /dev/null +++ b/pkgs/development/ocaml-modules/otr/default.nix @@ -0,0 +1,29 @@ +{ lib, fetchurl, buildDunePackage +, cstruct, sexplib0, mirage-crypto, mirage-crypto-pk, astring, base64 +}: + +buildDunePackage rec { + pname = "otr"; + version = "0.3.10"; + + minimumOCamlVersion = "4.08"; + + src = fetchurl { + url = "https://github.com/hannesm/ocaml-otr/releases/download/v${version}/otr-v${version}.tbz"; + sha256 = "0dssc7p6s7z53n0mddyipjghzr8ld8bb7alaxqrx9gdpspwab1gq"; + }; + + useDune2 = true; + + propagatedBuildInputs = [ cstruct sexplib0 mirage-crypto mirage-crypto-pk + astring base64 ]; + + doCheck = true; + + meta = with lib; { + homepage = "https://github.com/hannesm/ocaml-otr"; + description = "Off-the-record messaging protocol, purely in OCaml"; + license = licenses.bsd2; + maintainers = with maintainers; [ sternenseemann ]; + }; +} diff --git a/pkgs/development/ocaml-modules/ounit/default.nix b/pkgs/development/ocaml-modules/ounit/default.nix new file mode 100644 index 00000000000..a40111cd3b3 --- /dev/null +++ b/pkgs/development/ocaml-modules/ounit/default.nix @@ -0,0 +1,18 @@ +{ stdenv, ocaml, findlib, ounit2 }: + +stdenv.mkDerivation { + pname = "ocaml${ocaml.version}-ounit"; + inherit (ounit2) version src meta; + + nativeBuildInputs = [ findlib ]; + propagatedBuildInputs = [ ounit2 ]; + + strictDeps = true; + + dontBuild = true; + + createFindlibDestdir = true; + + installTargets = "install-ounit version='${ounit2.version}'"; + +} diff --git a/pkgs/development/ocaml-modules/ounit2/default.nix b/pkgs/development/ocaml-modules/ounit2/default.nix new file mode 100644 index 00000000000..0b68609584d --- /dev/null +++ b/pkgs/development/ocaml-modules/ounit2/default.nix @@ -0,0 +1,27 @@ +{ lib, ocaml, buildDunePackage, fetchurl, stdlib-shims, ncurses }: + +buildDunePackage rec { + minimumOCamlVersion = "4.04"; + + pname = "ounit2"; + version = "2.2.4"; + + useDune2 = lib.versionAtLeast ocaml.version "4.08"; + + src = fetchurl { + url = "https://github.com/gildor478/ounit/releases/download/v${version}/ounit-v${version}.tbz"; + sha256 = "0i9kiqbf2dp12c4qcvbn4abdpdp6h4g5z54ycsh0q8jpv6jnkh5m"; + }; + + propagatedBuildInputs = [ stdlib-shims ]; + + doCheck = true; + checkInputs = lib.optional (lib.versionOlder ocaml.version "4.07") ncurses; + + meta = with lib; { + homepage = "https://github.com/gildor478/ounit"; + description = "A unit test framework for OCaml"; + license = licenses.mit; + maintainers = with maintainers; [ sternenseemann ]; + }; +} diff --git a/pkgs/development/ocaml-modules/owee/default.nix b/pkgs/development/ocaml-modules/owee/default.nix new file mode 100644 index 00000000000..7b15437a7ed --- /dev/null +++ b/pkgs/development/ocaml-modules/owee/default.nix @@ -0,0 +1,20 @@ +{ lib, buildDunePackage, fetchurl }: + +buildDunePackage rec { + minimalOCamlVersion = "4.06"; + useDune2 = true; + pname = "owee"; + version = "0.4"; + + src = fetchurl { + url = "https://github.com/let-def/owee/releases/download/v${version}/owee-${version}.tbz"; + sha256 = "sha256:055bi0yfdki1pqagbhrwmfvigyawjgsmqw04zhpp6hds8513qzvb"; + }; + + meta = { + description = "An experimental OCaml library to work with DWARF format"; + homepage = "https://github.com/let-def/owee/"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/owl-base/default.nix b/pkgs/development/ocaml-modules/owl-base/default.nix new file mode 100644 index 00000000000..b767b1db24c --- /dev/null +++ b/pkgs/development/ocaml-modules/owl-base/default.nix @@ -0,0 +1,24 @@ +{ lib, buildDunePackage, fetchurl }: + +buildDunePackage rec { + pname = "owl-base"; + version = "1.0.1"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/owlbarn/owl/releases/download/${version}/owl-${version}.tbz"; + sha256 = "72ca9f6edd302fdfa16c7559cedac7ac2c885466a367e17ea1ea8807b2dd13ef"; + }; + + minimumOCamlVersion = "4.10"; + + meta = with lib; { + description = "Numerical computing library for Ocaml"; + homepage = "https://ocaml.xyz"; + changelog = "https://github.com/owlbarn/owl/releases"; + platforms = platforms.x86_64; + maintainers = [ maintainers.bcdarwin ]; + license = licenses.mit; + }; +} diff --git a/pkgs/development/ocaml-modules/owl/default.nix b/pkgs/development/ocaml-modules/owl/default.nix new file mode 100644 index 00000000000..980efd3bf5c --- /dev/null +++ b/pkgs/development/ocaml-modules/owl/default.nix @@ -0,0 +1,26 @@ +{ stdenv +, buildDunePackage +, dune-configurator +, fetchFromGitHub +, alcotest +, eigen +, stdio +, openblasCompat +, owl-base +, npy +}: + + +buildDunePackage rec { + pname = "owl"; + + inherit (owl-base) version src meta useDune2; + + checkInputs = [ alcotest ]; + buildInputs = [ dune-configurator stdio ]; + propagatedBuildInputs = [ + eigen openblasCompat owl-base npy + ]; + + doCheck = !stdenv.isDarwin; # https://github.com/owlbarn/owl/issues/462 +} diff --git a/pkgs/development/ocaml-modules/paf/cohttp.nix b/pkgs/development/ocaml-modules/paf/cohttp.nix new file mode 100644 index 00000000000..b1a6321032c --- /dev/null +++ b/pkgs/development/ocaml-modules/paf/cohttp.nix @@ -0,0 +1,53 @@ +{ lib +, buildDunePackage +, paf +, cohttp-lwt +, domain-name +, httpaf +, ipaddr +, alcotest-lwt +, fmt +, logs +, mirage-crypto-rng +, mirage-time-unix +, tcpip +, uri +, lwt +, astring +}: + +buildDunePackage { + pname = "paf-cohttp"; + + inherit (paf) + version + src + useDune2 + minimumOCamlVersion + ; + + propagatedBuildInputs = [ + paf + cohttp-lwt + domain-name + httpaf + ipaddr + ]; + + doCheck = false; # tests fail + checkInputs = [ + alcotest-lwt + fmt + logs + mirage-crypto-rng + mirage-time-unix + tcpip + uri + lwt + astring + ]; + + meta = paf.meta // { + description = "A CoHTTP client with its HTTP/AF implementation"; + }; +} diff --git a/pkgs/development/ocaml-modules/paf/default.nix b/pkgs/development/ocaml-modules/paf/default.nix new file mode 100644 index 00000000000..05d0edcebd4 --- /dev/null +++ b/pkgs/development/ocaml-modules/paf/default.nix @@ -0,0 +1,70 @@ +{ buildDunePackage +, lib +, fetchurl +, fetchpatch +, mirage-stack +, mirage-time +, h2 +, tls-mirage +, mimic +, ke +, bigstringaf +, faraday +, tls +, lwt +, logs +, fmt +, mirage-crypto-rng +, tcpip +, mirage-time-unix +, ptime +, uri +, alcotest-lwt +, cstruct +}: + +buildDunePackage rec { + pname = "paf"; + version = "0.0.8"; + + src = fetchurl { + url = "https://github.com/dinosaure/paf-le-chien/releases/download/${version}/paf-${version}.tbz"; + sha256 = "CyIIV11G7oUPPHuhov52LP4Ih4pY6bcUApD23/9q39k="; + }; + + useDune2 = true; + minimumOCamlVersion = "4.08"; + + propagatedBuildInputs = [ + mirage-stack + mirage-time + h2 + tls-mirage + mimic + ke + bigstringaf + faraday + tls + cstruct + tcpip + ]; + + doCheck = false; + checkInputs = [ + lwt + logs + fmt + mirage-crypto-rng + mirage-time-unix + ptime + uri + alcotest-lwt + ]; + + meta = { + description = "HTTP/AF and MirageOS"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.sternenseemann ]; + homepage = "https://github.com/dinosaure/paf-le-chien"; + }; +} diff --git a/pkgs/development/ocaml-modules/paf/le.nix b/pkgs/development/ocaml-modules/paf/le.nix new file mode 100644 index 00000000000..06a8d9b51eb --- /dev/null +++ b/pkgs/development/ocaml-modules/paf/le.nix @@ -0,0 +1,41 @@ +{ lib +, buildDunePackage +, paf +, duration +, emile +, httpaf +, letsencrypt +, mirage-stack +, mirage-time +, tls-mirage +, x509 +}: + +buildDunePackage { + pname = "paf-le"; + + inherit (paf) + version + src + useDune2 + minimumOCamlVersion + ; + + propagatedBuildInputs = [ + paf + duration + emile + httpaf + letsencrypt + mirage-stack + mirage-time + tls-mirage + x509 + ]; + + doCheck = true; + + meta = paf.meta // { + description = "A CoHTTP client with its HTTP/AF implementation"; + }; +} diff --git a/pkgs/development/ocaml-modules/parany/default.nix b/pkgs/development/ocaml-modules/parany/default.nix new file mode 100644 index 00000000000..4f072391deb --- /dev/null +++ b/pkgs/development/ocaml-modules/parany/default.nix @@ -0,0 +1,25 @@ +{ lib, buildDunePackage, fetchFromGitHub, ocamlnet, cpu }: + +buildDunePackage rec { + pname = "parany"; + version = "12.1.2"; + + useDune2 = true; + minimumOCamlVersion = "4.03.0"; + + src = fetchFromGitHub { + owner = "UnixJunkie"; + repo = pname; + rev = "v${version}"; + sha256 = "yOeJzb2Wr6jA4efI9/fuqDCl/Tza3zxT3YjAiJmhHHg="; + }; + + propagatedBuildInputs = [ ocamlnet cpu ]; + + meta = with lib; { + inherit (src.meta) homepage; + description = "Generalized map/reduce for multicore computing"; + maintainers = [ maintainers.bcdarwin ]; + license = licenses.lgpl2; + }; +} diff --git a/pkgs/development/ocaml-modules/parmap/default.nix b/pkgs/development/ocaml-modules/parmap/default.nix new file mode 100644 index 00000000000..521c1c40671 --- /dev/null +++ b/pkgs/development/ocaml-modules/parmap/default.nix @@ -0,0 +1,28 @@ +{ lib, fetchurl, buildDunePackage, dune-configurator }: + +buildDunePackage rec { + pname = "parmap"; + version = "1.2.4"; + + src = fetchurl { + url = "https://github.com/rdicosmo/${pname}/releases/download/${version}/${pname}-${version}.tbz"; + sha256 = "sha256-BTkSEjIK3CVNloJACFo6eQ6Ob9o/cdrA9xuv87NKas4="; + }; + + minimalOCamlVersion = "4.03"; + useDune2 = true; + + buildInputs = [ + dune-configurator + ]; + + doCheck = true; + + meta = with lib; { + description = "Library for multicore parallel programming"; + downloadPage = "https://github.com/rdicosmo/parmap"; + homepage = "https://rdicosmo.github.io/parmap"; + license = licenses.lgpl2; + maintainers = with maintainers; [ bcdarwin ]; + }; +} diff --git a/pkgs/development/ocaml-modules/parse-argv/default.nix b/pkgs/development/ocaml-modules/parse-argv/default.nix new file mode 100644 index 00000000000..4bc409245ee --- /dev/null +++ b/pkgs/development/ocaml-modules/parse-argv/default.nix @@ -0,0 +1,30 @@ +{ lib, fetchurl, buildDunePackage, ocaml +, astring +, ounit +}: + +buildDunePackage rec { + pname = "parse-argv"; + version = "0.2.0"; + + useDune2 = true; + + minimumOCamlVersion = "4.03"; + + src = fetchurl { + url = "https://github.com/mirage/parse-argv/releases/download/v${version}/parse-argv-v${version}.tbz"; + sha256 = "06dl04fcmwpkydzni2fzwrhk0bqypd55mgxfax9v82x65xrgj5gw"; + }; + + propagatedBuildInputs = [ astring ]; + + doCheck = lib.versionAtLeast ocaml.version "4.04"; + checkInputs = [ ounit ]; + + meta = { + description = "Process strings into sets of command-line arguments"; + homepage = "https://github.com/mirage/parse-argv"; + license = lib.licenses.isc; + maintainers = [ lib.maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/path_glob/default.nix b/pkgs/development/ocaml-modules/path_glob/default.nix new file mode 100644 index 00000000000..ed6363bad26 --- /dev/null +++ b/pkgs/development/ocaml-modules/path_glob/default.nix @@ -0,0 +1,17 @@ +{ lib, buildDunePackage, fetchurl }: + +buildDunePackage rec { + pname = "path_glob"; + version = "0.2"; + useDune2 = true; + src = fetchurl { + url = "https://gasche.gitlab.io/path_glob/releases/path_glob-${version}.tbz"; + sha256 = "01ra20bzjiihbgma74axsp70gqmid6x7jmiizg48mdkni0aa42ay"; + }; + + meta = { + homepage = "https://gitlab.com/gasche/path_glob"; + description = "Checking glob patterns on paths"; + license = lib.licenses.lgpl2Only; + }; +} diff --git a/pkgs/development/ocaml-modules/pbkdf/default.nix b/pkgs/development/ocaml-modules/pbkdf/default.nix new file mode 100644 index 00000000000..1ecf213f6d3 --- /dev/null +++ b/pkgs/development/ocaml-modules/pbkdf/default.nix @@ -0,0 +1,30 @@ +{ lib +, buildDunePackage +, fetchurl +, mirage-crypto +, alcotest +}: + +buildDunePackage rec { + pname = "pbkdf"; + version = "1.1.0"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/abeaumont/ocaml-pbkdf/releases/download/${version}/pbkdf-${version}.tbz"; + sha256 = "e53ed1bd9abf490c858a341c10fb548bc9ad50d4479acdf95a9358a73d042264"; + }; + + propagatedBuildInputs = [ mirage-crypto ]; + checkInputs = [ alcotest ]; + doCheck = true; + + meta = { + description = "Password based key derivation functions (PBKDF) from PKCS#5"; + maintainers = [ lib.maintainers.sternenseemann ]; + license = lib.licenses.bsd2; + homepage = "https://github.com/abeaumont/ocaml-pbkdf"; + }; +} + diff --git a/pkgs/development/ocaml-modules/pcap-format/default.nix b/pkgs/development/ocaml-modules/pcap-format/default.nix new file mode 100644 index 00000000000..f8bb6f4f6b2 --- /dev/null +++ b/pkgs/development/ocaml-modules/pcap-format/default.nix @@ -0,0 +1,41 @@ +{ lib, buildDunePackage, fetchurl +, ppx_cstruct, ppx_tools +, cstruct, ounit, mmap +}: + +buildDunePackage rec { + pname = "pcap-format"; + version = "0.5.2"; + + minimumOCamlVersion = "4.03"; + + # due to cstruct + useDune2 = true; + + src = fetchurl { + url = "https://github.com/mirage/ocaml-pcap/releases/download/${version}/${pname}-${version}.tbz"; + sha256 = "14c5rpgglyz41jic0fg0xa22d2w1syb86kva22y9fi7aqj9vm31f"; + }; + + nativeBuildInputs = [ + ppx_tools + ppx_cstruct + ]; + + propagatedBuildInputs = [ + cstruct + ]; + + doCheck = true; + checkInputs = [ + ounit + mmap + ]; + + meta = with lib; { + description = "Decode and encode PCAP (packet capture) files"; + homepage = "https://mirage.github.io/ocaml-pcap"; + license = licenses.isc; + maintainers = [ maintainers.sternenseemann ]; + }; +} diff --git a/pkgs/development/ocaml-modules/pcre/default.nix b/pkgs/development/ocaml-modules/pcre/default.nix new file mode 100644 index 00000000000..ea853c4648b --- /dev/null +++ b/pkgs/development/ocaml-modules/pcre/default.nix @@ -0,0 +1,26 @@ +{ lib, buildDunePackage, fetchurl, pcre, dune-configurator }: + +buildDunePackage rec { + pname = "pcre"; + version = "7.4.6"; + + useDune2 = true; + + minimalOCamlVersion = "4.08"; + + src = fetchurl { + url = "https://github.com/mmottl/pcre-ocaml/releases/download/${version}/pcre-${version}.tbz"; + sha256 = "17ajl0ra5xkxn5pf0m0zalylp44wsfy6mvcq213djh2pwznh4gya"; + }; + + buildInputs = [ dune-configurator ]; + + propagatedBuildInputs = [ pcre ]; + + meta = with lib; { + homepage = "https://mmottl.github.io/pcre-ocaml"; + description = "An efficient C-library for pattern matching with Perl-style regular expressions in OCaml"; + license = licenses.lgpl21Plus; + maintainers = with maintainers; [ maggesi vbmithr ]; + }; +} diff --git a/pkgs/development/ocaml-modules/pecu/default.nix b/pkgs/development/ocaml-modules/pecu/default.nix new file mode 100644 index 00000000000..22c1913635f --- /dev/null +++ b/pkgs/development/ocaml-modules/pecu/default.nix @@ -0,0 +1,26 @@ +{ lib, buildDunePackage, ocaml, fetchurl, fmt, alcotest, crowbar, astring }: + +buildDunePackage rec { + pname = "pecu"; + version = "0.6"; + + useDune2 = true; + + minimumOCamlVersion = "4.03"; + + src = fetchurl { + url = "https://github.com/mirage/pecu/releases/download/v${version}/pecu-v${version}.tbz"; + sha256 = "a9d2b7da444c83b20f879f6c3b7fc911d08ac1e6245ad7105437504f9394e5c7"; + }; + + # crowbar availability + doCheck = lib.versionAtLeast ocaml.version "4.08"; + checkInputs = [ fmt alcotest crowbar astring ]; + + meta = with lib; { + description = "Encoder/Decoder of Quoted-Printable (RFC2045 & RFC2047)"; + license = licenses.mit; + homepage = "https://github.com/mirage/pecu"; + maintainers = [ maintainers.sternenseemann ]; + }; +} diff --git a/pkgs/development/ocaml-modules/pgocaml/default.nix b/pkgs/development/ocaml-modules/pgocaml/default.nix new file mode 100644 index 00000000000..5c00f2c8991 --- /dev/null +++ b/pkgs/development/ocaml-modules/pgocaml/default.nix @@ -0,0 +1,26 @@ +{ lib, fetchFromGitHub, buildDunePackage +, calendar, csv, hex, ppx_deriving, ppx_sexp_conv, re, rresult, sexplib +}: + +buildDunePackage rec { + pname = "pgocaml"; + version = "4.2.2-dev-20210111"; + src = fetchFromGitHub { + owner = "darioteixeira"; + repo = "pgocaml"; + rev = "1bb0025deeb3d14029afdcc69aaa7847026e243e"; + sha256 = "11inbjf87gclc2xmpq56ag4cm4467y9q9hjgbdn69fa1bman2zn2"; + }; + + minimumOCamlVersion = "4.08"; + useDune2 = true; + + propagatedBuildInputs = [ calendar csv hex ppx_deriving ppx_sexp_conv re rresult sexplib ]; + + meta = with lib; { + description = "An interface to PostgreSQL databases for OCaml applications"; + inherit (src.meta) homepage; + license = licenses.lgpl2; + maintainers = with maintainers; [ vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/pgocaml/ppx.nix b/pkgs/development/ocaml-modules/pgocaml/ppx.nix new file mode 100644 index 00000000000..dce2e2b0c99 --- /dev/null +++ b/pkgs/development/ocaml-modules/pgocaml/ppx.nix @@ -0,0 +1,8 @@ +{ buildDunePackage, pgocaml, ppx_optcomp }: + +buildDunePackage { + pname = "pgocaml_ppx"; + inherit (pgocaml) src version useDune2 meta; + + propagatedBuildInputs = [ pgocaml ppx_optcomp ]; +} diff --git a/pkgs/development/ocaml-modules/pgsolver/default.nix b/pkgs/development/ocaml-modules/pgsolver/default.nix new file mode 100644 index 00000000000..a1d6fe6486a --- /dev/null +++ b/pkgs/development/ocaml-modules/pgsolver/default.nix @@ -0,0 +1,23 @@ +{ lib, fetchFromGitHub, buildOasisPackage, ounit, tcslib, ocaml-sat-solvers }: + +buildOasisPackage rec { + pname = "pgsolver"; + version = "4.1"; + + src = fetchFromGitHub { + owner = "tcsprojects"; + repo = "pgsolver"; + rev = "v${version}"; + sha256 = "16skrn8qql9djpray25xv66rjgfl20js5wqnxyq1763nmyizyj8a"; + }; + + buildInputs = [ ounit ]; + propagatedBuildInputs = [ tcslib ocaml-sat-solvers ]; + + meta = { + homepage = "https://github.com/tcsprojects/pgsolver"; + description = "A collection of tools for generating, manipulating and - most of all - solving parity games"; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ mgttlinger ]; + }; +} diff --git a/pkgs/development/ocaml-modules/phylogenetics/default.nix b/pkgs/development/ocaml-modules/phylogenetics/default.nix new file mode 100644 index 00000000000..1cb348a4165 --- /dev/null +++ b/pkgs/development/ocaml-modules/phylogenetics/default.nix @@ -0,0 +1,56 @@ +{ lib +, buildDunePackage +, fetchurl +, ppx_deriving +, bppsuite +, alcotest +, angstrom-unix +, biocaml +, core +, gsl +, lacaml +, menhir +, menhirLib +, printbox-text +}: + +buildDunePackage rec { + pname = "phylogenetics"; + version = "0.0.0"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/biocaml/phylogenetics/releases/download/v${version}/${pname}-${version}.tbz"; + sha256 = "sha256:0knfh2s0jfnsc0vsq5yw5xla7m7i98xd0qv512dyh3jhkh7m00l9"; + }; + + # Ensure compatibility with printbox ≥ 0.6 + preConfigure = '' + substituteInPlace lib/dune --replace printbox printbox-text + ''; + + minimalOCamlVersion = "4.08"; + + checkInputs = [ alcotest bppsuite ]; + buildInputs = [ menhir ]; + propagatedBuildInputs = [ + angstrom-unix + biocaml + core + gsl + lacaml + menhirLib + ppx_deriving + printbox-text + ]; + + doCheck = true; + + meta = with lib; { + homepage = "https://github.com/biocaml/phylogenetics"; + description = "Algorithms and datastructures for phylogenetics"; + maintainers = [ maintainers.bcdarwin ]; + license = licenses.cecill-b; + }; +} diff --git a/pkgs/development/ocaml-modules/piaf/default.nix b/pkgs/development/ocaml-modules/piaf/default.nix new file mode 100644 index 00000000000..5f1834c5f10 --- /dev/null +++ b/pkgs/development/ocaml-modules/piaf/default.nix @@ -0,0 +1,54 @@ +{ alcotest-lwt +, buildDunePackage +, dune-site +, fetchzip +, gluten-lwt-unix +, lib +, logs +, lwt_ssl +, magic-mime +, mrmime +, openssl +, pecu +, psq +, ssl +, uri +}: + +buildDunePackage rec { + pname = "piaf"; + version = "0.1.0"; + + src = fetchzip { + url = "https://github.com/anmonteiro/piaf/releases/download/${version}/piaf-${version}.tbz"; + sha256 = "0d431kz3bkwlgdamvsv94mzd9631ppcjpv516ii91glzlfdzh5hz"; + }; + + postPatch = '' + substituteInPlace ./vendor/dune --replace "mrmime.prettym" "prettym" + ''; + + useDune2 = true; + + propagatedBuildInputs = [ + logs + magic-mime + mrmime + psq + uri + gluten-lwt-unix + ]; + + checkInputs = [ + alcotest-lwt + dune-site + ]; + doCheck = true; + + meta = { + description = "An HTTP library with HTTP/2 support written entirely in OCaml"; + homepage = "https://github.com/anmonteiro/piaf"; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ anmonteiro ]; + }; +} diff --git a/pkgs/development/ocaml-modules/pipebang/default.nix b/pkgs/development/ocaml-modules/pipebang/default.nix new file mode 100644 index 00000000000..251aeb8de8e --- /dev/null +++ b/pkgs/development/ocaml-modules/pipebang/default.nix @@ -0,0 +1,26 @@ +{ lib, buildOcaml, fetchFromGitHub, camlp4 }: + +buildOcaml rec { + pname = "pipebang"; + version = "113.00.00"; + + minimumSupportedOcamlVersion = "4.00"; + + src = fetchFromGitHub { + owner = "janestreet"; + repo = "pipebang"; + rev = version; + sha256 = "sha256-9A3X/ciL5HtuKQ5awS+hDDBLL5ytOr12wHsmJLNRn+Q="; + }; + + strictDeps = true; + + buildInputs = [ camlp4 ]; + + meta = with lib; { + homepage = "https://github.com/janestreet/pipebang"; + description = "Syntax extension to transform x |! f into f x"; + license = licenses.asl20; + maintainers = [ maintainers.ericbmerritt ]; + }; +} diff --git a/pkgs/development/ocaml-modules/piqi-ocaml/default.nix b/pkgs/development/ocaml-modules/piqi-ocaml/default.nix new file mode 100644 index 00000000000..4f2e4693357 --- /dev/null +++ b/pkgs/development/ocaml-modules/piqi-ocaml/default.nix @@ -0,0 +1,34 @@ +{ lib, stdenv, fetchFromGitHub, fetchpatch, ocaml, findlib, piqi, stdlib-shims }: + +stdenv.mkDerivation rec { + version = "0.7.7"; + pname = "piqi-ocaml"; + name = "ocaml${ocaml.version}-${pname}-${version}"; + + src = fetchFromGitHub { + owner = "alavrik"; + repo = pname; + rev = "v${version}"; + sha256 = "1913jpsb8mvqi8609j4g4sm5jhg50dq0xqxgy8nmvknfryyc89nm"; + }; + + nativeBuildInputs = [ ocaml findlib ]; + buildInputs = [ piqi stdlib-shims ]; + + strictDeps = true; + + createFindlibDestdir = true; + + installPhase = '' + runHook preInstall + DESTDIR=$out make install + runHook postInstall + ''; + + meta = with lib; { + homepage = "https://piqi.org"; + description = "Universal schema language and a collection of tools built around it. These are the ocaml bindings"; + license = licenses.asl20; + maintainers = [ maintainers.maurer ]; + }; +} diff --git a/pkgs/development/ocaml-modules/piqi/default.nix b/pkgs/development/ocaml-modules/piqi/default.nix new file mode 100644 index 00000000000..45d65a5be04 --- /dev/null +++ b/pkgs/development/ocaml-modules/piqi/default.nix @@ -0,0 +1,34 @@ +{ lib, stdenv, fetchFromGitHub, ocaml, findlib, which, sedlex_2, easy-format, xmlm, base64 }: + +stdenv.mkDerivation rec { + version = "0.6.15"; + pname = "piqi"; + name = "ocaml${ocaml.version}-${pname}-${version}"; + + src = fetchFromGitHub { + owner = "alavrik"; + repo = pname; + rev = "v${version}"; + sha256 = "0v04hs85xv6d4ysqxyv1dik34dx49yab9shpi4x7iv19qlzl7csb"; + }; + + nativeBuildInputs = [ ocaml findlib which ]; + propagatedBuildInputs = [ sedlex_2 xmlm easy-format base64 ]; + + strictDeps = true; + + patches = [ ./no-ocamlpath-override.patch ]; + + createFindlibDestdir = true; + + postBuild = "make -C piqilib piqilib.cma"; + + installTargets = [ "install" "ocaml-install" ]; + + meta = with lib; { + homepage = "https://piqi.org"; + description = "Universal schema language and a collection of tools built around it"; + license = licenses.asl20; + maintainers = [ maintainers.maurer ]; + }; +} diff --git a/pkgs/development/ocaml-modules/piqi/no-ocamlpath-override.patch b/pkgs/development/ocaml-modules/piqi/no-ocamlpath-override.patch new file mode 100644 index 00000000000..bf85a42551c --- /dev/null +++ b/pkgs/development/ocaml-modules/piqi/no-ocamlpath-override.patch @@ -0,0 +1,17 @@ +diff -rupN piqi-0.6.12.orig/make/Makefile.ocaml piqi-0.6.12/make/Makefile.ocaml +--- piqi-0.6.12.orig/make/Makefile.ocaml 2015-03-13 13:35:19.000000000 +0100 ++++ piqi-0.6.12/make/Makefile.ocaml 2015-06-10 21:19:57.231000000 +0200 +@@ -1,13 +1,5 @@ + OCAMLMAKEFILE := $(PIQI_ROOT)/make/OCamlMakefile + +- +-OCAMLPATH := $(PIQI_BUILD)/lib/ocaml +-ifeq ($(SYSTEM),$(filter $(SYSTEM),mingw mingw64)) +-OCAMLPATH := $(shell cygpath -w $(OCAMLPATH)) +-endif +-export OCAMLPATH +- +- + # make sure camlp4o produces pretty-printed text instead of AST + export CAMLP4_O = $(CAMLP4)o -printer o + diff --git a/pkgs/development/ocaml-modules/posix/base.nix b/pkgs/development/ocaml-modules/posix/base.nix new file mode 100644 index 00000000000..a6fe690ebcc --- /dev/null +++ b/pkgs/development/ocaml-modules/posix/base.nix @@ -0,0 +1,26 @@ +{ lib, buildDunePackage, fetchFromGitHub +, ctypes, integers +}: + +buildDunePackage rec { + pname = "posix-base"; + version = "2.0.0"; + + src = fetchFromGitHub { + owner = "savonet"; + repo = "ocaml-posix"; + rev = "v${version}"; + sha256 = "18px8hfqcfy2lk8105ki3hrxxigs44gs046ba0fqda6wzd0hr82b"; + }; + + useDune2 = true; + + propagatedBuildInputs = [ ctypes integers ]; + + meta = { + homepage = "https://www.liquidsoap.info/ocaml-posix/"; + description = "Base module for the posix bindings"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/posix/socket.nix b/pkgs/development/ocaml-modules/posix/socket.nix new file mode 100644 index 00000000000..69a469bbece --- /dev/null +++ b/pkgs/development/ocaml-modules/posix/socket.nix @@ -0,0 +1,16 @@ +{ lib, buildDunePackage, posix-base }: + +buildDunePackage { + pname = "posix-socket"; + + inherit (posix-base) version src useDune2; + + propagatedBuildInputs = [ posix-base ]; + + doCheck = true; + + meta = posix-base.meta // { + description = "Bindings for posix sockets"; + }; + +} diff --git a/pkgs/development/ocaml-modules/posix/types.nix b/pkgs/development/ocaml-modules/posix/types.nix new file mode 100644 index 00000000000..2512fe892c1 --- /dev/null +++ b/pkgs/development/ocaml-modules/posix/types.nix @@ -0,0 +1,15 @@ +{ lib, buildDunePackage, posix-base }: + +buildDunePackage { + pname = "posix-types"; + + inherit (posix-base) version src useDune2; + + minimumOCamlVersion = "4.03"; + + propagatedBuildInputs = [ posix-base ]; + + meta = posix-base.meta // { + description = "Bindings for the types defined in <sys/types.h>"; + }; +} diff --git a/pkgs/development/ocaml-modules/postgresql/default.nix b/pkgs/development/ocaml-modules/postgresql/default.nix new file mode 100644 index 00000000000..a63876ec5bb --- /dev/null +++ b/pkgs/development/ocaml-modules/postgresql/default.nix @@ -0,0 +1,26 @@ +{ lib, fetchFromGitHub, buildDunePackage, dune-configurator, postgresql }: + +buildDunePackage rec { + pname = "postgresql"; + version = "5.0.0"; + + useDune2 = true; + + minimumOCamlVersion = "4.08"; + + src = fetchFromGitHub { + owner = "mmottl"; + repo = "postgresql-ocaml"; + rev = version; + sha256 = "1i4pnh2v00i0s7s9pcwz1x6s4xcd77d08gjjkvy0fmda6mqq6ghn"; + }; + + buildInputs = [ dune-configurator postgresql ]; + + meta = { + description = "Bindings to the PostgreSQL library"; + license = lib.licenses.lgpl21Plus; + maintainers = with lib.maintainers; [ bcc32 ]; + homepage = "https://mmottl.github.io/postgresql-ocaml"; + }; +} diff --git a/pkgs/development/ocaml-modules/pp/default.nix b/pkgs/development/ocaml-modules/pp/default.nix new file mode 100644 index 00000000000..70c509ec22c --- /dev/null +++ b/pkgs/development/ocaml-modules/pp/default.nix @@ -0,0 +1,28 @@ +{ buildDunePackage +, fetchzip +, ppx_expect +, lib +}: + +buildDunePackage rec { + pname = "pp"; + version = "1.1.2"; + + src = fetchzip { + url = "https://github.com/ocaml-dune/pp/releases/download/${version}/pp-${version}.tbz"; + sha256 = "1l1im054pxrkj7zk8m6yj4qfdpxkajpjfvy818ggf0j4nxkaihc5"; + }; + + useDune2 = true; + minimalOCamlVersion = "4.08"; + + checkInputs = [ ppx_expect ]; + doCheck = true; + + meta = with lib; { + description = "A an alternative pretty printing library to the Format module of the OCaml standard library"; + license = licenses.mit; + platforms = platforms.unix; + maintainers = with maintainers; [ symphorien ]; + }; +} diff --git a/pkgs/development/ocaml-modules/pprint/default.nix b/pkgs/development/ocaml-modules/pprint/default.nix new file mode 100644 index 00000000000..e0c5c269767 --- /dev/null +++ b/pkgs/development/ocaml-modules/pprint/default.nix @@ -0,0 +1,22 @@ +{ lib, fetchFromGitHub, buildDunePackage }: + +buildDunePackage rec { + pname = "pprint"; + version = "20220103"; + + useDune2 = true; + + src = fetchFromGitHub { + owner = "fpottier"; + repo = pname; + rev = version; + sha256 = "sha256:09y6nwnjldifm47406q1r9987njlk77g4ifqg6qs54dckhr64vax"; + }; + + meta = with lib; { + inherit (src.meta) homepage; + description = "An OCaml library for pretty-printing textual documents"; + license = licenses.lgpl2Only; + maintainers = [ maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/ppx_bap/default.nix b/pkgs/development/ocaml-modules/ppx_bap/default.nix new file mode 100644 index 00000000000..f0a223c3db7 --- /dev/null +++ b/pkgs/development/ocaml-modules/ppx_bap/default.nix @@ -0,0 +1,51 @@ +{ lib, buildDunePackage +, fetchFromGitHub +, ppx_assert +, ppx_bench +, ppx_bin_prot +, ppx_compare +, ppx_enumerate +, ppx_hash +, ppx_here +, ppx_optcomp +, ppx_sexp_conv +, ppx_sexp_value +}: + +buildDunePackage rec { + pname = "ppx_bap"; + version = "0.14"; + useDune2 = true; + + minimumOCamlVersion = "4.07"; + + src = fetchFromGitHub { + owner = "BinaryAnalysisPlatform"; + repo = pname; + rev = "v${version}"; + sha256 = "1c6rcdp8bicdiwqc2mb59cl9l2vxlp3y8hmnr9x924fq7acly248"; + }; + + buildInputs = [ + ppx_optcomp + ppx_sexp_value + ]; + + propagatedBuildInputs = [ + ppx_assert + ppx_bench + ppx_bin_prot + ppx_compare + ppx_enumerate + ppx_hash + ppx_here + ppx_sexp_conv + ]; + + meta = { + description = "The set of ppx rewriters for BAP"; + license = lib.licenses.mit; + inherit (src.meta) homepage; + maintainers = [ lib.maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/ppx_blob/default.nix b/pkgs/development/ocaml-modules/ppx_blob/default.nix new file mode 100644 index 00000000000..ac96e56d04e --- /dev/null +++ b/pkgs/development/ocaml-modules/ppx_blob/default.nix @@ -0,0 +1,23 @@ +{ lib, fetchurl, buildDunePackage, ocaml, alcotest, ppxlib }: + +buildDunePackage rec { + pname = "ppx_blob"; + version = "0.7.2"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/johnwhitington/${pname}/releases/download/${version}/ppx_blob-${version}.tbz"; + sha256 = "00haz1cmplk3j9ysh6j656zrldy60585fmlndmfhpd5332mxrfdw"; + }; + + checkInputs = [ alcotest ]; + propagatedBuildInputs = [ ppxlib ]; + doCheck = lib.versionAtLeast ocaml.version "4.05"; + + meta = with lib; { + homepage = "https://github.com/johnwhitington/ppx_blob"; + description = "OCaml ppx to include binary data from a file as a string"; + license = licenses.unlicense; + }; +} diff --git a/pkgs/development/ocaml-modules/ppx_cstubs/default.nix b/pkgs/development/ocaml-modules/ppx_cstubs/default.nix new file mode 100644 index 00000000000..f4794eea76e --- /dev/null +++ b/pkgs/development/ocaml-modules/ppx_cstubs/default.nix @@ -0,0 +1,52 @@ +{ lib +, fetchFromGitHub +, buildDunePackage +, bigarray-compat +, containers +, cppo +, ctypes +, integers +, num +, ppxlib +, re +, findlib +}: + +buildDunePackage rec { + pname = "ppx_cstubs"; + version = "0.6.1.2"; + + minimalOCamlVersion = "4.08"; + + useDune2 = true; + + src = fetchFromGitHub { + owner = "fdopen"; + repo = "ppx_cstubs"; + rev = version; + sha256 = "15cjb9ygnvp2kv85rrb7ncz7yalifyl7wd2hp2cl8r1qrpgi1d0w"; + }; + + nativeBuildInputs = [ cppo ]; + + buildInputs = [ + bigarray-compat + containers + ctypes + integers + num + ppxlib + re + findlib + ]; + + strictDeps = true; + + meta = with lib; { + homepage = "https://github.com/fdopen/ppx_cstubs"; + changelog = "https://github.com/fdopen/ppx_cstubs/raw/${version}/CHANGES.md"; + description = "Preprocessor for easier stub generation with ocaml-ctypes"; + license = licenses.lgpl21Plus; + maintainers = [ maintainers.osener ]; + }; +} diff --git a/pkgs/development/ocaml-modules/ppx_derivers/default.nix b/pkgs/development/ocaml-modules/ppx_derivers/default.nix new file mode 100644 index 00000000000..84dda38846f --- /dev/null +++ b/pkgs/development/ocaml-modules/ppx_derivers/default.nix @@ -0,0 +1,24 @@ +{ lib, fetchFromGitHub, buildDunePackage, ocaml }: + +buildDunePackage rec { + pname = "ppx_derivers"; + version = "1.2.1"; + + useDune2 = lib.versionAtLeast ocaml.version "4.08"; + + minimumOCamlVersion = "4.02"; + + src = fetchFromGitHub { + owner = "diml"; + repo = pname; + rev = version; + sha256 = "0yqvqw58hbx1a61wcpbnl9j30n495k23qmyy2xwczqs63mn2nkpn"; + }; + + meta = { + description = "Shared [@@deriving] plugin registry"; + license = lib.licenses.bsd3; + maintainers = [ lib.maintainers.vbgl ]; + inherit (src.meta) homepage; + }; +} diff --git a/pkgs/development/ocaml-modules/ppx_deriving/default.nix b/pkgs/development/ocaml-modules/ppx_deriving/default.nix new file mode 100644 index 00000000000..fbe484dea04 --- /dev/null +++ b/pkgs/development/ocaml-modules/ppx_deriving/default.nix @@ -0,0 +1,64 @@ +{ lib +, fetchurl +, buildDunePackage +, cppo +, ppxlib +, ppx_derivers +, result +, ounit +, ounit2 +, ocaml-migrate-parsetree +, ocaml-migrate-parsetree-2 +}: + +let params = + if lib.versionAtLeast ppxlib.version "0.20" then { + version = "5.2.1"; + sha256 = "11h75dsbv3rs03pl67hdd3lbim7wjzh257ij9c75fcknbfr5ysz9"; + useOMP2 = true; + } else if lib.versionAtLeast ppxlib.version "0.15" then { + version = "5.1"; + sha256 = "1i64fd7qrfzbam5hfbl01r0sx4iihsahcwqj13smmrjlnwi3nkxh"; + useOMP2 = false; + } else { + version = "5.0"; + sha256 = "0fkzrn4pdyvf1kl0nwvhqidq01pnq3ql8zk1jd56hb0cxaw851w3"; + useOMP2 = false; + } +; in + +buildDunePackage rec { + pname = "ppx_deriving"; + inherit (params) version; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/ocaml-ppx/ppx_deriving/releases/download/v${version}/ppx_deriving-v${version}.tbz"; + inherit (params) sha256; + }; + + # This currently fails with dune + strictDeps = false; + + nativeBuildInputs = [ cppo ]; + buildInputs = [ ppxlib ]; + propagatedBuildInputs = [ + (if params.useOMP2 + then ocaml-migrate-parsetree-2 + else ocaml-migrate-parsetree) + ppx_derivers + result + ]; + + doCheck = true; + checkInputs = [ + (if lib.versionAtLeast version "5.2" then ounit2 else ounit) + ]; + + meta = with lib; { + description = "deriving is a library simplifying type-driven code generation on OCaml >=4.02."; + maintainers = [ maintainers.maurer ]; + license = licenses.mit; + }; +} diff --git a/pkgs/development/ocaml-modules/ppx_deriving_cmdliner/default.nix b/pkgs/development/ocaml-modules/ppx_deriving_cmdliner/default.nix new file mode 100644 index 00000000000..412ef9568db --- /dev/null +++ b/pkgs/development/ocaml-modules/ppx_deriving_cmdliner/default.nix @@ -0,0 +1,41 @@ +{ lib +, buildDunePackage +, fetchFromGitHub +, alcotest +, cmdliner +, ppx_deriving +, ppxlib +}: + +buildDunePackage rec { + pname = "ppx_deriving_cmdliner"; + version = "0.6.0"; + + minimumOCamlVersion = "4.08"; + useDune2 = true; + + src = fetchFromGitHub { + owner = "hammerlab"; + repo = "ppx_deriving_cmdliner"; + rev = "v${version}"; + sha256 = "19l32y2wv64d1c7fvln07dg3bkf7wf5inzjxlff7lbabskdbbras"; + }; + + propagatedBuildInputs = [ + cmdliner + ppx_deriving + ppxlib + ]; + + doCheck = true; + checkInputs = [ + alcotest + ]; + + meta = with lib; { + description = "Ppx_deriving plugin for generating command line interfaces from types for OCaml"; + inherit (src.meta) homepage; + license = licenses.asl20; + maintainers = [ maintainers.romildo ]; + }; +} diff --git a/pkgs/development/ocaml-modules/ppx_deriving_protobuf/default.nix b/pkgs/development/ocaml-modules/ppx_deriving_protobuf/default.nix new file mode 100644 index 00000000000..6f23af44b94 --- /dev/null +++ b/pkgs/development/ocaml-modules/ppx_deriving_protobuf/default.nix @@ -0,0 +1,24 @@ +{ lib, fetchurl, buildDunePackage, cppo, ppx_deriving +, ppxlib +}: + +buildDunePackage rec { + pname = "ppx_deriving_protobuf"; + version = "3.0.0"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/ocaml-ppx/ppx_deriving_protobuf/releases/download/v${version}/ppx_deriving_protobuf-v${version}.tbz"; + sha256 = "1dc1vxnkd0cnrgac5v3zbaj2lq1d2w8118mp1cmsdxylp06yz1sj"; + }; + + buildInputs = [ cppo ppxlib ppx_deriving ]; + + meta = with lib; { + homepage = "https://github.com/ocaml-ppx/ppx_deriving_protobuf"; + description = "A Protocol Buffers codec generator for OCaml"; + license = licenses.mit; + maintainers = [ maintainers.vyorkin ]; + }; +} diff --git a/pkgs/development/ocaml-modules/ppx_deriving_rpc/default.nix b/pkgs/development/ocaml-modules/ppx_deriving_rpc/default.nix new file mode 100644 index 00000000000..b7d1986c30d --- /dev/null +++ b/pkgs/development/ocaml-modules/ppx_deriving_rpc/default.nix @@ -0,0 +1,21 @@ +{ lib, buildDunePackage, rpclib, alcotest, ppxlib, ppx_deriving, yojson }: + +buildDunePackage rec { + pname = "ppx_deriving_rpc"; + + inherit (rpclib) version useDune2 src; + + minimumOCamlVersion = "4.08"; + + propagatedBuildInputs = [ ppxlib rpclib ppx_deriving ]; + + checkInputs = [ alcotest yojson ]; + doCheck = true; + + meta = with lib; { + homepage = "https://github.com/mirage/ocaml-rpc"; + description = "Ppx deriver for ocaml-rpc"; + license = licenses.isc; + maintainers = [ maintainers.vyorkin ]; + }; +} diff --git a/pkgs/development/ocaml-modules/ppx_deriving_yaml/default.nix b/pkgs/development/ocaml-modules/ppx_deriving_yaml/default.nix new file mode 100644 index 00000000000..0dfd8edd573 --- /dev/null +++ b/pkgs/development/ocaml-modules/ppx_deriving_yaml/default.nix @@ -0,0 +1,29 @@ +{ lib, buildDunePackage, fetchurl, ppxlib, alcotest +, ppx_deriving, yaml +}: + +buildDunePackage rec { + pname = "ppx_deriving_yaml"; + version = "0.1.0"; + + useDune2 = true; + + minimalOCamlVersion = "4.08"; + + src = fetchurl { + url = "https://github.com/patricoferris/ppx_deriving_yaml/releases/download/v${version}/ppx_deriving_yaml-v${version}.tbz"; + sha256 = "kdonUD4Y8QhVSAFAafIpXBFPkS4pSScYwJbaWMn/6pA="; + }; + + propagatedBuildInputs = [ ppxlib ppx_deriving yaml ]; + + doCheck = true; + checkInputs = [ alcotest ]; + + meta = { + description = "A YAML codec generator for OCaml"; + homepage = "https://github.com/patricoferris/ppx_deriving_yaml"; + license = lib.licenses.isc; + maintainers = [ ]; + }; +} diff --git a/pkgs/development/ocaml-modules/ppx_deriving_yojson/default.nix b/pkgs/development/ocaml-modules/ppx_deriving_yojson/default.nix new file mode 100644 index 00000000000..bef60b3f381 --- /dev/null +++ b/pkgs/development/ocaml-modules/ppx_deriving_yojson/default.nix @@ -0,0 +1,31 @@ +{ lib, buildDunePackage, fetchFromGitHub, ppxlib, ounit +, ppx_deriving, yojson +}: + +buildDunePackage rec { + pname = "ppx_deriving_yojson"; + version = "3.6.1"; + + useDune2 = true; + + minimumOCamlVersion = "4.07"; + + src = fetchFromGitHub { + owner = "ocaml-ppx"; + repo = "ppx_deriving_yojson"; + rev = "v${version}"; + sha256 = "1icz5h6p3pfj7my5gi7wxpflrb8c902dqa17f9w424njilnpyrbk"; + }; + + propagatedBuildInputs = [ ppxlib ppx_deriving yojson ]; + + doCheck = true; + checkInputs = [ ounit ]; + + meta = { + description = "A Yojson codec generator for OCaml >= 4.04"; + inherit (src.meta) homepage; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/ppx_gen_rec/default.nix b/pkgs/development/ocaml-modules/ppx_gen_rec/default.nix new file mode 100644 index 00000000000..ee801f6adfd --- /dev/null +++ b/pkgs/development/ocaml-modules/ppx_gen_rec/default.nix @@ -0,0 +1,23 @@ +{ lib, fetchurl, buildDunePackage, ppxlib }: + +buildDunePackage rec { + pname = "ppx_gen_rec"; + version = "2.0.0"; + + src = fetchurl { + url = "https://github.com/flowtype/ocaml-${pname}/releases/download/v${version}/${pname}-v${version}.tbz"; + sha256 = "sha256-/mMj5UT22KQGVy1sjgEoOgPzyCYyeDPtWJYNDvQ9nlk="; + }; + + minimumOCamlVersion = "4.07"; + useDune2 = true; + + buildInputs = [ ppxlib ]; + + meta = with lib; { + homepage = "https://github.com/flowtype/ocaml-ppx_gen_rec"; + description = "A ppx rewriter that transforms a recursive module expression into a struct."; + license = licenses.mit; + maintainers = with maintainers; [ frontsideair ]; + }; +} diff --git a/pkgs/development/ocaml-modules/ppx_import/default.nix b/pkgs/development/ocaml-modules/ppx_import/default.nix new file mode 100644 index 00000000000..192e7258c4c --- /dev/null +++ b/pkgs/development/ocaml-modules/ppx_import/default.nix @@ -0,0 +1,43 @@ +{ lib +, fetchurl +, buildDunePackage +, ounit +, ppx_deriving +, ppx_sexp_conv +, ppxlib +}: + +lib.throwIfNot (lib.versionAtLeast ppxlib.version "0.24.0") + "ppx_import is not available with ppxlib-${ppxlib.version}" + +buildDunePackage rec { + pname = "ppx_import"; + version = "1.9.1"; + + useDune2 = true; + + minimalOCamlVersion = "4.05"; + + src = fetchurl { + url = "https://github.com/ocaml-ppx/ppx_import/releases/download/${version}/ppx_import-${version}.tbz"; + sha256 = "1li1f9b1i0yhjy655k74hgzhd05palz726zjbhwcy3iqxvi9id6i"; + }; + + propagatedBuildInputs = [ + ppxlib + ]; + + checkInputs = [ + ounit + ppx_deriving + ppx_sexp_conv + ]; + + doCheck = true; + + meta = { + description = "A syntax extension for importing declarations from interface files"; + license = lib.licenses.mit; + homepage = "https://github.com/ocaml-ppx/ppx_import"; + }; +} diff --git a/pkgs/development/ocaml-modules/ppx_tools/default.nix b/pkgs/development/ocaml-modules/ppx_tools/default.nix new file mode 100644 index 00000000000..9ec1c24dbe3 --- /dev/null +++ b/pkgs/development/ocaml-modules/ppx_tools/default.nix @@ -0,0 +1,78 @@ +{ lib, stdenv, fetchFromGitHub, buildDunePackage, ocaml, findlib, cppo }: + +let param = + let v6_5 = { + version = "6.5"; + sha256 = "sha256:0fwibah2hgllrnbdrmfqil5gr5raf6pb5h2zx6zs1h3d4ykvy8k8"; + useDune2 = true; + nativeBuildInputs = [cppo]; + buildInputs = [cppo]; + }; in +{ + "4.02" = { + version = "5.0+4.02.0"; + sha256 = "16drjk0qafjls8blng69qiv35a84wlafpk16grrg2i3x19p8dlj8"; }; + "4.03" = { + version = "5.0+4.03.0"; + sha256 = "061v1fl5z7z3ywi4ppryrlcywnvnqbsw83ppq72qmkc7ma4603jg"; }; + "4.04" = { + version = "unstable-20161114"; + rev = "49c08e2e4ea8fef88692cd1dcc1b38a9133f17ac"; + sha256 = "0ywzfkf5brj33nwh49k9if8x8v433ral25f3nbklfc9vqr06zrfl"; }; + "4.05" = { + version = "5.0+4.05.0"; + sha256 = "1jvvhk6wnkvm7b9zph309ihsc0hyxfpahmxxrq19vx8c674jsdm4"; }; + "4.06" = { + version = "5.1+4.06.0"; + sha256 = "1ww4cspdpgjjsgiv71s0im5yjkr3544x96wsq1vpdacq7dr7zwiw"; }; + "4.07" = { + version = "5.1+4.06.0"; + sha256 = "1ww4cspdpgjjsgiv71s0im5yjkr3544x96wsq1vpdacq7dr7zwiw"; }; + "4.08" = v6_5; + "4.09" = v6_5; + "4.10" = v6_5; + "4.11" = v6_5; + "4.12" = v6_5; + "4.13" = v6_5; + "4.14" = v6_5; +}.${ocaml.meta.branch}; +in + +let src = fetchFromGitHub { + owner = "alainfrisch"; + repo = pname; + rev = param.rev or param.version; + inherit (param) sha256; + }; + pname = "ppx_tools"; + meta = with lib; { + description = "Tools for authors of ppx rewriters"; + homepage = "https://www.lexifi.com/ppx_tools"; + license = licenses.mit; + maintainers = with maintainers; [ vbgl ]; + }; +in +if lib.versionAtLeast param.version "6.0" +then + buildDunePackage { + inherit pname src meta; + inherit (param) version useDune2 buildInputs nativeBuildInputs; + + strictDeps = true; + } +else + stdenv.mkDerivation { + name = "ocaml${ocaml.version}-${pname}-${param.version}"; + + inherit src; + + nativeBuildInputs = [ ocaml findlib ]; + + strictDeps = true; + + createFindlibDestdir = true; + + dontStrip = true; + + meta = meta // { inherit (ocaml.meta) platforms; }; + } diff --git a/pkgs/development/ocaml-modules/ppx_tools_versioned/default.nix b/pkgs/development/ocaml-modules/ppx_tools_versioned/default.nix new file mode 100644 index 00000000000..5200c13d89f --- /dev/null +++ b/pkgs/development/ocaml-modules/ppx_tools_versioned/default.nix @@ -0,0 +1,24 @@ +{ lib, fetchFromGitHub, buildDunePackage, ocaml-migrate-parsetree }: + +buildDunePackage rec { + pname = "ppx_tools_versioned"; + version = "5.4.0"; + + useDune2 = true; + + src = fetchFromGitHub { + owner = "ocaml-ppx"; + repo = pname; + rev = version; + sha256 = "07lnj4yzwvwyh5fhpp1dxrys4ddih15jhgqjn59pmgxinbnddi66"; + }; + + propagatedBuildInputs = [ ocaml-migrate-parsetree ]; + + meta = with lib; { + homepage = "https://github.com/let-def/ppx_tools_versioned"; + description = "Tools for authors of syntactic tools (such as ppx rewriters)"; + license = licenses.gpl2; + maintainers = [ maintainers.volth ]; + }; +} diff --git a/pkgs/development/ocaml-modules/ppx_yojson_conv_lib/default.nix b/pkgs/development/ocaml-modules/ppx_yojson_conv_lib/default.nix new file mode 100644 index 00000000000..07d817d2293 --- /dev/null +++ b/pkgs/development/ocaml-modules/ppx_yojson_conv_lib/default.nix @@ -0,0 +1,26 @@ +{ lib, buildDunePackage, fetchFromGitHub, yojson }: + +buildDunePackage rec { + pname = "ppx_yojson_conv_lib"; + version = "0.14.0"; + + useDune2 = true; + + minimumOCamlVersion = "4.02.3"; + + src = fetchFromGitHub { + owner = "janestreet"; + repo = pname; + rev = "v${version}"; + sha256 = "12s3xshayy1f8cp9lk6zqwnw60n7cdap55gkksz5w65gdd8bfxmf"; + }; + + propagatedBuildInputs = [ yojson ]; + + meta = with lib; { + description = "Runtime lib for ppx_yojson_conv"; + homepage = "https://github.com/janestreet/ppx_yojson_conv_lib"; + maintainers = [ maintainers.marsam ]; + license = licenses.mit; + }; +} diff --git a/pkgs/development/ocaml-modules/ppxlib/default.nix b/pkgs/development/ocaml-modules/ppxlib/default.nix new file mode 100644 index 00000000000..c5b2dd762ce --- /dev/null +++ b/pkgs/development/ocaml-modules/ppxlib/default.nix @@ -0,0 +1,85 @@ +{ lib, fetchFromGitHub, buildDunePackage, ocaml +, version ? + if lib.versionAtLeast ocaml.version "4.07" + then if lib.versionAtLeast ocaml.version "4.08" + then "0.24.0" else "0.15.0" else "0.13.0" +, ocaml-compiler-libs, ocaml-migrate-parsetree, ppx_derivers, stdio +, stdlib-shims, ocaml-migrate-parsetree-2 +}: + +let param = { + "0.8.1" = { + sha256 = "0vm0jajmg8135scbg0x60ivyy5gzv4abwnl7zls2mrw23ac6kml6"; + max_version = "4.10"; + useDune2 = false; + useOMP2 = false; + }; + "0.13.0" = { + sha256 = "0c54g22pm6lhfh3f7s5wbah8y48lr5lj3cqsbvgi99bly1b5vqvl"; + useDune2 = false; + useOMP2 = false; + }; + "0.15.0" = { + sha256 = "1p037kqj5858xrhh0dps6vbf4fnijla6z9fjz5zigvnqp4i2xkrn"; + min_version = "4.07"; + max_version = "4.12"; + useOMP2 = false; + }; + "0.18.0" = { + sha256 = "1ciy6va2gjrpjs02kha83pzh0x1gkmfsfsdgabbs1v14a8qgfibm"; + min_version = "4.07"; + max_version = "4.12"; + }; + "0.22.0" = { + sha256 = "0kf7lgcwygf6zlx7rwddqpqvasa6v7xiq0bqal8vxlib6lpg074q"; + min_version = "4.07"; + }; + "0.22.2" = { + sha256 = "0fysjqcpv281n52wl3h0dy2lzf9d61wdzk90ldv3p63a4i3mr1j2"; + min_version = "4.07"; + }; + "0.23.0" = { + sha256 = "0jg5v4pssbl66hn5davpin1i57a0r3r54l96vpz5y99xk5w70xi1"; + min_version = "4.07"; + }; + "0.24.0" = { + sha256 = "sha256-wuG7cUZiVP2PdM+nZloip7lGGiWn6Wpkh2YoF/Fuc9o="; + min_version = "4.07"; + }; +}."${version}"; in + +if param ? max_version && lib.versionAtLeast ocaml.version param.max_version +|| param ? min_version && !lib.versionAtLeast ocaml.version param.min_version +then throw "ppxlib-${version} is not available for OCaml ${ocaml.version}" +else + +buildDunePackage rec { + pname = "ppxlib"; + inherit version; + + useDune2 = param.useDune2 or true; + + src = fetchFromGitHub { + owner = "ocaml-ppx"; + repo = pname; + rev = version; + inherit (param) sha256; + }; + + propagatedBuildInputs = [ + ocaml-compiler-libs + (if param.useOMP2 or true + then ocaml-migrate-parsetree-2 + else ocaml-migrate-parsetree) + ppx_derivers + stdio + stdlib-shims + ]; + + meta = { + description = "Comprehensive ppx tool set"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.vbgl ]; + inherit (src.meta) homepage; + }; +} diff --git a/pkgs/development/ocaml-modules/prettym/default.nix b/pkgs/development/ocaml-modules/prettym/default.nix new file mode 100644 index 00000000000..d19233cf13c --- /dev/null +++ b/pkgs/development/ocaml-modules/prettym/default.nix @@ -0,0 +1,48 @@ +{ alcotest +, base64 +, bigarray-compat +, bigarray-overlap +, bigstringaf +, buildDunePackage +, fetchzip +, fmt +, jsonm +, ke +, lib +, ptime +}: + +buildDunePackage rec { + pname = "prettym"; + version = "0.0.2"; + + src = fetchzip { + url = "https://github.com/dinosaure/prettym/releases/download/${version}/prettym-${version}.tbz"; + sha256 = "03x7jh62mvzc6x2d8xsy456qa6iphw72zm7jmqrakpmsy6zcf2lb"; + }; + + useDune2 = true; + + propagatedBuildInputs = [ + bigarray-compat + bigarray-overlap + bigstringaf + fmt + ke + ]; + + checkInputs = [ + ptime + alcotest + jsonm + base64 + ]; + doCheck = true; + + meta = { + description = "A simple bounded encoder to serialize human readable values and respect the 80-column constraint"; + license = lib.licenses.mit; + homepage = "https://github.com/dinosaure/prettym"; + maintainers = with lib.maintainers; [ ]; + }; +} diff --git a/pkgs/development/ocaml-modules/printbox/default.nix b/pkgs/development/ocaml-modules/printbox/default.nix new file mode 100644 index 00000000000..179e559d72f --- /dev/null +++ b/pkgs/development/ocaml-modules/printbox/default.nix @@ -0,0 +1,29 @@ +{ lib, fetchFromGitHub, buildDunePackage, ocaml, mdx }: + +buildDunePackage rec { + pname = "printbox"; + version = "0.6"; + + useDune2 = true; + + minimalOCamlVersion = "4.03"; + + src = fetchFromGitHub { + owner = "c-cube"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256:0vqp8j1vp8h8par699nnh31hnikzh6pqn07lqyxw65axqy3sc9dp"; + }; + + checkInputs = [ mdx.bin ]; + + # mdx is not available for OCaml < 4.08 + doCheck = lib.versionAtLeast ocaml.version "4.08"; + + meta = { + homepage = "https://github.com/c-cube/printbox/"; + description = "Allows to print nested boxes, lists, arrays, tables in several formats"; + license = lib.licenses.isc; + maintainers = [ lib.maintainers.romildo ]; + }; +} diff --git a/pkgs/development/ocaml-modules/printbox/text.nix b/pkgs/development/ocaml-modules/printbox/text.nix new file mode 100644 index 00000000000..cc0aa5691de --- /dev/null +++ b/pkgs/development/ocaml-modules/printbox/text.nix @@ -0,0 +1,14 @@ +{ buildDunePackage, printbox, uucp, uutf, mdx }: + +buildDunePackage { + pname = "printbox-text"; + inherit (printbox) src version useDune2 doCheck; + + propagatedBuildInputs = [ printbox uucp uutf ]; + + checkInputs = [ mdx.bin ]; + + meta = printbox.meta // { + description = "Text renderer for printbox, using unicode edges"; + }; +} diff --git a/pkgs/development/ocaml-modules/process/default.nix b/pkgs/development/ocaml-modules/process/default.nix new file mode 100644 index 00000000000..89faf40c3be --- /dev/null +++ b/pkgs/development/ocaml-modules/process/default.nix @@ -0,0 +1,26 @@ +{ stdenv, lib, fetchFromGitHub, ocaml, findlib, ocamlbuild }: + +stdenv.mkDerivation rec { + pname = "ocaml${ocaml.version}-process"; + version = "0.2.1"; + + src = fetchFromGitHub { + owner = "dsheets"; + repo = "ocaml-process"; + rev = version; + sha256 = "0m1ldah5r9gcq09d9jh8lhvr77910dygx5m309k1jm60ah9mdcab"; + }; + + nativeBuildInputs = [ ocaml findlib ocamlbuild ]; + strictDeps = true; + + createFindlibDestdir = true; + + meta = { + description = "Easy process control in OCaml"; + license = lib.licenses.isc; + maintainers = [ lib.maintainers.vbgl ]; + inherit (src.meta) homepage; + inherit (ocaml.meta) platforms; + }; +} diff --git a/pkgs/development/ocaml-modules/prof_spacetime/default.nix b/pkgs/development/ocaml-modules/prof_spacetime/default.nix new file mode 100644 index 00000000000..bfbd466bad6 --- /dev/null +++ b/pkgs/development/ocaml-modules/prof_spacetime/default.nix @@ -0,0 +1,43 @@ +{ buildDunePackage +, lib +, fetchFromGitHub +, cmdliner +, spacetime_lib +, yojson +, cohttp +, ocaml_lwt +, cohttp-lwt-unix +, lambda-term +, stdlib-shims +}: + +buildDunePackage rec { + pname = "prof_spacetime"; + version = "0.3.0"; + useDune2 = true; + + src = fetchFromGitHub { + owner = "lpw25"; + repo = pname; + rev = version; + sha256 = "1s88gf6x5almmyi58zx4q23w89mvahfjwhvyfg29ya5s1pjbc9hi"; + }; + + buildInputs = [ + cmdliner + spacetime_lib + yojson + cohttp + ocaml_lwt + cohttp-lwt-unix + lambda-term + stdlib-shims + ]; + + meta = { + description = "A viewer for OCaml spacetime profiles"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.symphorien ]; + inherit (src.meta) homepage; + }; +} diff --git a/pkgs/development/ocaml-modules/progress/default.nix b/pkgs/development/ocaml-modules/progress/default.nix new file mode 100644 index 00000000000..4c00ff98465 --- /dev/null +++ b/pkgs/development/ocaml-modules/progress/default.nix @@ -0,0 +1,25 @@ +{ lib, buildDunePackage +, fmt, logs, mtime, optint, terminal, vector +, alcotest, astring +}: + +buildDunePackage rec { + pname = "progress"; + + minimalOCamlVersion = "4.08"; + useDune2 = true; + + inherit (terminal) version src; + + propagatedBuildInputs = [ fmt logs mtime optint terminal vector ]; + + doCheck = true; + checkInputs = [ alcotest astring ]; + + meta = with lib; { + description = "Progress bar library for OCaml"; + homepage = "https://github.com/CraigFe/progress"; + license = licenses.mit; + maintainers = [ maintainers.sternenseemann ]; + }; +} diff --git a/pkgs/development/ocaml-modules/psmt2-frontend/default.nix b/pkgs/development/ocaml-modules/psmt2-frontend/default.nix new file mode 100644 index 00000000000..25c9ec4b870 --- /dev/null +++ b/pkgs/development/ocaml-modules/psmt2-frontend/default.nix @@ -0,0 +1,29 @@ +{ lib, fetchFromGitHub, buildDunePackage, menhir }: + +buildDunePackage rec { + version = "0.3.1"; + pname = "psmt2-frontend"; + + src = fetchFromGitHub { + owner = "ACoquereau"; + repo = pname; + rev = version; + sha256 = "038jrfsq09nhnzpjiishg4adk09w3aw1bpczgbj66lqqilkd6gci"; + }; + + useDune2 = true; + + minimumOCamlVersion = "4.03"; + + strictDeps = true; + + nativeBuildInputs = [ menhir ]; + + meta = { + description = "A simple parser and type-checker for polomorphic extension of the SMT-LIB 2 language"; + license = lib.licenses.asl20; + maintainers = [ lib.maintainers.vbgl ]; + inherit (src.meta) homepage; + }; + +} diff --git a/pkgs/development/ocaml-modules/psq/default.nix b/pkgs/development/ocaml-modules/psq/default.nix new file mode 100644 index 00000000000..ea9a0615b41 --- /dev/null +++ b/pkgs/development/ocaml-modules/psq/default.nix @@ -0,0 +1,26 @@ +{ lib, buildDunePackage, ocaml, fetchurl, seq, qcheck-alcotest }: + +buildDunePackage rec { + minimumOCamlVersion = "4.03"; + pname = "psq"; + version = "0.2.0"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/pqwy/psq/releases/download/v${version}/psq-v${version}.tbz"; + sha256 = "1j4lqkq17rskhgcrpgr4n1m1a2b1x35mlxj6f9g05rhpmgvgvknk"; + }; + + propagatedBuildInputs = [ seq ]; + + doCheck = lib.versionAtLeast ocaml.version "4.08"; + checkInputs = [ qcheck-alcotest ]; + + meta = { + description = "Functional Priority Search Queues for OCaml"; + homepage = "https://github.com/pqwy/psq"; + maintainers = [ lib.maintainers.vbgl ]; + license = lib.licenses.isc; + }; +} diff --git a/pkgs/development/ocaml-modules/ptime/default.nix b/pkgs/development/ocaml-modules/ptime/default.nix new file mode 100644 index 00000000000..ac30876520a --- /dev/null +++ b/pkgs/development/ocaml-modules/ptime/default.nix @@ -0,0 +1,43 @@ +{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, topkg, result, js_of_ocaml +, jsooSupport ? true +}: + +stdenv.mkDerivation rec { + version = "0.8.5"; + pname = "ocaml${ocaml.version}-ptime"; + + src = fetchurl { + url = "https://erratique.ch/software/ptime/releases/ptime-${version}.tbz"; + sha256 = "1fxq57xy1ajzfdnvv5zfm7ap2nf49znw5f9gbi4kb9vds942ij27"; + }; + + nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ]; + buildInputs = [ topkg ] ++ lib.optional jsooSupport js_of_ocaml; + + strictDeps = true; + + propagatedBuildInputs = [ result ]; + + buildPhase = "${topkg.run} build --with-js_of_ocaml ${lib.boolToString jsooSupport}"; + + inherit (topkg) installPhase; + + meta = { + homepage = "https://erratique.ch/software/ptime"; + description = "POSIX time for OCaml"; + longDescription = '' + Ptime has platform independent POSIX time support in pure OCaml. + It provides a type to represent a well-defined range of POSIX timestamps + with picosecond precision, conversion with date-time values, conversion + with RFC 3339 timestamps and pretty printing to a human-readable, + locale-independent representation. + + The additional Ptime_clock library provides access to a system POSIX clock + and to the system's current time zone offset. + + Ptime is not a calendar library. + ''; + license = lib.licenses.isc; + maintainers = with lib.maintainers; [ sternenseemann ]; + }; +} diff --git a/pkgs/development/ocaml-modules/ptmap/default.nix b/pkgs/development/ocaml-modules/ptmap/default.nix new file mode 100644 index 00000000000..fd59368f82d --- /dev/null +++ b/pkgs/development/ocaml-modules/ptmap/default.nix @@ -0,0 +1,30 @@ +{ lib, buildDunePackage, fetchurl +, seq +, stdlib-shims +}: + +buildDunePackage rec { + pname = "ptmap"; + version = "2.0.5"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/backtracking/ptmap/releases/download/${version}/ptmap-${version}.tbz"; + sha256 = "1apk61fc1y1g7x3m3c91fnskvxp6i0vk5nxwvipj56k7x2pzilgb"; + }; + + strictDeps = true; + + buildInputs = [ stdlib-shims ]; + propagatedBuildInputs = [ seq ]; + + doCheck = true; + + meta = { + homepage = "https://www.lri.fr/~filliatr/software.en.html"; + description = "Maps over integers implemented as Patricia trees"; + license = lib.licenses.lgpl21; + maintainers = with lib.maintainers; [ volth ]; + }; +} diff --git a/pkgs/development/ocaml-modules/ptset/default.nix b/pkgs/development/ocaml-modules/ptset/default.nix new file mode 100644 index 00000000000..b9c534e763d --- /dev/null +++ b/pkgs/development/ocaml-modules/ptset/default.nix @@ -0,0 +1,26 @@ +{ lib, fetchurl, buildDunePackage +, stdlib-shims +}: + +buildDunePackage rec { + pname = "ptset"; + version = "1.0.1"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/backtracking/ptset/releases/download/${version}/ptset-${version}.tbz"; + sha256 = "1pr80mgk12l93mdq1wfsv2b6ccraxs334d5h92qzjh7bw2g13424"; + }; + + doCheck = true; + + propagatedBuildInputs = [ stdlib-shims ]; + + meta = { + description = "Integer set implementation using Patricia trees"; + homepage = "https://github.com/backtracking/ptset"; + license = lib.licenses.lgpl21; + maintainers = [ lib.maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/pyml/default.nix b/pkgs/development/ocaml-modules/pyml/default.nix new file mode 100644 index 00000000000..afcc47e38dc --- /dev/null +++ b/pkgs/development/ocaml-modules/pyml/default.nix @@ -0,0 +1,48 @@ +{ stdenv, lib, fetchFromGitHub, ocaml, findlib, utop, python3, stdcompat, ncurses }: + +stdenv.mkDerivation rec { + pname = "pyml"; + version = "20211015"; + + src = fetchFromGitHub { + owner = "thierry-martinez"; + repo = pname; + rev = version; + sha256 = "sha256-GCO6KlRhJmADFjQ5QF4naMQBskF63yqnJnLnuQsagEk="; + }; + + nativeBuildInputs = [ + ocaml + findlib + ]; + buildInputs = [ + utop + ncurses + ]; + + propagatedBuildInputs = [ + python3 + stdcompat + ]; + + strictDeps = true; + + buildPhase = '' + make all pymltop pymlutop PREFIX=$out + ''; + + installPhase = '' + runHook preInstall + mkdir -p $out/bin + mkdir -p $OCAMLFIND_DESTDIR/stublibs + make install PREFIX=$out + runHook postInstall + ''; + + doCheck = true; + + meta = { + description = "OCaml bindings for Python"; + license = lib.licenses.bsd2; + }; +} diff --git a/pkgs/development/ocaml-modules/qcheck/alcotest.nix b/pkgs/development/ocaml-modules/qcheck/alcotest.nix new file mode 100644 index 00000000000..aebe6bd95a8 --- /dev/null +++ b/pkgs/development/ocaml-modules/qcheck/alcotest.nix @@ -0,0 +1,13 @@ +{ buildDunePackage, qcheck-core, alcotest }: + +buildDunePackage { + pname = "qcheck-alcotest"; + + inherit (qcheck-core) version useDune2 src; + + propagatedBuildInputs = [ qcheck-core alcotest ]; + + meta = qcheck-core.meta // { + description = "Alcotest backend for qcheck"; + }; +} diff --git a/pkgs/development/ocaml-modules/qcheck/core.nix b/pkgs/development/ocaml-modules/qcheck/core.nix new file mode 100644 index 00000000000..efa3f11967e --- /dev/null +++ b/pkgs/development/ocaml-modules/qcheck/core.nix @@ -0,0 +1,25 @@ +{ lib, buildDunePackage, fetchFromGitHub }: + +buildDunePackage rec { + pname = "qcheck-core"; + version = "0.18"; + + useDune2 = true; + + minimalOCamlVersion = "4.08"; + + src = fetchFromGitHub { + owner = "c-cube"; + repo = "qcheck"; + rev = "v${version}"; + sha256 = "1s652hrj2sxqj30dfl300zjvvqk3r62a1bnzqw1hqyf6pi88qn8x"; + }; + + meta = { + description = "Core qcheck library"; + homepage = "https://c-cube.github.io/qcheck/"; + license = lib.licenses.bsd2; + maintainers = [ lib.maintainers.vbgl ]; + }; + +} diff --git a/pkgs/development/ocaml-modules/qcheck/default.nix b/pkgs/development/ocaml-modules/qcheck/default.nix new file mode 100644 index 00000000000..dc73f42a13b --- /dev/null +++ b/pkgs/development/ocaml-modules/qcheck/default.nix @@ -0,0 +1,14 @@ +{ buildDunePackage, qcheck-ounit }: + +buildDunePackage { + pname = "qcheck"; + + inherit (qcheck-ounit) version useDune2 src; + + propagatedBuildInputs = [ qcheck-ounit ]; + + meta = qcheck-ounit.meta // { + description = "Compatibility package for qcheck"; + }; + +} diff --git a/pkgs/development/ocaml-modules/qcheck/ounit.nix b/pkgs/development/ocaml-modules/qcheck/ounit.nix new file mode 100644 index 00000000000..62b082f48fb --- /dev/null +++ b/pkgs/development/ocaml-modules/qcheck/ounit.nix @@ -0,0 +1,14 @@ +{ buildDunePackage, qcheck-core, ounit }: + +buildDunePackage { + pname = "qcheck-ounit"; + + inherit (qcheck-core) version useDune2 src; + + propagatedBuildInputs = [ qcheck-core ounit ]; + + meta = qcheck-core.meta // { + description = "OUnit backend for qcheck"; + }; + +} diff --git a/pkgs/development/ocaml-modules/qtest/default.nix b/pkgs/development/ocaml-modules/qtest/default.nix new file mode 100644 index 00000000000..5e9a89a8376 --- /dev/null +++ b/pkgs/development/ocaml-modules/qtest/default.nix @@ -0,0 +1,24 @@ +{ lib, buildDunePackage, fetchFromGitHub, qcheck }: + +buildDunePackage rec { + pname = "qtest"; + version = "2.11.2"; + + useDune2 = true; + + src = fetchFromGitHub { + owner = "vincent-hugot"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-VLY8+Nu6md0szW4RVxTFwlSQ9kyrgUqf7wQEA6GW8BE="; + }; + + propagatedBuildInputs = [ qcheck ]; + + meta = { + description = "Inline (Unit) Tests for OCaml"; + inherit (src.meta) homepage; + maintainers = with lib.maintainers; [ vbgl ]; + license = lib.licenses.gpl3; + }; +} diff --git a/pkgs/development/ocaml-modules/randomconv/default.nix b/pkgs/development/ocaml-modules/randomconv/default.nix new file mode 100644 index 00000000000..078d50da895 --- /dev/null +++ b/pkgs/development/ocaml-modules/randomconv/default.nix @@ -0,0 +1,23 @@ +{ lib, buildDunePackage, fetchurl, cstruct }: + +buildDunePackage rec { + pname = "randomconv"; + version = "0.1.3"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/hannesm/randomconv/releases/download/v${version}/randomconv-v${version}.tbz"; + sha256 = "1iv3r0s5kqxs893b0d55f0r62k777haiahfkkvvfbqwgqsm6la4v"; + }; + + propagatedBuildInputs = [ cstruct ]; + + meta = { + homepage = "https://github.com/hannesm/randomconv"; + description = "Convert from random bytes to random native numbers"; + license = lib.licenses.isc; + maintainers = [ lib.maintainers.vbgl ]; + }; + +} diff --git a/pkgs/development/ocaml-modules/rdbg/default.nix b/pkgs/development/ocaml-modules/rdbg/default.nix new file mode 100644 index 00000000000..9b33678590d --- /dev/null +++ b/pkgs/development/ocaml-modules/rdbg/default.nix @@ -0,0 +1,31 @@ +{ lib, buildDunePackage, fetchurl, num, lutils, ounit}: + +buildDunePackage rec { + pname = "rdbg"; + version = "1.196.12"; + + useDune2 = true; + + minimalOCamlVersion = "4.07"; + + src = fetchurl { + url = "http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/pool/rdbg.1.196.12.tgz"; + sha512 = "8e88034b1eda8f1233b4990adc9746782148254c93d8d0c99c246c0d50f306eeb6aa4afcfca8834acb3e268860647f47a24cc6a2d29fb45cac11f098e2ede275"; + }; + + buildInputs = [ + num + ounit + ]; + + propagatedBuildInputs = [ + lutils + ]; + + meta = with lib; { + homepage = "https://gricad-gitlab.univ-grenoble-alpes.fr/verimag/synchrone/rdbg"; + description = "A programmable debugger that targets reactive programs for which a rdbg-plugin exists. Currently two plugins exist : one for Lustre, and one for Lutin (nb: both are synchronous programming languages)"; + license = lib.licenses.cecill21; + maintainers = [ lib.maintainers.delta ]; + }; +} diff --git a/pkgs/development/ocaml-modules/re/default.nix b/pkgs/development/ocaml-modules/re/default.nix new file mode 100644 index 00000000000..4734d4a9bf5 --- /dev/null +++ b/pkgs/development/ocaml-modules/re/default.nix @@ -0,0 +1,26 @@ +{ lib, fetchurl, buildDunePackage, ocaml, ounit, seq }: + +buildDunePackage rec { + pname = "re"; + version = "1.9.0"; + + minimumOCamlVersion = "4.02"; + + useDune2 = lib.versionAtLeast ocaml.version "4.08"; + + src = fetchurl { + url = "https://github.com/ocaml/ocaml-re/releases/download/${version}/re-${version}.tbz"; + sha256 = "1gas4ky49zgxph3870nffzkr6y41kkpqp4nj38pz1gh49zcf12aj"; + }; + + buildInputs = lib.optional doCheck ounit; + propagatedBuildInputs = [ seq ]; + doCheck = lib.versionAtLeast ocaml.version "4.04"; + + meta = { + homepage = "https://github.com/ocaml/ocaml-re"; + description = "Pure OCaml regular expressions, with support for Perl and POSIX-style strings"; + license = lib.licenses.lgpl2; + maintainers = with lib.maintainers; [ vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/react/default.nix b/pkgs/development/ocaml-modules/react/default.nix new file mode 100644 index 00000000000..4e07a2021e3 --- /dev/null +++ b/pkgs/development/ocaml-modules/react/default.nix @@ -0,0 +1,26 @@ +{ lib, stdenv, fetchurl, ocaml, findlib, topkg, ocamlbuild }: + +stdenv.mkDerivation rec { + pname = "ocaml-react"; + version = "1.2.1"; + + src = fetchurl { + url = "https://erratique.ch/software/react/releases/react-${version}.tbz"; + sha256 = "1aj8w79gdd9xnrbz7s5p8glcb4pmimi8jp9f439dqnf6ih3mqb3v"; + }; + + nativeBuildInputs = [ ocaml findlib ocamlbuild ]; + buildInputs = [ topkg ]; + + strictDeps = true; + + inherit (topkg) buildPhase installPhase; + + meta = with lib; { + homepage = "https://erratique.ch/software/react"; + description = "Applicative events and signals for OCaml"; + license = licenses.bsd3; + platforms = ocaml.meta.platforms or [ ]; + maintainers = with maintainers; [ maggesi vbmithr gal_bolle ]; + }; +} diff --git a/pkgs/development/ocaml-modules/reactivedata/default.nix b/pkgs/development/ocaml-modules/reactivedata/default.nix new file mode 100644 index 00000000000..23ebb3144d1 --- /dev/null +++ b/pkgs/development/ocaml-modules/reactivedata/default.nix @@ -0,0 +1,34 @@ +{ lib, stdenv, fetchFromGitHub, ocaml, findlib, ocamlbuild, react, opaline }: + +if !lib.versionAtLeast ocaml.version "4.04" +then throw "reactiveData is not available for OCaml ${ocaml.version}" +else + +stdenv.mkDerivation rec { + pname = "ocaml${ocaml.version}-reactiveData"; + version = "0.2.2"; + + src = fetchFromGitHub { + owner = "ocsigen"; + repo = "reactiveData"; + rev = version; + sha256 = "sha256-YLkacIbjxZQ/ThgSxjTqviBYih6eW2GX5H7iybQDv1A="; + }; + + nativeBuildInputs = [ ocaml findlib ocamlbuild opaline ]; + propagatedBuildInputs = [ react ]; + + strictDeps = true; + + buildPhase = "ocaml pkg/build.ml native=true native-dynlink=true"; + + installPhase = "opaline -prefix $out -libdir $OCAMLFIND_DESTDIR"; + + meta = with lib; { + description = "An OCaml module for functional reactive programming (FRP) based on React"; + homepage = "https://github.com/ocsigen/reactiveData"; + license = licenses.lgpl21; + platforms = ocaml.meta.platforms or [ ]; + maintainers = with maintainers; [ vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/reason-native/cli.nix b/pkgs/development/ocaml-modules/reason-native/cli.nix new file mode 100644 index 00000000000..ee5e7d2774d --- /dev/null +++ b/pkgs/development/ocaml-modules/reason-native/cli.nix @@ -0,0 +1,14 @@ +{ re, reason, pastel, ... }: + +{ + pname = "cli"; + + nativeBuildInputs = [ + reason + ]; + + buildInputs = [ + re + pastel + ]; +} diff --git a/pkgs/development/ocaml-modules/reason-native/console.nix b/pkgs/development/ocaml-modules/reason-native/console.nix new file mode 100644 index 00000000000..b4b30cab4a0 --- /dev/null +++ b/pkgs/development/ocaml-modules/reason-native/console.nix @@ -0,0 +1,21 @@ +{ buildDunePackage, callPackage, reason, console, ... }: + +{ + pname = "console"; + + nativeBuildInputs = [ + reason + ]; + + passthru.tests = { + console = callPackage ./tests/console { + inherit buildDunePackage reason console; + }; + }; + + meta = { + description = "A library providing a web-influenced polymorphic console API for native Console.log(anything) with runtime printing"; + downloadPage = "https://github.com/reasonml/reason-native/tree/master/src/console"; + homepage = "https://reason-native.com/docs/console/"; + }; +} diff --git a/pkgs/development/ocaml-modules/reason-native/default.nix b/pkgs/development/ocaml-modules/reason-native/default.nix new file mode 100644 index 00000000000..d20f994b832 --- /dev/null +++ b/pkgs/development/ocaml-modules/reason-native/default.nix @@ -0,0 +1,43 @@ +{ newScope, lib, fetchFromGitHub, callPackage, buildDunePackage, atdgen, junit, qcheck-core, re, reason, reason-native }: + +let + generic = (somePath: + let + prepkg = import somePath { + inherit callPackage cli buildDunePackage atdgen junit qcheck-core re reason; + inherit (reason-native) console file-context-printer fp pastel rely; + }; + in + buildDunePackage + ({ + version = "2021-16-16-aec0ac6"; + src = fetchFromGitHub { + owner = "reasonml"; + repo = "reason-native"; + rev = "aec0ac681be7211b4d092262281689c46deb63e1"; + sha256 = "sha256-QoyI50MBY3RJBmM1y90n7oXrLmHe0CQxKojv+7YbegE="; + }; + useDune2 = true; + meta = with lib; { + description = "Libraries for building and testing native Reason programs"; + downloadPage = "https://github.com/reasonml/reason-native"; + homepage = "https://reason-native.com/"; + license = licenses.mit; + maintainers = with maintainers; [ ]; + } // (prepkg.meta or {}); + } // prepkg) + ); + cli = generic ./cli.nix; # Used only by Rely. +in + lib.makeScope newScope (self: with self; { + console = generic ./console.nix; + dir = generic ./dir.nix; + file-context-printer = generic ./file-context-printer.nix; + fp = generic ./fp.nix; + pastel = generic ./pastel.nix; + pastel-console = generic ./pastel-console.nix; + qcheck-rely = generic ./qcheck-rely.nix; + refmterr = generic ./refmterr.nix; + rely = generic ./rely.nix; + rely-junit-reporter = generic ./rely-junit-reporter.nix; + }) diff --git a/pkgs/development/ocaml-modules/reason-native/dir.nix b/pkgs/development/ocaml-modules/reason-native/dir.nix new file mode 100644 index 00000000000..6b2aa0c3cd8 --- /dev/null +++ b/pkgs/development/ocaml-modules/reason-native/dir.nix @@ -0,0 +1,18 @@ +{ reason, fp, ... }: + +{ + pname = "dir"; + + nativeBuildInputs = [ + reason + ]; + + propagatedBuildInputs = [ + fp + ]; + + meta = { + description = "A library that provides a consistent API for common system, user and application directories consistently on all platforms"; + downloadPage = "https://github.com/reasonml/reason-native/tree/master/src/dir"; + }; +} diff --git a/pkgs/development/ocaml-modules/reason-native/file-context-printer.nix b/pkgs/development/ocaml-modules/reason-native/file-context-printer.nix new file mode 100644 index 00000000000..a7c663493ef --- /dev/null +++ b/pkgs/development/ocaml-modules/reason-native/file-context-printer.nix @@ -0,0 +1,20 @@ +{ reason, re, pastel, ... }: + +{ + pname = "file-context-printer"; + + nativeBuildInputs = [ + reason + ]; + + propagatedBuildInputs = [ + re + pastel + ]; + + meta = { + description = "Utility for displaying snippets of files on the command line"; + downloadPage = "https://github.com/reasonml/reason-native/tree/master/src/file-context-printer"; + homepage = "https://reason-native.com/docs/file-context-printer/"; + }; +} diff --git a/pkgs/development/ocaml-modules/reason-native/fp.nix b/pkgs/development/ocaml-modules/reason-native/fp.nix new file mode 100644 index 00000000000..8ff2ed65c4c --- /dev/null +++ b/pkgs/development/ocaml-modules/reason-native/fp.nix @@ -0,0 +1,14 @@ +{ reason, ... }: + +{ + pname = "fp"; + + nativeBuildInputs = [ + reason + ]; + + meta = { + description = "A library for creating and operating on file paths consistently on multiple platforms"; + downloadPage = "https://github.com/reasonml/reason-native/tree/master/src/fp"; + }; +} diff --git a/pkgs/development/ocaml-modules/reason-native/pastel-console.nix b/pkgs/development/ocaml-modules/reason-native/pastel-console.nix new file mode 100644 index 00000000000..968b9f88af9 --- /dev/null +++ b/pkgs/development/ocaml-modules/reason-native/pastel-console.nix @@ -0,0 +1,20 @@ +{ reason, console, pastel, ... }: + +{ + pname = "pastel-console"; + + nativeBuildInputs = [ + reason + ]; + + propagatedBuildInputs = [ + console + pastel + ]; + + meta = { + description = "Small library for pretty coloring to Console output"; + downloadPage = "https://github.com/reasonml/reason-native/tree/master/src/pastel-console"; + homepage = "https://reason-native.com/docs/pastel/console"; + }; +} diff --git a/pkgs/development/ocaml-modules/reason-native/pastel.nix b/pkgs/development/ocaml-modules/reason-native/pastel.nix new file mode 100644 index 00000000000..f2c975d938e --- /dev/null +++ b/pkgs/development/ocaml-modules/reason-native/pastel.nix @@ -0,0 +1,20 @@ +{ reason, re, ... }: + +{ + pname = "pastel"; + + minimalOCamlVersion = "4.05"; + + nativeBuildInputs = [ + reason + ]; + propagatedBuildInputs = [ + re + ]; + + meta = { + description = "A text formatting library that harnesses Reason JSX to provide intuitive terminal output. Like React but for CLI"; + downloadPage = "https://github.com/reasonml/reason-native/tree/master/src/pastel"; + homepage = "https://reason-native.com/docs/pastel/"; + }; +} diff --git a/pkgs/development/ocaml-modules/reason-native/qcheck-rely.nix b/pkgs/development/ocaml-modules/reason-native/qcheck-rely.nix new file mode 100644 index 00000000000..1250dc2d3a7 --- /dev/null +++ b/pkgs/development/ocaml-modules/reason-native/qcheck-rely.nix @@ -0,0 +1,21 @@ +{ qcheck-core, reason, console, rely, ... }: + +{ + pname = "qcheck-rely"; + + nativeBuildInputs = [ + reason + ]; + + propagatedBuildInputs = [ + qcheck-core + console + rely + ]; + + meta = { + description = "A library containing custom Rely matchers allowing for easily using QCheck with Rely. QCheck is a 'QuickCheck inspired property-based testing for OCaml, and combinators to generate random values to run tests on'"; + downloadPage = "https://github.com/reasonml/reason-native/tree/master/src/qcheck-rely"; + broken = true; + }; +} diff --git a/pkgs/development/ocaml-modules/reason-native/refmterr.nix b/pkgs/development/ocaml-modules/reason-native/refmterr.nix new file mode 100644 index 00000000000..b4d6708467f --- /dev/null +++ b/pkgs/development/ocaml-modules/reason-native/refmterr.nix @@ -0,0 +1,21 @@ +{ atdgen, re, reason, pastel, ... }: + +{ + pname = "refmterr"; + + nativeBuildInputs = [ + reason + ]; + + propagatedBuildInputs = [ + atdgen + re + pastel + ]; + + meta = { + description = "An error formatter tool for Reason and OCaml. Takes raw error output from compiler and converts to pretty output"; + downloadPage = "https://github.com/reasonml/reason-native/tree/master/src/refmterr"; + homepage = "https://reason-native.com/docs/refmterr/"; + }; +} diff --git a/pkgs/development/ocaml-modules/reason-native/rely-junit-reporter.nix b/pkgs/development/ocaml-modules/reason-native/rely-junit-reporter.nix new file mode 100644 index 00000000000..8a7080f624d --- /dev/null +++ b/pkgs/development/ocaml-modules/reason-native/rely-junit-reporter.nix @@ -0,0 +1,26 @@ +{ atdgen, junit, re, reason, pastel, rely, ... }: + +{ + pname = "rely-junit-reporter"; + + nativeBuildInputs = [ + reason + ]; + + buildInputs = [ + atdgen + ]; + + propagatedBuildInputs = [ + junit + re + pastel + rely + ]; + + meta = { + description = "A tool providing JUnit Reporter for Rely Testing Framework"; + downloadPage = "https://github.com/reasonml/reason-native/tree/master/src/rely-junit-reporter"; + homepage = "https://reason-native.com/docs/rely/"; + }; +} diff --git a/pkgs/development/ocaml-modules/reason-native/rely.nix b/pkgs/development/ocaml-modules/reason-native/rely.nix new file mode 100644 index 00000000000..f29565f9c46 --- /dev/null +++ b/pkgs/development/ocaml-modules/reason-native/rely.nix @@ -0,0 +1,22 @@ +{ re, reason, cli, file-context-printer, pastel, ... }: + +{ + pname = "rely"; + + nativeBuildInputs = [ + reason + ]; + + propagatedBuildInputs = [ + re + cli + file-context-printer + pastel + ]; + + meta = { + description = "A Jest-inspired testing framework for native OCaml/Reason"; + downloadPage = "https://github.com/reasonml/reason-native/tree/master/src/rely"; + homepage = "https://reason-native.com/docs/rely/"; + }; +} diff --git a/pkgs/development/ocaml-modules/reason-native/tests/console/console-test.opam b/pkgs/development/ocaml-modules/reason-native/tests/console/console-test.opam new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/pkgs/development/ocaml-modules/reason-native/tests/console/console-test.opam diff --git a/pkgs/development/ocaml-modules/reason-native/tests/console/console-test.re b/pkgs/development/ocaml-modules/reason-native/tests/console/console-test.re new file mode 100644 index 00000000000..15685205e1b --- /dev/null +++ b/pkgs/development/ocaml-modules/reason-native/tests/console/console-test.re @@ -0,0 +1 @@ +Console.log(Some("Hello fellow Nixer!")); /* {"Hello fellow Nixer!"} */ diff --git a/pkgs/development/ocaml-modules/reason-native/tests/console/default.nix b/pkgs/development/ocaml-modules/reason-native/tests/console/default.nix new file mode 100644 index 00000000000..e1a995d33c5 --- /dev/null +++ b/pkgs/development/ocaml-modules/reason-native/tests/console/default.nix @@ -0,0 +1,20 @@ +{ lib, buildDunePackage, reason, console }: + +buildDunePackage rec { + pname = "console-test"; + version = "1"; + + src = ./.; + + useDune2 = true; + + buildInputs = [ + reason + console + ]; + + doInstallCheck = true; + postInstallCheck = '' + $out/bin/console-test | grep -q "{\"Hello fellow Nixer!\"}" > /dev/null + ''; +} diff --git a/pkgs/development/ocaml-modules/reason-native/tests/console/dune b/pkgs/development/ocaml-modules/reason-native/tests/console/dune new file mode 100644 index 00000000000..49f2121385e --- /dev/null +++ b/pkgs/development/ocaml-modules/reason-native/tests/console/dune @@ -0,0 +1,4 @@ +(executable + (name console-test) + (public_name console-test) + (libraries reason console.lib)) diff --git a/pkgs/development/ocaml-modules/repr/default.nix b/pkgs/development/ocaml-modules/repr/default.nix new file mode 100644 index 00000000000..168da21a04e --- /dev/null +++ b/pkgs/development/ocaml-modules/repr/default.nix @@ -0,0 +1,30 @@ +{ lib, buildDunePackage, fetchurl, base64, either, fmt, jsonm, uutf, optint }: + +buildDunePackage rec { + pname = "repr"; + version = "0.5.0"; + + src = fetchurl { + url = "https://github.com/mirage/${pname}/releases/download/${version}/${pname}-fuzz-${version}.tbz"; + sha256 = "1y9qnbaxcyxz7bzkkq5lwjrv715mvp2vphzcrd8vbvjhp7df3l1f"; + }; + + minimumOCamlVersion = "4.08"; + useDune2 = true; + + propagatedBuildInputs = [ + base64 + either + fmt + jsonm + uutf + optint + ]; + + meta = with lib; { + description = "Dynamic type representations. Provides no stability guarantee"; + homepage = "https://github.com/mirage/repr"; + license = licenses.isc; + maintainers = with maintainers; [ sternenseemann ]; + }; +} diff --git a/pkgs/development/ocaml-modules/repr/ppx.nix b/pkgs/development/ocaml-modules/repr/ppx.nix new file mode 100644 index 00000000000..b495f6bb772 --- /dev/null +++ b/pkgs/development/ocaml-modules/repr/ppx.nix @@ -0,0 +1,23 @@ +{ lib, buildDunePackage, ppx_deriving, ppxlib, repr, alcotest, hex }: + +buildDunePackage { + pname = "ppx_repr"; + + inherit (repr) src version useDune2; + + propagatedBuildInputs = [ + ppx_deriving + ppxlib + repr + ]; + + doCheck = false; # tests fail with ppxlib >= 0.23.0 + checkInputs = [ + alcotest + hex + ]; + + meta = repr.meta // { + description = "PPX deriver for type representations"; + }; +} diff --git a/pkgs/development/ocaml-modules/resource-pooling/default.nix b/pkgs/development/ocaml-modules/resource-pooling/default.nix new file mode 100644 index 00000000000..51407f6b49d --- /dev/null +++ b/pkgs/development/ocaml-modules/resource-pooling/default.nix @@ -0,0 +1,28 @@ +{ lib, fetchFromGitHub, buildDunePackage, lwt_log }: + +buildDunePackage rec { + version = "1.1"; + pname = "resource-pooling"; + + useDune2 = true; + + minimumOCamlVersion = "4.06"; + + src = fetchFromGitHub { + owner = "ocsigen"; + repo = pname; + rev = version; + sha256 = "0wsbnwszafdv3gsiiaslgf6m6pfx74h7h19i0gp2c4ivdiv3wck9"; + }; + + propagatedBuildInputs = [ lwt_log ]; + + doCheck = true; + + meta = { + inherit (src.meta) homepage; + description = "A library for pooling resources like connections, threads, or similar"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/resto/acl.nix b/pkgs/development/ocaml-modules/resto/acl.nix new file mode 100644 index 00000000000..7ac05cd62da --- /dev/null +++ b/pkgs/development/ocaml-modules/resto/acl.nix @@ -0,0 +1,13 @@ +{ lib, buildDunePackage, resto, uri }: + +buildDunePackage { + pname = "resto-acl"; + inherit (resto) src version meta useDune2 doCheck; + + minimalOCamlVersion = "4.05"; + + propagatedBuildInputs = [ + resto + uri + ]; +} diff --git a/pkgs/development/ocaml-modules/resto/cohttp-client.nix b/pkgs/development/ocaml-modules/resto/cohttp-client.nix new file mode 100644 index 00000000000..2dc651045ba --- /dev/null +++ b/pkgs/development/ocaml-modules/resto/cohttp-client.nix @@ -0,0 +1,20 @@ +{ buildDunePackage +, resto +, resto-directory +, resto-cohttp +, uri +, lwt +}: + +buildDunePackage { + pname = "resto-cohttp-client"; + inherit (resto) src version meta useDune2 doCheck; + + propagatedBuildInputs = [ + resto + resto-directory + resto-cohttp + uri + lwt + ]; +} diff --git a/pkgs/development/ocaml-modules/resto/cohttp-self-serving-client.nix b/pkgs/development/ocaml-modules/resto/cohttp-self-serving-client.nix new file mode 100644 index 00000000000..88f2ef25e6a --- /dev/null +++ b/pkgs/development/ocaml-modules/resto/cohttp-self-serving-client.nix @@ -0,0 +1,27 @@ +{ lib +, buildDunePackage +, resto +, resto-directory +, resto-acl +, resto-cohttp +, resto-cohttp-client +, resto-cohttp-server +, uri +, lwt +}: + +buildDunePackage { + pname = "resto-cohttp-self-serving-client"; + inherit (resto) src version meta useDune2 doCheck; + + propagatedBuildInputs = [ + resto + resto-directory + resto-acl + resto-cohttp + resto-cohttp-client + resto-cohttp-server + uri + lwt + ]; +} diff --git a/pkgs/development/ocaml-modules/resto/cohttp-server.nix b/pkgs/development/ocaml-modules/resto/cohttp-server.nix new file mode 100644 index 00000000000..61a5d93e9fc --- /dev/null +++ b/pkgs/development/ocaml-modules/resto/cohttp-server.nix @@ -0,0 +1,25 @@ +{ lib +, buildDunePackage +, resto +, resto-directory +, resto-acl +, resto-cohttp +, cohttp-lwt-unix +, conduit-lwt-unix +, lwt +}: + +buildDunePackage { + pname = "resto-cohttp-server"; + inherit (resto) src version meta useDune2 doCheck; + + propagatedBuildInputs = [ + resto + resto-directory + resto-acl + resto-cohttp + cohttp-lwt-unix + conduit-lwt-unix + lwt + ]; +} diff --git a/pkgs/development/ocaml-modules/resto/cohttp.nix b/pkgs/development/ocaml-modules/resto/cohttp.nix new file mode 100644 index 00000000000..c29e589057c --- /dev/null +++ b/pkgs/development/ocaml-modules/resto/cohttp.nix @@ -0,0 +1,12 @@ +{ buildDunePackage, resto, resto-directory, cohttp-lwt }: + +buildDunePackage { + pname = "resto-cohttp"; + inherit (resto) src version meta useDune2 doCheck; + + propagatedBuildInputs = [ + resto + resto-directory + cohttp-lwt + ]; +} diff --git a/pkgs/development/ocaml-modules/resto/default.nix b/pkgs/development/ocaml-modules/resto/default.nix new file mode 100644 index 00000000000..13d55b1af21 --- /dev/null +++ b/pkgs/development/ocaml-modules/resto/default.nix @@ -0,0 +1,28 @@ +{ lib, fetchFromGitLab, buildDunePackage, uri }: + +buildDunePackage rec { + pname = "resto"; + version = "0.6.1"; + src = fetchFromGitLab { + owner = "nomadic-labs"; + repo = "resto"; + rev = "v${version}"; + sha256 = "13h3zga7h2jhgbyda1q53szbpxcz3vvy3c51mlqk3jh9jq2wrn87"; + }; + + useDune2 = true; + + propagatedBuildInputs = [ + uri + ]; + + # resto has infinite recursion in their tests + doCheck = false; + + meta = { + description = "A minimal OCaml library for type-safe HTTP/JSON RPCs"; + homepage = "https://gitlab.com/nomadic-labs/resto"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.ulrikstrid ]; + }; +} diff --git a/pkgs/development/ocaml-modules/resto/directory.nix b/pkgs/development/ocaml-modules/resto/directory.nix new file mode 100644 index 00000000000..7539bf98ffd --- /dev/null +++ b/pkgs/development/ocaml-modules/resto/directory.nix @@ -0,0 +1,11 @@ +{ lib, buildDunePackage, resto, resto-json, lwt }: + +buildDunePackage { + pname = "resto-directory"; + inherit (resto) src version meta useDune2 doCheck; + + propagatedBuildInputs = [ + resto + lwt + ]; +} diff --git a/pkgs/development/ocaml-modules/resto/ezresto-directory.nix b/pkgs/development/ocaml-modules/resto/ezresto-directory.nix new file mode 100644 index 00000000000..fa208cc3fbb --- /dev/null +++ b/pkgs/development/ocaml-modules/resto/ezresto-directory.nix @@ -0,0 +1,13 @@ +{ buildDunePackage, resto, resto-directory, ezresto, lwt }: + +buildDunePackage { + pname = "ezresto-directory"; + inherit (resto) src version meta useDune2 doCheck; + + propagatedBuildInputs = [ + ezresto + resto-directory + resto + lwt + ]; +} diff --git a/pkgs/development/ocaml-modules/resto/ezresto.nix b/pkgs/development/ocaml-modules/resto/ezresto.nix new file mode 100644 index 00000000000..8b3b2c6cd71 --- /dev/null +++ b/pkgs/development/ocaml-modules/resto/ezresto.nix @@ -0,0 +1,12 @@ +{ lib, buildDunePackage, resto, resto-json, uri }: + +buildDunePackage { + pname = "ezresto"; + inherit (resto) src version meta useDune2 doCheck; + + propagatedBuildInputs = [ + uri + resto + resto-json + ]; +} diff --git a/pkgs/development/ocaml-modules/resto/json.nix b/pkgs/development/ocaml-modules/resto/json.nix new file mode 100644 index 00000000000..e861cac6d31 --- /dev/null +++ b/pkgs/development/ocaml-modules/resto/json.nix @@ -0,0 +1,12 @@ +{ lib, buildDunePackage, resto, json-data-encoding, json-data-encoding-bson }: + +buildDunePackage { + pname = "resto-json"; + inherit (resto) src version meta useDune2 doCheck; + + propagatedBuildInputs = [ + resto + json-data-encoding + json-data-encoding-bson + ]; +} diff --git a/pkgs/development/ocaml-modules/rfc7748/default.nix b/pkgs/development/ocaml-modules/rfc7748/default.nix new file mode 100644 index 00000000000..40356ec9aa5 --- /dev/null +++ b/pkgs/development/ocaml-modules/rfc7748/default.nix @@ -0,0 +1,43 @@ +{ lib +, buildDunePackage +, fetchFromGitHub +, ocaml + +, ounit +, zarith +}: + +buildDunePackage rec { + pname = "rfc7748"; + version = "1.0"; + + src = fetchFromGitHub { + owner = "burgerdev"; + repo = "ocaml-rfc7748"; + rev = "v${version}"; + sha256 = "sha256-mgZooyfxrKBVQFn01B8PULmFUW9Zq5HJfgHCSJSkJo4="; + }; + + useDune2 = true; + + minimumOCamlVersion = "4.05"; + + propagatedBuildInputs = [ zarith ]; + + # the tests fail for 4.05 + doCheck = lib.versionAtLeast ocaml.version "4.06"; + checkInputs = [ ounit ]; + + meta = { + homepage = "https://github.com/burgerdev/ocaml-rfc7748"; + description = "Elliptic Curve Diffie-Hellman on Edwards Curves (X25519, X448)"; + longDescription = '' + This library implements the ECDH functions 'X25519' and 'X448' as specified + in RFC 7748, 'Elliptic curves for security'. In the spirit of the original + publications, the public API is kept as simple as possible to make it easy + to use and hard to misuse. + ''; + license = lib.licenses.bsd2; + maintainers = with lib.maintainers; [ fufexan ]; + }; +} diff --git a/pkgs/development/ocaml-modules/ringo/default.nix b/pkgs/development/ocaml-modules/ringo/default.nix new file mode 100644 index 00000000000..7bfd38b869d --- /dev/null +++ b/pkgs/development/ocaml-modules/ringo/default.nix @@ -0,0 +1,28 @@ +{ lib, fetchFromGitLab, buildDunePackage }: + +buildDunePackage rec { + pname = "ringo"; + version = "0.5"; + + src = fetchFromGitLab { + owner = "nomadic-labs"; + repo = "ringo"; + rev = "v${version}"; + sha256 = "1zwha0ycv3rm3qnw7nkg2m08ibx39yxnx5fan4lnn82b0pdasjag"; + }; + + minimalOCamlVersion = "4.05"; + + useDune2 = true; + + doCheck = true; + + # If we just run the test as is it will try to test ringo-lwt + checkPhase = "dune build @test/runtest"; + + meta = { + description = "Caches (bounded-size key-value stores) and other bounded-size stores"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.ulrikstrid ]; + }; +} diff --git a/pkgs/development/ocaml-modules/ringo/lwt.nix b/pkgs/development/ocaml-modules/ringo/lwt.nix new file mode 100644 index 00000000000..be9f5bbf2b2 --- /dev/null +++ b/pkgs/development/ocaml-modules/ringo/lwt.nix @@ -0,0 +1,17 @@ +{ lib, buildDunePackage, ringo, lwt }: + +buildDunePackage { + pname = "ringo-lwt"; + inherit (ringo) version src doCheck useDune2; + + minimalOCamlVersion = "4.08"; + + propagatedBuildInputs = [ + ringo + lwt + ]; + + meta = ringo.meta // { + description = "Lwt-wrappers for Ringo caches"; + }; +} diff --git a/pkgs/development/ocaml-modules/rope/default.nix b/pkgs/development/ocaml-modules/rope/default.nix new file mode 100644 index 00000000000..9ac090a780e --- /dev/null +++ b/pkgs/development/ocaml-modules/rope/default.nix @@ -0,0 +1,45 @@ +{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, dune_2, benchmark }: + +let param = + if lib.versionAtLeast ocaml.version "4.03" + then rec { + version = "0.6.2"; + url = "https://github.com/Chris00/ocaml-rope/releases/download/${version}/rope-${version}.tbz"; + sha256 = "15cvfa0s1vjx7gjd07d3fkznilishqf4z4h2q5f20wm9ysjh2h2i"; + nativeBuildInputs = [ dune_2 ]; + extra = { + buildPhase = "dune build -p rope"; + installPhase = '' + dune install --prefix $out --libdir $OCAMLFIND_DESTDIR rope + ''; + }; + } else { + version = "0.5"; + url = "https://forge.ocamlcore.org/frs/download.php/1156/rope-0.5.tar.gz"; + sha256 = "05fr2f5ch2rqhyaj06rv5218sbg99p1m9pq5sklk04hpslxig21f"; + nativeBuildInputs = [ ocamlbuild ]; + extra = { createFindlibDestdir = true; }; + }; +in + +stdenv.mkDerivation ({ + pname = "ocaml${ocaml.version}-rope"; + inherit (param) version; + + src = fetchurl { + inherit (param) url sha256; + }; + + nativeBuildInputs = [ ocaml findlib ] ++ param.nativeBuildInputs; + buildInputs = [ benchmark ] ; + + strictDeps = true; + + meta = { + homepage = "http://rope.forge.ocamlcore.org/"; + platforms = ocaml.meta.platforms or []; + description = ''Ropes ("heavyweight strings") in OCaml''; + license = lib.licenses.lgpl21; + maintainers = with lib.maintainers; [ volth ]; + }; +} // param.extra) diff --git a/pkgs/development/ocaml-modules/rosetta/default.nix b/pkgs/development/ocaml-modules/rosetta/default.nix new file mode 100644 index 00000000000..3675b899426 --- /dev/null +++ b/pkgs/development/ocaml-modules/rosetta/default.nix @@ -0,0 +1,34 @@ +{ buildDunePackage +, coin +, fetchzip +, lib +, yuscii +, uuuu +}: + +buildDunePackage rec { + pname = "rosetta"; + version = "0.3.0"; + + src = fetchzip { + url = "https://github.com/mirage/rosetta/releases/download/v${version}/rosetta-v${version}.tbz"; + sha256 = "1gzp3fbk8qd207cm25dgj9kj7b44ldqpjs63pl6xqvi9hx60m3ij"; + }; + + useDune2 = true; + + propagatedBuildInputs = [ + coin + uuuu + yuscii + ]; + + doCheck = false; # No tests. + + meta = { + description = "Universal decoder of an encoded flow (UTF-7, ISO-8859 and KOI8) to Unicode"; + license = lib.licenses.mit; + homepage = "https://github.com/mirage/rosetta"; + maintainers = with lib.maintainers; [ ]; + }; +} diff --git a/pkgs/development/ocaml-modules/routes/default.nix b/pkgs/development/ocaml-modules/routes/default.nix new file mode 100644 index 00000000000..a83d0db5d84 --- /dev/null +++ b/pkgs/development/ocaml-modules/routes/default.nix @@ -0,0 +1,21 @@ +{ lib, fetchurl, buildDunePackage }: + +buildDunePackage rec { + pname = "routes"; + version = "0.9.1"; + + useDune2 = true; + minimalOCamlVersion = "4.05"; + + src = fetchurl { + url = "https://github.com/anuragsoni/routes/releases/download/${version}/routes-${version}.tbz"; + sha256 = "0h2c1p5w6237c1lmsl5c8q2dj5dq20gf2cmb12nbmlfn12sfmcrl"; + }; + + meta = with lib; { + description = "Typed routing for OCaml applications"; + license = licenses.bsd3; + homepage = "https://anuragsoni.github.io/routes"; + maintainers = with maintainers; [ ulrikstrid anmonteiro ]; + }; +} diff --git a/pkgs/development/ocaml-modules/rpclib/default.nix b/pkgs/development/ocaml-modules/rpclib/default.nix new file mode 100644 index 00000000000..311c4caaada --- /dev/null +++ b/pkgs/development/ocaml-modules/rpclib/default.nix @@ -0,0 +1,29 @@ +{ lib, fetchurl, buildDunePackage +, alcotest +, base64, cmdliner, rresult, xmlm, yojson +}: + +buildDunePackage rec { + pname = "rpclib"; + version = "8.1.0"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/mirage/ocaml-rpc/releases/download/v${version}/rpclib-v${version}.tbz"; + sha256 = "0fbajg8wq8hjhkvvfnq68br0m0pa8zf2qzadhfgi2nnr9713rada"; + }; + + buildInputs = [ cmdliner yojson ]; + propagatedBuildInputs = [ base64 rresult xmlm ]; + checkInputs = [ alcotest ]; + + doCheck = true; + + meta = with lib; { + homepage = "https://github.com/mirage/ocaml-rpc"; + description = "Light library to deal with RPCs in OCaml"; + license = licenses.isc; + maintainers = [ maintainers.vyorkin ]; + }; +} diff --git a/pkgs/development/ocaml-modules/rpclib/lwt.nix b/pkgs/development/ocaml-modules/rpclib/lwt.nix new file mode 100644 index 00000000000..49f71847498 --- /dev/null +++ b/pkgs/development/ocaml-modules/rpclib/lwt.nix @@ -0,0 +1,18 @@ +{ lib, buildDunePackage, rpclib +, lwt +, alcotest-lwt, ppx_deriving_rpc, yojson +}: + +buildDunePackage { + pname = "rpclib-lwt"; + inherit (rpclib) version useDune2 src; + + propagatedBuildInputs = [ lwt rpclib ]; + + checkInputs = [ alcotest-lwt ppx_deriving_rpc yojson ]; + doCheck = true; + + meta = rpclib.meta // { + description = "A library to deal with RPCs in OCaml - Lwt interface"; + }; +} diff --git a/pkgs/development/ocaml-modules/rresult/default.nix b/pkgs/development/ocaml-modules/rresult/default.nix new file mode 100644 index 00000000000..cdc3a1dba68 --- /dev/null +++ b/pkgs/development/ocaml-modules/rresult/default.nix @@ -0,0 +1,27 @@ +{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, topkg, result }: + +stdenv.mkDerivation rec { + pname = "ocaml${ocaml.version}-rresult"; + version = "0.6.0"; + src = fetchurl { + url = "https://erratique.ch/software/rresult/releases/rresult-${version}.tbz"; + sha256 = "1k69a3gvrk7f2cshwjzvk7818f0bwxhacgd14wxy6d4gmrggci86"; + }; + + nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ]; + buildInputs = [ topkg ]; + + propagatedBuildInputs = [ result ]; + + strictDeps = true; + + inherit (topkg) buildPhase installPhase; + + meta = { + license = lib.licenses.isc; + homepage = "https://erratique.ch/software/rresult"; + description = "Result value combinators for OCaml"; + maintainers = [ lib.maintainers.vbgl ]; + inherit (ocaml.meta) platforms; + }; +} diff --git a/pkgs/development/ocaml-modules/safepass/default.nix b/pkgs/development/ocaml-modules/safepass/default.nix new file mode 100644 index 00000000000..e8a50f45119 --- /dev/null +++ b/pkgs/development/ocaml-modules/safepass/default.nix @@ -0,0 +1,23 @@ +{ lib, fetchFromGitHub, buildDunePackage }: + +buildDunePackage rec { + pname = "safepass"; + version = "3.1"; + + useDune2 = true; + + src = fetchFromGitHub { + owner = "darioteixeira"; + repo = "ocaml-safepass"; + rev = "v${version}"; + sha256 = "1cwslwdb1774lfmhcclj9kymvidbcpjx1vp16jnjirqdqgl4zs5q"; + }; + + meta = { + inherit (src.meta) homepage; + description = "An OCaml library offering facilities for the safe storage of user passwords"; + license = lib.licenses.lgpl21; + maintainers = with lib.maintainers; [ vbgl ]; + }; + +} diff --git a/pkgs/development/ocaml-modules/sawja/Makefile.config.example.patch b/pkgs/development/ocaml-modules/sawja/Makefile.config.example.patch new file mode 100644 index 00000000000..4f2cc99e76b --- /dev/null +++ b/pkgs/development/ocaml-modules/sawja/Makefile.config.example.patch @@ -0,0 +1,9 @@ +--- sawja-1.5-orig/Makefile.config.example 2013-10-30 08:35:29.000000000 +0100 ++++ sawja-1.5/Makefile.config.example 2014-07-05 18:54:37.902423482 +0200 +@@ -1,6 +1,3 @@ +-export OCAMLFIND_DESTDIR=$(LOCALDEST) +-export OCAMLPATH=$(LOCALDEST) +- + RECODE=-charset utf-8 + DOCDIR = doc/api + diff --git a/pkgs/development/ocaml-modules/sawja/configure.sh.patch b/pkgs/development/ocaml-modules/sawja/configure.sh.patch new file mode 100644 index 00000000000..8165de242f5 --- /dev/null +++ b/pkgs/development/ocaml-modules/sawja/configure.sh.patch @@ -0,0 +1,11 @@ +--- sawja-1.5-orig/configure.sh 2013-10-30 08:35:29.000000000 +0100 ++++ sawja-1.5/configure.sh 2014-07-05 18:50:26.833798254 +0200 +@@ -39,7 +39,7 @@ + DESTDIR= + # The ocamlpath variable for the compiler to locate the locally-installed + # packages (depends on LOCALDEST) +-OCAMLPATH= ++#OCAMLPATH= + # The path to ocamlfind + FINDER=`which ocamlfind` + # The perl executable diff --git a/pkgs/development/ocaml-modules/sawja/default.nix b/pkgs/development/ocaml-modules/sawja/default.nix new file mode 100644 index 00000000000..3b0878155a5 --- /dev/null +++ b/pkgs/development/ocaml-modules/sawja/default.nix @@ -0,0 +1,50 @@ +{ lib, stdenv, fetchFromGitHub, which, ocaml, findlib, javalib }: + +let + pname = "sawja"; + version = "1.5.10"; + webpage = "http://sawja.inria.fr/"; +in + +if !lib.versionAtLeast ocaml.version "4.07" +then throw "${pname} is not available for OCaml ${ocaml.version}" +else + +stdenv.mkDerivation { + + pname = "ocaml${ocaml.version}-${pname}"; + + inherit version; + + src = fetchFromGitHub { + owner = "javalib-team"; + repo = pname; + rev = version; + sha256 = "sha256:0k51rscs9mdgpg3qn4cahql5ncdvlb207m015hr8v6r1vfgn0ddq"; + }; + + nativeBuildInputs = [ which ocaml findlib ]; + + strictDeps = true; + + patches = [ ./configure.sh.patch ./Makefile.config.example.patch ]; + + createFindlibDestdir = true; + + preConfigure = "patchShebangs ./configure.sh"; + + configureScript = "./configure.sh"; + dontAddPrefix = "true"; + dontAddStaticConfigureFlags = true; + configurePlatforms = []; + + propagatedBuildInputs = [ javalib ]; + + meta = with lib; { + description = "A library written in OCaml, relying on Javalib to provide a high level representation of Java bytecode programs"; + homepage = webpage; + license = licenses.gpl3Plus; + maintainers = [ maintainers.vbgl ]; + platforms = ocaml.meta.platforms or []; + }; +} diff --git a/pkgs/development/ocaml-modules/secp256k1-internal/default.nix b/pkgs/development/ocaml-modules/secp256k1-internal/default.nix new file mode 100644 index 00000000000..f7d3c1e41c5 --- /dev/null +++ b/pkgs/development/ocaml-modules/secp256k1-internal/default.nix @@ -0,0 +1,48 @@ +{ lib +, fetchFromGitLab +, buildDunePackage +, gmp +, dune-configurator +, cstruct +, bigstring +, alcotest +, hex +}: + +buildDunePackage rec { + pname = "secp256k1-internal"; + version = "0.2"; + src = fetchFromGitLab { + owner = "nomadic-labs"; + repo = "ocaml-secp256k1-internal"; + rev = "v${version}"; + sha256 = "1g9fyi78nmmm19l2cggwj14m4n80rz7gmnh1gq376zids71s6qxv"; + }; + + useDune2 = true; + + minimalOCamlVersion = "4.08"; + + propagatedBuildInputs = [ + gmp + cstruct + bigstring + ]; + + buildInputs = [ + dune-configurator + ]; + + checkInputs = [ + alcotest + hex + ]; + + doCheck = true; + + meta = { + description = "Bindings to secp256k1 internal functions (generic operations on the curve)"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.ulrikstrid ]; + }; +} diff --git a/pkgs/development/ocaml-modules/secp256k1/default.nix b/pkgs/development/ocaml-modules/secp256k1/default.nix new file mode 100644 index 00000000000..7ad18fba81c --- /dev/null +++ b/pkgs/development/ocaml-modules/secp256k1/default.nix @@ -0,0 +1,24 @@ +{ lib, fetchFromGitHub, buildDunePackage, base, stdio, dune-configurator, secp256k1 }: + +buildDunePackage rec { + pname = "secp256k1"; + version = "0.4.1"; + + useDune2 = true; + + src = fetchFromGitHub { + owner = "dakk"; + repo = "secp256k1-ml"; + rev = version; + sha256 = "0jkd7mc5kynhg0b76dfk70pww97qsq2jbd991634i16xf8qja9fj"; + }; + + buildInputs = [ base stdio dune-configurator secp256k1 ]; + + meta = with lib; { + homepage = "https://github.com/dakk/secp256k1-ml"; + description = "Elliptic curve library secp256k1 wrapper for Ocaml"; + license = licenses.mit; + maintainers = [ maintainers.vyorkin ]; + }; +} diff --git a/pkgs/development/ocaml-modules/sedlex/2.nix b/pkgs/development/ocaml-modules/sedlex/2.nix new file mode 100644 index 00000000000..9f4badbc7ca --- /dev/null +++ b/pkgs/development/ocaml-modules/sedlex/2.nix @@ -0,0 +1,67 @@ +{ lib +, fetchFromGitHub +, fetchurl +, buildDunePackage +, ocaml +, gen +, ppxlib +, uchar +}: + +if lib.versionOlder ocaml.version "4.08" +then throw "sedlex is not available for OCaml ${ocaml.version}" +else + +let + unicodeVersion = "13.0.0"; + baseUrl = "https://www.unicode.org/Public/${unicodeVersion}"; + + DerivedCoreProperties = fetchurl { + url = "${baseUrl}/ucd/DerivedCoreProperties.txt"; + sha256 = "0j12x112cd8fpgazkc8izxnhhpia44p1m36ff8yapslxndcmzm55"; + }; + DerivedGeneralCategory = fetchurl { + url = "${baseUrl}/ucd/extracted/DerivedGeneralCategory.txt"; + sha256 = "0w6mkz4w79k23bnmwgfxc4yqc2ypv8ilrjn6nk25hrafksbg00j5"; + }; + PropList = fetchurl { + url = "${baseUrl}/ucd/PropList.txt"; + sha256 = "1ks0585wimygbk2wqi9hqg8gyl25iffvdad5vya1zgsxs8z5lns8"; + }; +in +buildDunePackage rec { + pname = "sedlex"; + version = "2.4"; + + useDune2 = true; + + src = fetchFromGitHub { + owner = "ocaml-community"; + repo = "sedlex"; + rev = "v${version}"; + sha256 = "13g8az4zqg6hrnxmy3qrasslppzlag13dd1dsr8vlpg2vpfmfv6i"; + }; + + propagatedBuildInputs = [ + gen uchar ppxlib + ]; + + preBuild = '' + rm src/generator/data/dune + ln -s ${DerivedCoreProperties} src/generator/data/DerivedCoreProperties.txt + ln -s ${DerivedGeneralCategory} src/generator/data/DerivedGeneralCategory.txt + ln -s ${PropList} src/generator/data/PropList.txt + ''; + + doCheck = true; + + dontStrip = true; + + meta = { + homepage = "https://github.com/ocaml-community/sedlex"; + changelog = "https://github.com/ocaml-community/sedlex/raw/v${version}/CHANGES"; + description = "An OCaml lexer generator for Unicode"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.marsam ]; + }; +} diff --git a/pkgs/development/ocaml-modules/sedlex/default.nix b/pkgs/development/ocaml-modules/sedlex/default.nix new file mode 100644 index 00000000000..b808145bcbb --- /dev/null +++ b/pkgs/development/ocaml-modules/sedlex/default.nix @@ -0,0 +1,37 @@ +{ stdenv, lib, fetchFromGitHub, ocaml, findlib, gen, ppx_tools_versioned, ocaml-migrate-parsetree }: + +if !lib.versionAtLeast ocaml.version "4.02" +then throw "sedlex is not available for OCaml ${ocaml.version}" +else + +stdenv.mkDerivation rec { + pname = "ocaml${ocaml.version}-sedlex"; + version = "1.99.5"; + + src = fetchFromGitHub { + owner = "ocaml-community"; + repo = "sedlex"; + rev = "fb84e1766fc4b29e79ec40029ffee5cdb37b392f"; + sha256 = "sha256-VhzlDTYBFXgKWT69PqZYLuHkiaDwzhmyX2XfaqzHFl4="; + }; + + nativeBuildInputs = [ ocaml findlib ]; + + propagatedBuildInputs = [ gen ocaml-migrate-parsetree ppx_tools_versioned ]; + + strictDeps = true; + + buildFlags = [ "all" "opt" ]; + + createFindlibDestdir = true; + + dontStrip = true; + + meta = { + homepage = "https://github.com/ocaml-community/sedlex"; + description = "An OCaml lexer generator for Unicode"; + license = lib.licenses.mit; + inherit (ocaml.meta) platforms; + maintainers = [ lib.maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/semaphore-compat/default.nix b/pkgs/development/ocaml-modules/semaphore-compat/default.nix new file mode 100644 index 00000000000..a686ef42e70 --- /dev/null +++ b/pkgs/development/ocaml-modules/semaphore-compat/default.nix @@ -0,0 +1,20 @@ +{ lib, buildDunePackage, fetchurl }: + +buildDunePackage rec { + pname = "semaphore-compat"; + version = "1.0.1"; + + src = fetchurl { + url = "https://github.com/mirage/semaphore-compat/releases/download/${version}/semaphore-compat-${version}.tbz"; + sha256 = "139c5rxdp4dg1jcwyyxvhxr8213l1xdl2ab0mc288rfcppsiyxrb"; + }; + + useDune2 = true; + + meta = with lib; { + description = "Compatibility Semaphore module"; + homepage = "https://github.com/mirage/semaphore-compat"; + license = licenses.lgpl21Only; + maintainers = [ maintainers.sternenseemann ]; + }; +} diff --git a/pkgs/development/ocaml-modules/seq/default.nix b/pkgs/development/ocaml-modules/seq/default.nix new file mode 100644 index 00000000000..6131585e34b --- /dev/null +++ b/pkgs/development/ocaml-modules/seq/default.nix @@ -0,0 +1,43 @@ +{ stdenv, lib, fetchFromGitHub, ocaml, findlib, ocamlbuild }: + +stdenv.mkDerivation ({ + version = "0.1"; + pname = "ocaml${ocaml.version}-seq"; + + meta = { + license = lib.licenses.lgpl21; + maintainers = [ lib.maintainers.vbgl ]; + homepage = "https://github.com/c-cube/seq"; + inherit (ocaml.meta) platforms; + }; + +} // (if lib.versionOlder ocaml.version "4.07" then { + + src = fetchFromGitHub { + owner = "c-cube"; + repo = "seq"; + rev = "0.1"; + sha256 = "1cjpsc7q76yfgq9iyvswxgic4kfq2vcqdlmxjdjgd4lx87zvcwrv"; + }; + + nativeBuildInputs = [ ocaml findlib ocamlbuild ]; + strictDeps = true; + + createFindlibDestdir = true; + + 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 00000000000..06b95eff3f8 --- /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="" diff --git a/pkgs/development/ocaml-modules/sha/default.nix b/pkgs/development/ocaml-modules/sha/default.nix new file mode 100644 index 00000000000..4cbb658b654 --- /dev/null +++ b/pkgs/development/ocaml-modules/sha/default.nix @@ -0,0 +1,31 @@ +{ lib, fetchurl, buildDunePackage, stdlib-shims, dune-configurator, ounit }: + +buildDunePackage rec { + pname = "sha"; + version = "1.15.1"; + + src = fetchurl { + url = "https://github.com/djs55/ocaml-${pname}/releases/download/v${version}/${pname}-v${version}.tbz"; + sha256 = "sha256-cRtjydvwgXgimi6F3C48j7LrWgfMO6m9UJKjKlxvp0Q="; + }; + + useDune2 = true; + + buildInputs = [ dune-configurator ]; + + propagatedBuildInputs = [ + stdlib-shims + ]; + + doCheck = true; + checkInputs = [ + ounit + ]; + + meta = with lib; { + description = "Binding for SHA interface code in OCaml"; + homepage = "https://github.com/djs55/ocaml-sha/"; + license = licenses.isc; + maintainers = with maintainers; [ arthurteisseire ]; + }; +} diff --git a/pkgs/development/ocaml-modules/shared-memory-ring/default.nix b/pkgs/development/ocaml-modules/shared-memory-ring/default.nix new file mode 100644 index 00000000000..3a96d4adee4 --- /dev/null +++ b/pkgs/development/ocaml-modules/shared-memory-ring/default.nix @@ -0,0 +1,41 @@ +{ lib +, buildDunePackage +, fetchurl +, ppx_cstruct +, mirage-profile +, cstruct +, ounit +}: + +buildDunePackage rec { + pname = "shared-memory-ring"; + version = "3.1.0"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/mirage/shared-memory-ring/releases/download/v${version}/shared-memory-ring-v${version}.tbz"; + sha256 = "06350ph3rdfvybi0cgs3h3rdkmjspk3c4375rxvbdg0kza1w22x1"; + }; + + nativeBuildInputs = [ + ppx_cstruct + ]; + + propagatedBuildInputs = [ + mirage-profile + cstruct + ]; + + doCheck = true; + checkInputs = [ + ounit + ]; + + meta = with lib; { + description = "Shared memory rings for RPC and bytestream communications"; + license = licenses.isc; + homepage = "https://github.com/mirage/shared-memory-ring"; + maintainers = [ maintainers.sternenseemann ]; + }; +} diff --git a/pkgs/development/ocaml-modules/shared-memory-ring/lwt.nix b/pkgs/development/ocaml-modules/shared-memory-ring/lwt.nix new file mode 100644 index 00000000000..8f41253bab8 --- /dev/null +++ b/pkgs/development/ocaml-modules/shared-memory-ring/lwt.nix @@ -0,0 +1,37 @@ +{ lib +, buildDunePackage +, shared-memory-ring +, ppx_cstruct +, cstruct +, lwt +, lwt-dllist +, mirage-profile +, ounit +}: + +buildDunePackage { + pname = "shared-memory-ring-lwt"; + + inherit (shared-memory-ring) version src useDune2; + + buildInputs = [ + ppx_cstruct + ]; + + propagatedBuildInputs = [ + shared-memory-ring + cstruct + lwt + lwt-dllist + mirage-profile + ]; + + doCheck = true; + checkInputs = [ + ounit + ]; + + meta = shared-memory-ring.meta // { + description = "Shared memory rings for RPC and bytestream communications using Lwt"; + }; +} diff --git a/pkgs/development/ocaml-modules/shine/default.nix b/pkgs/development/ocaml-modules/shine/default.nix new file mode 100644 index 00000000000..3aa8cce7980 --- /dev/null +++ b/pkgs/development/ocaml-modules/shine/default.nix @@ -0,0 +1,25 @@ +{ lib, buildDunePackage, fetchFromGitHub, dune-configurator, shine }: + +buildDunePackage rec { + pname = "shine"; + version = "0.2.2"; + + useDune2 = true; + + src = fetchFromGitHub { + owner = "savonet"; + repo = "ocaml-shine"; + rev = "2e1de686ea031f1056df389161ea2b721bfdb39e"; + sha256 = "0v6i4ym5zijki6ffkp2qkp00lk4fysjhmg690xscj23gwz4zx8ir"; + }; + + buildInputs = [ dune-configurator ]; + propagatedBuildInputs = [ shine ]; + + meta = with lib; { + homepage = "https://github.com/savonet/ocaml-shine"; + description = "Bindings to the fixed-point mp3 encoding library shine"; + license = licenses.gpl2Only; + maintainers = with maintainers; [ dandellion ]; + }; +} diff --git a/pkgs/development/ocaml-modules/sodium/default.nix b/pkgs/development/ocaml-modules/sodium/default.nix new file mode 100644 index 00000000000..040a34ef6f1 --- /dev/null +++ b/pkgs/development/ocaml-modules/sodium/default.nix @@ -0,0 +1,34 @@ +{ lib, stdenv, fetchFromGitHub, ocaml, findlib, ocamlbuild, ctypes, libsodium }: + +stdenv.mkDerivation rec { + pname = "ocaml${ocaml.version}-sodium"; + version = "0.6.0"; + + src = fetchFromGitHub { + owner = "dsheets"; + repo = "ocaml-sodium"; + rev = version; + sha256 = "124gpi1jhac46x05gp5viykyrafnlp03v1cmkl13c6pgcs8w04pv"; + }; + + patches = [ + # ctypes.stubs no longer pulls in bigarray automatically + ./lib-gen-link-bigarray.patch + ]; + + nativeBuildInputs = [ ocaml findlib ocamlbuild ]; + propagatedBuildInputs = [ ctypes libsodium ]; + + strictDeps = true; + + createFindlibDestdir = true; + + hardeningDisable = lib.optional stdenv.isDarwin "strictoverflow"; + + meta = with lib; { + homepage = "https://github.com/dsheets/ocaml-sodium"; + description = "Binding to libsodium 1.0.9+"; + platforms = ocaml.meta.platforms or []; + maintainers = [ maintainers.rixed ]; + }; +} diff --git a/pkgs/development/ocaml-modules/sodium/lib-gen-link-bigarray.patch b/pkgs/development/ocaml-modules/sodium/lib-gen-link-bigarray.patch new file mode 100644 index 00000000000..f05f5332097 --- /dev/null +++ b/pkgs/development/ocaml-modules/sodium/lib-gen-link-bigarray.patch @@ -0,0 +1,7 @@ +diff --git a/lib_gen/_tags b/lib_gen/_tags +index 7a7e632..7a4e0b7 100644 +--- a/lib_gen/_tags ++++ b/lib_gen/_tags +@@ -1 +1 @@ +-<*.{ml,byte,native}>: package(ctypes.stubs) ++<*.{ml,byte,native}>: package(ctypes.stubs), package(bigarray) diff --git a/pkgs/development/ocaml-modules/sosa/default.nix b/pkgs/development/ocaml-modules/sosa/default.nix new file mode 100644 index 00000000000..141e2a50193 --- /dev/null +++ b/pkgs/development/ocaml-modules/sosa/default.nix @@ -0,0 +1,36 @@ +{ lib, fetchFromGitHub, stdenv +, findlib, ocaml, ocamlbuild +}: + +if !lib.versionAtLeast ocaml.version "4.02" +then throw "sosa is not available for OCaml ${ocaml.version}" +else + +stdenv.mkDerivation rec { + pname = "ocaml${ocaml.version}-sosa"; + version = "0.3.0"; + + src = fetchFromGitHub { + owner = "hammerlab"; + repo = "sosa"; + rev = "sosa.${version}"; + sha256 = "053hdv6ww0q4mivajj4iyp7krfvgq8zajq9d8x4mia4lid7j0dyk"; + }; + + nativeBuildInputs = [ ocaml ocamlbuild findlib ]; + + strictDeps = true; + + buildPhase = "make build"; + + createFindlibDestdir = true; + + doCheck = true; + + meta = with lib; { + homepage = "http://www.hammerlab.org/docs/sosa/master/index.html"; + description = "Sane OCaml String API"; + license = licenses.isc; + maintainers = [ maintainers.alexfmpe ]; + }; +} diff --git a/pkgs/development/ocaml-modules/spacetime_lib/default.nix b/pkgs/development/ocaml-modules/spacetime_lib/default.nix new file mode 100644 index 00000000000..442d06e4f69 --- /dev/null +++ b/pkgs/development/ocaml-modules/spacetime_lib/default.nix @@ -0,0 +1,31 @@ +{ lib, fetchFromGitHub, buildDunePackage, ocaml, owee }: + +lib.throwIfNot (lib.versionAtLeast "4.12" ocaml.version) + "spacetime_lib is not available for OCaml ${ocaml.version}" + +buildDunePackage rec { + pname = "spacetime_lib"; + version = "0.3.0"; + + useDune2 = true; + + src = fetchFromGitHub { + owner = "lpw25"; + repo = "spacetime_lib"; + rev = version; + sha256 = "0biisgbycr5v3nm5jp8i0h6vq76vzasdjkcgh8yr7fhxc81jgv3p"; + }; + + propagatedBuildInputs = [ owee ]; + + preConfigure = '' + bash ./configure.sh + ''; + + meta = { + description = "An OCaml library providing some simple operations for handling OCaml “spacetime” profiles"; + inherit (src.meta) homepage; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/speex/default.nix b/pkgs/development/ocaml-modules/speex/default.nix new file mode 100644 index 00000000000..1bf5f308ecf --- /dev/null +++ b/pkgs/development/ocaml-modules/speex/default.nix @@ -0,0 +1,25 @@ +{ lib, buildDunePackage, fetchFromGitHub, dune-configurator, ogg, speex }: + +buildDunePackage rec { + pname = "speex"; + version = "0.4.1"; + + useDune2 = true; + + src = fetchFromGitHub { + owner = "savonet"; + repo = "ocaml-speex"; + rev = "v${version}"; + sha256 = "0p4ip37kihlz9qy604llak2kzd00g45ix1yiihnrri2nm01scfab"; + }; + + buildInputs = [ dune-configurator ]; + propagatedBuildInputs = [ ogg speex.dev ]; + + meta = with lib; { + homepage = "https://github.com/savonet/ocaml-speex"; + description = "Bindings to libspeex"; + license = licenses.gpl2Only; + maintainers = with maintainers; [ dandellion ]; + }; +} diff --git a/pkgs/development/ocaml-modules/spelll/default.nix b/pkgs/development/ocaml-modules/spelll/default.nix new file mode 100644 index 00000000000..9df0779e53a --- /dev/null +++ b/pkgs/development/ocaml-modules/spelll/default.nix @@ -0,0 +1,26 @@ +{ lib, fetchFromGitHub, buildDunePackage +, seq +}: + +buildDunePackage rec { + pname = "spelll"; + version = "0.3"; + + useDune2 = true; + + src = fetchFromGitHub { + owner = "c-cube"; + repo = pname; + rev = "v${version}"; + sha256 = "03adqisgsazsxdkrypp05k3g91hydfgcif2014il63gdbd9nhzlh"; + }; + + propagatedBuildInputs = [ seq ]; + + meta = { + inherit (src.meta) homepage; + description = "Fuzzy string searching, using Levenshtein automaton"; + license = lib.licenses.bsd2; + maintainers = [ lib.maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/sqlite3/default.nix b/pkgs/development/ocaml-modules/sqlite3/default.nix new file mode 100644 index 00000000000..90b469288c7 --- /dev/null +++ b/pkgs/development/ocaml-modules/sqlite3/default.nix @@ -0,0 +1,25 @@ +{ lib, fetchurl, sqlite, pkg-config, buildDunePackage, dune-configurator }: + +buildDunePackage rec { + pname = "sqlite3"; + version = "5.0.2"; + useDune2 = true; + minimumOCamlVersion = "4.05"; + + src = fetchurl { + url = "https://github.com/mmottl/sqlite3-ocaml/releases/download/${version}/sqlite3-${version}.tbz"; + sha256 = "0sba74n0jvzxibrclhbpqscil36yfw7i9jj9q562yhza6rax9p82"; + }; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ dune-configurator sqlite ]; + + meta = with lib; { + homepage = "http://mmottl.github.io/sqlite3-ocaml/"; + description = "OCaml bindings to the SQLite 3 database access library"; + license = licenses.mit; + maintainers = with maintainers; [ + maggesi vbgl + ]; + }; +} diff --git a/pkgs/development/ocaml-modules/sqlite3EZ/default.nix b/pkgs/development/ocaml-modules/sqlite3EZ/default.nix new file mode 100644 index 00000000000..6009eaecce1 --- /dev/null +++ b/pkgs/development/ocaml-modules/sqlite3EZ/default.nix @@ -0,0 +1,36 @@ +{ lib, stdenv, fetchFromGitHub, ocaml, findlib, ocamlbuild, twt, ocaml_sqlite3 }: + +assert lib.versionAtLeast (lib.getVersion ocaml) "3.12"; + +if lib.versionAtLeast ocaml.version "4.06" +then throw "sqlite3EZ is not available for OCaml ${ocaml.version}" +else + +stdenv.mkDerivation rec { + pname = "ocaml-sqlite3EZ"; + version = "0.1.0"; + + src = fetchFromGitHub { + owner = "mlin"; + repo = "ocaml-sqlite3EZ"; + rev = "v${version}"; + sha256 = "sha256-pKysvth0efxJeyJQY2Dnqarg7OtsKyyLnFV/1ZhsfDY="; + }; + + nativeBuildInputs = [ ocaml findlib ocamlbuild ]; + buildInputs = [ twt ]; + + propagatedBuildInputs = [ ocaml_sqlite3 ]; + + strictDeps = true; + + createFindlibDestdir = true; + + meta = with lib; { + homepage = "https://github.com/mlin/ocaml-sqlite3EZ"; + description = "A thin wrapper for sqlite3-ocaml with a simplified interface"; + license = licenses.mit; + maintainers = [ maintainers.vbgl ]; + platforms = ocaml.meta.platforms or [ ]; + }; +} diff --git a/pkgs/development/ocaml-modules/srt/default.nix b/pkgs/development/ocaml-modules/srt/default.nix new file mode 100644 index 00000000000..7f0897ae662 --- /dev/null +++ b/pkgs/development/ocaml-modules/srt/default.nix @@ -0,0 +1,30 @@ +{ lib, buildDunePackage, fetchFromGitHub +, dune-configurator +, posix-socket +, srt +}: + +buildDunePackage rec { + pname = "srt"; + version = "0.1.1"; + + src = fetchFromGitHub { + owner = "savonet"; + repo = "ocaml-srt"; + rev = "v${version}"; + sha256 = "0xh89w4j7lljvpy2n08x6m9kw88f82snmzf23kp0gw637sjnrj6f"; + }; + + useDune2 = true; + + buildInputs = [ dune-configurator ]; + propagatedBuildInputs = [ posix-socket srt ]; + + meta = { + description = "OCaml bindings for the libsrt library"; + license = lib.licenses.gpl2Only; + inherit (src.meta) homepage; + maintainers = [ lib.maintainers.vbgl ]; + }; + +} diff --git a/pkgs/development/ocaml-modules/ssl/default.nix b/pkgs/development/ocaml-modules/ssl/default.nix new file mode 100644 index 00000000000..04f181d7598 --- /dev/null +++ b/pkgs/development/ocaml-modules/ssl/default.nix @@ -0,0 +1,30 @@ +{ lib, buildDunePackage, fetchFromGitHub, pkg-config, openssl +, dune-configurator }: + +buildDunePackage rec { + pname = "ssl"; + version = "0.5.10"; + + src = fetchFromGitHub { + owner = "savonet"; + repo = "ocaml-ssl"; + rev = "v${version}"; + sha256 = "1rszqiqayh67xlwd5411k8vib47x9kapdr037z1majd2c14z3kcb"; + }; + + useDune2 = true; + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ dune-configurator ]; + propagatedBuildInputs = [openssl]; + + meta = { + homepage = "http://savonet.rastageeks.org/"; + description = "OCaml bindings for libssl "; + license = "LGPL+link exception"; + maintainers = [ + lib.maintainers.maggesi + lib.maintainers.anmonteiro + lib.maintainers.dandellion + ]; + }; +} diff --git a/pkgs/development/ocaml-modules/stdcompat/default.nix b/pkgs/development/ocaml-modules/stdcompat/default.nix new file mode 100644 index 00000000000..eae9b264ba1 --- /dev/null +++ b/pkgs/development/ocaml-modules/stdcompat/default.nix @@ -0,0 +1,29 @@ +{ stdenv, lib, fetchurl +, ocaml, findlib +}: + +stdenv.mkDerivation rec { + pname = "ocaml${ocaml.version}-stdcompat"; + version = "18"; + + src = fetchurl { + url = "https://github.com/thierry-martinez/stdcompat/releases/download/v${version}/stdcompat-${version}.tar.gz"; + sha256 = "sha256:01y67rndjlzfp5zq0gbqpg9skqq2hfbvhbq9lfhhk5xidr98sfj8"; + }; + + nativeBuildInputs = [ ocaml findlib ]; + + strictDeps = true; + + # build fails otherwise + enableParallelBuilding = false; + + configureFlags = "--libdir=$(OCAMLFIND_DESTDIR)"; + + meta = { + homepage = "https://github.com/thierry-martinez/stdcompat"; + license = lib.licenses.bsd2; + maintainers = [ lib.maintainers.vbgl ]; + inherit (ocaml.meta) platforms; + }; +} diff --git a/pkgs/development/ocaml-modules/stdint/default.nix b/pkgs/development/ocaml-modules/stdint/default.nix new file mode 100644 index 00000000000..2a4bf2bb633 --- /dev/null +++ b/pkgs/development/ocaml-modules/stdint/default.nix @@ -0,0 +1,47 @@ +{ lib, fetchurl, fetchpatch, buildDunePackage, ocaml, qcheck }: + +buildDunePackage rec { + pname = "stdint"; + version = "0.7.0"; + + useDune2 = true; + + minimumOCamlVersion = "4.03"; + + src = fetchurl { + url = "https://github.com/andrenth/ocaml-stdint/releases/download/${version}/stdint-${version}.tbz"; + sha256 = "4fcc66aef58e2b96e7af3bbca9d910aa239e045ba5fb2400aaef67d0041252dc"; + }; + + patches = [ + # fix test bug, remove at next release + (fetchpatch { + url = "https://github.com/andrenth/ocaml-stdint/commit/fc64293f99f597cdfd4470954da6fb323988e2af.patch"; + sha256 = "0nxck14vfjfzldsf8cdj2jg1cvhnyh37hqnrcxbdkqmpx4rxkbxs"; + }) + ]; + + # 1. disable remaining broken tests, see + # https://github.com/andrenth/ocaml-stdint/issues/59 + # 2. fix tests to liberal test range + # https://github.com/andrenth/ocaml-stdint/pull/61 + postPatch = '' + substituteInPlace tests/stdint_test.ml \ + --replace 'test "An integer should perform left-shifts correctly"' \ + 'skip "An integer should perform left-shifts correctly"' \ + --replace 'test "Logical shifts must not sign-extend"' \ + 'skip "Logical shifts must not sign-extend"' \ + --replace 'let pos_int = QCheck.map_same_type abs in_range' \ + 'let pos_int = QCheck.int_range 0 maxi' + ''; + + doCheck = lib.versionAtLeast ocaml.version "4.08"; + checkInputs = [ qcheck ]; + + meta = { + description = "Various signed and unsigned integers for OCaml"; + homepage = "https://github.com/andrenth/ocaml-stdint"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.gebner ]; + }; +} diff --git a/pkgs/development/ocaml-modules/stdlib-shims/default.nix b/pkgs/development/ocaml-modules/stdlib-shims/default.nix new file mode 100644 index 00000000000..470a2a5bd03 --- /dev/null +++ b/pkgs/development/ocaml-modules/stdlib-shims/default.nix @@ -0,0 +1,19 @@ +{ buildDunePackage, lib, fetchurl, ocaml }: + +buildDunePackage rec { + pname = "stdlib-shims"; + version = "0.3.0"; + src = fetchurl { + url = "https://github.com/ocaml/${pname}/releases/download/${version}/${pname}-${version}.tbz"; + sha256 = "0jnqsv6pqp5b5g7lcjwgd75zqqvcwcl5a32zi03zg1kvj79p5gxs"; + }; + useDune2 = lib.versionAtLeast ocaml.version "4.08"; + minimumOCamlVersion = "4.02"; + doCheck = true; + meta = { + description = "Shims for forward-compatibility between versions of the OCaml standard library"; + homepage = "https://github.com/ocaml/stdlib-shims"; + inherit (ocaml.meta) license; + maintainers = [ lib.maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/stringext/default.nix b/pkgs/development/ocaml-modules/stringext/default.nix new file mode 100644 index 00000000000..3d440cf4895 --- /dev/null +++ b/pkgs/development/ocaml-modules/stringext/default.nix @@ -0,0 +1,26 @@ +{ lib, fetchurl, ocaml, buildDunePackage, ounit, qtest +# Optionally enable tests; test script use OCaml-4.01+ features +, doCheck ? lib.versionAtLeast ocaml.version "4.08" +}: + +let version = "1.6.0"; in + +buildDunePackage { + pname = "stringext"; + version = version; + useDune2 = true; + src = fetchurl { + url = "https://github.com/rgrinberg/stringext/releases/download/${version}/stringext-${version}.tbz"; + sha256 = "1sh6nafi3i9773j5mlwwz3kxfzdjzsfqj2qibxhigawy5vazahfv"; + }; + + checkInputs = [ ounit qtest ]; + inherit doCheck; + + meta = { + homepage = "https://github.com/rgrinberg/stringext"; + description = "Extra string functions for OCaml"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/syslog-message/default.nix b/pkgs/development/ocaml-modules/syslog-message/default.nix new file mode 100644 index 00000000000..2c12415cdbb --- /dev/null +++ b/pkgs/development/ocaml-modules/syslog-message/default.nix @@ -0,0 +1,36 @@ +{ lib, buildDunePackage, fetchurl +, ocaml +, astring, ptime, rresult, qcheck +}: + +buildDunePackage rec { + pname = "syslog-message"; + version = "1.1.0"; + + minimumOCamlVersion = "4.03"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/verbosemode/${pname}/releases/download/${version}/${pname}-${version}.tbz"; + sha256 = "0vy4dkl2q2fa6rzyfsvjyc9r1b9ymfqd6j35z2kp5vdc4r87053g"; + }; + + propagatedBuildInputs = [ + astring + ptime + rresult + ]; + + doCheck = lib.versionAtLeast ocaml.version "4.08"; + checkInputs = [ + qcheck + ]; + + meta = with lib; { + description = "Syslog message parser"; + homepage = "https://github.com/verbosemode/syslog-message"; + license = licenses.bsd2; + maintainers = [ maintainers.sternenseemann ]; + }; +} diff --git a/pkgs/development/ocaml-modules/syslog/default.nix b/pkgs/development/ocaml-modules/syslog/default.nix new file mode 100644 index 00000000000..9614c404c5b --- /dev/null +++ b/pkgs/development/ocaml-modules/syslog/default.nix @@ -0,0 +1,30 @@ +{ lib, stdenv, fetchFromGitHub, ocaml, findlib }: + +assert lib.versionAtLeast (lib.getVersion ocaml) "4.03.0"; + +stdenv.mkDerivation rec { + pname = "ocaml${ocaml.version}-syslog"; + version = "1.5"; + + src = fetchFromGitHub { + owner = "rixed"; + repo = "ocaml-syslog"; + rev = "v${version}"; + sha256 = "1kqpc55ppzv9n555qgqpda49n7nvkqimzisyjx2a7338r7q4r5bw"; + }; + + nativeBuildInputs = [ ocaml findlib ]; + strictDeps = true; + + buildFlags = [ "all" "opt" ]; + + createFindlibDestdir = true; + + meta = with lib; { + homepage = "https://github.com/rixed/ocaml-syslog"; + description = "Simple wrapper to access the system logger from OCaml"; + license = licenses.lgpl21Plus; + platforms = ocaml.meta.platforms or []; + maintainers = [ maintainers.rixed ]; + }; +} diff --git a/pkgs/development/ocaml-modules/tar/default.nix b/pkgs/development/ocaml-modules/tar/default.nix new file mode 100644 index 00000000000..abc28e2d879 --- /dev/null +++ b/pkgs/development/ocaml-modules/tar/default.nix @@ -0,0 +1,39 @@ +{ lib +, fetchFromGitHub +, buildDunePackage +, ppx_cstruct +, cstruct +, re +, ppx_tools +}: + +buildDunePackage rec { + pname = "tar"; + version = "1.1.0"; + src = fetchFromGitHub { + owner = "mirage"; + repo = "ocaml-tar"; + rev = "v${version}"; + sha256 = "14k24vn3q5jl0iyrynb5vwg80670qsv12fsmc6cdgh4zwdpjh7zs"; + }; + + useDune2 = true; + + propagatedBuildInputs = [ + ppx_cstruct + cstruct + re + ]; + + buildInputs = [ + ppx_tools + ]; + + doCheck = true; + + meta = { + description = "Decode and encode tar format files from Unix"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.ulrikstrid ]; + }; +} diff --git a/pkgs/development/ocaml-modules/tar/unix.nix b/pkgs/development/ocaml-modules/tar/unix.nix new file mode 100644 index 00000000000..4ac1f625a02 --- /dev/null +++ b/pkgs/development/ocaml-modules/tar/unix.nix @@ -0,0 +1,27 @@ +{ lib +, buildDunePackage +, tar +, cstruct +, cstruct-lwt +, re +, lwt +}: + +buildDunePackage rec { + pname = "tar-unix"; + inherit (tar) version src useDune2 doCheck; + + propagatedBuildInputs = [ + tar + cstruct + cstruct-lwt + re + lwt + ]; + + meta = { + description = "Decode and encode tar format files from Unix"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.ulrikstrid ]; + }; +} diff --git a/pkgs/development/ocaml-modules/tcpip/default.nix b/pkgs/development/ocaml-modules/tcpip/default.nix new file mode 100644 index 00000000000..ad12cb42d5e --- /dev/null +++ b/pkgs/development/ocaml-modules/tcpip/default.nix @@ -0,0 +1,76 @@ +{ lib, buildDunePackage, fetchurl +, bisect_ppx, ppx_cstruct, pkg-config +, rresult, cstruct, cstruct-lwt, mirage-net, mirage-clock +, mirage-random, mirage-stack, mirage-protocols, mirage-time +, ipaddr, macaddr, macaddr-cstruct, mirage-profile, fmt +, lwt, lwt-dllist, logs, duration, randomconv, ethernet +, alcotest, mirage-flow, mirage-vnetif, pcap-format +, mirage-clock-unix, arp, ipaddr-cstruct, mirage-random-test +, lru, metrics +, withFreestanding ? false +, ocaml-freestanding +}: + +buildDunePackage rec { + pname = "tcpip"; + version = "7.0.1"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/mirage/mirage-${pname}/releases/download/v${version}/${pname}-${version}.tbz"; + sha256 = "0gqj2s9sk3a7f4yavx423a569fvxsrgm0wg58biiv16v37xjaymp"; + }; + + nativeBuildInputs = [ + bisect_ppx + ppx_cstruct + pkg-config + ]; + + propagatedBuildInputs = [ + rresult + cstruct + cstruct-lwt + mirage-net + mirage-clock + mirage-random + mirage-random-test + mirage-stack + mirage-protocols + mirage-time + ipaddr + macaddr + macaddr-cstruct + mirage-profile + fmt + lwt + lwt-dllist + logs + duration + randomconv + ethernet + lru + metrics + arp + ] ++ lib.optionals withFreestanding [ + ocaml-freestanding + ]; + + doCheck = false; + checkInputs = [ + alcotest + mirage-flow + mirage-vnetif + pcap-format + mirage-clock-unix + ipaddr-cstruct + ]; + + meta = with lib; { + description = "OCaml TCP/IP networking stack, used in MirageOS"; + homepage = "https://github.com/mirage/mirage-tcpip"; + maintainers = [ maintainers.sternenseemann ]; + license = licenses.isc; + }; +} diff --git a/pkgs/development/ocaml-modules/tcslib/default.nix b/pkgs/development/ocaml-modules/tcslib/default.nix new file mode 100644 index 00000000000..a8ddea79b77 --- /dev/null +++ b/pkgs/development/ocaml-modules/tcslib/default.nix @@ -0,0 +1,25 @@ +{ lib, fetchFromGitHub, ocamlPackages, buildOasisPackage, ounit, ocaml_extlib, num }: + +buildOasisPackage rec { + pname = "tcslib"; + version = "0.3"; + + minimumOCamlVersion = "4.03.0"; + + src = fetchFromGitHub { + owner = "tcsprojects"; + repo = "tcslib"; + rev = "v${version}"; + sha256 = "05g6m82blsccq8wx8knxv6a5fzww7hi624jx91f9h87nk2fsplhi"; + }; + + buildInputs = [ ounit ]; + propagatedBuildInputs = [ ocaml_extlib num ]; + + meta = { + homepage = "https://github.com/tcsprojects/tcslib"; + description = "A multi-purpose library for OCaml"; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ mgttlinger ]; + }; +} diff --git a/pkgs/development/ocaml-modules/terminal/default.nix b/pkgs/development/ocaml-modules/terminal/default.nix new file mode 100644 index 00000000000..1fcdc1a5cba --- /dev/null +++ b/pkgs/development/ocaml-modules/terminal/default.nix @@ -0,0 +1,30 @@ +{ lib, buildDunePackage, fetchurl, ocaml +, stdlib-shims, uutf, uucp +, alcotest, fmt +}: + +buildDunePackage rec { + pname = "terminal"; + version = "0.2.1"; + + minimalOCamlVersion = "4.03"; + useDune2 = true; + + src = fetchurl { + url = "https://github.com/CraigFe/progress/releases/download/${version}/terminal-${version}.tbz"; + sha256 = "sha256:0vjqkvmpyi8kvmb4vrx3f0994rph8i9pvlrz1dyi126vlb2zbrvs"; + }; + + propagatedBuildInputs = [ stdlib-shims uutf uucp ]; + + doCheck = lib.versionAtLeast ocaml.version "4.05"; + checkInputs = [ alcotest fmt ]; + + meta = with lib; { + description = "Basic utilities for interacting with terminals"; + homepage = "https://github.com/CraigFe/progress"; + license = licenses.mit; + maintainers = [ maintainers.vbgl ]; + }; +} + diff --git a/pkgs/development/ocaml-modules/terminal_size/default.nix b/pkgs/development/ocaml-modules/terminal_size/default.nix new file mode 100644 index 00000000000..9036fc55bef --- /dev/null +++ b/pkgs/development/ocaml-modules/terminal_size/default.nix @@ -0,0 +1,23 @@ +{ lib, buildDunePackage, fetchurl, alcotest }: + +buildDunePackage rec { + pname = "terminal_size"; + version = "0.1.4"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/cryptosense/terminal_size/releases/download/v${version}/terminal_size-v${version}.tbz"; + sha256 = "fdca1fee7d872c4a8e5ab003d9915b6782b272e2a3661ca877f2d78dd25371a7"; + }; + + checkInputs = [ alcotest ]; + doCheck = true; + + meta = with lib; { + description = "Get the dimensions of the terminal"; + homepage = "https://github.com/cryptosense/terminal_size"; + license = licenses.bsd2; + maintainers = [ maintainers.sternenseemann ]; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/010-PtGRANAD-test-helpers.nix b/pkgs/development/ocaml-modules/tezos/010-PtGRANAD-test-helpers.nix new file mode 100644 index 00000000000..fe2664333e3 --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/010-PtGRANAD-test-helpers.nix @@ -0,0 +1,39 @@ +{ lib +, buildDunePackage +, tezos-stdlib +, tezos-stdlib-unix +, tezos-base +, tezos-shell-services +, tezos-protocol-environment +, tezos-protocol-010-PtGRANAD +, tezos-protocol-010-PtGRANAD-parameters +, tezos-client-010-PtGRANAD +, alcotest-lwt +}: + +buildDunePackage { + pname = "tezos-010-PtGRANAD-test-helpers"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src/proto_010_PtGRANAD/lib_protocol/test/helpers"; + + propagatedBuildInputs = [ + tezos-base + tezos-stdlib-unix + tezos-shell-services + tezos-protocol-environment + tezos-protocol-010-PtGRANAD + tezos-protocol-010-PtGRANAD-parameters + tezos-client-010-PtGRANAD + alcotest-lwt + ]; + + checkInputs = [ + alcotest-lwt + ]; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos/Protocol: protocol testing framework"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/011-PtHangz2-test-helpers.nix b/pkgs/development/ocaml-modules/tezos/011-PtHangz2-test-helpers.nix new file mode 100644 index 00000000000..589d6465b20 --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/011-PtHangz2-test-helpers.nix @@ -0,0 +1,35 @@ +{ lib +, buildDunePackage +, tezos-stdlib +, tezos-base +, tezos-client-011-PtHangz2 +, tezos-protocol-011-PtHangz2 +, tezos-protocol-011-PtHangz2-parameters +, tezos-protocol-environment +, tezos-shell-services +, tezos-stdlib-unix +, tezos-test-helpers +}: + +buildDunePackage { + pname = "tezos-011-PtHangz2-test-helpers"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src"; + + propagatedBuildInputs = [ + tezos-base + tezos-client-011-PtHangz2 + tezos-protocol-011-PtHangz2 + tezos-protocol-011-PtHangz2-parameters + tezos-protocol-environment + tezos-shell-services + tezos-stdlib-unix + tezos-test-helpers + ]; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos/Protocol: protocol testing framework"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/base-test-helpers.nix b/pkgs/development/ocaml-modules/tezos/base-test-helpers.nix new file mode 100644 index 00000000000..d9a8307bd30 --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/base-test-helpers.nix @@ -0,0 +1,32 @@ +{ lib +, buildDunePackage +, alcotest +, alcotest-lwt +, tezos-base +, tezos-event-logging-test-helpers +, tezos-stdlib +, tezos-test-helpers +}: + +buildDunePackage { + pname = "tezos-base-test-helpers"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src/lib_base/test_helpers"; + + propagatedBuildInputs = [ + alcotest + alcotest-lwt + tezos-base + tezos-event-logging-test-helpers + ]; + + checkInputs = [ + tezos-test-helpers + ]; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos: base test helpers"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/base.nix b/pkgs/development/ocaml-modules/tezos/base.nix new file mode 100644 index 00000000000..544daa297ac --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/base.nix @@ -0,0 +1,37 @@ +{ lib +, buildDunePackage +, tezos-stdlib +, tezos-crypto +, tezos-hacl-glue-unix +, tezos-micheline +, tezos-test-helpers +, ptime +, ipaddr +, bls12-381-unix +}: + +buildDunePackage { + pname = "tezos-base"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src/lib_base"; + + propagatedBuildInputs = [ + tezos-crypto + tezos-micheline + tezos-hacl-glue-unix + bls12-381-unix + ptime + ipaddr + ]; + + checkInputs = [ + # tezos-test-helpers + ]; + + # circular dependency if we add this + doCheck = false; + + meta = tezos-stdlib.meta // { + description = "Tezos: meta-package and pervasive type definitions for Tezos"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/clic.nix b/pkgs/development/ocaml-modules/tezos/clic.nix new file mode 100644 index 00000000000..863ecb8df45 --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/clic.nix @@ -0,0 +1,28 @@ +{ lib +, buildDunePackage +, tezos-stdlib +, tezos-stdlib-unix +, alcotest +, alcotest-lwt +}: + +buildDunePackage { + pname = "tezos-clic"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src/lib_clic"; + + propagatedBuildInputs = [ + tezos-stdlib-unix + ]; + + checkInputs = [ + alcotest + alcotest-lwt + ]; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos: library of auto-documented command-line-parsing combinators"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/client-010-PtGRANAD.nix b/pkgs/development/ocaml-modules/tezos/client-010-PtGRANAD.nix new file mode 100644 index 00000000000..55a98454508 --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/client-010-PtGRANAD.nix @@ -0,0 +1,38 @@ +{ lib +, buildDunePackage +, tezos-stdlib +, tezos-mockup-registration +, tezos-proxy +, tezos-signer-backends +, tezos-protocol-010-PtGRANAD-parameters +, tezos-protocol-plugin-010-PtGRANAD +, alcotest-lwt +, ppx_inline_test +, cacert +}: + +buildDunePackage { + pname = "tezos-client-010-PtGRANAD"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src/proto_010_PtGRANAD/lib_client"; + + propagatedBuildInputs = [ + tezos-mockup-registration + tezos-proxy + tezos-signer-backends + tezos-protocol-010-PtGRANAD-parameters + tezos-protocol-plugin-010-PtGRANAD + ppx_inline_test + ]; + + checkInputs = [ + alcotest-lwt + cacert + ]; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos/Protocol: protocol specific library for `tezos-client`"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/client-011-PtHangz2.nix b/pkgs/development/ocaml-modules/tezos/client-011-PtHangz2.nix new file mode 100644 index 00000000000..ec564f70f3b --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/client-011-PtHangz2.nix @@ -0,0 +1,44 @@ +{ lib +, buildDunePackage +, tezos-stdlib +, tezos-mockup-registration +, tezos-proxy +, tezos-signer-backends +, tezos-protocol-011-PtHangz2-parameters +, tezos-protocol-plugin-011-PtHangz2 +, alcotest-lwt +, cacert +, ppx_inline_test +, qcheck-alcotest +, tezos-base-test-helpers +, tezos-test-helpers +}: + +buildDunePackage { + pname = "tezos-client-011-PtHangz2"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src"; + + propagatedBuildInputs = [ + tezos-mockup-registration + tezos-proxy + tezos-signer-backends + tezos-protocol-011-PtHangz2-parameters + tezos-protocol-plugin-011-PtHangz2 + ppx_inline_test + ]; + + checkInputs = [ + alcotest-lwt + cacert + qcheck-alcotest + tezos-base-test-helpers + tezos-test-helpers + ]; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos/Protocol: protocol specific library for `tezos-client`"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/client-base.nix b/pkgs/development/ocaml-modules/tezos/client-base.nix new file mode 100644 index 00000000000..f2503481720 --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/client-base.nix @@ -0,0 +1,28 @@ +{ lib +, buildDunePackage +, tezos-stdlib +, tezos-shell-services +, tezos-sapling +, alcotest +}: + +buildDunePackage { + pname = "tezos-client-base"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src/lib_client_base"; + + propagatedBuildInputs = [ + tezos-shell-services + tezos-sapling + ]; + + checkInputs = [ + alcotest + ]; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos: protocol registration for the mockup mode"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/context.nix b/pkgs/development/ocaml-modules/tezos/context.nix new file mode 100644 index 00000000000..e118c3e1ebe --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/context.nix @@ -0,0 +1,34 @@ +{ lib +, buildDunePackage +, tezos-stdlib +, tezos-base +, tezos-shell-services +, irmin +, irmin-pack +, digestif +, alcotest-lwt +}: + +buildDunePackage { + pname = "tezos-context"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src/lib_context"; + + propagatedBuildInputs = [ + tezos-base + tezos-shell-services + irmin + irmin-pack + digestif + ]; + + checkInputs = [ + alcotest-lwt + ]; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos: library of auto-documented RPCs (service and hierarchy descriptions)"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/crypto.nix b/pkgs/development/ocaml-modules/tezos/crypto.nix new file mode 100644 index 00000000000..532e8fc12b2 --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/crypto.nix @@ -0,0 +1,42 @@ +{ lib +, buildDunePackage +, tezos-stdlib +, tezos-rpc +, tezos-clic +, tezos-hacl-glue +, tezos-hacl-glue-unix +, secp256k1-internal +, ringo +, bls12-381 +, bls12-381-unix +, tezos-test-helpers +, alcotest-lwt +}: + +buildDunePackage { + pname = "tezos-crypto"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src/lib_crypto"; + + propagatedBuildInputs = [ + tezos-rpc + tezos-clic + tezos-hacl-glue + tezos-hacl-glue-unix + secp256k1-internal + ringo + bls12-381 + bls12-381-unix + ]; + + checkInputs = [ + tezos-test-helpers + alcotest-lwt + ]; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos: library with all the cryptographic primitives used by Tezos"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/embedded-protocol-010-PtGRANAD.nix b/pkgs/development/ocaml-modules/tezos/embedded-protocol-010-PtGRANAD.nix new file mode 100644 index 00000000000..e2b9a8e8d79 --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/embedded-protocol-010-PtGRANAD.nix @@ -0,0 +1,23 @@ +{ lib +, buildDunePackage +, tezos-stdlib +, tezos-protocol-010-PtGRANAD +, tezos-protocol-updater +}: + +buildDunePackage { + pname = "tezos-embedded-protocol-010-PtGRANAD"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src"; + + propagatedBuildInputs = [ + tezos-protocol-010-PtGRANAD + tezos-protocol-updater + ]; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos/Protocol: economic-protocol definition, embedded in `tezos-node`"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/embedded-protocol-demo-noops.nix b/pkgs/development/ocaml-modules/tezos/embedded-protocol-demo-noops.nix new file mode 100644 index 00000000000..abe4aed67eb --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/embedded-protocol-demo-noops.nix @@ -0,0 +1,23 @@ +{ lib +, buildDunePackage +, tezos-stdlib +, tezos-protocol-demo-noops +, tezos-protocol-updater +}: + +buildDunePackage { + pname = "tezos-embedded-protocol-demo-noops"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src"; + + propagatedBuildInputs = [ + tezos-protocol-demo-noops + tezos-protocol-updater + ]; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos/Protocol: demo_noops (economic-protocol definition, embedded in `tezos-node`)"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/error-monad.nix b/pkgs/development/ocaml-modules/tezos/error-monad.nix new file mode 100644 index 00000000000..cbebf1e51c6 --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/error-monad.nix @@ -0,0 +1,35 @@ +{ lib +, buildDunePackage +, tezos-stdlib +, data-encoding +, lwt +, lwt-canceler +, tezos-lwt-result-stdlib +, alcotest +, alcotest-lwt +}: + +buildDunePackage { + pname = "tezos-error-monad"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src/lib_error_monad"; + + propagatedBuildInputs = [ + tezos-stdlib + data-encoding + lwt + lwt-canceler + tezos-lwt-result-stdlib + ]; + + checkInputs = [ + alcotest + alcotest-lwt + ]; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos: error monad"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/event-logging-test-helpers.nix b/pkgs/development/ocaml-modules/tezos/event-logging-test-helpers.nix new file mode 100644 index 00000000000..0407277bde9 --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/event-logging-test-helpers.nix @@ -0,0 +1,25 @@ +{ lib +, buildDunePackage +, alcotest +, tezos-event-logging +, tezos-stdlib +, tezos-test-helpers +}: + +buildDunePackage { + pname = "tezos-event-logging-test-helpers"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src/lib_event_logging/test_helpers/"; + + propagatedBuildInputs = [ + alcotest + tezos-event-logging + tezos-test-helpers + ]; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos: test helpers for the event logging library"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/event-logging.nix b/pkgs/development/ocaml-modules/tezos/event-logging.nix new file mode 100644 index 00000000000..75b4a5d0643 --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/event-logging.nix @@ -0,0 +1,28 @@ +{ lib +, buildDunePackage +, tezos-stdlib +, tezos-error-monad +, data-encoding +, lwt_log +, lwt +}: + +buildDunePackage { + pname = "tezos-event-logging"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src/lib_event_logging"; + + propagatedBuildInputs = [ + tezos-stdlib + tezos-error-monad + data-encoding + lwt_log + lwt + ]; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos: event logging library"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/hacl-glue-unix.nix b/pkgs/development/ocaml-modules/tezos/hacl-glue-unix.nix new file mode 100644 index 00000000000..5c8afad0f2a --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/hacl-glue-unix.nix @@ -0,0 +1,26 @@ +{ lib +, buildDunePackage +, tezos-stdlib +, tezos-hacl-glue +, ctypes +, hacl-star +}: + +buildDunePackage { + pname = "tezos-hacl-glue-unix"; + + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src/lib_hacl_glue/unix"; + + propagatedBuildInputs = [ + ctypes + hacl-star + tezos-hacl-glue + ]; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos: thin layer of glue around hacl-star (unix implementation)"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/hacl-glue.nix b/pkgs/development/ocaml-modules/tezos/hacl-glue.nix new file mode 100644 index 00000000000..409d04bb266 --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/hacl-glue.nix @@ -0,0 +1,17 @@ +{ lib +, buildDunePackage +, tezos-stdlib +}: + +buildDunePackage { + pname = "tezos-hacl-glue"; + + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src/lib_hacl_glue/virtual"; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos: thin layer of glue around hacl-star (virtual package)"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/legacy-store.nix b/pkgs/development/ocaml-modules/tezos/legacy-store.nix new file mode 100644 index 00000000000..b6d9f20df3c --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/legacy-store.nix @@ -0,0 +1,42 @@ +{ lib +, buildDunePackage +, tezos-stdlib +, tezos-context +, tezos-lmdb +, tezos-validation +, tezos-shell-services +, tezos-protocol-compiler +, lwt-watcher +, alcotest-lwt +}: + +buildDunePackage { + pname = "tezos-legacy-store"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src/lib_store/legacy_store"; + + propagatedBuildInputs = [ + tezos-context + tezos-lmdb + tezos-validation + tezos-shell-services + lwt-watcher + ]; + + nativeBuildInputs = [ + tezos-protocol-compiler + ]; + + strictDeps = true; + + checkInputs = [ + alcotest-lwt + ]; + + # A lot of extra deps with wide dependency cones needed + doCheck = false; + + meta = tezos-stdlib.meta // { + description = "Tezos: custom economic-protocols environment implementation for `tezos-client` and testing"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/lmdb.nix b/pkgs/development/ocaml-modules/tezos/lmdb.nix new file mode 100644 index 00000000000..5b5690707ab --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/lmdb.nix @@ -0,0 +1,51 @@ +{ lib +, fetchFromGitLab +, pkg-config +, buildDunePackage +, lmdb +, rresult +, cstruct +, alcotest +}: + +let + version = "7.4"; + src = fetchFromGitLab { + owner = "tezos"; + repo = "tezos"; + rev = "v${version}"; + sha256 = "0sghc60xzr02pmmkr626pnhzrnczf7mki7qyxzzfn7rbbdbrf4wp"; + }; +in + +buildDunePackage { + pname = "tezos-lmdb"; + version = version; + src = "${src}/vendors/ocaml-lmdb"; + + useDune2 = true; + + nativeBuildInputs = [ + pkg-config + ]; + + propagatedBuildInputs = [ + rresult + lmdb + ]; + + strictDeps = true; + + checkInputs = [ + cstruct + alcotest + ]; + + doCheck = false; + + meta = { + description = "Legacy Tezos OCaml binding to LMDB (Consider ocaml-lmdb instead)"; + license = lib.licenses.isc; + maintainers = [ lib.maintainers.ulrikstrid ]; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/lwt-result-stdlib.nix b/pkgs/development/ocaml-modules/tezos/lwt-result-stdlib.nix new file mode 100644 index 00000000000..fd209741b3f --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/lwt-result-stdlib.nix @@ -0,0 +1,31 @@ +{ lib +, buildDunePackage +, ocaml +, tezos-stdlib +, lwt +, alcotest-lwt +, tezos-test-helpers +}: + +buildDunePackage { + pname = "tezos-lwt-result-stdlib"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src/lib_lwt_result_stdlib"; + + minimalOCamlVersion = "4.12"; + + propagatedBuildInputs = [ + lwt + ]; + + checkInputs = [ + alcotest-lwt + tezos-test-helpers + ]; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos: error-aware stdlib replacement"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/micheline.nix b/pkgs/development/ocaml-modules/tezos/micheline.nix new file mode 100644 index 00000000000..c28e8f89745 --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/micheline.nix @@ -0,0 +1,32 @@ +{ lib +, buildDunePackage +, tezos-stdlib +, tezos-error-monad +, uutf +, alcotest +, alcotest-lwt +, ppx_inline_test +}: + +buildDunePackage { + pname = "tezos-micheline"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src/lib_micheline"; + + propagatedBuildInputs = [ + tezos-error-monad + uutf + ppx_inline_test + ]; + + checkInputs = [ + alcotest + alcotest-lwt + ]; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos: internal AST and parser for the Michelson language"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/mockup-proxy.nix b/pkgs/development/ocaml-modules/tezos/mockup-proxy.nix new file mode 100644 index 00000000000..d949439fcee --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/mockup-proxy.nix @@ -0,0 +1,27 @@ +{ lib +, buildDunePackage +, tezos-stdlib +, tezos-client-base +, tezos-protocol-environment +, tezos-rpc-http-client +, resto-cohttp-self-serving-client +}: + +buildDunePackage { + pname = "tezos-mockup-proxy"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src/lib_mockup_proxy"; + + propagatedBuildInputs = [ + tezos-client-base + tezos-protocol-environment + tezos-rpc-http-client + resto-cohttp-self-serving-client + ]; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos: local RPCs"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/mockup-registration.nix b/pkgs/development/ocaml-modules/tezos/mockup-registration.nix new file mode 100644 index 00000000000..651c89a5986 --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/mockup-registration.nix @@ -0,0 +1,23 @@ +{ lib +, buildDunePackage +, tezos-stdlib +, tezos-client-base +, tezos-protocol-environment +}: + +buildDunePackage { + pname = "tezos-mockup-registration"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src/lib_mockup"; + + propagatedBuildInputs = [ + tezos-client-base + tezos-protocol-environment + ]; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos: protocol registration for the mockup mode"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/p2p-services.nix b/pkgs/development/ocaml-modules/tezos/p2p-services.nix new file mode 100644 index 00000000000..da15852aa97 --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/p2p-services.nix @@ -0,0 +1,19 @@ +{ lib +, buildDunePackage +, tezos-stdlib +, tezos-base +}: + +buildDunePackage { + pname = "tezos-p2p-services"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src/lib_p2p_services"; + + propagatedBuildInputs = [ + tezos-base + ]; + + meta = tezos-stdlib.meta // { + description = "Tezos: descriptions of RPCs exported by `tezos-p2p`"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/p2p.nix b/pkgs/development/ocaml-modules/tezos/p2p.nix new file mode 100644 index 00000000000..bdaabfda1b7 --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/p2p.nix @@ -0,0 +1,38 @@ +{ lib +, buildDunePackage +, alcotest-lwt +, astring +, lwt +, lwt-canceler +, lwt-watcher +, ringo +, tezos-base-test-helpers +, tezos-p2p-services +, tezos-stdlib +}: + +buildDunePackage { + pname = "tezos-p2p"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src/lib_p2p"; + + propagatedBuildInputs = [ + lwt + lwt-canceler + lwt-watcher + ringo + tezos-p2p-services + ]; + + checkInputs = [ + alcotest-lwt + astring + tezos-base-test-helpers + ]; + + doCheck = false; # some tests fail + + meta = tezos-stdlib.meta // { + description = "Tezos: library for a pool of P2P connections"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/protocol-010-PtGRANAD-parameters.nix b/pkgs/development/ocaml-modules/tezos/protocol-010-PtGRANAD-parameters.nix new file mode 100644 index 00000000000..832ca9df30c --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/protocol-010-PtGRANAD-parameters.nix @@ -0,0 +1,23 @@ +{ lib +, buildDunePackage +, tezos-stdlib +, tezos-protocol-010-PtGRANAD +, tezos-protocol-environment +}: + +buildDunePackage { + pname = "tezos-protocol-010-PtGRANAD-parameters"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src/proto_010_PtGRANAD/lib_parameters"; + + propagatedBuildInputs = [ + tezos-protocol-010-PtGRANAD + tezos-protocol-environment + ]; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos/Protocol: parameters"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/protocol-010-PtGRANAD.nix b/pkgs/development/ocaml-modules/tezos/protocol-010-PtGRANAD.nix new file mode 100644 index 00000000000..85dc33dc98f --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/protocol-010-PtGRANAD.nix @@ -0,0 +1,28 @@ +{ lib +, buildDunePackage +, tezos-stdlib +, tezos-protocol-compiler +, tezos-protocol-environment +}: + +buildDunePackage { + pname = "tezos-protocol-010-PtGRANAD"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src"; + + nativeBuildInputs = [ + tezos-protocol-compiler + ]; + + buildInputs = [ + tezos-protocol-environment + ]; + + strictDeps = true; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos/Protocol: economic-protocol definition"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/protocol-011-PtHangz2-parameters.nix b/pkgs/development/ocaml-modules/tezos/protocol-011-PtHangz2-parameters.nix new file mode 100644 index 00000000000..26b05e56f85 --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/protocol-011-PtHangz2-parameters.nix @@ -0,0 +1,23 @@ +{ lib +, buildDunePackage +, tezos-stdlib +, tezos-protocol-011-PtHangz2 +, tezos-protocol-environment +}: + +buildDunePackage { + pname = "tezos-protocol-011-PtHangz2-parameters"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src"; + + propagatedBuildInputs = [ + tezos-protocol-011-PtHangz2 + tezos-protocol-environment + ]; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos/Protocol: parameters"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/protocol-011-PtHangz2.nix b/pkgs/development/ocaml-modules/tezos/protocol-011-PtHangz2.nix new file mode 100644 index 00000000000..3cfb8cced04 --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/protocol-011-PtHangz2.nix @@ -0,0 +1,28 @@ +{ lib +, buildDunePackage +, tezos-stdlib +, tezos-protocol-compiler +, tezos-protocol-environment +}: + +buildDunePackage { + pname = "tezos-protocol-011-PtHangz2"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src"; + + nativeBuildInputs = [ + tezos-protocol-compiler + ]; + + buildInputs = [ + tezos-protocol-environment + ]; + + strictDeps = true; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos/Protocol: economic-protocol definition"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/protocol-alpha.nix b/pkgs/development/ocaml-modules/tezos/protocol-alpha.nix new file mode 100644 index 00000000000..df31eeeefb8 --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/protocol-alpha.nix @@ -0,0 +1,21 @@ +{ lib +, buildDunePackage +, tezos-stdlib +, tezos-protocol-compiler +}: + +buildDunePackage { + pname = "tezos-protocol-alpha"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src"; + + propagatedBuildInputs = [ + tezos-protocol-compiler + ]; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos/Protocol: economic-protocol definition"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/protocol-compiler.nix b/pkgs/development/ocaml-modules/tezos/protocol-compiler.nix new file mode 100644 index 00000000000..ac72c518e82 --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/protocol-compiler.nix @@ -0,0 +1,34 @@ +{ lib +, buildDunePackage +, ocaml +, tezos-stdlib +, tezos-version +, tezos-protocol-environment +, ocp-ocamlres +, pprint +}: + +if lib.versionAtLeast ocaml.version "4.13" then + throw "tezos-protocol-compiler-${tezos-stdlib.version} is not available for OCaml > 4.12" +else + +buildDunePackage { + pname = "tezos-protocol-compiler"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src/lib_protocol_compiler"; + + minimalOCamlVersion = "4.12"; + + propagatedBuildInputs = [ + tezos-version + tezos-protocol-environment + ocp-ocamlres + pprint + ]; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos: economic-protocol compiler"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/protocol-demo-noops.nix b/pkgs/development/ocaml-modules/tezos/protocol-demo-noops.nix new file mode 100644 index 00000000000..02958401ff8 --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/protocol-demo-noops.nix @@ -0,0 +1,21 @@ +{ lib +, buildDunePackage +, tezos-stdlib +, tezos-protocol-compiler +}: + +buildDunePackage { + pname = "tezos-protocol-demo-noops"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src/"; + + propagatedBuildInputs = [ + tezos-protocol-compiler + ]; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos/Protocol: demo_noops economic-protocol definition"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/protocol-environment-packer.nix b/pkgs/development/ocaml-modules/tezos/protocol-environment-packer.nix new file mode 100644 index 00000000000..3aa5e0f6fca --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/protocol-environment-packer.nix @@ -0,0 +1,18 @@ +{ lib +, buildDunePackage +, tezos-stdlib +}: + +buildDunePackage { + pname = "tezos-protocol-environment-packer"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src/lib_protocol_environment"; + + minimalOCamlVersion = "4.03"; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos: sigs/structs packer for economic protocol environment"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/protocol-environment-sigs.nix b/pkgs/development/ocaml-modules/tezos/protocol-environment-sigs.nix new file mode 100644 index 00000000000..dfd3fd14fe3 --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/protocol-environment-sigs.nix @@ -0,0 +1,42 @@ +{ lib +, buildDunePackage +, ocaml +, tezos-stdlib +, tezos-protocol-environment-packer +, zarith +}: + +buildDunePackage { + pname = "tezos-protocol-environment-sigs"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src/lib_protocol_environment"; + + minimalOCamlVersion = "4.12"; + + postPatch = '' + ls ./sigs/v0 + cp -f ${zarith}/lib/ocaml/${ocaml.version}/site-lib/zarith/z.mli ./sigs/v1/z.mli + cp -f ${zarith}/lib/ocaml/${ocaml.version}/site-lib/zarith/z.mli ./sigs/v2/z.mli + cp -f ${zarith}/lib/ocaml/${ocaml.version}/site-lib/zarith/z.mli ./sigs/v3/z.mli + sed -i 's/out_channel/Stdlib.out_channel/g' ./sigs/v1/z.mli + sed -i 's/Buffer/Stdlib.Buffer/g' ./sigs/v1/z.mli + sed -i 's/out_channel/Stdlib.out_channel/g' ./sigs/v2/z.mli + sed -i 's/Buffer/Stdlib.Buffer/g' ./sigs/v2/z.mli + sed -i 's/out_channel/Stdlib.out_channel/g' ./sigs/v3/z.mli + sed -i 's/Buffer/Stdlib.Buffer/g' ./sigs/v3/z.mli + ''; + + propagatedBuildInputs = [ + tezos-protocol-environment-packer + ]; + + checkInputs = [ + tezos-stdlib + ]; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos: restricted typing environment for the economic protocols"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/protocol-environment-structs.nix b/pkgs/development/ocaml-modules/tezos/protocol-environment-structs.nix new file mode 100644 index 00000000000..c55578b5605 --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/protocol-environment-structs.nix @@ -0,0 +1,25 @@ +{ lib +, buildDunePackage +, tezos-stdlib +, tezos-crypto +, tezos-protocol-environment-packer +, bls12-381-legacy +}: + +buildDunePackage { + pname = "tezos-protocol-environment-structs"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src/lib_protocol_environment"; + + propagatedBuildInputs = [ + tezos-crypto + tezos-protocol-environment-packer + bls12-381-legacy + ]; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos: restricted typing environment for the economic protocols"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/protocol-environment.nix b/pkgs/development/ocaml-modules/tezos/protocol-environment.nix new file mode 100644 index 00000000000..f3e8bc42c54 --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/protocol-environment.nix @@ -0,0 +1,43 @@ +{ lib +, ocaml +, buildDunePackage +, bls12-381 +, bls12-381-legacy +, tezos-stdlib +, tezos-base +, tezos-sapling +, tezos-context +, tezos-protocol-environment-sigs +, tezos-protocol-environment-structs +, tezos-test-helpers +, zarith +, alcotest-lwt +}: + +buildDunePackage { + pname = "tezos-protocol-environment"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src/lib_protocol_environment"; + + propagatedBuildInputs = [ + bls12-381 + bls12-381-legacy + tezos-sapling + tezos-base + tezos-context + tezos-protocol-environment-sigs + tezos-protocol-environment-structs + zarith # this might break, since they actually want 1.11 + ]; + + checkInputs = [ + alcotest-lwt + tezos-test-helpers + ]; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos: custom economic-protocols environment implementation for `tezos-client` and testing"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/protocol-plugin-010-PtGRANAD.nix b/pkgs/development/ocaml-modules/tezos/protocol-plugin-010-PtGRANAD.nix new file mode 100644 index 00000000000..8e80b3c65d3 --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/protocol-plugin-010-PtGRANAD.nix @@ -0,0 +1,23 @@ +{ lib +, buildDunePackage +, tezos-stdlib +, tezos-protocol-010-PtGRANAD +, tezos-protocol-environment +}: + +buildDunePackage { + pname = "tezos-protocol-plugin-010-PtGRANAD"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src/proto_010_PtGRANAD/lib_plugin"; + + buildInputs = [ + tezos-protocol-010-PtGRANAD + tezos-protocol-environment + ]; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos/Protocol: protocol plugin registerer"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/protocol-plugin-011-PtHangz2.nix b/pkgs/development/ocaml-modules/tezos/protocol-plugin-011-PtHangz2.nix new file mode 100644 index 00000000000..79333e04617 --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/protocol-plugin-011-PtHangz2.nix @@ -0,0 +1,23 @@ +{ lib +, buildDunePackage +, tezos-stdlib +, tezos-protocol-011-PtHangz2 +, tezos-protocol-environment +}: + +buildDunePackage { + pname = "tezos-protocol-plugin-011-PtHangz2"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src"; + + buildInputs = [ + tezos-protocol-011-PtHangz2 + tezos-protocol-environment + ]; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos/Protocol: protocol plugin"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/protocol-plugin-alpha.nix b/pkgs/development/ocaml-modules/tezos/protocol-plugin-alpha.nix new file mode 100644 index 00000000000..588a420a890 --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/protocol-plugin-alpha.nix @@ -0,0 +1,21 @@ +{ lib +, buildDunePackage +, tezos-stdlib +, tezos-protocol-alpha +}: + +buildDunePackage { + pname = "tezos-protocol-plugin-alpha"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src"; + + propagatedBuildInputs = [ + tezos-protocol-alpha + ]; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos/Protocol: protocol plugin"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/protocol-updater.nix b/pkgs/development/ocaml-modules/tezos/protocol-updater.nix new file mode 100644 index 00000000000..29aaa8be734 --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/protocol-updater.nix @@ -0,0 +1,26 @@ +{ lib +, ocaml +, buildDunePackage +, tezos-stdlib +, tezos-protocol-compiler +, tezos-shell-context +, lwt-exit +}: + +buildDunePackage { + pname = "tezos-protocol-updater"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src/lib_protocol_updater"; + + propagatedBuildInputs = [ + tezos-shell-context + lwt-exit + tezos-protocol-compiler + ]; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos: economic-protocol dynamic loading for `tezos-node`"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/proxy.nix b/pkgs/development/ocaml-modules/tezos/proxy.nix new file mode 100644 index 00000000000..91ed6ab2340 --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/proxy.nix @@ -0,0 +1,36 @@ +{ lib +, buildDunePackage +, tezos-stdlib +, tezos-mockup-proxy +, tezos-context +, ringo-lwt +, alcotest-lwt +, qcheck-alcotest +, tezos-base-test-helpers +, tezos-shell-services-test-helpers +}: + +buildDunePackage { + pname = "tezos-proxy"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src/lib_proxy"; + + propagatedBuildInputs = [ + ringo-lwt + tezos-mockup-proxy + tezos-context + ]; + + checkInputs = [ + alcotest-lwt + qcheck-alcotest + tezos-base-test-helpers + tezos-shell-services-test-helpers + ]; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos: protocol registration for the mockup mode"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/requester.nix b/pkgs/development/ocaml-modules/tezos/requester.nix new file mode 100644 index 00000000000..35e426feb29 --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/requester.nix @@ -0,0 +1,34 @@ +{ lib +, buildDunePackage +, tezos-stdlib +, tezos-base +, lwt-watcher +, alcotest-lwt +, qcheck-alcotest +, tezos-base-test-helpers +, tezos-test-helpers +}: + +buildDunePackage { + pname = "tezos-requester"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src/lib_requester"; + + propagatedBuildInputs = [ + tezos-base + lwt-watcher + ]; + + checkInputs = [ + alcotest-lwt + qcheck-alcotest + tezos-base-test-helpers + tezos-test-helpers + ]; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos: generic resource fetching service"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/rpc-http-client-unix.nix b/pkgs/development/ocaml-modules/tezos/rpc-http-client-unix.nix new file mode 100644 index 00000000000..246618ce076 --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/rpc-http-client-unix.nix @@ -0,0 +1,23 @@ +{ lib +, buildDunePackage +, tezos-stdlib +, tezos-rpc-http-client +, cohttp-lwt-unix +}: + +buildDunePackage { + pname = "tezos-rpc-http-client-unix"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src/lib_rpc_http"; + + propagatedBuildInputs = [ + tezos-rpc-http-client + cohttp-lwt-unix + ]; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos: unix implementation of the RPC client"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/rpc-http-client.nix b/pkgs/development/ocaml-modules/tezos/rpc-http-client.nix new file mode 100644 index 00000000000..54cb71617bb --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/rpc-http-client.nix @@ -0,0 +1,23 @@ +{ lib +, buildDunePackage +, tezos-stdlib +, tezos-rpc-http +, resto-cohttp-client +}: + +buildDunePackage { + pname = "tezos-rpc-http-client"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src/lib_rpc_http"; + + propagatedBuildInputs = [ + tezos-rpc-http + resto-cohttp-client + ]; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos: library of auto-documented RPCs (http client)"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/rpc-http.nix b/pkgs/development/ocaml-modules/tezos/rpc-http.nix new file mode 100644 index 00000000000..56fda87f93d --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/rpc-http.nix @@ -0,0 +1,25 @@ +{ lib +, buildDunePackage +, tezos-stdlib +, tezos-base +, resto-directory +, resto-cohttp +}: + +buildDunePackage { + pname = "tezos-rpc-http"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src/lib_rpc_http"; + + propagatedBuildInputs = [ + tezos-base + resto-directory + resto-cohttp + ]; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos: library of auto-documented RPCs (http server and client)"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/rpc.nix b/pkgs/development/ocaml-modules/tezos/rpc.nix new file mode 100644 index 00000000000..f8a1336146e --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/rpc.nix @@ -0,0 +1,25 @@ +{ lib +, buildDunePackage +, tezos-stdlib +, tezos-error-monad +, resto +, resto-directory +}: + +buildDunePackage { + pname = "tezos-rpc"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src/lib_rpc"; + + propagatedBuildInputs = [ + tezos-error-monad + resto + resto-directory + ]; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos: library of auto-documented RPCs (service and hierarchy descriptions)"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/sapling.nix b/pkgs/development/ocaml-modules/tezos/sapling.nix new file mode 100644 index 00000000000..59e61d49af0 --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/sapling.nix @@ -0,0 +1,35 @@ +{ lib +, buildDunePackage +, ocaml +, tezos-stdlib +, tezos-crypto +, tezos-rust-libs +, tezos-base-test-helpers +, alcotest-lwt +}: + +buildDunePackage { + pname = "tezos-sapling"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src/lib_sapling"; + + propagatedBuildInputs = [ + tezos-crypto + tezos-rust-libs + ]; + + checkInputs = [ + alcotest-lwt + tezos-base-test-helpers + ]; + + # requires the "zcash-params" files + doCheck = false; + + # This is a hack to work around the hack used in the dune files + OPAM_SWITCH_PREFIX = "${tezos-rust-libs}"; + + meta = tezos-stdlib.meta // { + description = "Tezos/Protocol: economic-protocol definition"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/shell-context.nix b/pkgs/development/ocaml-modules/tezos/shell-context.nix new file mode 100644 index 00000000000..89b50177f2c --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/shell-context.nix @@ -0,0 +1,21 @@ +{ lib +, buildDunePackage +, tezos-stdlib +, tezos-protocol-environment +}: + +buildDunePackage { + pname = "tezos-shell-context"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src/lib_protocol_environment"; + + propagatedBuildInputs = [ + tezos-protocol-environment + ]; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos: economic-protocols environment implementation for `tezos-node`"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/shell-services-test-helpers.nix b/pkgs/development/ocaml-modules/tezos/shell-services-test-helpers.nix new file mode 100644 index 00000000000..077e44852ed --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/shell-services-test-helpers.nix @@ -0,0 +1,32 @@ +{ lib +, buildDunePackage +, tezos-stdlib +, tezos-test-helpers +, tezos-base +, tezos-shell-services +, qcheck-core +, qcheck-alcotest +}: + +buildDunePackage { + pname = "tezos-shell-services-test-helpers"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src/lib_shell_services/test_helpers/"; + + propagatedBuildInputs = [ + tezos-base + tezos-shell-services + tezos-test-helpers + qcheck-core + ]; + + checkInputs = [ + qcheck-alcotest + ]; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos: shell_services test helpers"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/shell-services.nix b/pkgs/development/ocaml-modules/tezos/shell-services.nix new file mode 100644 index 00000000000..34354b1821f --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/shell-services.nix @@ -0,0 +1,30 @@ +{ lib +, buildDunePackage +, tezos-stdlib +, tezos-workers +, tezos-p2p-services +, tezos-version +, alcotest-lwt +}: + +buildDunePackage { + pname = "tezos-shell-services"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src/lib_shell_services"; + + propagatedBuildInputs = [ + tezos-workers + tezos-p2p-services + tezos-version + ]; + + doCheck = true; + + checkInputs = [ + alcotest-lwt + ]; + + meta = tezos-stdlib.meta // { + description = "Tezos: descriptions of RPCs exported by `tezos-shell`"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/shell.nix b/pkgs/development/ocaml-modules/tezos/shell.nix new file mode 100644 index 00000000000..cdf5ea66395 --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/shell.nix @@ -0,0 +1,44 @@ +{ lib +, buildDunePackage +, tezos-stdlib +, tezos-p2p +, tezos-requester +, tezos-validation +, tezos-store +, lwt-canceler +, alcotest-lwt +, qcheck-alcotest +, tezos-base-test-helpers +, tezos-embedded-protocol-demo-noops +, tezos-protocol-plugin-alpha +, tezos-test-helpers +}: + +buildDunePackage { + pname = "tezos-shell"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src/lib_shell"; + + propagatedBuildInputs = [ + lwt-canceler + tezos-p2p + tezos-requester + tezos-store + tezos-validation + ]; + + checkInputs = [ + alcotest-lwt + qcheck-alcotest + tezos-base-test-helpers + tezos-embedded-protocol-demo-noops + tezos-protocol-plugin-alpha + tezos-test-helpers + ]; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos: descriptions of RPCs exported by `tezos-shell`"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/signer-backends.nix b/pkgs/development/ocaml-modules/tezos/signer-backends.nix new file mode 100644 index 00000000000..0b49779c279 --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/signer-backends.nix @@ -0,0 +1,30 @@ +{ lib +, buildDunePackage +, tezos-stdlib +, tezos-rpc-http-client-unix +, tezos-signer-services +, alcotest +, alcotest-lwt +}: + +buildDunePackage { + pname = "tezos-signer-backends"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src/lib_signer_backends"; + + propagatedBuildInputs = [ + tezos-rpc-http-client-unix + tezos-signer-services + ]; + + checkInputs = [ + alcotest + alcotest-lwt + ]; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos: remote-signature backends for `tezos-client`"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/signer-services.nix b/pkgs/development/ocaml-modules/tezos/signer-services.nix new file mode 100644 index 00000000000..2f7333312fa --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/signer-services.nix @@ -0,0 +1,21 @@ +{ lib +, buildDunePackage +, tezos-stdlib +, tezos-client-base +}: + +buildDunePackage { + pname = "tezos-signer-services"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src/lib_signer_services"; + + propagatedBuildInputs = [ + tezos-client-base + ]; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos: descriptions of RPCs exported by `tezos-signer`"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/stdlib-unix.nix b/pkgs/development/ocaml-modules/tezos/stdlib-unix.nix new file mode 100644 index 00000000000..1b275d03dff --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/stdlib-unix.nix @@ -0,0 +1,33 @@ +{ lib +, buildDunePackage +, tezos-stdlib +, tezos-event-logging +, re +, ptime +, mtime +, ipaddr +, ezjsonm +, fmt +}: + +buildDunePackage { + pname = "tezos-stdlib-unix"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src/lib_stdlib_unix"; + + propagatedBuildInputs = [ + tezos-event-logging + re + ptime + mtime + ipaddr + ezjsonm + fmt + ]; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos: yet-another local-extension of the OCaml standard library (unix-specific fragment)"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/stdlib.nix b/pkgs/development/ocaml-modules/tezos/stdlib.nix new file mode 100644 index 00000000000..31dfd43b615 --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/stdlib.nix @@ -0,0 +1,64 @@ +{ lib +, fetchFromGitLab +, buildDunePackage +, hex +, lwt +, zarith +, alcotest +, alcotest-lwt +, crowbar +, bigstring +, lwt_log +, ppx_inline_test +, qcheck-alcotest +, tezos-test-helpers +}: + +buildDunePackage rec { + pname = "tezos-stdlib"; + version = "11.0"; + base_src = fetchFromGitLab { + owner = "tezos"; + repo = "tezos"; + rev = "v${version}"; + sha256 = "uUYd1DxH2bdCQlevQt3oGxvg0ai5EiCD2mti5SiueU8="; + }; + + src = "${base_src}/src/lib_stdlib"; + + minimalOCamlVersion = "4.08"; + + useDune2 = true; + + preBuild = '' + rm -rf vendors + ''; + + propagatedBuildInputs = [ + hex + lwt + zarith + ppx_inline_test + ]; + + checkInputs = [ + bigstring + lwt_log + alcotest + alcotest-lwt + crowbar + bigstring + lwt_log + qcheck-alcotest + # tezos-test-helpers + ]; + + # circular dependency if we add this + doCheck = false; + + meta = { + description = "Tezos: yet-another local-extension of the OCaml standard library"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.ulrikstrid ]; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/store.nix b/pkgs/development/ocaml-modules/tezos/store.nix new file mode 100644 index 00000000000..3fbe945d07b --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/store.nix @@ -0,0 +1,50 @@ +{ lib +, buildDunePackage +, tezos-stdlib +, tezos-protocol-updater +, tezos-validation +, tezos-legacy-store +, tezos-protocol-compiler +, index +, camlzip +, tar-unix +, ringo-lwt +, digestif +, alcotest-lwt +, lwt-watcher +}: + +buildDunePackage { + pname = "tezos-store"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src/lib_store"; + + propagatedBuildInputs = [ + index + camlzip + tar-unix + ringo-lwt + digestif + lwt-watcher + tezos-protocol-updater + tezos-validation + tezos-legacy-store + ]; + + nativeBuildInputs = [ + tezos-protocol-compiler + ]; + + strictDeps = true; + + checkInputs = [ + alcotest-lwt + ]; + + # A lot of extra deps with wide dependency cones needed + doCheck = false; + + meta = tezos-stdlib.meta // { + description = "Tezos: custom economic-protocols environment implementation for `tezos-client` and testing"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/test-helpers.nix b/pkgs/development/ocaml-modules/tezos/test-helpers.nix new file mode 100644 index 00000000000..6b3c42b85ba --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/test-helpers.nix @@ -0,0 +1,28 @@ +{ lib +, fetchFromGitLab +, buildDunePackage +, qcheck-alcotest +, alcotest +, alcotest-lwt +, uri +, tezos-stdlib +}: + +buildDunePackage rec { + pname = "tezos-test-helpers"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src/lib_test"; + + propagatedBuildInputs = [ + qcheck-alcotest + alcotest + alcotest-lwt + uri + ]; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos: yet-another local-extension of the OCaml standard library"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/validation.nix b/pkgs/development/ocaml-modules/tezos/validation.nix new file mode 100644 index 00000000000..44a7576cc06 --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/validation.nix @@ -0,0 +1,28 @@ +{ lib +, buildDunePackage +, tezos-stdlib +, tezos-protocol-updater +, tezos-protocol-compiler +}: + +buildDunePackage { + pname = "tezos-validation"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src/lib_validation"; + + propagatedBuildInputs = [ + tezos-protocol-updater + ]; + + nativeBuildInputs = [ + tezos-protocol-compiler + ]; + + strictDeps = true; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos: library for blocks validation"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/version.nix b/pkgs/development/ocaml-modules/tezos/version.nix new file mode 100644 index 00000000000..a0928d15f46 --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/version.nix @@ -0,0 +1,21 @@ +{ lib +, buildDunePackage +, tezos-stdlib +, tezos-base +}: + +buildDunePackage { + pname = "tezos-version"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src/lib_version"; + + propagatedBuildInputs = [ + tezos-base + ]; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos: version information generated from Git"; + }; +} diff --git a/pkgs/development/ocaml-modules/tezos/workers.nix b/pkgs/development/ocaml-modules/tezos/workers.nix new file mode 100644 index 00000000000..65a60a216cd --- /dev/null +++ b/pkgs/development/ocaml-modules/tezos/workers.nix @@ -0,0 +1,21 @@ +{ lib +, buildDunePackage +, tezos-stdlib +, tezos-base +}: + +buildDunePackage { + pname = "tezos-workers"; + inherit (tezos-stdlib) version useDune2; + src = "${tezos-stdlib.base_src}/src/lib_workers"; + + propagatedBuildInputs = [ + tezos-base + ]; + + doCheck = true; + + meta = tezos-stdlib.meta // { + description = "Tezos: worker library"; + }; +} diff --git a/pkgs/development/ocaml-modules/theora/default.nix b/pkgs/development/ocaml-modules/theora/default.nix new file mode 100644 index 00000000000..0f7b4aca1c7 --- /dev/null +++ b/pkgs/development/ocaml-modules/theora/default.nix @@ -0,0 +1,25 @@ +{ lib, buildDunePackage, fetchFromGitHub, dune-configurator, ogg, libtheora }: + +buildDunePackage rec { + pname = "theora"; + version = "0.4.0"; + + useDune2 = true; + + src = fetchFromGitHub { + owner = "savonet"; + repo = "ocaml-theora"; + rev = "v${version}"; + sha256 = "1sggjmlrx4idkih1ddfk98cgpasq60haj4ykyqbfs22cmii5gpal"; + }; + + buildInputs = [ dune-configurator ]; + propagatedBuildInputs = [ ogg libtheora ]; + + meta = with lib; { + homepage = "https://github.com/savonet/ocaml-theora"; + description = "Bindings to libtheora"; + license = licenses.gpl2Only; + maintainers = with maintainers; [ dandellion ]; + }; +} diff --git a/pkgs/development/ocaml-modules/tls/async.nix b/pkgs/development/ocaml-modules/tls/async.nix new file mode 100644 index 00000000000..ceac7a7c074 --- /dev/null +++ b/pkgs/development/ocaml-modules/tls/async.nix @@ -0,0 +1,21 @@ +{ lib, buildDunePackage, tls, async, cstruct-async, core, cstruct, mirage-crypto-rng-async }: + +buildDunePackage rec { + pname = "tls-async"; + + inherit (tls) src meta version; + + minimumOCamlVersion = "4.08"; + useDune2 = true; + + doCheck = true; + + propagatedBuildInputs = [ + async + core + cstruct + cstruct-async + mirage-crypto-rng-async + tls + ]; +} diff --git a/pkgs/development/ocaml-modules/tls/default.nix b/pkgs/development/ocaml-modules/tls/default.nix new file mode 100644 index 00000000000..81f0a176bfc --- /dev/null +++ b/pkgs/development/ocaml-modules/tls/default.nix @@ -0,0 +1,54 @@ +{ lib, fetchurl, buildDunePackage +, cstruct, cstruct-sexp, domain-name, fmt, ppx_cstruct, ppx_sexp_conv, logs, hkdf, mirage-crypto, mirage-crypto-ec, mirage-crypto-pk, mirage-crypto-rng, ocaml_lwt, ptime, sexplib, x509 +, ipaddr, ipaddr-sexp +, alcotest, cstruct-unix, ounit2, randomconv +}: + +buildDunePackage rec { + pname = "tls"; + version = "0.15.2"; + + src = fetchurl { + url = "https://github.com/mirleft/ocaml-tls/releases/download/v${version}/tls-v${version}.tbz"; + sha256 = "b76371757249bbeabb12c333de4ea2a09c095767bdbbc83322538c0da1fc1e36"; + }; + + minimumOCamlVersion = "4.08"; + useDune2 = true; + + propagatedBuildInputs = [ + cstruct + cstruct-sexp + domain-name + fmt + ppx_cstruct + ppx_sexp_conv + logs + hkdf + mirage-crypto + mirage-crypto-ec + mirage-crypto-pk + mirage-crypto-rng + ocaml_lwt + ptime + sexplib + x509 + ipaddr + ipaddr-sexp + ]; + + doCheck = true; + checkInputs = [ + alcotest + cstruct-unix + ounit2 + randomconv + ]; + + meta = with lib; { + homepage = "https://github.com/mirleft/ocaml-tls"; + description = "TLS in pure OCaml"; + license = licenses.bsd2; + maintainers = with maintainers; [ sternenseemann ]; + }; +} diff --git a/pkgs/development/ocaml-modules/tls/mirage.nix b/pkgs/development/ocaml-modules/tls/mirage.nix new file mode 100644 index 00000000000..a0428536b81 --- /dev/null +++ b/pkgs/development/ocaml-modules/tls/mirage.nix @@ -0,0 +1,26 @@ +{ buildDunePackage, tls +, fmt, lwt, mirage-clock, mirage-crypto, mirage-crypto-ec, mirage-crypto-pk, mirage-flow, mirage-kv, ptime, x509 +}: + +buildDunePackage { + pname = "tls-mirage"; + inherit (tls) src version minimumOCamlVersion useDune2; + + propagatedBuildInputs = [ + fmt + lwt + mirage-clock + mirage-crypto + mirage-crypto-ec + mirage-crypto-pk + mirage-flow + mirage-kv + ptime + tls + x509 + ]; + + meta = tls.meta // { + description = "Transport Layer Security purely in OCaml, MirageOS layer"; + }; +} diff --git a/pkgs/development/ocaml-modules/toml/default.nix b/pkgs/development/ocaml-modules/toml/default.nix new file mode 100644 index 00000000000..dd765e38823 --- /dev/null +++ b/pkgs/development/ocaml-modules/toml/default.nix @@ -0,0 +1,27 @@ +{ lib, fetchFromGitHub, buildDunePackage +, iso8601, menhir +}: + +buildDunePackage rec { + pname = "toml"; + version = "6.0.0"; + + useDune2 = true; + + src = fetchFromGitHub { + owner = "ocaml-toml"; + repo = "to.ml"; + rev = version; + sha256 = "08ywzqckllvwawl1wpgg7qzvx6jhq7d6vysa0d5hj7qdwq213ggm"; + }; + + nativeBuildInputs = [ menhir ]; + propagatedBuildInputs = [ iso8601 ]; + + meta = { + description = "Implementation in OCaml of the Toml minimal langage"; + homepage = "http://ocaml-toml.github.io/To.ml"; + license = lib.licenses.lgpl3; + maintainers = [ lib.maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/topkg/default.nix b/pkgs/development/ocaml-modules/topkg/default.nix new file mode 100644 index 00000000000..10104228c83 --- /dev/null +++ b/pkgs/development/ocaml-modules/topkg/default.nix @@ -0,0 +1,56 @@ +/* Topkg is a packager for distributing OCaml software. This derivation +provides facilities to describe derivations for OCaml libraries +using topkg. +The `buildPhase` and `installPhase` attributes can be reused directly +in many cases. When more fine-grained control on how to run the “topkg” +build system is required, the attribute `run` can be used. +*/ +{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, result, opaline }: + +let + param = + if lib.versionAtLeast ocaml.version "4.03" then { + version = "1.0.3"; + sha256 = "0b77gsz9bqby8v77kfi4lans47x9p2lmzanzwins5r29maphb8y6"; + } else { + version = "1.0.0"; + sha256 = "1df61vw6v5bg2mys045682ggv058yqkqb67w7r2gz85crs04d5fw"; + propagatedBuildInputs = [ result ]; + }; + +/* This command allows to run the “topkg” build system. + * It is usually called with `build` or `test` as argument. + * Packages that use `topkg` may call this command as part of + * their `buildPhase` or `checkPhase`. +*/ + run = "ocaml -I ${findlib}/lib/ocaml/${ocaml.version}/site-lib/ pkg/pkg.ml"; +in + +stdenv.mkDerivation rec { + pname = "ocaml${ocaml.version}-topkg"; + inherit (param) version; + + src = fetchurl { + url = "https://erratique.ch/software/topkg/releases/topkg-${version}.tbz"; + inherit (param) sha256; + }; + + nativeBuildInputs = [ ocaml findlib ocamlbuild ]; + propagatedBuildInputs = param.propagatedBuildInputs or []; + + strictDeps = true; + + buildPhase = "${run} build"; + createFindlibDestdir = true; + installPhase = "${opaline}/bin/opaline -prefix $out -libdir $OCAMLFIND_DESTDIR"; + + passthru = { inherit run; }; + + meta = { + homepage = "https://erratique.ch/software/topkg"; + license = lib.licenses.isc; + maintainers = [ lib.maintainers.vbgl ]; + description = "A packager for distributing OCaml software"; + inherit (ocaml.meta) platforms; + }; +} diff --git a/pkgs/development/ocaml-modules/torch/default.nix b/pkgs/development/ocaml-modules/torch/default.nix new file mode 100644 index 00000000000..7a0c6bdadef --- /dev/null +++ b/pkgs/development/ocaml-modules/torch/default.nix @@ -0,0 +1,60 @@ +{ lib +, stdenv +, buildDunePackage +, fetchFromGitHub +, cmdliner +, ctypes +, dune-configurator +, npy +, ocaml-compiler-libs +, ppx_custom_printf +, ppx_expect +, ppx_sexp_conv +, sexplib +, stdio +, pytorch +}: + +buildDunePackage rec { + pname = "torch"; + version = "0.14"; + + useDune2 = true; + + minimalOCamlVersion = "4.08"; + + src = fetchFromGitHub { + owner = "LaurentMazare"; + repo = "ocaml-${pname}"; + rev = version; + sha256 = "sha256:039anfvzsalbqi5cdp95bbixcwr2ngharihgd149hcr0wa47y700"; + }; + + buildInputs = [ dune-configurator ]; + + propagatedBuildInputs = [ + cmdliner + ctypes + npy + ocaml-compiler-libs + pytorch + pytorch.dev + ppx_custom_printf + ppx_expect + ppx_sexp_conv + sexplib + stdio + ]; + + preBuild = "export LIBTORCH=${pytorch.dev}/"; + + doCheck = !stdenv.isAarch64; + checkPhase = "dune runtest"; + + meta = with lib; { + inherit (src.meta) homepage; + description = "Ocaml bindings to Pytorch"; + maintainers = [ maintainers.bcdarwin ]; + license = licenses.asl20; + }; +} diff --git a/pkgs/development/ocaml-modules/trie/default.nix b/pkgs/development/ocaml-modules/trie/default.nix new file mode 100644 index 00000000000..935f71a5e22 --- /dev/null +++ b/pkgs/development/ocaml-modules/trie/default.nix @@ -0,0 +1,23 @@ +{ lib, buildDunePackage, fetchFromGitHub }: + +buildDunePackage rec { + pname = "trie"; + version = "1.0.0"; + + useDune2 = true; + + src = fetchFromGitHub { + owner = "kandu"; + repo = pname; + rev = version; + sha256 = "0s7p9swjqjsqddylmgid6cv263ggq7pmb734z4k84yfcrgb6kg4g"; + }; + + meta = { + inherit (src.meta) homepage; + license = lib.licenses.mit; + description = "Strict impure trie tree"; + maintainers = [ lib.maintainers.vbgl ]; + }; + +} diff --git a/pkgs/development/ocaml-modules/tsdl/default.nix b/pkgs/development/ocaml-modules/tsdl/default.nix new file mode 100644 index 00000000000..a56cccbe071 --- /dev/null +++ b/pkgs/development/ocaml-modules/tsdl/default.nix @@ -0,0 +1,42 @@ +{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg, ctypes, result, SDL2, pkg-config, ocb-stubblr }: + +if !lib.versionAtLeast ocaml.version "4.03" +then throw "tsdl is not available for OCaml ${ocaml.version}" +else + +let + pname = "tsdl"; + version = "0.9.7"; + webpage = "https://erratique.ch/software/${pname}"; +in + +stdenv.mkDerivation { + name = "ocaml${ocaml.version}-${pname}-${version}"; + + src = fetchurl { + url = "${webpage}/releases/${pname}-${version}.tbz"; + sha256 = "1zwv0ixkigh1gzk5n49rwvz2f2m62jdkkqg40j7dclg4gri7691f"; + }; + + nativeBuildInputs = [ pkg-config ocaml findlib ocamlbuild topkg ]; + buildInputs = [ topkg ]; + propagatedBuildInputs = [ SDL2 ctypes ]; + + preConfigure = '' + # The following is done to avoid an additional dependency (ncurses) + # due to linking in the custom bytecode runtime. Instead, just + # compile directly into a native binary, even if it's just a + # temporary build product. + substituteInPlace myocamlbuild.ml \ + --replace ".byte" ".native" + ''; + + inherit (topkg) buildPhase installPhase; + + meta = with lib; { + homepage = webpage; + description = "Thin bindings to the cross-platform SDL library"; + license = licenses.isc; + platforms = ocaml.meta.platforms or []; + }; +} diff --git a/pkgs/development/ocaml-modules/tsort/default.nix b/pkgs/development/ocaml-modules/tsort/default.nix new file mode 100644 index 00000000000..fdfe7a650e5 --- /dev/null +++ b/pkgs/development/ocaml-modules/tsort/default.nix @@ -0,0 +1,22 @@ +{ lib, buildDunePackage, fetchFromGitHub, containers }: + +buildDunePackage rec { + pname = "tsort"; + useDune2 = true; + version = "2.0.0"; + src = fetchFromGitHub { + owner = "dmbaturin"; + repo = "ocaml-tsort"; + rev = version; + sha256 = "0i67ys5p5i8q9p0nhkq4pjg9jav8dy0fiy975a365j7m6bhrwgc1"; + }; + + propagatedBuildInputs = [ containers ]; + + meta = { + description = "Easy to use and user-friendly topological sort"; + inherit (src.meta) homepage; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/tuntap/default.nix b/pkgs/development/ocaml-modules/tuntap/default.nix new file mode 100644 index 00000000000..981f05b01e3 --- /dev/null +++ b/pkgs/development/ocaml-modules/tuntap/default.nix @@ -0,0 +1,29 @@ +{ lib, buildDunePackage, fetchurl +, ipaddr, macaddr, cmdliner +}: + +buildDunePackage rec { + pname = "tuntap"; + version = "2.0.0"; + + useDune2 = true; + + minimumOCamlVersion = "4.04.2"; + + src = fetchurl { + url = "https://github.com/mirage/ocaml-tuntap/releases/download/v${version}/tuntap-v${version}.tbz"; + sha256 = "12wmls28h3jzikwyfw08d5f7ycsc9njwzbhd3qk2l8jnf5rakfsa"; + }; + + propagatedBuildInputs = [ ipaddr macaddr cmdliner ]; + + # tests manipulate network devices and use network + # also depend on LWT 5 + doCheck = false; + + meta = { + description = "Bindings to the UNIX tuntap facility"; + license = lib.licenses.isc; + homepage = "https://github.com/mirage/ocaml-tuntap"; + }; +} diff --git a/pkgs/development/ocaml-modules/twt/default.nix b/pkgs/development/ocaml-modules/twt/default.nix new file mode 100644 index 00000000000..4e76f0c16d3 --- /dev/null +++ b/pkgs/development/ocaml-modules/twt/default.nix @@ -0,0 +1,36 @@ +{ lib, stdenv, fetchFromGitHub, ocaml, findlib }: + +stdenv.mkDerivation rec { + pname = "ocaml${ocaml.version}-twt"; + version = "0.94.0"; + + src = fetchFromGitHub { + owner = "mlin"; + repo = "twt"; + rev = "v${version}"; + sha256 = "sha256-xbjLPd7P1KyuC3i6WHLBcdLwd14atcBsd5ER+l97KAk="; + }; + + nativeBuildInputs = [ ocaml findlib ]; + + strictDeps = true; + + preInstall = '' + mkdir -p $out/bin + mkdir -p $OCAMLFIND_DESTDIR + ''; + + dontBuild = true; + + installFlags = [ "PREFIX=$(out)" ]; + + dontStrip = true; + + meta = with lib; { + homepage = "http://people.csail.mit.edu/mikelin/ocaml+twt/"; + description = "“The Whitespace Thing” for OCaml"; + license = licenses.mit; + maintainers = [ maintainers.vbgl ]; + platforms = ocaml.meta.platforms or [ ]; + }; +} diff --git a/pkgs/development/ocaml-modules/type_conv/108.08.00.nix b/pkgs/development/ocaml-modules/type_conv/108.08.00.nix new file mode 100644 index 00000000000..fb3977223f7 --- /dev/null +++ b/pkgs/development/ocaml-modules/type_conv/108.08.00.nix @@ -0,0 +1,31 @@ +{ lib, stdenv, fetchurl, ocaml, findlib, camlp4 }: + +if !lib.versionAtLeast ocaml.version "3.12" + || lib.versionAtLeast ocaml.version "4.03" +then throw "type_conv-108.08.00 is not available for OCaml ${ocaml.version}" else + +stdenv.mkDerivation rec { + pname = "ocaml-type_conv"; + version = "108.08.00"; + + src = fetchurl { + url = "https://ocaml.janestreet.com/ocaml-core/${version}/individual/type_conv-${version}.tar.gz"; + sha256 = "08ysikwwp69zvc147lzzg79nwlrzrk738rj0ggcfadi8h5il42sl"; + }; + + nativeBuildInputs = [ ocaml findlib ]; + buildInputs = [ camlp4 ]; + + strictDeps = true; + + createFindlibDestdir = true; + + meta = with lib; { + homepage = "https://ocaml.janestreet.com/"; + description = "Support library for OCaml preprocessor type conversions"; + license = licenses.asl20; + branch = "108"; + platforms = ocaml.meta.platforms or [ ]; + maintainers = with maintainers; [ maggesi ]; + }; +} diff --git a/pkgs/development/ocaml-modules/type_conv/109.60.01.nix b/pkgs/development/ocaml-modules/type_conv/109.60.01.nix new file mode 100644 index 00000000000..1f6500c6ed1 --- /dev/null +++ b/pkgs/development/ocaml-modules/type_conv/109.60.01.nix @@ -0,0 +1,32 @@ +{ stdenv, lib, fetchFromGitHub, ocaml, findlib, camlp4 }: + +if !lib.versionAtLeast ocaml.version "4.00" + || lib.versionAtLeast ocaml.version "4.03" +then throw "type_conv-109.60.01 is not available for OCaml ${ocaml.version}" else + +stdenv.mkDerivation rec { + pname = "ocaml-type_conv"; + version = "109.60.01"; + + src = fetchFromGitHub { + owner = "janestreet"; + repo = "type_conv"; + rev = version; + sha256 = "sha256-8Oz/fPL3+RghyxQp5u6seSEdf0BgfP6XNcsMYty0rNs="; + }; + + nativeBuildInputs = [ ocaml findlib ]; + buildInputs = [ camlp4 ]; + + strictDeps = true; + + createFindlibDestdir = true; + + meta = { + homepage = "http://forge.ocamlcore.org/projects/type-conv/"; + description = "Support library for OCaml preprocessor type conversions"; + license = lib.licenses.lgpl21; + platforms = ocaml.meta.platforms or [ ]; + maintainers = with lib.maintainers; [ maggesi ]; + }; +} diff --git a/pkgs/development/ocaml-modules/type_conv/112.01.01.nix b/pkgs/development/ocaml-modules/type_conv/112.01.01.nix new file mode 100644 index 00000000000..468b872ec3d --- /dev/null +++ b/pkgs/development/ocaml-modules/type_conv/112.01.01.nix @@ -0,0 +1,26 @@ +{ lib, fetchFromGitHub, buildOcaml, camlp4}: + +buildOcaml rec { + minimumSupportedOcamlVersion = "4.02"; + + pname = "type_conv"; + version = "113.00.02"; + + src = fetchFromGitHub { + owner = "janestreet"; + repo = "type_conv"; + rev = version; + sha256 = "sha256-HzH0hnceCQ2kDRATjl+tfKk3XSBDsGnPzVUGYpDQUmU="; + }; + + strictDeps = true; + + buildInputs = [ camlp4 ]; + + meta = { + homepage = "https://github.com/janestreet/type_conv/"; + description = "Support library for preprocessor type conversions"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ maggesi ericbmerritt ]; + }; +} diff --git a/pkgs/development/ocaml-modules/tyxml/default.nix b/pkgs/development/ocaml-modules/tyxml/default.nix new file mode 100644 index 00000000000..c49327d7d33 --- /dev/null +++ b/pkgs/development/ocaml-modules/tyxml/default.nix @@ -0,0 +1,25 @@ +{ lib, buildDunePackage, fetchurl, re, uutf }: + +buildDunePackage rec { + pname = "tyxml"; + version = "4.5.0"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/ocsigen/tyxml/releases/download/${version}/tyxml-${version}.tbz"; + sha256 = "0s30f72m457c3gbdmdwbx7ls9zg806nvm83aiz9qkpglbppwr6n6"; + }; + + propagatedBuildInputs = [ uutf re ]; + + meta = with lib; { + homepage = "http://ocsigen.org/tyxml/"; + description = "A library that makes it almost impossible for your OCaml programs to generate wrong XML output, using static typing"; + license = licenses.lgpl21; + maintainers = with maintainers; [ + gal_bolle vbgl + ]; + }; + +} diff --git a/pkgs/development/ocaml-modules/uchar/default.nix b/pkgs/development/ocaml-modules/uchar/default.nix new file mode 100644 index 00000000000..09004e8a943 --- /dev/null +++ b/pkgs/development/ocaml-modules/uchar/default.nix @@ -0,0 +1,25 @@ +{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, opaline, withShared ? true, lib }: + +stdenv.mkDerivation rec { + pname = "ocaml${ocaml.version}-uchar"; + version = "0.0.2"; + + src = fetchurl { + url = "https://github.com/ocaml/uchar/releases/download/v${version}/uchar-${version}.tbz"; + sha256 = "1w2saw7zanf9m9ffvz2lvcxvlm118pws2x1wym526xmydhqpyfa7"; + }; + + nativeBuildInputs = [ ocaml ocamlbuild findlib ]; + + strictDeps = true; + + buildPhase = "ocaml pkg/build.ml native=true native-dynlink=${lib.boolToString withShared}"; + installPhase = "${opaline}/bin/opaline -libdir $OCAMLFIND_DESTDIR"; + configurePlatforms = [ ]; + + meta = { + description = "Compatibility library for OCaml’s Uchar module"; + inherit (ocaml.meta) platforms license; + maintainers = [ lib.maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/uecc/default.nix b/pkgs/development/ocaml-modules/uecc/default.nix new file mode 100644 index 00000000000..f67980db2ff --- /dev/null +++ b/pkgs/development/ocaml-modules/uecc/default.nix @@ -0,0 +1,34 @@ +{ lib, fetchFromGitLab, buildDunePackage, bigstring, alcotest, cstruct, hex }: + +buildDunePackage rec { + pname = "uecc"; + version = "0.3"; + + src = fetchFromGitLab { + owner = "nomadic-labs"; + repo = "ocaml-uecc"; + rev = "v${version}"; + sha256 = "0m3cw34254baajscrwlrj0jp5n0yad3dhgi4jh3pz89iqykj15fr"; + }; + + useDune2 = true; + + propagatedBuildInputs = [ + bigstring + ]; + + checkInputs = [ + alcotest + cstruct + hex + ]; + + doCheck = true; + + meta = { + description = "Bindings for ECDH and ECDSA for 8-bit, 32-bit, and 64-bit processors"; + homepage = "https://gitlab.com/nomadic-labs/ocaml-uecc"; + license = lib.licenses.isc; + maintainers = [ lib.maintainers.ulrikstrid ]; + }; +} diff --git a/pkgs/development/ocaml-modules/ulex/default.nix b/pkgs/development/ocaml-modules/ulex/default.nix new file mode 100644 index 00000000000..9a5848db3f7 --- /dev/null +++ b/pkgs/development/ocaml-modules/ulex/default.nix @@ -0,0 +1,41 @@ +{ stdenv, lib, fetchFromGitHub, ocaml, findlib, ocamlbuild, camlp4 }: + +let + pname = "ulex"; + param = + if lib.versionAtLeast ocaml.version "4.02" then { + version = "1.2"; + sha256 = "08yf2x9a52l2y4savjqfjd2xy4pjd1rpla2ylrr9qrz1drpfw4ic"; + } else { + version = "1.1"; + sha256 = "0cmscxcmcxhlshh4jd0lzw5ffzns12x3bj7h27smbc8waxkwffhl"; + }; +in + +stdenv.mkDerivation rec { + name = "ocaml${ocaml.version}-${pname}-${version}"; + inherit (param) version; + + src = fetchFromGitHub { + owner = "whitequark"; + repo = pname; + rev = "v${version}"; + inherit (param) sha256; + }; + + createFindlibDestdir = true; + + nativeBuildInputs = [ ocaml findlib ocamlbuild camlp4 ]; + + strictDeps = true; + + buildFlags = [ "all" "all.opt" ]; + + meta = { + inherit (src.meta) homepage; + description = "A lexer generator for Unicode and OCaml"; + license = lib.licenses.mit; + platforms = ocaml.meta.platforms or []; + maintainers = [ lib.maintainers.roconnor ]; + }; +} diff --git a/pkgs/development/ocaml-modules/unstrctrd/default.nix b/pkgs/development/ocaml-modules/unstrctrd/default.nix new file mode 100644 index 00000000000..104cabfd0fa --- /dev/null +++ b/pkgs/development/ocaml-modules/unstrctrd/default.nix @@ -0,0 +1,48 @@ +{ alcotest +, angstrom +, bigstringaf +, buildDunePackage +, crowbar +, fetchzip +, fmt +, hxd +, ke +, lib +, rresult +, uutf +}: + +buildDunePackage rec { + pname = "unstrctrd"; + version = "0.3"; + + src = fetchzip { + url = "https://github.com/dinosaure/unstrctrd/releases/download/v${version}/unstrctrd-v${version}.tbz"; + sha256 = "0mjm4v7kk75iwwsfnpmxc3bsl8aisz53y7z21sykdp60f4rxnah7"; + }; + + useDune2 = true; + + propagatedBuildInputs = [ + angstrom + uutf + ]; + + checkInputs = [ + alcotest + bigstringaf + crowbar + fmt + hxd + ke + rresult + ]; + doCheck = true; + + meta = { + description = "A library for parsing email headers"; + homepage = "https://github.com/dinosaure/unstrctrd"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ ]; + }; +} diff --git a/pkgs/development/ocaml-modules/uri/default.nix b/pkgs/development/ocaml-modules/uri/default.nix new file mode 100644 index 00000000000..f669a98c4de --- /dev/null +++ b/pkgs/development/ocaml-modules/uri/default.nix @@ -0,0 +1,27 @@ +{ lib, fetchurl, buildDunePackage, ounit +, angstrom, stringext +}: + +buildDunePackage rec { + minimumOCamlVersion = "4.03"; + pname = "uri"; + version = "4.2.0"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/mirage/ocaml-${pname}/releases/download/v${version}/${pname}-v${version}.tbz"; + sha256 = "0szifda6yism5vn5jdizkha3ad0xk6zw4xgfl8g77dnv83ci7h65"; + }; + + checkInputs = [ ounit ]; + propagatedBuildInputs = [ angstrom stringext ]; + doCheck = true; + + meta = { + homepage = "https://github.com/mirage/ocaml-uri"; + description = "RFC3986 URI parsing library for OCaml"; + license = lib.licenses.isc; + maintainers = [ lib.maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/uri/sexp.nix b/pkgs/development/ocaml-modules/uri/sexp.nix new file mode 100644 index 00000000000..83be70c3649 --- /dev/null +++ b/pkgs/development/ocaml-modules/uri/sexp.nix @@ -0,0 +1,14 @@ +{ lib, ocaml, buildDunePackage, uri, ounit, ppx_sexp_conv, sexplib0 }: + +if !lib.versionAtLeast ocaml.version "4.04" +then throw "uri-sexp is not available for OCaml ${ocaml.version}" +else + +buildDunePackage { + pname = "uri-sexp"; + inherit (uri) version useDune2 src meta; + + checkInputs = [ ounit ]; + propagatedBuildInputs = [ ppx_sexp_conv sexplib0 uri ]; + doCheck = lib.versionAtLeast ocaml.version "4.08"; +} diff --git a/pkgs/development/ocaml-modules/uucd/default.nix b/pkgs/development/ocaml-modules/uucd/default.nix new file mode 100644 index 00000000000..0c71ddf0d70 --- /dev/null +++ b/pkgs/development/ocaml-modules/uucd/default.nix @@ -0,0 +1,32 @@ +{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, xmlm, topkg }: + +let + pname = "uucd"; + webpage = "https://erratique.ch/software/${pname}"; +in +stdenv.mkDerivation rec { + name = "ocaml-${pname}-${version}"; + version = "14.0.0"; + + src = fetchurl { + url = "${webpage}/releases/${pname}-${version}.tbz"; + sha256 = "sha256:0fc737v5gj3339jx4x9xr096lxrpwvp6vaiylhavcvsglcwbgm30"; + }; + + nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ]; + buildInputs = [ topkg ]; + + strictDeps = true; + + inherit (topkg) buildPhase installPhase; + + propagatedBuildInputs = [ xmlm ]; + + meta = with lib; { + description = "An OCaml module to decode the data of the Unicode character database from its XML representation"; + homepage = webpage; + inherit (ocaml.meta) platforms; + maintainers = [ maintainers.vbgl ]; + license = licenses.bsd3; + }; +} diff --git a/pkgs/development/ocaml-modules/uucp/default.nix b/pkgs/development/ocaml-modules/uucp/default.nix new file mode 100644 index 00000000000..9031087f505 --- /dev/null +++ b/pkgs/development/ocaml-modules/uucp/default.nix @@ -0,0 +1,54 @@ +{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg, uchar, uutf, uunf, uucd }: + +let + pname = "uucp"; + version = "14.0.0"; + webpage = "https://erratique.ch/software/${pname}"; + minimumOCamlVersion = "4.03"; + doCheck = true; +in + +if !(lib.versionAtLeast ocaml.version minimumOCamlVersion) +then builtins.throw "${pname} needs at least OCaml ${minimumOCamlVersion}" +else + +stdenv.mkDerivation { + + name = "ocaml${ocaml.version}-${pname}-${version}"; + + src = fetchurl { + url = "${webpage}/releases/${pname}-${version}.tbz"; + sha256 = "sha256:1yx9nih3d9prb9zizq8fzmmqylf24a6yifhf81h33znrj5xn1mpj"; + }; + + nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ]; + buildInputs = [ topkg uutf uunf uucd ]; + + propagatedBuildInputs = [ uchar ]; + + strictDeps = true; + + buildPhase = '' + runHook preBuild + ${topkg.buildPhase} --with-cmdliner false --tests ${lib.boolToString doCheck} + runHook postBuild + ''; + + inherit (topkg) installPhase; + + inherit doCheck; + checkPhase = '' + runHook preCheck + ${topkg.run} test + runHook postCheck + ''; + checkInputs = [ uucd ]; + + meta = with lib; { + description = "An OCaml library providing efficient access to a selection of character properties of the Unicode character database"; + homepage = webpage; + inherit (ocaml.meta) platforms; + license = licenses.bsd3; + maintainers = [ maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/uuidm/default.nix b/pkgs/development/ocaml-modules/uuidm/default.nix new file mode 100644 index 00000000000..336d66cb0a6 --- /dev/null +++ b/pkgs/development/ocaml-modules/uuidm/default.nix @@ -0,0 +1,24 @@ +{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg, cmdliner }: + +stdenv.mkDerivation rec { + version = "0.9.7"; + pname = "uuidm"; + src = fetchurl { + url = "https://erratique.ch/software/uuidm/releases/uuidm-${version}.tbz"; + sha256 = "1ivxb3hxn9bk62rmixx6px4fvn52s4yr1bpla7rgkcn8981v45r8"; + }; + + nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ]; + configurePlatforms = []; + buildInputs = [ topkg cmdliner ]; + + inherit (topkg) buildPhase installPhase; + + meta = with lib; { + description = "An OCaml module implementing 128 bits universally unique identifiers version 3, 5 (name based with MD5, SHA-1 hashing) and 4 (random based) according to RFC 4122"; + homepage = "https://erratique.ch/software/uuidm"; + license = licenses.bsd3; + platforms = ocaml.meta.platforms or []; + maintainers = [ maintainers.maurer ]; + }; +} diff --git a/pkgs/development/ocaml-modules/uunf/default.nix b/pkgs/development/ocaml-modules/uunf/default.nix new file mode 100644 index 00000000000..12031c53927 --- /dev/null +++ b/pkgs/development/ocaml-modules/uunf/default.nix @@ -0,0 +1,39 @@ +{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg, uchar, uutf, cmdliner }: +let + pname = "uunf"; + webpage = "https://erratique.ch/software/${pname}"; + version = "14.0.0"; +in + +if !lib.versionAtLeast ocaml.version "4.03" +then throw "${pname} is not available for OCaml ${ocaml.version}" +else + +stdenv.mkDerivation { + name = "ocaml${ocaml.version}-${pname}-${version}"; + inherit version; + + src = fetchurl { + url = "${webpage}/releases/${pname}-${version}.tbz"; + sha256 = "sha256:17wv0nm3vvwcbzb1b09akw8jblmigyhbfmh1sy9lkb5756ni94a2"; + }; + + nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ]; + buildInputs = [ topkg uutf cmdliner ]; + + propagatedBuildInputs = [ uchar ]; + + strictDeps = true; + + prePatch = lib.optionalString stdenv.isAarch64 "ulimit -s 16384"; + + inherit (topkg) buildPhase installPhase; + + meta = with lib; { + description = "An OCaml module for normalizing Unicode text"; + homepage = webpage; + inherit (ocaml.meta) platforms; + license = licenses.bsd3; + maintainers = [ maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/uuseg/default.nix b/pkgs/development/ocaml-modules/uuseg/default.nix new file mode 100644 index 00000000000..42642d2dc24 --- /dev/null +++ b/pkgs/development/ocaml-modules/uuseg/default.nix @@ -0,0 +1,33 @@ +{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg, uucp, uutf, cmdliner }: + +let + pname = "uuseg"; + webpage = "https://erratique.ch/software/${pname}"; +in + +stdenv.mkDerivation rec { + + name = "ocaml${ocaml.version}-${pname}-${version}"; + version = "14.0.0"; + + src = fetchurl { + url = "${webpage}/releases/${pname}-${version}.tbz"; + sha256 = "sha256:1g9zyzjkhqxgbb9mh3cgaawscwdazv6y8kdqvmy6yhnimmfqv25p"; + }; + + nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ]; + buildInputs = [ topkg cmdliner uutf ]; + propagatedBuildInputs = [ uucp ]; + + strictDeps = true; + + inherit (topkg) buildPhase installPhase; + + meta = with lib; { + description = "An OCaml library for segmenting Unicode text"; + homepage = webpage; + inherit (ocaml.meta) platforms; + license = licenses.bsd3; + maintainers = [ maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/uutf/default.nix b/pkgs/development/ocaml-modules/uutf/default.nix new file mode 100644 index 00000000000..6701c865051 --- /dev/null +++ b/pkgs/development/ocaml-modules/uutf/default.nix @@ -0,0 +1,31 @@ +{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, cmdliner , topkg, uchar }: +let + pname = "uutf"; + webpage = "https://erratique.ch/software/${pname}"; +in + +stdenv.mkDerivation rec { + name = "ocaml${ocaml.version}-${pname}-${version}"; + version = "1.0.2"; + + src = fetchurl { + url = "${webpage}/releases/${pname}-${version}.tbz"; + sha256 = "1nx1rly3qj23jzn9yk3x6fwqimcxjd84kv5859vvhdg56psq26p6"; + }; + + nativeBuildInputs = [ ocaml ocamlbuild findlib topkg ]; + buildInputs = [ topkg cmdliner ]; + propagatedBuildInputs = [ uchar ]; + + strictDeps = true; + + inherit (topkg) buildPhase installPhase; + + meta = with lib; { + description = "Non-blocking streaming Unicode codec for OCaml"; + homepage = webpage; + platforms = ocaml.meta.platforms or []; + license = licenses.bsd3; + maintainers = [ maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/uuuu/default.nix b/pkgs/development/ocaml-modules/uuuu/default.nix new file mode 100644 index 00000000000..4f400d1ec75 --- /dev/null +++ b/pkgs/development/ocaml-modules/uuuu/default.nix @@ -0,0 +1,42 @@ +{ angstrom +, buildDunePackage +, fetchzip +, findlib +, lib +, menhir +, ocaml +, re +}: + +buildDunePackage rec { + pname = "uuuu"; + version = "0.2.0"; + + src = fetchzip { + url = "https://github.com/mirage/uuuu/releases/download/v${version}/uuuu-v${version}.tbz"; + sha256 = "0457qcxvakbbc56frsh8a5v4y4l0raj9p4zz7jx3brn9255j1mw3"; + }; + + postPatch = '' + substituteInPlace src/dune --replace 'ocaml} ' \ + 'ocaml} -I ${findlib}/lib/ocaml/${ocaml.version}/site-lib ' + ''; + + useDune2 = true; + + nativeBuildInputs = [ menhir findlib ]; + + buildInputs = [ angstrom ]; + + strictDeps = !doCheck; + + checkInputs = [ re ]; + doCheck = true; + + meta = { + description = "A library to normalize an ISO-8859 input to Unicode code-point"; + license = lib.licenses.mit; + homepage = "https://github.com/mirage/uuuu"; + maintainers = with lib.maintainers; [ ]; + }; +} diff --git a/pkgs/development/ocaml-modules/vchan/default.nix b/pkgs/development/ocaml-modules/vchan/default.nix new file mode 100644 index 00000000000..54bf4e65004 --- /dev/null +++ b/pkgs/development/ocaml-modules/vchan/default.nix @@ -0,0 +1,47 @@ +{ lib, buildDunePackage, fetchurl +, ppx_cstruct, ppx_sexp_conv, ounit, io-page-unix +, lwt, cstruct, io-page, mirage-flow, xenstore, xenstore_transport +, sexplib, cmdliner +}: + +buildDunePackage rec { + pname = "vchan"; + version = "6.0.0"; + + useDune2 = true; + minimumOCamlVersion = "4.08"; + + src = fetchurl { + url = "https://github.com/mirage/ocaml-vchan/releases/download/v${version}/vchan-v${version}.tbz"; + sha256 = "7a6cc89ff8ba7144d6cef3f36722f40deedb3cefff0f7be1b2f3b7b2a2b41747"; + }; + + nativeBuildInputs = [ + ppx_cstruct + ]; + + propagatedBuildInputs = [ + ppx_sexp_conv + lwt + cstruct + io-page + mirage-flow + xenstore + xenstore_transport + sexplib + ]; + + doCheck = true; + checkInputs = [ + cmdliner + io-page-unix + ounit + ]; + + meta = with lib; { + description = "Xen Vchan implementation"; + homepage = "https://github.com/mirage/ocaml-vchan"; + license = licenses.isc; + maintainers = [ maintainers.sternenseemann ]; + }; +} diff --git a/pkgs/development/ocaml-modules/vector/default.nix b/pkgs/development/ocaml-modules/vector/default.nix new file mode 100644 index 00000000000..c5f4336bb83 --- /dev/null +++ b/pkgs/development/ocaml-modules/vector/default.nix @@ -0,0 +1,23 @@ +{ lib, buildDunePackage, fetchurl }: + +buildDunePackage rec { + pname = "vector"; + version = "1.0.0"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/backtracking/vector/releases/download/${version}/vector-${version}.tbz"; + sha256 = "sha256:0hb6prpada4c5z07sxf5ayj5xbahsnwall15vaqdwdyfjgbd24pj"; + }; + + doCheck = true; + + meta = { + description = "Resizable arrays for OCaml"; + license = lib.licenses.lgpl2Only; + homepage = "https://github.com/backtracking/vector"; + maintainers = [ lib.maintainers.vbgl ]; + }; + +} diff --git a/pkgs/development/ocaml-modules/vg/default.nix b/pkgs/development/ocaml-modules/vg/default.nix new file mode 100644 index 00000000000..9dc7a4eeeef --- /dev/null +++ b/pkgs/development/ocaml-modules/vg/default.nix @@ -0,0 +1,64 @@ +{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, topkg +, uchar, result, gg, uutf, otfm +, js_of_ocaml, js_of_ocaml-ppx, + pdfBackend ? true, # depends on uutf and otfm + htmlcBackend ? true # depends on js_of_ocaml +}: + +with lib; + +let + inherit (lib) optionals versionAtLeast; + + pname = "vg"; + version = "0.9.4"; + webpage = "https://erratique.ch/software/${pname}"; +in + +if !versionAtLeast ocaml.version "4.03" +then throw "vg is not available for OCaml ${ocaml.version}" +else + +stdenv.mkDerivation { + + name = "ocaml${ocaml.version}-${pname}-${version}"; + + src = fetchurl { + url = "${webpage}/releases/${pname}-${version}.tbz"; + sha256 = "181sz6l5xrj5jvwg4m2yqsjzwp2s5h8v0mwhjcwbam90kdfx2nak"; + }; + + nativeBuildInputs = [ ocaml findlib ocamlbuild ]; + buildInputs = [ topkg ]; + + propagatedBuildInputs = [ uchar result gg ] + ++ optionals pdfBackend [ uutf otfm ] + ++ optionals htmlcBackend [ js_of_ocaml js_of_ocaml-ppx ]; + + strictDeps = true; + + buildPhase = topkg.buildPhase + + " --with-uutf ${boolToString pdfBackend}" + + " --with-otfm ${boolToString pdfBackend}" + + " --with-js_of_ocaml ${boolToString htmlcBackend}" + + " --with-cairo2 false"; + + inherit (topkg) installPhase; + + meta = { + description = "Declarative 2D vector graphics for OCaml"; + longDescription = '' + Vg is an OCaml module for declarative 2D vector graphics. In Vg, images + are values that denote functions mapping points of the cartesian plane + to colors. The module provides combinators to define and compose these + values. + + Renderers for PDF, SVG and the HTML canvas are distributed with the + module. An API allows to implement new renderers. + ''; + homepage = webpage; + inherit (ocaml.meta) platforms; + license = licenses.isc; + maintainers = [ maintainers.jirkamarsik ]; + }; +} diff --git a/pkgs/development/ocaml-modules/visitors/default.nix b/pkgs/development/ocaml-modules/visitors/default.nix new file mode 100644 index 00000000000..42c077e24a8 --- /dev/null +++ b/pkgs/development/ocaml-modules/visitors/default.nix @@ -0,0 +1,28 @@ +{ lib, buildDunePackage, fetchFromGitLab, ppxlib, ppx_deriving, result }: + +buildDunePackage rec { + pname = "visitors"; + version = "20210608"; + + useDune2 = true; + + minimumOCamlVersion = "4.08"; + + src = fetchFromGitLab { + owner = "fpottier"; + repo = pname; + rev = version; + domain = "gitlab.inria.fr"; + sha256 = "1p75x5yqwbwv8yb2gz15rfl3znipy59r45d1f4vcjdghhjws6q2a"; + }; + + propagatedBuildInputs = [ ppxlib ppx_deriving result ]; + + meta = with lib; { + homepage = "https://gitlab.inria.fr/fpottier/visitors"; + changelog = "https://gitlab.inria.fr/fpottier/visitors/-/raw/${version}/CHANGES.md"; + license = licenses.lgpl21; + description = "An OCaml syntax extension (technically, a ppx_deriving plugin) which generates object-oriented visitors for traversing and transforming data structures"; + maintainers = [ maintainers.marsam ]; + }; +} diff --git a/pkgs/development/ocaml-modules/vlq/default.nix b/pkgs/development/ocaml-modules/vlq/default.nix new file mode 100644 index 00000000000..41991cbf748 --- /dev/null +++ b/pkgs/development/ocaml-modules/vlq/default.nix @@ -0,0 +1,25 @@ +{ lib, buildDunePackage, fetchurl +, dune-configurator +}: + +buildDunePackage rec { + pname = "vlq"; + version = "0.2.1"; + + src = fetchurl { + url = "https://github.com/flowtype/ocaml-vlq/releases/download/v${version}/vlq-v${version}.tbz"; + sha256 = "02wr9ph4q0nxmqgbc67ydf165hmrdv9b655krm2glc3ahb6larxi"; + }; + + useDune2 = true; + + buildInputs = [ dune-configurator ]; + + meta = { + description = "encoding variable-length quantities, in particular base64"; + license = lib.licenses.mit; + homepage = "https://github.com/flowtype/ocaml-vlq"; + maintainers = [ lib.maintainers.nomeata ]; + }; + +} diff --git a/pkgs/development/ocaml-modules/vorbis/default.nix b/pkgs/development/ocaml-modules/vorbis/default.nix new file mode 100644 index 00000000000..f33182e5fc1 --- /dev/null +++ b/pkgs/development/ocaml-modules/vorbis/default.nix @@ -0,0 +1,25 @@ +{ lib, buildDunePackage, fetchFromGitHub, dune-configurator, ogg, libvorbis }: + +buildDunePackage rec { + pname = "vorbis"; + version = "0.8.0"; + + useDune2 = true; + + src = fetchFromGitHub { + owner = "savonet"; + repo = "ocaml-vorbis"; + rev = "v${version}"; + sha256 = "1acy7yvf2y5dggzxw4vmrpdipakr98si3pw5kxw0mh7livn08al8"; + }; + + buildInputs = [ dune-configurator ]; + propagatedBuildInputs = [ ogg libvorbis ]; + + meta = with lib; { + homepage = "https://github.com/savonet/ocaml-vorbis"; + description = "Bindings to libvorbis"; + license = licenses.gpl2Only; + maintainers = with maintainers; [ dandellion ]; + }; +} diff --git a/pkgs/development/ocaml-modules/wasm/default.nix b/pkgs/development/ocaml-modules/wasm/default.nix new file mode 100644 index 00000000000..6b000891290 --- /dev/null +++ b/pkgs/development/ocaml-modules/wasm/default.nix @@ -0,0 +1,41 @@ +{ stdenv, lib, fetchFromGitHub, ocaml, findlib, ocamlbuild }: + +if !lib.versionAtLeast ocaml.version "4.02" +|| lib.versionOlder "4.13" ocaml.version +then throw "wasm is not available for OCaml ${ocaml.version}" +else + +stdenv.mkDerivation rec { + pname = "ocaml${ocaml.version}-wasm"; + version = "1.1.1"; + + src = fetchFromGitHub { + owner = "WebAssembly"; + repo = "spec"; + rev = "opam-${version}"; + sha256 = "1kp72yv4k176i94np0m09g10cviqp2pnpm7jmiq6ik7fmmbknk7c"; + }; + + nativeBuildInputs = [ ocaml findlib ocamlbuild ]; + strictDeps = true; + + # x86_64-unknown-linux-musl-ld: -r and -pie may not be used together + hardeningDisable = lib.optional stdenv.hostPlatform.isStatic "pie"; + + makeFlags = [ "-C" "interpreter" ]; + + createFindlibDestdir = true; + + postInstall = '' + mkdir $out/bin + cp -L interpreter/wasm $out/bin + ''; + + meta = { + description = "An executable and OCaml library to run, read and write Web Assembly (wasm) files and manipulate their AST"; + license = lib.licenses.asl20; + maintainers = [ lib.maintainers.vbgl ]; + homepage = "https://github.com/WebAssembly/spec/tree/master/interpreter"; + inherit (ocaml.meta) platforms; + }; +} diff --git a/pkgs/development/ocaml-modules/wayland/default.nix b/pkgs/development/ocaml-modules/wayland/default.nix new file mode 100644 index 00000000000..7dfb46ce63c --- /dev/null +++ b/pkgs/development/ocaml-modules/wayland/default.nix @@ -0,0 +1,49 @@ +{ lib +, buildDunePackage +, fetchurl +, xmlm +, lwt +, logs +, fmt +, cstruct +, cmdliner +, alcotest-lwt +}: + +buildDunePackage rec { + pname = "wayland"; + version = "1.0"; + + minimumOCamlVersion = "4.08"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/talex5/ocaml-wayland/releases/download/v${version}/wayland-${version}.tbz"; + sha256 = "bf8fd0057242d11f1c265c11cfa5de3c517ec0ad5994eae45e1efe3aac034510"; + }; + + propagatedBuildInputs = [ + lwt + logs + fmt + cstruct + ]; + + buildInputs = [ + cmdliner + xmlm + ]; + + checkInputs = [ + alcotest-lwt + ]; + doCheck = true; + + meta = { + description = "Pure OCaml Wayland protocol library"; + license = lib.licenses.asl20; + maintainers = [ lib.maintainers.sternenseemann ]; + homepage = "https://github.com/talex5/ocaml-wayland"; + }; +} diff --git a/pkgs/development/ocaml-modules/webbrowser/default.nix b/pkgs/development/ocaml-modules/webbrowser/default.nix new file mode 100644 index 00000000000..a8adced9388 --- /dev/null +++ b/pkgs/development/ocaml-modules/webbrowser/default.nix @@ -0,0 +1,28 @@ +{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, topkg +, astring, bos, cmdliner, rresult +}: + +stdenv.mkDerivation rec { + pname = "ocaml${ocaml.version}-webbrowser"; + version = "0.6.1"; + src = fetchurl { + url = "https://erratique.ch/software/webbrowser/releases/webbrowser-${version}.tbz"; + sha256 = "137a948bx7b71zfv4za3hhznrn5lzbbrgzjy0das83zms508isx3"; + }; + + nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ]; + buildInputs = [ topkg ]; + propagatedBuildInputs = [ astring bos cmdliner rresult ]; + + strictDeps = true; + + inherit (topkg) buildPhase installPhase; + + meta = { + description = "Open and reload URIs in browsers from OCaml"; + homepage = "https://erratique.ch/software/webbrowser"; + license = lib.licenses.isc; + maintainers = [ lib.maintainers.vbgl ]; + inherit (ocaml.meta) platforms; + }; +} diff --git a/pkgs/development/ocaml-modules/webmachine/default.nix b/pkgs/development/ocaml-modules/webmachine/default.nix new file mode 100644 index 00000000000..c7ad92efe76 --- /dev/null +++ b/pkgs/development/ocaml-modules/webmachine/default.nix @@ -0,0 +1,33 @@ +{ lib, buildDunePackage, fetchFromGitHub +, cohttp, dispatch, ptime +, ounit +}: + +buildDunePackage rec { + pname = "webmachine"; + version = "0.7.0"; + useDune2 = true; + + minimumOCamlVersion = "4.04"; + + src = fetchFromGitHub { + owner = "inhabitedtype"; + repo = "ocaml-webmachine"; + rev = version; + sha256 = "03ynb1l2jjqba88m9r8m5hwlm8izpfp617r4vcab5kmdim1l2ffx"; + }; + + propagatedBuildInputs = [ cohttp dispatch ptime ]; + + checkInputs = [ ounit ]; + + doCheck = true; + + meta = { + inherit (src.meta) homepage; + license = lib.licenses.bsd3; + description = "A REST toolkit for OCaml"; + maintainers = [ lib.maintainers.vbgl ]; + }; + +} diff --git a/pkgs/development/ocaml-modules/wodan/default.nix b/pkgs/development/ocaml-modules/wodan/default.nix new file mode 100644 index 00000000000..64ca29f2030 --- /dev/null +++ b/pkgs/development/ocaml-modules/wodan/default.nix @@ -0,0 +1,40 @@ +{ lib, buildDunePackage, fetchFromGitHub, lwt_ppx, ppx_cstruct, optint +, checkseum, diet, bitv, nocrypto, logs, lru, io-page, mirage-block }: + +buildDunePackage rec { + pname = "wodan"; + version = "unstable-2020-11-20"; + + useDune2 = true; + + src = fetchFromGitHub { + owner = "mirage"; + repo = pname; + rev = "cc08fe25888051c207f1009bcd2d39f8c514484f"; + sha256 = "0186vlhnl8wcz2hmpn327n9a0bibnypmjy3w4nxq3yyglh6vj1im"; + fetchSubmodules = true; + }; + + minimumOCamlVersion = "4.08"; + + propagatedBuildInputs = [ + lwt_ppx + ppx_cstruct + optint + checkseum + diet + bitv + nocrypto + logs + lru + io-page + mirage-block + ]; + + meta = with lib; { + inherit (src.meta) homepage; + description = "A flash-friendly, safe and flexible filesystem library"; + license = licenses.isc; + maintainers = with maintainers; [ ehmry ]; + }; +} diff --git a/pkgs/development/ocaml-modules/wodan/irmin.nix b/pkgs/development/ocaml-modules/wodan/irmin.nix new file mode 100644 index 00000000000..86064d887db --- /dev/null +++ b/pkgs/development/ocaml-modules/wodan/irmin.nix @@ -0,0 +1,26 @@ +{ lib, buildDunePackage, io-page-unix, irmin-chunk, irmin-git, irmin-unix +, mirage-block-ramdisk, mirage-block-unix, wodan }: + +buildDunePackage rec { + pname = "wodan-irmin"; + inherit (wodan) version src useDune2; + + propagatedBuildInputs = [ + io-page-unix + irmin-chunk + irmin-git + irmin-unix + mirage-block-ramdisk + mirage-block-unix + wodan + ]; + + meta = wodan.meta // { + # wodan is currently incompatible with irmin 2.3.0. + # additionally upgrading to current master (unclear + # if the issue is fixed there) is not possible as it + # depends on a custom fork of mirage-block + broken = true; + description = "Wodan as an Irmin store"; + }; +} diff --git a/pkgs/development/ocaml-modules/wodan/unix.nix b/pkgs/development/ocaml-modules/wodan/unix.nix new file mode 100644 index 00000000000..64a18b6b83d --- /dev/null +++ b/pkgs/development/ocaml-modules/wodan/unix.nix @@ -0,0 +1,27 @@ +{ lib, buildDunePackage, base64, benchmark, csv, cmdliner, wodan, afl-persistent +, io-page-unix, mirage-block-ramdisk, mirage-block-unix }: + +buildDunePackage rec { + outputs = [ "bin" "out" ]; + pname = "wodan-unix"; + inherit (wodan) version src useDune2; + + propagatedBuildInputs = [ + afl-persistent + base64 + benchmark + cmdliner + csv + io-page-unix + mirage-block-ramdisk + mirage-block-unix + wodan + ]; + + postInstall = '' + moveToOutput bin "''${!outputBin}" + ''; + + meta = wodan.meta // { description = "Wodan clients with Unix integration"; }; + +} diff --git a/pkgs/development/ocaml-modules/wtf8/default.nix b/pkgs/development/ocaml-modules/wtf8/default.nix new file mode 100644 index 00000000000..fec6c433604 --- /dev/null +++ b/pkgs/development/ocaml-modules/wtf8/default.nix @@ -0,0 +1,22 @@ +{ lib, fetchurl, buildDunePackage }: + +buildDunePackage rec { + pname = "wtf8"; + version = "1.0.2"; + + useDune2 = true; + + minimumOCamlVersion = "4.02"; + + src = fetchurl { + url = "https://github.com/flowtype/ocaml-${pname}/releases/download/v${version}/${pname}-v${version}.tbz"; + sha256 = "09ygcxxd5warkdzz17rgpidrd0pg14cy2svvnvy1hna080lzg7vp"; + }; + + meta = with lib; { + homepage = "https://github.com/flowtype/ocaml-wtf8"; + description = "WTF-8 is a superset of UTF-8 that allows unpaired surrogates."; + license = licenses.mit; + maintainers = [ maintainers.eqyiel ]; + }; +} diff --git a/pkgs/development/ocaml-modules/x509/default.nix b/pkgs/development/ocaml-modules/x509/default.nix new file mode 100644 index 00000000000..116772e7819 --- /dev/null +++ b/pkgs/development/ocaml-modules/x509/default.nix @@ -0,0 +1,31 @@ +{ lib, fetchurl, buildDunePackage +, alcotest, cstruct-unix +, asn1-combinators, domain-name, fmt, gmap, pbkdf, mirage-crypto, mirage-crypto-ec, mirage-crypto-pk, ipaddr +, logs, base64 +}: + +buildDunePackage rec { + minimumOCamlVersion = "4.07"; + + pname = "x509"; + version = "0.15.2"; + + src = fetchurl { + url = "https://github.com/mirleft/ocaml-x509/releases/download/v${version}/x509-v${version}.tbz"; + sha256 = "4034afdd83a0cb8291b1f809403015da9139bd772813d59d6093e42ec31ba643"; + }; + + useDune2 = true; + + buildInputs = [ alcotest cstruct-unix ]; + propagatedBuildInputs = [ asn1-combinators domain-name fmt gmap mirage-crypto mirage-crypto-pk mirage-crypto-ec pbkdf logs base64 ipaddr ]; + + doCheck = true; + + meta = with lib; { + homepage = "https://github.com/mirleft/ocaml-x509"; + description = "X509 (RFC5280) handling in OCaml"; + license = licenses.bsd2; + maintainers = with maintainers; [ vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/xenstore-tool/default.nix b/pkgs/development/ocaml-modules/xenstore-tool/default.nix new file mode 100644 index 00000000000..34f32e4f117 --- /dev/null +++ b/pkgs/development/ocaml-modules/xenstore-tool/default.nix @@ -0,0 +1,13 @@ +{ buildDunePackage, xenstore_transport, xenstore, lwt }: + +buildDunePackage { + pname = "xenstore-tool"; + + inherit (xenstore_transport) src version useDune2 minimumOCamlVersion; + + buildInputs = [ xenstore_transport xenstore lwt ]; + + meta = xenstore_transport.meta // { + description = "Command line tool for interfacing with xenstore"; + }; +} diff --git a/pkgs/development/ocaml-modules/xenstore/default.nix b/pkgs/development/ocaml-modules/xenstore/default.nix new file mode 100644 index 00000000000..189920290e3 --- /dev/null +++ b/pkgs/development/ocaml-modules/xenstore/default.nix @@ -0,0 +1,30 @@ +{ lib, buildDunePackage, fetchurl +, cstruct, ppx_cstruct, lwt, ounit, stdlib-shims +}: + +buildDunePackage rec { + pname = "xenstore"; + version = "2.1.1"; + + minimumOCamlVersion = "4.04"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/mirage/ocaml-xenstore/releases/download/${version}/xenstore-${version}.tbz"; + sha256 = "283814ea21adc345c4d59cfcb17b2f7c1185004ecaecc3871557c961874c84f5"; + }; + + nativeBuildInputs = [ ppx_cstruct ]; + propagatedBuildInputs = [ stdlib-shims cstruct lwt ]; + + doCheck = true; + checkInputs = [ ounit ]; + + meta = with lib; { + description = "Xenstore protocol in pure OCaml"; + license = licenses.lgpl21Only; + maintainers = [ maintainers.sternenseemann ]; + homepage = "https://github.com/mirage/ocaml-xenstore"; + }; +} diff --git a/pkgs/development/ocaml-modules/xenstore_transport/default.nix b/pkgs/development/ocaml-modules/xenstore_transport/default.nix new file mode 100644 index 00000000000..1981f2d5cab --- /dev/null +++ b/pkgs/development/ocaml-modules/xenstore_transport/default.nix @@ -0,0 +1,27 @@ +{ lib, buildDunePackage, fetchFromGitHub, xenstore, lwt }: + +buildDunePackage rec { + pname = "xenstore_transport"; + version = "1.3.0"; + + minimumOCamlVersion = "4.04"; + useDune2 = true; + + src = fetchFromGitHub { + owner = "xapi-project"; + repo = "ocaml-xenstore-clients"; + rev = "v${version}"; + sha256 = "1kxxd9i4qiq98r7sgvl59iq2ni7y6drnv48qj580q5cyiyyc85q3"; + }; + + propagatedBuildInputs = [ xenstore lwt ]; + + # requires a mounted xenfs and xen server + doCheck = false; + + meta = with lib; { + description = "Low-level libraries for connecting to a xenstore service on a xen host"; + license = licenses.lgpl21Only; + homepage = "https://github.com/xapi-project/ocaml-xenstore-clients"; + }; +} diff --git a/pkgs/development/ocaml-modules/xml-light/default.nix b/pkgs/development/ocaml-modules/xml-light/default.nix new file mode 100644 index 00000000000..8eb700a4d14 --- /dev/null +++ b/pkgs/development/ocaml-modules/xml-light/default.nix @@ -0,0 +1,42 @@ +{ stdenv, lib, fetchFromGitHub, ocaml, findlib }: + +stdenv.mkDerivation rec { + pname = "ocaml${ocaml.version}-xml-light"; + version = "2.4"; + + src = fetchFromGitHub { + owner = "ncannasse"; + repo = "xml-light"; + rev = version; + sha256 = "sha256-2txmkl/ZN5RGaLQJmr+orqwB4CbFk2RpLJd4gr7kPiE="; + }; + + nativeBuildInputs = [ ocaml findlib ]; + + strictDeps = true; + + createFindlibDestdir = true; + + installPhase = '' + runHook preInstall + make install_ocamlfind + mkdir -p $out/share + cp -vai doc $out/share/ + runHook postInstall + ''; + + meta = { + description = "Minimal Xml parser and printer for OCaml"; + longDescription = '' + Xml-Light provides functions to parse an XML document into an OCaml + data structure, work with it, and print it back to an XML + document. It support also DTD parsing and checking, and is + entirely written in OCaml, hence it does not require additional C + library. + ''; + homepage = "http://tech.motion-twin.com/xmllight.html"; + license = lib.licenses.lgpl21; + maintainers = [ lib.maintainers.romildo ]; + inherit (ocaml.meta) platforms; + }; +} diff --git a/pkgs/development/ocaml-modules/xmlm/default.nix b/pkgs/development/ocaml-modules/xmlm/default.nix new file mode 100644 index 00000000000..f7aa1fdf113 --- /dev/null +++ b/pkgs/development/ocaml-modules/xmlm/default.nix @@ -0,0 +1,34 @@ +{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg }: +let + pname = "xmlm"; + webpage = "https://erratique.ch/software/${pname}"; +in + +if !lib.versionAtLeast ocaml.version "4.02" +then throw "xmlm is not available for OCaml ${ocaml.version}" +else + +stdenv.mkDerivation rec { + name = "ocaml${ocaml.version}-${pname}-${version}"; + version = "1.3.0"; + + src = fetchurl { + url = "${webpage}/releases/${pname}-${version}.tbz"; + sha256 = "1rrdxg5kh9zaqmgapy9bhdqyxbbvxxib3bdfg1vhw4rrkp1z0x8n"; + }; + + nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ]; + buildInputs = [ topkg ]; + + strictDeps = true; + + inherit (topkg) buildPhase installPhase; + + meta = with lib; { + description = "An OCaml streaming codec to decode and encode the XML data format"; + homepage = webpage; + platforms = ocaml.meta.platforms or []; + maintainers = [ maintainers.vbgl ]; + license = licenses.bsd3; + }; +} diff --git a/pkgs/development/ocaml-modules/xtmpl/default.nix b/pkgs/development/ocaml-modules/xtmpl/default.nix new file mode 100644 index 00000000000..7c2f0a01e53 --- /dev/null +++ b/pkgs/development/ocaml-modules/xtmpl/default.nix @@ -0,0 +1,23 @@ +{ lib, buildDunePackage, fetchFromGitLab, iri, re, sedlex_2, uutf }: + +buildDunePackage rec { + pname = "xtmpl"; + version = "0.19.0"; + useDune2 = true; + src = fetchFromGitLab { + domain = "framagit.org"; + owner = "zoggy"; + repo = "xtmpl"; + rev = version; + sha256 = "sha256:0vwj0aayg60wm98d91fg3hmj90730liljy4cn8771dpxvz8m07bw"; + }; + + propagatedBuildInputs = [ iri re sedlex_2 uutf ]; + + meta = with lib; { + description = "XML templating library for OCaml"; + homepage = "https://www.good-eris.net/xtmpl/"; + license = licenses.lgpl3; + maintainers = with maintainers; [ regnat ]; + }; +} diff --git a/pkgs/development/ocaml-modules/xtmpl/ppx.nix b/pkgs/development/ocaml-modules/xtmpl/ppx.nix new file mode 100644 index 00000000000..b6f5bd65000 --- /dev/null +++ b/pkgs/development/ocaml-modules/xtmpl/ppx.nix @@ -0,0 +1,14 @@ +{ buildDunePackage, xtmpl, ppxlib }: + +buildDunePackage { + pname = "xtmpl_ppx"; + minimalOCamlVersion = "4.11"; + + inherit (xtmpl) src version useDune2; + + buildInputs = [ ppxlib xtmpl ]; + + meta = xtmpl.meta // { + description = "Xml templating library, ppx extension"; + }; +} diff --git a/pkgs/development/ocaml-modules/yaml/default.nix b/pkgs/development/ocaml-modules/yaml/default.nix new file mode 100644 index 00000000000..43481e4c7f3 --- /dev/null +++ b/pkgs/development/ocaml-modules/yaml/default.nix @@ -0,0 +1,31 @@ +{ lib, fetchurl, buildDunePackage, ocaml +, dune-configurator +, bos, ctypes, fmt, logs, rresult +, mdx, alcotest, crowbar, junit_alcotest, ezjsonm +}: + +buildDunePackage rec { + pname = "yaml"; + version = "3.0.0"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/avsm/ocaml-yaml/releases/download/v${version}/yaml-v${version}.tbz"; + sha256 = "1iws6lbnrrd5hhmm7lczfvqp0aidx5xn7jlqk2s5rjfmj9qf4j2c"; + }; + + buildInputs = [ dune-configurator ]; + propagatedBuildInputs = [ bos ctypes rresult ]; + # crowbar is not available for OCaml < 4.08 + doCheck = lib.versionAtLeast ocaml.version "4.08"; + checkInputs = [ fmt logs mdx.bin alcotest crowbar junit_alcotest ezjsonm ]; + + meta = { + description = "Parse and generate YAML 1.1 files"; + homepage = "https://github.com/avsm/ocaml-yaml"; + license = lib.licenses.isc; + maintainers = [ lib.maintainers.vbgl ]; + }; + +} diff --git a/pkgs/development/ocaml-modules/yaml/yaml-sexp.nix b/pkgs/development/ocaml-modules/yaml/yaml-sexp.nix new file mode 100644 index 00000000000..96036145844 --- /dev/null +++ b/pkgs/development/ocaml-modules/yaml/yaml-sexp.nix @@ -0,0 +1,13 @@ +{ lib, fetchurl, buildDunePackage, yaml, dune-configurator, ppx_sexp_conv, sexplib }: + +buildDunePackage rec { + pname = "yaml-sexp"; + + inherit (yaml) version src useDune2; + + propagatedBuildInputs = [ yaml ppx_sexp_conv sexplib ]; + + meta = yaml.meta // { + description = "ocaml-yaml with sexp support"; + }; +} diff --git a/pkgs/development/ocaml-modules/yojson/default.nix b/pkgs/development/ocaml-modules/yojson/default.nix new file mode 100644 index 00000000000..2be9ce1b021 --- /dev/null +++ b/pkgs/development/ocaml-modules/yojson/default.nix @@ -0,0 +1,22 @@ +{ lib, fetchurl, buildDunePackage, cppo, easy-format, biniou }: + +buildDunePackage rec { + pname = "yojson"; + version = "1.7.0"; + useDune2 = true; + + src = fetchurl { + url = "https://github.com/ocaml-community/yojson/releases/download/${version}/yojson-${version}.tbz"; + sha256 = "1iich6323npvvs8r50lkr4pxxqm9mf6w67cnid7jg1j1g5gwcvv5"; + }; + + nativeBuildInputs = [ cppo ]; + propagatedBuildInputs = [ easy-format biniou ]; + + meta = with lib; { + description = "An optimized parsing and printing library for the JSON format"; + homepage = "https://github.com/ocaml-community/${pname}"; + license = licenses.bsd3; + maintainers = [ maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/yuscii/default.nix b/pkgs/development/ocaml-modules/yuscii/default.nix new file mode 100644 index 00000000000..9d7b5d3c4d6 --- /dev/null +++ b/pkgs/development/ocaml-modules/yuscii/default.nix @@ -0,0 +1,35 @@ +{ alcotest +, buildDunePackage +, fetchzip +, gcc +, fmt +, lib +, uutf +}: + +buildDunePackage rec { + pname = "yuscii"; + version = "0.3.0"; + + src = fetchzip { + url = "https://github.com/mirage/yuscii/releases/download/v${version}/yuscii-v${version}.tbz"; + sha256 = "0idywlkw0fbakrxv65swnr5bj7f2vns9kpay7q03gzlv82p670hy"; + }; + + useDune2 = true; + + checkInputs = [ + gcc + alcotest + fmt + uutf + ]; + doCheck = true; + + meta = { + description = "A simple mapper between UTF-7 to Unicode according RFC2152"; + license = lib.licenses.mit; + homepage = "https://github.com/mirage/yuscii"; + maintainers = with lib.maintainers; [ ]; + }; +} diff --git a/pkgs/development/ocaml-modules/z3/default.nix b/pkgs/development/ocaml-modules/z3/default.nix new file mode 100644 index 00000000000..b17f29b4353 --- /dev/null +++ b/pkgs/development/ocaml-modules/z3/default.nix @@ -0,0 +1,40 @@ +{ stdenv, lib, ocaml, findlib, zarith, z3 }: + +if !lib.versionAtLeast ocaml.version "4.07" +then throw "z3 is not available for OCaml ${ocaml.version}" +else + +let z3-with-ocaml = (z3.override { + ocamlBindings = true; + inherit ocaml findlib zarith; +}).overrideAttrs (o: { + patches = (o.patches or []) ++ [ + # Fix build; see: https://github.com/Z3Prover/z3/issues/5776 + ./ocamlfind.patch + ]; +}); in + +stdenv.mkDerivation { + + pname = "ocaml${ocaml.version}-z3"; + inherit (z3-with-ocaml) version; + + dontUnpack = true; + + installPhase = '' + runHook preInstall + mkdir -p $OCAMLFIND_DESTDIR + cp -r ${z3-with-ocaml.ocaml}/lib/ocaml/${ocaml.version}/site-lib/stublibs $OCAMLFIND_DESTDIR + cp -r ${z3-with-ocaml.ocaml}/lib/ocaml/${ocaml.version}/site-lib/Z3 $OCAMLFIND_DESTDIR/z3 + runHook postInstall + ''; + + nativeBuildInputs = [ findlib ]; + propagatedBuildInputs = [ zarith ]; + + strictDeps = true; + + meta = z3.meta // { + description = "Z3 Theorem Prover (OCaml API)"; + }; +} diff --git a/pkgs/development/ocaml-modules/z3/ocamlfind.patch b/pkgs/development/ocaml-modules/z3/ocamlfind.patch new file mode 100644 index 00000000000..d84907cf793 --- /dev/null +++ b/pkgs/development/ocaml-modules/z3/ocamlfind.patch @@ -0,0 +1,13 @@ +diff --git a/scripts/mk_util.py b/scripts/mk_util.py +index 042e6af46..1e105b002 100644 +--- a/scripts/mk_util.py ++++ b/scripts/mk_util.py +@@ -1995,7 +1995,7 @@ class MLComponent(Component): + + LIBZ3 = LIBZ3 + ' ' + ' '.join(map(lambda x: '-cclib ' + x, LDFLAGS.split())) + +- stubs_install_path = '$$(%s printconf path)/stublibs' % OCAMLFIND ++ stubs_install_path = '$$(%s printconf destdir)/stublibs' % OCAMLFIND + if not STATIC_LIB: + loadpath = '-ccopt -L' + stubs_install_path + dllpath = '-dllpath ' + stubs_install_path diff --git a/pkgs/development/ocaml-modules/zarith/default.nix b/pkgs/development/ocaml-modules/zarith/default.nix new file mode 100644 index 00000000000..95351caee30 --- /dev/null +++ b/pkgs/development/ocaml-modules/zarith/default.nix @@ -0,0 +1,38 @@ +{ lib, stdenv, fetchFromGitHub +, ocaml, findlib, pkg-config +, gmp +}: + +if !lib.versionAtLeast ocaml.version "4.04" +then throw "zarith is not available for OCaml ${ocaml.version}" +else + +stdenv.mkDerivation rec { + pname = "ocaml${ocaml.version}-zarith"; + version = "1.12"; + src = fetchFromGitHub { + owner = "ocaml"; + repo = "Zarith"; + rev = "release-${version}"; + sha256 = "1jslm1rv1j0ya818yh23wf3bb6hz7qqj9pn5fwl45y9mqyqa01s9"; + }; + + nativeBuildInputs = [ pkg-config ocaml findlib ]; + propagatedBuildInputs = [ gmp ]; + strictDeps = true; + + dontAddPrefix = true; + dontAddStaticConfigureFlags = true; + configurePlatforms = []; + configureFlags = [ "-installdir ${placeholder "out"}/lib/ocaml/${ocaml.version}/site-lib" ]; + + preInstall = "mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib/stublibs"; + + meta = with lib; { + description = "Fast, arbitrary precision OCaml integers"; + homepage = "http://forge.ocamlcore.org/projects/zarith"; + license = licenses.lgpl2; + inherit (ocaml.meta) platforms; + maintainers = with maintainers; [ thoughtpolice vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/zed/default.nix b/pkgs/development/ocaml-modules/zed/default.nix new file mode 100644 index 00000000000..a7889523bcc --- /dev/null +++ b/pkgs/development/ocaml-modules/zed/default.nix @@ -0,0 +1,33 @@ +{ lib, buildDunePackage, fetchFromGitHub, camomile, react, charInfo_width }: + +buildDunePackage rec { + pname = "zed"; + version = "3.1.0"; + + useDune2 = true; + + src = fetchFromGitHub { + owner = "ocaml-community"; + repo = pname; + rev = version; + sha256 = "04vr1a94imsghm98iigc35rhifsz0rh3qz2qm0wam2wvp6vmrx0p"; + }; + + propagatedBuildInputs = [ charInfo_width react ]; + + meta = { + description = "Abstract engine for text edition in OCaml"; + longDescription = '' + Zed is an abstract engine for text edition. It can be used to write text editors, edition widgets, readlines, ... + + Zed uses Camomile to fully support the Unicode specification, and implements an UTF-8 encoded string type with validation, and a rope datastructure to achieve efficient operations on large Unicode buffers. Zed also features a regular expression search on ropes. + + To support efficient text edition capabilities, Zed provides macro recording and cursor management facilities. + ''; + inherit (src.meta) homepage; + license = lib.licenses.bsd3; + maintainers = [ + lib.maintainers.gal_bolle + ]; + }; +} diff --git a/pkgs/development/ocaml-modules/zmq/default.nix b/pkgs/development/ocaml-modules/zmq/default.nix new file mode 100644 index 00000000000..9779004085c --- /dev/null +++ b/pkgs/development/ocaml-modules/zmq/default.nix @@ -0,0 +1,27 @@ +{ lib, fetchFromGitHub, buildDunePackage, dune-configurator, czmq, stdint }: + +buildDunePackage rec { + minimumOCamlVersion = "4.03"; + pname = "zmq"; + version = "20180726"; + + useDune2 = true; + + src = fetchFromGitHub { + owner = "issuu"; + repo = "ocaml-zmq"; + rev = "d312a8458d6b688f75470248f11875fbbfa5bb1a"; + sha256 = "1f5l4bw78y4drabhyvmpj3z8k30bill33ca7bzhr02m55yf6gqpf"; + }; + + buildInputs = [ czmq dune-configurator ]; + + propagatedBuildInputs = [ stdint ]; + + meta = { + description = "ZeroMQ bindings for OCaml"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ akavel ]; + inherit (src.meta) homepage; + }; +} diff --git a/pkgs/development/ocaml-modules/zmq/lwt.nix b/pkgs/development/ocaml-modules/zmq/lwt.nix new file mode 100644 index 00000000000..6717e787f19 --- /dev/null +++ b/pkgs/development/ocaml-modules/zmq/lwt.nix @@ -0,0 +1,8 @@ +{ buildDunePackage, zmq, ocaml_lwt }: + +buildDunePackage { + pname = "zmq-lwt"; + inherit (zmq) version src useDune2 meta; + + propagatedBuildInputs = [ zmq ocaml_lwt ]; +} |