You are not logged in.

#1 2016-01-10 02:00:47

crmullins
Member
Registered: 2014-04-08
Posts: 27

[REQUEST] First PKGBUILD for a VCS package

Hi all,

Like the title says, I haven't done a git PKGBUILD yet so I felt like CTK would be a good first try at this.

# Maintainer: Chris <christopher.r.mullins g-mail>

pkgname=commontk-git
pkgrel=1
pkgdesc='A set of common support code for medical imaging, surgical navigation, and related purposes.' 
pkgver=r5007.0f14f50
arch=('i686' 'x86_64')
url='http://commontk.org'
depends=('qt4')
makedepends=('git' 'cmake' 'subversion')
optdepends=('python2: For scripting support')
license=('Apache')
source=("git://github.com/commontk/CTK.git")
md5sums=("SKIP")

pkgver() {
  cd $srcdir/CTK
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
  cd $srcdir
  rm -rf build
  mkdir build
  cd build

  cmake \
    -DCTK_SUPERBUILD:BOOL=OFF \
    -DCMAKE_BUILD_TYPE:STRING=Release \
    -DCMAKE_INSTALL_PREFIX:PATH=/usr \
    -DBUILD_SHARED_LIBS:BOOL=ON \
    -DCTK_LIB_Widgets:BOOL=ON \
    ../CTK

  make
}

package() {
  cd $srcdir/build
  make DESTDIR=${pkgdir} install
}

Is there anything I'm missing or doing wrong? 

One thing I'm unsure about, is what cmake options I should be using by default.  If, for example, someone wanted to build CTK with python bindings, that would require some nontrivial changes to how the build and install functions work.  Maybe that would require a split package, but I'd be interested to see what's the recommended way to handle this situation.

Thanks!

Offline

#2 2016-01-10 05:25:29

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [REQUEST] First PKGBUILD for a VCS package

1) If you are going to explicitly reference $srcdir (a directory name you do not control) you should quote it.
Same goes for $pkgdir

2) Why is subversion listed as a makedepends if you are not using it?

python bindings can probably just be included. How big are they, compared to the rest of the package, and how often will they be desired?


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#3 2016-01-10 19:30:58

crmullins
Member
Registered: 2014-04-08
Posts: 27

Re: [REQUEST] First PKGBUILD for a VCS package

1) Thanks, I didn't know that. 

2)  It is used in the superbuild depending on what you build with it, e.g. OpenIGTLink [1] but if CTK_SUPERBUILD is off you don't need it.  Thanks for mentioning that, taking it out.

The only big reservation I have about turning on python wrapping is that it would require PythonQt to also be built.  Looks like that package is orphaned right now, I'll go ahead and throw one up for that too, then add pythonqt as an optional dependency, and see how difficult it is after that.


[1] https://github.com/commontk/CTK/blob/ma … .cmake#L32

Offline

Board footer

Powered by FluxBB