From c0794376da80d8e2d65f5ab0ec89b224c68162bf Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Sun, 15 Jan 2023 21:31:32 -0700 Subject: [PATCH] Update to 1.0.2 Use SPDX License tag Skip failing test on s390x --- .gitignore | 1 + 1486.patch | 174 ++++++++++++++++++++++++++++++++++++++++++++++++ gdl-antlr.patch | 18 ++--- gdl-size.patch | 58 ++++++++++++++++ gdl.spec | 31 ++++++--- sources | 2 +- 6 files changed, 265 insertions(+), 19 deletions(-) create mode 100644 1486.patch create mode 100644 gdl-size.patch diff --git a/.gitignore b/.gitignore index 4aff70f..a9afced 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ gdl-0.9rc4.tar.gz /gdl-1.0.0-git-4892c96.tar.gz /gdl-1.0.0.tar.gz /gdl-1.0.1.tar.gz +/gdl-1.0.2.tar.gz diff --git a/1486.patch b/1486.patch new file mode 100644 index 0000000..39d2b88 --- /dev/null +++ b/1486.patch @@ -0,0 +1,174 @@ +From 6a3337ff29917a4766f80ffb19e24a55251f1511 Mon Sep 17 00:00:00 2001 +From: GillesDuvert +Date: Fri, 20 Jan 2023 17:47:56 +0100 +Subject: [PATCH 1/2] try to permit distro builders to put drivers in + GDL_LIB_DIR but still make normal (non-distro) build as usual and moreover + enable relocation of gdl executable ans all its componenets, including + drivers, as it is now done for installers on Windows and OSX. + +--- + CMakeLists.txt | 1 + + config.h.cmake | 1 + + src/gdl.cpp | 24 +++++++++++++++++++----- + src/objects.cpp | 2 ++ + src/objects.hpp | 2 ++ + 5 files changed, 25 insertions(+), 5 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b0cecea36..281e12979 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -144,6 +144,7 @@ set(JPEGDIR "" CACHE PATH "GDL: Specify the JPEG directory tree") + set(SZIPDIR "" CACHE PATH "GDL: Specify the SZip directory tree") + + set(GDL_DATA_DIR "/share/gnudatalanguage" CACHE PATH "GDL: data directory relative to CMAKE_INSTALL_PREFIX") ++set(GDL_LIB_DIR "" CACHE PATH "GDL: library directory relative to CMAKE_INSTALL_PREFIX") + + # check for 64-bit OS + if(${CMAKE_SIZEOF_VOID_P} EQUAL 8) +diff --git a/config.h.cmake b/config.h.cmake +index 07c7fa199..4637af869 100644 +--- a/config.h.cmake ++++ b/config.h.cmake +@@ -3,6 +3,7 @@ + + #define EXEC_PREFIX "@CMAKE_INSTALL_PREFIX@" + #define GDLDATADIR "@CMAKE_INSTALL_PREFIX@@GDL_DATA_DIR@" ++#define GDLLIBDIR "@GDL_LIB_DIR@" + #define VERSION "@VERSION@" + + #define _CRT_SECURE_NO_WARNINGS +diff --git a/src/gdl.cpp b/src/gdl.cpp +index bf9947ae3..445145331 100644 +--- a/src/gdl.cpp ++++ b/src/gdl.cpp +@@ -250,8 +250,10 @@ int main(int argc, char *argv[]) + + //The default installation location --- will not always be there. + gdlDataDir = std::string(GDLDATADIR); ++ gdlLibDir = std::string(GDLLIBDIR); + #ifdef _WIN32 + std::replace(gdlDataDir.begin(), gdlDataDir.end(), '/', '\\'); ++ std::replace(gdlLibDir.begin(), gdlLibDir.end(), '/', '\\'); + #endif + + //check where is the executable being run +@@ -269,16 +271,28 @@ int main(int argc, char *argv[]) + if( gdlPath == "") gdlPath=GetEnvString("IDL_PATH"); //warning: is a Path, use system separator. + if( gdlPath == "") gdlPath = gdlDataDir + lib::PathSeparator() + "lib"; + +-//drivers if local ++//LIBDIR. Can be '' in which case the location of drivers is deduced from the location of ++//the executable (OSX, Windows, unix in user-installed mode). ++ string driversPath = GetEnvPathString("GDL_DRV_DIR"); ++ if (driversPath == "") { //NOT enforced by GDL_DRV_DIR ++ driversPath = gdlLibDir; //e.g. Fedora ++ if (driversPath == "") { //NOT enforced by GDLLIBDIR at build : not a distro ++ driversPath = gdlDataDir + lib::PathSeparator() + "drivers"; //deduced from the location of the executable ++ } ++ } ++ //drivers if local + useLocalDrivers=false; + bool driversNotFound=false; +- string driversPath=gdlDataDir + lib::PathSeparator() + "drivers"; +- //We'll ned to get the current value for PLPLOT_DRV_DIR if any (useful later if something goes wrong below) +- static const char* DrvEnvName="PLPLOT_DRV_DIR"; ++ ++ //The current value for PLPLOT_DRV_DIR. ++ //To find our drivers, the plplot library needs to have PLPLOT_DRV_DIR set to the good path, i.e., driversPath. ++ const char* DrvEnvName = "PLPLOT_DRV_DIR"; ++ //In a startup message (below), the value of $PLPLOT_DRV_DIR appears. ++ //It will be the value set inside the program (just below) to find the relevant drivers. + + #ifdef INSTALL_LOCAL_DRIVERS + useLocalDrivers=true; +- //For WIN32 the drivers dlls are copied alongwith the gdl.exe and plplot does not use PLPLOT_DRV_DIR to find them. ++ //For WIN32 the drivers dlls are copied along with the gdl.exe and plplot does not use PLPLOT_DRV_DIR to find them. + #ifndef _WIN32 + char* oldDriverEnv=getenv(DrvEnvName); + // We must declare here (and not later) where our local copy of (customized?) drivers is to be found. +diff --git a/src/objects.cpp b/src/objects.cpp +index d31991998..cc8d23088 100644 +--- a/src/objects.cpp ++++ b/src/objects.cpp +@@ -98,6 +98,8 @@ antlr::ASTFactory DNodeFactory("DNode",DNode::factory); + + //this string contains the value of DATADIR + std::string gdlDataDir; ++//this string contains the value of LIBDIR ++std::string gdlLibDir; + //do we use WxWidgets at all? + volatile bool useWxWidgets; + //do we use WxWidgets for graphics? +diff --git a/src/objects.hpp b/src/objects.hpp +index e65059a11..7cde23877 100644 +--- a/src/objects.hpp ++++ b/src/objects.hpp +@@ -71,6 +71,8 @@ extern volatile bool sigControlC; + + //this string contains the value of DATADIR + extern std::string gdlDataDir; ++//this string contains the value of LIBDIR ++extern std::string gdlLibDir; + + extern volatile bool iAmANotebook; + // tells if wxwidgets is to be used at all... + +From 7688f0b931d03d7ff15e552dac3666ebd819cd82 Mon Sep 17 00:00:00 2001 +From: GillesDuvert +Date: Sat, 21 Jan 2023 19:56:56 +0100 +Subject: [PATCH 2/2] enable GDL_LIB_DIR positioning of .so files (drivers), + something needed by distributions (Debian, Fedora...) + +--- + CMakeLists.txt | 8 +++++++- + config.h.cmake | 1 + + src/plplotdriver/CMakeLists.txt | 4 ++-- + 3 files changed, 10 insertions(+), 3 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 281e12979..5c674e141 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -145,7 +145,13 @@ set(SZIPDIR "" CACHE PATH "GDL: Specify the SZip directory tree") + + set(GDL_DATA_DIR "/share/gnudatalanguage" CACHE PATH "GDL: data directory relative to CMAKE_INSTALL_PREFIX") + set(GDL_LIB_DIR "" CACHE PATH "GDL: library directory relative to CMAKE_INSTALL_PREFIX") +- ++#define (for plplotdriver/CMakeLists.txt) the GDL_DRV_DIR where the drivers will be installed. ++#if GDL_LIB_DIR is empty, it will be the default (GDL_DATA_DIR/drivers) otherwise it is GDL_LIB_DIR (not GDL_LIB_DIR/drivers) ++if ( GDL_LIB_DIR STREQUAL "" OR NOT GDL_LIB_DIR) ++ set (GDL_DRV_DIR "${CMAKE_INSTALL_PREFIX}/${GDL_DATA_DIR}/drivers") # CACHE PATH "GDL: where the drivers will be installed.") ++else() ++ set (GDL_DRV_DIR "${GDL_LIB_DIR}" ) # CACHE PATH "GDL: where the drivers will be installed.") ++endif() + # check for 64-bit OS + if(${CMAKE_SIZEOF_VOID_P} EQUAL 8) + set(HAVE_64BIT_OS 1) +diff --git a/config.h.cmake b/config.h.cmake +index 4637af869..7080df9a6 100644 +--- a/config.h.cmake ++++ b/config.h.cmake +@@ -4,6 +4,7 @@ + #define EXEC_PREFIX "@CMAKE_INSTALL_PREFIX@" + #define GDLDATADIR "@CMAKE_INSTALL_PREFIX@@GDL_DATA_DIR@" + #define GDLLIBDIR "@GDL_LIB_DIR@" ++#define GDL_DRV_DIR "@GDL_DRV_DIR@" + #define VERSION "@VERSION@" + + #define _CRT_SECURE_NO_WARNINGS +diff --git a/src/plplotdriver/CMakeLists.txt b/src/plplotdriver/CMakeLists.txt +index 69e5062b1..a48742c10 100644 +--- a/src/plplotdriver/CMakeLists.txt ++++ b/src/plplotdriver/CMakeLists.txt +@@ -66,8 +66,8 @@ if(INSTALL_LOCAL_DRIVERS) + + foreach(v IN LISTS WHAT) + set_target_properties(${v} PROPERTIES PREFIX "" SUFFIX ${DYNAMIC_SUFFIX} ) +- install(TARGETS ${v} DESTINATION ${CMAKE_INSTALL_PREFIX}/${GDL_DATA_DIR}/drivers) +- install( FILES ${v}.driver_info DESTINATION ${CMAKE_INSTALL_PREFIX}/${GDL_DATA_DIR}/drivers) ++ install(TARGETS ${v} DESTINATION ${GDL_DRV_DIR}) ++ install( FILES ${v}.driver_info DESTINATION ${GDL_DRV_DIR}) + endforeach() + + endif(INSTALL_LOCAL_DRIVERS) diff --git a/gdl-antlr.patch b/gdl-antlr.patch index b877158..acafc42 100644 --- a/gdl-antlr.patch +++ b/gdl-antlr.patch @@ -1,18 +1,18 @@ -diff -up gdl-1.0.0/src/CMakeLists.txt.antlr gdl-1.0.0/src/CMakeLists.txt ---- gdl-1.0.0/src/CMakeLists.txt.antlr 2021-08-19 20:04:43.096095029 -0600 -+++ gdl-1.0.0/src/CMakeLists.txt 2021-08-19 20:05:26.844467193 -0600 -@@ -193,9 +193,7 @@ ${WX_RC} - ) - endif(HAVE_LIBWXWIDGETS AND WIN32) +diff -up gdl-1.0.2/src/CMakeLists.txt.antlr gdl-1.0.2/src/CMakeLists.txt +--- gdl-1.0.2/src/CMakeLists.txt.antlr 2023-01-06 10:39:47.000000000 -0700 ++++ gdl-1.0.2/src/CMakeLists.txt 2023-01-16 08:51:18.033486027 -0700 +@@ -197,9 +197,7 @@ endif(HAVE_LIBWXWIDGETS AND WIN32) + #local plplot drivers + add_subdirectory(plplotdriver) -add_subdirectory(antlr) - --include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/src/antlr ${CMAKE_BINARY_DIR}) -+include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src ${CMAKE_BINARY_DIR}) +-include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/src/antlr ${CMAKE_SOURCE_DIR}/src/plplotdriver ${CMAKE_BINARY_DIR}) ++include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/src/plplotdriver ${CMAKE_BINARY_DIR}) link_directories(${LINK_DIRECTORIES}) if(PYTHON_MODULE) #GDL.so -@@ -213,7 +211,6 @@ if(USE_OPENMP) +@@ -217,7 +215,6 @@ if(USE_OPENMP) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") endif(USE_OPENMP) diff --git a/gdl-size.patch b/gdl-size.patch new file mode 100644 index 0000000..f80b965 --- /dev/null +++ b/gdl-size.patch @@ -0,0 +1,58 @@ +diff -up gdl-1.0.2/src/qhull.cpp.size gdl-1.0.2/src/qhull.cpp +--- gdl-1.0.2/src/qhull.cpp.size 2023-01-06 10:39:47.000000000 -0700 ++++ gdl-1.0.2/src/qhull.cpp 2023-01-16 19:35:16.464432434 -0700 +@@ -784,7 +784,7 @@ int output_qhull_voronoi_local(Qhull* qh + func = e->GetParAs(3); //input function + tetra_list = e->GetParAs(4); //indices of tetrahedra vertices from qhull + +- int inDim = e->GetParAs(0)->Dim(0); ++ SizeT inDim = e->GetParAs(0)->Dim(0); + p0 = new DDoubleGDL( *(new dimension(3, inDim)), BaseGDL::ZERO ); //concatenation of the 3 separate inputs arrays + + for(int i=0; i<3; i++) +@@ -794,7 +794,7 @@ int output_qhull_voronoi_local(Qhull* qh + { + e->Throw("separated input arrays must have same length and be 1 dimensional"); + } +- for(int j=0; j points; +- points.reserve(np); ++ points.resize(np); + +- for (int i =0; i < np; i++) ++ for (size_t i =0; i < np; i++) + { + points[i] = { (*p0)[3*i], (*p0)[3*i+1], (*p0)[3*i+2] }; + //TODO handle not finite values +@@ -829,7 +829,7 @@ int output_qhull_voronoi_local(Qhull* qh + + // vector holding all necessary info on the triangulation + vector tetra_data; +- tetra_data.reserve(n_tetra); ++ tetra_data.resize(n_tetra); + + // directly available info + array empty_neighbours {-1,-1,-1,-1}; +@@ -848,7 +848,7 @@ int output_qhull_voronoi_local(Qhull* qh + // TOO SLOW, FIND ANOTHER METHOD + + vector tetra_neigh_count(n_tetra, 0); +- tetra_neigh_count.reserve(n_tetra); ++ tetra_neigh_count.resize(n_tetra); + + for(int i=0; i= 8 && "%{_arch}" == "s390x" ) %check +export GDL_DRV_DIR=$RPM_BUILD_ROOT%{_libdir}/gnudatalanguage cd build cp %SOURCE4 . if [ -x /usr/libexec/Xorg ]; then @@ -219,7 +226,8 @@ failing_tests="test_l64" failing_tests="test_(byte_conversion|bytscl|finite|matrix_multiply)" %endif %ifarch s390x -failing_tests="test_(byte_conversion|bytsc)" +# test_hdf5 - https://github.com/gnudatalanguage/gdl/issues/1488 +failing_tests="test_(byte_conversion|bytsc|hdf5)" %endif make test VERBOSE=1 ARGS="-V -E '$failing_tests'" make test VERBOSE=1 ARGS="-V -R '$failing_tests' --timeout 600" || : @@ -233,6 +241,7 @@ cat xorg.log %doc AUTHORS HACKING NEWS README %config(noreplace) %{_sysconfdir}/profile.d/gdl.*sh %{_bindir}/gdl +%{_libdir}/gnudatalanguage/ %{_mandir}/man1/gdl.1* %files common @@ -243,6 +252,10 @@ cat xorg.log %changelog +* Sun Jan 22 2023 Orion Poplawski - 1.0.2-1 +- Update to 1.0.2 +- Use SPDX License tag + * Thu Jan 19 2023 Fedora Release Engineering - 1.0.1-12 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild diff --git a/sources b/sources index 133fd1b..dbd1217 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (gdl-1.0.1.tar.gz) = 9d15f114d26d03c34dce6177a5d5115e81c128ec21752c01d171f8427e6cb21b9d0b69a44e29891b5e8fc2bd4d0b89d1a8dcd189f362a13c6e59182528b5842d +SHA512 (gdl-1.0.2.tar.gz) = 19869b68343ae8532ec9e27c402f69986d8269cc1f4c6af55402bef74f6dbee88c82b4c67db093b3be63377afb9a9a870f7baf484c8278d54ee5a7b5a428206a