1 # Contributor: Tom < reztho at archlinux dot us >
3 # Thanks to sq5nbg for hix fix to this package
4 # Thanks to net147 for his fixes to this package
9 pkgdesc="Extra packages for GNU Octave."
10 arch=('i686' 'x86_64')
11 url="http://octave.sourceforge.net/"
13 depends=('octave>=3.2.0' 'octave<3.3' 'gsl' 'netcdf' 'ginac' 'binutils' 'lapack' 'pcre' 'fftw' 'freetype2' 'perl' 'libjpeg' 'libpng' 'ffmpeg')
14 makedepends=('gcc-fortran')
15 provides=('octave-forge')
16 options=('!makeflags')
17 install=octave-forge.install
18 source=("http://downloads.sourceforge.net/octave/${pkgname}-bundle-${pkgver}.tar.gz")
21 cd ${srcdir}/${pkgname}-bundle-${pkgver}
23 # Unsetting TERM for fixing the problem with some terminals
26 # Adding a flag to CXXFLAGS
27 export CXXFLAGS="${CXXFLAGS} -D__STDC_CONSTANT_MACROS"
29 # Internal variable for setting the .m support file for installation of the packages
30 _m_file=${srcdir}/pkgbuild_install_pkgs.m
31 # Internal variable for the categories of packages. By now I won't consider the nonfree packages
32 _pkg_categories=('main' 'extra' 'language')
33 # List of packages impossible to install because of problems when compiling.
34 _dont_install="main/ann-1.0.2.tar.gz main/image-1.0.10.tar.gz main/database-1.0.4.tar.gz \
35 main/fixed-0.7.10.tar.gz main/ftp-1.0.2.tar.gz main/parallel-2.0.0.tar.gz main/specfun-1.0.8.tar.gz \
36 main/vrml-1.0.10.tar.gz extra/graceplot-1.0.8.tar.gz extra/java-1.2.6.tar.gz \
37 extra/jhandles-0.3.5.tar.gz extra/windows-1.0.8.tar.gz extra/xraylib-1.0.8.tar.gz \
38 language/spanish-1.0.1.tar.gz"
40 # Deleting the packages from the list
41 for _i in ${_dont_install}
43 rm ${srcdir}/${pkgname}-bundle-${pkgver}/${_i} || return 1
46 # We need to know the current global directory prefix previously
48 for _i in `/usr/bin/octave -H --silent --eval 'pkg -global prefix' | tr -d ' ' | cut -d ':' -f 2`
50 _directories[${_varx}]=${_i}
51 _varx=$(expr ${_varx} + 1)
54 # We make the destination directories
55 mkdir -p ${pkgdir}/${_directories[0]}
56 mkdir -p ${pkgdir}/${_directories[1]}
58 # Now we make our .m file for using it in octave
59 echo "pkg prefix ${pkgdir}${_directories[0]} ${pkgdir}${_directories[1]}" > ${_m_file}
61 # - Preventing octave from writing to ~/.octave_packages
62 echo 'pkg local_list /dev/null' >> ${_m_file}
64 _vartotal=${#_pkg_categories[@]}
66 while [ ${_varx} -lt ${_vartotal} ]
68 echo "pkgs = dir(\"${srcdir}/${pkgname}-bundle-${pkgver}/${_pkg_categories[${_varx}]}/\");" >> ${_m_file}
69 echo "cd ${srcdir}/${pkgname}-bundle-${pkgver}/${_pkg_categories[${_varx}]}" >> ${_m_file}
70 echo " for i = 3:length(pkgs)" >> ${_m_file}
71 echo " pkgs(i).name" >> ${_m_file}
72 echo " pkg(\"install\",\"-nodeps\",\"-local\",pkgs(i).name)" >> ${_m_file}
73 echo " endfor" >> ${_m_file}
74 _varx=$(expr ${_varx} + 1)
77 # Now we tell octave to "install" the packages using our .m file
78 cd `dirname ${_m_file}`
79 /usr/bin/octave -H --silent --eval `basename ${_m_file} .m` || return 1
82 md5sums=('faf95ff58884cd29379015b70f57c745')