forked from mirrors/nixpkgs
ocamlPackages.buildTopkgPackage: Added
This function helps building an OCaml package that builds with topkg. There are currently many such packages in nixpkgs and this function would greatly simplify adding more. This is heavily inspired by `ocamlPackages.buildDunePackage`.
This commit is contained in:
parent
499149ef95
commit
187d777aad
28
pkgs/build-support/ocaml/topkg.nix
Normal file
28
pkgs/build-support/ocaml/topkg.nix
Normal file
|
@ -0,0 +1,28 @@
|
|||
{ lib, stdenv, fetchurl, ocaml, findlib, topkg, ocamlbuild, cmdliner, odoc, b0
|
||||
}:
|
||||
|
||||
{ pname, version, nativeBuildInputs ? [ ], buildInputs ? [ ], ... }@args:
|
||||
|
||||
lib.throwIf (args ? minimalOCamlVersion
|
||||
&& lib.versionOlder ocaml.version args.minimalOCamlVersion)
|
||||
"${pname}-${version} is not available for OCaml ${ocaml.version}"
|
||||
|
||||
stdenv.mkDerivation ({
|
||||
|
||||
dontAddStaticConfigureFlags = true;
|
||||
configurePlatforms = [ ];
|
||||
strictDeps = true;
|
||||
inherit (topkg) buildPhase installPhase;
|
||||
|
||||
} // (builtins.removeAttrs args [ "minimalOCamlVersion" ]) // {
|
||||
|
||||
name = "ocaml${ocaml.version}-${pname}-${version}";
|
||||
|
||||
nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ] ++ nativeBuildInputs;
|
||||
buildInputs = [ topkg ] ++ buildInputs;
|
||||
|
||||
meta = (args.meta or { }) // {
|
||||
platforms = args.meta.platforms or ocaml.meta.platforms;
|
||||
};
|
||||
|
||||
})
|
|
@ -1890,6 +1890,8 @@ let
|
|||
|
||||
buildOasisPackage = callPackage ../build-support/ocaml/oasis.nix { };
|
||||
|
||||
buildTopkgPackage = callPackage ../build-support/ocaml/topkg.nix { };
|
||||
|
||||
# Apps from all-packages, to be eventually removed
|
||||
|
||||
google-drive-ocamlfuse = callPackage ../applications/networking/google-drive-ocamlfuse { };
|
||||
|
|
Loading…
Reference in a new issue