You are not logged in.

#1 2009-06-14 03:37:30

joaca_rj
Member
From: Rio de Janeiro, Brazil
Registered: 2009-04-12
Posts: 76

Problems writing PKGBUILD for freecad-svn

Hello everyone...

I'm having some issues writing a PKGBUILD to freecad(svn)....
When I build it by hand it works flawlessly...
but when I use makepkg, it ends with errors, seems like it can't link to a library of Opencascade...

I don't know if its related ( but my guess is it is) with optimizations in makepkg.conf... One thing is that it uses only one core when building by hand ( and both when via makepkg )

here is the error...

libtool: link: (cd ".libs" && rm -f "libPartDesign.so.2" && ln -s "libPartDesign.so.2.0.0" "libPartDesign.so.2")
libtool: link: (cd ".libs" && rm -f "libPartDesign.so" && ln -s "libPartDesign.so.2.0.0" "libPartDesign.so")
libtool: link: ( cd ".libs" && rm -f "libPartDesign.la" && ln -s "../libPartDesign.la" "libPartDesign.la" )
libtool: link: g++ -shared -nostdlib /usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.0/../../../../lib/crti.o /usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.0/crtbeginS.o  .libs/PartDesign_la-AppPartDesign.o   -Wl,-rpath -Wl,/home/arkim/Joaquim/CAD/freecad/src/freecad/src/Mod/Part/App/.libs -Wl,-rpath -Wl,/home/arkim/Joaquim/CAD/freecad/src/freecad/src/App/.libs -Wl,-rpath -Wl,/home/arkim/Joaquim/CAD/freecad/src/freecad/src/Base/.libs -Wl,-rpath -Wl,/home/arkim/FreeCAD/Mod/Part -Wl,-rpath -Wl,/home/arkim/FreeCAD/lib -L/home/arkim/Joaquim/CAD/freecad/src/freecad/src/App/.libs -L/home/arkim/Joaquim/CAD/freecad/src/freecad/src/Base/.libs -L/home/arkim/Joaquim/CAD/freecad/src/freecad/src/Base -L/home/arkim/Joaquim/CAD/freecad/src/freecad/src/App -L/home/arkim/Joaquim/CAD/freecad/src/freecad/src/Mod/Part/App -L/usr/lib -L/usr/lib/ -L/opt/opencascade/Linux/lib -lboost_regex-mt /home/arkim/Joaquim/CAD/freecad/src/freecad/src/Mod/Part/App/.libs/libPart.so -L/usr/X11R6/lib -L/usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.0/../../../../lib -L/opt/opencascade/lib /home/arkim/Joaquim/CAD/freecad/src/freecad/src/App/.libs/libFreeCADApp.so -lboost_program_options-mt -lboost_signals-mt /home/arkim/Joaquim/CAD/freecad/src/freecad/src/Base/.libs/libFreeCADBase.so -lboost_filesystem-mt -lboost_system-mt -lz -lpython2.6 /usr/lib/libxerces-c.so -lnsl -lcurl /opt/opencascade/lib/libTKSTEP.so /opt/opencascade/lib/libTKSTEPAttr.so /opt/opencascade/lib/libTKSTEP209.so /opt/opencascade/lib/libTKSTEPBase.so /opt/opencascade/lib/libTKIGES.so /opt/opencascade/lib/libTKSTL.so /opt/opencascade/lib/libTKMesh.so /opt/opencascade/lib/libTKXSBase.so /opt/opencascade/lib/libTKOffset.so /opt/opencascade/lib/libTKFillet.so /opt/opencascade/lib/libTKShHealing.so /opt/opencascade/lib/libTKBool.so /opt/opencascade/lib/libTKPrim.so /opt/opencascade/lib/libTKBO.so /opt/opencascade/lib/libTKTopAlgo.so /opt/opencascade/lib/libTKGeomAlgo.so /opt/opencascade/lib/libTKBRep.so /opt/opencascade/lib/libTKGeomBase.so /opt/opencascade/lib/libTKG3d.so /opt/opencascade/lib/libTKG2d.so /opt/opencascade/lib/libTKMath.so /opt/opencascade/lib/libTKernel.so -ldl -lpthread -lPartDesign -L/usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.0 -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.0/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.0/crtendS.o /usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.0/../../../../lib/crtn.o  -march=core2   -Wl,-soname -Wl,PartDesign.so -o .libs/PartDesign.so
/usr/bin/ld: cannot find -lPartDesign
collect2: ld returned 1 exit status
make[5]: ** [PartDesign.la] Erro 1

and makepkg.conf...

#
# /etc/makepkg.conf
#

#########################################################################
# SOURCE ACQUISITION
#########################################################################
#
#-- The download utilities that makepkg should use to acquire sources
#  Format: 'protocol::agent'
DLAGENTS=('ftp::/usr/bin/wget -c --passive-ftp -t 3 --waitretry=3 -O %o %u'
          'http::/usr/bin/wget -c -t 3 --waitretry=3 -O %o %u'
          'https::/usr/bin/wget -c -t 3 --waitretry=3 --no-check-certificate -O %o %u'
          'rsync::/usr/bin/rsync -z %u %o'
          'scp::/usr/bin/scp -C %u %o')

# Other common tools:
# /usr/bin/snarf
# /usr/bin/lftpget -c
# /usr/bin/curl

#########################################################################
# ARCHITECTURE, COMPILE FLAGS
#########################################################################
#
CARCH="x86_64"
CHOST="x86_64-unknown-linux-gnu"

#-- Exclusive: will only run on -march=x86-64 
# -march (or -mcpu) builds exclusively for an architecture
# -mtune optimizes for an architecture, but builds for whole processor family
CFLAGS="-march=core2 -O2 -pipe"
CXXFLAGS="-march=core2 -O2 -pipe"
#-- Make Flags: change this for DistCC/SMP systems
MAKEFLAGS="-j3"

#########################################################################
# BUILD ENVIRONMENT
#########################################################################
#
# Defaults: BUILDENV=(fakeroot !distcc color !ccache !xdelta)
#  A negated environment option will do the opposite of the comments below.
#
#-- fakeroot: Allow building packages as a non-root user
#-- distcc:   Use the Distributed C/C++/ObjC compiler
#-- color:    Colorize output messages
#-- ccache:   Use ccache to cache compilation
#-- xdelta:   Generate delta patch from previous to current package
#
BUILDENV=(fakeroot !distcc color !ccache !xdelta)
#
#-- If using DistCC, your MAKEFLAGS will also need modification. In addition,
#-- specify a space-delimited list of hosts running in the DistCC cluster.
#DISTCC_HOSTS=""

#########################################################################
# GLOBAL PACKAGE OPTIONS
#   These are default values for the options=() settings
#########################################################################
#
# Default: OPTIONS=(strip docs libtool emptydirs zipman)
#  A negated option will do the opposite of the comments below.
#
#-- strip:     Strip symbols from binaries/libraries
#-- docs:      Save doc and info directories
#-- libtool:   Leave libtool (.la) files in packages
#-- emptydirs: Leave empty directories in packages
#-- zipman:    Compress manpages with gzip
#
OPTIONS=(strip docs libtool emptydirs zipman)

#-- File integrity checks to use. Valid: md5, sha1, sha256, sha384, sha512
INTEGRITY_CHECK=(md5)
#-- Info and doc directories to remove (if option set correctly above)
DOC_DIRS=(usr/{,share/}{info,doc,gtk-doc} opt/*/{info,doc,gtk-doc})
#-- Directories to be searched for the strip option (if option set correctly above)
STRIP_DIRS=(bin lib sbin usr/{bin,lib,sbin,local/{bin,lib,sbin}} opt/*/{bin,lib,sbin})

#########################################################################
# PACKAGE OUTPUT
#########################################################################
#
# Default: put built package and cached source in build directory
#
#-- Destination: specify a fixed directory where all packages will be placed
#PKGDEST=/home/packages
#-- Source cache: specify a fixed directory where source files will be cached
#SRCDEST=/home/sources
#-- Packager: name/email of the person or organization building packages
#PACKAGER="John Doe <john@doe.com>"

#########################################################################
# BUILDSCRIPT/EXTENSION DEFAULTS
#########################################################################
#
# WARNING: Do NOT modify these variables unless you know what you are
#          doing.
#
BUILDSCRIPT='PKGBUILD'
PKGEXT='.pkg.tar.gz'
SRCEXT='.src.tar.gz'
DB_COMPRESSION='gz'
DB_CHECKSUMS=(md5)

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

I could try removing some optimisations from makepkg, but that would defeat the purpose of doing it anyway....

And the PKGBUILD ( corrections appreciated )

# Contributor: Joaquim Coimbra <joaca_rj@yahoo.com.br>
# Thanks to Werner Mayer for his support

pkgname=freecad-svn
pkgver=2152
pkgrel=1
pkgdesc="A general purpose 3D CAD modeler, aimed directly at mechanical engineering and product design but also architecture or other engineering specialties"
arch=('i686' 'x86_64')
url="https://sourceforge.net/apps/mediawiki/free-cad/"
license=('GPL')
groups=()
depends=('xerces-c' 'gts' 'opencascade' 'coin' 'soqt' 'soqt-doc' 'zlib' 'ode' 'qt' 'opencv' 'boost' 'python')
makedepends=('subversion')
provides=('freecad')
conflicts=('freecad')
replaces=()
backup=()
options=()
install=
source=()
noextract=()
md5sums=()

_svntrunk=https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk
_svnmod=freecad

build() {
  cd "$srcdir"

  if [ -d $_svnmod/.svn ]; then
    (cd $_svnmod && svn up -r $pkgver)
  else
    svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod
  fi

  msg "SVN checkout done or server timeout"
  msg "Starting make..."

  cd $_svnmod

  #
  # BUILD
  #
  ./autogen.sh || return 1
  ./configure --with-qt4-dir=/usr/lib/qt/ --with-qt4-bin=/usr/bin/ --with-qt4-include=/usr/include/ --with-qt4-lib=/usr/lib/qt/ --with-xercesc-include=/usr/include/xercesc/ --with-xercesc-lib=/usr/lib/

  make || return 1
  make DESTDIR="$pkgdir/" install || return 1

help!

Last edited by joaca_rj (2009-06-14 03:37:56)

Offline

#2 2009-06-14 10:10:00

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

Re: Problems writing PKGBUILD for freecad-svn

Try options=('!makeflags') in PKGBUILD.

Offline

#3 2009-06-14 17:29:57

joaca_rj
Member
From: Rio de Janeiro, Brazil
Registered: 2009-04-12
Posts: 76

Re: Problems writing PKGBUILD for freecad-svn

ThX!
That did it!!

Offline

Board footer

Powered by FluxBB