From 740b31cea8ae39f5260ec181d22e3a23c3e33fca Mon Sep 17 00:00:00 2001 From: Rajdeep Malakar Date: Sun, 31 Mar 2024 15:03:27 +0530 Subject: [PATCH 01/10] +ocaml.org Signed-off-by: Rajdeep Malakar Adds a recipe for OCaml WITHOUT the Compiler Libraries, which are often unnecessary for everything but Opam. For Opam, we need that, btw. --- projects/ocaml.org/fixture.ml | 1 + projects/ocaml.org/package.yml | 66 ++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 projects/ocaml.org/fixture.ml create mode 100644 projects/ocaml.org/package.yml diff --git a/projects/ocaml.org/fixture.ml b/projects/ocaml.org/fixture.ml new file mode 100644 index 0000000000..5afe781b44 --- /dev/null +++ b/projects/ocaml.org/fixture.ml @@ -0,0 +1 @@ +let () = print_endline "Hello, World!";; diff --git a/projects/ocaml.org/package.yml b/projects/ocaml.org/package.yml new file mode 100644 index 0000000000..3dc0b1d365 --- /dev/null +++ b/projects/ocaml.org/package.yml @@ -0,0 +1,66 @@ +distributable: + url: https://github.com/ocaml/ocaml/archive/refs/tags/{{version.raw}}.tar.gz + strip-components: 1 + +display-name: ocaml + +versions: + github: ocaml/ocaml + +dependencies: + invisible-island.net/ncurses: "*" + +build: + script: | + # Recommended flags in the Arch Linux PKGBUILD. Remove if not necessary. + CFLAGS+=' -ffat-lto-objects' + CXXFLAGS+=' -ffat-lto-objects' + ./configure $ARGS + make --jobs {{ hw.concurrency }} --debug=v world.opt + make DESTDIR="{{prefix}}" -j {{ hw.concurrency }} install + rm -rf "{{prefix}}/lib/ocaml/compiler-libs" + env: + ARGS: + - --prefix="{{prefix}}" + # Idk if frame pointers are fine on macOS. Remove if not. + - --enable-frame-pointers + + +provides: + - ocaml + - ocamlcp + - ocamldoc + - ocamlmklib + - ocamlopt + - ocamlrun + - ocamlc + - ocamldebug + - ocamldoc.opt + - ocamlmktop + - ocamlopt.byte + - ocamlrund + - ocamlc.byte + - ocamldep + - ocamllex + - ocamlobjinfo + - ocamlopt.opt + - ocamlruni + - ocamlcmt + - ocamldep.byte + - ocamllex.byte + - ocamlobjinfo.byte + - ocamloptp + - ocamlyacc + - ocamlc.opt + - ocamldep.opt + - ocamllex.opt + - ocamlobjinfo.opt + - ocamlprof + + +test: + script: | + test "$(ocaml --version)" = "The OCaml toplevel, version {{version.raw}}" + test "$(ocamlc --version)" = {{version.raw}} + ocamlc fixture.ml -o fixture + test "$(./fixture)" = "Hello, World!" From c39d95677dc322b8187c38d5f08d5167e83495e7 Mon Sep 17 00:00:00 2001 From: Rajdeep Malakar Date: Sun, 31 Mar 2024 15:12:58 +0530 Subject: [PATCH 02/10] don't enable frame pointers for macOS Signed-off-by: Rajdeep Malakar --- projects/ocaml.org/package.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/projects/ocaml.org/package.yml b/projects/ocaml.org/package.yml index 3dc0b1d365..36662b7d38 100644 --- a/projects/ocaml.org/package.yml +++ b/projects/ocaml.org/package.yml @@ -22,8 +22,10 @@ build: env: ARGS: - --prefix="{{prefix}}" - # Idk if frame pointers are fine on macOS. Remove if not. - - --enable-frame-pointers + # Frame Pointers don't work in macOS + linux: + ARGS: + - --enable-frame-pointers provides: From 6ed652117567f4c88c1e551c2e417f749cea6ae8 Mon Sep 17 00:00:00 2001 From: Rajdeep Malakar Date: Sun, 31 Mar 2024 15:15:01 +0530 Subject: [PATCH 03/10] don't enable frame pointers for linux arm64 Signed-off-by: Rajdeep Malakar --- projects/ocaml.org/package.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/ocaml.org/package.yml b/projects/ocaml.org/package.yml index 36662b7d38..40680aa022 100644 --- a/projects/ocaml.org/package.yml +++ b/projects/ocaml.org/package.yml @@ -22,8 +22,8 @@ build: env: ARGS: - --prefix="{{prefix}}" - # Frame Pointers don't work in macOS - linux: + # Frame Pointers don't work in macOS and Linux ARM64. Only for Linux x86_64 + linux/x86_64: ARGS: - --enable-frame-pointers From dcdf740619336f7b0c438814ff5584b137351df0 Mon Sep 17 00:00:00 2001 From: Rajdeep Malakar Date: Sun, 31 Mar 2024 15:25:02 +0530 Subject: [PATCH 04/10] fix syntax error Signed-off-by: Rajdeep Malakar --- projects/ocaml.org/package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/ocaml.org/package.yml b/projects/ocaml.org/package.yml index 40680aa022..abdd66cfcd 100644 --- a/projects/ocaml.org/package.yml +++ b/projects/ocaml.org/package.yml @@ -23,7 +23,7 @@ build: ARGS: - --prefix="{{prefix}}" # Frame Pointers don't work in macOS and Linux ARM64. Only for Linux x86_64 - linux/x86_64: + linux/x86-64: ARGS: - --enable-frame-pointers From cc2cbb7e870b5fb8893d735afea0796e403afb13 Mon Sep 17 00:00:00 2001 From: Rajdeep Malakar Date: Sun, 31 Mar 2024 15:41:07 +0530 Subject: [PATCH 05/10] so, we need to have the pkg as an explicit dep in test? Signed-off-by: Rajdeep Malakar --- projects/ocaml.org/package.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/projects/ocaml.org/package.yml b/projects/ocaml.org/package.yml index abdd66cfcd..176150a4cb 100644 --- a/projects/ocaml.org/package.yml +++ b/projects/ocaml.org/package.yml @@ -61,6 +61,8 @@ provides: test: + dependencies: + ocaml.org: "*" script: | test "$(ocaml --version)" = "The OCaml toplevel, version {{version.raw}}" test "$(ocamlc --version)" = {{version.raw}} From b94c8d9949013f037dab2ca37f2bfaac20f38132 Mon Sep 17 00:00:00 2001 From: Jacob Heider Date: Sun, 31 Mar 2024 09:43:24 -0400 Subject: [PATCH 06/10] Check for bins --- projects/ocaml.org/package.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/projects/ocaml.org/package.yml b/projects/ocaml.org/package.yml index 176150a4cb..8e403b3565 100644 --- a/projects/ocaml.org/package.yml +++ b/projects/ocaml.org/package.yml @@ -64,6 +64,8 @@ test: dependencies: ocaml.org: "*" script: | + ls -l {{prefix}} + ls -l {{prefix}}/bin test "$(ocaml --version)" = "The OCaml toplevel, version {{version.raw}}" test "$(ocamlc --version)" = {{version.raw}} ocamlc fixture.ml -o fixture From be23ba61ce951126c22dd1f9f680292e591b052e Mon Sep 17 00:00:00 2001 From: Rajdeep Malakar Date: Sun, 31 Mar 2024 20:30:52 +0530 Subject: [PATCH 07/10] how can i be this dumb --- projects/ocaml.org/package.yml | 60 ++++++++++++++++------------------ 1 file changed, 29 insertions(+), 31 deletions(-) diff --git a/projects/ocaml.org/package.yml b/projects/ocaml.org/package.yml index 8e403b3565..fb8dba5341 100644 --- a/projects/ocaml.org/package.yml +++ b/projects/ocaml.org/package.yml @@ -29,40 +29,38 @@ build: provides: - - ocaml - - ocamlcp - - ocamldoc - - ocamlmklib - - ocamlopt - - ocamlrun - - ocamlc - - ocamldebug - - ocamldoc.opt - - ocamlmktop - - ocamlopt.byte - - ocamlrund - - ocamlc.byte - - ocamldep - - ocamllex - - ocamlobjinfo - - ocamlopt.opt - - ocamlruni - - ocamlcmt - - ocamldep.byte - - ocamllex.byte - - ocamlobjinfo.byte - - ocamloptp - - ocamlyacc - - ocamlc.opt - - ocamldep.opt - - ocamllex.opt - - ocamlobjinfo.opt - - ocamlprof + - bin/ocaml + - bin/ocamlcp + - bin/ocamldoc + - bin/ocamlmklib + - bin/ocamlopt + - bin/ocamlrun + - bin/ocamlc + - bin/ocamldebug + - bin/ocamldoc.opt + - bin/ocamlmktop + - bin/ocamlopt.byte + - bin/ocamlrund + - bin/ocamlc.byte + - bin/ocamldep + - bin/ocamllex + - bin/ocamlobjinfo + - bin/ocamlopt.opt + - bin/ocamlruni + - bin/ocamlcmt + - bin/ocamldep.byte + - bin/ocamllex.byte + - bin/ocamlobjinfo.byte + - bin/ocamloptp + - bin/ocamlyacc + - bin/ocamlc.opt + - bin/ocamldep.opt + - bin/ocamllex.opt + - bin/ocamlobjinfo.opt + - bin/ocamlprof test: - dependencies: - ocaml.org: "*" script: | ls -l {{prefix}} ls -l {{prefix}}/bin From 2f9fc3d53d7091e37e420292261669aad7afab27 Mon Sep 17 00:00:00 2001 From: Rajdeep Malakar Date: Sun, 31 Mar 2024 20:46:23 +0530 Subject: [PATCH 08/10] debug. what's really wrong? --- projects/ocaml.org/package.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/projects/ocaml.org/package.yml b/projects/ocaml.org/package.yml index fb8dba5341..a049415143 100644 --- a/projects/ocaml.org/package.yml +++ b/projects/ocaml.org/package.yml @@ -19,6 +19,8 @@ build: make --jobs {{ hw.concurrency }} --debug=v world.opt make DESTDIR="{{prefix}}" -j {{ hw.concurrency }} install rm -rf "{{prefix}}/lib/ocaml/compiler-libs" + ls -l {{prefix}} + ls -l {{prefix}}/bin env: ARGS: - --prefix="{{prefix}}" From 78149d9d08ff7bb587b2ffa94591a7c0a5c3cbf0 Mon Sep 17 00:00:00 2001 From: Jacob Heider Date: Sun, 31 Mar 2024 16:40:53 -0400 Subject: [PATCH 09/10] fix prefix `/opt/ocaml.org/v5.1.1+brewing/opt/ocaml.org/v5.1.1+brewing/lib/ocaml/compiler-libs` prefix was getting applied twice --- projects/ocaml.org/package.yml | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/projects/ocaml.org/package.yml b/projects/ocaml.org/package.yml index a049415143..a4a397092e 100644 --- a/projects/ocaml.org/package.yml +++ b/projects/ocaml.org/package.yml @@ -11,17 +11,16 @@ dependencies: invisible-island.net/ncurses: "*" build: - script: | - # Recommended flags in the Arch Linux PKGBUILD. Remove if not necessary. - CFLAGS+=' -ffat-lto-objects' - CXXFLAGS+=' -ffat-lto-objects' - ./configure $ARGS - make --jobs {{ hw.concurrency }} --debug=v world.opt - make DESTDIR="{{prefix}}" -j {{ hw.concurrency }} install - rm -rf "{{prefix}}/lib/ocaml/compiler-libs" - ls -l {{prefix}} - ls -l {{prefix}}/bin + script: + - ./configure $ARGS + - make --jobs {{ hw.concurrency }} --debug=v world.opt + - make -j {{ hw.concurrency }} install + - run: rm -rf compiler-libs + working-directory: "{{prefix}}/lib/ocaml" env: + # Recommended flags in the Arch Linux PKGBUILD. Remove if not necessary. + CFLAGS: $CFLAGS -ffat-lto-objects + CXXFLAGS: $CXXFLAGS -ffat-lto-objects ARGS: - --prefix="{{prefix}}" # Frame Pointers don't work in macOS and Linux ARM64. Only for Linux x86_64 @@ -29,7 +28,6 @@ build: ARGS: - --enable-frame-pointers - provides: - bin/ocaml - bin/ocamlcp @@ -61,12 +59,10 @@ provides: - bin/ocamlobjinfo.opt - bin/ocamlprof - test: - script: | - ls -l {{prefix}} - ls -l {{prefix}}/bin - test "$(ocaml --version)" = "The OCaml toplevel, version {{version.raw}}" - test "$(ocamlc --version)" = {{version.raw}} - ocamlc fixture.ml -o fixture - test "$(./fixture)" = "Hello, World!" + - ls -l {{prefix}} + - ls -l {{prefix}}/bin + - test "$(ocaml --version)" = "The OCaml toplevel, version {{version.raw}}" + - test "$(ocamlc --version)" = {{version.raw}} + - ocamlc fixture.ml -o fixture + - test "$(./fixture)" = "Hello, World!" From aa875240ff37c7160e63ea96518a15988fd29e0a Mon Sep 17 00:00:00 2001 From: Rajdeep Malakar Date: Mon, 1 Apr 2024 14:29:36 +0530 Subject: [PATCH 10/10] maybe just test ocamlc? --- projects/ocaml.org/package.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/projects/ocaml.org/package.yml b/projects/ocaml.org/package.yml index a4a397092e..c30b25d9bf 100644 --- a/projects/ocaml.org/package.yml +++ b/projects/ocaml.org/package.yml @@ -62,7 +62,6 @@ provides: test: - ls -l {{prefix}} - ls -l {{prefix}}/bin - - test "$(ocaml --version)" = "The OCaml toplevel, version {{version.raw}}" - test "$(ocamlc --version)" = {{version.raw}} - ocamlc fixture.ml -o fixture - test "$(./fixture)" = "Hello, World!"