You are not logged in.

#1 2008-04-07 14:49:17

alcafar
Member
From: Italy
Registered: 2008-03-23
Posts: 47

[SOLVED]I can build a package with "make install" but not with makepkg

I'm quite new to Arch and it's my first PKGBUILD.
I successfully built the software lhapdf http://www.hepforge.org/archive/lhapdf/ … 3.1.tar.gz with the traditional system:
1) I do a patch for compatibility with gcc 4.3

cd lhapdf-5.3.1
sed -i "s/<string>/<cstring>/" ccwrap/test-lhapdf-ccwrap.cc

and then

./configure --prefix=/usr
make
sudo make install

Then I tried to write a PKGBUILD

pkgname=lhapdf
pkgver=5.3.1
pkgrel=1
pkgdesc="Unified and easy to use interface to modern PDF sets"
arch=(i686 x86_64)
url="http://projects.hepforge.org/lhapdf"
license=('GPL')
groups=()
depends=()
makedepends=()
provides=()
conflicts=()
replaces=()
backup=()
options=()
install=
source=(http://www.hepforge.org/archive/lhapdf/$pkgname-$pkgver.tar.gz)
noextract=()
md5sums=() #generate with 'makepkg -g'

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

  #Change needed in order to compile with gcc 4.3
  sed -i "s/<string>/<cstring>/" ccwrap/test-lhapdf-ccwrap.cc

  ./configure --prefix=/usr
  make || return 1
  make DESTDIR="$pkgdir" install
}

# vim:set ts=2 sw=2 et:

and it doesn't work. The last lines of the output of makepkg are:

g++ -march=nocona -O2 -pipe -o .libs/test-lhapdf-ccwrap test-lhapdf-ccwrap.o  -L/home/cafarell/abs/lhapdf/src/lhapdf-5.3.1/ccwrap -L/home/cafarell/abs/lhapdf/src/lhapdf-5.3.1/src -lLHAPDFWrap /home/cafarell/abs/lhapdf/src/lhapdf-5.3.1/src/.libs/libLHAPDF.so -Wl,--rpath -Wl,/usr/lib
/usr/bin/ld: cannot find -lLHAPDFWrap
collect2: ld returned 1 exit status
make[1]: *** [test-lhapdf-ccwrap] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/home/cafarell/abs/lhapdf/src/lhapdf-5.3.1/ccwrap'
make: *** [all-recursive] Error 1
==> ERRORE: Compilazione interrotta.
    L'operazione sta per essere interrotta...

Any idea?

Last edited by alcafar (2008-04-09 11:03:00)

Offline

#2 2008-04-07 18:00:29

Snowman
Developer/Forum Fellow
From: Montreal, Canada
Registered: 2004-08-20
Posts: 5,212

Re: [SOLVED]I can build a package with "make install" but not with makepkg

use options=('!makeflags')

and change:
cd "$srcdir/$pkgname-$pkgver"
to
cd "$startdir/src/$pkgname-$pkgver"

and change:
make DESTDIR="$pkgdir" install
to:
make DESTDIR="$startdir/pkg" install

Offline

#3 2008-04-08 10:43:54

alcafar
Member
From: Italy
Registered: 2008-03-23
Posts: 47

Re: [SOLVED]I can build a package with "make install" but not with makepkg

Thank you Snowman, it works with options=('!makeflags'). The changes in the paths were not needed, I copied them from /usr/share/pacman/PKGBUILD.proto, probably is some new feature.
Now, I'd like to post the PKGBUILD to AUR. This is currently my PKGBUILD:

# Contributor: My name <mymail@bla.bla>
pkgname=lhapdf
pkgver=5.3.1
pkgrel=1
pkgdesc="Unified and easy to use interface to modern PDF sets"
arch=(i686 x86_64)
url="http://projects.hepforge.org/lhapdf"
license=('GPL')
groups=()
depends=(gcc-libs)
makedepends=()
provides=()
conflicts=()
replaces=()
backup=()
options=('!makeflags')
install=
source=(http://www.hepforge.org/archive/lhapdf/$pkgname-$pkgver.tar.gz)
noextract=()
md5sums=('df667840071996d2c58a125567be26b2')

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

  #Change needed in order to compile with gcc 4.3
  sed -i "s/<string>/<cstring>/" ccwrap/test-lhapdf-ccwrap.cc

  ./configure --prefix=/usr
  make || return 1
  make DESTDIR="$pkgdir" install
}

# vim:set ts=2 sw=2 et:

I have the following output from namcap:

$ namcap lhapdf-5.3.1-1-x86_64.pkg.tar.gz
lhapdf     W: File (usr/lib/libLHAPDFWrap.la) is a libtool file.
lhapdf     W: File (usr/lib/libLHAPDF.la) is a libtool file.
$ namcap PKGBUILD
PKGBUILD (lhapdf)    W: Missing Maintainer tag
PKGBUILD (lhapdf)    W: Missing CVS Id tag

and this output from ldd

$ ldd libLHAPDF.so
        linux-vdso.so.1 =>  (0x00007fff86dfe000)
        libgfortran.so.3 => /usr/lib/libgfortran.so.3 (0x00002b70367fe000)
        libm.so.6 => /lib/libm.so.6 (0x00002b7036ace000)
        libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00002b7036d52000)
        libc.so.6 => /lib/libc.so.6 (0x00002b7036f69000)
        /lib/ld-linux-x86-64.so.2 (0x0000555555554000)

$ ldd libLHAPDFWrap.so
        linux-vdso.so.1 =>  (0x00007fffeeffe000)
        libLHAPDF.so.0 => not found
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00002b11bbd53000)
        libm.so.6 => /lib/libm.so.6 (0x00002b11bc060000)
        libc.so.6 => /lib/libc.so.6 (0x00002b11bc2e3000)
        libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00002b11bc636000)
        /lib/ld-linux-x86-64.so.2 (0x0000555555554000)

What should I add to PKGBUILD?
The program is in fortran, so I'm surprised that namcap did not add gcc-fortran in the dependencies. Should I add it to depends or makedepends? Or maybe it is included in gcc-libs?

Offline

#4 2008-04-08 14:34:07

bender02
Member
From: UK
Registered: 2007-02-04
Posts: 1,328

Re: [SOLVED]I can build a package with "make install" but not with makepkg

$ pacman -Qo /usr/lib/libgfortran.so.3
/usr/lib/libgfortran.so.3 is owned by gcc-libs 4.3.0-1

Offline

#5 2008-04-08 15:30:16

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

Re: [SOLVED]I can build a package with "make install" but not with makepkg

You should also delete the empty fields from your PKGBUILD (e.g. groups=(), install= etc).

Offline

#6 2008-04-09 11:01:16

alcafar
Member
From: Italy
Registered: 2008-03-23
Posts: 47

Re: [SOLVED]I can build a package with "make install" but not with makepkg

Thank you, package submitted!

Offline

Board footer

Powered by FluxBB