https://github.com/3mdeb/meta-ocaml
Forked from https://gitlab.com/wtolkien/meta-vyos
https://github.com/3mdeb/meta-ocaml
Last synced: 5 months ago
JSON representation
Forked from https://gitlab.com/wtolkien/meta-vyos
- Host: GitHub
- URL: https://github.com/3mdeb/meta-ocaml
- Owner: 3mdeb
- Created: 2020-11-20T22:47:58.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-11-20T22:50:15.000Z (over 5 years ago)
- Last Synced: 2023-09-21T15:12:34.438Z (over 2 years ago)
- Language: BitBake
- Homepage:
- Size: 32.2 KB
- Stars: 3
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# meta-ocaml
A Yocto Software Layer to support the OCaml Language
__(08/2018) This Repo is still very much 'Work In Progress'!__
_Note:_
This repo was started to support the [meta-vyos](https://gitlab.com/wtolkien/meta-vyos)
project, which requires OCaml starting with release 1.2
I'm not an OCaml developer, so expect problems. Any help is very much appreciated!
I'm intentionally focussing on OCaml 4.03.0 since that version is used with VyOS, however
the resulting code should be portable enough to upgrade to newer versions later.
## Status:
* ocaml-native produces working native compiler (for host system)
* ocaml-cross produces working cross compiler (tried for ARM)
* lots of work to do to compile libraries and actually OCaml applications
# Build Instructions:
Development is currently using OpenEmbedded/Yocto, release 'sumo'
If you are not familiar with OpenEmbedded (or the 'Yocto' derivative), extensive documentation can be found here:
https://www.yoctoproject.org/documentation
* make sure you meet the required prerequisites as described here:
https://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#ref-manual-system-requirements
* get the Yocto core packages, plus this `meta-ocaml` layer:
```
git clone -b sumo git://git.yoctoproject.org/poky.git yocto-sumo
cd yocto-sumo
git clone https://gitlab.com/wtolkien/meta-ocaml
```
* from the `yocto-sumo` directory, initialize the build-environment:
```
source oe-init-build-env
```
* if you want to play it safe, just try and build a 'vanila' Yocto image without
OCaml to make sure everything else works. I suggest building an ARM image for the
'qemuarm' target to get some cross-compile action going:
Uncomment the following line in ```conf/local.conf```:
```
MACHINE ?= "qemuarm"
```
Build a minimal image (this can take an hour during first build):
```
bitbake core-image-minimal
```
Run the new created image using QEmu:
```
runqemu
```
* now edit the Yocto layer configuration file ```conf/bblayers.conf``` to include
the `meta-ocaml` layer.
Your `BBLAYERS` variable should look as below, however you may have to adjust
your path
```
BBLAYERS ?= " \
[your existing path]/yocto-sumo/meta \
[your existing path]/yocto-sumo/meta-poky \
[your existing path]/yocto-sumo/meta-yocto-bsp \
\
${TOPDIR}/../meta-ocaml \
"
```
* you can now build individual OCaml packages such as:
```
bitbake ocaml-native
bitbake ocaml-cross
[...]
```
Yocto's directory structure can be confusing to newcomers, the actual build of the two packages
above will take place in the following directories:
```
~/sumo-test/build/tmp/work/x86_64-linux/ocaml-native
~/sumo-test/build/tmp/work/x86_64-linux/ocaml-cross
```