summaryrefslogtreecommitdiff
path: root/app-emulation
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-05-09 00:01:03 +0100
committerV3n3RiX <venerix@koprulu.sector>2024-05-09 00:01:03 +0100
commita0ce545d52f231499bf9f3644493113d8af58ec9 (patch)
tree4d67c09eed0c2ae28d1317f72d7f7b08b4f6aeea /app-emulation
parent5181ced3f3566a9610b85922b083c8f84f20d78f (diff)
gentoo auto-resync : 09:05:2024 - 00:01:03
Diffstat (limited to 'app-emulation')
-rw-r--r--app-emulation/Manifest.gzbin15635 -> 16501 bytes
-rw-r--r--app-emulation/hercules-sdl-crypto/Manifest5
-rw-r--r--app-emulation/hercules-sdl-crypto/files/cmakefix.patch155
-rw-r--r--app-emulation/hercules-sdl-crypto/hercules-sdl-crypto-4.7.0.ebuild20
-rw-r--r--app-emulation/hercules-sdl-crypto/hercules-sdl-crypto-9999.ebuild14
-rw-r--r--app-emulation/hercules-sdl-crypto/metadata.xml18
-rw-r--r--app-emulation/hercules-sdl-decnumber/Manifest5
-rw-r--r--app-emulation/hercules-sdl-decnumber/files/cmakefix.patch159
-rw-r--r--app-emulation/hercules-sdl-decnumber/hercules-sdl-decnumber-4.7.0.ebuild20
-rw-r--r--app-emulation/hercules-sdl-decnumber/hercules-sdl-decnumber-9999.ebuild14
-rw-r--r--app-emulation/hercules-sdl-decnumber/metadata.xml18
-rw-r--r--app-emulation/hercules-sdl-softfloat/Manifest5
-rw-r--r--app-emulation/hercules-sdl-softfloat/files/cmakefix.patch159
-rw-r--r--app-emulation/hercules-sdl-softfloat/hercules-sdl-softfloat-4.7.0.ebuild20
-rw-r--r--app-emulation/hercules-sdl-softfloat/hercules-sdl-softfloat-9999.ebuild14
-rw-r--r--app-emulation/hercules-sdl-softfloat/metadata.xml18
-rw-r--r--app-emulation/hercules-sdl-telnet/Manifest5
-rw-r--r--app-emulation/hercules-sdl-telnet/files/cmakefix.patch155
-rw-r--r--app-emulation/hercules-sdl-telnet/hercules-sdl-telnet-4.7.0.ebuild20
-rw-r--r--app-emulation/hercules-sdl-telnet/hercules-sdl-telnet-9999.ebuild14
-rw-r--r--app-emulation/hercules-sdl-telnet/metadata.xml18
-rw-r--r--app-emulation/hercules-sdl/Manifest10
-rw-r--r--app-emulation/hercules-sdl/files/gen_hashes.sh24
-rw-r--r--app-emulation/hercules-sdl/files/hercules-3.13-htmldir.patch25
-rw-r--r--app-emulation/hercules-sdl/files/hercules-3.13-posix-test.patch29
-rw-r--r--app-emulation/hercules-sdl/files/hercules-3.13-unbundle-libltdl.patch379
-rw-r--r--app-emulation/hercules-sdl/files/hercules-3.13-user-install.patch21
-rw-r--r--app-emulation/hercules-sdl/files/hercules-sdl-4.4.1-htmldir.patch29
-rw-r--r--app-emulation/hercules-sdl/files/hercules-sdl-4.4.1-unbundle-libltdl.patch179
-rw-r--r--app-emulation/hercules-sdl/hercules-sdl-4.7.0.ebuild85
-rw-r--r--app-emulation/hercules-sdl/metadata.xml22
31 files changed, 1659 insertions, 0 deletions
diff --git a/app-emulation/Manifest.gz b/app-emulation/Manifest.gz
index de4a03ed1622..7d22cd73fe6e 100644
--- a/app-emulation/Manifest.gz
+++ b/app-emulation/Manifest.gz
Binary files differ
diff --git a/app-emulation/hercules-sdl-crypto/Manifest b/app-emulation/hercules-sdl-crypto/Manifest
new file mode 100644
index 000000000000..dc58be5291e7
--- /dev/null
+++ b/app-emulation/hercules-sdl-crypto/Manifest
@@ -0,0 +1,5 @@
+AUX cmakefix.patch 6163 BLAKE2B 534c402eb154e64a4de8a0eecba618e372a9584c46272ba98bc353d958848bff54569b691b81b8efd38adec3a1539ca2bfde8d8cac2a7b8dfb03db1266766136 SHA512 9c26b76cff4c28fe9f4eb36d403ea9d6caeb7c2475fd2833d5d857167a925eafa76b6b86d039876ffeff29b8f8245156b58a72439a0a2334c7ab3f5d9643db1c
+DIST crypto-a5096e5dd79f46b568806240c0824cd8cb2fcda2.tar.gz 81482 BLAKE2B 4e414c66ee3716c17217ac85b658171907b1018bb8b7306c2b040957cb15723f77c32d5b04c5ff12c346e2ac464d16e805c036b7408755a7f1ca40174c031296 SHA512 d55e73d7dfa90da53c173159e32cb733a44780cd8606d539351371e61910f3a82312b8ab9f858b293c89c8f7cc4fe74da86825db2f9a6e73391d95c3f903d94e
+EBUILD hercules-sdl-crypto-4.7.0.ebuild 651 BLAKE2B 8a99e5fa11d2a078250b47e1925960177ced0f1f4a06c0eb55b57ef323535ee3143f20d5c77992f96e8bb9f07158afe6d27c970f801577de5e9dd45d93a9dae7 SHA512 9b50fa3db8709ce7ae6ef0557f68d6eb1e30aa7be05f143a001a78375bad3602d4fa8a4bdee6ca081c53116d1bdac9334069e8f689ef741f308a3c03f87b97f6
+EBUILD hercules-sdl-crypto-9999.ebuild 401 BLAKE2B 8d7cbbd6533b321329c211fdef427813030546f013889c1b12c84d02208fef2095f181b283159c51ce0e72b967ca4957aa56a7c257d711a323736e41a4ec22ce SHA512 ce5d4825e4e8650a312f66763737f19dfbb31ee4dc175c38ce9cf2dd8b590b87b81edd9d878e66a1df3d64fc79533f37a0b0d64b6b2ccd6afb0944ac45ba2c2d
+MISC metadata.xml 625 BLAKE2B bb13ad47e68a21a65bb61ff57c30994b43a492cf32737aadf5d9a9b4d09f65f964ac320e6f878bee00dd25feb1c6b426725ae7d80df777cc3c7df9a7daa3008a SHA512 aed23cee820c63ddaeed997bb4c0b8919b347948fb589d7cbdb0425cafa23e31928fa684a9441073def2a7556ba16d10590725f08ed0cb7880107fe93ff81e9c
diff --git a/app-emulation/hercules-sdl-crypto/files/cmakefix.patch b/app-emulation/hercules-sdl-crypto/files/cmakefix.patch
new file mode 100644
index 000000000000..dd8f1840a7d9
--- /dev/null
+++ b/app-emulation/hercules-sdl-crypto/files/cmakefix.patch
@@ -0,0 +1,155 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index a316b76..50176f0 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -6,6 +6,8 @@ cmake_minimum_required( VERSION 3.2 )
+
+ cmake_policy( SET CMP0048 NEW )
+
++include( GNUInstallDirs )
++
+ #------------------------------------------------------------------------------
+ # Define the project
+ #------------------------------------------------------------------------------
+@@ -131,8 +133,8 @@ set_target_properties( ${FULLNAME} PROPERTIES
+ COMPILE_PDB_NAME ${FULLNAME} )
+
+ install( TARGETS ${FULLNAME}
+- PUBLIC_HEADER DESTINATION include
+- ARCHIVE DESTINATION ${LIB_INSTALL_DIR} )
++ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_LIBDIR}/hercules-sdl/include
++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/hercules-sdl/lib )
+
+
+ #------------------------------------------------------------------------------
+diff --git a/cmake/modules/ParseBinaryDir.cmake b/cmake/modules/ParseBinaryDir.cmake
+index 7983107..2ede77b 100644
+--- a/cmake/modules/ParseBinaryDir.cmake
++++ b/cmake/modules/ParseBinaryDir.cmake
+@@ -7,6 +7,8 @@ macro( ParseBinaryDir )
+ set( CMAKE_DISABLE_IN_SOURCE_BUILD ON )
+ set( CMAKE_DISABLE_SOURCE_CHANGES ON )
+
++ set( FULLNAME ${EXTPKG_NAME} )
++
+ #--------------------------------------------------------------------------
+ # Make sure they are not trying to do an "in source" build by making
+ # sure the cmake "binary" (build) directory is not a subdirectory of
+@@ -48,102 +50,6 @@ Remove the 'CMakeCache.txt' file and the entire 'CMakeFiles' directory and try a
+
+ TEST_BIG_ENDIAN( IS_BIG_ENDIAN )
+
+- #--------------------------------------------------------------------------
+- # Split the binary build directory into its constituent components.
+- # Refer to the "BUILDING" document for more information.
+- #--------------------------------------------------------------------------
+-
+- get_filename_component( BINARY_HLQ "${CMAKE_BINARY_DIR}" DIRECTORY )
+- get_filename_component( BINARY_DIR "${CMAKE_BINARY_DIR}" NAME )
+-
+- trace( BINARY_HLQ )
+- trace( BINARY_DIR )
+-
+- string( FIND ${BINARY_DIR} " " _n )
+- if( NOT ${_n} EQUAL -1 )
+- message( FATAL_ERROR "Build directory name cannot have spaces! ${BINARY_DIR}" )
+- endif()
+-
+- #--------------------------------------------------------------------------
+- # First, split it into two parts: before the dot and after the dot
+- #--------------------------------------------------------------------------
+-
+- string( REGEX MATCH "([^\\.]*)" _xxxxx ${BINARY_DIR} )
+- string( REGEX MATCH "([^.]*\$)" CONFIG ${BINARY_DIR} )
+-
+- trace( _xxxxx )
+- trace( CONFIG )
+-
+- #--------------------------------------------------------------------------
+- # The second part tells us if this is a "Debug" or "Release" build.
+- #--------------------------------------------------------------------------
+-
+- string( LENGTH ${CONFIG} _n )
+- if( ${_n} LESS 1 )
+- message( FATAL_ERROR "Invalid Release/Debug build type! ${CONFIG}" )
+- endif()
+-
+- #--------------------------------------------------------------------------
+- # Capitalize "Debug" and "Release" for Visual Studio compatibility.
+- #--------------------------------------------------------------------------
+-
+- include( CapitalizeWord )
+-
+- Capitalize_Word( ${CONFIG} CONFIG )
+-
+- if(( NOT CONFIG STREQUAL "Debug" ) AND (NOT CONFIG STREQUAL "Release" ))
+- message( FATAL_ERROR "Invalid Release/Debug build type! ${CONFIG}" )
+- endif()
+-
+- #--------------------------------------------------------------------------
+- # Define the "Debug" or "Release" build type
+- #--------------------------------------------------------------------------
+-
+- if( CONFIG STREQUAL "Debug" )
+- set( CMAKE_BUILD_TYPE "Debug" CACHE PATH "" FORCE )
+- set( DBGCHAR "d" )
+- elseif( CONFIG STREQUAL "Release" )
+- set( CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE PATH "" FORCE )
+- set( DBGCHAR "" )
+- endif()
+-
+- trace( CMAKE_BUILD_TYPE )
+-
+- #--------------------------------------------------------------------------
+- # Now split the first part into the base package/product name
+- # and build architecture (32-bit ot 64-bit).
+- #--------------------------------------------------------------------------
+-
+- string( LENGTH ${_xxxxx} _n )
+- if( ${_n} LESS 3 )
+- message( FATAL_ERROR "Invalid base package name! ${_xxxxx}" )
+- endif()
+-
+- math( EXPR _n "${_n} - 2" ) # (want the last two characters)
+-
+- string( SUBSTRING ${_xxxxx} 0 ${_n} BASENAME )
+- string( SUBSTRING ${_xxxxx} ${_n} -1 BITNESS )
+-
+- if( NOT BITNESS STREQUAL "32" AND
+- NOT BITNESS STREQUAL "64" )
+- message( FATAL_ERROR "Invalid package architecture! ${BITNESS}" )
+- endif()
+-
+- #--------------------------------------------------------------------------
+- # Show results
+- #--------------------------------------------------------------------------
+-
+- set( SUFFIX "${BITNESS}${DBGCHAR}" )
+- set( FULLNAME "${BASENAME}${SUFFIX}" )
+-
+- trace( BASENAME )
+- trace( BITNESS )
+- trace( CONFIG )
+- trace( DBGCHAR )
+- trace( SUFFIX )
+- trace( FULLNAME )
+- trace( CMAKE_BINARY_DIR )
+-
+ #--------------------------------------------------------------------------
+ # Define the install directory
+ #--------------------------------------------------------------------------
+diff --git a/extra.txt b/extra.txt
+index dfb293d..6018eb6 100644
+--- a/extra.txt
++++ b/extra.txt
+@@ -2,8 +2,8 @@
+ # Define additional files to be installed
+ #------------------------------------------------------------------------------
+
+-install( FILES "crypto.LICENSE.txt" DESTINATION . )
+-install( FILES "crypto.README.txt" DESTINATION . )
++install( FILES "crypto.LICENSE.txt" DESTINATION ${CMAKE_INSTALL_DOCDIR} )
++install( FILES "crypto.README.txt" DESTINATION ${CMAKE_INSTALL_DOCDIR} )
+
+ #------------------------------------------------------------------------------
+
diff --git a/app-emulation/hercules-sdl-crypto/hercules-sdl-crypto-4.7.0.ebuild b/app-emulation/hercules-sdl-crypto/hercules-sdl-crypto-4.7.0.ebuild
new file mode 100644
index 000000000000..b3f5be08e2fa
--- /dev/null
+++ b/app-emulation/hercules-sdl-crypto/hercules-sdl-crypto-4.7.0.ebuild
@@ -0,0 +1,20 @@
+# Copyright 2022-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake
+
+# Use ../hercules-sdl/files/gen_hashes.sh to identify the relevant
+# commit when tagging new versions.
+COMMIT="a5096e5dd79f46b568806240c0824cd8cb2fcda2"
+
+DESCRIPTION="Simple AES/DES encryption and SHA1/SHA2 hashing library"
+HOMEPAGE="https://github.com/SDL-Hercules-390/crypto"
+SRC_URI="https://github.com/SDL-Hercules-390/crypto/archive/${COMMIT}.tar.gz -> crypto-${COMMIT}.tar.gz"
+
+S="${WORKDIR}/crypto-${COMMIT}"
+LICENSE="public-domain MIT BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc64"
+PATCHES=( "${FILESDIR}/cmakefix.patch" )
diff --git a/app-emulation/hercules-sdl-crypto/hercules-sdl-crypto-9999.ebuild b/app-emulation/hercules-sdl-crypto/hercules-sdl-crypto-9999.ebuild
new file mode 100644
index 000000000000..0bfa5e44ea13
--- /dev/null
+++ b/app-emulation/hercules-sdl-crypto/hercules-sdl-crypto-9999.ebuild
@@ -0,0 +1,14 @@
+# Copyright 2022-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit git-r3 cmake
+
+DESCRIPTION="Simple AES/DES encryption and SHA1/SHA2 hashing library"
+HOMEPAGE="https://github.com/SDL-Hercules-390/crypto"
+EGIT_REPO_URI="https://github.com/SDL-Hercules-390/crypto"
+
+LICENSE="public-domain MIT BSD"
+SLOT="0"
+PATCHES=( "${FILESDIR}/cmakefix.patch" )
diff --git a/app-emulation/hercules-sdl-crypto/metadata.xml b/app-emulation/hercules-sdl-crypto/metadata.xml
new file mode 100644
index 000000000000..8e22c018c0ee
--- /dev/null
+++ b/app-emulation/hercules-sdl-crypto/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person" proxied="yes">
+ <email>matoro_gentoo@matoro.tk</email>
+ <name>Matoro Mahri</name>
+ </maintainer>
+ <maintainer type="project" proxied="proxy">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <longdescription>
+ Simple AES/DES encryption and SHA1/SHA2 hashing library for use by the SDL-Hercules-390 emulator
+ </longdescription>
+ <upstream>
+ <remote-id type="github">SDL-Hercules-390/crypto</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-emulation/hercules-sdl-decnumber/Manifest b/app-emulation/hercules-sdl-decnumber/Manifest
new file mode 100644
index 000000000000..e61062ce5fe4
--- /dev/null
+++ b/app-emulation/hercules-sdl-decnumber/Manifest
@@ -0,0 +1,5 @@
+AUX cmakefix.patch 6485 BLAKE2B 1629d74ac9170baf935602c2122ab2b51c8a635d7e557ce98613a80cbbd05c6177ccdd6e816f321b181e84b23bcc6cca382211787913447675568b07330a1fde SHA512 4c16235fbf4429812082735a4b86b764b3bff3afb4b7dd4a42961287a3837e70dbff3fa3c841939b4dbdee1a877135b0a13407905c69fdac5b43da9750920088
+DIST decNumber-3aa2f4531b5fcbd0478ecbaf72ccc47079c67280.tar.gz 785702 BLAKE2B c7348c33dfdad046f79fc8112800e31b8010a0aa0acbca0e84d21e0f4ba366969a4c453d07ed8a3fdb79735850f17d71e66731a9b2db6d64781309f2c2861f8e SHA512 dad1c2d271f5739ac99850ac90ad45209e8efc80c20d29210f2f5b911b10ffc12a039e1bf6a7b8a171869a63ecad9bc8dfcf95161273385974b03221bd538a74
+EBUILD hercules-sdl-decnumber-4.7.0.ebuild 631 BLAKE2B 205b79a829aa007d379a23ed33793c2f5ece9fde4fcb339c3e5901a2b6301bb4c5f84faef24c529588ccfc083d26c2bca95001da47dc28c4adaaec80a83e94aa SHA512 10700ca78acd54b38ff2857d8eafa85b24a1c7ef60bc113420be2f28e260c5a33b4c4edfd45bceb12f2882369c94dbff70ead15e6c459910fabe32c388baa008
+EBUILD hercules-sdl-decnumber-9999.ebuild 375 BLAKE2B 2067846a7f3d274fd0ecd7cb2c70972689fec859c54aa057ddf6606f3119055071fafd907632f23e9b5e00f3c94290556d138624b9351da1323f5ac22cfd4c68 SHA512 372e66b188880030a409aca1f7a3689fc58fde54379f1ccdfde7590b3f85f292f5f2bc637cdee9d4046beabb448286874e13c8abb1775a9c311238dca42c4a37
+MISC metadata.xml 614 BLAKE2B f96f42c67530d89664539eb8fc4d07e890ad0f6c559dc8d618f89036364f18f3df74f127ce5b5760d60a5e8908b2cb6292247e18ec4dcd3e07a63261ba149dfc SHA512 d5e12431056dd6ce71846080e07e5352a3224bb8096d43d6bd35ea95c9c1b09aab82ce32a7c11dc906dd954a661b8558405ad1706cdab20b9b380d47da4d9274
diff --git a/app-emulation/hercules-sdl-decnumber/files/cmakefix.patch b/app-emulation/hercules-sdl-decnumber/files/cmakefix.patch
new file mode 100644
index 000000000000..42e461d92e24
--- /dev/null
+++ b/app-emulation/hercules-sdl-decnumber/files/cmakefix.patch
@@ -0,0 +1,159 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index a316b76..50176f0 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -6,6 +6,8 @@ cmake_minimum_required( VERSION 3.2 )
+
+ cmake_policy( SET CMP0048 NEW )
+
++include( GNUInstallDirs )
++
+ #------------------------------------------------------------------------------
+ # Define the project
+ #------------------------------------------------------------------------------
+@@ -131,8 +133,8 @@ set_target_properties( ${FULLNAME} PROPERTIES
+ COMPILE_PDB_NAME ${FULLNAME} )
+
+ install( TARGETS ${FULLNAME}
+- PUBLIC_HEADER DESTINATION include
+- ARCHIVE DESTINATION ${LIB_INSTALL_DIR} )
++ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_LIBDIR}/hercules-sdl/include
++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/hercules-sdl/lib )
+
+
+ #------------------------------------------------------------------------------
+diff --git a/cmake/modules/ParseBinaryDir.cmake b/cmake/modules/ParseBinaryDir.cmake
+index 7983107..2ede77b 100644
+--- a/cmake/modules/ParseBinaryDir.cmake
++++ b/cmake/modules/ParseBinaryDir.cmake
+@@ -7,6 +7,8 @@ macro( ParseBinaryDir )
+ set( CMAKE_DISABLE_IN_SOURCE_BUILD ON )
+ set( CMAKE_DISABLE_SOURCE_CHANGES ON )
+
++ set( FULLNAME ${EXTPKG_NAME} )
++
+ #--------------------------------------------------------------------------
+ # Make sure they are not trying to do an "in source" build by making
+ # sure the cmake "binary" (build) directory is not a subdirectory of
+@@ -48,102 +50,6 @@ Remove the 'CMakeCache.txt' file and the entire 'CMakeFiles' directory and try a
+
+ TEST_BIG_ENDIAN( IS_BIG_ENDIAN )
+
+- #--------------------------------------------------------------------------
+- # Split the binary build directory into its constituent components.
+- # Refer to the "BUILDING" document for more information.
+- #--------------------------------------------------------------------------
+-
+- get_filename_component( BINARY_HLQ "${CMAKE_BINARY_DIR}" DIRECTORY )
+- get_filename_component( BINARY_DIR "${CMAKE_BINARY_DIR}" NAME )
+-
+- trace( BINARY_HLQ )
+- trace( BINARY_DIR )
+-
+- string( FIND ${BINARY_DIR} " " _n )
+- if( NOT ${_n} EQUAL -1 )
+- message( FATAL_ERROR "Build directory name cannot have spaces! ${BINARY_DIR}" )
+- endif()
+-
+- #--------------------------------------------------------------------------
+- # First, split it into two parts: before the dot and after the dot
+- #--------------------------------------------------------------------------
+-
+- string( REGEX MATCH "([^\\.]*)" _xxxxx ${BINARY_DIR} )
+- string( REGEX MATCH "([^.]*\$)" CONFIG ${BINARY_DIR} )
+-
+- trace( _xxxxx )
+- trace( CONFIG )
+-
+- #--------------------------------------------------------------------------
+- # The second part tells us if this is a "Debug" or "Release" build.
+- #--------------------------------------------------------------------------
+-
+- string( LENGTH ${CONFIG} _n )
+- if( ${_n} LESS 1 )
+- message( FATAL_ERROR "Invalid Release/Debug build type! ${CONFIG}" )
+- endif()
+-
+- #--------------------------------------------------------------------------
+- # Capitalize "Debug" and "Release" for Visual Studio compatibility.
+- #--------------------------------------------------------------------------
+-
+- include( CapitalizeWord )
+-
+- Capitalize_Word( ${CONFIG} CONFIG )
+-
+- if(( NOT CONFIG STREQUAL "Debug" ) AND (NOT CONFIG STREQUAL "Release" ))
+- message( FATAL_ERROR "Invalid Release/Debug build type! ${CONFIG}" )
+- endif()
+-
+- #--------------------------------------------------------------------------
+- # Define the "Debug" or "Release" build type
+- #--------------------------------------------------------------------------
+-
+- if( CONFIG STREQUAL "Debug" )
+- set( CMAKE_BUILD_TYPE "Debug" CACHE PATH "" FORCE )
+- set( DBGCHAR "d" )
+- elseif( CONFIG STREQUAL "Release" )
+- set( CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE PATH "" FORCE )
+- set( DBGCHAR "" )
+- endif()
+-
+- trace( CMAKE_BUILD_TYPE )
+-
+- #--------------------------------------------------------------------------
+- # Now split the first part into the base package/product name
+- # and build architecture (32-bit ot 64-bit).
+- #--------------------------------------------------------------------------
+-
+- string( LENGTH ${_xxxxx} _n )
+- if( ${_n} LESS 3 )
+- message( FATAL_ERROR "Invalid base package name! ${_xxxxx}" )
+- endif()
+-
+- math( EXPR _n "${_n} - 2" ) # (want the last two characters)
+-
+- string( SUBSTRING ${_xxxxx} 0 ${_n} BASENAME )
+- string( SUBSTRING ${_xxxxx} ${_n} -1 BITNESS )
+-
+- if( NOT BITNESS STREQUAL "32" AND
+- NOT BITNESS STREQUAL "64" )
+- message( FATAL_ERROR "Invalid package architecture! ${BITNESS}" )
+- endif()
+-
+- #--------------------------------------------------------------------------
+- # Show results
+- #--------------------------------------------------------------------------
+-
+- set( SUFFIX "${BITNESS}${DBGCHAR}" )
+- set( FULLNAME "${BASENAME}${SUFFIX}" )
+-
+- trace( BASENAME )
+- trace( BITNESS )
+- trace( CONFIG )
+- trace( DBGCHAR )
+- trace( SUFFIX )
+- trace( FULLNAME )
+- trace( CMAKE_BINARY_DIR )
+-
+ #--------------------------------------------------------------------------
+ # Define the install directory
+ #--------------------------------------------------------------------------
+diff --git a/extra.txt b/extra.txt
+index dfb293d..6018eb6 100644
+--- a/extra.txt
++++ b/extra.txt
+@@ -2,10 +2,10 @@
+ # Define additional files to be installed
+ #------------------------------------------------------------------------------
+
+-install( FILES "decnumber.ICU-license.html" DESTINATION . )
+-install( FILES "decnumber.pdf" DESTINATION . )
+-install( FILES "decnumber.readme.txt" DESTINATION . )
+-install( FILES "decnumber.ERRATA" DESTINATION . )
++install( FILES "decnumber.ICU-license.html" DESTINATION ${CMAKE_INSTALL_DOCDIR} )
++install( FILES "decnumber.pdf" DESTINATION ${CMAKE_INSTALL_DOCDIR} )
++install( FILES "decnumber.readme.txt" DESTINATION ${CMAKE_INSTALL_DOCDIR} )
++install( FILES "decnumber.ERRATA" DESTINATION ${CMAKE_INSTALL_DOCDIR} )
+
+ #------------------------------------------------------------------------------
+
diff --git a/app-emulation/hercules-sdl-decnumber/hercules-sdl-decnumber-4.7.0.ebuild b/app-emulation/hercules-sdl-decnumber/hercules-sdl-decnumber-4.7.0.ebuild
new file mode 100644
index 000000000000..1b93ffd36baf
--- /dev/null
+++ b/app-emulation/hercules-sdl-decnumber/hercules-sdl-decnumber-4.7.0.ebuild
@@ -0,0 +1,20 @@
+# Copyright 2022-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake
+
+# Use ../hercules-sdl/files/gen_hashes.sh to identify the relevant
+# commit when tagging new versions.
+COMMIT="3aa2f4531b5fcbd0478ecbaf72ccc47079c67280"
+
+DESCRIPTION="ANSI C General Decimal Arithmetic Library"
+HOMEPAGE="https://github.com/SDL-Hercules-390/decNumber"
+SRC_URI="https://github.com/SDL-Hercules-390/decNumber/archive/${COMMIT}.tar.gz -> decNumber-${COMMIT}.tar.gz"
+
+S="${WORKDIR}/decNumber-${COMMIT}"
+LICENSE="icu"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc64"
+PATCHES=( "${FILESDIR}/cmakefix.patch" )
diff --git a/app-emulation/hercules-sdl-decnumber/hercules-sdl-decnumber-9999.ebuild b/app-emulation/hercules-sdl-decnumber/hercules-sdl-decnumber-9999.ebuild
new file mode 100644
index 000000000000..6c8be1db358a
--- /dev/null
+++ b/app-emulation/hercules-sdl-decnumber/hercules-sdl-decnumber-9999.ebuild
@@ -0,0 +1,14 @@
+# Copyright 2022-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit git-r3 cmake
+
+DESCRIPTION="ANSI C General Decimal Arithmetic Library"
+HOMEPAGE="https://github.com/SDL-Hercules-390/decNumber"
+EGIT_REPO_URI="https://github.com/SDL-Hercules-390/decNumber"
+
+LICENSE="icu"
+SLOT="0"
+PATCHES=( "${FILESDIR}/cmakefix.patch" )
diff --git a/app-emulation/hercules-sdl-decnumber/metadata.xml b/app-emulation/hercules-sdl-decnumber/metadata.xml
new file mode 100644
index 000000000000..54d5e56d442d
--- /dev/null
+++ b/app-emulation/hercules-sdl-decnumber/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person" proxied="yes">
+ <email>matoro_gentoo@matoro.tk</email>
+ <name>Matoro Mahri</name>
+ </maintainer>
+ <maintainer type="project" proxied="proxy">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <longdescription>
+ ANSI C General Decimal Arithmetic Library for use by the SDL-Hercules-390 emulator
+ </longdescription>
+ <upstream>
+ <remote-id type="github">SDL-Hercules-390/decNumber</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-emulation/hercules-sdl-softfloat/Manifest b/app-emulation/hercules-sdl-softfloat/Manifest
new file mode 100644
index 000000000000..d364134101ac
--- /dev/null
+++ b/app-emulation/hercules-sdl-softfloat/Manifest
@@ -0,0 +1,5 @@
+AUX cmakefix.patch 6490 BLAKE2B b1d7724c8422e1c73baddb4b593d2e5790d2c6f2e636bd13a64594fcdee2fd8d484d0c7c097d2b10496ecc551d1695de89d0e4173abda8a246e56d8c65cd66bb SHA512 ff5d7859a27e0c0bc0edd96f62d37decfe79be88b3101f60e5b39cce6f19db369fc0c805b1b1001264048e2809725191248ac488c47e84673a4d87be2b74700b
+DIST SoftFloat-4b0c326008e174610969c92e69178939ed80653d.tar.gz 237236 BLAKE2B 4d29161ebdb1b659a61a7c83cb2c5eee1b0874455d0e6f634d2fb70a4dd0200c0bd46961edf9e7f41fd84695278653e1073c2b0fe39bf252ca7242bafdcf6adc SHA512 549b144c63fdbbb0815650dfe9fb443a92fb8baeff33baeca1d25fa6226705ef149a1bdb80236c5debeb161bfaecd4cffe9f8d74298a83175c2ddeebb735c48c
+EBUILD hercules-sdl-softfloat-4.7.0.ebuild 633 BLAKE2B 32de467be978112dfd3ab27fec2122fe5c5626abc1ecb4db0725ecd39bcee08e2dae3f8259368f3a6f56608073b75881614cd6f9925af84f34e72b29dd8301a5 SHA512 48fbfa5c87c621abc685f3fe0821393872c2baa8163f1d24315378a0e97d153886a0a02696976a8083e156f520d2408c9ad01782b1ec6397f5837a487d8f3d5d
+EBUILD hercules-sdl-softfloat-9999.ebuild 377 BLAKE2B 839dfa750fa9527de9ffa53b713c209060d75f9e3f3a9f2672f12fcd1bddfd813ca33169c128e52d630eee7905c2b2a848624519d0e9e56dcb0a9cefaa7089c0 SHA512 7bd61aab9418ad70669d7ed4069dd0638f5d51d74527102d5edd208fb5937f2012df1f90b4d81ce664247c4f09a7dd4b947999090233f670fe9725df6719d096
+MISC metadata.xml 618 BLAKE2B 32de0cc21779c574887e53d21ff103f956baacea2b749a14351ff8bda37f94d25c6b2921febd7964c257f51112c5feacb92033cf4e0c108f1429013cade1c2ac SHA512 903c2f25a8162c32ed8f1cb9bb917c9e211f49c52c7526d407f3366fb7a154df549f006303238f99dae6951493193b2d7eef596ad3297acdcac9b536c11a7c26
diff --git a/app-emulation/hercules-sdl-softfloat/files/cmakefix.patch b/app-emulation/hercules-sdl-softfloat/files/cmakefix.patch
new file mode 100644
index 000000000000..21796e3cda00
--- /dev/null
+++ b/app-emulation/hercules-sdl-softfloat/files/cmakefix.patch
@@ -0,0 +1,159 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index a316b76..50176f0 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -6,6 +6,8 @@ cmake_minimum_required( VERSION 3.2 )
+
+ cmake_policy( SET CMP0048 NEW )
+
++include( GNUInstallDirs )
++
+ #------------------------------------------------------------------------------
+ # Define the project
+ #------------------------------------------------------------------------------
+@@ -131,8 +133,8 @@ set_target_properties( ${FULLNAME} PROPERTIES
+ COMPILE_PDB_NAME ${FULLNAME} )
+
+ install( TARGETS ${FULLNAME}
+- PUBLIC_HEADER DESTINATION include
+- ARCHIVE DESTINATION ${LIB_INSTALL_DIR} )
++ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_LIBDIR}/hercules-sdl/include
++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/hercules-sdl/lib )
+
+
+ #------------------------------------------------------------------------------
+diff --git a/cmake/modules/ParseBinaryDir.cmake b/cmake/modules/ParseBinaryDir.cmake
+index 7983107..2ede77b 100644
+--- a/cmake/modules/ParseBinaryDir.cmake
++++ b/cmake/modules/ParseBinaryDir.cmake
+@@ -7,6 +7,8 @@ macro( ParseBinaryDir )
+ set( CMAKE_DISABLE_IN_SOURCE_BUILD ON )
+ set( CMAKE_DISABLE_SOURCE_CHANGES ON )
+
++ set( FULLNAME ${EXTPKG_NAME} )
++
+ #--------------------------------------------------------------------------
+ # Make sure they are not trying to do an "in source" build by making
+ # sure the cmake "binary" (build) directory is not a subdirectory of
+@@ -48,102 +50,6 @@ Remove the 'CMakeCache.txt' file and the entire 'CMakeFiles' directory and try a
+
+ TEST_BIG_ENDIAN( IS_BIG_ENDIAN )
+
+- #--------------------------------------------------------------------------
+- # Split the binary build directory into its constituent components.
+- # Refer to the "BUILDING" document for more information.
+- #--------------------------------------------------------------------------
+-
+- get_filename_component( BINARY_HLQ "${CMAKE_BINARY_DIR}" DIRECTORY )
+- get_filename_component( BINARY_DIR "${CMAKE_BINARY_DIR}" NAME )
+-
+- trace( BINARY_HLQ )
+- trace( BINARY_DIR )
+-
+- string( FIND ${BINARY_DIR} " " _n )
+- if( NOT ${_n} EQUAL -1 )
+- message( FATAL_ERROR "Build directory name cannot have spaces! ${BINARY_DIR}" )
+- endif()
+-
+- #--------------------------------------------------------------------------
+- # First, split it into two parts: before the dot and after the dot
+- #--------------------------------------------------------------------------
+-
+- string( REGEX MATCH "([^\\.]*)" _xxxxx ${BINARY_DIR} )
+- string( REGEX MATCH "([^.]*\$)" CONFIG ${BINARY_DIR} )
+-
+- trace( _xxxxx )
+- trace( CONFIG )
+-
+- #--------------------------------------------------------------------------
+- # The second part tells us if this is a "Debug" or "Release" build.
+- #--------------------------------------------------------------------------
+-
+- string( LENGTH ${CONFIG} _n )
+- if( ${_n} LESS 1 )
+- message( FATAL_ERROR "Invalid Release/Debug build type! ${CONFIG}" )
+- endif()
+-
+- #--------------------------------------------------------------------------
+- # Capitalize "Debug" and "Release" for Visual Studio compatibility.
+- #--------------------------------------------------------------------------
+-
+- include( CapitalizeWord )
+-
+- Capitalize_Word( ${CONFIG} CONFIG )
+-
+- if(( NOT CONFIG STREQUAL "Debug" ) AND (NOT CONFIG STREQUAL "Release" ))
+- message( FATAL_ERROR "Invalid Release/Debug build type! ${CONFIG}" )
+- endif()
+-
+- #--------------------------------------------------------------------------
+- # Define the "Debug" or "Release" build type
+- #--------------------------------------------------------------------------
+-
+- if( CONFIG STREQUAL "Debug" )
+- set( CMAKE_BUILD_TYPE "Debug" CACHE PATH "" FORCE )
+- set( DBGCHAR "d" )
+- elseif( CONFIG STREQUAL "Release" )
+- set( CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE PATH "" FORCE )
+- set( DBGCHAR "" )
+- endif()
+-
+- trace( CMAKE_BUILD_TYPE )
+-
+- #--------------------------------------------------------------------------
+- # Now split the first part into the base package/product name
+- # and build architecture (32-bit ot 64-bit).
+- #--------------------------------------------------------------------------
+-
+- string( LENGTH ${_xxxxx} _n )
+- if( ${_n} LESS 3 )
+- message( FATAL_ERROR "Invalid base package name! ${_xxxxx}" )
+- endif()
+-
+- math( EXPR _n "${_n} - 2" ) # (want the last two characters)
+-
+- string( SUBSTRING ${_xxxxx} 0 ${_n} BASENAME )
+- string( SUBSTRING ${_xxxxx} ${_n} -1 BITNESS )
+-
+- if( NOT BITNESS STREQUAL "32" AND
+- NOT BITNESS STREQUAL "64" )
+- message( FATAL_ERROR "Invalid package architecture! ${BITNESS}" )
+- endif()
+-
+- #--------------------------------------------------------------------------
+- # Show results
+- #--------------------------------------------------------------------------
+-
+- set( SUFFIX "${BITNESS}${DBGCHAR}" )
+- set( FULLNAME "${BASENAME}${SUFFIX}" )
+-
+- trace( BASENAME )
+- trace( BITNESS )
+- trace( CONFIG )
+- trace( DBGCHAR )
+- trace( SUFFIX )
+- trace( FULLNAME )
+- trace( CMAKE_BINARY_DIR )
+-
+ #--------------------------------------------------------------------------
+ # Define the install directory
+ #--------------------------------------------------------------------------
+diff --git a/extra.txt b/extra.txt
+index dfb293d..6018eb6 100644
+--- a/extra.txt
++++ b/extra.txt
+@@ -2,10 +2,10 @@
+ # Define additional files to be installed
+ #------------------------------------------------------------------------------
+
+-install( FILES "softfloat.LICENSE.txt" DESTINATION . )
+-install( FILES "softfloat.README.txt" DESTINATION . )
+-install( FILES "softfloat.README.html" DESTINATION . )
+-install( DIRECTORY "doc/" DESTINATION doc )
++install( FILES "softfloat.LICENSE.txt" DESTINATION ${CMAKE_INSTALL_DOCDIR} )
++install( FILES "softfloat.README.txt" DESTINATION ${CMAKE_INSTALL_DOCDIR} )
++install( FILES "softfloat.README.html" DESTINATION ${CMAKE_INSTALL_DOCDIR} )
++install( DIRECTORY "doc/" DESTINATION ${CMAKE_INSTALL_DOCDIR} )
+
+ #------------------------------------------------------------------------------
+
diff --git a/app-emulation/hercules-sdl-softfloat/hercules-sdl-softfloat-4.7.0.ebuild b/app-emulation/hercules-sdl-softfloat/hercules-sdl-softfloat-4.7.0.ebuild
new file mode 100644
index 000000000000..562f9aca52d4
--- /dev/null
+++ b/app-emulation/hercules-sdl-softfloat/hercules-sdl-softfloat-4.7.0.ebuild
@@ -0,0 +1,20 @@
+# Copyright 2022-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake
+
+# Use ../hercules-sdl/files/gen_hashes.sh to identify the relevant
+# commit when tagging new versions.
+COMMIT="4b0c326008e174610969c92e69178939ed80653d"
+
+DESCRIPTION="Berkeley IEEE Binary Floating-Point Library"
+HOMEPAGE="https://github.com/SDL-Hercules-390/SoftFloat"
+SRC_URI="https://github.com/SDL-Hercules-390/SoftFloat/archive/${COMMIT}.tar.gz -> SoftFloat-${COMMIT}.tar.gz"
+
+S="${WORKDIR}/SoftFloat-${COMMIT}"
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc64"
+PATCHES=( "${FILESDIR}/cmakefix.patch" )
diff --git a/app-emulation/hercules-sdl-softfloat/hercules-sdl-softfloat-9999.ebuild b/app-emulation/hercules-sdl-softfloat/hercules-sdl-softfloat-9999.ebuild
new file mode 100644
index 000000000000..aa8e20b71b90
--- /dev/null
+++ b/app-emulation/hercules-sdl-softfloat/hercules-sdl-softfloat-9999.ebuild
@@ -0,0 +1,14 @@
+# Copyright 2022-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit git-r3 cmake
+
+DESCRIPTION="Berkeley IEEE Binary Floating-Point Library"
+HOMEPAGE="https://github.com/SDL-Hercules-390/SoftFloat"
+EGIT_REPO_URI="https://github.com/SDL-Hercules-390/SoftFloat"
+
+LICENSE="BSD"
+SLOT="0"
+PATCHES=( "${FILESDIR}/cmakefix.patch" )
diff --git a/app-emulation/hercules-sdl-softfloat/metadata.xml b/app-emulation/hercules-sdl-softfloat/metadata.xml
new file mode 100644
index 000000000000..36219eca3e6d
--- /dev/null
+++ b/app-emulation/hercules-sdl-softfloat/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person" proxied="yes">
+ <email>matoro_gentoo@matoro.tk</email>
+ <name>Matoro Mahri</name>
+ </maintainer>
+ <maintainer type="project" proxied="proxy">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <longdescription>
+ Berkeley IEEE Binary Floating-Point Library for use by the SDL-Hercules-390 emulator
+ </longdescription>
+ <upstream>
+ <remote-id type="github">SDL-Hercules-390/SoftFloat</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-emulation/hercules-sdl-telnet/Manifest b/app-emulation/hercules-sdl-telnet/Manifest
new file mode 100644
index 000000000000..6a87f9fda2d8
--- /dev/null
+++ b/app-emulation/hercules-sdl-telnet/Manifest
@@ -0,0 +1,5 @@
+AUX cmakefix.patch 6162 BLAKE2B 20521d9a73e76437e42d03dd1a60e8f17829ded646bb30c821b41cd93e02a2883d1bd091798735599d4aff785c35a8722db731e3456fb0d5f346b44ce89b44ab SHA512 53e97b45af0500e3d5464e65bf0fd215768b07f1b2d549ce75c9bc429c285fd2a40c2a4f31b982868a5ffb8c9db6910c5277273f0bbf790b5eabaad7ac18bd10
+DIST telnet-729f0b688c1426018112c1e509f207fb5f266efa.tar.gz 67277 BLAKE2B 720b292adbe6c1273221d57f74018c08c529b5766dbe623f04af5b14ec3fa9c56f749395aa0f365da97b90a08549e378afbbd3634e4e11cd0418fa0f80d85a9c SHA512 e44df68cfba85b4f2e235c6b830cf89a10d66c635cfec933843c1695bdac33bf307b2e66c965a8b853723c2fd02419c40f80bcf6098be98f01472d9c3cebf1dd
+EBUILD hercules-sdl-telnet-4.7.0.ebuild 630 BLAKE2B 7dc5b0a4bae2303b4d796def572122bf8da5c093d87548319ea219a33b22df113fc52fdc1ce093d48dbde3881a041a941f4daa9fcf08d4bca01f435f9a95f3dc SHA512 1b76e16d7e5e5718e96a82b9880cfc31adf63ab7c6b99e9e89f5fdf3ba6f88e9a619688b9c9388c4d02c819c457de35b7c8f49b79c46b61603213c442e4334c1
+EBUILD hercules-sdl-telnet-9999.ebuild 380 BLAKE2B 52f885ec5183c4bd540a98fd1600ba40108a3f0b80c31e91d076ac2b687997f6167634784f884d099eac2603f4cbf06c4398039dc836f622f7420973bf5e1c13 SHA512 7fc8d84644a05038d92dd9f8f6307e85dfc95790d4d33c309c5968c9d4ef0d29ca744c87d1a87e72835e5714e8a57c0d724acfd75a6b39f58f849c7af8fb0667
+MISC metadata.xml 612 BLAKE2B 6d645d5b7e66b6b9111cdecbc69937cc213bcecdba01dc85f4885d91408f9b91bff260eee950272fa60c90243c6c1d8260b91882de5ce8b443773ee963a9f0fa SHA512 d75830e03c28ade48b595f69b880c35e6226438b8257f3358c558c54885cab83d7c2b88167d681c909276273fede7942cd3c4bbaa8d6cc54cfca6a7b3b5a134e
diff --git a/app-emulation/hercules-sdl-telnet/files/cmakefix.patch b/app-emulation/hercules-sdl-telnet/files/cmakefix.patch
new file mode 100644
index 000000000000..76fd8513213a
--- /dev/null
+++ b/app-emulation/hercules-sdl-telnet/files/cmakefix.patch
@@ -0,0 +1,155 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index a316b76..50176f0 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -6,6 +6,8 @@ cmake_minimum_required( VERSION 3.2 )
+
+ cmake_policy( SET CMP0048 NEW )
+
++include( GNUInstallDirs )
++
+ #------------------------------------------------------------------------------
+ # Define the project
+ #------------------------------------------------------------------------------
+@@ -131,8 +133,8 @@ set_target_properties( ${FULLNAME} PROPERTIES
+ COMPILE_PDB_NAME ${FULLNAME} )
+
+ install( TARGETS ${FULLNAME}
+- PUBLIC_HEADER DESTINATION include
+- ARCHIVE DESTINATION ${LIB_INSTALL_DIR} )
++ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_LIBDIR}/hercules-sdl/include
++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/hercules-sdl/lib )
+
+
+ #------------------------------------------------------------------------------
+diff --git a/cmake/modules/ParseBinaryDir.cmake b/cmake/modules/ParseBinaryDir.cmake
+index 7983107..2ede77b 100644
+--- a/cmake/modules/ParseBinaryDir.cmake
++++ b/cmake/modules/ParseBinaryDir.cmake
+@@ -7,6 +7,8 @@ macro( ParseBinaryDir )
+ set( CMAKE_DISABLE_IN_SOURCE_BUILD ON )
+ set( CMAKE_DISABLE_SOURCE_CHANGES ON )
+
++ set( FULLNAME ${EXTPKG_NAME} )
++
+ #--------------------------------------------------------------------------
+ # Make sure they are not trying to do an "in source" build by making
+ # sure the cmake "binary" (build) directory is not a subdirectory of
+@@ -48,102 +50,6 @@ Remove the 'CMakeCache.txt' file and the entire 'CMakeFiles' directory and try a
+
+ TEST_BIG_ENDIAN( IS_BIG_ENDIAN )
+
+- #--------------------------------------------------------------------------
+- # Split the binary build directory into its constituent components.
+- # Refer to the "BUILDING" document for more information.
+- #--------------------------------------------------------------------------
+-
+- get_filename_component( BINARY_HLQ "${CMAKE_BINARY_DIR}" DIRECTORY )
+- get_filename_component( BINARY_DIR "${CMAKE_BINARY_DIR}" NAME )
+-
+- trace( BINARY_HLQ )
+- trace( BINARY_DIR )
+-
+- string( FIND ${BINARY_DIR} " " _n )
+- if( NOT ${_n} EQUAL -1 )
+- message( FATAL_ERROR "Build directory name cannot have spaces! ${BINARY_DIR}" )
+- endif()
+-
+- #--------------------------------------------------------------------------
+- # First, split it into two parts: before the dot and after the dot
+- #--------------------------------------------------------------------------
+-
+- string( REGEX MATCH "([^\\.]*)" _xxxxx ${BINARY_DIR} )
+- string( REGEX MATCH "([^.]*\$)" CONFIG ${BINARY_DIR} )
+-
+- trace( _xxxxx )
+- trace( CONFIG )
+-
+- #--------------------------------------------------------------------------
+- # The second part tells us if this is a "Debug" or "Release" build.
+- #--------------------------------------------------------------------------
+-
+- string( LENGTH ${CONFIG} _n )
+- if( ${_n} LESS 1 )
+- message( FATAL_ERROR "Invalid Release/Debug build type! ${CONFIG}" )
+- endif()
+-
+- #--------------------------------------------------------------------------
+- # Capitalize "Debug" and "Release" for Visual Studio compatibility.
+- #--------------------------------------------------------------------------
+-
+- include( CapitalizeWord )
+-
+- Capitalize_Word( ${CONFIG} CONFIG )
+-
+- if(( NOT CONFIG STREQUAL "Debug" ) AND (NOT CONFIG STREQUAL "Release" ))
+- message( FATAL_ERROR "Invalid Release/Debug build type! ${CONFIG}" )
+- endif()
+-
+- #--------------------------------------------------------------------------
+- # Define the "Debug" or "Release" build type
+- #--------------------------------------------------------------------------
+-
+- if( CONFIG STREQUAL "Debug" )
+- set( CMAKE_BUILD_TYPE "Debug" CACHE PATH "" FORCE )
+- set( DBGCHAR "d" )
+- elseif( CONFIG STREQUAL "Release" )
+- set( CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE PATH "" FORCE )
+- set( DBGCHAR "" )
+- endif()
+-
+- trace( CMAKE_BUILD_TYPE )
+-
+- #--------------------------------------------------------------------------
+- # Now split the first part into the base package/product name
+- # and build architecture (32-bit ot 64-bit).
+- #--------------------------------------------------------------------------
+-
+- string( LENGTH ${_xxxxx} _n )
+- if( ${_n} LESS 3 )
+- message( FATAL_ERROR "Invalid base package name! ${_xxxxx}" )
+- endif()
+-
+- math( EXPR _n "${_n} - 2" ) # (want the last two characters)
+-
+- string( SUBSTRING ${_xxxxx} 0 ${_n} BASENAME )
+- string( SUBSTRING ${_xxxxx} ${_n} -1 BITNESS )
+-
+- if( NOT BITNESS STREQUAL "32" AND
+- NOT BITNESS STREQUAL "64" )
+- message( FATAL_ERROR "Invalid package architecture! ${BITNESS}" )
+- endif()
+-
+- #--------------------------------------------------------------------------
+- # Show results
+- #--------------------------------------------------------------------------
+-
+- set( SUFFIX "${BITNESS}${DBGCHAR}" )
+- set( FULLNAME "${BASENAME}${SUFFIX}" )
+-
+- trace( BASENAME )
+- trace( BITNESS )
+- trace( CONFIG )
+- trace( DBGCHAR )
+- trace( SUFFIX )
+- trace( FULLNAME )
+- trace( CMAKE_BINARY_DIR )
+-
+ #--------------------------------------------------------------------------
+ # Define the install directory
+ #--------------------------------------------------------------------------
+diff --git a/extra.txt b/extra.txt
+index dfb293d..6018eb6 100644
+--- a/extra.txt
++++ b/extra.txt
+@@ -2,8 +2,8 @@
+ # Define additional files to be installed
+ #------------------------------------------------------------------------------
+
+-install( FILES "telnet.LICENSE.txt" DESTINATION . )
+-install( FILES "telnet.README.txt" DESTINATION . )
++install( FILES "telnet.LICENSE.txt" DESTINATION ${CMAKE_INSTALL_DOCDIR} )
++install( FILES "telnet.README.txt" DESTINATION ${CMAKE_INSTALL_DOCDIR} )
+
+ #------------------------------------------------------------------------------
+
diff --git a/app-emulation/hercules-sdl-telnet/hercules-sdl-telnet-4.7.0.ebuild b/app-emulation/hercules-sdl-telnet/hercules-sdl-telnet-4.7.0.ebuild
new file mode 100644
index 000000000000..edd973959b15
--- /dev/null
+++ b/app-emulation/hercules-sdl-telnet/hercules-sdl-telnet-4.7.0.ebuild
@@ -0,0 +1,20 @@
+# Copyright 2022-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake
+
+# Use ../hercules-sdl/files/gen_hashes.sh to identify the relevant
+# commit when tagging new versions.
+COMMIT="729f0b688c1426018112c1e509f207fb5f266efa"
+
+DESCRIPTION="Simple RFC-complient TELNET implementation"
+HOMEPAGE="https://github.com/SDL-Hercules-390/telnet"
+SRC_URI="https://github.com/SDL-Hercules-390/telnet/archive/${COMMIT}.tar.gz -> telnet-${COMMIT}.tar.gz"
+
+S="${WORKDIR}/telnet-${COMMIT}"
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc64"
+PATCHES=( "${FILESDIR}/cmakefix.patch" )
diff --git a/app-emulation/hercules-sdl-telnet/hercules-sdl-telnet-9999.ebuild b/app-emulation/hercules-sdl-telnet/hercules-sdl-telnet-9999.ebuild
new file mode 100644
index 000000000000..f819096dd87c
--- /dev/null
+++ b/app-emulation/hercules-sdl-telnet/hercules-sdl-telnet-9999.ebuild
@@ -0,0 +1,14 @@
+# Copyright 2022-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit git-r3 cmake
+
+DESCRIPTION="Simple RFC-complient TELNET implementation"
+HOMEPAGE="https://github.com/SDL-Hercules-390/telnet"
+EGIT_REPO_URI="https://github.com/SDL-Hercules-390/telnet"
+
+LICENSE="public-domain"
+SLOT="0"
+PATCHES=( "${FILESDIR}/cmakefix.patch" )
diff --git a/app-emulation/hercules-sdl-telnet/metadata.xml b/app-emulation/hercules-sdl-telnet/metadata.xml
new file mode 100644
index 000000000000..7514393f2230
--- /dev/null
+++ b/app-emulation/hercules-sdl-telnet/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person" proxied="yes">
+ <email>matoro_gentoo@matoro.tk</email>
+ <name>Matoro Mahri</name>
+ </maintainer>
+ <maintainer type="project" proxied="proxy">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <longdescription>
+ Simple RFC-complient TELNET implementation for use by the SDL-Hercules-390 emulator
+ </longdescription>
+ <upstream>
+ <remote-id type="github">SDL-Hercules-390/telnet</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-emulation/hercules-sdl/Manifest b/app-emulation/hercules-sdl/Manifest
new file mode 100644
index 000000000000..a1ec3b0877bb
--- /dev/null
+++ b/app-emulation/hercules-sdl/Manifest
@@ -0,0 +1,10 @@
+AUX gen_hashes.sh 706 BLAKE2B 85e0f867ea7012a9859f75cf8802ce85b50b23c2a7b48a117983874e3e47a8695042da20eb26c9d47933fa5b9d4e8f1de644542be703d544693d287e978ca070 SHA512 060b413470ffd57b304dc091a57cbdac4cfb8c44f23230607ba16d133840fd27a4da47ed3965aaca6a65a14960cb5835675ee2d76f2345dc95add06de946f14b
+AUX hercules-3.13-htmldir.patch 960 BLAKE2B 2eccc3c00c2cbc6025d65c1baff374b7f86edee3b0c4eec8d3ca791bed84e13b8c6c2cc0cde7b890c2f138f74e9d22fc9014bcd94c22dbb336009ccc84c7f851 SHA512 42b35915ee13fb94187e67baf969098327f8a2bb118a8b356236cba89a3d8dc360366bae1aec7e9542474ed57df2a733d8fd756bac19fd735750fc63cb704a82
+AUX hercules-3.13-posix-test.patch 1184 BLAKE2B 4d87fe365de07270b3adea242e940ee2a8eea8c946b5f1c67ba0c4abfe3b51a656c5cba2b0154f2b8ff05d8a7a3414255c760eaa0e5a3922631c61d4355bf875 SHA512 23755468397fedc6dca0e1dd6c0c65323ebb32d29f642ee677279fcc00df369327eb8e0b7de6e1e9bbc90d591b6bdd0fedc7c150bea002617fb06ab6bf3d0ef6
+AUX hercules-3.13-unbundle-libltdl.patch 14102 BLAKE2B 45862802246327ae89a7778e2c27939dcc2e3d9db5cc0774d5c457799987a43093e07980add8d86cf3ab8010d9c0c66b6a7e8b315634f83a0df0a087c77305db SHA512 3be153d1baf29e066109e996fe9e3ec06c723f4ccbba997098a79b887324cd3041665d59eb3a1fa08698608e441a4755e9c52130e10624062d364d4ff91c926f
+AUX hercules-3.13-user-install.patch 655 BLAKE2B 1ec0fc4628312180ec0fbdc24f2da9b6dc4344143b4a92dad1d4cc90c8aaa8ca632800e0dfdb2a7af0795d4b2fa356ea73b340cfe01cce799ab284d69cf501df SHA512 e2ee00e9efb582bd5d02f9bbd1481b38db7eee91e721ebf4d3158a8b7e22086ba09b72b07b08f1a815ae24e0211b5e1181e3a3ae4f0316206ae3f8dc6c704d2a
+AUX hercules-sdl-4.4.1-htmldir.patch 774 BLAKE2B 3cf3c50c60059ae0bd042333c2220669f87aa37cf632d1bc2cec738e02ca5f74a2a4302e484a73b6e9df32edb8c4bf2c0a2198c32e1242cab970e4a819c254c1 SHA512 bae45addb0c4f339b93d9709119b7df5d330978e60b982349244b98a72b157f86180454fa82ff9918a082f705a06a379ff3212f59bd5c1777090bb0cf03b9795
+AUX hercules-sdl-4.4.1-unbundle-libltdl.patch 8078 BLAKE2B ff2e892071142067fce6f9a545c185cd62d167888948a0c45eefee8dd2f4a04fc0687593fff325eeef0dbae0c2c4787d618c83f53fd447e46387fae8f6e4cd1b SHA512 87d5ef1da708ce72f6244de1f12deacb49550acda47f62bb4a5320c909f9b4519ac489c2442c4a1778c9228d2f38c50b2f9f2c1c7450952e9a1101199d2bb7fa
+DIST hercules-sdl-4.7.tar.gz 25439384 BLAKE2B 78a8d2df947c80e23d0e956a25a4f009dd32b09f2834cc06373f685badf9f1e657bf0f4e4408c7085371c46085718998076f3a6063caf80c9161b1fa7caa91eb SHA512 9d7060c4e2687358b9547b59b47362d642cbf2bf009085fdd41e485170d0f81029ee3d04d12b905a3a266cd26a9087e92c231c3f4600c32a8535a6140656b7b0
+EBUILD hercules-sdl-4.7.0.ebuild 2604 BLAKE2B 916d399a2d0a53ade95495d1788399543ebe41000cb480307af7425c78cfe2adeaa53a753f9e66eedb3786a9d875794f1f44ef15a80653718bc02a8ed01add2d SHA512 1c4242b251e4b4d0ecf84b7e796a242ded35adeb686726bfe4833c0c4c1c69b0705f3216e6a31f24e9876a39b6315d228d65d149d8ca66a08cc77755f27abf47
+MISC metadata.xml 1141 BLAKE2B b630c058fe32f2410985e53779d387fc007759f2bd36ad8240a2b6a2157b6c5921cfb4aa14ed3b513e0f787d9838bab46a6ceadd031d33daa2a3190d2ca64095 SHA512 fe090b27c7d46e6a9fee40a9d948f4124814d134cb64ff7f7d7b2d341f1db9313f5d071e5c34a312a3dacbe643c8083ba98a3b0058fa3886b9d024d6ecb17575
diff --git a/app-emulation/hercules-sdl/files/gen_hashes.sh b/app-emulation/hercules-sdl/files/gen_hashes.sh
new file mode 100644
index 000000000000..bb499392a4a5
--- /dev/null
+++ b/app-emulation/hercules-sdl/files/gen_hashes.sh
@@ -0,0 +1,24 @@
+#!/usr/bin/env bash
+
+[[ -z "${1}" ]] && exit 1
+[[ "${1}" =~ [0-9]+\.[0-9]+\.[0-9]+ ]] || exit 1
+
+CLONEDIR="$(mktemp -d)"
+for f in "hyperion" "crypto" "decNumber" "SoftFloat" "telnet"
+do
+ git -C "${CLONEDIR}" clone --tags "https://github.com/SDL-Hercules-390/${f}"
+done
+
+VERSIONARR=( ${1//./ })
+VERSIONTAG="Release_${VERSIONARR[0]}.${VERSIONARR[1]}"
+[[ "${VERSIONARR[2]}" == "0" ]] || VERSIONTAG=".${VERSIONARR[2]}"
+RELEASEDATE="$(git -C "${CLONEDIR}/hyperion" show -s --format="%ci" "${VERSIONTAG}")"
+
+echo
+for f in "crypto" "decNumber" "SoftFloat" "telnet"
+do
+ echo -n "${f,,}: "
+ git -C "${CLONEDIR}/${f}" rev-list -n 1 --first-parent --before="${RELEASEDATE}" master
+done
+
+rm -rf "${CLONEDIR}"
diff --git a/app-emulation/hercules-sdl/files/hercules-3.13-htmldir.patch b/app-emulation/hercules-sdl/files/hercules-3.13-htmldir.patch
new file mode 100644
index 000000000000..962611b87edd
--- /dev/null
+++ b/app-emulation/hercules-sdl/files/hercules-3.13-htmldir.patch
@@ -0,0 +1,25 @@
+--- a/html/Makefile.am
++++ b/html/Makefile.am
+@@ -1,4 +1,4 @@
+-dist_pkgdata_DATA = cckddasd.html fishgui.html hercconf.html hercfaq.html \
++dist_html_DATA = cckddasd.html fishgui.html hercconf.html hercfaq.html \
+ hercinst.html herclic.html hercload.html hercmsca.html hercmscf.html \
+ hercmscp.html hercmsct.html hercmscu.html hercmsda.html hercmsdc.html \
+ hercmsdg.html hercmsdi.html hercmsdl.html hercmsds.html hercmsdt.html \
+@@ -12,7 +12,7 @@
+
+ include_sources = include/header.htmlpart include/footer.htmlpart
+
+-include_pkgdatadir = $(pkgdatadir)/include
++include_pkgdatadir = $(htmldir)/include
+
+ dist_include_pkgdata_DATA = $(include_sources)
+
+@@ -33,6 +33,6 @@
+ images/interruptu.gif images/redu.gif images/waitonu.gif \
+ images/loadd.gif images/restartd.gif
+
+-images_pkgdatadir = $(pkgdatadir)/images
++images_pkgdatadir = $(htmldir)/images
+
+ dist_images_pkgdata_DATA = $(images_sources)
diff --git a/app-emulation/hercules-sdl/files/hercules-3.13-posix-test.patch b/app-emulation/hercules-sdl/files/hercules-3.13-posix-test.patch
new file mode 100644
index 000000000000..abee4b0cc5ed
--- /dev/null
+++ b/app-emulation/hercules-sdl/files/hercules-3.13-posix-test.patch
@@ -0,0 +1,29 @@
+https://github.com/rbowler/spinhawk/pull/106
+
+From 9a9f7182069b8fe0483383c177882218244bad16 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Thu, 18 Nov 2021 02:32:02 -0500
+Subject: [PATCH] avoid bashism in test call
+
+POSIX test only supports =, not ==.
+---
+ autoconf/hercules.m4 | 2 +-
+ configure.ac | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index f12d47058562..8dd420af8d13 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -562,7 +562,7 @@ AC_CHECK_DECLS( SIOCADDRT, [hc_cv_have_siocaddrt=yes], [hc_
+ AC_CHECK_DECLS( SIOCDELRT, [hc_cv_have_siocdelrt=yes], [hc_cv_have_siocdelrt=no], [#include <linux/sockios.h>] )
+ AC_CHECK_DECLS( SIOCDIFADDR, [hc_cv_have_siocdifaddr=yes], [hc_cv_have_siocdifaddr=no], [#include <linux/sockios.h>] )
+
+-if test "$hc_cv_have_sys_mtio_h" == "yes"; then
++if test "$hc_cv_have_sys_mtio_h" = "yes"; then
+ AC_CHECK_DECLS( MTEWARN, [hc_cv_have_mtewarn=yes], [hc_cv_have_mtewarn=no], [#include <sys/mtio.h>] )
+ else
+ hc_cv_have_mtewarn=no
+--
+2.33.0
+
diff --git a/app-emulation/hercules-sdl/files/hercules-3.13-unbundle-libltdl.patch b/app-emulation/hercules-sdl/files/hercules-3.13-unbundle-libltdl.patch
new file mode 100644
index 000000000000..c96831d96ad2
--- /dev/null
+++ b/app-emulation/hercules-sdl/files/hercules-3.13-unbundle-libltdl.patch
@@ -0,0 +1,379 @@
+--- a/bootstrap.c
++++ b/bootstrap.c
+@@ -11,7 +11,7 @@
+ #include "hstdinc.h"
+ #include "hercules.h"
+ #if defined(HDL_USE_LIBTOOL)
+-#include "ltdl.h"
++#include <ltdl.h>
+ #endif
+
+ #if !defined( _MSVC_ )
+--- a/configure.ac
++++ b/configure.ac
+@@ -12,7 +12,7 @@
+ AC_REVISION($Revision$) # (the version of this configure.ac)
+ AC_CONFIG_AUX_DIR(autoconf) # (directory containing auxillary build tools)
+ AM_INIT_AUTOMAKE(hercules,3.13) # (the version of our software package)
+-AM_CONFIG_HEADER(config.h) # (the file the resulting configure script will produce)
++AC_CONFIG_HEADERS(config.h) # (the file the resulting configure script will produce)
+ AM_MAINTAINER_MODE()
+ AC_CANONICAL_HOST() # (sets $host_cpu, $host_vendor, and $host_os)
+ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+@@ -38,154 +38,8 @@
+ modexecdir='$(libdir)/$(PACKAGE)'
+ AC_SUBST(modexecdir)
+
+-
+-# -----------------------------------------------------------------------------
+-#
+-# AC_LIBTOOL_DLOPEN
+-#
+-# Enable checking for dlopen support. This macro should be used if the
+-# package makes use of the '-dlopen' and '-dlpreopen' flags, otherwise
+-# libtool will assume that the system does not support dlopening. The
+-# macro must be called before AC_PROG_LIBTOOL.
+-#
+-# -----------------------------------------------------------------------------
+-
+-AC_LIBTOOL_DLOPEN() # (we need libtool's dlopen support)
+-
+-
+-# -----------------------------------------------------------------------------
+-#
+-# AC_LIBTOOL_WIN32_DLL
+-#
+-# This macro should be used if the package has been ported to build
+-# clean dlls on win32 platforms. Usually this means that any library
+-# data items are exported with __declspec(dllexport) and imported with
+-# __declspec(dllimport). If this macro is not used, libtool will assume
+-# that the package libraries are not dll clean and will build only static
+-# libraries on win32 hosts.
+-#
+-# This macro must be called before AC_PROG_LIBTOOL, and provision must
+-# be made to pass '-no-undefined' to libtool in link mode from the package
+-# Makefile. Naturally, if you pass '-no-undefined', you must ensure that
+-# all the library symbols really are defined at link time!
+-#
+-# -----------------------------------------------------------------------------
+-
+-AC_LIBTOOL_WIN32_DLL() # (we need Win32 support in libtool)
+-
+-
+-# -----------------------------------------------------------------------------
+-# See: 'AC_PROG_LIBTOOL' below.
+-# -----------------------------------------------------------------------------
+-
+-AC_DISABLE_STATIC() # (forces libtool to build shared
+-
+- # libraries instead of static ones)
+-# -----------------------------------------------------------------------------
+-# AC_PROG_LIBTOOL
+-#
+-# Add support for the '--enable-shared' and '--disable-shared'
+-# configure flags. By default, this macro turns on shared libraries
+-# if they are available, and also enables static libraries if they
+-# don't conflict with the shared libraries. You can modify these
+-# defaults by calling either the AC_DISABLE_SHARED or AC_DISABLE_STATIC
+-# macros.
+-#
+-# Hercules REQUIRES shared libraries (i.e. DLLs), so we do indeed use
+-# the AC_DISABLE_STATIC macro above.
+-#
+-# -----------------------------------------------------------------------------
+-
+-AC_PROG_LIBTOOL() # (we build libtool for ourselves)
+-
+-
+-# -----------------------------------------------------------------------------
+-#
+-# AC_LIB_LTDL
+-#
+-# Even though libltdl is installed together with libtool, you may wish
+-# to include libltdl in the distribution of your package, for the convenience
+-# of users of your package that don't have libtool or libltdl installed.
+-#
+-# The most simplistic way to add libltdl to your package is to copy the
+-# source files, 'ltdl.c' and 'ltdl.h', to a source directory withing your
+-# package and to build and link them along with the rest of your sources.
+-#
+-# To do this, you must add a call to the 'AC_LIB_LTDL' macro to your package's
+-# 'configure.in' to perform the required configure time checks in order that
+-# 'ltdl.o' is built correctly.
+-#
+-# This method does have its problems though: if you try to link the package
+-# binaries with an installed libltdl, or a library which depends on libltdl,
+-# you may have problems with duplicate symbol definitions.
+-#
+-# In order to enable this flavor of libltdl, you should add the line
+-# 'AC_LIBLTDL_CONVENIENCE' to your `configure.in', before 'AC_PROG_LIBTOOL'.
+-#
+-# In order to select the installable version of libltdl, you should add a
+-# call of the macro 'AC_LIBLTDL_INSTALLABLE' to your 'configure.in' before
+-# 'AC_PROG_LIBTOOL'. This macro will check whether libltdl is already
+-# installed and, if not, request the libltdl embedded in your package to be
+-# built and installed.
+-#
+-# Whatever macro you use, it is up to you to ensure that your 'configure.in'
+-# will configure libltdl, using 'AC_CONFIG_SUBDIRS', and that your 'Makefile's
+-# will start sub-makes within libltdl's directory, using automake's SUBDIRS,
+-# for example. Both macros define the shell variables LIBLTDL, to the link flag
+-# that you should use to link with libltdl, and LTDLINCL, to the preprocessor
+-# flag that you should use to compile with programs that include 'ltdl.h'. It
+-# is up to you to use 'AC_SUBST' to ensure that this variable will be available
+-# in 'Makefile's, or add them to variables that are 'AC_SUBST'ed by default,
+-# such as LIBS and CPPFLAGS.
+-#
+-# So, when you want to link a program with libltdl, be it a convenience,
+-# installed or installable library, just compile with '$(LTDLINCL)' and link
+-# it with '$(LIBLTDL)', using libtool.
+-#
+-# You should probably also add 'AC_LIBTOOL_DLOPEN' to your 'configure.in' before
+-# 'AC_PROG_LIBTOOL', otherwise libtool will assume no dlopening mechanism is
+-# supported, and revert to dlpreopening, which is probably not what you want.
+-#
+-# The following example shows you how to embed the convenience libltdl
+-# in your package. In order to use the installable variant just replace
+-# 'AC_LIBLTDL_CONVENIENCE' with 'AC_LIBLTDL_INSTALLABLE'. We assume that libltdl
+-# was embedded using 'libtoolize --ltdl':
+-#
+-# configure.in:
+-#
+-# ...
+-# dnl Enable building of the convenience library
+-# dnl and set LIBLTDL accordingly
+-# AC_LIBLTDL_CONVENIENCE
+-# dnl Substitute LTDLINCL and LIBLTDL in the Makefiles
+-# AC_SUBST(LTDLINCL)
+-# AC_SUBST(LIBLTDL)
+-# dnl Check for dlopen support
+-# AC_LIBTOOL_DLOPEN
+-# dnl Configure libtool
+-# AC_PROG_LIBTOOL
+-# dnl Configure libltdl
+-# AC_CONFIG_SUBDIRS(libltdl)
+-# ...
+-#
+-# Makefile.am:
+-#
+-# ...
+-# SUBDIRS = libltdl
+-#
+-# INCLUDES = $(LTDLINCL)
+-#
+-# myprog_LDFLAGS = -export-dynamic
+-# # The quotes around -dlopen below fool automake <= 1.4 into accepting it
+-# myprog_LDADD = $(LIBLTDL) "-dlopen" self "-dlopen" foo1.la
+-# myprog_DEPENDENCIES = $(LIBLTDL) foo1.la
+-# ...
+-#
+-# -----------------------------------------------------------------------------
+-
+-AC_LIB_LTDL() # (we need the ltdl libtool library)
+-AC_SUBST([LIBTOOL_DEPS]) # (see PROGRAMMING NOTE above)
+-
++LT_PREREQ([2.2.6])
++LT_INIT([dlopen win32-dll disable-static])
+
+ # -----------------------------------------------------------------------------
+ # (See comments in the 'AC_CHECK_LIB' Libraries section further below)
+--- a/crypto/Makefile.am
++++ b/crypto/Makefile.am
+@@ -23,7 +23,6 @@
+
+ if OPTION_DYNAMIC_LOAD
+ DYNSRC =
+- LTDL = ../ltdl.c
+
+ DYNMOD_LD_FLAGS = -module \
+ -no-undefined \
+@@ -31,7 +30,7 @@
+ -export-dynamic \
+ -avoid-version
+
+- DYNMOD_LD_ADD = $(LDADD)
++ DYNMOD_LD_ADD = $(LDADD) -lltdl
+
+ LIB_LD_FLAGS = -export-dynamic \
+ $(XSTATIC) \
+@@ -39,7 +38,6 @@
+ -avoid-version
+ else
+ DYNSRC = $(dyndev_SRC)
+- LTDL =
+ DYNMOD_LD_FLAGS =
+ DYNMOD_LD_ADD =
+ LIB_LD_FLAGS = $(XSTATIC) \
+--- a/decNumber/Makefile.am
++++ b/decNumber/Makefile.am
+@@ -37,13 +37,13 @@
+ endif
+
+ if OPTION_DYNAMIC_LOAD
+- LTDL = ../ltdl.c
++ LIB_LD_ADD = -lltdl
+ LIB_LD_FLAGS = -export-dynamic \
+ $(XSTATIC) \
+ -no-undefined \
+ -avoid-version
+ else
+- LTDL =
++ LIB_LD_ADD =
+ LIB_LD_FLAGS = $(XSTATIC) \
+ -no-undefined \
+ -avoid-version
+@@ -56,7 +56,7 @@
+
+ libdecNumber_la_SOURCES = $(decNumber_SRC)
+ libdecNumber_la_LDFLAGS = $(LIB_LD_FLAGS)
+- libdecNumber_la_LIBADD = $(LDADD)
++ libdecNumber_la_LIBADD = $(LDADD) $(LIB_LD_ADD)
+
+ noinst_HEADERS = decContext.h \
+ decDPD.h \
+--- a/fillfnam.c
++++ b/fillfnam.c
+@@ -5,6 +5,8 @@
+ #include "hercules.h"
+ #include "fillfnam.h"
+
++#include <dirent.h>
++
+ /* On Solaris 2.9 (SunOS 5.9) and earlier, there is no scandir
+ and alphasort function. In this case fillfnam does nothing
+ and the tab command is effectively a no-operation */
+--- a/herclin.c
++++ b/herclin.c
+@@ -26,7 +26,7 @@
+ /* This must be included if HDL uses the */
+ /* libtool ltdl convenience library */
+
+-#include "ltdl.h"
++#include <ltdl.h>
+ #endif
+
+
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -98,7 +98,7 @@
+
+ if OPTION_DYNAMIC_LOAD
+ DYNSRC =
+- LTDL = ltdl.c
++ LIB_LD_ADD = -lltdl
+
+ DYNMOD_LD_FLAGS = -module \
+ -no-undefined \
+@@ -109,7 +109,8 @@
+ DYNMOD_LD_ADD = libherc.la \
+ libhercs.la \
+ libhercu.la \
+- $(LDADD)
++ $(LDADD) \
++ $(LIB_LD_ADD)
+
+ LIB_LD_FLAGS = -export-dynamic \
+ $(XSTATIC) \
+@@ -117,7 +118,6 @@
+ -avoid-version
+ else
+ DYNSRC = $(dyndev_SRC)
+- LTDL =
+ DYNMOD_LD_FLAGS =
+ DYNMOD_LD_ADD =
+ LIB_LD_FLAGS = $(XSTATIC) \
+@@ -295,12 +295,11 @@
+ memrchr.c \
+ parser.c \
+ pttrace.c \
+- $(FTHREADS) \
+- $(LTDL)
++ $(FTHREADS)
+
+ libhercu_la_LDFLAGS = $(LIB_LD_FLAGS)
+
+- libhercu_la_LIBADD = $(LDADD) libhercs.la
++ libhercu_la_LIBADD = $(LDADD) libhercs.la $(LIB_LD_ADD)
+
+ #
+ # Core Hercules (shared) library
+@@ -372,8 +371,7 @@
+ memrchr.c \
+ $(dynamic_SRC) \
+ $(extra_SRC) \
+- $(dyndev_SRC) \
+- ltdl.c
++ $(dyndev_SRC)
+
+ libherc_la_LDFLAGS = $(LIB_LD_FLAGS)
+
+@@ -383,7 +381,8 @@
+ libhercd.la \
+ decNumber/libdecNumber.la \
+ softfloat/libsoftfloat.la \
+- $(LDADD)
++ $(LDADD) \
++ $(LIB_LD_ADD)
+
+ #
+ # THIS is the hercules executable.
+@@ -440,7 +439,7 @@
+ hercules_SOURCES = bootstrap.c \
+ hdlmain.c
+
+- hercules_LDADD = libherc.la libhercs.la $(LDADD)
++ hercules_LDADD = libherc.la libhercs.la $(LDADD) $(LIB_LD_ADD)
+
+ hercules_LDFLAGS = $(HLDFLAGS)
+
+@@ -656,7 +655,6 @@
+ hdl.h \
+ crypto.h \
+ sockdev.h \
+- ltdl.h \
+ herc_getopt.h \
+ service.h \
+ chsc.h \
+--- a/softfloat/Makefile.am
++++ b/softfloat/Makefile.am
+@@ -22,13 +22,11 @@
+ endif
+
+ if OPTION_DYNAMIC_LOAD
+- LTDL = ../ltdl.c
+ LIB_LD_FLAGS = -export-dynamic \
+ $(XSTATIC) \
+ -no-undefined \
+ -avoid-version
+ else
+- LTDL =
+ LIB_LD_FLAGS = $(XSTATIC) \
+ -no-undefined \
+ -avoid-version
+--- a/autoconf/hercules.m4
++++ b/autoconf/hercules.m4
+@@ -270,7 +270,7 @@
+
+ else
+
+- if test $(./libtool --features | fgrep "enable shared libraries" | wc -l) -ne 1; then
++ if test "$enable_shared" != "yes"; then
+
+ # Libtool doesn't support shared libraries,
+ # and thus our wrapper kludge is not needed.
+@@ -280,11 +280,11 @@
+ }
+ DUPGETOPT2
+
+- ./libtool --mode=compile ${CC-cc} conftest1.c -c -o conftest1.lo > /dev/null 2>&1
+- ./libtool --mode=compile ${CC-cc} conftest2.c -c -o conftest2.lo > /dev/null 2>&1
++ libtool --mode=compile ${CC-cc} conftest1.c -c -o conftest1.lo > /dev/null 2>&1
++ libtool --mode=compile ${CC-cc} conftest2.c -c -o conftest2.lo > /dev/null 2>&1
+
+- ./libtool --mode=link ${CC-cc} -shared -rpath /lib -no-undefined conftest1.lo -o libconftest1.la > /dev/null 2>&1
+- ./libtool --mode=link ${CC-cc} -shared -rpath /lib -no-undefined conftest2.lo libconftest1.la -o libconftest2.la > /dev/null 2>&1
++ libtool --mode=link ${CC-cc} -shared -rpath /lib -no-undefined conftest1.lo -o libconftest1.la > /dev/null 2>&1
++ libtool --mode=link ${CC-cc} -shared -rpath /lib -no-undefined conftest2.lo libconftest1.la -o libconftest2.la > /dev/null 2>&1
+
+ if test $? = 0; then
+
diff --git a/app-emulation/hercules-sdl/files/hercules-3.13-user-install.patch b/app-emulation/hercules-sdl/files/hercules-3.13-user-install.patch
new file mode 100644
index 000000000000..bcde1181e873
--- /dev/null
+++ b/app-emulation/hercules-sdl/files/hercules-3.13-user-install.patch
@@ -0,0 +1,21 @@
+the ebuild will handle these, so no need to do it directly which will fail when
+building as non-root.
+
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -730,15 +730,6 @@ endif
+ (cd $(DESTDIR)$(bindir); @LN_S@ ./dasdcopy$(EXEEXT) cfba2fba$(EXEEXT))
+ rm -f $(DESTDIR)$(bindir)/cckd2ckd$(EXEEXT)
+ (cd $(DESTDIR)$(bindir); @LN_S@ ./dasdcopy$(EXEEXT) cckd2ckd$(EXEEXT))
+-if SETUID_HERCIFC
+- chown root $(DESTDIR)$(bindir)/hercifc
+-if HERCIFC_GROUPSET
+- chgrp $(HERCIFC_GROUPNAME) $(DESTDIR)$(bindir)/hercifc
+-endif
+- chmod 0750 $(DESTDIR)$(bindir)/hercifc
+- chmod +s $(DESTDIR)$(bindir)/hercifc
+- rm hercifc
+-endif
+
+ uninstall-local:
+
diff --git a/app-emulation/hercules-sdl/files/hercules-sdl-4.4.1-htmldir.patch b/app-emulation/hercules-sdl/files/hercules-sdl-4.4.1-htmldir.patch
new file mode 100644
index 000000000000..50b30cca91dd
--- /dev/null
+++ b/app-emulation/hercules-sdl/files/hercules-sdl-4.4.1-htmldir.patch
@@ -0,0 +1,29 @@
+diff --git a/html/Makefile.am b/html/Makefile.am
+index b4d21d0..1e5af4c 100644
+--- a/html/Makefile.am
++++ b/html/Makefile.am
+@@ -1,5 +1,5 @@
+
+-dist_pkgdata_DATA = \
++dist_html_DATA = \
+ cckddasd.html \
+ fishgui.html \
+ hercconf.html \
+@@ -62,7 +62,7 @@ include_sources = \
+ include/footer.htmlpart \
+ include/header.htmlpart
+
+-include_pkgdatadir = $(pkgdatadir)/include
++include_pkgdatadir = $(htmldir)/include
+
+ dist_include_pkgdata_DATA = $(include_sources)
+
+@@ -120,7 +120,7 @@ images_sources = \
+ images/waitoffu.gif \
+ images/waitonu.gif
+
+-images_pkgdatadir = $(pkgdatadir)/images
++images_pkgdatadir = $(htmldir)/images
+
+ dist_images_pkgdata_DATA = $(images_sources)
+
diff --git a/app-emulation/hercules-sdl/files/hercules-sdl-4.4.1-unbundle-libltdl.patch b/app-emulation/hercules-sdl/files/hercules-sdl-4.4.1-unbundle-libltdl.patch
new file mode 100644
index 000000000000..e5bb86fbebcf
--- /dev/null
+++ b/app-emulation/hercules-sdl/files/hercules-sdl-4.4.1-unbundle-libltdl.patch
@@ -0,0 +1,179 @@
+diff --git a/autoconf/hercules.m4 b/autoconf/hercules.m4
+index cb962f5..31d641c 100755
+--- a/autoconf/hercules.m4
++++ b/autoconf/hercules.m4
+@@ -263,7 +263,7 @@ AC_DEFUN([_HC_CHECK_NEED_GETOPT_WRAPPER],
+
+ else
+
+- if test $(libtool --features | fgrep "enable shared libraries" | wc -l) -ne 1; then
++ if test "$enable_shared" != "yes"; then
+
+ # Libtool doesn't support shared libraries,
+ # and thus our wrapper kludge is not needed.
+diff --git a/configure.ac b/configure.ac
+index c657251..af23407 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -325,41 +325,6 @@ fi
+ modexecdir='$(libdir)/$(PACKAGE)'
+ AC_SUBST(modexecdir)
+
+-
+-# -----------------------------------------------------------------------------
+-#
+-# AC_LIBTOOL_DLOPEN
+-#
+-# Enable checking for dlopen support. This macro should be used if the
+-# package makes use of the '-dlopen' and '-dlpreopen' flags, otherwise
+-# libtool will assume that the system does not support dlopening. The
+-# macro must be called before AC_PROG_LIBTOOL.
+-#
+-# -----------------------------------------------------------------------------
+-
+-AC_LIBTOOL_DLOPEN() # (we need libtool's dlopen support)
+-
+-
+-# -----------------------------------------------------------------------------
+-#
+-# AC_LIBTOOL_WIN32_DLL
+-#
+-# This macro should be used if the package has been ported to build
+-# clean dlls on win32 platforms. Usually this means that any library
+-# data items are exported with __declspec(dllexport) and imported with
+-# __declspec(dllimport). If this macro is not used, libtool will assume
+-# that the package libraries are not dll clean and will build only static
+-# libraries on win32 hosts.
+-#
+-# This macro must be called before AC_PROG_LIBTOOL, and provision must
+-# be made to pass '-no-undefined' to libtool in link mode from the package
+-# Makefile. Naturally, if you pass '-no-undefined', you must ensure that
+-# all the library symbols really are defined at link time!
+-#
+-# -----------------------------------------------------------------------------
+-
+-AC_LIBTOOL_WIN32_DLL() # (we need Win32 support in libtool)
+-
+ # -----------------------------------------------------------------------------
+ # This is a hack:
+ #
+@@ -395,117 +360,8 @@ case $host_os in
+ ;;
+ esac
+
+-# -----------------------------------------------------------------------------
+-# See: 'AC_PROG_LIBTOOL' below.
+-# -----------------------------------------------------------------------------
+-
+-AC_DISABLE_STATIC() # (forces libtool to build shared
+- # libraries instead of static ones)
+-
+-# -----------------------------------------------------------------------------
+-# AC_PROG_LIBTOOL
+-#
+-# Add support for the '--enable-shared' and '--disable-shared'
+-# configure flags. By default, this macro turns on shared libraries
+-# if they are available, and also enables static libraries if they
+-# don't conflict with the shared libraries. You can modify these
+-# defaults by calling either the AC_DISABLE_SHARED or AC_DISABLE_STATIC
+-# macros.
+-#
+-# Hercules REQUIRES shared libraries (i.e. DLLs), so we do indeed use
+-# the AC_DISABLE_STATIC macro above.
+-#
+-# -----------------------------------------------------------------------------
+-
+-AC_PROG_LIBTOOL() # (we build libtool for ourselves)
+-
+-
+-# -----------------------------------------------------------------------------
+-#
+-# AC_LIB_LTDL
+-#
+-# Even though libltdl is installed together with libtool, you may wish
+-# to include libltdl in the distribution of your package, for the convenience
+-# of users of your package that don't have libtool or libltdl installed.
+-#
+-# The most simplistic way to add libltdl to your package is to copy the
+-# source files, 'ltdl.c' and 'ltdl.h', to a source directory withing your
+-# package and to build and link them along with the rest of your sources.
+-#
+-# To do this, you must add a call to the 'AC_LIB_LTDL' macro to your package's
+-# 'configure.in' to perform the required configure time checks in order that
+-# 'ltdl.o' is built correctly.
+-#
+-# This method does have its problems though: if you try to link the package
+-# binaries with an installed libltdl, or a library which depends on libltdl,
+-# you may have problems with duplicate symbol definitions.
+-#
+-# In order to enable this flavor of libltdl, you should add the line
+-# 'AC_LIBLTDL_CONVENIENCE' to your `configure.in', before 'AC_PROG_LIBTOOL'.
+-#
+-# In order to select the installable version of libltdl, you should add a
+-# call of the macro 'AC_LIBLTDL_INSTALLABLE' to your 'configure.in' before
+-# 'AC_PROG_LIBTOOL'. This macro will check whether libltdl is already
+-# installed and, if not, request the libltdl embedded in your package to be
+-# built and installed.
+-#
+-# Whatever macro you use, it is up to you to ensure that your 'configure.in'
+-# will configure libltdl, using 'AC_CONFIG_SUBDIRS', and that your 'Makefile's
+-# will start sub-makes within libltdl's directory, using automake's SUBDIRS,
+-# for example. Both macros define the shell variables LIBLTDL, to the link flag
+-# that you should use to link with libltdl, and LTDLINCL, to the preprocessor
+-# flag that you should use to compile with programs that include 'ltdl.h'. It
+-# is up to you to use 'AC_SUBST' to ensure that this variable will be available
+-# in 'Makefile's, or add them to variables that are 'AC_SUBST'ed by default,
+-# such as LIBS and CPPFLAGS.
+-#
+-# So, when you want to link a program with libltdl, be it a convenience,
+-# installed or installable library, just compile with '$(LTDLINCL)' and link
+-# it with '$(LIBLTDL)', using libtool.
+-#
+-# You should probably also add 'AC_LIBTOOL_DLOPEN' to your 'configure.in' before
+-# 'AC_PROG_LIBTOOL', otherwise libtool will assume no dlopening mechanism is
+-# supported, and revert to dlpreopening, which is probably not what you want.
+-#
+-# The following example shows you how to embed the convenience libltdl
+-# in your package. In order to use the installable variant just replace
+-# 'AC_LIBLTDL_CONVENIENCE' with 'AC_LIBLTDL_INSTALLABLE'. We assume that libltdl
+-# was embedded using 'libtoolize --ltdl':
+-#
+-# configure.in:
+-#
+-# ...
+-# dnl Enable building of the convenience library
+-# dnl and set LIBLTDL accordingly
+-# AC_LIBLTDL_CONVENIENCE
+-# dnl Substitute LTDLINCL and LIBLTDL in the Makefiles
+-# AC_SUBST(LTDLINCL)
+-# AC_SUBST(LIBLTDL)
+-# dnl Check for dlopen support
+-# AC_LIBTOOL_DLOPEN
+-# dnl Configure libtool
+-# AC_PROG_LIBTOOL
+-# dnl Configure libltdl
+-# AC_CONFIG_SUBDIRS(libltdl)
+-# ...
+-#
+-# Makefile.am:
+-#
+-# ...
+-# SUBDIRS = libltdl
+-#
+-# INCLUDES = $(LTDLINCL)
+-#
+-# myprog_LDFLAGS = -export-dynamic
+-# # The quotes around -dlopen below fool automake <= 1.4 into accepting it
+-# myprog_LDADD = $(LIBLTDL) "-dlopen" self "-dlopen" foo1.la
+-# myprog_DEPENDENCIES = $(LIBLTDL) foo1.la
+-# ...
+-#
+-# -----------------------------------------------------------------------------
+-
+-AC_LIB_LTDL() # (we need the ltdl libtool library)
+-AC_SUBST([LIBTOOL_DEPS]) # (see PROGRAMMING NOTE above)
++LT_PREREQ([2.2.6])
++LT_INIT([dlopen win32-dll disable-static])
+
+ # -----------------------------------------------------------------------------
+ # (See comments in the 'AC_CHECK_LIB' Libraries section further below)
diff --git a/app-emulation/hercules-sdl/hercules-sdl-4.7.0.ebuild b/app-emulation/hercules-sdl/hercules-sdl-4.7.0.ebuild
new file mode 100644
index 000000000000..336396af8692
--- /dev/null
+++ b/app-emulation/hercules-sdl/hercules-sdl-4.7.0.ebuild
@@ -0,0 +1,85 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools fcaps
+
+DESCRIPTION="The SoftDevLabs (SDL) version of the Hercules 4.x Hyperion Emulator"
+HOMEPAGE="https://sdl-hercules-390.github.io/html/"
+SRC_URI="https://github.com/SDL-Hercules-390/hyperion/archive/refs/tags/Release_${PV/.0/}.tar.gz -> ${P/.0/}.tar.gz"
+
+S="${WORKDIR}/hyperion-Release_${PV/.0/}"
+LICENSE="QPL-1.0"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc64"
+# In theory USE=object-rexx and USE=regina-rexx are not mutually-exclusive.
+# In practice they functionally are as the Gentoo packages conflict, and
+# additionally Hercules only supports calling out to one of them at runtime,
+# controlled by the HREXX_PACKAGE environment variable.
+IUSE="bzip2 debug object-rexx regina-rexx test"
+RESTRICT="!test? ( test )"
+FILECAPS=(
+ -M 755 cap_sys_nice\=eip usr/bin/hercules --
+ -M 755 cap_sys_nice\=eip usr/bin/herclin --
+ -M 755 cap_net_admin+ep usr/bin/hercifc
+)
+
+RDEPEND="
+ dev-libs/libltdl
+ net-libs/libnsl:0
+ sys-libs/zlib
+ bzip2? ( app-arch/bzip2 )
+ object-rexx? ( dev-lang/oorexx )
+ regina-rexx? ( dev-lang/regina-rexx )"
+DEPEND="${RDEPEND}
+ ~app-emulation/hercules-sdl-crypto-${PV}
+ ~app-emulation/hercules-sdl-decnumber-${PV}
+ ~app-emulation/hercules-sdl-softfloat-${PV}
+ ~app-emulation/hercules-sdl-telnet-${PV}"
+# Neither package support needs to be compiled-in for tests,
+# but the "rexx" command needs to be available
+BDEPEND="${RDEPEND}
+ test? ( || ( dev-lang/regina-rexx dev-lang/oorexx ) )"
+
+PATCHES=( "${FILESDIR}/${PN}-4.4.1-htmldir.patch" )
+
+src_prepare() {
+ rm -rf crypto decNumber SoftFloat telnet || die
+ sed -i 's#/lib${hc_cv_pkg_lib_subdir}#/lib#g' configure.ac || die
+ sed -i 's#_pkgname}${hc_cv_pkg_lib_suffix}#_pkgname}#g' configure.ac || die
+
+ default
+ eautoreconf
+}
+
+src_configure() {
+ local -x ac_cv_lib_bz2_BZ2_bzBuffToBuffDecompress=$(usex bzip2)
+ econf \
+ $(use_enable bzip2 cckd-bzip2) \
+ $(use_enable bzip2 het-bzip2) \
+ $(use_enable object-rexx) \
+ $(use_enable regina-rexx) \
+ $(use_enable debug) \
+ --enable-custom="Gentoo ${PF}.ebuild" \
+ --disable-optimization \
+ --disable-setuid-hercifc \
+ --disable-capabilities \
+ --enable-ipv6 \
+ --enable-enhanced-configincludes \
+ --disable-fthreads \
+ --enable-shared \
+ --enable-automatic-operator \
+ --enable-extpkgs="${SYSROOT}/usr/$(get_libdir)/${PN}"
+}
+
+src_install() {
+ default
+ dodoc RELEASE.NOTES
+
+ insinto /usr/share/hercules
+ doins hercules.cnf
+
+ # No static archives. Have to leave .la files for modules. #720342
+ find "${ED}/usr/$(get_libdir)" -name "*.la" -delete || die
+}
diff --git a/app-emulation/hercules-sdl/metadata.xml b/app-emulation/hercules-sdl/metadata.xml
new file mode 100644
index 000000000000..c7d581937769
--- /dev/null
+++ b/app-emulation/hercules-sdl/metadata.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person" proxied="yes">
+ <email>matoro_gentoo@matoro.tk</email>
+ <name>Matoro Mahri</name>
+ </maintainer>
+ <maintainer type="project" proxied="proxy">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <longdescription>
+ This version of Hercules 4.x Hyperion is a SoftDevLabs maintained version of the Hercules emulator containing fixes made by David B. Trout and others for bugs that may still exist in the original hercules-390 version of Hercules 4.0 Hyperion, as well as enhancements and improvements to the overall functionality above and beyond what is provided by the hercules-390 version of Hercules.
+ </longdescription>
+ <use>
+ <flag name="object-rexx">Enable REXX support via Open Object Rexx (<pkg>dev-lang/oorexx</pkg>)</flag>
+ <flag name="regina-rexx">Enable REXX support via Regina Rexx (<pkg>dev-lang/regina-rexx</pkg>)</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">SDL-Hercules-390/hyperion</remote-id>
+ </upstream>
+</pkgmetadata>