You are not logged in.

#1 2016-02-09 08:33:27

beowulfey
Member
Registered: 2016-02-09
Posts: 2

Split pkg where second library depends on the first being installed

Hi, I'm new to generating packages (and, to some extent, compiling in general) so sorry if this is silly or obvious. I'm trying to install a series of C++ libraries that are distributed as separate source tarballs; the software is Bio++, and so I've dubbed the package libbpp, with the intention of installing the separate sources as two packages: "libbpp-core" and "libbpp-seq". Libbpp-core has to be installed first, as libbpp-seq needs to see the core libraries in order to be compiled. Now, I've so far managed to generate and install the two packages separately by doing core first and then seq second; this worked okay, but compilation of both core and seq generates a Bpp.all file in the /usr/include directory, where presumably the one made when compiling the "seq" source is updating/overwriting the "core" version. The problem I've run into is installing the libbpp-seq package with pacman requires using the --force option since it needs to overwrite that Bpp.all file.

So! This is where I am now. I thought by setting this up as a split package, I might be able to get around having to use the pacman --force option, as using excessive --force seems like bad practice. However, I can't seem to figure out how to structure the PKGBUILD file so that it compiles properly. Like I said, doing it separately is fine; but when together, it errors out because it complains that it can't find the bpp-core libraries. I'm betting it's something simple with how I'm organizing the files that are generated or something, but I've tried a couple methods and searched around, and wasn't able to find something that worked. Any suggestions would be really appreciated!

Here's my PKGBUILD for my split setup. When I ran this, it successfully generates the libbcc-core package, but errors at the libbcc-seq package. Hopefully it seems relatively sane and isn't too embarrassing...

pkgname=('libbpp-core' 'libbpp-seq')
pkgbase='libbpp'
pkgver=2.2.0
pkgrel=1
epoch=
pkgdesc="The Bio++ library for phylogenetics and sequence manipulation. Contains bpp-core and bpp-seq only."
arch=('x86_64')
url="http://biopp.univ-montp2.fr/wiki/index.php/Main_Page"
license=('CeCiLL')
groups=()
depends=()                                                                                                                                                                                                         
makedepends=('cmake')
checkdepends=()
optdepends=()
provides=()
conflicts=()
replaces=()
backup=()
options=()
install=
changelog=
source=("http://biopp.univ-montp2.fr/repos/sources/bpp-core-$pkgver.tar.gz"
        "http://biopp.univ-montp2.fr/repos/sources/bpp-seq-$pkgver.tar.gz")
noextract=()
md5sums=('5789ed2ae8687d13664140cd77203477'
         '44adef0ff4d5ca4e69ccf258c9270633')
validpgpkeys=()

build() {
        cd bpp-core-$pkgver
        cmake -DCMAKE_INSTALL_PREFIX=libbpp-core/usr -DBUILD_TESTING=FALSE
        make -j4 
}

package_libbpp-core() {
        cd bpp-core-$pkgver
        make install
}

package_libbpp-seq() {
        cd bpp-seq-$pkgver
        cmake -DCMAKE_INSTALL_PREFIX=libbpp-seq/usr -DBUILD_TESTING=FALSE
        make -j4
        make install
}

Thanks!

Last edited by beowulfey (2016-02-09 08:36:21)

Offline

#2 2016-02-09 09:31:11

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,383
Website

Re: Split pkg where second library depends on the first being installed

In "package_libbpp-seq()" put "depends=('libbp-core')".   Also delete the Bpp.all in the -seq package.

Offline

#3 2016-02-09 15:41:42

beowulfey
Member
Registered: 2016-02-09
Posts: 2

Re: Split pkg where second library depends on the first being installed

Thanks for the suggestion. Deleting the Bpp.all from the -seq package seems to work (I just rm'd it after make install in the PKGBUILD). It still didn't work as a split package, as the -seq pkg still couldn't find -core... but doing them sequentially was fine, so it still solved my problem!

I took a look at the contents of those ".All" files, it's basically just a list of all the headers Bio++ includes. Is it worth deleting it from the -core package as well? My knowledge of C++ is still sort of rudimentary, I'm not sure if they are necessary to source the headers. None of the other software headers I have in my /usr/include directory uses a ".all" file, and I figure it would be neater if it isn't necessary.

Offline

Board footer

Powered by FluxBB