cschwan / sage-on-gentoo

(Unofficial) Gentoo Overlay for Sage- and Sage-related ebuilds
84 stars 26 forks source link

[New package] dev-gap/guava: GAP package that implements coding theory algorithms #410

Closed Coacher closed 8 years ago

Coacher commented 8 years ago

Hello.

Here's the ebuild that works for me for quite a while now:

# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=6

inherit multilib toolchain-funcs

DESCRIPTION="GAP package that implements coding theory algorithms"
HOMEPAGE="http://www.gap-system.org/Packages/guava.html"
SRC_URI="http://www.gap-system.org/pub/gap/gap4/tar.gz/packages/${PN}${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="GPL-2 GPL-3"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""
RESTRICT="mirror"

DEPEND=">=sci-mathematics/gap-4.5.3"
RDEPEND="${DEPEND}"

src_prepare() {
    # include <stdlib.h>, which is needed by exit()
    sed -i -e '1i #include <stdlib.h>' src/leonconv.c || die

    # cleanup sources
    rm -r lib/*.diff src/leon/autom4te.cache src/leon/src/stamp-h1 || die

    default
}

src_configure() {
    econf "${EPREFIX}/usr/$(get_libdir)/gap"
}

src_compile() {
    # COMPILE and COMPOPT are only needed to compile the code under src/leon/
    emake -j1 \
        CC="$(tc-getCC)" CFLAGS="${CFLAGS}" \
        COMPILE="$(tc-getCC)" COMPOPT="-c ${CFLAGS}"
}

src_install() {
    insinto "/usr/$(get_libdir)/gap/pkg/${P}"
    doins -r bin/ doc/ htm/ lib/ tbl/
    doins init.g read.g PackageInfo.g ${PN}.tst

    dodoc CHANGES.${PN} README.${PN}
}

Note that src_install() is different from what I've seen in other GAP packages in this overlay with a bit more precision. Nevertheless all the interesting stuff is before src_install().

Coacher commented 8 years ago

I can maintain it and prepare a proper PR with metadata and stuff if you are interested. I am also open to discussion re the posted ebuild.

kiwifb commented 8 years ago

Go with the PR. It is indeed more precise than what I have done especially in regard to dodoc stuff. One question about standardisation would be installation to ${P} or ${PN}.

Packages don't consistently unfold in ${P}, some do (or whatever their original versioning is) and some unfold in just ${PN}. I seem to have standardised to installing in ${PN} but that's open to discussion. The big tarball from gap-system.org is inconsistent too.

Licensing is a bit nebulous too. Most package don't seem to have a license notice. The distribution is GPL 2+ except for the bit stated otherwise. So GPL-2+ is my blanket license.

kiwifb commented 8 years ago

I am guessing it will need a slight update for guava-3.13.

kiwifb commented 8 years ago

Still want to send a PR or should I just put one in?

Coacher commented 8 years ago

I am very sorry. It fell off my radar. Ebuild was ready for a while now. Also I've been working with this package recently and it works fine.

kiwifb commented 8 years ago

No problems. It happens. Only issue #413 is an annoyance now, but I can move to create a meta ebuild for sage with the rest.