summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 41e37b08ae57f459bb96c173b9fe32b282599099 (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
# Maintainer: anon at sansorgan.es
pkgname=madagascar
pkgver=r14561.279e38d29
pkgrel=1
epoch=1
pkgdesc="Multidimensional data analysis and reproducible computational experiments."
url=http://ahay.org/
license=('GPL2')
arch=('i686' 'x86_64')
depends=('libtirpc' 'ffmpeg' 'libxaw' 'cairo' 'fftw' 'netpbm' 'gd'
'openmpi' 'glu' 'freeglut' 'suitesparse' 'python') 
makedepends=('scons' 'libtirpc' 'libtirpc-compat')
options=('strip')
#source=("$pkgname.tar.gz::https://sourceforge.net/projects/rsf/files/madagascar/madagascar-3.0/madagascar-3.0.1.tar.gz/download")
source=($pkgname::git+https://github.com/ahay/src)
noextract=("$pkgname.tar.gz")

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


build() {
  cd ${srcdir}/${pkgname}
  # Investigate additional bindings
  #export LINKFLAGS="-ltirpc"
  export LINKFLAGS="-llapack -lblas -ltirpc -pthread -fopenmp"
  ./configure --prefix=${pkgdir}/usr/

  echo "Fixing paths in files..."

#  for f in config.py env.sh env.csh ; do
#    sed -i "s|${pkgdir}||g" "$f"
#    sed -i "s|${srcdir}|/usr/src/|g" "$f"
#  done

  sed -i "s/^LINKFLAGS.*/LINKFLAGS = ['-llapack', '-lblas', '-pthread', '-fopenmp', '-ltirpc']/g" config.py
#  sed -i "s/^CXXFLAGS.*/CXXFLAGS = \'-O2 -std=c++11 -U__STRICT_ANSI__ -Wall -pedantic -fopenmp ${CXXFLAGS}\'/g" config.py
  make "${MAKEFLAGS}"
}

package() {
    cd ${srcdir}/${pkgname}
    make install
    arr=("/usr/share/madagascar/etc/config.py"
         "/usr/lib/python3.8/site-packages/rsf/prog.py"
	 "/usr/share/madagascar/etc/env.sh"
	 "/usr/src/madagascar/config.py"
	)
    for f in $arr ; do
      sed -i "s|${pkgdir}||g" "${pkgdir}/$f"
      sed -i "s|${srcdir}|/usr/src/|g" "${pkgdir}/$f"
    done
    mkdir -p "${pkgdir}/usr/src/"
    cp -r ${srcdir} ${pkgdir}/usr/src/${pkgname}
    rm ${pkgdir}/usr/src/${pkgname}/madagascar.tar.gz
}
#md5sums=('a87a6f7f5ba552cd251b1588048844bf')
md5sums=('SKIP')