From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id F1B387F706 for ; Mon, 9 Dec 2013 12:13:27 +0100 (CET) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of john@coherentgraphics.co.uk) identity=pra; client-ip=188.64.184.40; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="john@coherentgraphics.co.uk"; x-sender="john@coherentgraphics.co.uk"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of john@coherentgraphics.co.uk) identity=mailfrom; client-ip=188.64.184.40; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="john@coherentgraphics.co.uk"; x-sender="john@coherentgraphics.co.uk"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@bluechip4.ukhost4u.com) identity=helo; client-ip=188.64.184.40; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="john@coherentgraphics.co.uk"; x-sender="postmaster@bluechip4.ukhost4u.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqoCAIWlpVK8QLgohGdsb2JhbABZgz+5ZweBIxYOAQEBCgcECQkUKIIlAQEFOEABEAsYCRYPCQMCAQIBRQYOBYgGAcEZF48QBy6EBQOZRIUVjnc X-IPAS-Result: AqoCAIWlpVK8QLgohGdsb2JhbABZgz+5ZweBIxYOAQEBCgcECQkUKIIlAQEFOEABEAsYCRYPCQMCAQIBRQYOBYgGAcEZF48QBy6EBQOZRIUVjnc X-IronPort-AV: E=Sophos;i="4.93,857,1378850400"; d="scan'208";a="47779101" Received: from bluechip4.ukhost4u.com ([188.64.184.40]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 09 Dec 2013 12:13:13 +0100 Received: from [78.105.203.81] (port=59872 helo=[192.168.1.150]) by bluechip4.ukhost4u.com with esmtpsa (TLSv1:DHE-RSA-CAMELLIA256-SHA:256) (Exim 4.82) (envelope-from ) id 1Vpylz-000OfM-PW; Mon, 09 Dec 2013 11:13:11 +0000 Message-ID: <52A5A5C6.6060503@coherentgraphics.co.uk> Date: Mon, 09 Dec 2013 11:13:10 +0000 From: John Whitington User-Agent: Postbox 3.0.8 (Macintosh/20130427) MIME-Version: 1.0 To: Anthony Tavener CC: "caml-list@inria.fr" References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bluechip4.ukhost4u.com X-AntiAbuse: Original Domain - inria.fr X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - coherentgraphics.co.uk X-Get-Message-Sender-Via: bluechip4.ukhost4u.com: authenticated_id: john@coherentgraphics.co.uk Subject: Re: [Caml-list] Library installation procedure (for use with OPAM)? Hi Anthony, Anthony Tavener wrote: > For local libraries, my "make install" amounts to copying the relevant > files into the system OCaml directory (ie. /usr/local/lib64/ocaml). > Terrible, I know. > > Now I'm switching to using OPAM for general use, and packaging up local > libraries so that OPAM can be aware of them and install them in its > managed environment. But I figure OPAM will be expecting a more sane, > environment-sensitive install... right? Otherwise it must do some voodoo. > > Is there a simple example of an appropriate install process suitable for > use with OPAM? I've tried looking at a few existing packages and the > build+install process, as usual, is convoluted... not as obscure as > autotools, but different for each project. Is findlib still applicable? > Or some other means to query the system install directory? OCamlMakefile knows how to use ocamlfind for installation. I assume the other popular build systems do too. For example, here's the makefile for "cpdf", providing "make" and "make install" targets. The "PACKS" line tells OCamlMakefile which ocamlfind packages to depend on. "install : libinstall" tells it to install things as an ocamlfind package. # Build the cpdf command line tools and top level MODS = cpdfstrftime cpdf cpdfcommand SOURCES = $(foreach x,$(MODS),$(x).ml $(x).mli) cpdfcommandrun.ml RESULT = cpdf ANNOTATE = true PACKS = camlpdf OCAMLNCFLAGS = -g OCAMLBCFLAGS = -g OCAMLLDFLAGS = -g all : native-code native-code-library byte-code-library top htdoc LIBINSTALL_FILES = cpdf.a cpdf.cma cpdf.cmxa \ $(foreach x,$(MODS),$x.mli) $(foreach x,$(MODS),$x.cmi) install : libinstall -include OCamlMakefile The 'opam' file is then easy: opam-version: "1" maintainer: "contact@coherentgraphics.co.uk" build: [ [make] [make "install"] ] remove: [["ocamlfind" "remove" "cpdf"]] depends: [ "ocamlfind" "camlpdf" ] -- John Whitington