Skip to content

Commit a7a9cd6

Browse files
committed
Use sedlex instead ulex
Sedlex is a successor of ulex based ppx. A side effect of this change is that now we use opam for installing third-party dependencies.
1 parent e220d22 commit a7a9cd6

18 files changed

+327
-294
lines changed

.travis-ci.sh

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ else
2222
brew upgrade python
2323

2424
# build dependencies (Mac OS X)
25-
brew install ocaml opam
25+
brew install opam
2626

2727
# optional dependencies for running tests
2828
brew install protobuf
@@ -39,36 +39,16 @@ else
3939
opam init
4040
eval `opam config env`
4141

42-
# install basic build dependencies using opam
43-
opam install ocamlfind camlp5
44-
4542
# so that tests pass with the latest protobuf version
4643
export CXXFLAGS='-std=c++14'
4744

48-
elif [ "$OCAML_VERSION" = "system" ]
49-
then
50-
# build dependencies (Ubuntu)
51-
sudo apt-get install ocaml-nox camlp5 ocaml-findlib
52-
53-
# optional dependencies for running tests and building docs
54-
#
55-
# NOTE: these need to be tested only once, no need to re-run these
56-
# tests for all OCaml versions
57-
sudo apt-get install libprotoc-dev protobuf-compiler pandoc
58-
59-
echo "system OCaml version:"
60-
ocaml -version
6145
else
6246
# install specific ocaml version
6347
wget https://raw.githubusercontent.com/ocaml/ocaml-ci-scripts/master/.travis-ocaml.sh
6448

6549
. .travis-ocaml.sh
66-
67-
# install basic build dependencies using opam
68-
opam install ocamlfind camlp5
6950
fi
7051

71-
7252
./configure
7353
make deps
7454
make

INSTALL

Lines changed: 11 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -19,59 +19,30 @@ architectures supported by OCaml. See the list of supported platforms at
1919
PREREQUISITES
2020
=============
2121

22-
On Debian and Ubuntu:
22+
1. Install OCaml and opam (package manager for OCaml)
2323

24-
apt-get install ocaml camlp5 ocaml-findlib gcc make sed
24+
On Debian and Ubuntu:
2525

26+
apt-get install opam
2627

2728
On Mac OS X (using Homebrew):
2829

2930
brew install ocaml opam
30-
opam init
31-
eval `opam config env`
32-
opam install ocamlfind camlp5
33-
34-
(Here, we used [OPAM](http://opam.ocaml.org/) to build and install
35-
ocamlfind).
36-
37-
38-
On Windows:
39-
40-
See the "CROSS-COMPILATION" section below for instructions on building a
41-
Windows executable on Linux and Mac OS X.
4231

43-
For building native Windows binaries, download and install OCaml for
44-
Windows from here:
32+
On other systems, see [OPAM](http://opam.ocaml.org/)
4533

46-
http://protz.github.io/ocaml-installer/
34+
To cross-compile for Windows, see the "CROSS-COMPILATION" section below
4735

48-
For building under Cygwin, follow the steps from the next section.
4936

37+
2. Configure opam
5038

51-
On other Unix systems:
52-
53-
* OCaml (>= 4.03.0)
54-
55-
OCaml is available in most Linux distributions. It can also be
56-
downloaded from here:
57-
58-
http://caml.inria.fr/download.en.html
59-
60-
* Camlp5 -- Caml Preprocessor and Pretty Printer
61-
62-
* Ocamlfind/Findlib -- library manager for OCaml
63-
64-
If installed separately form prepackaged OCaml distribution, it
65-
is recommended to build it from sources after you build/install
66-
OCaml. It can be downloaded from here:
39+
opam init
40+
eval `opam config env`
6741

68-
http://projects.camlcity.org/projects/findlib.html
69-
* C compiler
7042

71-
GCC works. Other compilers should work if they are able to build
72-
OCaml.
43+
3. Install dependencies
7344

74-
* GNU make, sed and probably some other tools.
45+
opam install --deps-only ./opam
7546

7647

7748
INSTALLATION INSTRUCTIONS
@@ -81,7 +52,7 @@ INSTALLATION INSTRUCTIONS
8152

8253
Run "./configure --help" for the list of available options.
8354

84-
2. Build third-party dependencies
55+
2. Install third-party dependencies
8556

8657
make deps
8758

Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ endif
2424

2525

2626
deps: build-dir
27-
$(MAKE) -C deps download
28-
$(MAKE) -C deps
29-
$(MAKE) -C deps uninstall install
27+
@#$(MAKE) -C deps download
28+
@#$(MAKE) -C deps
29+
@#$(MAKE) -C deps uninstall install
30+
opam install -y --deps-only ./opam
3031

3132

3233
build-dir:

configure

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,20 @@ then
101101
# skipping everything else in cross-compilation mode; namely, we have to
102102
# cross-compile deps that come with the package
103103
echo "export SYSTEM := unix" >> $M
104+
105+
# figure out which dependencies we need to build
106+
echo "checking whether necessary dependencies are already installed..."
107+
for i in xmlm easy-format base64
108+
do
109+
dir="`$OCAMLFIND query $i 2>/dev/null`"
110+
if [ $? -eq 0 ]
111+
then
112+
echo "$i is installed in $dir"
113+
echo "SKIP-$i = 1" >> $M
114+
else
115+
echo "$i is not installed; it will be built during \"make deps\""
116+
fi
117+
done
104118
else
105119
# detecting the type of OCaml toolchain
106120
system="`ocamlc -config 2>/dev/null | grep system | sed 's/system: //'`"
@@ -109,19 +123,6 @@ else
109123
echo "detected $system OCaml toolchain"
110124
fi
111125

112-
# figure out which dependencies we need to build
113-
echo "checking whether necessary dependencies are already installed..."
114-
for i in xmlm ulex-camlp5 easy-format base64
115-
do
116-
dir="`$OCAMLFIND query $i 2>/dev/null`"
117-
if [ $? -eq 0 ]
118-
then
119-
echo "$i is installed in $dir"
120-
echo "SKIP-$i = 1" >> $M
121-
else
122-
echo "$i is not installed; it will be built during \"make deps\""
123-
fi
124-
done
125126

126127
OCAML_VERSION=`$OCAMLFIND ocamlc -version`
127128
if [ $? -ne 0 ]

deps/Makefile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ endif
1616
export OCAMLPATH
1717

1818

19-
ifndef SKIP-ulex
20-
DIRS += ulex-camlp5
21-
endif
22-
2319
ifndef SKIP-xmlm
2420
DIRS += xmlm
2521
endif

deps/ulex-camlp5/META

Lines changed: 0 additions & 6 deletions
This file was deleted.

deps/ulex-camlp5/Makefile

Lines changed: 0 additions & 40 deletions
This file was deleted.

deps/ulex-camlp5/Makefile.camlp5

Lines changed: 0 additions & 16 deletions
This file was deleted.

deps/ulex-camlp5/Makefile.download

Lines changed: 0 additions & 38 deletions
This file was deleted.

opam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ depends: [
2424
"ocaml" {>= "4.03"}
2525
"ocamlfind" {build}
2626
"easy-format"
27-
"ulex-camlp5"
27+
"sedlex"
2828
"xmlm"
2929
"base64" {>="3.1.0"}
3030
]

0 commit comments

Comments
 (0)