Skip to content

Commit 98b6f22

Browse files
committed
tur-on-device/ocaml: add package at version 5.5.0 and opam 2.5.2
1 parent 3595023 commit 98b6f22

3 files changed

Lines changed: 116 additions & 0 deletions

File tree

tur-on-device/ocaml/build.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
TERMUX_PKG_HOMEPAGE=https://ocaml.org/
2+
TERMUX_PKG_DESCRIPTION="Industrial strength programming language with an emphasis on expressive types and safety"
3+
TERMUX_PKG_LICENSE="LGPL-2.1"
4+
TERMUX_PKG_MAINTAINER="@termux-user-repository"
5+
TERMUX_PKG_VERSION="5.5.0"
6+
TERMUX_PKG_SRCURL="https://github.com/ocaml/ocaml/releases/download/${TERMUX_PKG_VERSION}/ocaml-${TERMUX_PKG_VERSION}.tar.gz"
7+
TERMUX_PKG_SHA256=c018052c8264a3791a8f54f84179e6bcc78ed82eb889bacc2773df445259aed3
8+
TERMUX_PKG_DEPENDS="binutils, clang, libandroid-shmem"
9+
TERMUX_PKG_BUILD_DEPENDS="which"
10+
TERMUX_PKG_EXCLUDED_ARCHES="arm,i686"
11+
TERMUX_PKG_BUILD_IN_SRC=true
12+
TERMUX_PKG_UNDEF_SYMBOLS_FILES="all"
13+
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
14+
ac_cv_func_getentropy=no
15+
ac_cv_func_getlogin_r=no
16+
--mandir=$TERMUX_PREFIX/share/man
17+
"
18+
19+
termux_step_pre_configure() {
20+
if [ "${TERMUX_ON_DEVICE_BUILD}" = false ]; then
21+
termux_error_exit "This package doesn't support cross-compiling."
22+
fi
23+
24+
export AS="$CC -c"
25+
export ASPP="$CC -c"
26+
LDFLAGS+=" -landroid-shmem"
27+
}
28+
29+
termux_step_make() {
30+
make -j"${TERMUX_PKG_MAKE_PROCESSES}"
31+
}
32+
33+
termux_step_make_install() {
34+
make install
35+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
--- a/src/client/opamCommands.ml
2+
+++ b/src/client/opamCommands.ml
3+
@@ -125,7 +125,7 @@
4+
5+
let get_init_config ~no_sandboxing ~no_default_config_file ~add_config_file =
6+
let builtin_config =
7+
- OpamInitDefaults.init_config ~sandboxing:(not no_sandboxing) ()
8+
+ OpamInitDefaults.init_config ~sandboxing:false ()
9+
in
10+
let config_files =
11+
(if no_default_config_file then []
12+
@@ -350,6 +350,7 @@
13+
cygwin_internal cygwin_location cygwin_extra_packages
14+
git_location no_git_location
15+
() =
16+
+ let no_sandboxing = true in
17+
apply_global_options cli global_options;
18+
apply_build_options cli build_options;
19+
(* If show option is set, dump opamrc and exit *)
20+
--- a/src/client/opamInitDefaults.ml
21+
+++ b/src/client/opamInitDefaults.ml
22+
@@ -139,16 +139,17 @@
23+
"rsync";
24+
] |> List.map OpamSysPkg.of_string
25+
26+
-let init_scripts () = [
27+
- ("sandbox.sh", OpamScript.bwrap), Some bwrap_filter;
28+
- ("sandbox.sh", OpamScript.sandbox_exec), Some macos_filter;
29+
-]
30+
+let init_scripts ~sandboxing () =
31+
+ if sandboxing then [
32+
+ ("sandbox.sh", OpamScript.bwrap), Some bwrap_filter;
33+
+ ("sandbox.sh", OpamScript.sandbox_exec), Some macos_filter;
34+
+ ] else []
35+
36+
module I = OpamFile.InitConfig
37+
38+
let (@|) g f = OpamStd.Op.(g @* f) ()
39+
40+
-let init_config ?(sandboxing=true) () =
41+
+let init_config ?(sandboxing=false) () =
42+
I.empty |>
43+
I.with_repositories
44+
[OpamRepositoryName.of_string "default", (repository_url, None)] |>
45+
@@ -158,5 +159,5 @@
46+
I.with_wrappers @| wrappers ~sandboxing |>
47+
I.with_recommended_tools @| recommended_tools |>
48+
I.with_required_tools @| required_tools ~sandboxing |>
49+
- I.with_init_scripts @| init_scripts |>
50+
+ I.with_init_scripts @| init_scripts ~sandboxing |>
51+
I.with_dl_tool @| dl_tool

tur-on-device/opam/build.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
TERMUX_PKG_HOMEPAGE=https://opam.ocaml.org/
2+
TERMUX_PKG_DESCRIPTION="A source-based package manager for OCaml"
3+
TERMUX_PKG_LICENSE="LGPL-2.1"
4+
TERMUX_PKG_MAINTAINER="@termux-user-repository"
5+
TERMUX_PKG_VERSION="2.5.2"
6+
TERMUX_PKG_SRCURL="https://github.com/ocaml/opam/releases/download/${TERMUX_PKG_VERSION}/opam-full-${TERMUX_PKG_VERSION}.tar.gz"
7+
TERMUX_PKG_SHA256=b3623809567f19ed6b5d679b8c7bbc0bdec9418bff4a875ff0799d446d8555c3
8+
TERMUX_PKG_DEPENDS="curl, git, ocaml, patch, tar, unzip"
9+
TERMUX_PKG_BUILD_DEPENDS="which"
10+
TERMUX_PKG_EXCLUDED_ARCHES="arm,i686"
11+
TERMUX_PKG_BUILD_IN_SRC=true
12+
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
13+
--with-vendored-deps
14+
MAKE=make
15+
--disable-static
16+
"
17+
18+
termux_step_pre_configure() {
19+
if [ "${TERMUX_ON_DEVICE_BUILD}" = false ]; then
20+
termux_error_exit "This package doesn't support cross-compiling."
21+
fi
22+
}
23+
24+
termux_step_make() {
25+
make -j"${TERMUX_PKG_MAKE_PROCESSES}"
26+
}
27+
28+
termux_step_make_install() {
29+
make install
30+
}

0 commit comments

Comments
 (0)