Skip to content

Instantly share code, notes, and snippets.

@naetherm
Last active March 26, 2020 11:11
Show Gist options
  • Save naetherm/7a66839dc5b9a834c68b4d2e55fb8c23 to your computer and use it in GitHub Desktop.
Save naetherm/7a66839dc5b9a834c68b4d2e55fb8c23 to your computer and use it in GitHub Desktop.
amdgpu-pro-install
# Author: Janusz Lewandowski <[email protected]>
# Contributor: David McFarland <[email protected]>
# Maintainer: Andrew Shark <ashark @at@ linuxcomp.ru>
# Autogenerated from AMD's Packages file
major=20.10
minor=1028677
pkgbase=amdgpu-pro-installer
pkgname=(
amdgpu-core-meta
amdgpu-pro-core-meta
amf-amdgpu-pro
hip-amdgpu-pro
amdgpu-pro-libgl
lib32-amdgpu-pro-libgl
opencl-amdgpu-pro
opencl-amdgpu-pro-comgr
opencl-amdgpu-pro-dev
opencl-amdgpu-pro-pal
opencl-amdgpu-pro-orca
lib32-opencl-amdgpu-pro-orca
vulkan-amdgpu-pro
lib32-vulkan-amdgpu-pro
)
pkgver=${major}_${minor}
pkgrel=1
arch=('x86_64')
url=https://www.amd.com/en/support/kb/release-notes/rn-rad-lin-20-10-unified
license=('custom: multiple')
groups=('Radeon_Software_for_Linux')
makedepends=('wget')
DLAGENTS='https::/usr/bin/wget --referer https://www.amd.com/en/support/kb/release-notes/rn-rad-lin-20-10-early-preview -N %u'
source=(https://drivers.amd.com/drivers/linux/amdgpu-pro-${major}-${minor}-ubuntu-18.04.tar.xz)
sha256sums=(ae2c4253bf11bea3dd01be79aeb250e4f44297ab8374e98a97716aa0809a9ed8)
PKGEXT=".pkg.tar"
# extracts a debian package
# $1: deb file to extract
extract_deb() {
local tmpdir="$(basename "${1%.deb}")"
rm -Rf "$tmpdir"
mkdir "$tmpdir"
cd "$tmpdir"
ar x "$1"
tar -C "${pkgdir}" -xf data.tar.xz
}
# move ubuntu specific /usr/lib/x86_64-linux-gnu to /usr/lib
# $1: debian package library dir (goes from opt/amdgpu or opt/amdgpu-pro and from x86_64 or i386)
# $2: arch package library dir (goes to usr/lib or usr/lib32)
move_libdir() {
local deb_libdir="$1"
local arch_libdir="$2"
if [ -d "${pkgdir}/${deb_libdir}" ]; then
if [ ! -d "${pkgdir}/${arch_libdir}" ]; then
mkdir -p "${pkgdir}/${arch_libdir}"
fi
mv -t "${pkgdir}/${arch_libdir}/" "${pkgdir}/${deb_libdir}"/*
find ${pkgdir} -type d -empty -delete
fi
}
# move copyright file to proper place and remove debian changelog
move_copyright() {
find ${pkgdir}/usr/share/doc -name "changelog.Debian.gz" -delete
mkdir -p ${pkgdir}/usr/share/licenses/${pkgname}
find ${pkgdir}/usr/share/doc -name "copyright" -exec mv {} ${pkgdir}/usr/share/licenses/${pkgname} \;
find ${pkgdir}/usr/share/doc -type d -empty -delete
}
package_amdgpu-core-meta () {
pkgdesc="Config file /etc/ld.so.conf.d/20-amdgpu.conf"
license=('MIT')
install=amdgpu-core-meta.install
arch=('any')
extract_deb "${srcdir}"/amdgpu-pro-${major}-${minor}-ubuntu-18.04/amdgpu-core_${major}-${minor}_all.deb
move_copyright
}
package_amdgpu-pro-core-meta () {
pkgdesc="Config file /etc/ld.so.conf.d/10-amdgpu-pro.conf"
license=('custom: AMDGPU-PRO EULA')
install=amdgpu-pro-core-meta.install
arch=('any')
depends=("amdgpu-core-meta=${major}_${minor}-${pkgrel}")
extract_deb "${srcdir}"/amdgpu-pro-${major}-${minor}-ubuntu-18.04/amdgpu-pro-core_${major}-${minor}_all.deb
move_copyright
}
package_amf-amdgpu-pro () {
pkgdesc="AMDGPU Pro Advanced Multimedia Framework"
license=('custom: AMDGPU-PRO EULA')
depends=("amdgpu-pro-core-meta=${major}_${minor}-${pkgrel}" "gcc-libs" "glibc" "libx11" "opencl-amdgpu-pro-orca=${major}_${minor}-${pkgrel}" "opencl-amdgpu-pro-pal=${major}_${minor}-${pkgrel}" "vulkan-amdgpu-pro=${major}_${minor}-${pkgrel}")
extract_deb "${srcdir}"/amdgpu-pro-${major}-${minor}-ubuntu-18.04/amf-amdgpu-pro_${major}-${minor}_amd64.deb
move_copyright
}
package_hip-amdgpu-pro () {
pkgdesc="HIP-CLANG runtime. HIP-CLANG allows developers to convert CUDA code to common C++"
license=('custom: AMDGPU-PRO EULA')
depends=("amdgpu-pro-core-meta=${major}_${minor}-${pkgrel}" "glibc")
extract_deb "${srcdir}"/amdgpu-pro-${major}-${minor}-ubuntu-18.04/hip-amdgpu-pro_${major}-${minor}_amd64.deb
move_copyright
}
package_amdgpu-pro-libgl () {
pkgdesc="AMDGPU Pro OpenGL driver"
license=('custom: AMDGPU-PRO EULA')
provides=('libgl')
depends=("amdgpu-pro-core-meta=${major}_${minor}-${pkgrel}" "gcc-libs" "glibc" "libx11" "libxcb" "libxdamage" "libxext" "libxfixes" "libxxf86vm")
#backup=(etc/gbm/gbm.conf)
extract_deb "${srcdir}"/amdgpu-pro-${major}-${minor}-ubuntu-18.04/libegl1-amdgpu-pro_${major}-${minor}_amd64.deb
#extract_deb "${srcdir}"/amdgpu-pro-${major}-${minor}-ubuntu-18.04/libgbm1-amdgpu-pro_19.3.4-${minor}_amd64.deb
#extract_deb "${srcdir}"/amdgpu-pro-${major}-${minor}-ubuntu-18.04/libgbm1-amdgpu-pro-base_${major}-${minor}_all.deb
extract_deb "${srcdir}"/amdgpu-pro-${major}-${minor}-ubuntu-18.04/libgl1-amdgpu-pro-appprofiles_${major}-${minor}_all.deb
extract_deb "${srcdir}"/amdgpu-pro-${major}-${minor}-ubuntu-18.04/libgl1-amdgpu-pro-dri_${major}-${minor}_amd64.deb
extract_deb "${srcdir}"/amdgpu-pro-${major}-${minor}-ubuntu-18.04/libgl1-amdgpu-pro-ext_${major}-${minor}_amd64.deb
extract_deb "${srcdir}"/amdgpu-pro-${major}-${minor}-ubuntu-18.04/libgl1-amdgpu-pro-ext-hwe_${major}-${minor}_amd64.deb
extract_deb "${srcdir}"/amdgpu-pro-${major}-${minor}-ubuntu-18.04/libgl1-amdgpu-pro-glx_${major}-${minor}_amd64.deb
extract_deb "${srcdir}"/amdgpu-pro-${major}-${minor}-ubuntu-18.04/libglapi1-amdgpu-pro_${major}-${minor}_amd64.deb
extract_deb "${srcdir}"/amdgpu-pro-${major}-${minor}-ubuntu-18.04/libgles2-amdgpu-pro_${major}-${minor}_amd64.deb
move_copyright
# extra_commands:
mv "${pkgdir}"/opt/amdgpu-pro/lib/xorg/modules/extensions/libglx-ext-hwe.so "${pkgdir}"/opt/amdgpu-pro/lib/xorg/modules/extensions/libglx.so
}
package_lib32-amdgpu-pro-libgl () {
pkgdesc="AMDGPU Pro OpenGL driver (32-bit)"
license=('custom: AMDGPU-PRO EULA')
provides=('lib32-libgl')
depends=("amdgpu-pro-core-meta=${major}_${minor}-${pkgrel}" "amdgpu-pro-libgl=${major}_${minor}-${pkgrel}" "lib32-gcc-libs" "lib32-glibc" "lib32-libx11" "lib32-libxcb" "lib32-libxdamage" "lib32-libxext" "lib32-libxfixes" "lib32-libxxf86vm")
backup=(etc/amd/amdrc etc/ld.so.conf.d/10-amdgpu-pro-i386.conf)
extract_deb "${srcdir}"/amdgpu-pro-${major}-${minor}-ubuntu-18.04/libegl1-amdgpu-pro_${major}-${minor}_i386.deb
#extract_deb "${srcdir}"/amdgpu-pro-${major}-${minor}-ubuntu-18.04/libgbm1-amdgpu-pro_19.3.4-${minor}_i386.deb
extract_deb "${srcdir}"/amdgpu-pro-${major}-${minor}-ubuntu-18.04/libgl1-amdgpu-pro-dri_${major}-${minor}_i386.deb
extract_deb "${srcdir}"/amdgpu-pro-${major}-${minor}-ubuntu-18.04/libgl1-amdgpu-pro-ext_${major}-${minor}_i386.deb
extract_deb "${srcdir}"/amdgpu-pro-${major}-${minor}-ubuntu-18.04/libgl1-amdgpu-pro-ext-hwe_${major}-${minor}_i386.deb
extract_deb "${srcdir}"/amdgpu-pro-${major}-${minor}-ubuntu-18.04/libgl1-amdgpu-pro-glx_${major}-${minor}_i386.deb
extract_deb "${srcdir}"/amdgpu-pro-${major}-${minor}-ubuntu-18.04/libglapi1-amdgpu-pro_${major}-${minor}_i386.deb
extract_deb "${srcdir}"/amdgpu-pro-${major}-${minor}-ubuntu-18.04/libgles2-amdgpu-pro_${major}-${minor}_i386.deb
move_copyright
# extra_commands:
mv "${pkgdir}"/opt/amdgpu-pro/lib/xorg/modules/extensions/libglx-ext-hwe.so "${pkgdir}"/opt/amdgpu-pro/lib/xorg/modules/extensions/libglx.so
rm "${pkgdir}"/etc/amd/amdrc "${pkgdir}"/opt/amdgpu-pro/lib/xorg/modules/extensions/libglx.so
# Double entry
rm "${pkgdir}"/opt/amdgpu/share/drirc.d/10-amdgpu-pro.conf
}
package_opencl-amdgpu-pro () {
pkgdesc="Code object manager (COMGR)"
license=('custom: AMDGPU-PRO EULA')
depends=("amdgpu-pro-core-meta=${major}_${minor}-${pkgrel}" "glibc")
extract_deb "${srcdir}"/amdgpu-pro-${major}-${minor}-ubuntu-18.04/opencl-amdgpu-pro_${major}-${minor}_amd64.deb
move_copyright
}
package_opencl-amdgpu-pro-comgr () {
pkgdesc="Code object manager (COMGR)"
license=('custom: AMDGPU-PRO EULA')
depends=("amdgpu-pro-core-meta=${major}_${minor}-${pkgrel}" "glibc")
extract_deb "${srcdir}"/amdgpu-pro-${major}-${minor}-ubuntu-18.04/opencl-amdgpu-pro-comgr_${major}-${minor}_amd64.deb
move_copyright
}
package_opencl-amdgpu-pro-dev () {
pkgdesc="AMD OpenCL SDK"
license=('custom: AMDGPU-PRO EULA')
depends=("glibc")
extract_deb "${srcdir}"/amdgpu-pro-${major}-${minor}-ubuntu-18.04/opencl-amdgpu-pro-dev_${major}-${minor}_amd64.deb
move_copyright
}
package_opencl-amdgpu-pro-pal () {
pkgdesc="AMDGPU Pro OpenCL driver PAL"
license=('custom: AMDGPU-PRO EULA')
provides=('opencl-driver')
depends=("amdgpu-pro-core-meta=${major}_${minor}-${pkgrel}" "glibc" "opencl-amdgpu-pro-comgr=${major}_${minor}-${pkgrel}")
backup=(etc/OpenCL/vendors/amdocl64.icd)
extract_deb "${srcdir}"/amdgpu-pro-${major}-${minor}-ubuntu-18.04/opencl-amdgpu-pro-icd_${major}-${minor}_amd64.deb
move_copyright
}
package_opencl-amdgpu-pro-orca () {
pkgdesc="AMDGPU Pro OpenCL driver ORCA aka legacy"
license=('custom: AMDGPU-PRO EULA')
provides=('opencl-driver')
depends=("amdgpu-pro-core-meta=${major}_${minor}-${pkgrel}" "glibc")
backup=(etc/OpenCL/vendors/amdocl-orca64.icd)
extract_deb "${srcdir}"/amdgpu-pro-${major}-${minor}-ubuntu-18.04/opencl-orca-amdgpu-pro-icd_${major}-${minor}_amd64.deb
move_copyright
}
package_lib32-opencl-amdgpu-pro-orca () {
pkgdesc="AMDGPU Pro OpenCL driver ORCA aka legacy (32-bit)"
license=('custom: AMDGPU-PRO EULA')
provides=('lib32-opencl-driver')
depends=("amdgpu-pro-core-meta=${major}_${minor}-${pkgrel}" "lib32-glibc")
backup=(etc/OpenCL/vendors/amdocl-orca32.icd)
extract_deb "${srcdir}"/amdgpu-pro-${major}-${minor}-ubuntu-18.04/opencl-orca-amdgpu-pro-icd_${major}-${minor}_i386.deb
move_copyright
}
package_vulkan-amdgpu-pro () {
pkgdesc="AMDGPU Pro Vulkan driver"
license=('custom: AMDGPU-PRO EULA')
provides=('vulkan-driver')
depends=("amdgpu-pro-core-meta=${major}_${minor}-${pkgrel}" "gcc-libs" "glibc")
extract_deb "${srcdir}"/amdgpu-pro-${major}-${minor}-ubuntu-18.04/vulkan-amdgpu-pro_${major}-${minor}_amd64.deb
move_copyright
# extra_commands:
mkdir -p "${pkgdir}"/usr/share/vulkan/icd.d/
mv "${pkgdir}"/opt/amdgpu-pro/etc/vulkan/icd.d/amd_icd64.json "${pkgdir}"/usr/share/vulkan/icd.d/amd_pro_icd64.json
rm -rf "${pkgdir}"/opt/amdgpu-pro/etc/
}
package_lib32-vulkan-amdgpu-pro () {
pkgdesc="AMDGPU Pro Vulkan driver (32-bit)"
license=('custom: AMDGPU-PRO EULA')
provides=('lib32-vulkan-driver')
depends=("amdgpu-pro-core-meta=${major}_${minor}-${pkgrel}" "lib32-gcc-libs" "lib32-glibc")
extract_deb "${srcdir}"/amdgpu-pro-${major}-${minor}-ubuntu-18.04/vulkan-amdgpu-pro_${major}-${minor}_i386.deb
move_copyright
# extra_commands:
mkdir -p "${pkgdir}"/usr/share/vulkan/icd.d/
mv "${pkgdir}"/opt/amdgpu-pro/etc/vulkan/icd.d/amd_icd32.json "${pkgdir}"/usr/share/vulkan/icd.d/amd_pro_icd32.json
rm -rf "${pkgdir}"/opt/amdgpu-pro/etc/
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment