commit:     84b1a3a4e4fb165d9a76d53ebc4b24de5568ae83
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Dec  8 04:17:14 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Dec  8 04:19:34 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=84b1a3a4

sci-libs/hdf: support additional architectures

Pull in patches from Fedora [0] and Debian [1] with some simple rebasing
(added riscv, hppa, sparc64 by cherry-picking extra bits too).

All references included in the respective patches within
the patch tarball too.

This should, in total, give us:
- hppa
- sparc{,64}
- arm
- arm64
- ppc
- ppc64(le?)
- s390

[0] https://src.fedoraproject.org/rpms/hdf/tree/rawhide
[1] https://sources.debian.org/patches/libhdf4/4.2.15-4/

Bug: https://bugs.gentoo.org/664856
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sci-libs/hdf/Manifest             |  1 +
 sci-libs/hdf/hdf-4.2.15-r1.ebuild | 82 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 83 insertions(+)

diff --git a/sci-libs/hdf/Manifest b/sci-libs/hdf/Manifest
index ffbb29281d6e..74b9e9dfb5b1 100644
--- a/sci-libs/hdf/Manifest
+++ b/sci-libs/hdf/Manifest
@@ -1,2 +1,3 @@
 DIST hdf-4.2.13.tar.bz2 3616255 BLAKE2B 
3b20f018849b64aebc0e5fa53516f65f6e181b421c3842a033c2ec5586c262f18cb0be5c2a146bdecd9ae7580963817face2a21458852756f5b7072b7e6d5899
 SHA512 
d7be2b3650255590b72db4a6931325ec0af256db4b846cfe886c76bf24034901b2ba7a7e546566f426d265b1793287ea3f95d8fbd818a3d018fa6813a4541657
+DIST hdf-4.2.15-arch-patches.tar.bz2 7012 BLAKE2B 
58fd8ac608856fff95bd385aa01062820a7b58c6b89d9733709449ad20cedb691e1bcaeb314b0d846068af5a30cdf46740ce5d02f54be144c8e292b3c5db55d1
 SHA512 
c86a9aee2b0e388793f84bcaf2900f498ba481a00e8a3b50bb70b30f5a9631c6abfa99dc17fb9a7af13b47f50742cf40a69d5e79b515f22072eaae72656c3bda
 DIST hdf-4.2.15.tar.bz2 3647900 BLAKE2B 
b1d60ee880563bf64ae6eae4c66f86afe55f4c512f06c84c154de30034fa7a65cfa2b9bd68fbf8a055bb42b57215455ac8967f2a73ec88b361750aa07e0da5e6
 SHA512 
7d4037800ef8950ed74f225355ef5458444bed26fc189fbbd2ce7d36009998013ac1f6ba5d4e60834acf8f6f73550357238745acc35e162679919400a48191e9

diff --git a/sci-libs/hdf/hdf-4.2.15-r1.ebuild 
b/sci-libs/hdf/hdf-4.2.15-r1.ebuild
new file mode 100644
index 000000000000..2c9f240f5c3e
--- /dev/null
+++ b/sci-libs/hdf/hdf-4.2.15-r1.ebuild
@@ -0,0 +1,82 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+FORTRAN_NEEDED=fortran
+
+inherit fortran-2 toolchain-funcs autotools flag-o-matic
+
+DESCRIPTION="General purpose library and format for storing scientific data"
+HOMEPAGE="https://www.hdfgroup.org/hdf4.html";
+SRC_URI="https://support.hdfgroup.org/ftp/HDF/releases/${PN^^}${PV}/src/${P}.tar.bz2";
+SRC_URI+=" 
https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${PN}-4.2.15-arch-patches.tar.bz2";
+
+LICENSE="NCSA-HDF"
+SLOT="0"
+KEYWORDS="~amd64 ~ia64 ~ppc -riscv ~x86 ~amd64-linux ~x86-linux"
+IUSE="examples fortran szip static-libs test"
+RESTRICT="!test? ( test )"
+REQUIRED_USE="test? ( szip )"
+
+RDEPEND="net-libs/libtirpc:=
+       sys-libs/zlib
+       virtual/jpeg:0
+       szip? ( virtual/szip )"
+DEPEND="${RDEPEND}
+       test? ( virtual/szip )"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-4.2.15-enable-fortran-shared.patch
+       "${FILESDIR}"/${PN}-4.2.15-fix-rpch-location.patch
+
+       # May need to extend these for more arches in future.
+       # bug #664856
+       "${FILESDIR}"/${PN}-4.2.15-arch-patches/
+)
+
+src_prepare() {
+       default
+
+       sed -i -e 's/-R/-L/g' config/commence.am || die #rpath
+       eautoreconf
+}
+
+src_configure() {
+       [[ $(tc-getFC) = *gfortran ]] && append-fflags -fno-range-check
+       # GCC 10 workaround
+       # bug #723014
+       append-fflags $(test-flags-FC -fallow-argument-mismatch)
+
+       econf \
+               --enable-shared \
+               --enable-production=gentoo \
+               --disable-netcdf \
+               $(use_enable fortran) \
+               $(use_enable static-libs static) \
+               $(use_with szip szlib) \
+               CC="$(tc-getCC)"
+}
+
+src_install() {
+       default
+
+       if ! use static-libs; then
+               find "${ED}" -name '*.la' -delete || die
+       fi
+
+       dodoc release_notes/{RELEASE,HISTORY,bugs_fixed,misc_docs}.txt
+
+       cd "${ED}/usr" || die
+       if use examples; then
+               mv  share/hdf4_examples share/doc/${PF}/examples || die
+               docompress -x /usr/share/doc/${PF}/examples
+       else
+               rm -r share/hdf4_examples || die
+       fi
+
+       mv bin/ncgen{,-hdf} || die
+       mv bin/ncdump{,-hdf} || die
+       mv share/man/man1/ncgen{,-hdf}.1 || die
+       mv share/man/man1/ncdump{,-hdf}.1 || die
+}

Reply via email to