Skip to content

Commit

Permalink
Merge pull request #5 from euanh/switch-to-oasis
Browse files Browse the repository at this point in the history
Switch to oasis
  • Loading branch information
euanh committed Jan 13, 2016
2 parents 2fbba86 + 913cf32 commit d0d053a
Show file tree
Hide file tree
Showing 11 changed files with 157 additions and 48 deletions.
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
dist/
META
_tags
*.mldylib
*.mllib
myocamlbuild.ml
setup.data
setup.log
_build/
*.native
*.clib
10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
language: c
install:
- wget https://raw.githubusercontent.com/ocaml/ocaml-travisci-skeleton/master/.travis-opam.sh
- wget https://raw.githubusercontent.com/simonjbeaumont/ocaml-travis-coveralls/master/travis-coveralls.sh
script: bash -ex .travis-opam.sh
env:
matrix:
- OCAML_VERSION=4.00
- OCAML_VERSION=4.01
- OCAML_VERSION=4.02
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
0.9.2 (13-Jan-2015):
* switch back to OASIS

0.9.1 (28-May-2013):
* switch from OASIS to Make + obuild; "make install" supports DESTDIR

Expand Down
3 changes: 2 additions & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ include a Signed-off-by: line.
Maintainers list
----------------

* David Scott <[email protected]>
* David Scott <[email protected]>
* Euan Harris <[email protected]>

52 changes: 31 additions & 21 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,31 +1,41 @@
OBUILDOPTS=--debug+
#CONFOPTS=--enable-library-bytecode --enable-executable-bytecode
PKGNAME=cdrom
# OASIS_START
# DO NOT EDIT (digest: a3c674b4239234cbbe53afe090018954)

SUFFIXES:=cdrom.a cdrom.cmi cdrom.cmx cdrom.o dllstubs_cdrom.so \
cdrom.cma cdrom.cmo cdrom.cmxa cdrom_stubs.c.o libstubs_cdrom.a
FILES:=$(addprefix dist/build/lib-$(PKGNAME)/,$(SUFFIXES))
SETUP = ocaml setup.ml

ifneq "$(DESTDIR)" ""
INSTALL_ARGS := -destdir $(DESTDIR)
endif
build: setup.data
$(SETUP) -build $(BUILDFLAGS)

.PHONY: configure build install clean uninstall
doc: setup.data build
$(SETUP) -doc $(DOCFLAGS)

all: build
test: setup.data build
$(SETUP) -test $(TESTFLAGS)

configure:
obuild $(OBUILDOPTS) configure $(CONFOPTS)
all:
$(SETUP) -all $(ALLFLAGS)

install: setup.data
$(SETUP) -install $(INSTALLFLAGS)

build: configure
obuild $(OBUILDOPTS) build
uninstall: setup.data
$(SETUP) -uninstall $(UNINSTALLFLAGS)

install: build
ocamlfind remove $(PKGNAME)
ocamlfind install $(PKGNAME) $(FILES) lib/META lib/$(PKGNAME).mli $(INSTALL_ARGS)
reinstall: setup.data
$(SETUP) -reinstall $(REINSTALLFLAGS)

clean:
obuild clean
$(SETUP) -clean $(CLEANFLAGS)

distclean:
$(SETUP) -distclean $(DISTCLEANFLAGS)

setup.data:
$(SETUP) -configure $(CONFIGUREFLAGS)

configure:
$(SETUP) -configure $(CONFIGUREFLAGS)

.PHONY: build doc test all install uninstall reinstall clean distclean configure

uninstall:
ocamlfind remove $(PKGNAME)
# OASIS_STOP
26 changes: 26 additions & 0 deletions _oasis
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
OASISFormat: 0.4
Name: cdrom
Version: 0.9.2
Synopsis: Query Linux CDROM devices
Authors: David Scott
License: LGPL-2.1 with OCaml linking exception
Plugins: META (0.4), Devfiles (0.4)
BuildTools: ocamlbuild

Library cdrom
Path: lib
FindlibName: cdrom
Modules: Cdrom
CSources: cdrom_stubs.c
ByteOpt: -warn-error +1..45
NativeOpt: -warn-error +1..45
BuildDepends: unix

Executable query
Path: query
MainIs: query.ml
CompiledObject: best
ByteOpt: -warn-error +1..45
NativeOpt: -warn-error +1..45
BuildDepends: cdrom

17 changes: 0 additions & 17 deletions cdrom.obuild

This file was deleted.

27 changes: 27 additions & 0 deletions configure
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/sh

# OASIS_START
# DO NOT EDIT (digest: dc86c2ad450f91ca10c931b6045d0499)
set -e

FST=true
for i in "$@"; do
if $FST; then
set --
FST=false
fi

case $i in
--*=*)
ARG=${i%%=*}
VAL=${i##*=}
set -- "$@" "$ARG" "$VAL"
;;
*)
set -- "$@" "$i"
;;
esac
done

ocaml setup.ml -configure "$@"
# OASIS_STOP
8 changes: 0 additions & 8 deletions lib/META

This file was deleted.

11 changes: 11 additions & 0 deletions opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
opam-version: "1.2"
name: "cdrom"
maintainer: "Euan Harris <[email protected]>"
author: "Dave Scott <[email protected]>"
build: [
["./configure" "--prefix=%{prefix}%"]
[make]
]
install: [make "install"]
remove: ["ocamlfind" "remove" "cdrom"]
depends: ["ocamlfind" "oasis"]
37 changes: 37 additions & 0 deletions setup.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
(* setup.ml generated for the first time by OASIS v0.4.5 *)

(* OASIS_START *)
(* DO NOT EDIT (digest: 9852805d5c19ca1cb6abefde2dcea323) *)
(******************************************************************************)
(* OASIS: architecture for building OCaml libraries and applications *)
(* *)
(* Copyright (C) 2011-2013, Sylvain Le Gall *)
(* Copyright (C) 2008-2011, OCamlCore SARL *)
(* *)
(* This library is free software; you can redistribute it and/or modify it *)
(* under the terms of the GNU Lesser General Public License as published by *)
(* the Free Software Foundation; either version 2.1 of the License, or (at *)
(* your option) any later version, with the OCaml static compilation *)
(* exception. *)
(* *)
(* This library is distributed in the hope that it will be useful, but *)
(* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY *)
(* or FITNESS FOR A PARTICULAR PURPOSE. See the file COPYING for more *)
(* details. *)
(* *)
(* You should have received a copy of the GNU Lesser General Public License *)
(* along with this library; if not, write to the Free Software Foundation, *)
(* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA *)
(******************************************************************************)

let () =
try
Topdirs.dir_directory (Sys.getenv "OCAML_TOPLEVEL_PATH")
with Not_found -> ()
;;
#use "topfind";;
#require "oasis.dynrun";;
open OASISDynRun;;

(* OASIS_STOP *)
let () = setup ();;

0 comments on commit d0d053a

Please sign in to comment.