--- /dev/null
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit unpacker
+
+MY_PV=$(ver_rs 3 '-')
+
+DESCRIPTION="Proprietary image-support library for Radeon Open Compute"
+HOMEPAGE="https://github.com/RadeonOpenCompute/ROCm#closed-source-components"
+SRC_URI="http://repo.radeon.com/rocm/apt/debian/pool/main/h/${PN}-dev/${PN}-dev_${MY_PV}-g835b876_amd64.deb"
+
+LICENSE="AMD-GPU-PRO-EULA"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="-deprecated"
+
+RESTRICT="mirror fetch strip"
+
+QA_PREBUILT="/opt/${PN}/lib*/*"
+
+S="${WORKDIR}"
+
+pkg_nofetch() {
+ einfo "Please download the package"
+ einfo
+ einfo " ${SRC_URI}"
+ einfo
+ einfo "and place into your distfiles directory."
+}
+
+src_unpack() {
+ unpack_deb ${A}
+}
+
+src_install() {
+ local destdir="/opt/${PN}"
+ local soversion=$(ver_cut 1-3)
+ local somajor=$(ver_cut 1)
+
+ local solibs_to_install=( "libhsa-ext-image64.so" )
+ if use deprecated; then
+ solibs_to_install+=( "libhsa-runtime-tools64.so" )
+ fi
+
+ into "${destdir}"
+ for solib in ${solibs_to_install[@]}; do
+ dolib.so "opt/rocm/hsa/lib/${solib}.${soversion}"
+ dosym "${EPREFIX}${destdir}/$(get_libdir)/${solib}.${soversion}" "${EPREFIX}usr/$(get_libdir)/${solib}.${soversion}"
+ dosym "${solib}.${soversion}" "${EPREFIX}usr/$(get_libdir)/${solib}.${somajor}"
+ done
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>marecki@gentoo.org</email>
+ <name>Marek Szuba</name>
+ </maintainer>
+ <maintainer type="person">
+ <email>candrews@gentoo.org</email>
+ <name>Craig Andrews</name>
+ </maintainer>
+ <longdescription lang="en">
+ For the time being the ROCm platform relies on a closed-source library
+ to provide HSA image support. In the future it will either be deprecated
+ or become open source.
+ Furthermore, this package optionally provides the "tools"
+ debug/trace/profiling library which has already been deprecated.
+ </longdescription>
+ <use>
+ <flag name="deprecated">Install the deprecated debug/trace/profiling library</flag>
+ </use>
+</pkgmetadata>