public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Alexis Ballier <aballier@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] New eclass: opam.eclass
Date: Wed, 2 Aug 2017 12:09:23 +0200	[thread overview]
Message-ID: <20170802120719.136f8021@gentoo.org> (raw)
In-Reply-To: <1500992290.795.19.camel@gentoo.org>

On Tue, 25 Jul 2017 16:18:10 +0200
Michał Górny <mgorny@gentoo.org> wrote:

> On pon, 2017-07-24 at 17:20 +0200, Alexis Ballier wrote:
> > # Copyright 1999-2017 Gentoo Foundation
> > # Distributed under the terms of the GNU General Public License v2
> > 
> > # @ECLASS: opam.eclass
> > # @MAINTAINER:
> > # Gentoo ML Project <ml@gentoo.org>
> > # @AUTHOR:
> > # Alexis Ballier <aballier@gentoo.org>
> > # @BLURB: Provides functions for installing opam packages.
> > # @DESCRIPTION:
> > # Provides dependencies on opam and ocaml, opam-install and a
> > default # src_install for opam-based packages.
> > 
> > case ${EAPI:-0} in
> >     0|1|2|3|4) die "You need at least EAPI-5 to use opam.eclass";;  
> 
> Why not start straight with EAPI 6? You will have less to clean up
> later.


opam-based ebuilds are good with EAPI 6 but some other ocaml
eclasses are still waiting for patches from those deprecating
eclasses/features with EAPI6. So, EAPI5 is still the norm in ocaml
(it really is min for := though), and EAPI update can happen later, I'm
definitely not in a hurry to go for new EAPIs :)

> 
> >     *) ;;
> > esac
> >   
> > RDEPEND=">=dev-lang/ocaml-4:="  
> > DEPEND="${RDEPEND}
> > 	dev-ml/opam"
> > 
> > # @FUNCTION: opam-install
> > # @USAGE: <list of packages>
> > # @DESCRIPTION:
> > # Installs the opam packages given as arguments. For each "${pkg}"
> > element in # that list, "${pkg}.install" must be readable from
> > current working directory. opam-install() {  
> 
> local pkg

fixed

> 
> > 	for pkg ; do
> > 		opam-installer -i \
> > 			--prefix="${ED}/usr" \
> > 			--libdir="${D}/$(ocamlc -where)" \
> > 			--docdir="${ED}/usr/share/doc/${PF}" \
> > 			--mandir="${ED}/usr/share/man" \  
> 
> Both ED and D include the trailing slash, so either remove the extra
> slash or use ${ED%/}.

thx, removed /

by the way, is there any technical reason to use ${ED%/} ?
as in, let the shell do it when the OS can probably do it much better ?


> 
> > 			"${pkg}.install" || die
> > 	done
> > }
> > 
> > opam_src_install() {
> > 	opam-install "${PN}"
> > 	# Handle opam putting doc in a subdir
> > 	if [ -d "${ED}/usr/share/doc/${PF}/${PN}" ] ; then  
> 
> Is PN always the correct subdirectory here?

yes because opam-install is called for $PN only here

for multiple packages in one ebuild that won't work well, that is why I
didn't include this in opam-install itself.


the idea with the eclass is to use it to split all opam based package to
have only 1 ebuild per corresponding opam package though



And pushed in a few minutes


Thanks!


  reply	other threads:[~2017-08-02 10:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-24 15:20 [gentoo-dev] New eclass: opam.eclass Alexis Ballier
2017-07-24 22:11 ` Aaron W. Swenson
2017-07-25  8:25   ` Alexis Ballier
2017-07-25 12:48     ` Peter Stuge
2017-07-25 13:37       ` Michał Górny
2017-07-25 14:18 ` Michał Górny
2017-08-02 10:09   ` Alexis Ballier [this message]
2017-08-02 10:27     ` Alexis Ballier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170802120719.136f8021@gentoo.org \
    --to=aballier@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox