sci-libs/dealii: ebuild maintenance
authorMatthias Maier <tamiko@gentoo.org>
Mon, 5 Aug 2019 12:06:17 +0000 (07:06 -0500)
committerMatthias Maier <tamiko@gentoo.org>
Mon, 5 Aug 2019 13:23:27 +0000 (08:23 -0500)
 * remove local description in metadata

 * avoid warning about unused variable

 * do not export LDFLAGS in pc files

Package-Manager: Portage-2.3.70, Repoman-2.3.16
Signed-off-by: Matthias Maier <tamiko@gentoo.org>
sci-libs/dealii/dealii-9.1.1.ebuild
sci-libs/dealii/dealii-9999.ebuild
sci-libs/dealii/files/dealii-9.1.1-no-ld-flags.patch [new file with mode: 0644]

index 0da4f8ea6ed5d3cc22db4b3627763ffaece671fd..719f781973909b07eb5f9b1f36dbea10747ea655 100644 (file)
@@ -33,10 +33,10 @@ fi
 LICENSE="LGPL-2.1+"
 SLOT="0"
 IUSE="
-       adolc assimp arpack cpu_flags_x86_avx cpu_flags_x86_sse2 cuda +debug
-       doc +examples gmsh +gsl hdf5 +lapack metis mpi muparser nanoflann
-       opencascade netcdf p4est petsc scalapack slepc +sparse static-libs
-       sundials symengine +tbb trilinos
+       adolc assimp arpack cpu_flags_x86_avx cpu_flags_x86_avx512f
+       cpu_flags_x86_sse2 cuda +debug doc +examples gmsh +gsl hdf5 +lapack
+       metis mpi muparser nanoflann opencascade netcdf p4est petsc scalapack
+       slepc +sparse static-libs sundials symengine +tbb trilinos
 "
 
 # TODO: add slepc use flag once slepc is packaged for gentoo-science
@@ -76,6 +76,10 @@ DEPEND="${RDEPEND}
        virtual/pkgconfig
        doc? ( app-doc/doxygen[dot] dev-lang/perl )"
 
+PATCHES=(
+       "${FILESDIR}"/${PN}-9.1.1-no-ld-flags.patch
+)
+
 src_configure() {
        # deal.II needs a custom build type:
        local CMAKE_BUILD_TYPE=$(usex debug DebugRelease Release)
@@ -97,9 +101,7 @@ src_configure() {
                -DDEAL_II_WITH_ADOLC="$(usex adolc)"
                -DDEAL_II_WITH_ASSIMP="$(usex assimp)"
                -DDEAL_II_WITH_ARPACK="$(usex arpack)"
-               -DDEAL_II_HAVE_AVX="$(usex cpu_flags_x86_avx)"
                -DDEAL_II_WITH_CUDA="$(usex cuda)"
-               -DDEAL_II_HAVE_SSE2="$(usex cpu_flags_x86_sse2)"
                -DDEAL_II_COMPONENT_DOCUMENTATION="$(usex doc)"
                -DDEAL_II_COMPONENT_EXAMPLES="$(usex examples)"
                -DDEAL_II_WITH_GMSH="$(usex gmsh)"
@@ -125,6 +127,18 @@ src_configure() {
                -DDEAL_II_WITH_THREADS="$(usex tbb)"
                -DDEAL_II_WITH_TRILINOS="$(usex trilinos)"
        )
+
+       # Do a little dance for purely cosmetic "QA" reasons. The build system
+       # does query for the highest instruction set first and skips the other
+       # variables if a "higher" variant is set
+       if use cpu_flags_x86_avx512f; then
+               mycmakeargs+=( -DDEAL_II_HAVE_AVX512=yes )
+       elif use cpu_flags_x86_avx; then
+               mycmakeargs+=( -DDEAL_II_HAVE_AVX=yes )
+       elif use cpu_flags_x86_avx; then
+               mycmakeargs+=( -DDEAL_II_HAVE_SSE2=yes )
+       fi
+
        cmake-utils_src_configure
 }
 
index 0da4f8ea6ed5d3cc22db4b3627763ffaece671fd..719f781973909b07eb5f9b1f36dbea10747ea655 100644 (file)
@@ -33,10 +33,10 @@ fi
 LICENSE="LGPL-2.1+"
 SLOT="0"
 IUSE="
-       adolc assimp arpack cpu_flags_x86_avx cpu_flags_x86_sse2 cuda +debug
-       doc +examples gmsh +gsl hdf5 +lapack metis mpi muparser nanoflann
-       opencascade netcdf p4est petsc scalapack slepc +sparse static-libs
-       sundials symengine +tbb trilinos
+       adolc assimp arpack cpu_flags_x86_avx cpu_flags_x86_avx512f
+       cpu_flags_x86_sse2 cuda +debug doc +examples gmsh +gsl hdf5 +lapack
+       metis mpi muparser nanoflann opencascade netcdf p4est petsc scalapack
+       slepc +sparse static-libs sundials symengine +tbb trilinos
 "
 
 # TODO: add slepc use flag once slepc is packaged for gentoo-science
@@ -76,6 +76,10 @@ DEPEND="${RDEPEND}
        virtual/pkgconfig
        doc? ( app-doc/doxygen[dot] dev-lang/perl )"
 
+PATCHES=(
+       "${FILESDIR}"/${PN}-9.1.1-no-ld-flags.patch
+)
+
 src_configure() {
        # deal.II needs a custom build type:
        local CMAKE_BUILD_TYPE=$(usex debug DebugRelease Release)
@@ -97,9 +101,7 @@ src_configure() {
                -DDEAL_II_WITH_ADOLC="$(usex adolc)"
                -DDEAL_II_WITH_ASSIMP="$(usex assimp)"
                -DDEAL_II_WITH_ARPACK="$(usex arpack)"
-               -DDEAL_II_HAVE_AVX="$(usex cpu_flags_x86_avx)"
                -DDEAL_II_WITH_CUDA="$(usex cuda)"
-               -DDEAL_II_HAVE_SSE2="$(usex cpu_flags_x86_sse2)"
                -DDEAL_II_COMPONENT_DOCUMENTATION="$(usex doc)"
                -DDEAL_II_COMPONENT_EXAMPLES="$(usex examples)"
                -DDEAL_II_WITH_GMSH="$(usex gmsh)"
@@ -125,6 +127,18 @@ src_configure() {
                -DDEAL_II_WITH_THREADS="$(usex tbb)"
                -DDEAL_II_WITH_TRILINOS="$(usex trilinos)"
        )
+
+       # Do a little dance for purely cosmetic "QA" reasons. The build system
+       # does query for the highest instruction set first and skips the other
+       # variables if a "higher" variant is set
+       if use cpu_flags_x86_avx512f; then
+               mycmakeargs+=( -DDEAL_II_HAVE_AVX512=yes )
+       elif use cpu_flags_x86_avx; then
+               mycmakeargs+=( -DDEAL_II_HAVE_AVX=yes )
+       elif use cpu_flags_x86_avx; then
+               mycmakeargs+=( -DDEAL_II_HAVE_SSE2=yes )
+       fi
+
        cmake-utils_src_configure
 }
 
diff --git a/sci-libs/dealii/files/dealii-9.1.1-no-ld-flags.patch b/sci-libs/dealii/files/dealii-9.1.1-no-ld-flags.patch
new file mode 100644 (file)
index 0000000..69c2c09
--- /dev/null
@@ -0,0 +1,20 @@
+diff --git a/cmake/config/config_debug.pc.in b/cmake/config/config_debug.pc.in
+index 5ea03885cd..32e45d8121 100644
+--- a/cmake/config/config_debug.pc.in
++++ b/cmake/config/config_debug.pc.in
+@@ -8,4 +8,4 @@ Version: @DEAL_II_VERSION@
+ URL: https://dealii.org/
+ Cflags: @DEAL_II_CXX_FLAGS@ @DEAL_II_CXX_FLAGS_DEBUG@ @CONFIG_INCLUDE_DIRS_PC@
+-Libs: @DEAL_II_LINKER_FLAGS@ @DEAL_II_LINKER_FLAGS_DEBUG@ @CONFIG_LIBRARIES_DEBUG_PC@ @CONFIG_RPATH_DEBUG_PC@
++Libs: @CONFIG_LIBRARIES_DEBUG_PC@ @CONFIG_RPATH_DEBUG_PC@
+diff --git a/cmake/config/config_release.pc.in b/cmake/config/config_release.pc.in
+index 726a35d040..8a879d07e8 100644
+--- a/cmake/config/config_release.pc.in
++++ b/cmake/config/config_release.pc.in
+@@ -8,4 +8,4 @@ Version: @DEAL_II_VERSION@
+ URL: https://dealii.org/
+ Cflags: @DEAL_II_CXX_FLAGS@ @DEAL_II_CXX_FLAGS_RELEASE@ @CONFIG_INCLUDE_DIRS_PC@
+-Libs: @DEAL_II_LINKER_FLAGS@ @DEAL_II_LINKER_FLAGS_RELEASE@ @CONFIG_LIBRARIES_RELEASE_PC@ @CONFIG_RPATH_RELEASE_PC@
++Libs: @CONFIG_LIBRARIES_RELEASE_PC@ @CONFIG_RPATH_RELEASE_PC@