summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e578b9a7bed4538d072318b7df5c4d7699e2f2dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Maintainer: lukaszimmermann <luk.zim91 at gmail dot com>
# Contributor: saxonbeta <saxonbeta at gmail dot com>
pkgname=openms
_pkgname=OpenMS
pkgver=2.5.0
_pkgver=2.5
pkgrel=1
pkgdesc="C++ library and tools for LC/MS data management and analyses"
arch=('i686' 'x86_64')
url="http://www.openms.de"
license=('BSD')
depends=('boost' 'eigen' 'glpk' 'hdf5' 'qt5-base' 'qt5-svg' 'sqlite' 'xerces-c')
makedepends=('autoconf' 'automake' 'cmake' 'fakeroot' 'gcc' 'make' 'patch')
source=("https://abibuilder.informatik.uni-tuebingen.de/archive/openms/OpenMSInstaller/release/${pkgver}/${_pkgname}-${pkgver}-src.tar.gz"
        "OpenMS-TOPPView.desktop"
        "OpenMS-TOPPAS.desktop"
        "OpenMS.sh")
sha256sums=('2c76cbb68b5b5c2c77003d467a1ed14e6d1efc36b135f97d2839449c4e696081'
            '4f93d5c22a8267e4fbde6883ecc34a00abfc2ee5eafb46f6d81256ad8a33cdac'
            '9b33c6c91d931802e88af89ade4beb6c8d05484d57d1ad804888511b7a8b00a0'
            '2cf69cb56959f101614129d2a87dc078daca904e1701ed674d399afed1ff306d')

# Variables 
_prefix="${_pkgname}-${pkgver}"
_openms_build="${_prefix}-build"

_physpath() {
	realpath -P "$1"
}

_goto_empty_dir_in_src() {
   cd "${srcdir}"
   rm -rf "$1"
   mkdir "$1"
   cd "$1"
}

_build_contrib() {
  _goto_empty_dir_in_src "${_contrib_build}"
  for contrib in $@; do
    cmake -DBUILD_TYPE="${contrib}" "$(_physpath ../${_prefix}/contrib)"
  done
}

_build_openms() {
  _goto_empty_dir_in_src "${_openms_build}"
  cmake \
    -DOPENMS_CONTRIB_LIBS="$(_physpath ../${_contrib_build})" \
    -DHAS_XSERVER=On \
    -DWITH_GUI=On \
    -DENABLE_TUTORIALS=Off \
    -DENABLE_DOCS=Off \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX="$(_physpath ${pkgdir}/usr)" \
    "$(_physpath ../${_prefix})"
  make $@
}

build() {

  # Variables
  local _contrib_build="contrib-build"

  # Build the required contribs, which cannot be covered by other Arch Linux packages
  # Note: We also build SQLITE, since AUR offers sqlite2. If this is installed,
  # the build process might erroneously link against sqlite2, which will then
  # break the build
  _build_contrib SQLITE SEQAN LIBSVM COINOR KISSFFT WILDMAGIC

  # Build OpenMS
  _build_openms OpenMS TOPP UTILS GUI
}

package() {
  cd "${srcdir}/${_openms_build}"
  make DESTDIR="${pkgdir}/usr" install
  local INSTALL='install -m644 -D'
  $INSTALL "${srcdir}/${_prefix}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
  $INSTALL "${srcdir}/OpenMS-TOPPView.desktop" "${pkgdir}/usr/share/applications/OpenMS-TOPPView.desktop"
  $INSTALL "${srcdir}/OpenMS-TOPPAS.desktop" "${pkgdir}/usr/share/applications/OpenMS-TOPPAS.desktop"
  $INSTALL "${srcdir}/OpenMS.sh" "${pkgdir}/etc/profile.d/OpenMS.sh"
}