summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 21a7f933ae7337ee050d0689886317b39f9aa7dc (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
# Maintainer: Andres Alejandro Navarro Alsina <aanavarroa@unal.edu.co>
# Contributor:  GalSim developers team on GitHub
pkgbase=python-galsim-git
pkgname=('python-galsim-git' 'python2-galsim-git' 'galsim-common-git' )
pkgver=v1.5.1.r0.9de448ef9
pkgrel=1
pkgdesc=" The modular galaxy image simulation toolkit "
arch=('i686' 'x86_64')
url="https://github.com/GalSim-developers/GalSim.git"
license=('BSD')
makedepends=('git' 'scons' 'boost-libs' 'fftw' 'tmv-git' 'python')
source=("${pkgbase}::git+${url}")
md5sums=('SKIP')

pkgver() {
	 cd "${pkgbase}"
	 printf "%s" "$(git describe --long | sed 's/\([^-]*-\)g/r\1/;s/-/./g')"
}

prepare() {
	  cp -a $pkgbase{,-py2}
}


build() {
	cd "$srcdir"/$pkgbase
	scons PREFIX=/usr TMV_DIR=/usr PYTHON=python

	cd  "$srcdir"/$pkgbase-py2
	scons PREFIX=/usr TMV_DIR=/usr PYTHON=python2
}

check() {
	cd "$srcdir"/$pkgbase/tests
	nosetests -v

	cd "$srcdir"/$pkgbase-py2/tests
	nosetests2 -v
}

	
package_python-galsim-git() {
			    depends=('python' 'boost-libs' 'tmv-git' 'galsim-common-git')
			    cd $pkgbase
			    scons PREFIX="${pkgdir}"/usr  FINAL_PREFIX=/usr PYTHON=python install
			    rm -rf "${pkgdir}"/usr/share
			    rm -f "${pkgdir}"/usr/lib/libgalsim.so
			    rm -f "${pkgdir}"/usr/lib/libgalsim.so.1.5
			    install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/$pkgname/LICENSE
}

package_python2-galsim-git() {
			     depends=('python2' 'boost-libs' 'tmv-git' 'galsim-common-git')	
			     cd $pkgbase-py2
			     scons PREFIX=$pkgdir/usr  FINAL_PREFIX=/usr PYTHON=python2 install
			    
			     rm -rf "${pkgdir}"/usr/share
			     rm -f "${pkgdir}"/usr/lib/libgalsim.so
			     rm -f "${pkgdir}"/usr/lib/libgalsim.so.1.5
			     for i in galsim galsim_download_cosmos galsim_json galsim_yaml ; do mv "$pkgdir"/usr/bin/${i}{,2}; done
			     install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/$pkgname/LICENSE				
}

package_galsim-common-git() {
			    depends=('fftw' 'tmv-git')
 			    pkgdesc='common files for python-galsim-git and python2-galsim-git'
    			    cd $pkgbase
			    install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/$pkgname/LICENSE
    			    mv "${srcdir}"/$pkgbase/share/ "${pkgdir}"/usr/share/galsim/
  			    install -Dm644 "${srcdir}"/$pkgbase/lib/libgalsim.so "${pkgdir}"/usr/lib/libgalsim.so
			    install -Dm644 "${srcdir}"/$pkgbase/lib/libgalsim.so.1.5 "${pkgdir}"/usr/lib/libgalsim.so.1.5
}