diff options
author | Andrew Ammerlaan <andrewammerlaan@gentoo.org> | 2022-10-06 14:56:12 +0200 |
---|---|---|
committer | Andrew Ammerlaan <andrewammerlaan@gentoo.org> | 2022-10-06 15:00:32 +0200 |
commit | 15ee6aa862be7cb1cf32b401ebac12cb55d16eaa (patch) | |
tree | 3b03766c5ddb4a83335c2cb05043e4cf3cab6c92 /dev-lang | |
parent | sys-devel/gcc: add 13.0.0_pre20221002 (diff) | |
download | gentoo-15ee6aa862be7cb1cf32b401ebac12cb55d16eaa.tar.gz gentoo-15ee6aa862be7cb1cf32b401ebac12cb55d16eaa.tar.bz2 gentoo-15ee6aa862be7cb1cf32b401ebac12cb55d16eaa.zip |
dev-lang/gdl: add 1.0.1, enable python3_{10,11}
switch to python-single-r1 to avoid compiling the whole
package two or three times when python support is enabled
add flag for shapelib support
add missing dep on net-libs/libtirpc
tests still need some work
Closes: https://bugs.gentoo.org/845642
Closes: https://bugs.gentoo.org/830817
Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
Diffstat (limited to 'dev-lang')
-rw-r--r-- | dev-lang/gdl/Manifest | 1 | ||||
-rw-r--r-- | dev-lang/gdl/files/gdl-1.0.1-cmake.patch | 110 | ||||
-rw-r--r-- | dev-lang/gdl/gdl-1.0.1.ebuild | 146 | ||||
-rw-r--r-- | dev-lang/gdl/metadata.xml | 1 |
4 files changed, 258 insertions, 0 deletions
diff --git a/dev-lang/gdl/Manifest b/dev-lang/gdl/Manifest index 868fcd3bef4c..659e647babeb 100644 --- a/dev-lang/gdl/Manifest +++ b/dev-lang/gdl/Manifest @@ -1 +1,2 @@ DIST gdl-1.0.0_rc3.tar.gz 32650313 BLAKE2B cdecfe0646e2271e2389e0a04f8da1e8de4534faf743f233169bccf326198025eff7fd7a7b62ed8bd05fa4a0222c6fd30f9469e3edf0f5b2991ef3ef545e616b SHA512 3fde22c7e709b9cdc72a23d2317c043037379c7903418211a699c7e5caa2ed17e78e32e6d2f9b4aa89200e729fc21555821140dfdd58a5a636a858e2841f6335 +DIST gdl-1.0.1.tar.gz 32775655 BLAKE2B 3428f33300403c98ae1f8f88cfa0e2346abe53d53b9f00c82ee5bf7f09f1f2f7d3021fa81173221ddd41ec29c94c2757cd1dc39b6e4d919c29d70af2e5045e6a SHA512 9d15f114d26d03c34dce6177a5d5115e81c128ec21752c01d171f8427e6cb21b9d0b69a44e29891b5e8fc2bd4d0b89d1a8dcd189f362a13c6e59182528b5842d diff --git a/dev-lang/gdl/files/gdl-1.0.1-cmake.patch b/dev-lang/gdl/files/gdl-1.0.1-cmake.patch new file mode 100644 index 000000000000..66c895250f97 --- /dev/null +++ b/dev-lang/gdl/files/gdl-1.0.1-cmake.patch @@ -0,0 +1,110 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6c07596..31dcaf2 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -459,8 +459,10 @@ endif(CYGWIN OR NOT WIN32) + + # PLplot MANDATORY + # -DPLPLOTDIR=DIR +-set(CMAKE_PREFIX_PATH ${PLPLOTDIR}) +-find_package(Plplot QUIET) ++ ++find_package(PkgConfig REQUIRED) ++pkg_check_modules(PLPLOT REQUIRED plplot plplot-c++) ++ + set(HAVE_LIBPLPLOTCXXD ${PLPLOT_FOUND}) + if(PLPLOT_FOUND) + set(LIBRARIES ${LIBRARIES} ${PLPLOT_LIBRARIES}) +@@ -635,33 +637,16 @@ endif(GRAPHICSMAGICK_FOUND) + # -DMAGICK=ON|OFF + # -DMAGICKDIR=DIR + if(MAGICK) +- set(CMAKE_PREFIX_PATH ${MAGICKDIR}) +- find_package(ImageMagick QUIET COMPONENTS Magick++ MagickWand MagickCore) +- mark_as_advanced(ImageMagick_EXECUTABLE_DIR ImageMagick_Magick++_INCLUDE_DIR ImageMagick_Magick++_LIBRARY +- ImageMagick_MagickCore_INCLUDE_DIR ImageMagick_MagickCore_LIBRARY ImageMagick_MagickWand_INCLUDE_DIR ImageMagick_MagickWand_LIBRARY) +- set(USE_MAGICK ${ImageMagick_FOUND}) +- if(ImageMagick_FOUND) +- find_program(MAGICKXXCONFIG Magick++-config) +- if(MAGICKXXCONFIG) +- execute_process(COMMAND ${MAGICKXXCONFIG} "--libs" OUTPUT_VARIABLE MAGICKXXCONFIGLIBS OUTPUT_STRIP_TRAILING_WHITESPACE) +- set(LIBRARIES ${LIBRARIES} ${MAGICKXXCONFIGLIBS}) +- else(MAGICKXXCONFIG) +- message(FATAL_ERROR "ImageMagick is required but was not found (Magick++-config).\n" +- "Use -DMAGICKDIR=DIR to specify the ImageMagick directory.\n" +- "Use -DMAGICK=OFF to not use it.\n" +- "(suitable Debian/Ubuntu package: libmagick++-dev)\n" +- "(suitable Fedora/CentOS package: ImageMagick-c++-devel)") +- endif(MAGICKXXCONFIG) +- set(LIBRARIES ${LIBRARIES} ${ImageMagick_LIBRARIES}) +- include_directories(${ImageMagick_INCLUDE_DIRS}) +- set(MAGICK_LIBRARIES ${ImageMagick_LIBRARIES}) +- else(ImageMagick_FOUND) +- message(FATAL_ERROR "ImageMagick is required but was not found.\n" +- "Use -DMAGICKDIR=DIR to specify the ImageMagick directory.\n" +- "Use -DMAGICK=OFF to not use it.\n" +- "(suitable Debian/Ubuntu package: libmagick++-dev)\n" +- "(suitable Fedora/CentOS package: ImageMagick-c++-devel)") +- endif(ImageMagick_FOUND) ++ find_package(PkgConfig REQUIRED) ++ pkg_check_modules(Magick++ REQUIRED Magick++) ++ pkg_check_modules(MagickWand REQUIRED MagickWand) ++ pkg_check_modules(MagickCore REQUIRED MagickCore) ++ ++ set(MAGICK_LIBRARIES ${Magick++_LIBRARIES} ${MagickWand_LIBRARIES} ${MagickCore_LIBRARIES}) ++ set(LIBRARIES ${LIBRARIES} ${MAGICK_LIBRARIES}) ++ include_directories(${Magick++_INCLUDE_DIRS}) ++ include_directories(${MagickWand_INCLUDE_DIRS}) ++ include_directories(${MagickCore_INCLUDE_DIRS}) + endif(MAGICK) + + ## not valid anymore I bet ## if GM or IM activated, we check whether Plplot is OK for that +@@ -1037,20 +1022,8 @@ endif(GLPK) + # -DSHAPELIB=ON|OFF + # -DSHAPELIBDIR=DIR + if(SHAPELIB) +- set(CMAKE_PREFIX_PATH ${SHAPELIBDIR}) +- find_package(SHAPELIB QUIET) +- set(USE_SHAPELIB ${SHAPELIB_FOUND}) +- if(SHAPELIB_FOUND) +- set(LIBRARIES ${LIBRARIES} ${SHAPELIB_LIBRARIES}) +- include_directories(${SHAPELIB_INCLUDE_DIR}) +- else(SHAPELIB_FOUND) +- message(FATAL_ERROR "SHAPELIB (http://shapelib.maptools.org/) is required but was not found.\n" +- "Use -DSHAPELIBDIR=DIR to specify the SHAPELIB-devel directory tree.\n" +- "Use -DSHAPELIB=OFF to not use it.\n" +- "shapelib is often in package libshp-devel.\n" +- "(suitable Debian/Ubuntu package: libshp-dev)\n" +- "(suitable Fedora/CentOS package: shapelib-devel)\n") +- endif(SHAPELIB_FOUND) ++ find_package(PkgConfig REQUIRED) ++ pkg_check_modules(shapelib REQUIRED shapelib) + endif(SHAPELIB) + # EXPAT for IDLffXMLSAX and IDLffXMLDOM + # -DEXPAT=ON|OFF +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index f1923d2..6f1343e 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -193,9 +193,9 @@ ${WX_RC} + ) + endif(HAVE_LIBWXWIDGETS AND WIN32) + +-add_subdirectory(antlr) ++find_library(ANTLR_LIBRARY NAMES 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}) + link_directories(${LINK_DIRECTORIES}) + + if(PYTHON_MODULE) #GDL.so +@@ -213,8 +213,7 @@ if(USE_OPENMP) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") + endif(USE_OPENMP) + +-add_dependencies(gdl antlr) # be sure that antlr is built before gdl +-target_link_libraries(gdl antlr) # link antlr against gdl ++target_link_libraries(gdl ${ANTLR_LIBRARY}) # link antlr against gdl + if (MINGW) + target_link_libraries(gdl ws2_32) + endif (MINGW) diff --git a/dev-lang/gdl/gdl-1.0.1.ebuild b/dev-lang/gdl/gdl-1.0.1.ebuild new file mode 100644 index 000000000000..3dd1b363bd8f --- /dev/null +++ b/dev-lang/gdl/gdl-1.0.1.ebuild @@ -0,0 +1,146 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +WX_GTK_VER="3.0-gtk3" +PYTHON_COMPAT=( python3_{8..11} ) + +inherit cmake python-single-r1 toolchain-funcs virtualx wxwidgets + +DESCRIPTION="GNU Data Language" +HOMEPAGE="https://github.com/gnudatalanguage/gdl" +SRC_URI="https://github.com/gnudatalanguage/gdl/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux" +IUSE=" + +eigen fftw glpk graphicsmagick gshhs hdf hdf5 +imagemagick netcdf + openmp png proj postscript python shapelib tiff udunits wxwidgets +" +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" + +RDEPEND=" + dev-cpp/antlr-cpp:2= + dev-libs/expat + net-libs/libtirpc:= + sci-libs/gsl:0= + sci-libs/plplot:0=[cxx,-dynamic,wxwidgets?] + sys-libs/ncurses:0= + sys-libs/readline:0= + sys-libs/zlib + x11-libs/libX11 + fftw? ( sci-libs/fftw:3.0= ) + glpk? ( sci-mathematics/glpk:= ) + gshhs? ( + sci-geosciences/gshhs-data + sci-geosciences/gshhs:0= + ) + hdf? ( sci-libs/hdf:0= ) + hdf5? ( sci-libs/hdf5:0= ) + imagemagick? ( + !graphicsmagick? ( media-gfx/imagemagick:=[cxx] ) + graphicsmagick? ( media-gfx/graphicsmagick:=[cxx] ) + ) + netcdf? ( sci-libs/netcdf:= ) + proj? ( sci-libs/proj:= ) + postscript? ( dev-libs/pslib ) + python? ( + ${PYTHON_DEPS} + $(python_gen_cond_dep ' + dev-python/numpy[${PYTHON_USEDEP}] + ') + ) + shapelib? ( sci-libs/shapelib:= ) + tiff? ( + media-libs/tiff + sci-libs/libgeotiff + ) + udunits? ( sci-libs/udunits ) + wxwidgets? ( x11-libs/wxGTK:${WX_GTK_VER}[X] ) +" +DEPEND="${RDEPEND} + eigen? ( dev-cpp/eigen:3 ) +" +BDEPEND=" + dev-util/intltool + virtual/pkgconfig +" + +PATCHES=( "${FILESDIR}"/${PN}-1.0.1-cmake.patch ) +DOCS=( AUTHORS HACKING NEWS PYTHON.txt README README.md ) + +pkg_pretend() { + [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp +} + +pkg_setup() { + [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp + use python && python-single-r1_pkg_setup +} + +src_prepare() { + use wxwidgets && setup-wxwidgets unicode + use hdf5 && has_version sci-libs/hdf5[mpi] && export CXX=mpicxx + + # remove bundled antlr + rm -r src/antlr || die + + # gentoo: avoid install files in datadir directory + # and manually install them in src_install + sed -e '/AUTHORS/d' -i CMakeLists.txt || die + + cmake_src_prepare +} + +src_configure() { + # MPI is still very buggy + # x11=off does not compile + local mycmakeargs=( + -DMPI=OFF + -DREADLINE=ON + -DX11=ON + -DEXPAT=ON + -DEIGEN3=$(usex eigen) + -DFFTW=$(usex fftw) + -DGRIB=OFF + -DGLPK=$(usex glpk) + -DHDF=$(usex hdf) + -DHDF5=$(usex hdf5) + -DLIBPROJ=$(usex proj) + -DNETCDF=$(usex netcdf) + -DOPENMP=$(usex openmp) + -DPNGLIB=$(usex png) + -DUDUNITS2=$(usex udunits) + -DWXWIDGETS=$(usex wxwidgets) + -DGRAPHICSMAGICK=$(usex imagemagick $(usex graphicsmagick)) + -DMAGICK=$(usex imagemagick $(usex !graphicsmagick)) + -DTIFF=$(usex tiff) + -DGEOTIFF=$(usex tiff) + -DPYTHON_MODULE=$(usex python) + -DPYTHON=$(usex python) + -DSHAPELIB=$(usex shapelib) + ) + + if use python; then + # automatically selection ignores EPYTHON + mycmakeargs+=( + -DPYTHONVERSION="${EPYTHON#python}" + ) + fi + + cmake_src_configure +} + +src_test() { + virtx cmake_src_test +} + +src_install() { + cmake_src_install + + newenvd - 50gdl <<-_EOF_ + GDL_PATH="+${EPREFIX}/usr/share/gnudatalanguage" + _EOF_ +} diff --git a/dev-lang/gdl/metadata.xml b/dev-lang/gdl/metadata.xml index 18c3a80ae8f9..7babf54e25d6 100644 --- a/dev-lang/gdl/metadata.xml +++ b/dev-lang/gdl/metadata.xml @@ -16,6 +16,7 @@ <flag name="glpk">Use GNU Linear Programming Kit <pkg>sci-mathematics/glpk</pkg></flag> <flag name="gshhs">Add support for projection adn continent maps with <pkg>sci-geosciences/gshhs-data</pkg></flag> <flag name="proj">Add support for <pkg>sci-libs/proj</pkg> (geographic projections)</flag> + <flag name="shapelib">Add support for manipulating ESRI Shapefiles with <pkg>sci-libs/shapelib</pkg></flag> <flag name="udunits">Add support for manipulating units of physical quantities</flag> </use> <upstream> |