Subject: PACKAGE: testing/hyperion new aport

From: kitzman <[email-masked]>
Date: Thu, 11 Apr 2024 13:06:45 +0200

Hey all,

I've had this APKBUILD for a while, feel free to add it.

Kind regards,
kitzman
diff --git a/testing/hyperion/APKBUILD b/testing/hyperion/APKBUILD
new file mode 100644
index 00000000000..04517095177
--- /dev/null
+++ b/testing/hyperion/APKBUILD
@@ -0,0 +1,103 @@
+pkgname=hyperion
+pkgver=4.7
+pkgrel=0
+pkgdesc='Software implementation of System/370 and ESA/390'
+arch='x86_64 aarch64'
+url='https://github.com/SDL-Hercules-390/hyperion'
+license='custom'
+makedepends="libtool pkgconf bash make cmake linux-headers zlib-dev bzip2-dev libnsl-dev openssl1.1-compat-dev"
+depends="bzip2 libnsl zlib perl libltdl openssl1.1-compat"
+options='!check !dbg suid libtool'
+subpackages="$pkgname-doc"
+
+# taken from pkgsrc
+_version_crypto="a5096e5dd79f46b568806240c0824cd8cb2fcda2"
+_version_decnumber="3aa2f4531b5fcbd0478ecbaf72ccc47079c67280"
+_version_softfloat="4b0c326008e174610969c92e69178939ed80653d"
+_version_telnet="e0e2a9150cb0c7cea8b27ea126e1367b3f03b17e"
+
+source="
+hyperion-$pkgver.tar.gz::https://github.com/SDL-Hercules-390/$pkgname/archive/refs/tags/Release_$pkgver.tar.gz
+crypto-${_version_crypto}.tar.gz::https://github.com/SDL-Hercules-390/crypto/archive/${_version_crypto}.tar.gz
+decNumber-${_version_decnumber}.tar.gz::https://github.com/SDL-Hercules-390/decNumber/archive/${_version_decnumber}.tar.gz
+SoftFloat-${_version_softfloat}.tar.gz::https://github.com/SDL-Hercules-390/SoftFloat/archive/${_version_softfloat}.tar.gz
+telnet-${_version_telnet}.tar.gz::https://github.com/SDL-Hercules-390/telnet/archive/${_version_telnet}.tar.gz
+"
+ 
+# directories
+builddir="$srcdir"/hyperion-Release_"$pkgver"
+
+crypto_builddir="$srcdir"/crypto-"$_version_crypto"
+decNumber_builddir="$srcdir"/decNumber-"$_version_decnumber"
+SoftFloat_builddir="$srcdir"/SoftFloat-"$_version_softfloat"
+telnet_builddir="$srcdir"/telnet-"$_version_telnet"
+
+extpkgdir="$builddir"/extpkgs
+
+# packaging functions
+prepare() {
+  cd "$builddir"
+
+  # __gnu_linux__ not defined on musl - but Linux support is
+  # known
+  sed -i '381s/undef/define/' hostopts.h
+  sed -i '382s/undef/define/' hostopts.h
+  sed -i '385s/undef/define/' hostopts.h
+
+  ./autogen.sh
+}
+
+build() {
+  mkdir -p "$extpkgdir"
+  
+  for ext_proj in "$crypto_builddir" \
+		  "$decNumber_builddir" \
+		  "$SoftFloat_builddir" \
+		  "$telnet_builddir"; do
+    project_name=$(basename "$ext_proj" | sed 's/-[a-f0-9]*$//g')
+
+    echo "building external package $project_name"
+    
+    mkdir "$ext_proj"/"$project_name"
+    cd "$ext_proj"/"$project_name"
+    
+    "$ext_proj"/build --pkgname . -r -i "$extpkgdir" \
+	       -m $pkgarch \
+	       -a BOTH
+  done
+
+  cd "$builddir"
+
+  CONFIG_SHELL=/bin/bash \
+	      SHELL=/bin/bash \
+	      MAKESHELL=/bin/bash \
+	      ./configure --prefix=/usr \
+	      --enable-optimization=yes \
+	      --enable-extpkgs="$extpkgdir"
+  CONFIG_SHELL=/bin/bash \
+	      SHELL=/bin/bash \
+	      MAKESHELL=/bin/bash \
+	      make -j$(nproc)
+}
+
+package() {
+  cd "$builddir"
+
+  DESTDIR="$pkgdir" \
+	 CONFIG_SHELL=/bin/bash \
+	 SHELL=/bin/bash \
+	 MAKESHELL=/bin/bash \
+	 make install
+
+  install -Dm644 COPYRIGHT "$pkgdir/usr/share/licenses/hercules/qpl1"
+
+  cp -r "$extpkgdir"/* "$pkgdir"/usr
+}
+
+sha512sums="
+9d7060c4e2687358b9547b59b47362d642cbf2bf009085fdd41e485170d0f81029ee3d04d12b905a3a266cd26a9087e92c231c3f4600c32a8535a6140656b7b0  hyperion-4.7.tar.gz
+d55e73d7dfa90da53c173159e32cb733a44780cd8606d539351371e61910f3a82312b8ab9f858b293c89c8f7cc4fe74da86825db2f9a6e73391d95c3f903d94e  crypto-a5096e5dd79f46b568806240c0824cd8cb2fcda2.tar.gz
+dad1c2d271f5739ac99850ac90ad45209e8efc80c20d29210f2f5b911b10ffc12a039e1bf6a7b8a171869a63ecad9bc8dfcf95161273385974b03221bd538a74  decNumber-3aa2f4531b5fcbd0478ecbaf72ccc47079c67280.tar.gz
+549b144c63fdbbb0815650dfe9fb443a92fb8baeff33baeca1d25fa6226705ef149a1bdb80236c5debeb161bfaecd4cffe9f8d74298a83175c2ddeebb735c48c  SoftFloat-4b0c326008e174610969c92e69178939ed80653d.tar.gz
+9a6be6909b29431311999eacf2a68effd38d68d6dea4a3c99b37cf51dbca433f74dae49ec7b6eea69f7ed9f74d7fc41ebdeb02a68529537ba9d1d2b134fc2df4  telnet-e0e2a9150cb0c7cea8b27ea126e1367b3f03b17e.tar.gz
+"