3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/ocaml-modules/ulex/default.nix
Ulrik Strid a13cdfe520 ocamlPackages tree-wide: Move buildInputs that should be nativeBuildInputs
To keep this for the future we also strictDeps where possible, including for janePackages, topkg, oasis and ocamlbuild.
This makes some closures significantly smaller and makes cross compilation easier
2022-02-24 14:39:27 +01:00

42 lines
993 B
Nix

{ 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 ];
};
}