summaryrefslogtreecommitdiff
path: root/community/scilab/PKGBUILD
blob: ed76c2b92b53c31183372644c59b91bafe0633f1 (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
83
84
85
86
# Maintainer: Stefan Husmann <stefan-husmann@t-online.de>
# Contributor: Simon Lipp <sloonz+aur@gmail.com>
# Paulo Matias

pkgname=scilab
pkgver=5.3.1
pkgrel=4
pkgdesc='Scilab is a scientific software package for numerical computations.'
arch=('i686' 'x86_64' 'mips64el')
url='http://www.scilab.org/'
license=('custom:CeCILL')
depends=('libxml2' 'pcre' 'lapack' 'java-batik' 'java-flexdock>=0.5.2'
  'jogl' 'jeuclid-core' 'fftw' 'libmatio'  'bash' 'tk' 'jrosetta' 
  'ocaml' 'javahelp2' 'jgraphx=1_4_1_0' 'jlatexmath>=0.9.4' 
  'jlatexmath-fop>=0.9.4' 'junit' 'java-skinlf' 'xalan-java' 
  'java-commons-logging' 'hdf5')
makedepends=('apache-ant' 'antlr2' 'gcc-fortran' 'java-avalon-framework' 'xorg-fonts-type1')
[[ $CARCH == x86_64 ]] && \
  source=("http://www.scilab.org/download/${pkgver}/${pkgname}-${pkgver}-src.tar.gz" \
  "http://www.scilab.org/download/5.3.1/prerequirements-scilab-5.3.1-x86_64-src.tar.gz" \
  'scilab.desktop' 'classpath.xml' 'configure-hdf5-vercheck.patch')

[[ $CARCH == i686 ]] && \
  source=("http://www.scilab.org/download/${pkgver}/${pkgname}-${pkgver}-src.tar.gz" \
  "http://www.scilab.org/download/5.3.1/prerequirements-scilab-5.3.1-src.tar.gz" \
  'scilab.desktop' 'classpath.xml' 'configure-hdf5-vercheck.patch')

[[ $CARCH == x86_64 ]] && md5sums=('0002653e670efabb8faf9e6403367134'
         '7c9bda373d8dfd75a4f8227a08ced588'
         'ad6286f324891fe8b86c60e4012a36b7'
         'efe6e8d06968ba5e1a3e5ab540a79667'
	 '7bf1a2149521db9e1c9a2ed684f9ce52')
[[ $CARCH == i686 ]] && md5sums=('0002653e670efabb8faf9e6403367134'
	 '7545859e4078d3b77436b7f322967f26'
         'ad6286f324891fe8b86c60e4012a36b7'
         'efe6e8d06968ba5e1a3e5ab540a79667'
         '7bf1a2149521db9e1c9a2ed684f9ce52')

options=('!libtool' '!emptydirs')

build() {
  # we do not want things we already have in Arch Linux
  cd ${pkgname}-${pkgver}/thirdparty
  rm  avalon* batik* commons-* flexdock* gluegen-rt* jeuclid* jgraphx* \
    jhall* jlatexmath* jogl* jrosetta* junit* looks-2.1.1.jar xalan* \
    xml* skinlf*
  # fix undefined references (scilab needs to fix its cyclic dependencies)
  LDFLAGS=${LDFLAGS/ -Wl,--as-needed}
  # begin configuring and building
  cd ..

  # dirty hack to remove non-working hdf5 version check from configure
  patch -Np0 -i ${srcdir}/configure-hdf5-vercheck.patch

  ./configure \
    --prefix=/usr \
    --enable-build-localization \
    --without-pvm \
    --with-matio \
    --without-umfpack \
    --with-fftw \
    --with-hdf5 \
    --with-gfortran  # Needed for 64 bits, don't hurt for 32 bits
  make all doc
}

package() {
  cd ${pkgname}-${pkgver}

  make DESTDIR="${pkgdir}" install install-html

  install -d ${pkgdir}/usr/share/licenses/${pkgname}
  install -Dm644 ${srcdir}/scilab-${pkgver}/COPYING \
	${pkgdir}/usr/share/licenses/${pkgname}
  install -Dm644 ${srcdir}/${pkgname}.desktop \
	${pkgdir}/usr/share/applications/${pkgname}.desktop
  sed -i 's#/jni##' ${pkgdir}/usr/share/scilab/etc/librarypath.xml
  install -Dm644 $srcdir/classpath.xml $pkgdir/usr/share/scilab/etc/classpath.xml
  for i in jhdf5.jar fop.jar saxon.jar
  do 
    install -Dm644 $srcdir/$pkgname-$pkgver/thirdparty/$i \
      $pkgdir/usr/share/java/scilab/$i
  done
  install -Dm644 $srcdir/$pkgname-$pkgver/bin/libjhdf5.so \
    $pkgdir/usr/lib/libjhdf5.so
}