-
Notifications
You must be signed in to change notification settings - Fork 23
/
PKGBUILD
131 lines (117 loc) · 2.96 KB
/
PKGBUILD
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# Maintainer: Hal Clark <gmail.com[at]hdeanclark>
pkgname=dicomautomaton
pkgver=20190713_202000
pkgver() {
date +%Y%m%d_%H%M%S
}
pkgrel=1
pkgdesc="Various tools for medical physics applications."
url="http://www.halclark.ca"
arch=('x86_64' 'i686' 'armv7h')
license=('unknown')
depends=(
'gcc-libs'
'gnu-free-fonts'
'zenity'
'sfml'
'sdl2'
'glew'
'glu'
'jansson'
'libpqxx'
'postgresql'
'nlopt'
'gsl'
'boost-libs'
'zlib'
'cgal>=4.8'
'wt'
'explicator'
'ygor'
)
optdepends=(
'libnotify'
'dunst' # Or any other notification server compatible with libnotify.
'zenity'
'dialog'
'gnuplot'
'patchelf'
'bash-completion'
'ttf-computer-modern-fonts'
)
makedepends=(
'cmake'
'git'
'asio'
'ygorclustering'
)
# conflicts=()
# replaces=()
# backup=()
# install='foo.install'
# source=("http://www.server.tld/${pkgname}-${pkgver}.tar.gz"
# "foo.desktop")
# md5sums=(''
# '')
#options=(!strip staticlibs)
#PKGEXT='.pkg.tar' # Disable compression.
options=(strip staticlibs !debug)
build() {
# ---------------- Configure -------------------
# Try use environment variable, but fallback to standard.
install_prefix=${INSTALL_PREFIX:-/usr}
# If the version is not supplied as an environment variable, attempt to provide it.
# (If this is being built it an intact git repo, it should pick up the git hash.)
if [ -z "${DCMA_VERSION}" ] ; then
DCMA_VERSION="$(../scripts/extract_dcma_version.sh)"
fi
# Work-around for SFML 2.6.0-1.
if [ -d '/usr/pkgconfig/' ] ; then
export PKG_CONFIG_PATH='/usr/pkgconfig/'
fi
# Default build with default compiler flags.
cmake \
-DDCMA_VERSION="${DCMA_VERSION}" \
-DCMAKE_INSTALL_PREFIX="${install_prefix}" \
-DCMAKE_INSTALL_SYSCONFDIR=/etc \
-DCMAKE_BUILD_TYPE=Release \
-DMEMORY_CONSTRAINED_BUILD=OFF \
-DWITH_ASAN=OFF \
-DWITH_TSAN=OFF \
-DWITH_MSAN=OFF \
-DWITH_EIGEN=ON \
-DWITH_CGAL=ON \
-DWITH_NLOPT=ON \
-DWITH_SFML=ON \
-DWITH_WT=ON \
-DWITH_GNU_GSL=ON \
-DWITH_POSTGRES=ON \
-DWITH_JANSSON=ON \
../
## Debug build with default compiler flags.
#cmake \
# -DMEMORY_CONSTRAINED_BUILD=OFF \
# -DCMAKE_INSTALL_PREFIX=/usr \
# -DCMAKE_BUILD_TYPE=Debug \
# ../
## Custom build which can make use of custom compiler flags.
## (Note that the CMake build type must NOT be specified, or these flags will be overridden.)
#cmake \
# -DMEMORY_CONSTRAINED_BUILD=OFF \
# -DCMAKE_INSTALL_PREFIX=/usr \
# -DCMAKE_CXX_FLAGS='-O2' \
# ../
# ------------------ Build ---------------------
# Scale compilation, but limit to 8 concurrent jobs to temper memory usage.
JOBS=$(nproc)
JOBS=$(( $JOBS < 8 ? $JOBS : 8 ))
make -j "$JOBS" VERBOSE=1
## Build with a single job to keep memory usage low.
#make VERBOSE=1
## Debug compiler flags without actually compiling ("dry-run").
#make -n
}
package() {
make DESTDIR="${pkgdir}" install
}
# vim:set ts=2 sw=2 et: