-
Notifications
You must be signed in to change notification settings - Fork 0
/
dkml-component-ocamlcompiler-network.opam
103 lines (100 loc) · 3.91 KB
/
dkml-component-ocamlcompiler-network.opam
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
version: "4.14.2~v2.1.3"
synopsis: "DkML network staging component for ocamlcompiler"
description:
"Network installed component for OCaml bytecode and native compiler"
maintainer: ["[email protected]"]
authors: ["Diskuv, Inc. <[email protected]>"]
license: "Apache-2.0"
homepage: "https://gitlab.com/dkml/components/dkml-component-ocamlcompiler"
doc:
"https://gitlab.com/dkml/components/dkml-component-ocamlcompiler/-/blob/main/README.md"
bug-reports:
"https://gitlab.com/dkml/components/dkml-component-ocamlcompiler/-/issues"
depends: [
"dune" {>= "3.6"}
"dkml-install" {>= "0.2.0"}
"diskuvbox" {>= "0.1.0"}
"dkml-compiler-src" {>= "2.1.0"}
"dkml-component-ocamlcompiler-common" {= version}
"dkml-component-offline-unixutils" {>= "0.1.0"}
"dkml-component-offline-opamshim"
{>= "2.2.0~" & (< "2.2.0~dkml20220000" | > "2.2.0~dkml99999999")}
"dkml-runtime-common" {>= "2.1.0"}
"diskuvbox" {>= "0.1.0"}
"odoc" {with-doc}
]
dev-repo:
"git+https://gitlab.com/dkml/components/dkml-component-ocamlcompiler.git"
build: [
# OCaml source code
["install" "-d" "dl/ocaml/flexdll"]
["tar" "xCfz" "dl/ocaml" "dl/ocaml.tar.gz" "--strip-components=1"]
["tar" "xCfz" "dl/ocaml/flexdll" "dl/flexdll.tar.gz" "--strip-components=1"]
# Portable shell scripts for OCaml compiling
#
# ** The only portable shell scripts needed are that that compile the bytecode
# ** interpreter for use in the dkml-component-staging-ocamlrun build:[] section.
# ** Any other logic needed for compiling the full native-code compiler
# ** can be done in OCaml bytecode. But since the portable shell scripts
# ** do 90% of the work needed for the native-code compiler, no strong
# ** reason (yet) to convert the native-code compiler installation into OCaml
# ** bytecode.
#
# Create a minimal DKMLDIR (no dkml-runtime-distribution) that can build
# the r-c-ocaml-* OCaml compiler. Its structure mimics a
# git submodule setup.
#
# <dkmldir>/vendor/drc/
["diskuvbox" "copy-dir" "%{dkml-runtime-common:lib}%/unix" "dkmldir/vendor/drc/unix"]
# <dkmldir>/.dkmlroot
["diskuvbox" "copy-file" "%{dkml-runtime-common:lib}%/template.dkmlroot" "dkmldir/.dkmlroot"]
# <dkmldir>/vendor/dkml-compiler/
["diskuvbox" "copy-dir" "%{dkml-compiler-src:lib}%/src" "dkmldir/vendor/dkml-compiler/src"]
["diskuvbox" "copy-dir" "%{dkml-compiler-src:lib}%/env" "dkmldir/vendor/dkml-compiler/env"]
# Build component
["dune" "subst"] {dev}
[
"dune"
"build"
"-p"
name
"-j"
jobs
"@install"
"@runtest" {with-test}
"@doc" {with-doc}
]
]
install: [
# Run r-c-ocaml-1-setup.sh ... just the OCaml runtime since not yet relocatable!
# With an OCaml runtime that is the same version as the full OCaml system we want
# to compile, the OCaml system should be compiled quicker (no bootstrap necessary).
#
# ** It may seem redundant to recreate the same reproducible directory that
# ** is available in ocamlrun. BUT ... it is a bad idea to couple the
# ** bytecode interpreter that runs the installer plugins to the same
# ** version as the OCaml compiler we are installing for the end-user.
[
"sh" "-eufc"
"""
env \
dkmldir/vendor/dkml-compiler/src/r-c-ocaml-1-setup.sh \
-d dkmldir \
-t '%{_:share}%/staging-files/generic' \
-v dl/ocaml \
-r \
-z \
-k vendor/dkml-compiler/env/standard-compiler-env-to-ocaml-configure-env.sh
"""
]
]
extra-source "dl/ocaml.tar.gz" {
src: "https://github.com/ocaml/ocaml/archive/4.14.0.tar.gz"
checksum: "sha256=39f44260382f28d1054c5f9d8bf4753cb7ad64027da792f7938344544da155e8"
}
extra-source "dl/flexdll.tar.gz" {
src: "https://github.com/alainfrisch/flexdll/archive/0.42.tar.gz"
checksum: "sha256=a2dce0a0d2f2c5c9f52f65e281db7405f51ff22dc71cdbf494eb241c8a4bdf0f"
}