From 563a444ea9f19ec55b53e82f17f5b97357e56691 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Fri, 19 Oct 2018 23:38:14 +0200 Subject: _oasis: opam: nix: add build and env setup --- _oasis | 27 +++++++++++++++++++++++++++ misc/nix-ocaml-shell.nix | 25 +++++++++++++++++++++++++ sid.opam | 20 ++++++++++++++++++++ 3 files changed, 72 insertions(+) create mode 100644 _oasis create mode 100644 misc/nix-ocaml-shell.nix create mode 100644 sid.opam diff --git a/_oasis b/_oasis new file mode 100644 index 0000000..e552a3e --- /dev/null +++ b/_oasis @@ -0,0 +1,27 @@ +OASISFormat: 0.4 +Name: sid +Version: 0 +Synopsis: non +Authors: phg +License: GPL-3 +BuildTools: ocamlbuild +Plugins: META (0.4), DevFiles (0.4) + +Library "sid" + Path: . + Modules: Sid + CompiledObject: native + BuildDepends: stdint + FindlibName: sid + +Executable "sid_test" + Path: . + Build$: flag(tests) + MainIs: sid_test.ml + BuildDepends: stdint, oUnit + +Test "test_sid" + Run$: flag(tests) + TestTools: sid_test + Command: $sid_test + diff --git a/misc/nix-ocaml-shell.nix b/misc/nix-ocaml-shell.nix new file mode 100644 index 0000000..316f156 --- /dev/null +++ b/misc/nix-ocaml-shell.nix @@ -0,0 +1,25 @@ +with import {}; + +let + libs = [ + autoconf + bubblewrap + binutils + curl + gcc + libtool + m4 + ocaml + pkgconfig + ]; +in +stdenv.mkDerivation rec { + name = "ocaml-env"; + buildInputs = libs; + + # configure opam with sandboxing + shellHook = '' + . /home/phg/.opam/opam-init/init.sh &>/dev/null || true + export OPAM_USER_PATH_RO=/nix/store + ''; +} diff --git a/sid.opam b/sid.opam new file mode 100644 index 0000000..c0e9507 --- /dev/null +++ b/sid.opam @@ -0,0 +1,20 @@ +opam-version: "2.0" +version: "0" +synopsis: "Handle security identfiers" + +maintainer: "Philipp Gesang " +authors: [ "Philipp Gesang" ] +license: "LGPLv3" +depends: [ + "ocamlbuild" {build} + "oasis" {build} + "stdint" + "ounit" {test} +] +build: [ + ["oasis" "setup"] + ["ocaml" "setup.ml" "-configure"] + ["ocaml" "setup.ml" "-build"] +] +install: [make "install"] +build-test: [make "test"] -- cgit v1.2.3