forked from mirrors/nixpkgs
Merge pull request #65715 from mgttlinger/build-oasis-package
OCaml build support: add oasis build system
This commit is contained in:
commit
b1d37354d7
46
pkgs/build-support/ocaml/oasis.nix
Normal file
46
pkgs/build-support/ocaml/oasis.nix
Normal file
|
@ -0,0 +1,46 @@
|
|||
{ stdenv, ocaml_oasis, ocaml, findlib, ocamlbuild }:
|
||||
|
||||
{ pname, version, buildInputs ? [], meta ? { platforms = ocaml.meta.platforms or []; },
|
||||
minimumOCamlVersion ? null,
|
||||
createFindlibDestdir ? true,
|
||||
dontStrip ? true,
|
||||
...
|
||||
}@args:
|
||||
|
||||
if args ? minimumOCamlVersion &&
|
||||
! stdenv.lib.versionAtLeast ocaml.version args.minimumOCamlVersion
|
||||
then throw "${pname}-${version} is not available for OCaml ${ocaml.version}"
|
||||
else
|
||||
|
||||
stdenv.mkDerivation (args // {
|
||||
name = "ocaml${ocaml.version}-${pname}-${version}";
|
||||
|
||||
buildInputs = [ ocaml findlib ocamlbuild ocaml_oasis ] ++ buildInputs;
|
||||
|
||||
inherit createFindlibDestdir;
|
||||
inherit dontStrip;
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
oasis setup
|
||||
ocaml setup.ml -configure
|
||||
ocaml setup.ml -build
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
checkPhase = ''
|
||||
runHook preCheck
|
||||
ocaml setup.ml -test
|
||||
runHook postCheck
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir -p $out
|
||||
sed -i s+/usr/local+$out+g setup.ml
|
||||
sed -i s+/usr/local+$out+g setup.data
|
||||
prefix=$OCAMLFIND_DESTDIR ocaml setup.ml -install
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
})
|
25
pkgs/development/ocaml-modules/tcslib/default.nix
Normal file
25
pkgs/development/ocaml-modules/tcslib/default.nix
Normal file
|
@ -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 ];
|
||||
};
|
||||
}
|
|
@ -12,6 +12,8 @@ let
|
|||
|
||||
buildOcaml = callPackage ../build-support/ocaml { };
|
||||
|
||||
buildOasisPackage = callPackage ../build-support/ocaml/oasis.nix { };
|
||||
|
||||
buildDunePackage = callPackage ../build-support/ocaml/dune.nix {};
|
||||
|
||||
alcotest = callPackage ../development/ocaml-modules/alcotest {};
|
||||
|
@ -725,6 +727,8 @@ let
|
|||
|
||||
stringext = callPackage ../development/ocaml-modules/stringext { };
|
||||
|
||||
tcslib = callPackage ../development/ocaml-modules/tcslib { };
|
||||
|
||||
toml = callPackage ../development/ocaml-modules/toml { };
|
||||
|
||||
topkg = callPackage ../development/ocaml-modules/topkg { };
|
||||
|
|
Loading…
Reference in a new issue