ocamlPackages.camlp4: fix build (#372762)

This commit is contained in:
Vincent Laporte
2025-01-13 11:17:51 +01:00
committed by GitHub
5 changed files with 99 additions and 60 deletions
@@ -4,6 +4,7 @@
fetchFromGitLab,
makeWrapper,
ocamlPackages,
fetchpatch,
}:
stdenv.mkDerivation (finalAttrs: {
@@ -18,6 +19,13 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-b4O48MQT3Neh8a1Z5wRgS701w6XrwpsbSMprlqTT+CE=";
};
patches = [
(fetchpatch {
url = "https://gitlab.inria.fr/synchrone/heptagon/-/commit/f10405e385ca25dc737727e0c210a44986929bf0.patch";
hash = "sha256-Sn55jEoRDYnEUg4SjuBDCNN4TNl2Dwn1fTjb9O8O1bo=";
})
];
strictDeps = true;
nativeBuildInputs = with ocamlPackages; [
@@ -7,30 +7,34 @@
camlp4,
}:
stdenv.mkDerivation rec {
pname = "ocaml-config-file";
version = "1.2";
lib.throwIf (lib.versionAtLeast ocaml.version "5.0")
"config-file is not available for OCaml ${ocaml.version}"
src = fetchurl {
url = "https://forge.ocamlcore.org/frs/download.php/1387/config-file-${version}.tar.gz";
sha256 = "1b02yxcnsjhr05ssh2br2ka4hxsjpdw34ldl3nk33wfnkwk7g67q";
};
stdenv.mkDerivation
rec {
pname = "ocaml-config-file";
version = "1.2";
nativeBuildInputs = [
ocaml
findlib
camlp4
];
src = fetchurl {
url = "https://forge.ocamlcore.org/frs/download.php/1387/config-file-${version}.tar.gz";
sha256 = "1b02yxcnsjhr05ssh2br2ka4hxsjpdw34ldl3nk33wfnkwk7g67q";
};
strictDeps = true;
nativeBuildInputs = [
ocaml
findlib
camlp4
];
createFindlibDestdir = true;
strictDeps = true;
meta = {
homepage = "http://config-file.forge.ocamlcore.org/";
platforms = ocaml.meta.platforms or [ ];
description = "OCaml library used to manage the configuration file(s) of an application";
license = lib.licenses.lgpl2Plus;
maintainers = with lib.maintainers; [ vbgl ];
};
}
createFindlibDestdir = true;
meta = {
homepage = "http://config-file.forge.ocamlcore.org/";
platforms = ocaml.meta.platforms or [ ];
description = "OCaml library used to manage the configuration file(s) of an application";
license = lib.licenses.lgpl2Plus;
maintainers = with lib.maintainers; [ vbgl ];
};
}
+34 -30
View File
@@ -23,39 +23,43 @@ let
};
in
stdenv.mkDerivation rec {
name = "ocaml${ocaml.version}-${pname}-${version}";
inherit (param) version;
lib.throwIf (lib.versionAtLeast ocaml.version "5.0")
"ulex is not available for OCaml ${ocaml.version}"
src = fetchFromGitHub {
owner = "whitequark";
repo = pname;
rev = "v${version}";
inherit (param) sha256;
};
stdenv.mkDerivation
rec {
name = "ocaml${ocaml.version}-${pname}-${version}";
inherit (param) version;
createFindlibDestdir = true;
src = fetchFromGitHub {
owner = "whitequark";
repo = pname;
rev = "v${version}";
inherit (param) sha256;
};
nativeBuildInputs = [
ocaml
findlib
ocamlbuild
camlp4
];
propagatedBuildInputs = [ camlp4 ];
createFindlibDestdir = true;
strictDeps = true;
nativeBuildInputs = [
ocaml
findlib
ocamlbuild
camlp4
];
propagatedBuildInputs = [ camlp4 ];
buildFlags = [
"all"
"all.opt"
];
strictDeps = true;
meta = {
inherit (src.meta) homepage;
description = "Lexer generator for Unicode and OCaml";
license = lib.licenses.mit;
inherit (ocaml.meta) platforms;
maintainers = [ lib.maintainers.roconnor ];
};
}
buildFlags = [
"all"
"all.opt"
];
meta = {
inherit (src.meta) homepage;
description = "Lexer generator for Unicode and OCaml";
license = lib.licenses.mit;
inherit (ocaml.meta) platforms;
maintainers = [ lib.maintainers.roconnor ];
};
}
@@ -4,10 +4,12 @@
fetchzip,
which,
ocaml,
camlp-streams,
ocamlbuild,
findlib,
}:
if lib.versionAtLeast ocaml.version "4.15" then
if lib.versionAtLeast ocaml.version "5.4" then
throw "camlp4 is not available for OCaml ${ocaml.version}"
else
@@ -66,6 +68,22 @@ else
version = "4.14+1";
sha256 = "sha256-cPN3GioZT/Zt6uzbjGUPEGVJcPQdsAnCkU/AQoPfvuo=";
};
"5.0" = {
version = "5.0";
sha256 = "sha256-oZptFNPUEAq5YlcqAoDWfLghGMF9AN7E7hUN55SAX+4=";
};
"5.1" = {
version = "5.1";
sha256 = "sha256-Ubedjg3BeHA0bJbEalQN9eEk5+LRAI/er+8mWfVYchg=";
};
"5.2" = {
version = "5.2";
sha256 = "sha256-lzbc9xsgeYlbVf71O+PWYS14QivAH1aPdnvWhe0HHME=";
};
"5.3" = {
version = "5.3";
sha256 = "sha256-V/kKhTP9U4jWDFuQKuB7BS3XICg1lq/2Avj7UJR55+k=";
};
}
.${ocaml.meta.branch};
in
@@ -81,9 +99,18 @@ else
strictDeps = true;
nativeBuildInputs = [
which
ocaml
nativeBuildInputs =
[
which
ocaml
ocamlbuild
]
++ lib.optionals (lib.versionAtLeast ocaml.version "5.0") [
findlib
];
buildInputs = lib.optionals (lib.versionAtLeast ocaml.version "5.0") [
camlp-streams
ocamlbuild
];
-4
View File
@@ -6331,10 +6331,6 @@ with pkgs;
inherit (emacs.pkgs.melpaStablePackages) irony;
};
heptagon = callPackage ../development/compilers/heptagon {
ocamlPackages = ocaml-ng.ocamlPackages_4_14;
};
openjfx17 = openjfx;
openjfx21 = callPackage ../by-name/op/openjfx/package.nix { featureVersion = "21"; };
openjfx23 = callPackage ../by-name/op/openjfx/package.nix { featureVersion = "23"; };