You are not logged in.

#1 2010-01-12 06:56:45

Registered: 2008-11-29
Posts: 8

Towards an Arch OCAML packaging guidelines

I'm not an OCaml programmer so I'm posting a preliminary howto in the hopes folks will give input and we can put it up on the wiki.  I think the lack of standardization (and packages in general) is quite sad and we should be able to rather effortlessly do better.  Much of the following info I hijacked from the debian package guidelines.

* Bytecode executables should have "options=(!strip)", since we're x86 only we don't really have to worry about native code compiler availability.
* Libraries/bindings should be prefixed with ocaml-.
* Libraries should provide META files.  Since these seem to differ across various distros it seems reasonable to try and support both fedora and debian if possible, otherwise it seems debian seems to have more force and should be a priority (also they have lots of prewritten META's to hijack).  Since our findlib doesn't setup a META.x directory META files should be placed under `ocamlfind printconf destdir`/library-name and should be called META.
* I have found that -j1 is often needed, maybe we should note this as it's bitten me a few times.

I wish I could comment on documentation but I don't know anything about it.  Input on this would be appreciated. I assume they have a tool like doxygen, haddock, javadoc, etc.

Please give suggestions!  Thanks.

Follows is a more formalised wiki page, I stole some stuff from the lisp guidelines:

== Background ==
At the moment, there are relatively few ocaml packages available in the Arch repositories. This means that at some point or another, more will likely appear. It is useful, therefore, to figure out now, while there are few packages, how they should be packaged. Therefore, this page stands as a proposed packaging guideline for lisp packages. Keep in mind, however, that this is a work in progress; if you disagree with some of the ideas suggested here, feel free to edit the page and propose something better.

== Bytecode and Native code ==
If Bytecode is produced make sure to include "options=('!strip')".

Probably should give mention of something here.  I'm not educated enough to comment but intuitively native would be the way to go.

== Findlib ==
Packagers are encouraged to create META packages if a library does not provide one.  The Debian folks seem to have a good foundation to build on or provide.  Compatibility with Debian should be an interest.  Fedora also supplies META packages for various libraries which may differ from those supplied by Debian.  It is sometimes possible to be compatible with both distributions and this is hence encouraged when sensible.

== Directory Structure ==
Given that our current findlib package does not setup a metadir META packages should be placed under `ocamlfind printconf destdir`.

Maybe a comment here about executables and/or documentation?

== Example PKGBUILD ==

arch=('i686' 'x86_64')

pkgdesc="Objective Caml (OCaml) mysql library."

depends=('ocaml' 'ocaml-findlib')



build() {
  cd $srcdir/$pkgname-$pkgver

  mkdir -p "$pkgdir/$(ocamlfind printconf destdir)"
  mkdir -p "$pkgdir/$(ocamlfind printconf destdir)/stublibs"

  ./configure || return 1
  make || return 1
  make opt || return 1
  env DESTDIR="$pkgdir" \
      OCAMLFIND_DESTDIR="$pkgdir/$(ocamlfind printconf destdir)" \
      make install || return 1

== Things you, the reader, can do ==
* Maintain lisp packages following these guidelines
* Update and fix problems with these guidelines
* Keep up with what's changed here
* Provide (polite) thoughts, feedback, and suggestions both on this document and to people's work.
* Translate this page and future updates to this page.


#2 2010-01-13 07:53:19

Stefan Husmann
From: Germany
Registered: 2007-08-07
Posts: 1,009

Re: Towards an Arch OCAML packaging guidelines

Nice Work! One question: Can you explain what you expect from the mentioned meta-packages? Maybe it is obvious to a experienced ocaml programmer, but not to me.:)


Board footer

Powered by FluxBB