webmin 2.202
authorroot <root@admin.liquid.me.uk>
Mon, 23 Sep 2024 04:03:40 +0000 (05:03 +0100)
committerroot <root@admin.liquid.me.uk>
Mon, 23 Sep 2024 04:03:40 +0000 (05:03 +0100)
23 files changed:
app-admin/webmin/Manifest
app-admin/webmin/webmin-2.202.ebuild [new file with mode: 0644]
kde-frameworks/oxygen-icons/Manifest [new file with mode: 0644]
kde-frameworks/oxygen-icons/metadata.xml [new file with mode: 0644]
kde-frameworks/oxygen-icons/oxygen-icons-5.116.0.ebuild [new file with mode: 0644]
net-im/discord/Manifest
net-im/discord/discord-0.0.46.ebuild [new file with mode: 0644]
net-im/discord/discord-0.0.64.ebuild [new file with mode: 0644]
net-im/discord/discord-0.0.65.ebuild [new file with mode: 0644]
net-im/discord/discord-0.0.66.ebuild [new file with mode: 0644]
net-im/discord/files/launcher.sh [new file with mode: 0644]
sci-libs/miopen/Manifest [new file with mode: 0644]
sci-libs/miopen/files/miopen-4.2.0-disable-no-inline-boost.patch [new file with mode: 0644]
sci-libs/miopen/files/miopen-4.2.0-gcc11-numeric_limits.patch [new file with mode: 0644]
sci-libs/miopen/files/miopen-4.3.0-enable-test.patch [new file with mode: 0644]
sci-libs/miopen/files/miopen-4.3.0-fix-interface-include-in-HIP_COMPILER_FLAGS.patch [new file with mode: 0644]
sci-libs/miopen/files/miopen-5.0.2-strip-xnack-in-flags.patch [new file with mode: 0644]
sci-libs/miopen/files/miopen-5.1.3-avoid-metadata-error-for-vanilla-clang.patch [new file with mode: 0644]
sci-libs/miopen/files/miopen-5.1.3-deprecate-clang-ocl.patch [new file with mode: 0644]
sci-libs/miopen/files/miopen-5.1.3-gfx1031.patch [new file with mode: 0644]
sci-libs/miopen/files/miopen-5.1.3-include-array.patch [new file with mode: 0644]
sci-libs/miopen/files/miopen-5.1.3-no-strip.patch [new file with mode: 0644]
sci-libs/miopen/miopen-5.7.1.ebuild [new file with mode: 0644]

index 623fbc199c4a3c3912d4b9e0da8dbba5467aa652..1a0ad83f3bec5ac20a69793bd88d2de5cca91d63 100644 (file)
@@ -8,7 +8,10 @@ DIST webmin-1.974-minimal.tar.gz 3628248 BLAKE2B 60268150a9d25233dde59be280d4917
 DIST webmin-1.974.tar.gz 45412074 BLAKE2B d62469797d009d47f0e327f00457abc54b515ea88ff41c2049a320eeee6ff516bbbafba80ae038ae592260704d1bfa4a72f9eb2da8d9ea18ce5f071f85419b86 SHA512 612a88337a6915a6e2249a44c6279c310ddf71745b7a8ea799e111d170f874e12c1f3a1c08112f333560b107b1bb44153455e967499d4eba29c626630747801f
 DIST webmin-2.105-minimal.tar.gz 4642671 BLAKE2B d85129110865e7521f0743fd5151525fb0dd8b17be2bb20299c1a50c2f4e78e14bcf229aada4abf61b5132d4eabe3b7862e0da7b9c1d6b119b8e33efca233d6f SHA512 48b674526ce0b71d112dcf4868ae7f1c7cb1c1dec6d4fc68161b8d6a06333dc4d5a700b84760d2a6e2406fc6b8c6bf07bc9705a2109ff54634220f020e3bf3b3
 DIST webmin-2.105.tar.gz 46439259 BLAKE2B d86c70459755992a1745b7091e9dfc5bee4b0886d337004e23a66ed444f978948c6c6a72ccfa2d4212d5cd32f1eabfa52c9076c8ba14f5c847ee9b40c314cfa1 SHA512 c2813641452051fe37b5178e201195ba343091670443602dae2ad3d77902f8f79b0924689b260278035ecbea0d41e7c945dd67f903f0c4740c3a04bf853dd9c0
+DIST webmin-2.202-minimal.tar.gz 4639136 BLAKE2B 8ca693d91099084daaba266971347e9dc3b63e97b82093e69c5f2057fb75b57dbb415036d641176cf666282b29f1830d1d1e9120bd65d22a03653155d2298674 SHA512 61aec98760a1b8f0c7beba61719ce676d3689d6f6de8f5cee767659b1ba31b73453e4b2b6bc330645204b291692503f16181df222ca41491a0ba5c2674888099
+DIST webmin-2.202.tar.gz 46511919 BLAKE2B f58f34346330eac0406a17d5ccc4ca6cc584fd46afe5df428df581fe0014f0afb4143233101a6dab913ca8e5e23427748a4395571c949095995bc7b43af518be SHA512 84cce8c4eeda62018b98f21b0c620c8746ea77ab6b7304a76e8e3a074e74e030541d14e7223b4f31b5e1203f375d3c0e2c8f3aa072023a92df63108e55082c6a
 EBUILD webmin-1.881.ebuild 10425 BLAKE2B f6a8497efc06cd2b1faece936fe511b869b74f8cf1e5c1f556920f8e8c6afb9a77466857ef97f5070aadcb997cef8dd2df97c531b39bd00e2532fc6a668007ce SHA512 89f950914d73cf9b907d4a5811453ae01ef249393f523e34cd65d332e3aa4ec388e82f3419fda707a85398f55fc437917d2e49364a427d17fcf9cec71711f51f
 EBUILD webmin-1.974.ebuild 10425 BLAKE2B f6a8497efc06cd2b1faece936fe511b869b74f8cf1e5c1f556920f8e8c6afb9a77466857ef97f5070aadcb997cef8dd2df97c531b39bd00e2532fc6a668007ce SHA512 89f950914d73cf9b907d4a5811453ae01ef249393f523e34cd65d332e3aa4ec388e82f3419fda707a85398f55fc437917d2e49364a427d17fcf9cec71711f51f
 EBUILD webmin-2.105.ebuild 9996 BLAKE2B 398489c0488ebc95fd059f905742b5975f96f639dc8ca2b7ccb4034967bc5e0130d0b16969ba352ac36768c542b33f902228cf74ff9f0ceee455977d19a1505f SHA512 c898cc552ce9ac38310d8a6be1d48861dbc732508ec9d3d4566aee244909b137a1a60cd3ea429965d27bf150f520c545331b52da72ecc3cf72a396bb292543dd
+EBUILD webmin-2.202.ebuild 9996 BLAKE2B 398489c0488ebc95fd059f905742b5975f96f639dc8ca2b7ccb4034967bc5e0130d0b16969ba352ac36768c542b33f902228cf74ff9f0ceee455977d19a1505f SHA512 c898cc552ce9ac38310d8a6be1d48861dbc732508ec9d3d4566aee244909b137a1a60cd3ea429965d27bf150f520c545331b52da72ecc3cf72a396bb292543dd
 MISC webmin-1.974.ebuild.old 2512 BLAKE2B 59ce4619734f1fe0194c4978b29b279e4bd320f0712b97ae81615f6b6298c6036cc0659627e179d178ae9cdab12ae76d9e6f05c543fb768838aae86e44309ba7 SHA512 845c1aaa0e3249560e33705d3c0be546fbd17dace5c88b2ebd2df9c0b5de760f398fb144c76081a67617c1c6861ff2cbc9740af5ade10bd0d641f62f3c59364e
diff --git a/app-admin/webmin/webmin-2.202.ebuild b/app-admin/webmin/webmin-2.202.ebuild
new file mode 100644 (file)
index 0000000..ecf2b25
--- /dev/null
@@ -0,0 +1,304 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+inherit pam ssl-cert systemd
+
+DESCRIPTION="A web-based Unix systems administration interface"
+HOMEPAGE="http://www.webmin.com/"
+SRC_URI="minimal? ( https://github.com/webmin/webmin/releases/download/${PV}/${P}-minimal.tar.gz )
+       !minimal? ( https://github.com/webmin/webmin/releases/download/${PV}//${P}.tar.gz )"
+
+LICENSE="BSD GPL-2"
+SLOT="0"
+
+KEYWORDS="amd64 x86"
+
+# NOTE: The ssl flag auto added by ssl-cert eclass is not used actually
+# because openssl is forced by dev-perl/Net-SSLeay
+IUSE="minimal +ssl mysql postgres ldap"
+REQUIRED_USE="minimal? ( !mysql !postgres !ldap )"
+
+# All the required perl modules can be found easily using (in Webmin's root src dir):
+# find . -name cpan_modules.pl -exec grep "::" {} \;
+# NOTE: If Webmin doesn't find the required perl modules, it offers(runtime) the user
+# to install them using the in-built cpan module, and this will mess up perl on the system
+# That's why some modules are forced without a use flag
+# NOTE: pam, ssl and dnssec-tools deps are forced for security and Gentoo compliance installation reasons
+DEPEND="virtual/perl-MIME-Base64
+       virtual/perl-Socket
+       virtual/perl-Sys-Syslog
+       virtual/perl-Time-HiRes
+       virtual/perl-Time-Local
+       dev-perl/Authen-Libwrap
+       dev-perl/IO-Tty
+       dev-perl/MD5
+       dev-perl/Net-SSLeay
+       dev-perl/Authen-PAM
+       dev-perl/Sys-Hostname-Long
+       >=net-dns/dnssec-tools-1.13
+       !minimal? (
+               mysql? ( dev-perl/DBD-mysql )
+               postgres? ( dev-perl/DBD-Pg )
+               ldap? ( dev-perl/perl-ldap )
+               dev-perl/XML-Generator
+               dev-perl/XML-Parser
+       )
+"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+       default
+
+       local perl="$( which perl )"
+
+       # Remove the unnecessary and incompatible files
+       rm -rf acl/Authen-SolarisRBAC-0.1*
+       if ! use minimal ; then
+               rm -rf {format,{bsd,hpux,sgi}exports,zones,rbac}
+               rm -f mount/{free,net,open}bsd-mounts*
+               rm -f mount/macos-mounts*
+       fi
+
+       # For security reasons remove the SSL certificate that comes with Webmin
+       # We will create our own later
+       rm -f miniserv.pem
+
+       # Remove the Webmin setup scripts to avoid Webmin in runtime to mess up config
+       # We will use our own later
+       rm -f setup.{sh,pl}
+
+       # Set the installation type/mode to Gentoo
+       echo "gentoo" > install-type
+
+       # Fix the permissions of the install files
+       chmod -R og-w "${S}"
+
+       # Since we should not modify any files after install
+       # we set the perl path in all cgi and pl files here using Webmin's routines
+       # The pl file is Prefix safe and works only on provided input, no other filesystem files
+       ln -s image imageetc
+       ebegin "Fixing perl path in source files"
+       (find "${S}" -name '*.cgi' -print ; find "${S}" -name '*.pl' -print) | $perl "${S}"/perlpath.pl $perl -
+       eend $?
+}
+
+src_install() {
+       # Create config dir and keep
+       diropts -m0755
+       dodir /etc/webmin
+       keepdir /etc/webmin
+
+       # Create install dir
+       # Third party modules installed through Webmin go here too, so keep
+       dodir /usr/libexec/webmin
+       keepdir /usr/libexec/webmin
+
+       # Copy our own setup script to installation folder
+       insinto /usr/libexec/webmin
+       newins "${FILESDIR}"/gentoo-setup gentoo-setup.sh
+       fperms 0744 /usr/libexec/webmin/gentoo-setup.sh
+
+       # This is here if we ever want in future ebuilds to add some specific
+       # config values in the /etc/webmin/miniserv.conf
+       # The format of this file should be the same as the one of miniserv.conf:
+       # var=value
+       #
+       # Uncomment it if you use such file. Before that check if upstream
+       # has this file in root dir too.
+       #newins "${FILESDIR}/miniserv-conf" miniserv-conf
+
+       # Create the log dir and keep
+       diropts -m0700
+       dodir /var/log/webmin
+       keepdir /var/log/webmin
+
+       # Create the init.d file and put the neccessary variables there
+       newinitd "${FILESDIR}"/init.d.webmin webmin
+       sed -i \
+               -e "s:%exe%:${EROOT}/usr/libexec/webmin/miniserv.pl:" \
+               -e "s:%pid%:${EROOT}/var/run/webmin.pid:" \
+               -e "s:%conf%:${EROOT}/etc/webmin/miniserv.conf:" \
+               -e "s:%config%:${EROOT}/etc/webmin/config:" \
+               -e "s:%perllib%:${EROOT}/usr/libexec/webmin:" \
+               "${ED}/etc/init.d/webmin" \
+               || die "Failed to patch the webmin init file"
+
+       # Setup pam
+       pamd_mimic system-auth webmin auth account session
+
+       # Copy files to installation folder
+       ebegin "Copying install files to destination"
+       cp -pPR "${S}"/* "${ED}/usr/libexec/webmin"
+       eend $?
+}
+
+pkg_preinst() {
+       # First stop service if running so Webmin to not messup our config
+       ebegin "Stopping any running Webmin instance prior merging"
+       if systemd_is_booted ; then
+               systemctl stop webmin.service 2>/dev/null
+       else
+               rc-service --ifexists -- webmin --ifstarted stop
+       fi
+       eend $?
+}
+
+pkg_postinst() {
+       # Run webmin_config first - non interactively
+       export INTERACTIVE="no"
+       webmin_config
+       # Every next time webmin_config should be interactive
+       INTERACTIVE="yes"
+
+       ewarn
+       ewarn "Bare in mind that not all Webmin modules are Gentoo tweaked and may have some issues."
+       ewarn "Always be careful when using modules that modify init entries, do update of webmin, install CPAN modules etc."
+       ewarn "To avoid problems, please before using any module, look at its configuration options first."
+       ewarn "(Usually there is a link at top in the right pane of Webmin for configuring the module.)"
+       ewarn
+       if systemd_is_booted ; then
+               elog "- To make Webmin start at boot time, run: 'systemctl enable webmin.service'"
+       else
+               elog "- To make Webmin start at boot time, run: 'rc-update add webmin default'"
+       fi
+       elog "- The default URL to connect to Webmin is: https://localhost:10000"
+       elog "- The default user that can login is: root"
+       elog "- To reconfigure Webmin in case of problems run 'emerge --config app-admin/webmin'"
+}
+
+pkg_prerm() {
+       # First stop service if running - we do not want Webmin to mess up config
+       ebegin "Stopping any running Webmin instance prior unmerging"
+       if systemd_is_booted ; then
+               systemctl stop webmin.service 2>/dev/null
+       else
+               rc-service --ifexists -- webmin --ifstarted stop
+       fi
+       eend $?
+}
+
+pkg_postrm() {
+       # If removing webmin completely, remind the user for the Webmin's own cron jobs.
+       if [[ ! ${REPLACED_BY_VERSION} ]]; then
+               ewarn
+               ewarn "You have uninstalled Webmin, so have in mind that all cron jobs scheduled"
+               ewarn "by Webmin for its own modules, are left active and they will fail when Webmin is missing."
+               ewarn "To fix this just disable them if you intend to use Webmin again,"
+               ewarn "OR delete them if not."
+               ewarn
+       fi
+}
+
+pkg_config(){
+       webmin_config
+}
+
+webmin_config(){
+       # First stop service if running
+       ebegin "Stopping any running Webmin instance"
+       if systemd_is_booted ; then
+               systemctl stop webmin.service 2>/dev/null
+       else
+               rc-service --ifexists -- webmin --ifstarted stop
+       fi
+       eend $?
+
+       # Next set the default reset variable to 'none'
+       # reset/_reset can be:
+       # 'none' - does not reset anything, just upgrades if a conf is present
+       #                  OR installs new conf if a conf is missing
+       # 'soft' - deletes only $config_dir/config file and thus resetting most
+       #                 conf values to their defaults. Keeps the specific Webmin cron jobs
+       # 'hard' - deletes all files in $config_dir (keeping the .keep_* Gentoo file)
+       #                 and thus resetting all Webmin. Deletes the specific Webmin cron jobs too.
+       local _reset="none"
+
+       # If in interactive mode ask user what should we do
+       if [[ "${INTERACTIVE}" = "yes" ]]; then
+               einfo
+               einfo "Please enter the number of the action you would like to perform?"
+               einfo
+               einfo "1. Update configuration"
+               einfo "   (keeps old config options and adds the new ones)"
+               einfo "2. Soft reset configuration"
+               einfo "   (keeps some old config options, the other options are set to default)"
+               ewarn "   All Webmin users will be reset"
+               einfo "3. Hard reset configuration"
+               einfo "   (all options including module options are set to default)"
+               ewarn "   You will lose all Webmin configuration options you have done till now"
+               einfo "4. Exit this configuration utility (default)"
+               while [ "$correct" != "true" ] ; do
+                       read answer
+                       if [[ "$answer" = "1" ]] ; then
+                               _reset="none"
+                               correct="true"
+                       elif [[ "$answer" = "2" ]] ; then
+                               _reset="soft"
+                               correct="true"
+                       elif  [[ "$answer" = "3" ]] ; then
+                               _reset="hard"
+                               correct="true"
+                       elif  [ "$answer" = "4" -o "$answer" = "" ] ; then
+                               die "User aborted configuration."
+                       else
+                               echo "Answer not recognized. Enter a number from 1 to 4"
+                       fi
+               done
+
+               if [[ "$_reset" = "hard" ]]; then
+                       while [ "$sure" != "true" ] ; do
+                               ewarn "You will lose all Webmin configuration options you have done till now."
+                               ewarn "Are you sure you want to do this? (y/n)"
+                               read answer
+                               if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then
+                                       sure="true"
+                               elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then
+                                       die "User aborted configuration."
+                               else
+                                       echo "Answer not recognized. Enter 'y' or 'n'"
+                               fi
+                       done
+               fi
+       fi
+
+       export reset=$_reset
+
+       # Create ssl certificate for Webmin if there is not one in the proper place
+       if [[ ! -e "${EROOT}etc/ssl/webmin/server.pem" ]]; then
+               SSL_ORGANIZATION="${SSL_ORGANIZATION:-Webmin Server}"
+               SSL_COMMONNAME="${SSL_COMMONNAME:-*}"
+               install_cert "${EROOT}/etc/ssl/webmin/server"
+       fi
+
+       # Ensure all paths passed to the setup script use EROOT
+       export wadir="${EROOT}usr/libexec/webmin"
+       export config_dir="${EROOT}etc/webmin"
+       export var_dir="${EROOT}var/log/webmin"
+       export tempdir="${T}"
+       export pidfile="${EROOT}var/run/webmin.pid"
+       export perl="$( which perl )"
+       export os_type='gentoo-linux'
+       export os_version='*'
+       export real_os_type='Gentoo Linux'
+       export real_os_version='Any version'
+       # Forcing 'ssl', 'no_ssl2', 'no_ssl3', 'ssl_redirect', 'no_sslcompression',
+       # 'ssl_honorcipherorder', 'no_tls1' and 'no_tls1_1' for tightening security
+       export ssl=1
+       export no_ssl2=1
+       export no_ssl3=1
+       export ssl_redirect=1
+       export ssl_honorcipherorder=1
+       export no_sslcompression=1
+       export no_tls1=1
+       export no_tls1_1=1
+       export keyfile="${EROOT}etc/ssl/webmin/server.pem"
+       export port=10000
+
+       export atboot=0
+
+       einfo "Executing Webmin's configure script"
+       $wadir/gentoo-setup.sh
+
+       einfo "Configuration of Webmin done"
+}
diff --git a/kde-frameworks/oxygen-icons/Manifest b/kde-frameworks/oxygen-icons/Manifest
new file mode 100644 (file)
index 0000000..914dcf9
--- /dev/null
@@ -0,0 +1,3 @@
+DIST oxygen-icons-5.116.0.tar.xz 238635868 BLAKE2B a4b5400c61d780c8bcdcfd4426bbaa6daa4b15ba5e90cd3106b6941571b10801c3c8312968647e115a1b73e34f926238132d160a862b8ed9222eaecbbf0b08c9 SHA512 d02599b95fcf7c7a38a65a7a422eba59748cdd0d6b3542721a789847b550757bc4162ab5d9c3b4bd1267f5ff0ae6d39c8041b65b895eb5553522645cf260670a
+EBUILD oxygen-icons-5.116.0.ebuild 748 BLAKE2B 0faef89059b04141357828e08021726236df617e7c8e08ae686dc531a413c505bb9b885b95c3c102ff136a047cf265787b345bffabe93edd6949b1a1e6dceb02 SHA512 3ba732c0db77fe8fec758223d62df9cd3f4d567506fd1fc02b24c35501e9bbc19be23940606dd130e22edbef47de04e442803951c93d67ddaaebac3af5fc411d
+MISC metadata.xml 456 BLAKE2B 4392b1cc6f304778d71236d5eb557dfbbd530143eea5cad9a3c3034e3e8b22c835f6c7f980124a21cefd35a2dd1efd5110adc0a5342170f88dfd7418b12bee99 SHA512 7ba65331cad434e2dceee012a5458d268eb2a04e0f7276b265c15644e6db5209bc7eee7d9695aa0038c435711e0f6f0dc53c7bae9d773b48f01e22a22e4dbb80
diff --git a/kde-frameworks/oxygen-icons/metadata.xml b/kde-frameworks/oxygen-icons/metadata.xml
new file mode 100644 (file)
index 0000000..506ecf6
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+       <maintainer type="project">
+               <email>kde@gentoo.org</email>
+               <name>Gentoo KDE Project</name>
+       </maintainer>
+       <upstream>
+               <bugs-to>https://bugs.kde.org/</bugs-to>
+       </upstream>
+       <slots>
+               <subslots>
+                       Must only be used by packages that are known to use private parts of the Frameworks API.
+               </subslots>
+       </slots>
+</pkgmetadata>
diff --git a/kde-frameworks/oxygen-icons/oxygen-icons-5.116.0.ebuild b/kde-frameworks/oxygen-icons/oxygen-icons-5.116.0.ebuild
new file mode 100644 (file)
index 0000000..4344e68
--- /dev/null
@@ -0,0 +1,41 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PVCUT=$(ver_cut 1-2)
+QTMIN=5.15.9
+inherit cmake frameworks.kde.org xdg-utils
+
+DESCRIPTION="Oxygen SVG icon theme"
+HOMEPAGE="https://develop.kde.org/frameworks/oxygen-icons/"
+
+LICENSE="LGPL-3"
+KEYWORDS="amd64 ~arm arm64 ~loong ~ppc ppc64 ~riscv x86"
+IUSE="test"
+
+RESTRICT="!test? ( test )"
+
+DEPEND="
+       test? (
+               >=dev-qt/qtcore-${QTMIN}:5
+               >=dev-qt/qttest-${QTMIN}:5
+       )
+"
+BDEPEND="
+       >=kde-frameworks/extra-cmake-modules-${PVCUT}:0
+       test? ( app-misc/fdupes )
+"
+
+src_prepare() {
+       cmake_src_prepare
+       use test || cmake_comment_add_subdirectory autotests
+}
+
+pkg_postinst() {
+       xdg_icon_cache_update
+}
+
+pkg_postrm() {
+       xdg_icon_cache_update
+}
index d2a7980eaa3f328236ef92d79329c2b6d740e855..22e4f1f716b82344a2bdd9f9d5528b100adfc991 100644 (file)
@@ -1,2 +1,11 @@
+AUX launcher.sh 456 BLAKE2B ae091128ef8841bb257ac586f6800fdd749cd8c9c08b9f1c5244f315c7dfa85d7686cae654e27c07ab1ce6481d7b86ab5adfbf8d8c5e477d3e0b172d6d85bc39 SHA512 e658f93725f72c7ae6f75e0633fd35b96f6d09f8c23a6918a70ade0396a822dded24a1d5d82bc5a3ea9fb08bea5aeb89abd4ad35a28997ec667a85d55d6755dc
 DIST discord-0.0.25.tar.gz 77709937 BLAKE2B 48617283675866b3ec8e8e7000800897fc8532ced4329a59561826d1eb018106ff4d499b5a3620ab3d557970f066f0e973211f9eb32f2566130298bd41abff57 SHA512 21a3e6dff2fd33fe0cd5b1c9c340cbeebc6fd214d9f0be8c05ac9faad2f287d17726bd45bebb4ecebe90533da20f501ad1156ac8097318d7545f78811ebe1224
+DIST discord-0.0.46.tar.gz 92983040 BLAKE2B 1d1fb9823808eafee6c41336bc1b82c5b803c5203abe0d65c62ac70444b8cd5c3f7926c2ed75215e16e2ee6c3fb6701ac4b2af3713fe9380b6a23b03aa8e5c90 SHA512 7f88a1f5281beb5bcdb9741ae4d984ec71c09931f31c4265e15f63b5710baff0124b38421971e45e217e20d7de14e4b5ab9e0b7da6afc3eb8ff3456643f692e8
+DIST discord-0.0.64.tar.gz 103547165 BLAKE2B c0ef2ab2f5296a7ba29f7d5a53f0d26fd6984579b32a9641fa2b49c3a5fa6ab7a371dcebdb97481e7843e179c6f0cf1fb55775659639727b72220a50dffa8d17 SHA512 835a1a1ac6c583e41d7c3521b5cbdafaf669d18b5ba1521109c3a3554d10015ef1198aba3697a149bdebb3cd747de4534dd923d448138891be661af96fbee26f
+DIST discord-0.0.65.tar.gz 103550088 BLAKE2B 291e1f9c8d4020a883cac4d0e7e16c1a2d5f83cb3efa4beaf0122627237690483378743e3c945802f9ea63d98703b606dfa31d75edebac4e09aa5f6cb1956daa SHA512 48a6d9d4939babe7b7243ae465e592baac357ed6a79513be3e78a78bbc7c5ce4b22bdb6edae31d43f2adb3e578d9a7ecb9b4fb62aed63da84d20e1daede4fc8e
+DIST discord-0.0.66.tar.gz 103548096 BLAKE2B 0016fca8c62e20848f9d65f9ca4c8b36d6bcd1c035f097db98a9c73187b2c1cd60887215b7c4403e85bb49dbedde8aaa680cbd2b470464db686621e885b722d2 SHA512 e521af930bf68d8da4fa9db1d86be84d17ad661213ba20a29eb05a67042625630d9d2ce5d8147146276b5c1356e07a0beba9312b0b558eb5cc5861244418e32b
 EBUILD discord-0.0.25.ebuild 3135 BLAKE2B 3846812d50c2dd8e14be01e5ed085bc31fcfe4eefa397210ab0d392bc86ad8ed1535d4d6ea0c92ccc23c89358ae2340a74e5a2f0dd9418037cc8e5375eeb76af SHA512 d2d5936dde95bad9d3ed31b5afc987f812cd8c85429392be3cecc6ccc4d622965b6e8efa69234262add2a7a96e6014020aefb1dd3db46ea8cab634ee62239ec8
+EBUILD discord-0.0.46.ebuild 3517 BLAKE2B f38d871f1bb8e7285468fb828779aad07ede1e0ad60ca343ff09f6f377620011fded733c8deddf8e25d4bfde43289682ab2c443e0a568a898c0c670569891edf SHA512 4ca6c99208ab670f8e2c7c74554d7a6c97617f3c6c2d25d3528827acad1221ad13f324da4ebd5b8e8915b8e1f308cb51525c216153d903420d23a2539a4e6c2a
+EBUILD discord-0.0.64.ebuild 3953 BLAKE2B 5108ee5a095f59114ad00d853f9d146ef0919aa802be7a84c3d61f134021e942c8abf699dbd066c82b310992629a80fd2764dc326b37fd0c6ad879ddfe8e5c9d SHA512 7d9a6560cf066d77301a87d83bcf54619f0291eabdd831911a7ead97eb5b4cecbc5db4b5f0adacbdba244c3c7ebdce4fb3fbc319964ca6c7b251e38697f1d92c
+EBUILD discord-0.0.65.ebuild 3953 BLAKE2B 5108ee5a095f59114ad00d853f9d146ef0919aa802be7a84c3d61f134021e942c8abf699dbd066c82b310992629a80fd2764dc326b37fd0c6ad879ddfe8e5c9d SHA512 7d9a6560cf066d77301a87d83bcf54619f0291eabdd831911a7ead97eb5b4cecbc5db4b5f0adacbdba244c3c7ebdce4fb3fbc319964ca6c7b251e38697f1d92c
+EBUILD discord-0.0.66.ebuild 3953 BLAKE2B 5108ee5a095f59114ad00d853f9d146ef0919aa802be7a84c3d61f134021e942c8abf699dbd066c82b310992629a80fd2764dc326b37fd0c6ad879ddfe8e5c9d SHA512 7d9a6560cf066d77301a87d83bcf54619f0291eabdd831911a7ead97eb5b4cecbc5db4b5f0adacbdba244c3c7ebdce4fb3fbc319964ca6c7b251e38697f1d92c
diff --git a/net-im/discord/discord-0.0.46.ebuild b/net-im/discord/discord-0.0.46.ebuild
new file mode 100644 (file)
index 0000000..e6f47c6
--- /dev/null
@@ -0,0 +1,135 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+MY_PN="${PN/-bin/}"
+MY_PV="${PV/-r*/}"
+
+CHROMIUM_LANGS="
+       af am ar bg bn ca cs da de el en-GB en-US es es-419 et fa fi fil fr gu he hi
+       hr hu id it ja kn ko lt lv ml mr ms nb nl pl pt-BR pt-PT ro ru sk sl sr sv
+       sw ta te th tr uk ur vi zh-CN zh-TW
+"
+
+inherit chromium-2 desktop linux-info optfeature unpacker xdg
+
+DESCRIPTION="All-in-one voice and text chat for gamers"
+HOMEPAGE="https://discordapp.com"
+SRC_URI="https://dl.discordapp.net/apps/linux/${MY_PV}/${MY_PN}-${MY_PV}.tar.gz"
+
+LICENSE="all-rights-reserved"
+SLOT="0"
+KEYWORDS="amd64"
+RESTRICT="bindist mirror strip test"
+IUSE="appindicator +seccomp"
+
+RDEPEND="
+       >=app-accessibility/at-spi2-core-2.46.0:2
+       app-crypt/libsecret
+       dev-libs/expat
+       dev-libs/glib:2
+       dev-libs/nspr
+       dev-libs/nss
+       media-libs/alsa-lib
+       media-libs/fontconfig
+       media-libs/mesa[gbm(+)]
+       net-print/cups
+       sys-apps/dbus
+       sys-apps/util-linux
+       sys-libs/glibc
+       x11-libs/cairo
+       x11-libs/libdrm
+       x11-libs/gdk-pixbuf:2
+       x11-libs/gtk+:3
+       x11-libs/libX11
+       x11-libs/libXScrnSaver
+       x11-libs/libXcomposite
+       x11-libs/libXdamage
+       x11-libs/libXext
+       x11-libs/libXfixes
+       x11-libs/libXrandr
+       x11-libs/libxcb
+       x11-libs/libxkbcommon
+       x11-libs/libxshmfence
+       x11-libs/pango
+       appindicator? ( dev-libs/libayatana-appindicator )
+"
+
+DESTDIR="/opt/${MY_PN}"
+
+QA_PREBUILT="*"
+
+CONFIG_CHECK="~USER_NS"
+
+S="${WORKDIR}/${MY_PN^}"
+
+src_unpack() {
+       unpack ${MY_PN}-${MY_PV}.tar.gz
+}
+
+src_configure() {
+       default
+       chromium_suid_sandbox_check_kernel_config
+}
+
+src_prepare() {
+       default
+       # remove post-install script
+       rm postinst.sh || die "the removal of the unneeded post-install script failed"
+       # cleanup languages
+       pushd "locales/" >/dev/null || die "location change for language cleanup failed"
+       chromium_remove_language_paks
+       popd >/dev/null || die "location reset for language cleanup failed"
+       # fix .desktop exec location
+       sed -i "/Exec/s:/usr/share/discord/Discord:${DESTDIR}/${MY_PN^}:" \
+               "${MY_PN}.desktop" ||
+               die "fixing of exec location on .desktop failed"
+       # USE seccomp
+       if ! use seccomp; then
+               sed -i '/Exec/s/Discord/Discord --disable-seccomp-filter-sandbox/' \
+                       "${MY_PN}.desktop" ||
+                       die "sed failed for seccomp"
+       fi
+}
+
+src_install() {
+       doicon -s 256 "${MY_PN}.png"
+
+       # install .desktop file
+       domenu "${MY_PN}.desktop"
+
+       exeinto "${DESTDIR}"
+
+       doexe "${MY_PN^}" chrome-sandbox libEGL.so libffmpeg.so libGLESv2.so libvk_swiftshader.so
+
+       insinto "${DESTDIR}"
+       doins chrome_100_percent.pak chrome_200_percent.pak icudtl.dat resources.pak snapshot_blob.bin v8_context_snapshot.bin
+       insopts -m0755
+       doins -r locales resources
+
+       # Chrome-sandbox requires the setuid bit to be specifically set.
+       # see https://github.com/electron/electron/issues/17972
+       fowners root "${DESTDIR}/chrome-sandbox"
+       fperms 4711 "${DESTDIR}/chrome-sandbox"
+
+       # Crashpad is included in the package once in a while and when it does, it must be installed.
+       # See #903616 and #890595
+       [[ -x chrome_crashpad_handler ]] && doins chrome_crashpad_handler
+
+       dosym "${DESTDIR}/${MY_PN^}" "/usr/bin/${MY_PN}"
+
+       # https://bugs.gentoo.org/898912
+       if use appindicator; then
+               dosym ../../usr/lib64/libayatana-appindicator3.so /opt/discord/libappindicator3.so
+       fi
+}
+
+pkg_postinst() {
+       xdg_pkg_postinst
+
+       optfeature_header "Install the following packages for additional support:"
+       optfeature "sound support" \
+               media-sound/pulseaudio media-sound/apulse[sdk] media-video/pipewire
+       optfeature "emoji support" media-fonts/noto-emoji
+}
diff --git a/net-im/discord/discord-0.0.64.ebuild b/net-im/discord/discord-0.0.64.ebuild
new file mode 100644 (file)
index 0000000..9c133ac
--- /dev/null
@@ -0,0 +1,147 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+MY_PN="${PN/-bin/}"
+MY_PV="${PV/-r*/}"
+
+CHROMIUM_LANGS="
+       af am ar bg bn ca cs da de el en-GB en-US es es-419 et fa fi fil fr gu he hi
+       hr hu id it ja kn ko lt lv ml mr ms nb nl pl pt-BR pt-PT ro ru sk sl sr sv
+       sw ta te th tr uk ur vi zh-CN zh-TW
+"
+
+inherit chromium-2 desktop linux-info optfeature unpacker xdg
+
+DESCRIPTION="All-in-one voice and text chat for gamers"
+HOMEPAGE="https://discord.com/"
+SRC_URI="https://dl.discordapp.net/apps/linux/${MY_PV}/${MY_PN}-${MY_PV}.tar.gz"
+S="${WORKDIR}/${MY_PN^}"
+
+LICENSE="all-rights-reserved"
+SLOT="0"
+KEYWORDS="amd64"
+
+IUSE="appindicator +seccomp wayland"
+RESTRICT="bindist mirror strip test"
+
+RDEPEND="
+       >=app-accessibility/at-spi2-core-2.46.0:2
+       app-crypt/libsecret
+       dev-libs/expat
+       dev-libs/glib:2
+       dev-libs/nspr
+       dev-libs/nss
+       media-libs/alsa-lib
+       media-libs/fontconfig
+       media-libs/mesa[gbm(+)]
+       net-print/cups
+       sys-apps/dbus
+       sys-apps/util-linux
+       sys-libs/glibc
+       x11-libs/cairo
+       x11-libs/libdrm
+       x11-libs/gdk-pixbuf:2
+       x11-libs/gtk+:3
+       x11-libs/libX11
+       x11-libs/libXScrnSaver
+       x11-libs/libXcomposite
+       x11-libs/libXdamage
+       x11-libs/libXext
+       x11-libs/libXfixes
+       x11-libs/libXrandr
+       x11-libs/libxcb
+       x11-libs/libxkbcommon
+       x11-libs/libxshmfence
+       x11-libs/pango
+       appindicator? ( dev-libs/libayatana-appindicator )
+"
+
+DESTDIR="/opt/${MY_PN}"
+
+QA_PREBUILT="*"
+
+CONFIG_CHECK="~USER_NS"
+
+src_unpack() {
+       unpack ${MY_PN}-${MY_PV}.tar.gz
+}
+
+src_configure() {
+       default
+       chromium_suid_sandbox_check_kernel_config
+}
+
+src_prepare() {
+       default
+       # remove post-install script
+       rm postinst.sh || die "the removal of the unneeded post-install script failed"
+       # cleanup languages
+       pushd "locales/" >/dev/null || die "location change for language cleanup failed"
+       chromium_remove_language_paks
+       popd >/dev/null || die "location reset for language cleanup failed"
+
+       # fix .desktop exec location
+       sed --in-place --expression "/^Exec=/s:/usr/share/discord/Discord:/usr/bin/${MY_PN}:" \
+               "${MY_PN}.desktop" ||
+               die "fixing of exec location on .desktop failed"
+
+       # Update exec location in launcher
+       sed --expression "s:@@DESTDIR@@:${DESTDIR}:" \
+               "${FILESDIR}/launcher.sh" > "${T}/launcher.sh" || die "updating of exec location in launcher failed"
+
+       # USE seccomp in launcher
+       if use seccomp; then
+               sed --in-place --expression '/^EBUILD_SECCOMP=/s/false/true/' \
+                       "${T}/launcher.sh" || die "sed failed for seccomp"
+       fi
+
+       # USE wayland in launcher
+       if use wayland; then
+               sed --in-place --expression '/^EBUILD_WAYLAND=/s/false/true/' \
+                       "${T}/launcher.sh" || die "sed failed for wayland"
+       fi
+}
+
+src_install() {
+       doicon -s 256 "${MY_PN}.png"
+
+       # install .desktop file
+       domenu "${MY_PN}.desktop"
+
+       exeinto "${DESTDIR}"
+
+       doexe "${MY_PN^}" chrome-sandbox libEGL.so libffmpeg.so libGLESv2.so libvk_swiftshader.so
+
+       insinto "${DESTDIR}"
+       doins chrome_100_percent.pak chrome_200_percent.pak icudtl.dat resources.pak snapshot_blob.bin v8_context_snapshot.bin
+       insopts -m0755
+       doins -r locales resources
+
+       # Chrome-sandbox requires the setuid bit to be specifically set.
+       # see https://github.com/electron/electron/issues/17972
+       fowners root "${DESTDIR}/chrome-sandbox"
+       fperms 4711 "${DESTDIR}/chrome-sandbox"
+
+       # Crashpad is included in the package once in a while and when it does, it must be installed.
+       # See #903616 and #890595
+       [[ -x chrome_crashpad_handler ]] && doins chrome_crashpad_handler
+
+       exeinto "/usr/bin"
+       newexe "${T}/launcher.sh" "discord" || die "failing to install launcher"
+
+       # https://bugs.gentoo.org/898912
+       if use appindicator; then
+               dosym ../../usr/lib64/libayatana-appindicator3.so /opt/discord/libappindicator3.so
+       fi
+}
+
+pkg_postinst() {
+       xdg_pkg_postinst
+
+       optfeature_header "Install the following packages for additional support:"
+       optfeature "sound support" \
+               media-sound/pulseaudio media-sound/apulse[sdk] media-video/pipewire
+       optfeature "emoji support" media-fonts/noto-emoji
+}
diff --git a/net-im/discord/discord-0.0.65.ebuild b/net-im/discord/discord-0.0.65.ebuild
new file mode 100644 (file)
index 0000000..9c133ac
--- /dev/null
@@ -0,0 +1,147 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+MY_PN="${PN/-bin/}"
+MY_PV="${PV/-r*/}"
+
+CHROMIUM_LANGS="
+       af am ar bg bn ca cs da de el en-GB en-US es es-419 et fa fi fil fr gu he hi
+       hr hu id it ja kn ko lt lv ml mr ms nb nl pl pt-BR pt-PT ro ru sk sl sr sv
+       sw ta te th tr uk ur vi zh-CN zh-TW
+"
+
+inherit chromium-2 desktop linux-info optfeature unpacker xdg
+
+DESCRIPTION="All-in-one voice and text chat for gamers"
+HOMEPAGE="https://discord.com/"
+SRC_URI="https://dl.discordapp.net/apps/linux/${MY_PV}/${MY_PN}-${MY_PV}.tar.gz"
+S="${WORKDIR}/${MY_PN^}"
+
+LICENSE="all-rights-reserved"
+SLOT="0"
+KEYWORDS="amd64"
+
+IUSE="appindicator +seccomp wayland"
+RESTRICT="bindist mirror strip test"
+
+RDEPEND="
+       >=app-accessibility/at-spi2-core-2.46.0:2
+       app-crypt/libsecret
+       dev-libs/expat
+       dev-libs/glib:2
+       dev-libs/nspr
+       dev-libs/nss
+       media-libs/alsa-lib
+       media-libs/fontconfig
+       media-libs/mesa[gbm(+)]
+       net-print/cups
+       sys-apps/dbus
+       sys-apps/util-linux
+       sys-libs/glibc
+       x11-libs/cairo
+       x11-libs/libdrm
+       x11-libs/gdk-pixbuf:2
+       x11-libs/gtk+:3
+       x11-libs/libX11
+       x11-libs/libXScrnSaver
+       x11-libs/libXcomposite
+       x11-libs/libXdamage
+       x11-libs/libXext
+       x11-libs/libXfixes
+       x11-libs/libXrandr
+       x11-libs/libxcb
+       x11-libs/libxkbcommon
+       x11-libs/libxshmfence
+       x11-libs/pango
+       appindicator? ( dev-libs/libayatana-appindicator )
+"
+
+DESTDIR="/opt/${MY_PN}"
+
+QA_PREBUILT="*"
+
+CONFIG_CHECK="~USER_NS"
+
+src_unpack() {
+       unpack ${MY_PN}-${MY_PV}.tar.gz
+}
+
+src_configure() {
+       default
+       chromium_suid_sandbox_check_kernel_config
+}
+
+src_prepare() {
+       default
+       # remove post-install script
+       rm postinst.sh || die "the removal of the unneeded post-install script failed"
+       # cleanup languages
+       pushd "locales/" >/dev/null || die "location change for language cleanup failed"
+       chromium_remove_language_paks
+       popd >/dev/null || die "location reset for language cleanup failed"
+
+       # fix .desktop exec location
+       sed --in-place --expression "/^Exec=/s:/usr/share/discord/Discord:/usr/bin/${MY_PN}:" \
+               "${MY_PN}.desktop" ||
+               die "fixing of exec location on .desktop failed"
+
+       # Update exec location in launcher
+       sed --expression "s:@@DESTDIR@@:${DESTDIR}:" \
+               "${FILESDIR}/launcher.sh" > "${T}/launcher.sh" || die "updating of exec location in launcher failed"
+
+       # USE seccomp in launcher
+       if use seccomp; then
+               sed --in-place --expression '/^EBUILD_SECCOMP=/s/false/true/' \
+                       "${T}/launcher.sh" || die "sed failed for seccomp"
+       fi
+
+       # USE wayland in launcher
+       if use wayland; then
+               sed --in-place --expression '/^EBUILD_WAYLAND=/s/false/true/' \
+                       "${T}/launcher.sh" || die "sed failed for wayland"
+       fi
+}
+
+src_install() {
+       doicon -s 256 "${MY_PN}.png"
+
+       # install .desktop file
+       domenu "${MY_PN}.desktop"
+
+       exeinto "${DESTDIR}"
+
+       doexe "${MY_PN^}" chrome-sandbox libEGL.so libffmpeg.so libGLESv2.so libvk_swiftshader.so
+
+       insinto "${DESTDIR}"
+       doins chrome_100_percent.pak chrome_200_percent.pak icudtl.dat resources.pak snapshot_blob.bin v8_context_snapshot.bin
+       insopts -m0755
+       doins -r locales resources
+
+       # Chrome-sandbox requires the setuid bit to be specifically set.
+       # see https://github.com/electron/electron/issues/17972
+       fowners root "${DESTDIR}/chrome-sandbox"
+       fperms 4711 "${DESTDIR}/chrome-sandbox"
+
+       # Crashpad is included in the package once in a while and when it does, it must be installed.
+       # See #903616 and #890595
+       [[ -x chrome_crashpad_handler ]] && doins chrome_crashpad_handler
+
+       exeinto "/usr/bin"
+       newexe "${T}/launcher.sh" "discord" || die "failing to install launcher"
+
+       # https://bugs.gentoo.org/898912
+       if use appindicator; then
+               dosym ../../usr/lib64/libayatana-appindicator3.so /opt/discord/libappindicator3.so
+       fi
+}
+
+pkg_postinst() {
+       xdg_pkg_postinst
+
+       optfeature_header "Install the following packages for additional support:"
+       optfeature "sound support" \
+               media-sound/pulseaudio media-sound/apulse[sdk] media-video/pipewire
+       optfeature "emoji support" media-fonts/noto-emoji
+}
diff --git a/net-im/discord/discord-0.0.66.ebuild b/net-im/discord/discord-0.0.66.ebuild
new file mode 100644 (file)
index 0000000..9c133ac
--- /dev/null
@@ -0,0 +1,147 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+MY_PN="${PN/-bin/}"
+MY_PV="${PV/-r*/}"
+
+CHROMIUM_LANGS="
+       af am ar bg bn ca cs da de el en-GB en-US es es-419 et fa fi fil fr gu he hi
+       hr hu id it ja kn ko lt lv ml mr ms nb nl pl pt-BR pt-PT ro ru sk sl sr sv
+       sw ta te th tr uk ur vi zh-CN zh-TW
+"
+
+inherit chromium-2 desktop linux-info optfeature unpacker xdg
+
+DESCRIPTION="All-in-one voice and text chat for gamers"
+HOMEPAGE="https://discord.com/"
+SRC_URI="https://dl.discordapp.net/apps/linux/${MY_PV}/${MY_PN}-${MY_PV}.tar.gz"
+S="${WORKDIR}/${MY_PN^}"
+
+LICENSE="all-rights-reserved"
+SLOT="0"
+KEYWORDS="amd64"
+
+IUSE="appindicator +seccomp wayland"
+RESTRICT="bindist mirror strip test"
+
+RDEPEND="
+       >=app-accessibility/at-spi2-core-2.46.0:2
+       app-crypt/libsecret
+       dev-libs/expat
+       dev-libs/glib:2
+       dev-libs/nspr
+       dev-libs/nss
+       media-libs/alsa-lib
+       media-libs/fontconfig
+       media-libs/mesa[gbm(+)]
+       net-print/cups
+       sys-apps/dbus
+       sys-apps/util-linux
+       sys-libs/glibc
+       x11-libs/cairo
+       x11-libs/libdrm
+       x11-libs/gdk-pixbuf:2
+       x11-libs/gtk+:3
+       x11-libs/libX11
+       x11-libs/libXScrnSaver
+       x11-libs/libXcomposite
+       x11-libs/libXdamage
+       x11-libs/libXext
+       x11-libs/libXfixes
+       x11-libs/libXrandr
+       x11-libs/libxcb
+       x11-libs/libxkbcommon
+       x11-libs/libxshmfence
+       x11-libs/pango
+       appindicator? ( dev-libs/libayatana-appindicator )
+"
+
+DESTDIR="/opt/${MY_PN}"
+
+QA_PREBUILT="*"
+
+CONFIG_CHECK="~USER_NS"
+
+src_unpack() {
+       unpack ${MY_PN}-${MY_PV}.tar.gz
+}
+
+src_configure() {
+       default
+       chromium_suid_sandbox_check_kernel_config
+}
+
+src_prepare() {
+       default
+       # remove post-install script
+       rm postinst.sh || die "the removal of the unneeded post-install script failed"
+       # cleanup languages
+       pushd "locales/" >/dev/null || die "location change for language cleanup failed"
+       chromium_remove_language_paks
+       popd >/dev/null || die "location reset for language cleanup failed"
+
+       # fix .desktop exec location
+       sed --in-place --expression "/^Exec=/s:/usr/share/discord/Discord:/usr/bin/${MY_PN}:" \
+               "${MY_PN}.desktop" ||
+               die "fixing of exec location on .desktop failed"
+
+       # Update exec location in launcher
+       sed --expression "s:@@DESTDIR@@:${DESTDIR}:" \
+               "${FILESDIR}/launcher.sh" > "${T}/launcher.sh" || die "updating of exec location in launcher failed"
+
+       # USE seccomp in launcher
+       if use seccomp; then
+               sed --in-place --expression '/^EBUILD_SECCOMP=/s/false/true/' \
+                       "${T}/launcher.sh" || die "sed failed for seccomp"
+       fi
+
+       # USE wayland in launcher
+       if use wayland; then
+               sed --in-place --expression '/^EBUILD_WAYLAND=/s/false/true/' \
+                       "${T}/launcher.sh" || die "sed failed for wayland"
+       fi
+}
+
+src_install() {
+       doicon -s 256 "${MY_PN}.png"
+
+       # install .desktop file
+       domenu "${MY_PN}.desktop"
+
+       exeinto "${DESTDIR}"
+
+       doexe "${MY_PN^}" chrome-sandbox libEGL.so libffmpeg.so libGLESv2.so libvk_swiftshader.so
+
+       insinto "${DESTDIR}"
+       doins chrome_100_percent.pak chrome_200_percent.pak icudtl.dat resources.pak snapshot_blob.bin v8_context_snapshot.bin
+       insopts -m0755
+       doins -r locales resources
+
+       # Chrome-sandbox requires the setuid bit to be specifically set.
+       # see https://github.com/electron/electron/issues/17972
+       fowners root "${DESTDIR}/chrome-sandbox"
+       fperms 4711 "${DESTDIR}/chrome-sandbox"
+
+       # Crashpad is included in the package once in a while and when it does, it must be installed.
+       # See #903616 and #890595
+       [[ -x chrome_crashpad_handler ]] && doins chrome_crashpad_handler
+
+       exeinto "/usr/bin"
+       newexe "${T}/launcher.sh" "discord" || die "failing to install launcher"
+
+       # https://bugs.gentoo.org/898912
+       if use appindicator; then
+               dosym ../../usr/lib64/libayatana-appindicator3.so /opt/discord/libappindicator3.so
+       fi
+}
+
+pkg_postinst() {
+       xdg_pkg_postinst
+
+       optfeature_header "Install the following packages for additional support:"
+       optfeature "sound support" \
+               media-sound/pulseaudio media-sound/apulse[sdk] media-video/pipewire
+       optfeature "emoji support" media-fonts/noto-emoji
+}
diff --git a/net-im/discord/files/launcher.sh b/net-im/discord/files/launcher.sh
new file mode 100644 (file)
index 0000000..31c2cc3
--- /dev/null
@@ -0,0 +1,20 @@
+#!/usr/bin/env bash
+# coding: UTF-8
+
+
+declare -a discord_parameters
+
+# Variables set during ebuild configuration
+EBUILD_SECCOMP=false
+EBUILD_WAYLAND=false
+
+"${EBUILD_SECCOMP}" || discord_parameters+=( --disable-seccomp-filter-sandbox )
+
+"${EBUILD_WAYLAND}" && \
+[[ -n "${WAYLAND_DISPLAY}" ]] && discord_parameters+=(
+       --enable-features=UseOzonePlatform
+       --ozone-platform=wayland
+       --enable-wayland-ime
+)
+
+@@DESTDIR@@/Discord "${discord_parameters[@]}" "$@"
diff --git a/sci-libs/miopen/Manifest b/sci-libs/miopen/Manifest
new file mode 100644 (file)
index 0000000..7d3a348
--- /dev/null
@@ -0,0 +1,12 @@
+AUX miopen-4.2.0-disable-no-inline-boost.patch 447 BLAKE2B ed62e94b4a557c06654ec7ea35300d3d737d4caf8f2421d119a4963c0a13ea4ad2ddeb990f95764e1063872d1dd12fdeb9c917d1a6d0409d0533d78642e03dcb SHA512 32785237505bbc291df6fc7ecb2a9dbf4320f7a8f97ebb0296392d7b5404c5072c21e254d579720c27391930ebe4e779b9d1de344f47905a9210fe0b8e4b7b28
+AUX miopen-4.2.0-gcc11-numeric_limits.patch 461 BLAKE2B 4502c7dc41e0e4ebf4105076c4415ce36e56e596bf98672ecf3d77de4a984499be0990a762c2b05d5e395a06c7df511c9f7629362c7849b31a0d2868b45d99d0 SHA512 04ce10c55af9b979651ef0c345bd12156c850139809601f29ab9305235499b53034efe1928a6dbb77d04114ddf8d93c71d37cc7bef373b07620c2169f88aebc3
+AUX miopen-4.3.0-enable-test.patch 1046 BLAKE2B a9a103eee9b3b6890c02349f36dba7c4cc4459969ebe07915d0cccd3aecbd0edab21de8acbdaee17daae602733965ec1bdda60456f2e0c6bd91ae9795c24622e SHA512 cadc3844aaa32713f0d630ae3ffb9a947c303cf80410785339187ad0ee3cce8bac1b201c12134ba0241c54c296e2752a1076a3826735ccfe4d2cf5f15504f390
+AUX miopen-4.3.0-fix-interface-include-in-HIP_COMPILER_FLAGS.patch 954 BLAKE2B 11f260c1ab9dd1569cf25363626e6431615f8853f334b0123d82b0e3404dcdb1b4ecd9e26658e2f39e4fa6a15ba672cb6940b0279e0ef22535e46992721fd060 SHA512 28724e7e1c1de5cee2d18b6c3da76fa857f95aee64a286262c8426149787f62d07f4a3892472cef91d3c091ec53c7f474a70616ce63e5fbbb4c531ed2ab91a50
+AUX miopen-5.0.2-strip-xnack-in-flags.patch 1205 BLAKE2B d1ba065387050b51288dba37631adea42398b2f7cd8b604e5c305d3491fb661dce8c448e31db42c70f8b6e4dec84c4214ce869dd1419eb67c2ea4c33f18849b5 SHA512 ad32335831c7d1057b53469aa2d1f8f3366b23ccdc71cb7e9a4e7813e7da7e9bb73e62465f1086391653538ccbab2f662baf2446e10e8dbc0f0db631d7368a4d
+AUX miopen-5.1.3-avoid-metadata-error-for-vanilla-clang.patch 10748 BLAKE2B 582b362a54d9ee00c8f6062b4ec16bebdaea7734adadcd5f6201801cb8ce3a7ca64e8148a10f2f3ab682560ced1f037b217bdcd161869d80a8489f4d56bd5241 SHA512 08cd489d23a48d0b227dacc514e3f84999c1e9a0ac3dd5424d9376c77c4d745c65f48c0f470cb5e65c20e9dbbfcb457995301a74bfe27a81604bf89213a2f1d2
+AUX miopen-5.1.3-deprecate-clang-ocl.patch 2884 BLAKE2B 4f45f66d87dea51d9f87878f52520863b36defa1403055a580e5f33c18e3de08daad1b3d3d5fad06d7d3f16da4f0945390872f573f168d1893f5f635070f1463 SHA512 c4835559a4005ffd2aac7afb38213d06857ab1a8d4bc5bd5c150b82226671fb1d66c6ef1d4eab2106ad11c475007af441182ca26f659a3fd779cd7d4f5c90247
+AUX miopen-5.1.3-gfx1031.patch 19268 BLAKE2B b3d10c57601fd5f39ae431d101687863de34b149ee08df25c987d18ef0bd89d8419a4a18659a22060093eba1cf97c2774e92abf8a38449a202e8770070b29dbf SHA512 44fb3445065087a3952ac143fba88addb4cc634dbd13e15d85d234c64fabba9cf7b83d8161a361e847375a2bc92efc86489e12cfa23ecce1b035d2ccb028db56
+AUX miopen-5.1.3-include-array.patch 343 BLAKE2B 993a8f3e301f4c16088ca216b2d820b17ceb42eeda4550b4291a70e00592281f992bf184407d024a0f8b2207a26fef2d56c26ef95e7a452d3b97090e1335a404 SHA512 887ac13f25c1bfd524bb2a3be701bf688f002a95ef8218cb798e41feaeb0678dbbd2ffaf905c59070a125001093bf5ede1bb6a77fdfe6f7a4ff19cbccfdc6624
+AUX miopen-5.1.3-no-strip.patch 608 BLAKE2B 3173d95219542a48c6dcd2b87e7157dcf483ff714c3d1c1c47aab8fc8af7b1fd4f6ac52b9d8e892cc25bff973597f4a05426fa4714b0764733b810867af59cfe SHA512 201357718203ee9a4062362541c483e069321b825708c6aa0e8892cc7722bcd520808797307e320df34c4fbf0003198f7a46717d5ff3819b1e2c3a5a3a045725
+DIST MIOpen-5.7.1.tar.gz 100751593 BLAKE2B c5f847fe4374ab22737c281a65401125012328412d584fc09244b431ea6265d6d5028429115ee15fa8b04cbe0edd020e4e7ac8deb22561183ed76cb8c3d4d9d4 SHA512 3354b3b154f29a6337403abc5a71ec47c0b2558320c5a1b0cbfbbdb370c4fada2db12d4a19a312b5e30ca2e2302ee50ece3390603e84d132b2212a168e9523fa
+EBUILD miopen-5.7.1.ebuild 2887 BLAKE2B dc14414391e10e8b3e7fd55c8c01257cea393cddd4f72815d301c25d7cee500c0169c989de0430078015d0c151bdc6f55637f7d37533a1c6704d756c9e416d07 SHA512 1e8634694fe4c8ec09b9db8a9611e767bf1c1420efc302e9d9b34934b7751f1f66916e452903ce0380fd67eee388f790502bd760f1b6693805a602c8eecdac6f
diff --git a/sci-libs/miopen/files/miopen-4.2.0-disable-no-inline-boost.patch b/sci-libs/miopen/files/miopen-4.2.0-disable-no-inline-boost.patch
new file mode 100644 (file)
index 0000000..769217a
--- /dev/null
@@ -0,0 +1,14 @@
+This let MIOpen compatible with >boost-1.72, for example 1.76
+
+Suggested by: Michael Boone <mike@protagonistsystems.io>
+
+--- a/CMakeLists.txt   2021-07-23 01:26:15.377754243 -0700
++++ b/CMakeLists.txt   2021-07-23 01:29:23.925685190 -0700
+@@ -216,6 +216,7 @@
+ message(STATUS "Hip compiler flags: ${HIP_COMPILER_FLAGS}")
+ add_definitions("-DHIP_COMPILER_FLAGS=${HIP_COMPILER_FLAGS}")
++add_definitions("-DBOOST_CONTAINER_DISABLE_NOINLINE")
+ # HIP
diff --git a/sci-libs/miopen/files/miopen-4.2.0-gcc11-numeric_limits.patch b/sci-libs/miopen/files/miopen-4.2.0-gcc11-numeric_limits.patch
new file mode 100644 (file)
index 0000000..73997ce
--- /dev/null
@@ -0,0 +1,14 @@
+See: https://stackoverflow.com/questions/4798936/numeric-limits-was-not-declared-in-this-scope-no-matching-function-for-call-t
+
+https://www.gnu.org/software/gcc/gcc-11/porting_to.html#header-dep-changes
+
+--- MIOpen-rocm-4.2.0/src/include/miopen/float_equal.hpp
++++ MIOpen-rocm-4.2.0/src/include/miopen/float_equal.hpp
+@@ -29,6 +29,7 @@
+ #include <algorithm>
+ #include <cmath>
+ #include <numeric>
++#include <limits>
+ #ifdef _MSC_VER
+ #include <iso646.h>
+ #endif
diff --git a/sci-libs/miopen/files/miopen-4.3.0-enable-test.patch b/sci-libs/miopen/files/miopen-4.3.0-enable-test.patch
new file mode 100644 (file)
index 0000000..68d2f14
--- /dev/null
@@ -0,0 +1,31 @@
+This create option BUILD_TESTS for miopen, like other rocm math libs, and
+
+testing executables are always built if test enabled. The original behaviour, is
+
+always add test/CMakeLists.txt without adding test exes as targets, and compile them
+
+during test.
+--- orig/CMakeLists.txt
++++ MIOpen-rocm-4.3.0/CMakeLists.txt
+@@ -590,6 +590,9 @@ add_subdirectory(src)
+ if(MIOPEN_BUILD_DRIVER)
+     add_subdirectory(driver)
+ endif()
+-add_subdirectory(test)
++option(BUILD_TESTS "Build binaries for tests" OFF)
++if(BUILD_TESTS)
++      add_subdirectory(test)
++endif()
+ add_subdirectory(speedtests)
+ add_subdirectory(utils)
+--- orig/test/CMakeLists.txt
++++ MIOpen-rocm-4.3.0/test/CMakeLists.txt
+@@ -142,7 +142,7 @@ function(add_test_command NAME EXE)
+ endfunction()
+ function(add_test_executable TEST_NAME)
+-    add_executable (${TEST_NAME} EXCLUDE_FROM_ALL ${ARGN})
++    add_executable (${TEST_NAME} ${ARGN})
+     clang_tidy_check(${TEST_NAME})
+     target_link_libraries(${TEST_NAME} ${CMAKE_THREAD_LIBS_INIT})
+     # Cmake does not add flags correctly for gcc
diff --git a/sci-libs/miopen/files/miopen-4.3.0-fix-interface-include-in-HIP_COMPILER_FLAGS.patch b/sci-libs/miopen/files/miopen-4.3.0-fix-interface-include-in-HIP_COMPILER_FLAGS.patch
new file mode 100644 (file)
index 0000000..5c2762a
--- /dev/null
@@ -0,0 +1,17 @@
+The interface inlude directories of hip::device should be included using -I, not -isystem;
+
+otherwise compilation at MIOpen runtime will fail due to cstdlib cannot find <stdlib.h> or similar errors.
+
+Suggested-by: Yuyi Wang <Strawberry_Str@hotmail.com>
+Signed-off-by: Yiyang Wu <xgreenlandforwyy@gmail.com>
+--- orig/cmake/TargetFlags.cmake
++++ MIOpen-rocm-4.3.0/cmake/TargetFlags.cmake
+@@ -41,7 +41,7 @@ function(target_flags FLAGS TARGET)
+     set(_flags)
+     append_flags(_flags ${TARGET} "INTERFACE_COMPILE_OPTIONS" "")
+     append_flags(_flags ${TARGET} "INTERFACE_COMPILE_DEFINITIONS" "-D")
+-    append_flags(_flags ${TARGET} "INTERFACE_INCLUDE_DIRECTORIES" "-isystem ")
++      append_flags(_flags ${TARGET} "INTERFACE_INCLUDE_DIRECTORIES" "-I ")
+     append_flags(_flags ${TARGET} "INTERFACE_LINK_DIRECTORIES" "-L ")
+     append_flags(_flags ${TARGET} "INTERFACE_LINK_OPTIONS" "")
+     append_link_flags(_flags ${TARGET} "INTERFACE_LINK_LIBRARIES" "")
diff --git a/sci-libs/miopen/files/miopen-5.0.2-strip-xnack-in-flags.patch b/sci-libs/miopen/files/miopen-5.0.2-strip-xnack-in-flags.patch
new file mode 100644 (file)
index 0000000..14d2c5b
--- /dev/null
@@ -0,0 +1,20 @@
+if options like :xnack- exists in ${AMDGPU_TARGETS}, CMakeLists cannot handle HIP_COMPILER_FLAGS well
+
+the original regex replace should include :+- so xnack- is stripped as well. Otherwise clang complation at MIOpen runtime will fail.
+
+Signed-off-by: Yiyang Wu <xgreenlandforwyy@gmail.com>
+Index: MIOpen-rocm-5.0.2/CMakeLists.txt
+===================================================================
+--- MIOpen-rocm-5.0.2.orig/CMakeLists.txt
++++ MIOpen-rocm-5.0.2/CMakeLists.txt
+@@ -198,8 +198,8 @@ find_package(hip REQUIRED PATHS /opt/roc
+ message(STATUS "Build with HIP ${hip_VERSION}")
+ target_flags(HIP_COMPILER_FLAGS hip::device)
+ # Remove cuda arch flags
+-string(REGEX REPLACE --cuda-gpu-arch=[a-z0-9]+ "" HIP_COMPILER_FLAGS "${HIP_COMPILER_FLAGS}")
+-string(REGEX REPLACE --offload-arch=[a-z0-9]+ "" HIP_COMPILER_FLAGS "${HIP_COMPILER_FLAGS}")
++string(REGEX REPLACE --cuda-gpu-arch=[a-z0-9:+-]+ "" HIP_COMPILER_FLAGS "${HIP_COMPILER_FLAGS}")
++string(REGEX REPLACE --offload-arch=[a-z0-9:+-]+ "" HIP_COMPILER_FLAGS "${HIP_COMPILER_FLAGS}")
+ string(REPLACE "$<LINK_LANGUAGE:CXX>" "1" HIP_COMPILER_FLAGS "${HIP_COMPILER_FLAGS}")
+ string(REPLACE "SHELL:" "" HIP_COMPILER_FLAGS "${HIP_COMPILER_FLAGS}")
diff --git a/sci-libs/miopen/files/miopen-5.1.3-avoid-metadata-error-for-vanilla-clang.patch b/sci-libs/miopen/files/miopen-5.1.3-avoid-metadata-error-for-vanilla-clang.patch
new file mode 100644 (file)
index 0000000..3dca20f
--- /dev/null
@@ -0,0 +1,183 @@
+Together with find-sed command in 5.1.3 ebuild, this fixes
+https://github.com/ROCmSoftwarePlatform/MIOpen/issues/1731
+index 71b2cabf1..60e7fab6e 100644
+--- a/src/kernels/Conv_Winograd_v13_3_12_epilogue.inc
++++ b/src/kernels/Conv_Winograd_v13_3_12_epilogue.inc
+@@ -76,7 +76,7 @@ amdhsa.kernels:
+     .max_flat_workgroup_size: \wg_x
+     .wavefront_size: 64
+     .args:
+-    - { .size: 4, .offset: 0,   .value_kind: by_value,      .value_type: i32, .name: N }
++    - { .size: 4, .offset: 0,   .value_kind: by_value,      .value_type: i32, .name: X }
+     - { .size: 4, .offset: 4,   .value_kind: by_value,      .value_type: i32, .name: C }
+     - { .size: 4, .offset: 8,   .value_kind: by_value,      .value_type: i32, .name: H }
+     - { .size: 4, .offset: 12,  .value_kind: by_value,      .value_type: i32, .name: W }
+diff --git a/src/kernels/Conv_Winograd_v16_5_0_epilogue.inc b/src/kernels/Conv_Winograd_v16_5_0_epilogue.inc
+index 36d47c862..f8f677ec6 100644
+--- a/src/kernels/Conv_Winograd_v16_5_0_epilogue.inc
++++ b/src/kernels/Conv_Winograd_v16_5_0_epilogue.inc
+@@ -76,7 +76,7 @@ amdhsa.kernels:
+     .max_flat_workgroup_size: \wg_x
+     .wavefront_size: 64
+     .args:
+-    - { .size: 4, .offset: 0,   .value_kind: by_value,      .value_type: i32, .name: N }
++    - { .size: 4, .offset: 0,   .value_kind: by_value,      .value_type: i32, .name: X }
+     - { .size: 4, .offset: 4,   .value_kind: by_value,      .value_type: i32, .name: C }
+     - { .size: 4, .offset: 8,   .value_kind: by_value,      .value_type: i32, .name: H }
+     - { .size: 4, .offset: 12,  .value_kind: by_value,      .value_type: i32, .name: W }
+diff --git a/src/kernels/Conv_Winograd_v21_1_3_metadata.inc b/src/kernels/Conv_Winograd_v21_1_3_metadata.inc
+index deff81e84..ed47abea7 100644
+--- a/src/kernels/Conv_Winograd_v21_1_3_metadata.inc
++++ b/src/kernels/Conv_Winograd_v21_1_3_metadata.inc
+@@ -51,7 +51,7 @@ amdhsa.kernels:
+     .max_flat_workgroup_size: \wg_x
+     .wavefront_size: 64
+     .args:
+-    - { .size: 4, .offset:   0, .value_kind: by_value, .value_type: i32, .name: N }
++    - { .size: 4, .offset:   0, .value_kind: by_value, .value_type: i32, .name: X }
+     - { .size: 4, .offset:   4, .value_kind: by_value, .value_type: i32, .name: C }
+     - { .size: 4, .offset:   8, .value_kind: by_value, .value_type: i32, .name: H }
+     - { .size: 4, .offset:  12, .value_kind: by_value, .value_type: i32, .name: W }
+diff --git a/src/kernels/conv1x1u.s b/src/kernels/conv1x1u.s
+index 5dc213546..c890d45a4 100644
+--- a/src/kernels/conv1x1u.s
++++ b/src/kernels/conv1x1u.s
+@@ -1076,7 +1076,7 @@ amdhsa.kernels:
+     .max_flat_workgroup_size: \wg_x
+     .wavefront_size: 64
+     .args:
+-    - { .size: 4, .offset:  0, .value_kind: by_value, .value_type: i32, .name: N }
++    - { .size: 4, .offset:  0, .value_kind: by_value, .value_type: i32, .name: X }
+     - { .size: 4, .offset:  4, .value_kind: by_value, .value_type: i32, .name: C }
+     - { .size: 4, .offset:  8, .value_kind: by_value, .value_type: i32, .name: H }
+     - { .size: 4, .offset: 12, .value_kind: by_value, .value_type: i32, .name: W }
+diff --git a/src/kernels/conv1x1u_bias_activ.s b/src/kernels/conv1x1u_bias_activ.s
+index 1675e819a..6bbdd9936 100644
+--- a/src/kernels/conv1x1u_bias_activ.s
++++ b/src/kernels/conv1x1u_bias_activ.s
+@@ -1230,7 +1230,7 @@ amdhsa.kernels:
+     .max_flat_workgroup_size: \wg_x
+     .wavefront_size: 64
+     .args:
+-    - { .size: 4, .offset:  0, .value_kind: by_value, .value_type: i32, .name: N }
++    - { .size: 4, .offset:  0, .value_kind: by_value, .value_type: i32, .name: X }
+     - { .size: 4, .offset:  4, .value_kind: by_value, .value_type: i32, .name: C }
+     - { .size: 4, .offset:  8, .value_kind: by_value, .value_type: i32, .name: H }
+     - { .size: 4, .offset: 12, .value_kind: by_value, .value_type: i32, .name: W }
+diff --git a/src/kernels/conv1x1u_stride2.s b/src/kernels/conv1x1u_stride2.s
+index c5ea1e90c..6241edcf7 100644
+--- a/src/kernels/conv1x1u_stride2.s
++++ b/src/kernels/conv1x1u_stride2.s
+@@ -1162,7 +1162,7 @@ amdhsa.kernels:
+     .max_flat_workgroup_size: \wg_x
+     .wavefront_size: 64
+     .args:
+-    - { .size: 4, .offset:  0, .value_kind: by_value, .value_type: i32, .name: N }
++    - { .size: 4, .offset:  0, .value_kind: by_value, .value_type: i32, .name: X }
+     - { .size: 4, .offset:  4, .value_kind: by_value, .value_type: i32, .name: C }
+     - { .size: 4, .offset:  8, .value_kind: by_value, .value_type: i32, .name: H }
+     - { .size: 4, .offset: 12, .value_kind: by_value, .value_type: i32, .name: W }
+diff --git a/src/kernels/conv1x1wrw.s b/src/kernels/conv1x1wrw.s
+index b13b6ffa4..eb63f17c6 100644
+--- a/src/kernels/conv1x1wrw.s
++++ b/src/kernels/conv1x1wrw.s
+@@ -1243,7 +1243,7 @@ amdhsa.kernels:
+     .max_flat_workgroup_size: \wg_x
+     .wavefront_size: 64
+     .args:
+-    - { .size: 4, .offset:  0, .value_kind: by_value, .value_type: i32, .name: N }
++    - { .size: 4, .offset:  0, .value_kind: by_value, .value_type: i32, .name: X }
+     - { .size: 4, .offset:  4, .value_kind: by_value, .value_type: i32, .name: C }
+     - { .size: 4, .offset:  8, .value_kind: by_value, .value_type: i32, .name: H }
+     - { .size: 4, .offset: 12, .value_kind: by_value, .value_type: i32, .name: W }
+diff --git a/src/kernels/conv3x3wrw.s b/src/kernels/conv3x3wrw.s
+index a3f73aeae..b6fb1632c 100755
+--- a/src/kernels/conv3x3wrw.s
++++ b/src/kernels/conv3x3wrw.s
+@@ -1033,7 +1033,7 @@ amdhsa.kernels:
+     .max_flat_workgroup_size: \wg_x
+     .wavefront_size: 64
+     .args:
+-    - { .size: 4, .offset:  0, .value_kind: by_value, .value_type: i32, .name: N }
++    - { .size: 4, .offset:  0, .value_kind: by_value, .value_type: i32, .name: X }
+     - { .size: 4, .offset:  4, .value_kind: by_value, .value_type: i32, .name: C }
+     - { .size: 4, .offset:  8, .value_kind: by_value, .value_type: i32, .name: H }
+     - { .size: 4, .offset: 12, .value_kind: by_value, .value_type: i32, .name: W }
+diff --git a/src/kernels/conv_3x3_wheel_alpha_v3_0b_epilogue.inc b/src/kernels/conv_3x3_wheel_alpha_v3_0b_epilogue.inc
+index 358772e63..b27ad5284 100644
+--- a/src/kernels/conv_3x3_wheel_alpha_v3_0b_epilogue.inc
++++ b/src/kernels/conv_3x3_wheel_alpha_v3_0b_epilogue.inc
+@@ -76,7 +76,7 @@ amdhsa.kernels:
+     .max_flat_workgroup_size: \wg_x
+     .wavefront_size: 64
+     .args:
+-    - { .size: 4, .offset: 0,   .value_kind: by_value,      .value_type: i32, .name: N }
++    - { .size: 4, .offset: 0,   .value_kind: by_value,      .value_type: i32, .name: X }
+     - { .size: 4, .offset: 4,   .value_kind: by_value,      .value_type: i32, .name: C }
+     - { .size: 4, .offset: 8,   .value_kind: by_value,      .value_type: i32, .name: H }
+     - { .size: 4, .offset: 12,  .value_kind: by_value,      .value_type: i32, .name: W }
+diff --git a/src/kernels/conv_3x3_wheel_alpha_v7_0_3b_epilogue.inc b/src/kernels/conv_3x3_wheel_alpha_v7_0_3b_epilogue.inc
+index d3296969a..f873ce153 100644
+--- a/src/kernels/conv_3x3_wheel_alpha_v7_0_3b_epilogue.inc
++++ b/src/kernels/conv_3x3_wheel_alpha_v7_0_3b_epilogue.inc
+@@ -76,7 +76,7 @@ amdhsa.kernels:
+     .max_flat_workgroup_size: \wg_x
+     .wavefront_size: 64
+     .args:
+-    - { .size: 4, .offset: 0,   .value_kind: by_value,      .value_type: i32, .name: N }
++    - { .size: 4, .offset: 0,   .value_kind: by_value,      .value_type: i32, .name: X }
+     - { .size: 4, .offset: 4,   .value_kind: by_value,      .value_type: i32, .name: C }
+     - { .size: 4, .offset: 8,   .value_kind: by_value,      .value_type: i32, .name: H }
+     - { .size: 4, .offset: 12,  .value_kind: by_value,      .value_type: i32, .name: W }
+diff --git a/src/kernels/conv_3x3_wheel_alpha_v9_0_15_epilogue.inc b/src/kernels/conv_3x3_wheel_alpha_v9_0_15_epilogue.inc
+index a253cc0f9..1582d002c 100644
+--- a/src/kernels/conv_3x3_wheel_alpha_v9_0_15_epilogue.inc
++++ b/src/kernels/conv_3x3_wheel_alpha_v9_0_15_epilogue.inc
+@@ -76,7 +76,7 @@ amdhsa.kernels:
+     .max_flat_workgroup_size: \wg_x
+     .wavefront_size: 64
+     .args:
+-    - { .size: 4, .offset: 0,   .value_kind: by_value,      .value_type: i32, .name: N }
++    - { .size: 4, .offset: 0,   .value_kind: by_value,      .value_type: i32, .name: X }
+     - { .size: 4, .offset: 4,   .value_kind: by_value,      .value_type: i32, .name: C }
+     - { .size: 4, .offset: 8,   .value_kind: by_value,      .value_type: i32, .name: H }
+     - { .size: 4, .offset: 12,  .value_kind: by_value,      .value_type: i32, .name: W }
+diff --git a/src/kernels/conv_3x3_wheel_alpha_v9_2_7_epilogue.inc b/src/kernels/conv_3x3_wheel_alpha_v9_2_7_epilogue.inc
+index e40ac1f60..78495e024 100644
+--- a/src/kernels/conv_3x3_wheel_alpha_v9_2_7_epilogue.inc
++++ b/src/kernels/conv_3x3_wheel_alpha_v9_2_7_epilogue.inc
+@@ -76,7 +76,7 @@ amdhsa.kernels:
+     .max_flat_workgroup_size: \wg_x
+     .wavefront_size: 64
+     .args:
+-    - { .size: 4, .offset: 0,   .value_kind: by_value,      .value_type: i32, .name: N }
++    - { .size: 4, .offset: 0,   .value_kind: by_value,      .value_type: i32, .name: X }
+     - { .size: 4, .offset: 4,   .value_kind: by_value,      .value_type: i32, .name: C }
+     - { .size: 4, .offset: 8,   .value_kind: by_value,      .value_type: i32, .name: H }
+     - { .size: 4, .offset: 12,  .value_kind: by_value,      .value_type: i32, .name: W }
+diff --git a/src/kernels/xform_bidirect_winograd_code.inc b/src/kernels/xform_bidirect_winograd_code.inc
+index 724845f49..d03314ef5 100644
+--- a/src/kernels/xform_bidirect_winograd_code.inc
++++ b/src/kernels/xform_bidirect_winograd_code.inc
+@@ -1566,7 +1566,7 @@ amdhsa.kernels:
+     .max_flat_workgroup_size: \wg_x
+     .wavefront_size: 64
+     .args:
+-    - { .size: 4, .offset:   0, .value_kind: by_value, .value_type: i32, .name: N }
++    - { .size: 4, .offset:   0, .value_kind: by_value, .value_type: i32, .name: X }
+     - { .size: 4, .offset:   4, .value_kind: by_value, .value_type: i32, .name: C }
+     - { .size: 4, .offset:   8, .value_kind: by_value, .value_type: i32, .name: H }
+     - { .size: 4, .offset:  12, .value_kind: by_value, .value_type: i32, .name: W }
+diff --git a/src/kernels/xform_metadata.inc b/src/kernels/xform_metadata.inc
+index 960a9a2d8..83b736bee 100644
+--- a/src/kernels/xform_metadata.inc
++++ b/src/kernels/xform_metadata.inc
+@@ -74,7 +74,7 @@ amdhsa.kernels:
+     .max_flat_workgroup_size: \wg_x
+     .wavefront_size: 64
+     .args:
+-    - { .size: 4, .offset:   0, .value_kind: by_value, .value_type: i32, .name: N }
++    - { .size: 4, .offset:   0, .value_kind: by_value, .value_type: i32, .name: X }
+     - { .size: 4, .offset:   4, .value_kind: by_value, .value_type: i32, .name: C }
+     - { .size: 4, .offset:   8, .value_kind: by_value, .value_type: i32, .name: H }
+     - { .size: 4, .offset:  12, .value_kind: by_value, .value_type: i32, .name: W }
diff --git a/sci-libs/miopen/files/miopen-5.1.3-deprecate-clang-ocl.patch b/sci-libs/miopen/files/miopen-5.1.3-deprecate-clang-ocl.patch
new file mode 100644 (file)
index 0000000..93c66fd
--- /dev/null
@@ -0,0 +1,55 @@
+This is a cherry picked PR on 5.1.3, which replace clang-ocl with clang
+From 98f001dfe61208af04ecf7690023efd772ee7d43 Mon Sep 17 00:00:00 2001
+From: Jehandad Khan <jahandad@gmail.com>
+Date: Tue, 19 Jul 2022 17:24:05 -0500
+Subject: [PATCH] Remove clang-ocl  and replace with clang
+
+---
+ CMakeLists.txt              | 7 +------
+ README.md                   | 1 -
+ src/hipoc/hipoc_program.cpp | 7 ++++++-
+ 3 files changed, 7 insertions(+), 8 deletions(-)
+
+Index: MIOpen-rocm-5.1.3/CMakeLists.txt
+===================================================================
+--- MIOpen-rocm-5.1.3.orig/CMakeLists.txt
++++ MIOpen-rocm-5.1.3/CMakeLists.txt
+@@ -241,7 +241,7 @@ if( MIOPEN_BACKEND STREQUAL "HIP" OR MIO
+     # miopentensile default off
+     set(MIOPEN_USE_MIOPENTENSILE OFF CACHE BOOL "")
+-    find_program(HIP_OC_COMPILER clang-ocl
++    find_program(HIP_OC_COMPILER clang
+         PATH_SUFFIXES bin
+         PATHS
+             /opt/rocm
+Index: MIOpen-rocm-5.1.3/README.md
+===================================================================
+--- MIOpen-rocm-5.1.3.orig/README.md
++++ MIOpen-rocm-5.1.3/README.md
+@@ -14,7 +14,6 @@ MIOpen supports two programming models -
+   * OpenCL - OpenCL libraries and header files
+   * HIP - 
+     * HIP and HCC libraries and header files
+-    * [clang-ocl](https://github.com/RadeonOpenCompute/clang-ocl) -- **required**
+ * [MIOpenGEMM](https://github.com/ROCmSoftwarePlatform/MIOpenGEMM) to enable various functionalities including transposed and dilated convolutions. This is optional on the HIP backend. Users can enable this library using the cmake configuration flag `-DMIOPEN_USE_MIOPENGEMM=On`.
+ * ROCm cmake modules can be installed from [here](https://github.com/RadeonOpenCompute/rocm-cmake)
+ * [Half](http://half.sourceforge.net/) - IEEE 754-based half-precision floating point library
+Index: MIOpen-rocm-5.1.3/src/hipoc/hipoc_program.cpp
+===================================================================
+--- MIOpen-rocm-5.1.3.orig/src/hipoc/hipoc_program.cpp
++++ MIOpen-rocm-5.1.3/src/hipoc/hipoc_program.cpp
+@@ -255,7 +255,12 @@ void HIPOCProgramImpl::BuildCodeObjectIn
+         if(miopen::IsEnabled(MIOPEN_DEBUG_OPENCL_WAVE64_NOWGP{}))
+             params += " -mwavefrontsize64 -mcumode";
+         WriteFile(src, dir->path / filename);
+-        dir->Execute(HIP_OC_COMPILER, params + " " + filename + " -o " + hsaco_file.string());
++        params += " -target amdgcn-amd-amdhsa -x cl -D__AMD__=1  -O3";
++        params += " -cl-kernel-arg-info -cl-denorms-are-zero";
++        params += " -cl-std=CL1.2 -mllvm -amdgpu-early-inline-all";
++        params += " -mllvm -amdgpu-internalize-symbols ";
++        params += " " + filename + " -o " + hsaco_file.string();
++        dir->Execute(HIP_OC_COMPILER, params);
+     }
+     if(!boost::filesystem::exists(hsaco_file))
+         MIOPEN_THROW("Cant find file: " + hsaco_file.string());
diff --git a/sci-libs/miopen/files/miopen-5.1.3-gfx1031.patch b/sci-libs/miopen/files/miopen-5.1.3-gfx1031.patch
new file mode 100644 (file)
index 0000000..de22d66
--- /dev/null
@@ -0,0 +1,375 @@
+Enable gfx1031 support
+======================
+--- MIOpen-rocm-5.1.3/fin/src/include/conv_fin.hpp     2022-05-08 14:08:05.000000000 +0800
++++ gfx1031/fin/src/include/conv_fin.hpp       2022-09-01 18:36:18.630980283 +0800
+@@ -111,6 +111,10 @@ class ConvFin : public Fin
+         {
+             assert(num_cu == 72 || num_cu == 36);
+         }
++        else if(arch == "gfx1031")
++        {
++            assert(num_cu == 40 || num_cu == 20);
++        }
+         else if(arch == "gfx90a")
+         {
+             assert(num_cu == 110);
+Only in MIOpen-rocm-5.1.3: patches
+--- MIOpen-rocm-5.1.3/src/composable_kernel/composable_kernel/include/utility/config.hpp       2022-05-08 14:08:05.000000000 +0800
++++ gfx1031/src/composable_kernel/composable_kernel/include/utility/config.hpp 2022-09-01 18:36:18.634980274 +0800
+@@ -13,7 +13,7 @@
+ // GPU target
+ // should enable one and only one GPU target
+ #if !(defined(CK_AMD_GPU_GFX803) || defined(CK_AMD_GPU_GFX900) || defined(CK_AMD_GPU_GFX906) || \
+-      defined(CK_AMD_GPU_GFX908) || defined(CK_AMD_GPU_GFX90A) || defined(CK_AMD_GPU_GFX1030))
++      defined(CK_AMD_GPU_GFX908) || defined(CK_AMD_GPU_GFX90A) || defined(CK_AMD_GPU_GFX1030) || defined(CK_AMD_GPU_GFX1031))
+ #error Need to define (only) one GPU target
+ #endif
+@@ -29,7 +29,7 @@
+ #if defined(CK_AMD_GPU_GFX803) || defined(CK_AMD_GPU_GFX900) || defined(CK_AMD_GPU_GFX906) || \
+     defined(CK_AMD_GPU_GFX908) || defined(CK_AMD_GPU_GFX90A)
+ #define CK_BUFFER_RESOURCE_3RD_DWORD 0x00020000
+-#elif defined(CK_AMD_GPU_GFX1030)
++#elif (defined(CK_AMD_GPU_GFX1030) || defined(CK_AMD_GPU_GFX1031))
+ #define CK_BUFFER_RESOURCE_3RD_DWORD 0x31014000
+ #endif
+@@ -37,7 +37,7 @@
+ #if defined(CK_AMD_GPU_GFX803) || defined(CK_AMD_GPU_GFX900)
+ #define CK_USE_AMD_V_MAC_F32
+ #elif defined(CK_AMD_GPU_GFX906) || defined(CK_AMD_GPU_GFX908) || defined(CK_AMD_GPU_GFX90a) || \
+-    defined(CK_AMD_GPU_GFX1030)
++    (defined(CK_AMD_GPU_GFX1030) || defined(CK_AMD_GPU_GFX1031))
+ #define CK_USE_AMD_V_FMAC_F32
+ #define CK_USE_AMD_V_DOT2_F32_F16
+ #define CK_USE_AMD_V_DOT4_I32_I8
+--- MIOpen-rocm-5.1.3/src/include/miopen/solver/ck_utility_common.hpp  2022-05-08 14:08:05.000000000 +0800
++++ gfx1031/src/include/miopen/solver/ck_utility_common.hpp    2022-09-01 18:36:18.638980266 +0800
+@@ -54,6 +54,7 @@ static inline bool is_ck_supported_hardw
+            StartsWith(handle.GetDeviceName(), "gfx908") ||
+            StartsWith(handle.GetDeviceName(), "gfx90a") ||
+            StartsWith(handle.GetDeviceName(), "gfx1030");
++           StartsWith(handle.GetDeviceName(), "gfx1031");
+ }
+ static inline bool is_support_amd_buffer_atomic_fadd(const std::string& device_name)
+@@ -83,6 +84,8 @@ static inline auto get_ck_common_compile
+         compiler_flag << " -DCK_AMD_GPU_GFX90A";
+     else if(StartsWith(device_name, "gfx1030"))
+         compiler_flag << " -DCK_AMD_GPU_GFX1030";
++    else if(StartsWith(device_name, "gfx1031"))
++        compiler_flag << " -DCK_AMD_GPU_GFX1031";
+     // buffer atomic-fadd
+     compiler_flag << " -DCK_USE_AMD_BUFFER_ATOMIC_FADD="
+--- MIOpen-rocm-5.1.3/src/include/miopen/solver/implicitgemm_util.hpp  2022-05-08 14:08:05.000000000 +0800
++++ gfx1031/src/include/miopen/solver/implicitgemm_util.hpp    2022-09-01 18:36:18.638980266 +0800
+@@ -469,7 +469,7 @@ static inline bool is_use_amd_buffer_loa
+ {
+ #if WORKAROUND_MIOPEN_ISSUE_557
+     const auto device_name = ctx.GetStream().GetDeviceName();
+-    return !StartsWith(device_name, "gfx1030");
++    return !StartsWith(device_name, "gfx1030") && !StartsWith(device_name, "gfx1031");
+ #else
+     return true;
+ #endif
+@@ -478,7 +478,7 @@ static inline bool is_use_amd_buffer_loa
+ static inline bool is_use_v_fmac_f32(const ConvolutionContext& ctx)
+ {
+     const auto device_name = ctx.GetStream().GetDeviceName();
+-    return StartsWith(device_name, "gfx1030");
++    return StartsWith(device_name, "gfx1030") || StartsWith(device_name, "gfx1031");
+ }
+ static inline bool support_amd_buffer_atomic_fadd(const std::string& device_name)
+@@ -599,7 +599,8 @@ static inline bool IsComposableKernelSup
+            StartsWith(c.GetStream().GetDeviceName(), "gfx906") ||
+            StartsWith(c.GetStream().GetDeviceName(), "gfx908") ||
+            StartsWith(c.GetStream().GetDeviceName(), "gfx90a") ||
+-           StartsWith(c.GetStream().GetDeviceName(), "gfx1030");
++           StartsWith(c.GetStream().GetDeviceName(), "gfx1030")||
++           StartsWith(c.GetStream().GetDeviceName(), "gfx1031");
+ }
+ // greatest common divisor, aka highest common factor
+--- MIOpen-rocm-5.1.3/src/kernels/batchnorm_functions.h        2022-05-08 14:08:05.000000000 +0800
++++ gfx1031/src/kernels/batchnorm_functions.h  2022-09-01 18:36:18.858979772 +0800
+@@ -159,6 +159,10 @@
+ #define MIO_BN_GFX1030 0
+ #endif
++#ifndef MIO_BN_GFX1031
++#define MIO_BN_GFX1031 0
++#endif
++
+ #define UNUSED __attribute__((__unused__))
+ #if(MIO_BN_VARIANT != 4)
+--- MIOpen-rocm-5.1.3/src/kernels/MIOpenBatchNormActivBwdPerAct.cl     2022-05-08 14:08:05.000000000 +0800
++++ gfx1031/src/kernels/MIOpenBatchNormActivBwdPerAct.cl       2022-09-01 18:36:18.858979772 +0800
+@@ -34,7 +34,7 @@
+ #endif
+ #define MIOPEN_USE_AMDGCN 0
+-#if defined(__AMDGCN__) && MIO_BN_GFX1030 != 1
++#if defined(__AMDGCN__) && MIO_BN_GFX1030 != 1 && MIO_BN_GFX1031 != 1
+ #undef MIOPEN_USE_AMDGCN
+ #define MIOPEN_USE_AMDGCN 1
+ #endif
+--- MIOpen-rocm-5.1.3/src/kernels/MIOpenBatchNormActivBwdSpatial.cl    2022-05-08 14:08:05.000000000 +0800
++++ gfx1031/src/kernels/MIOpenBatchNormActivBwdSpatial.cl      2022-09-01 18:36:18.858979772 +0800
+@@ -32,7 +32,7 @@
+ #endif
+ #define MIOPEN_USE_AMDGCN 0
+-#if defined(__AMDGCN__) && MIO_BN_GFX1030 != 1
++#if defined(__AMDGCN__) && MIO_BN_GFX1030 != 1 && MIO_BN_GFX1031 != 1
+ #undef MIOPEN_USE_AMDGCN
+ #define MIOPEN_USE_AMDGCN 1
+ #endif
+--- MIOpen-rocm-5.1.3/src/kernels/MIOpenBatchNormActivFwdTrainSpatial.cl       2022-05-08 14:08:05.000000000 +0800
++++ gfx1031/src/kernels/MIOpenBatchNormActivFwdTrainSpatial.cl 2022-09-01 18:36:18.858979772 +0800
+@@ -33,7 +33,7 @@
+ #endif
+ #define MIOPEN_USE_AMDGCN 0
+-#if defined(__AMDGCN__) && MIO_BN_GFX1030 != 1
++#if defined(__AMDGCN__) && MIO_BN_GFX1030 != 1 && MIO_BN_GFX1031 != 1
+ #undef MIOPEN_USE_AMDGCN
+ #define MIOPEN_USE_AMDGCN 1
+ #endif
+--- MIOpen-rocm-5.1.3/src/kernels/MIOpenBatchNormBwdSpatial.cl 2022-05-08 14:08:05.000000000 +0800
++++ gfx1031/src/kernels/MIOpenBatchNormBwdSpatial.cl   2022-09-01 18:36:18.858979772 +0800
+@@ -33,7 +33,7 @@
+ #endif
+ #define MIOPEN_USE_AMDGCN 0
+-#if defined(__AMDGCN__) && MIO_BN_GFX1030 != 1
++#if defined(__AMDGCN__) && MIO_BN_GFX1030 != 1 && MIO_BN_GFX1031 != 1
+ #undef MIOPEN_USE_AMDGCN
+ #define MIOPEN_USE_AMDGCN 1
+ #endif
+--- MIOpen-rocm-5.1.3/src/kernels/MIOpenBatchNormFwdTrainSpatial.cl    2022-05-08 14:08:05.000000000 +0800
++++ gfx1031/src/kernels/MIOpenBatchNormFwdTrainSpatial.cl      2022-09-01 18:36:18.858979772 +0800
+@@ -33,7 +33,7 @@
+ #endif
+ #define MIOPEN_USE_AMDGCN 0
+-#if defined(__AMDGCN__) && MIO_BN_GFX1030 != 1
++#if defined(__AMDGCN__) && MIO_BN_GFX1030 != 1 && MIO_BN_GFX1031 != 1
+ #undef MIOPEN_USE_AMDGCN
+ #define MIOPEN_USE_AMDGCN 1
+ #endif
+--- MIOpen-rocm-5.1.3/src/md_graph.cpp 2022-05-08 14:08:05.000000000 +0800
++++ gfx1031/src/md_graph.cpp   2022-09-01 18:36:18.630980283 +0800
+@@ -738,8 +738,8 @@ void FusionMDGraph::InitConv(FusionMDGra
+             add_v21_wino("gfx9", {"gfx900", "gfx906", "gfx908", "gfx90a"}, 1);
+             add_v21_wino("gfx9", {"gfx900", "gfx906", "gfx908", "gfx90a"}, 2);
+-            add_v21_wino("gfx10", {"gfx1011", "gfx1012", "gfx1030"}, 1);
+-            add_v21_wino("gfx10", {"gfx1011", "gfx1012", "gfx1030"}, 2);
++            add_v21_wino("gfx10", {"gfx1011", "gfx1012", "gfx1030", "gfx1031"}, 1);
++            add_v21_wino("gfx10", {"gfx1011", "gfx1012", "gfx1030", "gfx1031"}, 2);
+         }
+     }
+--- MIOpen-rocm-5.1.3/src/ocl/fusionopbiasbnactivocl.cpp       2022-05-08 14:08:05.000000000 +0800
++++ gfx1031/src/ocl/fusionopbiasbnactivocl.cpp 2022-09-01 18:36:18.634980274 +0800
+@@ -392,7 +392,8 @@ miopenStatus_t BatchNormBwdTrainFusionOp
+            " -DMIO_BN_USESAVED=" + std::to_string(static_cast<int>(true)) +
+            " -DMIO_BN_VARIANT=" + std::to_string(variant) +
+            " -DMIO_BN_CBA_WRITE_INTERMEDIATE=" + std::to_string(0) +
+-           " -DMIO_BN_GFX1030=" + ((handle.GetDeviceName() == "gfx1030") ? "1" : "0");
++           " -DMIO_BN_GFX1030=" + ((handle.GetDeviceName() == "gfx1030") ? "1" : "0") +
++           " -DMIO_BN_GFX1031=" + ((handle.GetDeviceName() == "gfx1031") ? "1" : "0");
+     compile_config += add;
+     MIOPEN_LOG_I2(add);
+@@ -607,7 +608,8 @@ miopenStatus_t BatchNormFwdTrainFusionOp
+            " -DMIO_SAVE_MEAN_VARIANCE=" + (saveBatchStats ? "1" : "0") +
+            " -DMIO_RUNNING_RESULT=" + ((savePopStats) ? "1" : "0") +
+            " -DMIO_BN_VARIANT=" + std::to_string(variant) +
+-           " -DMIO_BN_GFX1030=" + ((handle.GetDeviceName() == "gfx1030") ? "1" : "0");
++           " -DMIO_BN_GFX1030=" + ((handle.GetDeviceName() == "gfx1030") ? "1" : "0") +
++           " -DMIO_BN_GFX1031=" + ((handle.GetDeviceName() == "gfx1031") ? "1" : "0");
+     compile_config += add;
+     MIOPEN_LOG_I2(add);
+--- MIOpen-rocm-5.1.3/src/solver/batchnorm/backward_per_activation.cpp 2022-05-08 14:08:05.000000000 +0800
++++ gfx1031/src/solver/batchnorm/backward_per_activation.cpp   2022-09-01 18:36:18.638980266 +0800
+@@ -113,6 +113,7 @@ BnBwdTrainingPerActivation::GetSolution(
+             {"MIO_BN_GRP1", ylocalsize},
+             {"MIO_BN_GRP2", zlocalsize},
+             {"MIO_BN_GFX1030", ((handle.GetDeviceName() == "gfx1030") ? "1" : "0")},
++            {"MIO_BN_GFX1031", ((handle.GetDeviceName() == "gfx1031") ? "1" : "0")},
+         };
+         kernel.comp_options = build_params.GenerateFor(kbp::OpenCL{});
+--- MIOpen-rocm-5.1.3/src/solver/batchnorm/backward_spatial_multiple.cpp       2022-05-08 14:08:05.000000000 +0800
++++ gfx1031/src/solver/batchnorm/backward_spatial_multiple.cpp 2022-09-01 18:36:18.638980266 +0800
+@@ -210,6 +210,7 @@ ConvSolution BnBwdTrainingSpatialMultipl
+             {"MIO_BN_GRP1", ylocalsize},
+             {"MIO_BN_GRP2", zlocalsize},
+             {"MIO_BN_GFX1030", ((handle.GetDeviceName() == "gfx1030") ? "1" : "0")},
++            {"MIO_BN_GFX1031", ((handle.GetDeviceName() == "gfx1031") ? "1" : "0")},
+             {"MIO_LAYOUT_NHWC", static_cast<int>(problem.IsLayoutNHWC())},
+         };
+--- MIOpen-rocm-5.1.3/src/solver/batchnorm/backward_spatial_single.cpp 2022-05-08 14:08:05.000000000 +0800
++++ gfx1031/src/solver/batchnorm/backward_spatial_single.cpp   2022-09-01 18:36:18.638980266 +0800
+@@ -247,6 +247,7 @@ BnBwdTrainingSpatialSingle::GetSolution(
+             build_params << KernelBuildParameters{
+                 {"MIO_BN_GFX1030", (handle.GetDeviceName() == "gfx1030") ? "1" : "0"},
++                              {"MIO_BN_GFX1031", ((handle.GetDeviceName() == "gfx1031") ? "1" : "0")},
+             };
+             kernel.comp_options = build_params.GenerateFor(kbp::OpenCL{});
+--- MIOpen-rocm-5.1.3/src/solver/batchnorm/forward_inference.cpp       2022-05-08 14:08:05.000000000 +0800
++++ gfx1031/src/solver/batchnorm/forward_inference.cpp 2022-09-01 18:36:18.638980266 +0800
+@@ -103,6 +103,7 @@ ConvSolution BnFwdInference::GetSolution
+             {"MIO_BN_GRP1", ylocalsize},\r
+             {"MIO_BN_GRP2", zlocalsize},\r
+             {"MIO_BN_GFX1030", ((handle.GetDeviceName() == "gfx1030") ? "1" : "0")},\r
++            {"MIO_BN_GFX1031", ((handle.GetDeviceName() == "gfx1031") ? "1" : "0")},\r
+         };\r
\r
+         kernel.comp_options = build_params.GenerateFor(kbp::OpenCL{});\r
+--- MIOpen-rocm-5.1.3/src/solver/batchnorm/forward_per_activation.cpp  2022-05-08 14:08:05.000000000 +0800
++++ gfx1031/src/solver/batchnorm/forward_per_activation.cpp    2022-09-01 18:36:18.638980266 +0800
+@@ -105,6 +105,7 @@ BnFwdTrainingPerActivation::GetSolution(
+             {"MIO_BN_GRP1", ylocalsize},
+             {"MIO_BN_GRP2", zlocalsize},
+             {"MIO_BN_GFX1030", ((handle.GetDeviceName() == "gfx1030") ? "1" : "0")},
++            {"MIO_BN_GFX1031", ((handle.GetDeviceName() == "gfx1031") ? "1" : "0")},
+         };
+         auto kernel = KernelInfo{};
+--- MIOpen-rocm-5.1.3/src/solver/batchnorm/forward_spatial_multiple.cpp        2022-05-08 14:08:05.000000000 +0800
++++ gfx1031/src/solver/batchnorm/forward_spatial_multiple.cpp  2022-09-01 18:36:18.638980266 +0800
+@@ -177,6 +177,7 @@ ConvSolution BnFwdTrainingSpatialMultipl
+             {"MIO_BN_GRP1", ylocalsize},
+             {"MIO_BN_GRP2", zlocalsize},
+             {"MIO_BN_GFX1030", ((handle.GetDeviceName() == "gfx1030") ? "1" : "0")},
++            {"MIO_BN_GFX1031", ((handle.GetDeviceName() == "gfx1031") ? "1" : "0")},
+             {"MIO_LAYOUT_NHWC", static_cast<int>(problem.IsLayoutNHWC())},
+         };
+--- MIOpen-rocm-5.1.3/src/solver/batchnorm/forward_spatial_single.cpp  2022-05-08 14:08:05.000000000 +0800
++++ gfx1031/src/solver/batchnorm/forward_spatial_single.cpp    2022-09-01 18:36:18.638980266 +0800
+@@ -211,6 +211,7 @@ BnFwdTrainingSpatialSingle::GetSolution(
+             {"MIO_BN_GRP1", ylocalsize},
+             {"MIO_BN_GRP2", zlocalsize},
+             {"MIO_BN_GFX1030", ((handle.GetDeviceName() == "gfx1030") ? "1" : "0")},
++            {"MIO_BN_GFX1031", ((handle.GetDeviceName() == "gfx1031") ? "1" : "0")},
+             {"MIO_LAYOUT_NHWC", static_cast<int>(problem.IsLayoutNHWC())},
+         };
+--- MIOpen-rocm-5.1.3/src/target_properties.cpp        2022-05-08 14:08:05.000000000 +0800
++++ gfx1031/src/target_properties.cpp  2022-09-01 18:36:18.630980283 +0800
+@@ -54,6 +54,7 @@ static std::string GetDeviceNameFromMap(
+         {"Vega10", "gfx900"},
+         {"gfx901", "gfx900"},
+         {"10.3.0 Sienna_Cichlid 18", "gfx1030"},
++        {"10.3.1 Navi_flounder 18", "gfx1031"},
+     };
+     const char* const p_asciz = miopen::GetStringEnv(MIOPEN_DEBUG_ENFORCE_DEVICE{});
+--- MIOpen-rocm-5.1.3/test/CMakeLists.txt      2022-05-08 14:08:05.000000000 +0800
++++ gfx1031/test/CMakeLists.txt        2022-09-01 18:36:19.022979405 +0800
+@@ -38,6 +38,7 @@ option( MIOPEN_TEST_GFX90A "Test on gfx9
+ option( MIOPEN_TEST_GFX900 "Test on Vega10 (gfx900)" OFF )
+ option( MIOPEN_TEST_GFX906 "Test on Vega20 (gfx906)" OFF )
+ option( MIOPEN_TEST_GFX1030 "Test on Navi21 (gfx1030)" OFF )
++option( MIOPEN_TEST_GFX1031 "Test on Navi21 (gfx1031)" OFF )
+ option( MIOPEN_TEST_GPU_XNACK_ENABLED "Test as if XNACK mode is enabled" OFF )
+ option( MIOPEN_TEST_CONV Off)
+ option( MIOPEN_TEST_DEEPBENCH Off)
+@@ -74,7 +75,7 @@ endif()
+ # Also we do not detect GPU when target GPU for testing is specified explicitly.
+ set(MIOPEN_TEST_GPU_DETECTION_FAILED FALSE)
+ set(MIOPEN_NO_GPU FALSE)
+-if(NOT (MIOPEN_TEST_GFX900 OR MIOPEN_TEST_GFX906 OR MIOPEN_TEST_GFX908 OR MIOPEN_TEST_GFX90A OR MIOPEN_TEST_GFX1030 OR MIOPEN_TEST_HIP_NOGPU))
++if(NOT (MIOPEN_TEST_GFX900 OR MIOPEN_TEST_GFX906 OR MIOPEN_TEST_GFX908 OR MIOPEN_TEST_GFX90A OR MIOPEN_TEST_GFX1030 OR MIOPEN_TEST_GFX1031 OR MIOPEN_TEST_HIP_NOGPU))
+     find_program(ROCMINFO
+         NAMES rocminfo
+         PATHS
+@@ -96,6 +97,8 @@ if(NOT (MIOPEN_TEST_GFX900 OR MIOPEN_TES
+         elseif (NOT ROCMINFO_EXIT_STATUS EQUAL 0)
+             message(WARNING "ROCMINFO FAILED, GPU TYPE UNKNOWN. Manually set respective MIOPEN_TEST_GFX* CMake variable to specify target GPU for testing.")
+             set(MIOPEN_TEST_GPU_DETECTION_FAILED TRUE)
++        elseif(ROCMINFO_OUTPUT MATCHES "gfx1031")
++            set(MIOPEN_TEST_GFX1031 ON)
+         elseif(ROCMINFO_OUTPUT MATCHES "gfx1030")
+             set(MIOPEN_TEST_GFX1030 ON)
+         elseif(ROCMINFO_OUTPUT MATCHES "gfx900")
+@@ -125,6 +128,7 @@ message(STATUS "MIOPEN_TEST_GFX906 ${MIO
+ message(STATUS "MIOPEN_TEST_GFX908 ${MIOPEN_TEST_GFX908}")
+ message(STATUS "MIOPEN_TEST_GFX90A ${MIOPEN_TEST_GFX90A}")
+ message(STATUS "MIOPEN_TEST_GFX1030 ${MIOPEN_TEST_GFX1030}")
++message(STATUS "MIOPEN_TEST_GFX1031 ${MIOPEN_TEST_GFX1031}")
+ message(STATUS "MIOPEN_TEST_GPU_XNACK_ENABLED ${MIOPEN_TEST_GPU_XNACK_ENABLED}")
+ message(STATUS "MIOPEN_TEST_GPU_DETECTION_FAILED ${MIOPEN_TEST_GPU_DETECTION_FAILED}")
+@@ -167,10 +171,10 @@ endmacro()
+ set_var_to_condition(WORKAROUND_ISSUE_1187_DEFAULT MIOPEN_TEST_GFX90A AND MIOPEN_TEST_FLOAT)
+ option( WORKAROUND_ISSUE_1187 "" ${WORKAROUND_ISSUE_1187_DEFAULT})
+-set_var_to_condition(WORKAROUND_ISSUE_1148_DEFAULT MIOPEN_TEST_GFX1030 AND MIOPEN_TEST_FLOAT)
++set_var_to_condition(WORKAROUND_ISSUE_1148_DEFAULT MIOPEN_TEST_GFX1030 OR MIOPEN_TEST_GFX1031 AND MIOPEN_TEST_FLOAT)
+ option( WORKAROUND_ISSUE_1148 "" ${WORKAROUND_ISSUE_1148_DEFAULT})
+-set_var_to_condition(WORKAROUND_ISSUE_1334_DEFAULT MIOPEN_TEST_GFX1030 AND MIOPEN_TEST_FLOAT)
++set_var_to_condition(WORKAROUND_ISSUE_1334_DEFAULT MIOPEN_TEST_GFX1030 OR MIOPEN_TEST_GFX1031 AND MIOPEN_TEST_FLOAT)
+ option( WORKAROUND_ISSUE_1334 "" ${WORKAROUND_ISSUE_1334_DEFAULT})
+ if(NOT MIOPEN_TEST_MIOTENSILE)
+@@ -216,7 +220,7 @@ if (MIOPEN_NO_GPU)
+             test_pooling3d test_perfdb)
+ endif()
+-if(MIOPEN_TEST_GFX1030)
++if(MIOPEN_TEST_GFX1030 OR MIOPEN_TEST_GFX1031)
+     if(WORKAROUND_ISSUE_1053 AND MIOPEN_TEST_ALL)
+         list(APPEND SKIP_TESTS test_lrn_test)
+     endif()
+@@ -439,7 +443,7 @@ endfunction()
+ #   If nothing is specified, the default value is taken.
+ #   Default: FLOAT_ENABLED HALF_DISABLED BF16_DISABLED INT8_DISABLED
+ #
+-# GPU types: GFX900, GFX906, GFX908, GFX90A, GFX1030
++# GPU types: GFX900, GFX906, GFX908, GFX90A, GFX1030, GFX1031
+ #   The option can be enabled or disabled by using '_ENABLED' and '_DISABLED' suffix.
+ #   If nothing is specified, the default value is taken.
+ #   Default: GFX900_ENABLED, GFX906_ENABLED, GFX908_ENABLED, GFX90A_ENABLED, GFX1030_DISABLED
+@@ -571,7 +575,7 @@ function(add_custom_test NAME)
+         set_tests_properties(${NAME} PROPERTIES RUN_SERIAL On)
+     endif()
+-    if(  (is_gfx900_check OR is_gfx906_check OR is_gfx908_check OR is_gfx1030_check OR is_gfx90a_check)
++    if(  (is_gfx900_check OR is_gfx906_check OR is_gfx908_check OR is_gfx1030_check OR is_gfx1031_check OR is_gfx90a_check)
+      AND is_full_check
+      AND is_xnack_on_check
+      AND (is_miotensile_check AND is_mlir_check)
+--- MIOpen-rocm-5.1.3/test/handle_test.cpp     2022-05-08 14:08:05.000000000 +0800
++++ gfx1031/test/handle_test.cpp       2022-09-01 18:36:19.018979413 +0800
+@@ -234,7 +234,7 @@ void test_warnings(kernel_type_t kern_ty
+ void test_arch_name()
+ {
+     auto&& h        = get_handle();
+-    auto known_arch = {"gfx908", "gfx90a", "gfx906", "gfx900", "gfx803", "gfx1030"};
++    auto known_arch = {"gfx908", "gfx90a", "gfx906", "gfx900", "gfx803", "gfx1030", "gfx1031"};
+     auto this_arch  = h.GetDeviceName();
+     EXPECT(std::any_of(
+         known_arch.begin(), known_arch.end(), [&](std::string arch) { return arch == this_arch; }));
+--- MIOpen-rocm-5.1.3/test/mdgraph.cpp 2022-05-08 14:08:05.000000000 +0800
++++ gfx1031/test/mdgraph.cpp   2022-09-01 18:36:19.022979405 +0800
+@@ -222,7 +222,7 @@ struct mdgraph_driver : test_driver
+         auto target    = h.GetTargetProperties();
+         auto wino_supported_arch = {
+-            "gfx1030", "gfx1012", "gfx1011", "gfx90a", "gfx908", "gfx906", "gfx900", "gfx803"};
++            "gfx1030", "gfx1031","gfx1012", "gfx1011", "gfx90a", "gfx908", "gfx906", "gfx900", "gfx803"};
+         auto is_wino_support = !xnack_enabled &&
+                                !miopen::IsDisabled(MIOPEN_DEBUG_GCN_ASM_KERNELS{}) &&
diff --git a/sci-libs/miopen/files/miopen-5.1.3-include-array.patch b/sci-libs/miopen/files/miopen-5.1.3-include-array.patch
new file mode 100644 (file)
index 0000000..fc6a36d
--- /dev/null
@@ -0,0 +1,12 @@
+This fixes compile error upon gcc-12 libstdc++
+index 1cfb2a72c..0f4feb406 100644
+--- a/test/sequences.cpp
++++ b/test/sequences.cpp
+@@ -25,6 +25,7 @@
+  *******************************************************************************/
+ #include "test.hpp"
+ #include <miopen/sequences.hpp>
++#include <array>
+ namespace miopen {
+ namespace seq {
diff --git a/sci-libs/miopen/files/miopen-5.1.3-no-strip.patch b/sci-libs/miopen/files/miopen-5.1.3-no-strip.patch
new file mode 100644 (file)
index 0000000..0d1d429
--- /dev/null
@@ -0,0 +1,17 @@
+Don't strip for release. Let portage handle stripping.
+Index: MIOpen-rocm-5.1.3/CMakeLists.txt
+===================================================================
+--- MIOpen-rocm-5.1.3.orig/CMakeLists.txt
++++ MIOpen-rocm-5.1.3/CMakeLists.txt
+@@ -78,11 +78,6 @@ option( BUILD_DEV "Build for development
+ option(MIOPEN_ENABLE_FIN "Enable the fin driver for MIOpen"  OFF)
+-# Strip symbols for release
+-if(NOT WIN32 AND NOT APPLE)
+-    set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -s")
+-    set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s")
+-endif()
+ rocm_setup_version(VERSION 2.16.0)
diff --git a/sci-libs/miopen/miopen-5.7.1.ebuild b/sci-libs/miopen/miopen-5.7.1.ebuild
new file mode 100644 (file)
index 0000000..edf4307
--- /dev/null
@@ -0,0 +1,105 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+ROCM_VERSION=${PV}
+
+inherit cmake flag-o-matic llvm rocm
+
+LLVM_MAX_SLOT=18
+
+DESCRIPTION="AMD's Machine Intelligence Library"
+HOMEPAGE="https://github.com/ROCmSoftwarePlatform/MIOpen"
+SRC_URI="https://github.com/ROCm/MIOpen/archive/refs/tags/rocm-${PV}.tar.gz -> MIOpen-${PV}.tar.gz"
+
+LICENSE="MIT"
+KEYWORDS="~amd64"
+SLOT="0/$(ver_cut 1-2)"
+
+IUSE="debug test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+       >=dev-util/hip-5.1.3
+       >=dev-db/sqlite-3.17
+       sci-libs/rocBLAS:${SLOT}[${ROCM_USEDEP}]
+       >=dev-libs/boost-1.72
+"
+
+DEPEND="${RDEPEND}"
+
+BDEPEND="dev-libs/half:0/1
+       dev-build/rocm-cmake
+"
+
+S="${WORKDIR}/MIOpen-rocm-${PV}"
+
+PATCHES=(
+       "${FILESDIR}/${PN}-4.2.0-gcc11-numeric_limits.patch"
+       "${FILESDIR}/${PN}-4.3.0-fix-interface-include-in-HIP_COMPILER_FLAGS.patch"
+       "${FILESDIR}/${PN}-4.3.0-enable-test.patch"
+       "${FILESDIR}/${PN}-5.1.3-no-strip.patch"
+       "${FILESDIR}/${PN}-5.1.3-include-array.patch"
+)
+
+src_prepare() {
+       cmake_src_prepare
+
+       sed -e "s:/opt/rocm/llvm:$(get_llvm_prefix ${LLVM_MAX_SLOT}) NO_DEFAULT_PATH:" \
+               -e "s:/opt/rocm/hip:$(hipconfig -p) NO_DEFAULT_PATH:" \
+               -e '/set( MIOPEN_INSTALL_DIR/s:miopen:${CMAKE_INSTALL_PREFIX}:' \
+               -e '/MIOPEN_TIDY_ERRORS ALL/d' \
+               -i CMakeLists.txt || die
+
+       sed -e "/rocm_install_symlink_subdir(\${MIOPEN_INSTALL_DIR})/d" -i src/CMakeLists.txt || die
+       sed -e "/add_test/s:--build \${CMAKE_CURRENT_BINARY_DIR}:--build ${BUILD_DIR}:" -i test/CMakeLists.txt || die
+
+       sed -e "s:\${AMD_DEVICE_LIBS_PREFIX}/lib:${EPREFIX}/usr/lib/amdgcn/bitcode:" -i cmake/hip-config.cmake || die
+
+       # This plus avoid-metadata-error-for-vanilla-clang.patch fix bug mentioned
+       # in https://github.com/ROCmSoftwarePlatform/MIOpen/issues/1731
+       find src/kernels -name "*.s" -exec \
+               sed -e "s/.name: n /.name: x /g" -e "s/.name: y /.name: z /g" \
+                       -e "s/.name: y,/.name: z,/g" -i {} \; || die
+}
+
+src_configure() {
+       if ! use debug; then
+               append-cflags "-DNDEBUG"
+               append-cxxflags "-DNDEBUG"
+               CMAKE_BUILD_TYPE="Release"
+       else
+               CMAKE_BUILD_TYPE="Debug"
+       fi
+
+       local mycmakeargs=(
+               -DCMAKE_SKIP_RPATH=ON
+               -DAMDGPU_TARGETS="$(get_amdgpu_flags)"
+               -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr"
+               -DMIOPEN_BACKEND=HIP
+               -DBoost_USE_STATIC_LIBS=OFF
+               -DMIOPEN_USE_MLIR=OFF
+               -DMIOPEN_ENABLE_AI_KERNEL_TUNING=OFF
+               -DBUILD_TESTS=$(usex test ON OFF)
+               -DMIOPEN_TEST_ALL=$(usex test ON OFF)
+       )
+
+       if use test; then
+               for gpu_target in ${AMDGPU_TARGETS}; do
+                       mycmakeargs+=( -DMIOPEN_TEST_${gpu_target^^}=ON )
+               done
+       fi
+
+       addpredict /dev/kfd
+       addpredict /dev/dri/
+       append-cxxflags "--rocm-path=$(hipconfig -R)"
+       append-cxxflags "--hip-device-lib-path=${EPREFIX}/usr/lib/amdgcn/bitcode"
+       CXX="$(get_llvm_prefix ${LLVM_MAX_SLOT})/bin/clang++" cmake_src_configure
+}
+
+src_test() {
+       check_amdgpu
+       export LD_LIBRARY_PATH="${BUILD_DIR}"/lib
+       MAKEOPTS="-j1" cmake_src_test
+}