The package rpms/gdl.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/gdl.git/commit/?id=dca5c8f3f4ee7f....
Change:
+%ifnarch i686 ppc64 s390x armv7hl aarch64
Thanks.
Full change:
============
commit a3ace54c72747616403b5bc26b32bbc55058d998
Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Sun Feb 17 09:30:50 2019 +0100
Rebuild for readline 8.0
diff --git a/gdl.spec b/gdl.spec
index 8e242d9..5cfa4fd 100644
--- a/gdl.spec
+++ b/gdl.spec
@@ -3,7 +3,7 @@
Name: gdl
Version: 0.9.9
-Release: 4%{?dist}
+Release: 5%{?dist}
Summary: GNU Data Language
License: GPLv2+
@@ -300,6 +300,9 @@ cat xorg.log
%changelog
+* Sun Feb 17 2019 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 0.9.9-5
+- Rebuild for readline 8.0
+
* Wed Feb 13 2019 Orion Poplawski <orion(a)nwra.com> - 0.9.9-4
- Use eccodes where available
- Add patches to fix build
commit dca5c8f3f4ee7fecd389e26bd367fef063f8a3ca
Author: Orion Poplawski <orion(a)nwra.com>
Date: Wed Feb 13 14:04:38 2019 -0700
Use eccodes where available
Add patches to fix build
Use cmake3 for EPEL7 compat
diff --git a/gdl-antlr-grammar.patch b/gdl-antlr-grammar.patch
new file mode 100644
index 0000000..c02383d
--- /dev/null
+++ b/gdl-antlr-grammar.patch
@@ -0,0 +1,112 @@
+diff --git a/src/gdlc.i.g b/src/gdlc.i.g
+index e66902d..1c648c8 100644
+--- a/src/gdlc.i.g
++++ b/src/gdlc.i.g
+@@ -170,7 +170,7 @@ public:
+ static bool SearchCompilePro(const std::string& pro, bool searchForPro);
+ static int GetFunIx( ProgNodeP);
+ static int GetFunIx( const std::string& subName);
+- static int GetProIx( ProgNodeP);//const std::string& subName);
++ static int GetProIx( ProgNodeP, bool throwImmediately=false);//const
std::string& subName);
+ static int GetProIx( const std::string& subName);
+ DStructGDL* ObjectStruct( DObjGDL* self, ProgNodeP mp);
+ void SetRootR( ProgNodeP tt, DotAccessDescT* aD, BaseGDL* r, ArrayIndexListT* aL);
+@@ -184,7 +184,7 @@ public:
+
+ private:
+
+- static void SetProIx( ProgNodeP f); // triggers read/compile
++ static void SetProIx( ProgNodeP f, bool throwImmediately=false); // triggers
read/compile
+ static void AdjustTypes( BaseGDL*&, BaseGDL*&);
+
+
+@@ -979,18 +979,6 @@ interactive returns[ RetCode retCode]
+ )+
+ ;
+
+-// execute statement
+-execute returns[ RetCode retCode]
+-{
+-// RetCode retCode;
+- ValueGuard<bool> guard( interruptEnable);
+- interruptEnable = false;
+-
+- return statement_list(_t);
+-}
+- : retCode=statement_list
+- ;
+-
+ // used to call functions
+ // same as statement list, but different behaviour for returncodes
+ call_fun returns[ BaseGDL* res]
+@@ -1083,24 +1071,7 @@ call_pro
+ ;
+
+
+-// used on many occasions
+-statement_list returns[ RetCode retCode]
+-{
+- for (; _t != NULL;) {
+-
+- retCode=statement(_t);
+- _t = _retTree;
+-
+- if( retCode != RC_OK) break; // break out if non-regular
+- }
+- _retTree = _t;
+- return retCode;
+-}
+- : (retCode=statement
+- )+
+- ;
+-
+-statement returns[ RetCode retCode]
++statement [bool throwImmediately=false] returns[ RetCode retCode]
+ {
+ // ProgNodeP& actPos = statement_AST_in;
+ assert( _t != NULL);
+@@ -1121,7 +1092,7 @@ statement returns[ RetCode retCode]
+ // track actual line number
+ callStack.back()->SetLineNumber( last->getLine());
+
+- retCode = last->Run(); // Run() sets _retTree
++ retCode = last->Run(throwImmediately); // Run() sets _retTree
+
+ }
+ while(
+@@ -1456,6 +1427,35 @@ statement returns[ RetCode retCode]
+ } // catch [ GDLException& e]
+
+
++// used on many occasions
++statement_list [bool throwImmediately=false] returns[ RetCode retCode]
++{
++ for (; _t != NULL;) {
++
++ retCode=statement(_t, throwImmediately);
++ _t = _retTree;
++
++ if( retCode != RC_OK) break; // break out if non-regular
++ }
++ _retTree = _t;
++ return retCode;
++}
++ : (retCode=statement[throwImmediately]
++ )+
++ ;
++
++// execute statement
++execute [bool throwImmediately=false] returns[ RetCode retCode]
++{
++// RetCode retCode;
++ ValueGuard<bool> guard( interruptEnable);
++ interruptEnable = false;
++
++// return statement_list(_t, throwImmediately);
++}
++ : retCode=statement_list[throwImmediately]
++ ;
++
+
+
+
diff --git a/gdl-std.patch b/gdl-std.patch
new file mode 100644
index 0000000..b290bd8
--- /dev/null
+++ b/gdl-std.patch
@@ -0,0 +1,64 @@
+diff -up gdl-0.9.9/src/dSFMT/dSFMT-common.h.std gdl-0.9.9/src/dSFMT/dSFMT-common.h
+--- gdl-0.9.9/src/dSFMT/dSFMT-common.h.std 2018-12-01 07:19:52.000000000 -0700
++++ gdl-0.9.9/src/dSFMT/dSFMT-common.h 2019-02-12 21:32:20.568719598 -0700
+@@ -44,25 +44,25 @@ static const union X128I_T sse2_param_ma
+ #if defined(HAVE_ALTIVEC)
+ inline static void do_recursion(w128_t *r, w128_t *a, w128_t * b,
+ w128_t *lung) {
+- const vector unsigned char sl1 = ALTI_SL1;
+- const vector unsigned char sl1_perm = ALTI_SL1_PERM;
+- const vector unsigned int sl1_msk = ALTI_SL1_MSK;
+- const vector unsigned char sr1 = ALTI_SR;
+- const vector unsigned char sr1_perm = ALTI_SR_PERM;
+- const vector unsigned int sr1_msk = ALTI_SR_MSK;
+- const vector unsigned char perm = ALTI_PERM;
+- const vector unsigned int msk1 = ALTI_MSK;
+- vector unsigned int w, x, y, z;
++ const __vector unsigned char sl1 = ALTI_SL1;
++ const __vector unsigned char sl1_perm = ALTI_SL1_PERM;
++ const __vector unsigned int sl1_msk = ALTI_SL1_MSK;
++ const __vector unsigned char sr1 = ALTI_SR;
++ const __vector unsigned char sr1_perm = ALTI_SR_PERM;
++ const __vector unsigned int sr1_msk = ALTI_SR_MSK;
++ const __vector unsigned char perm = ALTI_PERM;
++ const __vector unsigned int msk1 = ALTI_MSK;
++ __vector unsigned int w, x, y, z;
+
+ z = a->s;
+ w = lung->s;
+- x = vec_perm(w, (vector unsigned int)perm, perm);
+- y = vec_perm(z, (vector unsigned int)sl1_perm, sl1_perm);
++ x = vec_perm(w, (__vector unsigned int)perm, perm);
++ y = vec_perm(z, (__vector unsigned int)sl1_perm, sl1_perm);
+ y = vec_sll(y, sl1);
+ y = vec_and(y, sl1_msk);
+ w = vec_xor(x, b->s);
+ w = vec_xor(w, y);
+- x = vec_perm(w, (vector unsigned int)sr1_perm, sr1_perm);
++ x = vec_perm(w, (__vector unsigned int)sr1_perm, sr1_perm);
+ x = vec_srl(x, sr1);
+ x = vec_and(x, sr1_msk);
+ y = vec_and(w, msk1);
+diff -up gdl-0.9.9/src/dSFMT/dSFMT.h.std gdl-0.9.9/src/dSFMT/dSFMT.h
+--- gdl-0.9.9/src/dSFMT/dSFMT.h.std 2018-12-01 07:19:52.000000000 -0700
++++ gdl-0.9.9/src/dSFMT/dSFMT.h 2019-02-12 21:31:11.001860961 -0700
+@@ -143,7 +143,7 @@ extern "C" {
+
+ /** 128-bit data structure */
+ union W128_T {
+- vector unsigned int s;
++ __vector unsigned int s;
+ uint64_t u[2];
+ uint32_t u32[4];
+ double d[2];
+diff -up gdl-0.9.9/src/randomgenerators.cpp.std gdl-0.9.9/src/randomgenerators.cpp
+--- gdl-0.9.9/src/randomgenerators.cpp.std 2018-12-01 07:19:52.000000000 -0700
++++ gdl-0.9.9/src/randomgenerators.cpp 2019-02-12 21:31:11.002860973 -0700
+@@ -35,7 +35,6 @@
+
+ namespace lib {
+
+- using namespace std;
+ #ifdef USE_EIGEN
+ /* following are some modified codes taken from the GNU Scientific Library.
+ *
diff --git a/gdl.spec b/gdl.spec
index 357b5f5..8e242d9 100644
--- a/gdl.spec
+++ b/gdl.spec
@@ -3,7 +3,7 @@
Name: gdl
Version: 0.9.9
-Release: 3%{?dist}
+Release: 4%{?dist}
Summary: GNU Data Language
License: GPLv2+
@@ -16,8 +16,15 @@ Source4: xorg.conf
# Build with system antlr library. Request for upstream change here:
#
https://sourceforge.net/tracker/index.php?func=detail&aid=2685215&...
Patch1: gdl-antlr.patch
+# Support python3
#
https://github.com/gnudatalanguage/gdl/pull/468
Patch2: gdl-python3.patch
+# Update ANTLR .g file to match upstream changes
+#
https://github.com/gnudatalanguage/gdl/pull/529
+Patch3: gdl-antlr-grammar.patch
+# Fix conflict with std::vector and ALTIVEC vector
+#
https://github.com/gnudatalanguage/gdl/pull/535
+Patch4: gdl-std.patch
#RHEL5 doesn't have the needed antlr version/headers, has old plplot
%if 0%{?rhel} == 5
@@ -45,14 +52,20 @@ BuildRequires: python2-devel, python2-numpy, python2-matplotlib
%endif
BuildRequires: fftw-devel, hdf-static
%if 0%{?fedora}
-%if 0%{?fedora} >= 28
+# eccodes not available on these arches
+%ifnarch i686 ppc64 s390x armv7hl
BuildRequires: eccodes-devel
%else
BuildRequires: grib_api-devel
%endif
%else
+# eccodes not available on these arches
+%ifnarch i686 ppc64 s390x armv7hl aarch64
+BuildRequires: eccodes-devel
+%else
BuildRequires: grib_api-static
%endif
+%endif
BuildRequires: eigen3-static
BuildRequires: libgeotiff-devel
BuildRequires: libtiff-devel
@@ -67,7 +80,7 @@ BuildRequires: qhull-devel
%endif
BuildRequires: udunits2-devel
BuildRequires: wxGTK3-devel
-BuildRequires: cmake
+BuildRequires: cmake3
# For tests
BuildRequires: xorg-x11-drv-dummy
BuildRequires: metacity
@@ -132,6 +145,8 @@ Provides: %{name}-runtime = %{version}-%{release}
rm -rf src/antlr
%patch1 -p1 -b .antlr
%patch2 -p1 -b .python3
+%patch3 -p1 -b .antlr-grammar
+%patch4 -p1 -b .std
pushd src
for f in *.g
@@ -165,12 +180,12 @@ popd
mkdir build build-python
#Build the standalone executable
pushd build
-%{cmake} %{cmake_opts} ..
+%cmake3 %{cmake_opts} ..
make #{?_smp_mflags}
popd
#Build the python module
pushd build-python
-%{cmake} %{cmake_opts} -DPYTHON_MODULE=ON ..
+%cmake3 %{cmake_opts} -DPYTHON_MODULE=ON ..
make #{?_smp_mflags}
popd
@@ -218,6 +233,7 @@ sleep 2
# bytscl -
https://github.com/gnudatalanguage/gdl/issues/159
# fft_leak -
https://github.com/gnudatalanguage/gdl/issues/147
# file_delete -
https://github.com/gnudatalanguage/gdl/issues/148
+# file_test -
https://github.com/gnudatalanguage/gdl/issues/534
# fix -
https://github.com/gnudatalanguage/gdl/issues/149
# formats -
https://github.com/gnudatalanguage/gdl/issues/144
# n_tags -
https://github.com/gnudatalanguage/gdl/issues/150
@@ -225,7 +241,7 @@ sleep 2
# resolve_routine -
https://github.com/gnudatalanguage/gdl/issues/146
# rounding -
https://github.com/gnudatalanguage/gdl/issues/154
# total -
https://github.com/gnudatalanguage/gdl/issues/155
-failing_tests='test_(bytscl|fft_leak|file_delete|finite|fix|formats|idlneturl|make_dll|n_tags|parse_url|resolve_routine|rounding|total)'
+failing_tests='test_(bytscl|fft_leak|file_(delete|test)|finite|fix|formats|idlneturl|make_dll|n_tags|parse_url|resolve_routine|rounding|total)'
%ifarch aarch64 ppc %{power64}
# test_fix fails currently on arm
#
https://sourceforge.net/p/gnudatalanguage/bugs/622/
@@ -251,10 +267,10 @@
failing_tests="$failing_tests|test_(file_lines|indgen|list|save_restore|wait|win
%endif
%ifarch ppc64le
# ppc64le - test_file_lines
https://github.com/gnudatalanguage/gdl/issues/373
-failing_tests="$failing_tests|test_(file_lines|indgen|list)"
+failing_tests="$failing_tests|test_(angles|container|file_lines|hist_2d|indgen|list|random)"
%endif
%ifarch s390x
-failing_tests="$failing_tests|test_(file_lines|indgen|list|save_restore|window_background)"
+failing_tests="$failing_tests|test_(bug_635|file_lines|indgen|list|save_restore|window_background)"
%endif
make check VERBOSE=1 ARGS="-V -E '$failing_tests'"
%ifnarch ppc64 s390x
@@ -284,6 +300,11 @@ cat xorg.log
%changelog
+* Wed Feb 13 2019 Orion Poplawski <orion(a)nwra.com> - 0.9.9-4
+- Use eccodes where available
+- Add patches to fix build
+- Use cmake3 for EPEL7 compat
+
* Wed Feb 13 2019 Orion Poplawski <orion(a)nwra.com> - 0.9.9-3
- Rebuild for plplot 5.14
commit 8ad36df8612206a26fce338bffa6e08e431ecde1
Author: Orion Poplawski <orion(a)nwra.com>
Date: Tue Feb 12 19:07:07 2019 -0700
Rebuild for plplot 5.14
diff --git a/gdl.spec b/gdl.spec
index 63f4d2f..357b5f5 100644
--- a/gdl.spec
+++ b/gdl.spec
@@ -3,7 +3,7 @@
Name: gdl
Version: 0.9.9
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: GNU Data Language
License: GPLv2+
@@ -284,6 +284,9 @@ cat xorg.log
%changelog
+* Wed Feb 13 2019 Orion Poplawski <orion(a)nwra.com> - 0.9.9-3
+- Rebuild for plplot 5.14
+
* Thu Jan 31 2019 Fedora Release Engineering <releng(a)fedoraproject.org> - 0.9.9-2
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
commit 5bb7723eb752b8f4a8d7cf8b5bc8aab0e589a8b7
Author: Fedora Release Engineering <releng(a)fedoraproject.org>
Date: Thu Jan 31 20:43:36 2019 +0000
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng(a)fedoraproject.org>
diff --git a/gdl.spec b/gdl.spec
index 718c6a2..63f4d2f 100644
--- a/gdl.spec
+++ b/gdl.spec
@@ -3,7 +3,7 @@
Name: gdl
Version: 0.9.9
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: GNU Data Language
License: GPLv2+
@@ -284,6 +284,9 @@ cat xorg.log
%changelog
+* Thu Jan 31 2019 Fedora Release Engineering <releng(a)fedoraproject.org> - 0.9.9-2
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
+
* Sat Dec 1 2018 Orion Poplawski <orion(a)nwra.com> - 0.9.9-1
- Update to 0.9.9
commit c5b275e858313d428fb6cc8de8c31e77d80b859f
Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Mon Jan 28 20:17:45 2019 +0100
Remove obsolete Group tag
References:
https://fedoraproject.org/wiki/Changes/Remove_Group_Tag
diff --git a/gdl.spec b/gdl.spec
index d8a8310..718c6a2 100644
--- a/gdl.spec
+++ b/gdl.spec
@@ -6,7 +6,6 @@ Version: 0.9.9
Release: 1%{?dist}
Summary: GNU Data Language
-Group: Applications/Engineering
License: GPLv2+
URL:
http://gnudatalanguage.sourceforge.net/
Source0:
https://github.com/gnudatalanguage/gdl/archive/v%{version}/gdl-%{version}...
@@ -88,7 +87,6 @@ Systems Inc.
%package common
Summary: Common files for GDL
-Group: Applications/Engineering
Requires: %{name}-runtime = %{version}-%{release}
BuildArch: noarch
@@ -104,7 +102,6 @@ Provides: %{name}-python = %{version}-%{release}
Provides: %{name}-python%{?_isa} = %{version}-%{release}
Obsoletes: %{name}-python < %{version}-%{release}
Summary: GDL python module
-Group: Applications/Engineering
# Needed to pull in drivers
Requires: plplot
Requires: %{name}-common = %{version}-%{release}
@@ -120,7 +117,6 @@ Provides: %{name}-python = %{version}-%{release}
Provides: %{name}-python%{?_isa} = %{version}-%{release}
Obsoletes: %{name}-python < %{version}-%{release}
Summary: GDL python module
-Group: Applications/Engineering
# Needed to pull in drivers
Requires: plplot
Requires: %{name}-common = %{version}-%{release}
commit e813a1fe0fc4eeb8dac1bdb9b57b6001cbca43d2
Author: Orion Poplawski <orion(a)cora.nwra.com>
Date: Sat Dec 1 09:45:49 2018 -0700
Update to 0.9.9
diff --git a/.gitignore b/.gitignore
index 55972b5..6d423c3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,3 +11,4 @@ gdl-0.9rc4.tar.gz
/gdl-0.9.8.tgz
/gdl-0.9.8-git-f3b6e01.tar.gz
/gdl-0.9.8-git-d892ee5.tar.gz
+/gdl-0.9.9.tar.gz
diff --git a/gdl.spec b/gdl.spec
index 809c436..d8a8310 100644
--- a/gdl.spec
+++ b/gdl.spec
@@ -2,15 +2,15 @@
%global shortcommit %(c=%{commit}; echo ${c:0:7})
Name: gdl
-Version: 0.9.8
-Release: 7%{?dist}.20180919git%{shortcommit}
+Version: 0.9.9
+Release: 1%{?dist}
Summary: GNU Data Language
Group: Applications/Engineering
License: GPLv2+
URL:
http://gnudatalanguage.sourceforge.net/
-#Source0:
http://downloads.sourceforge.net/gnudatalanguage/%{name}-%{version}.tgz
-Source0:
https://github.com/gnudatalanguage/gdl/archive/%{commit}/gdl-%{version}-g...
+Source0:
https://github.com/gnudatalanguage/gdl/archive/v%{version}/gdl-%{version}...
+#Source0:
https://github.com/gnudatalanguage/gdl/archive/%{commit}/gdl-%{version}-g...
Source1: gdl.csh
Source2: gdl.sh
Source4: xorg.conf
@@ -132,7 +132,7 @@ Provides: %{name}-runtime = %{version}-%{release}
%prep
-%setup -q -n %{name}-%{commit}
+%setup -q
rm -rf src/antlr
%patch1 -p1 -b .antlr
%patch2 -p1 -b .python3
@@ -288,6 +288,9 @@ cat xorg.log
%changelog
+* Sat Dec 1 2018 Orion Poplawski <orion(a)nwra.com> - 0.9.9-1
+- Update to 0.9.9
+
* Wed Oct 31 2018 Orion Poplawski <orion(a)nwra.com> - 0.9.8-7.20180919gitd892ee5
- Really use eccodes by fixing typo (bug #1644928)
diff --git a/sources b/sources
index b554740..e6f087c 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (gdl-0.9.8-git-d892ee5.tar.gz) =
174dcb8a63903aa35a120459981e985bf813d0cebb576fd771b49e6101e76391a94535744c09edd75917ad3d7b3729ba21875671cceb42c3e6f0afef853a5ff2
+SHA512 (gdl-0.9.9.tar.gz) =
41709c4951bbf71f7494eb339b6760756301b89b591020cb5a30c47d3b6f6228671a7d75b817e77f3ff6f1380505d27949e2900eb2577167de995f4941f288ee
commit bd80a68b2d70e505f6600eda9b38ba31b6a2dc98
Author: Orion Poplawski <orion(a)nwra.com>
Date: Wed Oct 31 17:18:10 2018 -0600
Really use eccodes by fixing typo (bug #1644928)
diff --git a/gdl.spec b/gdl.spec
index fd11c1d..809c436 100644
--- a/gdl.spec
+++ b/gdl.spec
@@ -3,7 +3,7 @@
Name: gdl
Version: 0.9.8
-Release: 6%{?dist}.20180919git%{shortcommit}
+Release: 7%{?dist}.20180919git%{shortcommit}
Summary: GNU Data Language
Group: Applications/Engineering
@@ -47,10 +47,10 @@ BuildRequires: python2-devel, python2-numpy, python2-matplotlib
BuildRequires: fftw-devel, hdf-static
%if 0%{?fedora}
%if 0%{?fedora} >= 28
-%else
BuildRequires: eccodes-devel
-%endif
+%else
BuildRequires: grib_api-devel
+%endif
%else
BuildRequires: grib_api-static
%endif
@@ -288,6 +288,9 @@ cat xorg.log
%changelog
+* Wed Oct 31 2018 Orion Poplawski <orion(a)nwra.com> - 0.9.8-7.20180919gitd892ee5
+- Really use eccodes by fixing typo (bug #1644928)
+
* Thu Sep 20 2018 Orion Poplawski <orion(a)nwra.com> - 0.9.8-6.20180919gitd892ee5
- Update to latest git
- Port to python 3
commit 2cd4ad64e32dd86bcd8430c250fd16caf658805d
Author: Orion Poplawski <orion(a)cora.nwra.com>
Date: Wed Sep 26 19:47:36 2018 -0600
No need to move GDL.so when %_lib == lib
diff --git a/gdl.spec b/gdl.spec
index 18a8a03..fd11c1d 100644
--- a/gdl.spec
+++ b/gdl.spec
@@ -188,11 +188,14 @@ make install DESTDIR=$RPM_BUILD_ROOT
# Install the python module in the right location
install -d -m 0755 $RPM_BUILD_ROOT/%{python_sitearch}
%if 0%{?fedora} >= 29
+%if %{_lib} != "lib"
mv $RPM_BUILD_ROOT%{_prefix}/lib/python*/site-packages/GDL.so \
+ $RPM_BUILD_ROOT%{python_sitearch}/GDL.so
+%endif
%else
mv $RPM_BUILD_ROOT%{_prefix}/lib/site-python/GDL.so \
-%endif
$RPM_BUILD_ROOT%{python_sitearch}/GDL.so
+%endif
popd
# Install the profile file to set GDL_PATH
commit 624b847dd4b8c78ac03d4f63c4f323e55ae14e24
Author: Orion Poplawski <orion(a)cora.nwra.com>
Date: Thu Sep 20 21:59:17 2018 -0600
Update to latest git
Port to python 3
diff --git a/.gitignore b/.gitignore
index cf56935..55972b5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,3 +10,4 @@ gdl-0.9rc4.tar.gz
/gdl-0.9.7.tgz
/gdl-0.9.8.tgz
/gdl-0.9.8-git-f3b6e01.tar.gz
+/gdl-0.9.8-git-d892ee5.tar.gz
diff --git a/gdl-python3.patch b/gdl-python3.patch
new file mode 100644
index 0000000..8327f6b
--- /dev/null
+++ b/gdl-python3.patch
@@ -0,0 +1,182 @@
+diff --git a/src/datatypes.cpp b/src/datatypes.cpp
+index 1a8d126..e8b08a1 100644
+--- a/src/datatypes.cpp
++++ b/src/datatypes.cpp
+@@ -18,6 +18,7 @@
+ #include "includefirst.hpp"
+
+ #if defined(USE_PYTHON) || defined(PYTHON_MODULE)
++#include <patchlevel.h>
+ #include <numpy/arrayobject.h>
+ #endif
+
+diff --git a/src/gdlpython.cpp b/src/gdlpython.cpp
+index 7835ec9..dd17598 100644
+--- a/src/gdlpython.cpp
++++ b/src/gdlpython.cpp
+@@ -32,18 +32,32 @@
+
+ using namespace std;
+
++#if PY_MAJOR_VERSION >= 3
++int PythonInit()
++{
++ if( Py_IsInitialized()) return NULL;
++#else
+ void PythonInit()
+ {
+ if( Py_IsInitialized()) return;
++#endif
+ Py_Initialize(); // signal handlers?
+
+ static int argc = 1;
++#if PY_MAJOR_VERSION >= 3
++ static wchar_t* arg0 = Py_DecodeLocale("./py/python.exe",NULL);
++ static wchar_t* argv[] = {arg0};
++#else
+ static char* arg0 = (char*)"./py/python.exe";
+ static char* argv[] = {arg0};
++#endif
+ PySys_SetArgv(argc, argv);
+
+ //
http://docs.scipy.org/doc/numpy/reference/c-api.array.html#miscellaneous
+ import_array();
++#if PY_MAJOR_VERSION >= 3
++ return NULL;
++#endif
+ }
+
+ void PythonEnd()
+@@ -71,6 +85,12 @@ BaseGDL* FromPython( PyObject* pyObj)
+ {
+ if( !PyArray_Check( pyObj))
+ {
++#if PY_MAJOR_VERSION >= 3
++ if( PyUnicode_Check( pyObj))
++ {
++ return new DStringGDL( PyUnicode_AsUTF8( pyObj));
++ }
++#else
+ if( PyString_Check( pyObj))
+ {
+ return new DStringGDL( PyString_AsString( pyObj));
+@@ -79,6 +99,7 @@ BaseGDL* FromPython( PyObject* pyObj)
+ {
+ return new DLongGDL( PyInt_AsLong( pyObj));
+ }
++#endif
+ if( PyLong_Check( pyObj))
+ {
+ return new DLongGDL( PyLong_AsLong( pyObj));
+@@ -174,11 +195,19 @@ namespace lib {
+ e->Throw( "ARGV keyword must be of type STRING.");
+
+ int argc = argvS->N_Elements();
++#if PY_MAJOR_VERSION >= 3
++ wchar_t** argv = new wchar_t*[ argc];
++#else
+ char** argv = new char*[ argc];
++#endif
+
+- // pyhton copies the value -> threats it as const
++ // python copies the value -> treats it as const
+ for( int i=0; i<argc; ++i)
++#if PY_MAJOR_VERSION >= 3
++ argv[i] = Py_DecodeLocale(const_cast<char*>((*argvS)[ i].c_str()), NULL);
++#else
+ argv[i] = const_cast<char*>((*argvS)[ i].c_str());
++#endif
+
+ PySys_SetArgv(argc, argv);
+ delete[] argv;
+diff --git a/src/gdlpython.hpp b/src/gdlpython.hpp
+index 45ef436..cb53bd7 100644
+--- a/src/gdlpython.hpp
++++ b/src/gdlpython.hpp
+@@ -18,7 +18,11 @@
+ #ifndef GDLPYTHON_HPP_
+ #define GDLPYTHON_HPP_
+
++#if PY_MAJOR_VERSION >= 3
++int PythonInit();
++#else
+ void PythonInit();
++#endif
+ void PythonEnd();
+ BaseGDL* FromPython( PyObject* pyObj);
+
+diff --git a/src/pythongdl.cpp b/src/pythongdl.cpp
+index a3b5afd..e541ba5 100644
+--- a/src/pythongdl.cpp
++++ b/src/pythongdl.cpp
+@@ -191,14 +191,22 @@ bool CopyArgFromPython( vector<BaseGDL*>& parRef,
+ for( SizeT k=0; k<nKW; ++k)
+ {
+ PyDict_Next( kwDict, &dictPos, &key, &value);
++#if PY_MAJOR_VERSION >= 3
++ int keyIsString = PyUnicode_Check( key);
++#else
+ int keyIsString = PyString_Check( key);
++#endif
+ if( !keyIsString)
+ {
+ PyErr_SetString( gdlError,
+ "Keywords must be of type string");
+ return false;
+ }
++#if PY_MAJOR_VERSION >= 3
++ const char* keyChar = PyUnicode_AsUTF8( key);
++#else
+ const char* keyChar = PyString_AsString( key);
++#endif
+ string keyString = StrUpCase( keyChar);
+ int kwIx = e.GetPro()->FindKey( keyString);
+ if( kwIx == -1)
+@@ -523,6 +531,35 @@ extern "C" {
+ {NULL, NULL, 0, NULL} // Sentinel
+ };
+
++#if PY_MAJOR_VERSION >= 3
++ struct module_state {
++ PyObject *error;
++ };
++
++ #define GETSTATE(m) ((struct module_state*)PyModule_GetState(m))
++
++ static int GDL_traverse(PyObject *m, visitproc visit, void *arg) {
++ Py_VISIT(GETSTATE(m)->error);
++ return 0;
++ }
++
++ static int GDL_clear(PyObject *m) {
++ Py_CLEAR(GETSTATE(m)->error);
++ return 0;
++ }
++
++ static struct PyModuleDef moduledef = {
++ PyModuleDef_HEAD_INIT,
++ "GDL",
++ NULL,
++ sizeof(struct module_state),
++ GDLMethods,
++ NULL,
++ GDL_traverse,
++ GDL_clear,
++ NULL
++ };
++#endif
+
+ // python GDL module init function
+ PyMODINIT_FUNC initGDL()
+@@ -552,7 +589,11 @@ extern "C" {
+ }
+ SysVar::SetGDLPath( gdlPath);
+
++#if PY_MAJOR_VERSION >= 3
++ PyObject* m = PyModule_Create(&moduledef);
++#else
+ PyObject* m = Py_InitModule("GDL", GDLMethods);
++#endif
+
+ gdlError = PyErr_NewException((char*)"GDL.error", NULL, NULL);
+ Py_INCREF(gdlError);
diff --git a/gdl.spec b/gdl.spec
index 8f06e8e..18a8a03 100644
--- a/gdl.spec
+++ b/gdl.spec
@@ -1,9 +1,9 @@
-%global commit f3b6e012ff645c93268cfb9da7f61792630c34ee
+%global commit d892ee54b710c645ec0bc75d4a0cb3118813daa6
%global shortcommit %(c=%{commit}; echo ${c:0:7})
Name: gdl
Version: 0.9.8
-Release: 5%{?dist}.20180723git%{shortcommit}
+Release: 6%{?dist}.20180919git%{shortcommit}
Summary: GNU Data Language
Group: Applications/Engineering
@@ -17,6 +17,8 @@ Source4: xorg.conf
# Build with system antlr library. Request for upstream change here:
#
https://sourceforge.net/tracker/index.php?func=detail&aid=2685215&...
Patch1: gdl-antlr.patch
+#
https://github.com/gnudatalanguage/gdl/pull/468
+Patch2: gdl-python3.patch
#RHEL5 doesn't have the needed antlr version/headers, has old plplot
%if 0%{?rhel} == 5
@@ -37,7 +39,11 @@ BuildRequires: java
BuildRequires: readline-devel, ncurses-devel
BuildRequires: gsl-devel, plplot-devel, GraphicsMagick-c++-devel
BuildRequires: netcdf-devel, hdf5-devel, libjpeg-devel
+%if 0%{?fedora} >= 29
+BuildRequires: python%{python3_pkgversion}-devel, python%{python3_pkgversion}-numpy,
python%{python3_pkgversion}-matplotlib
+%else
BuildRequires: python2-devel, python2-numpy, python2-matplotlib
+%endif
BuildRequires: fftw-devel, hdf-static
%if 0%{?fedora}
%if 0%{?fedora} >= 28
@@ -90,6 +96,23 @@ BuildArch: noarch
Common files for GDL
+%if 0%{?fedora} >= 29
+%package -n python%{python3_pkgversion}-gdl
+%{?python_provide:%python_provide python%{python3_pkgversion}-gdl}
+# Remove before F30
+Provides: %{name}-python = %{version}-%{release}
+Provides: %{name}-python%{?_isa} = %{version}-%{release}
+Obsoletes: %{name}-python < %{version}-%{release}
+Summary: GDL python module
+Group: Applications/Engineering
+# Needed to pull in drivers
+Requires: plplot
+Requires: %{name}-common = %{version}-%{release}
+Provides: %{name}-runtime = %{version}-%{release}
+
+%description -n python%{python3_pkgversion}-gdl
+%{summary}.
+%else
%package -n python2-gdl
%{?python_provide:%python_provide python2-gdl}
# Remove before F30
@@ -105,12 +128,14 @@ Provides: %{name}-runtime = %{version}-%{release}
%description -n python2-gdl
%{summary}.
+%endif
%prep
%setup -q -n %{name}-%{commit}
rm -rf src/antlr
%patch1 -p1 -b .antlr
+%patch2 -p1 -b .python3
pushd src
for f in *.g
@@ -119,6 +144,13 @@ do
done
popd
+%if 0%{?fedora} >= 29
+%global __python %{__python3}
+%global python_sitearch %{python3_sitearch}
+%else
+%global __python %{__python2}
+%global python_sitearch %{python2_sitearch}
+%endif
%global cmake_opts \\\
-DWXWIDGETS=ON \\\
-DGEOTIFF_INCLUDE_DIR=%{_includedir}/libgeotiff \\\
@@ -126,7 +158,7 @@ popd
-DUDUNITS_INCLUDE_DIR=%{_includedir}/udunits2 \\\
-DGRIB=ON \\\
-DOPENMP=ON \\\
- -DPYTHON_EXECUTABLE=%{_bindir}/python2 \\\
+ -DPYTHON_EXECUTABLE=%{__python} \\\
%{?cmake_qhull} \\\
%{nil}
# TODO - build an mpi version
@@ -154,8 +186,13 @@ popd
pushd build-python
make install DESTDIR=$RPM_BUILD_ROOT
# Install the python module in the right location
-install -d -m 0755 $RPM_BUILD_ROOT/%{python2_sitearch}
-mv $RPM_BUILD_ROOT%{_prefix}/lib/site-python/GDL.so
$RPM_BUILD_ROOT%{python2_sitearch}/GDL.so
+install -d -m 0755 $RPM_BUILD_ROOT/%{python_sitearch}
+%if 0%{?fedora} >= 29
+mv $RPM_BUILD_ROOT%{_prefix}/lib/python*/site-packages/GDL.so \
+%else
+mv $RPM_BUILD_ROOT%{_prefix}/lib/site-python/GDL.so \
+%endif
+ $RPM_BUILD_ROOT%{python_sitearch}/GDL.so
popd
# Install the profile file to set GDL_PATH
@@ -239,11 +276,19 @@ cat xorg.log
%files common
%{_datadir}/gnudatalanguage/
+%if 0%{?fedora} >= 29
+%files -n python%{python3_pkgversion}-gdl
+%else
%files -n python2-gdl
-%{python2_sitearch}/GDL.so
+%endif
+%{python_sitearch}/GDL.so
%changelog
+* Thu Sep 20 2018 Orion Poplawski <orion(a)nwra.com> - 0.9.8-6.20180919gitd892ee5
+- Update to latest git
+- Port to python 3
+
* Tue Jul 31 2018 Florian Weimer <fweimer(a)redhat.com> - 0.9.8-5.20180723gitf3b6e01
- Rebuild with fixed binutils
diff --git a/sources b/sources
index 950ef58..b554740 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (gdl-0.9.8-git-f3b6e01.tar.gz) =
da07cd62f36e8c392bb45952a77982a3d55c1b0740debfcb277576130983d882c0502056efab1700c7f495b920567f86a8740aae61341ea403e438c55f3d103c
+SHA512 (gdl-0.9.8-git-d892ee5.tar.gz) =
174dcb8a63903aa35a120459981e985bf813d0cebb576fd771b49e6101e76391a94535744c09edd75917ad3d7b3729ba21875671cceb42c3e6f0afef853a5ff2
commit 2a4c9f702da687a6c1ea40b02862993062c9edfc
Author: Florian Weimer <fweimer(a)redhat.com>
Date: Tue Jul 31 14:39:53 2018 +0200
Rebuild with fixed binutils
diff --git a/gdl.spec b/gdl.spec
index 342d5af..8f06e8e 100644
--- a/gdl.spec
+++ b/gdl.spec
@@ -3,7 +3,7 @@
Name: gdl
Version: 0.9.8
-Release: 4%{?dist}.20180723git%{shortcommit}
+Release: 5%{?dist}.20180723git%{shortcommit}
Summary: GNU Data Language
Group: Applications/Engineering
@@ -244,6 +244,9 @@ cat xorg.log
%changelog
+* Tue Jul 31 2018 Florian Weimer <fweimer(a)redhat.com> - 0.9.8-5.20180723gitf3b6e01
+- Rebuild with fixed binutils
+
* Mon Jul 23 2018 Orion Poplawski <orion(a)nwra.com> - 0.9.8-4.20180723gitf3b6e01
- Update to latest git
- Switch to eccodes from grib_api for Fedora 28+