summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartłomiej Piotrowski2018-01-06 21:54:39 +0100
committerBartłomiej Piotrowski2018-01-06 21:54:39 +0100
commit3430d9b5206f920f4e9eb9332611c80c6c114999 (patch)
treea6128abfb2e85e6c976b09bccb1ef42c587a5eca
downloadaur-3430d9b5206f920f4e9eb9332611c80c6c114999.tar.gz
Import from official repositories
-rw-r--r--.SRCINFO21
-rw-r--r--PKGBUILD39
-rw-r--r--grace-fftw3.patch258
3 files changed, 318 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..238748a1fcdc
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,21 @@
+pkgbase = grace
+ pkgdesc = 2D plotting tool
+ pkgver = 5.1.25
+ pkgrel = 6
+ url = http://plasma-gate.weizmann.ac.il/Grace/
+ arch = x86_64
+ license = GPL
+ depends = libjpeg
+ depends = libpng
+ depends = openmotif
+ depends = t1lib
+ depends = netcdf
+ depends = fftw
+ options = staticlibs
+ source = ftp://plasma-gate.weizmann.ac.il/pub/grace/src/grace5/grace-5.1.25.tar.gz
+ source = grace-fftw3.patch
+ md5sums = c0482b1f18b113192946a96f5ff35a4d
+ md5sums = 0c61460189e4d19713e59a84c28f23c2
+
+pkgname = grace
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..e341afead80f
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,39 @@
+# $Id: PKGBUILD 266875 2017-11-15 14:29:11Z foutrelis $
+# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
+# Maintainer: damir <damir@archlinux.org>
+# Contributor: Damir Perisa <damir.perisa@bluewin.ch>
+
+pkgname=grace
+pkgver=5.1.25
+pkgrel=6
+pkgdesc="2D plotting tool"
+arch=(x86_64)
+url="http://plasma-gate.weizmann.ac.il/Grace/"
+depends=('libjpeg' 'libpng' 'openmotif' 't1lib' 'netcdf' 'fftw')
+license=('GPL')
+options=('staticlibs')
+source=(ftp://plasma-gate.weizmann.ac.il/pub/grace/src/grace5/$pkgname-$pkgver.tar.gz grace-fftw3.patch)
+md5sums=('c0482b1f18b113192946a96f5ff35a4d'
+ '0c61460189e4d19713e59a84c28f23c2')
+
+prepare() {
+ cd $pkgname-$pkgver
+ sed -i '1,1i#include <zlib.h>' src/rstdrv.c
+ sed -i 's|png_ptr->jmpbuf|png_jmpbuf(png_ptr)|g' src/rstdrv.c
+ patch -p1 -i ../grace-fftw3.patch # port to FFTW3 (Debian)
+}
+
+build() {
+ cd "$srcdir"/$pkgname-$pkgver
+ ./configure --prefix=/usr --exec-prefix=/usr \
+ --enable-grace-home=/usr/share/grace \
+ --includedir=/usr/include --libdir=/usr/lib \
+ -with-helpviewer="firefox %s"
+ make
+}
+
+package() {
+ cd "$srcdir"/$pkgname-$pkgver
+ make DESTDIR="$pkgdir" install
+ (cd "$pkgdir"/usr/share/grace && mv bin lib include ../../)
+}
diff --git a/grace-fftw3.patch b/grace-fftw3.patch
new file mode 100644
index 000000000000..d964445255e7
--- /dev/null
+++ b/grace-fftw3.patch
@@ -0,0 +1,258 @@
+Description: Switch dependency from FFTW2 to FFTW3
+Author: Ionut Georgescu
+Bug: http://bugs.debian.org/264201
+Index: grace-5.1.24-patch/src/fourier.c
+===================================================================
+--- grace-5.1.24-patch.orig/src/fourier.c
++++ grace-5.1.24-patch/src/fourier.c
+@@ -230,7 +230,8 @@ static int bit_swap(int i, int nu)
+ #else
+ /* Start of new FFTW-based transforms by Marcus H. Mendenhall */
+
+-#include <fftw.h>
++#include <complex.h>
++#include <fftw3.h>
+ #include <string.h>
+
+ static char *wisdom_file=0;
+@@ -258,7 +259,7 @@ void dft(double *jr, double *ji, int n,
+ fftw_plan plan;
+ int i;
+ double ninv;
+- FFTW_COMPLEX *cbuf;
++ fftw_complex *cbuf;
+ static int wisdom_inited=0;
+ char *ram_cache_wisdom;
+ int plan_flags;
+@@ -274,7 +275,7 @@ void dft(double *jr, double *ji, int n,
+ if(wisdom_file && wisdom_file[0] ) {
+ /* if a file was specified in GRACE_FFTW_WISDOM_FILE, try to read it */
+ FILE *wf;
+- fftw_status fstat;
++ int fstat;
+ wf=fopen(wisdom_file,"r");
+ if(wf) {
+ fstat=fftw_import_wisdom_from_file(wf);
+@@ -286,30 +287,35 @@ void dft(double *jr, double *ji, int n,
+ }
+ }
+
+- plan_flags=using_wisdom? (FFTW_USE_WISDOM | FFTW_MEASURE) : FFTW_ESTIMATE;
+-
+- plan=fftw_create_plan(n, iflag?FFTW_BACKWARD:FFTW_FORWARD,
+- plan_flags | FFTW_IN_PLACE);
+- cbuf=xcalloc(n, sizeof(*cbuf));
++ /* fftw_malloc behaves like malloc except that it properly aligns the array
++ * when SIMD instructions (such as SSE and Altivec) are available.
++ */
++ cbuf=(fftw_complex *)fftw_malloc(n*sizeof(fftw_complex));
+ if(!cbuf) return;
++
+ for(i=0; i<n; i++) {
+- cbuf[i].re=jr[i]; cbuf[i].im=ji[i];
++ cbuf[i] = jr[i] + I * ji[i];
+ }
+- fftw(plan, 1, cbuf, 1, 1, 0, 1, 1);
++
++ plan_flags=using_wisdom? (FFTW_MEASURE) : FFTW_ESTIMATE;
++ plan=fftw_plan_dft_1d(n, cbuf, cbuf, iflag?FFTW_BACKWARD:FFTW_FORWARD,
++ plan_flags);
++
++ fftw_execute(plan);
+ fftw_destroy_plan(plan);
+
+ if(!iflag) {
+ ninv=1.0/n;
+ for(i=0; i<n; i++) {
+- jr[i]=cbuf[i].re*ninv; ji[i]=cbuf[i].im*ninv;
++ jr[i]=creal(cbuf[i])*ninv; ji[i]=cimag(cbuf[i])*ninv;
+ }
+ } else {
+ for(i=0; i<n; i++) {
+- jr[i]=cbuf[i].re; ji[i]=cbuf[i].im;
++ jr[i]=creal(cbuf[i]); ji[i]=cimag(cbuf[i]);
+ }
+ }
+
+- XCFREE(cbuf);
++ fftw_free(cbuf);
+
+ }
+
+Index: grace-5.1.24-patch/ac-tools/configure.in
+===================================================================
+--- grace-5.1.24-patch.orig/ac-tools/configure.in
++++ grace-5.1.24-patch/ac-tools/configure.in
+@@ -554,8 +554,17 @@ fi
+
+ if test $fftw = true
+ then
+- ACX_CHECK_FFTW(2.1.3, AC_DEFINE(HAVE_FFTW),
+- AC_MSG_RESULT(--> using legacy unoptimized FFT code))
++ AC_CHECK_HEADERS(fftw3.h,
++ [
++ AC_CHECK_LIB(fftw3, fftw_execute,
++ [
++ FFTW_LIB="-lfftw3"
++ AC_DEFINE(HAVE_FFTW)
++ ],
++ [AC_MSG_RESULT([--> using legacy unoptimized FFT code])]
++ )
++ ],
++ [AC_MSG_RESULT([--> using legacy unoptimized FFT code])])
+ fi
+
+ dnl **** check for libz - needed for PDF and PNG drivers and XmHTML
+Index: grace-5.1.24-patch/configure
+===================================================================
+--- grace-5.1.24-patch.orig/configure
++++ grace-5.1.24-patch/configure
+@@ -748,7 +748,6 @@ with_printcmd
+ enable_debug
+ enable_maintainer
+ with_netcdf_libraries
+-with_fftw_library
+ with_zlib_library
+ with_jpeg_library
+ with_png_library
+@@ -1412,7 +1411,6 @@ Optional Packages:
+ --with-helpviewer=COMMAND define help viewer command ["mozilla %s"]
+ --with-printcmd=PROG use PROG for printing
+ --with-netcdf-libraries=OBJ use OBJ as netCDF libraries [-lnetcdf]
+- --with-fftw-library=OBJ use OBJ as FFTW library [-lfftw]
+ --with-zlib-library=OBJ use OBJ as ZLIB library [-lz]
+ --with-jpeg-library=OBJ use OBJ as JPEG library [-ljpeg]
+ --with-png-library=OBJ use OBJ as PNG library [-lpng]
+@@ -8225,84 +8223,69 @@ fi
+
+ if test $fftw = true
+ then
++ for ac_header in fftw3.h
++do :
++ ac_fn_c_check_header_mongrel "$LINENO" "fftw3.h" "ac_cv_header_fftw3_h" "$ac_includes_default"
++if test "x$ac_cv_header_fftw3_h" = xyes; then :
++ cat >>confdefs.h <<_ACEOF
++#define HAVE_FFTW3_H 1
++_ACEOF
+
+-
+-# Check whether --with-fftw_library was given.
+-if test "${with_fftw_library+set}" = set; then :
+- withval=$with_fftw_library; fftw_library="$withval"
+-fi
+-
+- if test "x$fftw_library" = "x"
+- then
+- fftw_library=-lfftw
+- fi
+-
+- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FFTW library >= 2.1.3" >&5
+-$as_echo_n "checking for FFTW library >= 2.1.3... " >&6; }
+-if ${acx_cv_fftw+:} false; then :
++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fftw_execute in -lfftw3" >&5
++$as_echo_n "checking for fftw_execute in -lfftw3... " >&6; }
++if ${ac_cv_lib_fftw3_fftw_execute+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+- if ${acx_cv_fftw_library+:} false; then :
+- $as_echo_n "(cached) " >&6
+-else
+- acx_cv_fftw_library=$fftw_library
+-fi
+-
+-
+- save_CFLAGS=$CFLAGS
+- save_CPPFLAGS=$CPPFLAGS
+- save_LDFLAGS=$LDFLAGS
+- save_LIBS=$LIBS
+-
+- LIBS="$acx_cv_fftw_library $LIBS"
+- if test "$cross_compiling" = yes; then :
+- acx_cv_fftw="no"
+-
+-else
+- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++ ac_check_lib_save_LIBS=$LIBS
++LIBS="-lfftw3 $LIBS"
++cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+
+-#include <fftw.h>
+-#include <string.h>
+- int main(void) {
+- char *vlib = (char *) fftw_version;
+- if (strcmp(vlib, "2.1.3") < 0) {
+- exit(1);
+- }
+- exit(0);
+- }
+-
++/* Override any GCC internal prototype to avoid an error.
++ Use char because int might match the return type of a GCC
++ builtin and then its argument prototype would still apply. */
++#ifdef __cplusplus
++extern "C"
++#endif
++char fftw_execute ();
++int
++main ()
++{
++return fftw_execute ();
++ ;
++ return 0;
++}
+ _ACEOF
+-if ac_fn_c_try_run "$LINENO"; then :
+- acx_cv_fftw="yes"
++if ac_fn_c_try_link "$LINENO"; then :
++ ac_cv_lib_fftw3_fftw_execute=yes
+ else
+- acx_cv_fftw="no"
++ ac_cv_lib_fftw3_fftw_execute=no
+ fi
+-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+- conftest.$ac_objext conftest.beam conftest.$ac_ext
++rm -f core conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++LIBS=$ac_check_lib_save_LIBS
+ fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fftw3_fftw_execute" >&5
++$as_echo "$ac_cv_lib_fftw3_fftw_execute" >&6; }
++if test "x$ac_cv_lib_fftw3_fftw_execute" = xyes; then :
+
++ FFTW_LIB="-lfftw3"
++ $as_echo "#define HAVE_FFTW 1" >>confdefs.h
+
+
+- CFLAGS=$save_CFLAGS
+- CPPFLAGS=$save_CPPFLAGS
+- LDFLAGS=$save_LDFLAGS
+- LIBS=$save_LIBS
+-
++else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: --> using legacy unoptimized FFT code" >&5
++$as_echo "--> using legacy unoptimized FFT code" >&6; }
+
+ fi
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_cv_fftw" >&5
+-$as_echo "$acx_cv_fftw" >&6; }
+- if test "$acx_cv_fftw" = "yes"
+- then
+- FFTW_LIB="$acx_cv_fftw_library"
+- $as_echo "#define HAVE_FFTW 1" >>confdefs.h
+
+- else
+- FFTW_LIB=
+- { $as_echo "$as_me:${as_lineno-$LINENO}: result: --> using legacy unoptimized FFT code" >&5
++
++else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: --> using legacy unoptimized FFT code" >&5
+ $as_echo "--> using legacy unoptimized FFT code" >&6; }
+- fi
++fi
++
++done
+
+ fi
+
+