Skip to content

Commit

Permalink
Merge pull request #24 from talex5/jbuilder
Browse files Browse the repository at this point in the history
Port to jbuilder
  • Loading branch information
talex5 authored Jun 12, 2017
2 parents 4bfe9e0 + ac946f7 commit 6127999
Show file tree
Hide file tree
Showing 37 changed files with 1,172 additions and 440 deletions.
58 changes: 3 additions & 55 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,55 +1,3 @@
*.o
*.a
*.swp
*.swo
*.cmi
*.cmo
*.cmx
*.cma
*.cmxa
*.cmxs
*.byte
*.native
*.opt
.omakedb
.omakedb.lock
*.omc
src/compiler/capnpc-ocaml
src/tests/run-tests
src/tests/run-tests.opt
src/tests/run-tests.run
src/tests/test.mli
src/tests/test.ml
src/tests/.capnp-repo
src/tests/testLists.mli
src/tests/testLists.ml
src/tests/c2b2b.mli
src/tests/c2b2b.ml
src/tests/test_import.mli
src/tests/test_import.ml
src/tests/c2b2b_defun.ml
src/tests/testLists_defun.ml
src/tests/test_defun.ml
src/tests/test_import_defun.ml
src/benchmark/bench
src/benchmark/bench.opt
src/benchmark/bench.run
src/benchmark/.capnp-repo
src/benchmark/c2b2b.mli
src/benchmark/c2b2b.ml
src/benchmark/catrank.mli
src/benchmark/catrank.ml
src/benchmark/carsales.mli
src/benchmark/carsales.ml
src/benchmark/eval.mli
src/benchmark/eval.ml
src/benchmark/carsales
src/benchmark/catrank
src/benchmark/eval
src/compiler/includes.ml
src/benchmark/c2b2b_defun.ml
src/benchmark/carsales_defun.ml
src/benchmark/catrank_defun.ml
src/benchmark/eval_defun.ml
oUnit*.cache
oUnit*.log
_build
.merlin
capnp.install
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
all:
jbuilder build --dev

test:
jbuilder runtest --dev

clean:
rm -rf _build

benchmark:
python src/benchmark/test.py
42 changes: 0 additions & 42 deletions OMakefile

This file was deleted.

4 changes: 0 additions & 4 deletions OMakeroot

This file was deleted.

11 changes: 7 additions & 4 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -421,15 +421,16 @@ subdirectories may be helpful to look at.
Installation
------------
capnp-ocaml requires OCaml >= 4.01.
capnp-ocaml requires OCaml >= 4.02.

You should be able to install capnp-ocaml with
http://opam.ocaml.org[OPAM] using using `opam install capnp`.

If you prefer to compile manually, you will need OMake, Findlib, and OCaml
If you prefer to compile manually, you will need jbuilder, Findlib, and OCaml
packages `core_kernel`, `extunix`, `uint`, `ocplib-endian`, and `res`.
Run `omake` to build both the compiler and the runtime library, and then use
`omake install` to copy them into appropriate places within your filesystem.
Run `jbuilder build` to build both the compiler and the runtime library,
and then use `jbuilder install` to copy them into appropriate places within your
filesystem.

Contact
-------
Expand Down Expand Up @@ -460,3 +461,5 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Some of the `.capnp` schema files are imported from the Cap'n Proto repository
and have their own license (at the top of each file).
17 changes: 7 additions & 10 deletions opam → capnp.opam
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,20 @@ bug-reports: "https://github.com/pelzlpj/capnp-ocaml/issues"
dev-repo: "https://github.com/pelzlpj/capnp-ocaml.git"
author: "Paul Pelzl <pelzlpj@gmail.com>"
maintainer: "Paul Pelzl <pelzlpj@gmail.com>"
build: [["env" "PREFIX=%{prefix}%" "omake"]]
build-test: [
["env" "PREFIX=%{prefix}%" "omake" "src/tests/run-tests"]
[ocaml "./src/tests/run-tests.run"]
]
install: [["env" "PREFIX=%{prefix}%" "omake" "install"]]
remove: [["env" "PREFIX=%{prefix}%" "omake" "uninstall"]]

build: ["jbuilder" "build" "-p" name "-j" jobs]
build-test: ["jbuilder" "build" "@runtest" "@src/benchmark/benchmarks"]

depends: [
"omake"
"ocamlfind" {>= "1.5.1"}
"jbuilder" {build}
"core_kernel" {>= "112.24.00"}
"extunix"
"ocplib-endian" {>= "0.7"}
"res"
"uint"
"core" {test}
]
depexts: [
[["debian"] ["capnproto"]]
[["debian"] ["capnproto" "libcapnp-dev"]]
]
available: [ ocaml-version >= "4.02.0" ]
Empty file added jbuild-workspace.dev
Empty file.
7 changes: 0 additions & 7 deletions src/OMakefile

This file was deleted.

93 changes: 0 additions & 93 deletions src/benchmark/OMakefile

This file was deleted.

80 changes: 80 additions & 0 deletions src/benchmark/carsales.capnp
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors
# Licensed under the MIT License:
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

using Cxx = import "/capnp/c++.capnp";

@0xff75ddc6a36723c9;
$Cxx.namespace("capnp::benchmark::capnp");

struct ParkingLot {
cars@0: List(Car);
}

struct TotalValue {
amount@0: UInt64;
}

struct Car {
make@0: Text;
model@1: Text;
color@2: Color;
seats@3: UInt8;
doors@4: UInt8;
wheels@5: List(Wheel);
length@6: UInt16;
width@7: UInt16;
height@8: UInt16;
weight@9: UInt32;
engine@10: Engine;
fuelCapacity@11: Float32;
fuelLevel@12: Float32;
hasPowerWindows@13: Bool;
hasPowerSteering@14: Bool;
hasCruiseControl@15: Bool;
cupHolders@16: UInt8;
hasNavSystem@17: Bool;
}

enum Color {
black @0;
white @1;
red @2;
green @3;
blue @4;
cyan @5;
magenta @6;
yellow @7;
silver @8;
}

struct Wheel {
diameter@0: UInt16;
airPressure@1: Float32;
snowTires@2: Bool;
}

struct Engine {
horsepower@0: UInt16;
cylinders@1: UInt8;
cc@2: UInt32;
usesGas@3: Bool;
usesElectric@4: Bool;
}
35 changes: 35 additions & 0 deletions src/benchmark/catrank.capnp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors
# Licensed under the MIT License:
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

using Cxx = import "/capnp/c++.capnp";

@0x82beb8e37ff79aba;
$Cxx.namespace("capnp::benchmark::capnp");

struct SearchResultList {
results@0: List(SearchResult);
}

struct SearchResult {
url@0: Text;
score@1: Float64;
snippet@2: Text;
}
Loading

0 comments on commit 6127999

Please sign in to comment.