Skip to content

Commit 43cf162

Browse files
authored
ocamlPackages.camlp4: fix build (NixOS#372762)
2 parents 599c108 + e5b2963 commit 43cf162

File tree

5 files changed

+105
-66
lines changed

5 files changed

+105
-66
lines changed

pkgs/development/compilers/heptagon/default.nix renamed to pkgs/by-name/he/heptagon/package.nix

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
fetchFromGitLab,
55
makeWrapper,
66
ocamlPackages,
7+
fetchpatch,
78
}:
89

910
stdenv.mkDerivation (finalAttrs: {
@@ -18,6 +19,13 @@ stdenv.mkDerivation (finalAttrs: {
1819
hash = "sha256-b4O48MQT3Neh8a1Z5wRgS701w6XrwpsbSMprlqTT+CE=";
1920
};
2021

22+
patches = [
23+
(fetchpatch {
24+
url = "https://gitlab.inria.fr/synchrone/heptagon/-/commit/f10405e385ca25dc737727e0c210a44986929bf0.patch";
25+
hash = "sha256-Sn55jEoRDYnEUg4SjuBDCNN4TNl2Dwn1fTjb9O8O1bo=";
26+
})
27+
];
28+
2129
strictDeps = true;
2230

2331
nativeBuildInputs = with ocamlPackages; [

pkgs/development/ocaml-modules/config-file/default.nix

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,34 @@
77
camlp4,
88
}:
99

10-
stdenv.mkDerivation rec {
11-
pname = "ocaml-config-file";
12-
version = "1.2";
10+
lib.throwIf (lib.versionAtLeast ocaml.version "5.0")
11+
"config-file is not available for OCaml ${ocaml.version}"
1312

14-
src = fetchurl {
15-
url = "https://forge.ocamlcore.org/frs/download.php/1387/config-file-${version}.tar.gz";
16-
sha256 = "1b02yxcnsjhr05ssh2br2ka4hxsjpdw34ldl3nk33wfnkwk7g67q";
17-
};
13+
stdenv.mkDerivation
14+
rec {
15+
pname = "ocaml-config-file";
16+
version = "1.2";
1817

19-
nativeBuildInputs = [
20-
ocaml
21-
findlib
22-
camlp4
23-
];
18+
src = fetchurl {
19+
url = "https://forge.ocamlcore.org/frs/download.php/1387/config-file-${version}.tar.gz";
20+
sha256 = "1b02yxcnsjhr05ssh2br2ka4hxsjpdw34ldl3nk33wfnkwk7g67q";
21+
};
2422

25-
strictDeps = true;
23+
nativeBuildInputs = [
24+
ocaml
25+
findlib
26+
camlp4
27+
];
2628

27-
createFindlibDestdir = true;
29+
strictDeps = true;
2830

29-
meta = {
30-
homepage = "http://config-file.forge.ocamlcore.org/";
31-
platforms = ocaml.meta.platforms or [ ];
32-
description = "OCaml library used to manage the configuration file(s) of an application";
33-
license = lib.licenses.lgpl2Plus;
34-
maintainers = with lib.maintainers; [ vbgl ];
35-
};
36-
}
31+
createFindlibDestdir = true;
32+
33+
meta = {
34+
homepage = "http://config-file.forge.ocamlcore.org/";
35+
platforms = ocaml.meta.platforms or [ ];
36+
description = "OCaml library used to manage the configuration file(s) of an application";
37+
license = lib.licenses.lgpl2Plus;
38+
maintainers = with lib.maintainers; [ vbgl ];
39+
};
40+
}

pkgs/development/ocaml-modules/ulex/default.nix

Lines changed: 40 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -23,39 +23,43 @@ let
2323
};
2424
in
2525

26-
stdenv.mkDerivation rec {
27-
name = "ocaml${ocaml.version}-${pname}-${version}";
28-
inherit (param) version;
29-
30-
src = fetchFromGitHub {
31-
owner = "whitequark";
32-
repo = pname;
33-
rev = "v${version}";
34-
inherit (param) sha256;
35-
};
36-
37-
createFindlibDestdir = true;
38-
39-
nativeBuildInputs = [
40-
ocaml
41-
findlib
42-
ocamlbuild
43-
camlp4
44-
];
45-
propagatedBuildInputs = [ camlp4 ];
46-
47-
strictDeps = true;
48-
49-
buildFlags = [
50-
"all"
51-
"all.opt"
52-
];
53-
54-
meta = {
55-
inherit (src.meta) homepage;
56-
description = "Lexer generator for Unicode and OCaml";
57-
license = lib.licenses.mit;
58-
inherit (ocaml.meta) platforms;
59-
maintainers = [ lib.maintainers.roconnor ];
60-
};
61-
}
26+
lib.throwIf (lib.versionAtLeast ocaml.version "5.0")
27+
"ulex is not available for OCaml ${ocaml.version}"
28+
29+
stdenv.mkDerivation
30+
rec {
31+
name = "ocaml${ocaml.version}-${pname}-${version}";
32+
inherit (param) version;
33+
34+
src = fetchFromGitHub {
35+
owner = "whitequark";
36+
repo = pname;
37+
rev = "v${version}";
38+
inherit (param) sha256;
39+
};
40+
41+
createFindlibDestdir = true;
42+
43+
nativeBuildInputs = [
44+
ocaml
45+
findlib
46+
ocamlbuild
47+
camlp4
48+
];
49+
propagatedBuildInputs = [ camlp4 ];
50+
51+
strictDeps = true;
52+
53+
buildFlags = [
54+
"all"
55+
"all.opt"
56+
];
57+
58+
meta = {
59+
inherit (src.meta) homepage;
60+
description = "Lexer generator for Unicode and OCaml";
61+
license = lib.licenses.mit;
62+
inherit (ocaml.meta) platforms;
63+
maintainers = [ lib.maintainers.roconnor ];
64+
};
65+
}

pkgs/development/tools/ocaml/camlp4/default.nix

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44
fetchzip,
55
which,
66
ocaml,
7+
camlp-streams,
78
ocamlbuild,
9+
findlib,
810
}:
911

10-
if lib.versionAtLeast ocaml.version "4.15" then
12+
if lib.versionAtLeast ocaml.version "5.4" then
1113
throw "camlp4 is not available for OCaml ${ocaml.version}"
1214
else
1315

@@ -66,6 +68,22 @@ else
6668
version = "4.14+1";
6769
sha256 = "sha256-cPN3GioZT/Zt6uzbjGUPEGVJcPQdsAnCkU/AQoPfvuo=";
6870
};
71+
"5.0" = {
72+
version = "5.0";
73+
sha256 = "sha256-oZptFNPUEAq5YlcqAoDWfLghGMF9AN7E7hUN55SAX+4=";
74+
};
75+
"5.1" = {
76+
version = "5.1";
77+
sha256 = "sha256-Ubedjg3BeHA0bJbEalQN9eEk5+LRAI/er+8mWfVYchg=";
78+
};
79+
"5.2" = {
80+
version = "5.2";
81+
sha256 = "sha256-lzbc9xsgeYlbVf71O+PWYS14QivAH1aPdnvWhe0HHME=";
82+
};
83+
"5.3" = {
84+
version = "5.3";
85+
sha256 = "sha256-V/kKhTP9U4jWDFuQKuB7BS3XICg1lq/2Avj7UJR55+k=";
86+
};
6987
}
7088
.${ocaml.meta.branch};
7189
in
@@ -81,9 +99,18 @@ else
8199

82100
strictDeps = true;
83101

84-
nativeBuildInputs = [
85-
which
86-
ocaml
102+
nativeBuildInputs =
103+
[
104+
which
105+
ocaml
106+
ocamlbuild
107+
]
108+
++ lib.optionals (lib.versionAtLeast ocaml.version "5.0") [
109+
findlib
110+
];
111+
112+
buildInputs = lib.optionals (lib.versionAtLeast ocaml.version "5.0") [
113+
camlp-streams
87114
ocamlbuild
88115
];
89116

pkgs/top-level/all-packages.nix

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6331,10 +6331,6 @@ with pkgs;
63316331
inherit (emacs.pkgs.melpaStablePackages) irony;
63326332
};
63336333

6334-
heptagon = callPackage ../development/compilers/heptagon {
6335-
ocamlPackages = ocaml-ng.ocamlPackages_4_14;
6336-
};
6337-
63386334
openjfx17 = openjfx;
63396335
openjfx21 = callPackage ../by-name/op/openjfx/package.nix { featureVersion = "21"; };
63406336
openjfx23 = callPackage ../by-name/op/openjfx/package.nix { featureVersion = "23"; };

0 commit comments

Comments
 (0)