summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorb00rt00s2017-07-06 21:44:06 +0200
committerb00rt00s2017-07-06 21:44:06 +0200
commit60a667005cdb4514bed93d71a4ad86cd8c300ba8 (patch)
treefeebf3550552e60dcb9d351422b93229e926b7e6
parenta3fb30f0685842fa0427f9700c4081d639328be5 (diff)
downloadaur-60a667005cdb4514bed93d71a4ad86cd8c300ba8.tar.gz
fortran sources are now compiled
-rw-r--r--.SRCINFO10
-rw-r--r--PKGBUILD60
-rw-r--r--SConstruct.patch58
-rw-r--r--rungsas23
4 files changed, 103 insertions, 28 deletions
diff --git a/.SRCINFO b/.SRCINFO
index e06d2401ca6..af74d99e98a 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,23 +1,29 @@
pkgbase = gsas2-svn
pkgdesc = General Structure Analysis System II - refinement for powder diffraction patterns
pkgver = 2912
- pkgrel = 1
+ pkgrel = 2
url = https://subversion.xray.aps.anl.gov/trac/pyGSAS
arch = i686
arch = x86_64
license = unknown
makedepends = subversion
+ makedepends = scons
depends = python2
depends = python2-scipy
depends = python2-matplotlib
depends = wxpython
depends = python2-opengl
depends = python2-numpy
- depends = gcc
+ depends = gcc-fortran
+ optdepends = python2-h5py
source = gsas2::svn+https://subversion.xray.aps.anl.gov/pyGSAS/trunk/
source = GSASII.desktop
+ source = rungsas2
+ source = SConstruct.patch
md5sums = SKIP
md5sums = e9d06aed1866e65ce8259cfd5a31e1ce
+ md5sums = 62855c475e29b88b23a446ba4ffd91be
+ md5sums = 3d4b6dd46d76b39b216e1fac0e72f916
pkgname = gsas2-svn
diff --git a/PKGBUILD b/PKGBUILD
index ec93ddc1db3..120b60c6142 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,43 +4,67 @@
pkgname=gsas2-svn
_pkgname=gsas2
pkgver=2912
-pkgrel=1
+pkgrel=2
pkgdesc="General Structure Analysis System II - refinement for powder diffraction patterns"
arch=(i686 x86_64)
url="https://subversion.xray.aps.anl.gov/trac/pyGSAS"
license=(unknown)
-depends=(python2 python2-scipy python2-matplotlib wxpython python2-opengl python2-numpy gcc)
+depends=(python2 python2-scipy python2-matplotlib wxpython python2-opengl python2-numpy gcc-fortran)
[ "${CARCH}" = "x86_64" ] && depends=("${depends[@]}")
-makedepends=(subversion)
+makedepends=(subversion scons)
+optdepends=(python2-h5py)
+
source=("${_pkgname}::svn+https://subversion.xray.aps.anl.gov/pyGSAS/trunk/"
- "GSASII.desktop")
+ "GSASII.desktop"
+ "rungsas2"
+ "SConstruct.patch")
md5sums=('SKIP'
- 'e9d06aed1866e65ce8259cfd5a31e1ce')
+ 'e9d06aed1866e65ce8259cfd5a31e1ce'
+ '62855c475e29b88b23a446ba4ffd91be'
+ '3d4b6dd46d76b39b216e1fac0e72f916')
pkgver() {
cd "${SRCDEST}/${_pkgname}"
svnversion | tr -d [A-z]
}
+prepare() {
+ cd $srcdir/${_pkgname}/fsource
+ patch -p0 < $srcdir/SConstruct.patch
+}
+
build()
{
- msg "Nothing to do in build()"
+ cd $srcdir/${_pkgname}/fsource
+ scons
}
+
package()
{
mkdir -p "$pkgdir/opt/${_pkgname}"
mkdir -p "$pkgdir/usr/share/licenses/${_pkgname}/"
mkdir -p "$pkgdir/usr/share/applications/"
+ #Install gsas-2 files:
+ cp -a $srcdir/${_pkgname}/* $pkgdir/opt/${_pkgname}
+
#remove unecessary libraries for other platforms
- ( cd $srcdir/${_pkgname}
+ ( cd $pkgdir/opt/${_pkgname}
+
+ fortran_libs="fellipse.so histogram2d.so histosigma2d.so pack_f.so polymask.so pydiffax.so pypowder.so pyspg.so pytexture.so unpack_cbf.so"
+ mkdir _fsource
+ for lib in ${fortran_libs}; do
+ cp fsource/${lib} _fsource/lib
+ done
+ rm -r fsource
+ mv _fsource fsource
- [ "${CARCH}" == "i686" ] && rm -rf binlinux64-2.7
- [ "${CARCH}" == "x86_64" ] && rm -rf binlinux2.7
+# [ "${CARCH}" == "i686" ] && rm -rf binlinux64-2.7
+# [ "${CARCH}" == "x86_64" ] && rm -rf binlinux2.7
- for _dir in {binmac,binwin}{,64-}2.7; do
+ for _dir in bin{mac,win,linux}{,64-}2.7; do
rm -rf ${_dir}
done
@@ -48,27 +72,11 @@ package()
rm -rf PyOpenGL-3.0.2a5.zip
)
- #Install gsas-2 files:
- cp -a $srcdir/${_pkgname}/* $pkgdir/opt/${_pkgname}
#Install Desktop files:
install -m 644 -D "$srcdir/GSASII.desktop" "$pkgdir/usr/share/applications/GSASII.desktop"
#Install and link executables:
- if [ "${CARCH}" == "i686" ]; then
- cat <<EOF > "$srcdir/rungsas2"
-#!/bin/bash
-LD_LIBRARY_PATH="\${LD_LIBRARY_PATH}:/usr/lib/gcc/i686-pc-linux-gnu/5.4.0"
-python2 /opt/gsas2/GSASII.py
-EOF
- else
- cat <<EOF > "$srcdir/rungsas2"
-#!/bin/bash
-LD_LIBRARY_PATH="\${LD_LIBRARY_PATH}:/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0"
-python2 /opt/gsas2/GSASII.py
-EOF
- fi
-
cp "$srcdir/rungsas2" "$pkgdir/opt/gsas2/${_pkgname}"
chmod +x "$pkgdir/opt/${_pkgname}/gsas2"
diff --git a/SConstruct.patch b/SConstruct.patch
new file mode 100644
index 00000000000..2cf6a5662a9
--- /dev/null
+++ b/SConstruct.patch
@@ -0,0 +1,58 @@
+--- SConstruct-orig 2017-07-06 21:08:39.461528997 +0200
++++ SConstruct 2017-07-06 21:08:22.381529305 +0200
+@@ -37,22 +37,22 @@
+ for pth in [F2PYpath,spath,os.path.normpath(os.path.join(spath,'..')),os.path.join(spath,'Scripts')]:
+ if not pth: continue
+ if sys.platform == "win32":
+- program = 'f2py.exe'
++ program = 'f2py2.exe'
+ else:
+- program = 'f2py'
++ program = 'f2py2'
+ f2pyprogram = os.path.join(pth,program)
+ if is_exe(f2pyprogram):
+ F2PYpath,F2PYprog = os.path.split(f2pyprogram)
+ break
+- program = 'f2py.py'
++ program = 'f2py2.py'
+ f2pyprogram = os.path.join(pth,program)
+ if os.path.exists(f2pyprogram) and os.path.splitext(program)[1] == '.py':
+ F2PYpath,F2PYprog = os.path.split(f2pyprogram)
+ break
+ else:
+ print 'Note: Using f2py from path (hope that works!)'
+- F2PYpath = which_path('f2py') # default path to f2py
+- F2PYprog = 'f2py'
++ F2PYpath = which_path('f2py2') # default path to f2py
++ F2PYprog = 'f2py2'
+ # check if we have a working path to f2py:
+ f2pyprogram = os.path.normpath(os.path.join(F2PYpath,F2PYprog))
+ if os.path.exists(f2pyprogram) and os.path.splitext(program)[1] == '.py':
+@@ -169,16 +169,17 @@
+ # that on Windows it may be in the parent of the f2py location.
+ # then run it to get info about the verision and the number of bits
+ pythonpath = ''
+-for program in ['python','../python']:
+- if sys.platform == "win32" and os.path.splitext(program)[1].lower() != '.exe':
+- program = program + '.exe'
+- pythonprogram = os.path.normpath(os.path.join(F2PYpath,program))
+- if is_exe(pythonprogram):
+- pythonpath = os.path.split(program)[0]
+- break
+-else:
+- print 'python not found'
+- sys.exit()
++# for program in ['python2','../python2']:
++# if sys.platform == "win32" and os.path.splitext(program)[1].lower() != '.exe':
++# program = program + '.exe'
++# pythonprogram = os.path.normpath(os.path.join(F2PYpath,program))
++# if is_exe(pythonprogram):
++# pythonpath = os.path.split(program)[0]
++# break
++# else:
++# print 'python not found'
++# sys.exit()
++pythonprogram = '/usr/bin/python2'
+ p = subprocess.Popen(pythonprogram, stdout=subprocess.PIPE, stdin=subprocess.PIPE)
+ p.stdin.write("import sys,platform;print str(sys.version_info[0]);print str(sys.version_info[1]);print platform.architecture()[0];sys.exit()")
+ p.stdin.close()
diff --git a/rungsas2 b/rungsas2
new file mode 100644
index 00000000000..c21de3d6972
--- /dev/null
+++ b/rungsas2
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+python2 /opt/gsas2/GSASII.py