summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO21
-rw-r--r--.gitignore3
-rw-r--r--Alien-HDF4-0.06.patch32
-rw-r--r--PKGBUILD56
4 files changed, 112 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..cfb376f6c216
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,21 @@
+pkgbase = perl-alien-hdf4
+ pkgdesc = Encapsulate install info for HDF4
+ pkgver = 0.06
+ pkgrel = 1
+ url = https://metacpan.org/release/Alien-HDF4
+ arch = any
+ license = GPL
+ license = PerlArtistic
+ checkdepends = perl-test-simple
+ makedepends = perl-io-all
+ makedepends = perl-extutils-depends
+ depends = hdf4
+ depends = perl
+ options = !emptydirs
+ options = purge
+ source = https://cpan.metacpan.org/authors/id/E/ET/ETJ/Alien-HDF4-0.06.tar.gz
+ source = Alien-HDF4-0.06.patch
+ sha256sums = 19e143a3692c2c25a595e23834c2b318b912be1a92aa40ccd3e730cd097c152f
+ sha256sums = ca8c5c82eb503113707782ae56488ccee82d24165909fdad892cf0e0750190f3
+
+pkgname = perl-alien-hdf4
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..c906e75958f4
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+/pkg/
+/src/
+*.tar.*
diff --git a/Alien-HDF4-0.06.patch b/Alien-HDF4-0.06.patch
new file mode 100644
index 000000000000..8d2096e5725b
--- /dev/null
+++ b/Alien-HDF4-0.06.patch
@@ -0,0 +1,32 @@
+diff --unified --recursive --text Alien-HDF4-0.06.orig/Makefile.PL Alien-HDF4-0.06.new/Makefile.PL
+--- Alien-HDF4-0.06.orig/Makefile.PL 2019-04-27 12:18:12.000000000 +1000
++++ Alien-HDF4-0.06.new/Makefile.PL 2024-02-14 13:35:23.635563187 +1100
+@@ -7,7 +7,7 @@
+
+ my ($libpath, $libs) = findlibs();
+ die <<EOF unless defined $libpath;
+-Cannot find hdf library, libdf.a.
++Cannot find hdf library, libdf.$Config{so}.
+ Please add the correct library path to Makefile.PL or install HDF
+ EOF
+
+diff --unified --recursive --text Alien-HDF4-0.06.orig/common.pl Alien-HDF4-0.06.new/common.pl
+--- Alien-HDF4-0.06.orig/common.pl 2023-01-28 07:23:33.000000000 +1100
++++ Alien-HDF4-0.06.new/common.pl 2024-02-14 13:35:43.599172154 +1100
+@@ -38,13 +38,13 @@
+ foreach my $libdir ( @HDF_lib_locations ) {
+ return (
+ $libdir, '-lmfhdfalt -ldfalt',
+- ) if -e "$libdir/libdfalt.a";
++ ) if -e "$libdir/libdfalt.$Config{so}";
+ return (
+ $libdir, '-lmfhdf -ldf',
+- ) if -e "$libdir/libdf.a";
++ ) if -e "$libdir/libdf.$Config{so}";
+ return (
+ $libdir, '-lmfhdf -lhdf -lxdr',
+- ) if -e "$libdir/libhdf.a";
++ ) if -e "$libdir/libhdf.$Config{so}";
+ }
+ return;
+ }
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..d7db68ab7de7
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,56 @@
+# Maintainer: Elias Elwyn <a@jthv.ai>
+
+pkgname=perl-alien-hdf4
+pkgver=0.06
+pkgrel=1
+pkgdesc='Encapsulate install info for HDF4'
+_dist=Alien-HDF4
+arch=(any)
+url="https://metacpan.org/release/$_dist"
+license=(GPL PerlArtistic)
+depends=(
+ hdf4
+ perl
+)
+makedepends=(
+ perl-io-all
+ perl-extutils-depends
+)
+checkdepends=(
+ perl-test-simple
+)
+options=('!emptydirs' purge)
+source=("https://cpan.metacpan.org/authors/id/E/ET/ETJ/$_dist-$pkgver.tar.gz"
+ "$_dist-$pkgver.patch")
+sha256sums=(19e143a3692c2c25a595e23834c2b318b912be1a92aa40ccd3e730cd097c152f
+ ca8c5c82eb503113707782ae56488ccee82d24165909fdad892cf0e0750190f3)
+
+prepare(){
+ cd "$srcdir/$_dist-$pkgver"
+ # Use shared libraries instead, as static ones are not available in
+ # aur/hdf4
+ # https://github.com/PDLPorters/Alien-HDF4/issues/6
+ # https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-perl/Alien-HDF4/files/Alien-HDF4-0.50.0-shared.patch
+ patch --strip=1 <"../../$_dist-$pkgver.patch"
+}
+
+build() {
+ cd "$srcdir/$_dist-$pkgver"
+ unset PERL5LIB PERL_MM_OPT PERL_LOCAL_LIB_ROOT
+ export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL=--skipdeps
+ /usr/bin/perl Makefile.PL
+ make
+}
+
+check() {
+ cd "$srcdir/$_dist-$pkgver"
+ unset PERL5LIB PERL_MM_OPT PERL_LOCAL_LIB_ROOT
+ export PERL_MM_USE_DEFAULT=1
+ make test
+}
+
+package() {
+ cd "$srcdir/$_dist-$pkgver"
+ unset PERL5LIB PERL_MM_OPT PERL_LOCAL_LIB_ROOT
+ make install INSTALLDIRS=vendor DESTDIR="$pkgdir"
+}