Skip to content

Commit b35a395

Browse files
committed
port build system to dune
1 parent ca4ba1f commit b35a395

File tree

221 files changed

+1975
-3105
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

221 files changed

+1975
-3105
lines changed

.depend

-180
This file was deleted.

.github/workflows/test.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Ctypes
2+
on: [push, pull_request]
3+
jobs:
4+
tests:
5+
name: Tests
6+
runs-on: ${{ matrix.operating-system }}
7+
strategy:
8+
fail-fast: false
9+
matrix:
10+
ocaml-version: [ '4.08.1', '4.10.0' ]
11+
operating-system: [macos-latest, ubuntu-latest, windows-latest]
12+
steps:
13+
- uses: actions/checkout@master
14+
- uses: avsm/setup-ocaml@master
15+
with:
16+
ocaml-version: ${{ matrix.ocaml-version }}
17+
- name: Deps
18+
run: |
19+
opam pin add -n ctypes.dev .
20+
opam pin add -n ctypes-foreign.dev .
21+
opam depext -ty ctypes ctypes-foreign
22+
opam install -t --deps-only .
23+
- name: Build
24+
run: opam exec -- dune build
25+
- name: Test
26+
run: opam exec -- dune runtest

.gitignore

+3-28
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,5 @@
1+
.*.swp
12
_build
23
_opam
3-
libffi.config
4-
asneeded.config
5-
discover
6-
gen_c_primitives
7-
gen_c_primitives.log
8-
gen_libffi_abi
9-
gen_libffi_abi.log
10-
src/ctypes/ctypes_primitives.ml
11-
src/ctypes_config.h
12-
src/ctypes_config.ml
13-
src/ctypes-foreign-base/dl_stubs.c
14-
src/ctypes-foreign-base/dl.ml
15-
src/discover/commands.cm*
16-
src/discover/discover.cm*
17-
src/configure/extract_from_c.cm*
18-
src/configure/gen_c_primitives.cm*
19-
src/configure/gen_libffi_abi.cm*
20-
*~
21-
generated_stubs.c
22-
generated_bindings.ml
23-
generated_struct_bindings.ml
24-
ncurses_generated.ml
25-
ncurses_stubs.c
26-
date_generated.ml
27-
date_stubs.c
28-
fts_generated.ml
29-
fts_stubs.c
30-
libffi_abi.ml
4+
*.install
5+
.merlin

.travis-ci-arm.sh

-9
This file was deleted.

.travis-ci.sh

+23-21
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
echo travis_fold:start:prepare
12
ANDROID_REPOSITORY=git://github.com/whitequark/opam-cross-android
23
export OCAMLFINDFLAGS
34

@@ -12,15 +13,12 @@ install_on_linux () {
1213
sudo apt-get update -qq
1314
if test $use_opam; then
1415
sudo apt-get install -qq opam
15-
opam init
16-
opam update
17-
opam switch create -q $OCAML_VERSION
16+
opam init --compiler=$OCAML_COMPILER
1817
else
19-
sudo apt-get install -qq ocaml ocaml-native-compilers camlp4-extra opam
18+
sudo apt-get install -qq ocaml ocaml-native-compilers opam
2019
opam init
21-
opam update
2220
fi
23-
eval `opam config env`
21+
eval `opam env`
2422
}
2523

2624
install_on_osx () {
@@ -30,9 +28,8 @@ install_on_osx () {
3028
brew update
3129
brew reinstall ocaml
3230
brew install libffi opam
33-
opam init
34-
opam switch install ocaml-base-compiler.$OCAML_VERSION
35-
eval `opam config env`
31+
opam init --compiler=$OCAML_COMPILER
32+
eval `opam env`
3633
}
3734

3835
install_android_toolchain () {
@@ -51,8 +48,9 @@ install_android_toolchain () {
5148
}
5249

5350
export OPAMYES=1
54-
export OPAMVERBOSE=1
5551

52+
echo travis_fold:end:prepare
53+
echo travis_fold:start:install
5654
echo $TRAVIS_OS_NAME
5755
case $ANDROID in
5856
true) install_android_toolchain ;;
@@ -61,34 +59,38 @@ case $ANDROID in
6159
linux) install_on_linux ;;
6260
esac
6361
esac
62+
echo travis_fold:end:install
6463

6564
echo OCaml version
6665
ocaml -version
6766
echo OPAM versions
6867
opam --version
6968
opam --git-version
7069

70+
echo travis_fold:start:install-coverage
7171
# Optional dependencies for coverage testing
7272
if test $COVERAGE -a $TRAVIS_OS_NAME != osx ; then
7373
opam install bisect_ppx ocveralls
7474
fi
75+
echo travis_fold:end:install-coverage
7576

76-
# Optional dependencies for Xen build
77-
opam install mirage-xen || echo "Mirage not installable, so not testing Xen build."
7877

79-
opam pin add -n ctypes $(pwd)
78+
export OPAMVERBOSE=1
79+
echo travis_fold:start:build
80+
opam pin add -n .
81+
opam upgrade
8082
if test $ANDROID; then
8183
opam install --yes ctypes
8284
else
8385
opam install --build-test --yes ctypes
8486
fi
87+
echo travis_fold:end:build
8588

86-
# Check that the inverted stubs package builds with this release
87-
opam pin add -n ctypes-inverted-stubs-example https://github.com/yallop/ocaml-ctypes-inverted-stubs-example.git
88-
if test ! $ANDROID && test ! $COVERAGE && opam install --show-actions ctypes-inverted-stubs-example; then
89-
opam install --build-test --yes ctypes-inverted-stubs-example
90-
else
91-
echo "Pinning the inverted stubs example failed, probably due to OCaml version incompatibility"
92-
fi
93-
89+
# TODO Check that the inverted stubs package builds with this release
90+
#opam pin add -n ctypes-inverted-stubs-example https://github.com/yallop/ocaml-ctypes-inverted-stubs-example.git
91+
#if test ! $ANDROID && test ! $COVERAGE && opam install --show-actions ctypes-inverted-stubs-example; then
92+
# opam install --build-test --yes ctypes-inverted-stubs-example
93+
#else
94+
# echo "Pinning the inverted stubs example failed, probably due to OCaml version incompatibility"
95+
#fi
9496

.travis.yml

+14-44
Original file line numberDiff line numberDiff line change
@@ -3,50 +3,20 @@ sudo: required
33
services:
44
- docker
55
script:
6-
- if [ "${ARM}z" = "truez" ]; then
7-
docker run -v /usr/bin/qemu-arm-static:/usr/bin/qemu-arm-static -v $(pwd):/travis yallop/ocaml-ctypes-qemu-arm-base /travis/.travis-ci-arm.sh;
8-
else
9-
bash -ex .travis-ci.sh;
10-
fi
11-
os:
12-
- linux
13-
- osx
6+
bash -ex .travis-ci.sh
7+
dist:
8+
- bionic
9+
arch:
10+
- amd64
11+
- arm64
12+
- ppc64le
1413
env:
15-
- OCAML_VERSION=4.02.3 COVERAGE=true
16-
- OCAML_VERSION=4.02.3 ARM=true
14+
- OCAML_VERSION=4.02.3
1715
- OCAML_VERSION=4.03.0
18-
- OCAML_VERSION=4.04.0+flambda
19-
- OCAML_VERSION=4.04.0+32bit ANDROID=true
16+
- OCAML_VERSION=4.04.2
2017
- OCAML_VERSION=4.05.0
21-
- OCAML_VERSION=4.06.0
22-
- OCAML_VERSION=4.07.0
23-
- OCAML_VERSION=4.08.0
24-
- OCAML_VERSION=4.09.0
25-
matrix:
26-
allow_failures:
27-
- env: OCAML_VERSION=4.04.0+32bit ANDROID=true
28-
exclude:
29-
- os: osx
30-
env: OCAML_VERSION=4.02.3 ARM=true
31-
- os: osx
32-
env: OCAML_VERSION=4.02.3 COVERAGE=true
33-
- os: osx
34-
env: OCAML_VERSION=4.04.0+flambda
35-
- os: osx
36-
env: OCAML_VERSION=4.04.0+32bit ANDROID=true
37-
- os: osx
38-
env: OCAML_VERSION=4.05.0
39-
- os: osx
40-
env: OCAML_VERSION=4.06.0
41-
- os: osx
42-
env: OCAML_VERSION=4.03.0
43-
- os: osx
44-
env: OCAML_VERSION=4.08.0
45-
- os: osx
46-
env: OCAML_VERSION=4.09.0
47-
before_install:
48-
- if [ "${ARM}z" = "truez" ]; then
49-
sudo apt-get update && sudo apt-get install --yes qemu-user-static;
50-
docker pull yallop/ocaml-ctypes-qemu-arm-base;
51-
fi
52-
18+
- OCAML_VERSION=4.06.1
19+
- OCAML_VERSION=4.07.1
20+
- OCAML_VERSION=4.08.1
21+
- OCAML_VERSION=4.09.1
22+
- OCAML_VERSION=4.10.0

META

-72
This file was deleted.

0 commit comments

Comments
 (0)