forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes: https://bugs.gentoo.org/917444 Signed-off-by: Andrew Ammerlaan <[email protected]>
- Loading branch information
1 parent
b89a727
commit fd97f14
Showing
3 changed files
with
250 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
DIST gdl-1.0.1.tar.gz 32775655 BLAKE2B 3428f33300403c98ae1f8f88cfa0e2346abe53d53b9f00c82ee5bf7f09f1f2f7d3021fa81173221ddd41ec29c94c2757cd1dc39b6e4d919c29d70af2e5045e6a SHA512 9d15f114d26d03c34dce6177a5d5115e81c128ec21752c01d171f8427e6cb21b9d0b69a44e29891b5e8fc2bd4d0b89d1a8dcd189f362a13c6e59182528b5842d | ||
DIST gdl-1.0.4.tar.gz 33219638 BLAKE2B db0e843cf2e3f07d6f53d3a8b46cb95303cd0ae199c98099f45bbdfe5d206f325a8f9814935e876a3dfee3a46da0144766b18fa54b38a653567a429a88f06250 SHA512 3206bdd88b0478493221c0552e62620f1c9acbfec6f1900d73d932caae12401bf825e8893c81f844965f79e332bedb6ea99e6ea6f2b21427022efa60d1326eb0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index f7b8801d..8281aee1 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -596,36 +598,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}) | ||
- set(HAS_IMAGEMAGICK ${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}) | ||
- execute_process(COMMAND ${MAGICKXXCONFIG} "--cxxflags" OUTPUT_VARIABLE MAGICKXXCONFIGCXXFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE) | ||
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MAGICKXXCONFIGCXXFLAGS}") | ||
- 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} ${ImageMagick_MagickCore_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) | ||
|
||
# libtiff | ||
@@ -994,20 +976,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 968ead9d..b0623de4 100644 | ||
--- a/src/CMakeLists.txt | ||
+++ b/src/CMakeLists.txt | ||
@@ -200,9 +200,9 @@ add_subdirectory(plplotdriver) | ||
#whereami | ||
add_library(whereami STATIC ${CMAKE_SOURCE_DIR}/src/whereami/src/whereami.c) | ||
|
||
-add_subdirectory(antlr) | ||
+find_library(ANTLR_LIBRARY NAMES antlr) | ||
|
||
-include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/src/antlr ${CMAKE_SOURCE_DIR}/src/plplotdriver ${CMAKE_SOURCE_DIR}/src/whereami/src ${CMAKE_BINARY_DIR}) | ||
+include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/src/plplotdriver ${CMAKE_SOURCE_DIR}/src/whereami/src ${CMAKE_BINARY_DIR}) | ||
link_directories(${LINK_DIRECTORIES}) | ||
|
||
if(PYTHON_MODULE) #GDL.so | ||
@@ -220,8 +220,7 @@ if(USE_OPENMP) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") | ||
endif(USE_OPENMP) | ||
|
||
-add_dependencies(gdl antlr whereami) # be sure that antlr is built before gdl | ||
-target_link_libraries(gdl antlr whereami) # link antlr against gdl | ||
+target_link_libraries(gdl ${ANTLR_LIBRARY} whereami) # link antlr against gdl | ||
if (MINGW) | ||
target_link_libraries(gdl ws2_32) | ||
endif (MINGW) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
# Copyright 1999-2024 Gentoo Authors | ||
# Distributed under the terms of the GNU General Public License v2 | ||
|
||
EAPI=8 | ||
|
||
WX_GTK_VER="3.0-gtk3" | ||
PYTHON_COMPAT=( python3_{10..12} ) | ||
|
||
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/${PN}/releases/download/v${PV}/${PN}-v${PV}.tar.gz -> ${P}.tar.gz" | ||
S="${WORKDIR}/${PN}-v${PV}" | ||
|
||
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 | ||
media-libs/libpng:= | ||
net-libs/libtirpc:= | ||
sci-libs/gsl:= | ||
sci-libs/plplot:=[X,cxx,-dynamic,wxwidgets?] | ||
sys-libs/ncurses:= | ||
sys-libs/readline:= | ||
sys-libs/zlib | ||
x11-libs/libX11 | ||
fftw? ( sci-libs/fftw:3.0= ) | ||
glpk? ( sci-mathematics/glpk:= ) | ||
gshhs? ( | ||
sci-geosciences/gshhs-data | ||
sci-geosciences/gshhs:= | ||
) | ||
hdf? ( sci-libs/hdf:= ) | ||
hdf5? ( sci-libs/hdf5:= ) | ||
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=" | ||
virtual/pkgconfig | ||
" | ||
|
||
PATCHES=( "${FILESDIR}"/${PN}-1.0.4-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 | ||
-DPNGLIB=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) | ||
-DQHULL=OFF | ||
) | ||
|
||
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_ | ||
} |