diff options
Diffstat (limited to 'pkgs/development/ocaml-modules')
11 files changed, 141 insertions, 28 deletions
diff --git a/pkgs/development/ocaml-modules/batteries/default.nix b/pkgs/development/ocaml-modules/batteries/default.nix index b0ad12dad67..1b3bb9a7981 100644 --- a/pkgs/development/ocaml-modules/batteries/default.nix +++ b/pkgs/development/ocaml-modules/batteries/default.nix @@ -1,13 +1,13 @@ { stdenv, fetchurl, ocaml, findlib, ocamlbuild, qtest, num }: -let version = "2.10.0"; in +let version = "2.11.0"; in stdenv.mkDerivation { name = "ocaml${ocaml.version}-batteries-${version}"; src = fetchurl { url = "https://github.com/ocaml-batteries-team/batteries-included/releases/download/v${version}/batteries-${version}.tar.gz"; - sha256 = "08ghw87d56h1a6y1nnh3x2wy9xj25jqfk5sp6ma9nsyd37babb0h"; + sha256 = "0swdnm9c3sd3yzzyg7yh1lkqhfikmga4fzx2416ja1q62nv26j53"; }; buildInputs = [ ocaml findlib ocamlbuild qtest ]; diff --git a/pkgs/development/ocaml-modules/janestreet/0.12.nix b/pkgs/development/ocaml-modules/janestreet/0.12.nix index f912bdaa21f..4585a3b8596 100644 --- a/pkgs/development/ocaml-modules/janestreet/0.12.nix +++ b/pkgs/development/ocaml-modules/janestreet/0.12.nix @@ -398,6 +398,10 @@ rec { 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 { diff --git a/pkgs/development/ocaml-modules/lens/default.nix b/pkgs/development/ocaml-modules/lens/default.nix new file mode 100644 index 00000000000..27a753ae81a --- /dev/null +++ b/pkgs/development/ocaml-modules/lens/default.nix @@ -0,0 +1,23 @@ +{ lib, fetchzip, ppx_deriving, ppxfind, buildDunePackage }: + +buildDunePackage rec { + pname = "lens"; + version = "1.2.3"; + + src = fetchzip { + url = "https://github.com/pdonadeo/ocaml-lens/archive/v${version}.tar.gz"; + sha256 = "09k2vhzysx91syjhgv6w1shc9mgzi0l4bhwpx1g5pi4r4ghjp07y"; + }; + + minimumOCamlVersion = "4.04.1"; + buildInputs = [ ppx_deriving ppxfind ]; + + 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/lwt/ppx.nix b/pkgs/development/ocaml-modules/lwt/ppx.nix index 4ad6fc2c471..3cf4541aa01 100644 --- a/pkgs/development/ocaml-modules/lwt/ppx.nix +++ b/pkgs/development/ocaml-modules/lwt/ppx.nix @@ -1,9 +1,21 @@ -{ buildDunePackage, lwt, ppx_tools_versioned }: +{ fetchzip, buildDunePackage, lwt, ppx_tools_versioned }: buildDunePackage { pname = "lwt_ppx"; + version = "1.2.4"; + + src = fetchzip { + # `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. + url = "https://github.com/ocsigen/lwt/archive/4.4.0.tar.gz"; + sha256 = "1l97zdcql7y13fhaq0m9n9xvxf712jg0w70r72fvv6j49xm4nlhi"; + }; - inherit (lwt) src version; propagatedBuildInputs = [ lwt ppx_tools_versioned ]; diff --git a/pkgs/development/ocaml-modules/ocaml-migrate-parsetree/default.nix b/pkgs/development/ocaml-modules/ocaml-migrate-parsetree/default.nix index 23940ef1499..f633d17252c 100644 --- a/pkgs/development/ocaml-modules/ocaml-migrate-parsetree/default.nix +++ b/pkgs/development/ocaml-modules/ocaml-migrate-parsetree/default.nix @@ -1,22 +1,22 @@ -{ stdenv, fetchFromGitHub, buildDunePackage, result, ppx_derivers }: +{ lib, fetchFromGitHub, buildDunePackage, result, ppx_derivers }: buildDunePackage rec { pname = "ocaml-migrate-parsetree"; - version = "1.4.0"; + version = "1.5.0"; src = fetchFromGitHub { owner = "ocaml-ppx"; repo = pname; rev = "v${version}"; - sha256 = "0sv1p4615l8gpbah4ya2c40yr6fbvahvv3ks7zhrsgcwcq2ljyr2"; + sha256 = "0ms7nx7x16nkbm9rln3sycbzg6ad8swz8jw6bjndrill8bg3fipv"; }; propagatedBuildInputs = [ ppx_derivers result ]; meta = { description = "Convert OCaml parsetrees between different major versions"; - license = stdenv.lib.licenses.lgpl21; - maintainers = [ stdenv.lib.maintainers.vbgl ]; + license = lib.licenses.lgpl21; + maintainers = [ lib.maintainers.vbgl ]; inherit (src.meta) homepage; }; } diff --git a/pkgs/development/ocaml-modules/ppxfind/default.nix b/pkgs/development/ocaml-modules/ppxfind/default.nix index 3b61a651263..75d1e57765e 100644 --- a/pkgs/development/ocaml-modules/ppxfind/default.nix +++ b/pkgs/development/ocaml-modules/ppxfind/default.nix @@ -1,4 +1,4 @@ -{ lib, buildDunePackage, fetchurl, ocaml, ocaml-migrate-parsetree }: +{ stdenv, lib, buildDunePackage, fetchurl, ocaml, ocaml-migrate-parsetree }: buildDunePackage (rec { pname = "ppxfind"; @@ -12,6 +12,9 @@ buildDunePackage (rec { buildInputs = [ ocaml-migrate-parsetree ]; + # Don't run the native `strip' when cross-compiling. + dontStrip = stdenv.hostPlatform != stdenv.buildPlatform; + meta = { homepage = "https://github.com/diml/ppxfind"; description = "ocamlfind ppx tool"; diff --git a/pkgs/development/ocaml-modules/rresult/default.nix b/pkgs/development/ocaml-modules/rresult/default.nix index d40ce19a8fd..579d3da81e3 100644 --- a/pkgs/development/ocaml-modules/rresult/default.nix +++ b/pkgs/development/ocaml-modules/rresult/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg }: +{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg, result }: stdenv.mkDerivation rec { name = "ocaml${ocaml.version}-rresult-${version}"; @@ -10,6 +10,8 @@ stdenv.mkDerivation rec { buildInputs = [ ocaml findlib ocamlbuild topkg ]; + propagatedBuildInputs = [ result ]; + inherit (topkg) buildPhase installPhase; meta = { diff --git a/pkgs/development/ocaml-modules/sedlex/2.nix b/pkgs/development/ocaml-modules/sedlex/2.nix new file mode 100644 index 00000000000..09390a27343 --- /dev/null +++ b/pkgs/development/ocaml-modules/sedlex/2.nix @@ -0,0 +1,69 @@ +{ stdenv +, fetchFromGitHub +, fetchurl +, ocaml +, dune +, findlib +, gen +, ppx_tools_versioned +, ocaml-migrate-parsetree +, uchar +}: + +if stdenv.lib.versionOlder ocaml.version "4.02.3" +then throw "sedlex is not available for OCaml ${ocaml.version}" +else + +let + DerivedCoreProperties = fetchurl { + url = "https://www.unicode.org/Public/12.1.0/ucd/DerivedCoreProperties.txt"; + sha256 = "0s6sn1yr9qmb2i6gf8dir2zpsbjv1frdfzy3i2yjylzvf637msx6"; + }; + DerivedGeneralCategory = fetchurl { + url = "https://www.unicode.org/Public/12.1.0/ucd/extracted/DerivedGeneralCategory.txt"; + sha256 = "1rifzq9ba6c58dn0lrmcb5l5k4ksx3zsdkira3m5p6h4i2wriy3q"; + }; + PropList = fetchurl { + url = "https://www.unicode.org/Public/12.1.0/ucd/PropList.txt"; + sha256 = "0gsb1jpj3mnqbjgbavi4l95gl6g4agq58j82km22fdfg63j3w3fk"; + }; +in +stdenv.mkDerivation rec { + name = "ocaml${ocaml.version}-sedlex-${version}"; + version = "2.1"; + + src = fetchFromGitHub { + owner = "ocaml-community"; + repo = "sedlex"; + rev = "v${version}"; + sha256 = "05f6qa8x3vhpdz1fcnpqk37fpnyyq13icqsk2gww5idjnh6kng26"; + }; + + buildInputs = [ ocaml findlib dune ppx_tools_versioned ocaml-migrate-parsetree ]; + + propagatedBuildInputs = [ gen uchar ]; + + preBuild = '' + ln -s ${DerivedCoreProperties} src/generator/data/DerivedCoreProperties.txt + ln -s ${DerivedGeneralCategory} src/generator/data/DerivedGeneralCategory.txt + ln -s ${PropList} src/generator/data/PropList.txt + ''; + + buildFlags = [ "build" ]; + + installPhase = '' + make INSTALL_ARGS="--prefix=$out --libdir=$OCAMLFIND_DESTDIR" install + ''; + + createFindlibDestdir = true; + + dontStrip = true; + + meta = { + homepage = https://github.com/ocaml-community/sedlex; + description = "An OCaml lexer generator for Unicode"; + license = stdenv.lib.licenses.mit; + inherit (ocaml.meta) platforms; + maintainers = [ stdenv.lib.maintainers.marsam ]; + }; +} diff --git a/pkgs/development/ocaml-modules/sqlite3/default.nix b/pkgs/development/ocaml-modules/sqlite3/default.nix index 53b11f285a6..f47d7d37631 100644 --- a/pkgs/development/ocaml-modules/sqlite3/default.nix +++ b/pkgs/development/ocaml-modules/sqlite3/default.nix @@ -1,24 +1,22 @@ -{ stdenv, fetchurl, sqlite, ocaml, findlib, ocamlbuild, pkgconfig }: +{ lib, fetchurl, sqlite, pkgconfig, buildDunePackage }: -stdenv.mkDerivation rec { - pname = "ocaml-sqlite3"; - version = "2.0.9"; +buildDunePackage rec { + pname = "sqlite3"; + version = "5.0.1"; + minimumOCamlVersion = "4.05"; src = fetchurl { - url = "https://github.com/mmottl/sqlite3-ocaml/releases/download/v${version}/sqlite3-ocaml-${version}.tar.gz"; - sha256 = "0rwsx1nfa3xqmbygim2qx45jqm1gwf08m70wmcwkx50f1qk3l551"; + url = "https://github.com/mmottl/sqlite3-ocaml/releases/download/${version}/sqlite3-${version}.tbz"; + sha256 = "0iymkszrs6qwak0vadfzc8yd8jfwn06zl08ggb4jr2mgk2c8mmsn"; }; nativeBuildInputs = [ pkgconfig ]; - buildInputs = [ ocaml findlib ocamlbuild sqlite ]; + buildInputs = [ sqlite ]; - createFindlibDestdir = true; - - meta = with stdenv.lib; { + meta = with lib; { homepage = http://mmottl.github.io/sqlite3-ocaml/; description = "OCaml bindings to the SQLite 3 database access library"; license = licenses.mit; - platforms = ocaml.meta.platforms or []; maintainers = with maintainers; [ maggesi vbgl ]; diff --git a/pkgs/development/ocaml-modules/stdint/default.nix b/pkgs/development/ocaml-modules/stdint/default.nix index a36d84ffa3a..bffef61956e 100644 --- a/pkgs/development/ocaml-modules/stdint/default.nix +++ b/pkgs/development/ocaml-modules/stdint/default.nix @@ -1,9 +1,11 @@ -{ stdenv, fetchFromGitHub, buildDunePackage }: +{ lib, fetchFromGitHub, buildDunePackage }: buildDunePackage rec { pname = "stdint"; version = "0.6.0"; + minimumOCamlVersion = "4.07"; + src = fetchFromGitHub { owner = "andrenth"; repo = "ocaml-stdint"; @@ -14,7 +16,7 @@ buildDunePackage rec { meta = { description = "Various signed and unsigned integers for OCaml"; homepage = "https://github.com/andrenth/ocaml-stdint"; - license = stdenv.lib.licenses.mit; - maintainers = [ stdenv.lib.maintainers.gebner ]; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.gebner ]; }; } diff --git a/pkgs/development/ocaml-modules/uchar/default.nix b/pkgs/development/ocaml-modules/uchar/default.nix index 2140871021d..b5b2170e56a 100644 --- a/pkgs/development/ocaml-modules/uchar/default.nix +++ b/pkgs/development/ocaml-modules/uchar/default.nix @@ -8,10 +8,10 @@ stdenv.mkDerivation { sha256 = "1w2saw7zanf9m9ffvz2lvcxvlm118pws2x1wym526xmydhqpyfa7"; }; - nativeBuildInputs = [ ocaml ocamlbuild findlib opaline ]; - buildInputs = [ findlib ocaml ocamlbuild opaline ]; + nativeBuildInputs = [ ocaml ocamlbuild findlib ]; + buildInputs = [ findlib ocaml ocamlbuild ]; buildPhase = "ocaml pkg/build.ml native=true native-dynlink=${if withShared then "true" else "false"}"; - installPhase = "opaline -libdir $OCAMLFIND_DESTDIR"; + installPhase = "${opaline}/bin/opaline -libdir $OCAMLFIND_DESTDIR"; configurePlatforms = []; meta = { |