├── .SRCINFO ├── .gitignore ├── .travis.yml ├── .vscode └── launch.json ├── PKGBUILD ├── README.md ├── amdgpu-core-meta.install ├── amdgpu-pro-core-meta.install ├── build.sh ├── concat_packages_extracted.py ├── extract_transaction_scripts_and_triggers.sh ├── gen-PKGBUILD.py ├── gen_packages_map.sh ├── gen_replace_deps.sh ├── git └── hooks │ └── pre-commit ├── lib32-libgl1-amdgpu-mesa-dri.install ├── lib32-mesa-amdgpu-va-drivers.install ├── libgl1-amdgpu-mesa-dri.install ├── make_pkgbuild_pkgs_template.sh ├── mesa-amdgpu-va-drivers.install ├── packages_map.py ├── progl ├── progl.bash-completion ├── remake_all.sh ├── replace_deps.py ├── reposetup.sh ├── translate_deb_to_arch_dependency.sh ├── uninstall_packages_group.sh ├── unpack_all_deb_packages.sh ├── update-amdgpu-dri-links-32.hook ├── update-amdgpu-dri-links-32.script ├── update-amdgpu-dri-links.hook ├── update-amdgpu-dri-links.script ├── update-local-repo.sh └── versions /.SRCINFO: -------------------------------------------------------------------------------- 1 | pkgbase = amdgpu-pro-installer 2 | pkgver = 24.30_2125449 3 | pkgrel = 1 4 | url = https://www.amd.com/en/support/kb/release-notes/rn-amdgpu-unified-linux-22-40 5 | arch = x86_64 6 | groups = Radeon_Software_for_Linux 7 | license = custom: multiple 8 | source = progl::https://raw.githubusercontent.com/Ashark/archlinux-amdgpu-pro/master/progl 9 | source = progl.bash-completion::https://raw.githubusercontent.com/Ashark/archlinux-amdgpu-pro/master/progl.bash-completion 10 | source = https://repo.radeon.com/amdgpu/6.3.4/ubuntu/pool/proprietary/a/amf-amdgpu-pro/amf-amdgpu-pro_1.4.36-2125449.22.04_amd64.deb 11 | source = https://repo.radeon.com/amdgpu/6.3.4/ubuntu/pool/proprietary/liba/libamdenc-amdgpu-pro/libamdenc-amdgpu-pro_1.0-2125449.22.04_amd64.deb 12 | source = https://repo.radeon.com/amdgpu/6.3.4/ubuntu/pool/proprietary/o/oglp-amdgpu-pro/libegl1-amdgpu-pro-oglp_24.30-2125449.22.04_i386.deb 13 | source = https://repo.radeon.com/amdgpu/6.3.4/ubuntu/pool/proprietary/o/oglp-amdgpu-pro/libegl1-amdgpu-pro-oglp_24.30-2125449.22.04_amd64.deb 14 | source = https://repo.radeon.com/amdgpu/6.3.4/ubuntu/pool/proprietary/o/oglp-amdgpu-pro/libgl1-amdgpu-pro-oglp-dri_24.30-2125449.22.04_i386.deb 15 | source = https://repo.radeon.com/amdgpu/6.3.4/ubuntu/pool/proprietary/o/oglp-amdgpu-pro/libgl1-amdgpu-pro-oglp-dri_24.30-2125449.22.04_amd64.deb 16 | source = https://repo.radeon.com/amdgpu/6.3.4/ubuntu/pool/proprietary/o/oglp-amdgpu-pro/libgl1-amdgpu-pro-oglp-ext_24.30-2125449.22.04_amd64.deb 17 | source = https://repo.radeon.com/amdgpu/6.3.4/ubuntu/pool/proprietary/o/oglp-amdgpu-pro/libgl1-amdgpu-pro-oglp-gbm_24.30-2125449.22.04_amd64.deb 18 | source = https://repo.radeon.com/amdgpu/6.3.4/ubuntu/pool/proprietary/o/oglp-amdgpu-pro/libgl1-amdgpu-pro-oglp-glx_24.30-2125449.22.04_i386.deb 19 | source = https://repo.radeon.com/amdgpu/6.3.4/ubuntu/pool/proprietary/o/oglp-amdgpu-pro/libgl1-amdgpu-pro-oglp-glx_24.30-2125449.22.04_amd64.deb 20 | source = https://repo.radeon.com/amdgpu/6.3.4/ubuntu/pool/proprietary/o/oglp-amdgpu-pro/libgles1-amdgpu-pro-oglp_24.30-2125449.22.04_i386.deb 21 | source = https://repo.radeon.com/amdgpu/6.3.4/ubuntu/pool/proprietary/o/oglp-amdgpu-pro/libgles1-amdgpu-pro-oglp_24.30-2125449.22.04_amd64.deb 22 | source = https://repo.radeon.com/amdgpu/6.3.4/ubuntu/pool/proprietary/o/oglp-amdgpu-pro/libgles2-amdgpu-pro-oglp_24.30-2125449.22.04_i386.deb 23 | source = https://repo.radeon.com/amdgpu/6.3.4/ubuntu/pool/proprietary/o/oglp-amdgpu-pro/libgles2-amdgpu-pro-oglp_24.30-2125449.22.04_amd64.deb 24 | source = https://repo.radeon.com/amdgpu/6.3.4/ubuntu/pool/proprietary/v/vulkan-amdgpu-pro/vulkan-amdgpu-pro_24.30-2125449.22.04_i386.deb 25 | source = https://repo.radeon.com/amdgpu/6.3.4/ubuntu/pool/proprietary/v/vulkan-amdgpu-pro/vulkan-amdgpu-pro_24.30-2125449.22.04_amd64.deb 26 | sha256sums = feb74796c3152cbafaba89d96e68a152f209bd3058c7eb0413cbe1ab0764e96f 27 | sha256sums = e32801c38b475cd8df17a407726b86db3de26410f563d688325b4d4314fc5354 28 | sha256sums = 9c18bf369b20b2216ba59e5b913de22296d262f7644207b2b7a92179faf9beca 29 | sha256sums = 22021c6ee8096648812f6a76c56ec2eb3ff5c6034481da660dba348475333ffd 30 | sha256sums = 28e13fbee4e4d6bdf6e1efb3124dba4ce1940050d4c8bb8f481c7107cf32a485 31 | sha256sums = d26af55053a115500cf71c7be40dd4949672fc001c936506abc031890a7d03de 32 | sha256sums = 68829112a19a69aa4ff00df2083c20d39a772640f909b23f108a0fd0d4377e8b 33 | sha256sums = bf1204d287104cb30a8316a26ce57560de6129d75fe65bc1b5b055757e2d3669 34 | sha256sums = 9abcd4522facb0b45f5fc3af013cced60be48c1e4909436edffff7ce54afee78 35 | sha256sums = dfd883f33b323cffafec331f4f60e6ae625b99d0682cb0926817f3b2aab0e2bb 36 | sha256sums = 2ed5137a2b7e6962690a73a43ec28c91fb197f2410868de7d5b7ee1710290174 37 | sha256sums = ecdc83032e5de80678d5c4b1b99266282ec268af54b87007e25747f8f99af988 38 | sha256sums = 08ed6eab10a0bc1232464b3f8f991ee6d5250fd4abdece5432c8278398e45de5 39 | sha256sums = 89f63f1a1f1911bb0cc4f604379ee81889a73ea1b1cd75c58c8ffa6967af86d7 40 | sha256sums = 56ea9e91daf51820561832c4f30fc8eb2c0f91022d9b01de59e7643b325fd85b 41 | sha256sums = f7fabe430fdcc96d11495b7366e90df17139e9d84a085971b454f4f679debc73 42 | sha256sums = 0755c952c9e4045203084f14812e92b29f5271515cbb2e7304ca0bf06f08baf7 43 | sha256sums = 117af2d9b64a5b4971cb5298605309b8c3ac931d9494d2b2cb5b9b226728c701 44 | 45 | pkgname = amf-amdgpu-pro 46 | pkgdesc = AMDGPU Pro Advanced Multimedia Framework 47 | license = custom: AMDGPU-PRO EULA 48 | depends = libdrm 49 | depends = vulkan-icd-loader 50 | optdepends = rocm-opencl-runtime: Warning unspecified optdep description 51 | optdepends = vulkan-radeon: Warning unspecified optdep description 52 | 53 | pkgname = amdgpu-pro-oglp 54 | pkgdesc = AMDGPU Pro OpenGL driver 55 | license = custom: AMDGPU-PRO EULA 56 | depends = libglvnd 57 | depends = libx11 58 | provides = libgl 59 | 60 | pkgname = lib32-amdgpu-pro-oglp 61 | pkgdesc = AMDGPU Pro OpenGL driver (32-bit) 62 | license = custom: AMDGPU-PRO EULA 63 | depends = lib32-libx11 64 | provides = lib32-libgl 65 | 66 | pkgname = vulkan-amdgpu-pro 67 | pkgdesc = AMDGPU Pro Vulkan driver 68 | license = custom: AMDGPU-PRO EULA 69 | depends = vulkan-icd-loader 70 | depends = wayland 71 | depends = zlib 72 | optdepends = openssl-1.1: Warning unspecified optdep description 73 | provides = vulkan-driver 74 | 75 | pkgname = lib32-vulkan-amdgpu-pro 76 | pkgdesc = AMDGPU Pro Vulkan driver (32-bit) 77 | license = custom: AMDGPU-PRO EULA 78 | depends = lib32-vulkan-icd-loader 79 | depends = lib32-wayland 80 | depends = lib32-zlib 81 | optdepends = lib32-openssl-1.1: Warning unspecified optdep description 82 | provides = lib32-vulkan-driver 83 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /*.tar.xz 2 | /*.pkg.tar 3 | /*.pkg.tar.zst 4 | *.deb 5 | /pkg/ 6 | /src/ 7 | /archlinux-bootstrap-*.tar.gz 8 | /root.x86_64/ 9 | amdgpu-dev.db 10 | amdgpu-dev.db.tar.gz 11 | amdgpu-dev.db.tar.gz.old 12 | amdgpu-dev.files 13 | amdgpu-dev.files.tar.gz 14 | amdgpu-dev.files.tar.gz.old 15 | .idea 16 | __pycache__ 17 | .hidden 18 | amdgpu-pro-*-ubuntu-* 19 | Packages-extracted 20 | Packages-debugging 21 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: required 2 | 3 | arch: 4 | packages: 5 | - python 6 | - python-chardet 7 | - python-pip 8 | - wget 9 | 10 | script: 11 | - sudo pip install python-debian 12 | - ./build.sh 13 | - 'if [ -n "$(git status --porcelain)" ]; then echo Error: changes found after generate; git diff; exit 1; fi' 14 | - makepkg --printsrcinfo > .SRCINFO 15 | - 'if [ -n "$(git status --porcelain)" ]; then echo Error: changes found after printsrcinfo; git diff; exit 1; fi' 16 | - ALL_PACKAGES=true PKGEXT='.pkg.tar' makepkg -s 17 | - 'if [ -n "$(git status --porcelain)" ]; then echo Error: changes found after build; git diff; exit 1; fi' 18 | 19 | script: 20 | - export EDITOR=false 21 | - "curl -s https://raw.githubusercontent.com/mikkeloscar/arch-travis/master/arch-travis.sh | bash" 22 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Python: Current File", 9 | "type": "python", 10 | "request": "launch", 11 | "program": "${file}", 12 | "console": "integratedTerminal", 13 | "justMyCode": true 14 | } 15 | ] 16 | } -------------------------------------------------------------------------------- /PKGBUILD: -------------------------------------------------------------------------------- 1 | # Author: Janusz Lewandowski 2 | # Contributor: David McFarland 3 | # Maintainer: Andrew Shark 4 | # Autogenerated from AMD's Packages file 5 | # with https://github.com/Ashark/archlinux-amdgpu-pro/blob/master/gen-PKGBUILD.py 6 | 7 | major=24.30 8 | major_short=24.30 9 | minor=2125449 10 | ubuntu_ver=22.04 11 | repo_folder_ver=6.3.4 12 | 13 | pkgbase=amdgpu-pro-installer 14 | pkgname=( 15 | amf-amdgpu-pro 16 | amdgpu-pro-oglp 17 | lib32-amdgpu-pro-oglp 18 | vulkan-amdgpu-pro 19 | lib32-vulkan-amdgpu-pro 20 | ) 21 | pkgver=${major}_${minor} 22 | pkgrel=1 23 | arch=('x86_64') 24 | url=https://www.amd.com/en/support/kb/release-notes/rn-amdgpu-unified-linux-22-40 25 | license=('custom: multiple') 26 | groups=('Radeon_Software_for_Linux') 27 | 28 | source=(progl::https://raw.githubusercontent.com/Ashark/archlinux-amdgpu-pro/master/progl 29 | progl.bash-completion::https://raw.githubusercontent.com/Ashark/archlinux-amdgpu-pro/master/progl.bash-completion 30 | https://repo.radeon.com/amdgpu/${repo_folder_ver}/ubuntu/pool/proprietary/a/amf-amdgpu-pro/amf-amdgpu-pro_1.4.36-${minor}.${ubuntu_ver}_amd64.deb 31 | https://repo.radeon.com/amdgpu/${repo_folder_ver}/ubuntu/pool/proprietary/liba/libamdenc-amdgpu-pro/libamdenc-amdgpu-pro_1.0-${minor}.${ubuntu_ver}_amd64.deb 32 | https://repo.radeon.com/amdgpu/${repo_folder_ver}/ubuntu/pool/proprietary/o/oglp-amdgpu-pro/libegl1-amdgpu-pro-oglp_${major_short}-${minor}.${ubuntu_ver}_i386.deb 33 | https://repo.radeon.com/amdgpu/${repo_folder_ver}/ubuntu/pool/proprietary/o/oglp-amdgpu-pro/libegl1-amdgpu-pro-oglp_${major_short}-${minor}.${ubuntu_ver}_amd64.deb 34 | https://repo.radeon.com/amdgpu/${repo_folder_ver}/ubuntu/pool/proprietary/o/oglp-amdgpu-pro/libgl1-amdgpu-pro-oglp-dri_${major_short}-${minor}.${ubuntu_ver}_i386.deb 35 | https://repo.radeon.com/amdgpu/${repo_folder_ver}/ubuntu/pool/proprietary/o/oglp-amdgpu-pro/libgl1-amdgpu-pro-oglp-dri_${major_short}-${minor}.${ubuntu_ver}_amd64.deb 36 | https://repo.radeon.com/amdgpu/${repo_folder_ver}/ubuntu/pool/proprietary/o/oglp-amdgpu-pro/libgl1-amdgpu-pro-oglp-ext_${major_short}-${minor}.${ubuntu_ver}_amd64.deb 37 | https://repo.radeon.com/amdgpu/${repo_folder_ver}/ubuntu/pool/proprietary/o/oglp-amdgpu-pro/libgl1-amdgpu-pro-oglp-gbm_${major_short}-${minor}.${ubuntu_ver}_amd64.deb 38 | https://repo.radeon.com/amdgpu/${repo_folder_ver}/ubuntu/pool/proprietary/o/oglp-amdgpu-pro/libgl1-amdgpu-pro-oglp-glx_${major_short}-${minor}.${ubuntu_ver}_i386.deb 39 | https://repo.radeon.com/amdgpu/${repo_folder_ver}/ubuntu/pool/proprietary/o/oglp-amdgpu-pro/libgl1-amdgpu-pro-oglp-glx_${major_short}-${minor}.${ubuntu_ver}_amd64.deb 40 | https://repo.radeon.com/amdgpu/${repo_folder_ver}/ubuntu/pool/proprietary/o/oglp-amdgpu-pro/libgles1-amdgpu-pro-oglp_${major_short}-${minor}.${ubuntu_ver}_i386.deb 41 | https://repo.radeon.com/amdgpu/${repo_folder_ver}/ubuntu/pool/proprietary/o/oglp-amdgpu-pro/libgles1-amdgpu-pro-oglp_${major_short}-${minor}.${ubuntu_ver}_amd64.deb 42 | https://repo.radeon.com/amdgpu/${repo_folder_ver}/ubuntu/pool/proprietary/o/oglp-amdgpu-pro/libgles2-amdgpu-pro-oglp_${major_short}-${minor}.${ubuntu_ver}_i386.deb 43 | https://repo.radeon.com/amdgpu/${repo_folder_ver}/ubuntu/pool/proprietary/o/oglp-amdgpu-pro/libgles2-amdgpu-pro-oglp_${major_short}-${minor}.${ubuntu_ver}_amd64.deb 44 | https://repo.radeon.com/amdgpu/${repo_folder_ver}/ubuntu/pool/proprietary/v/vulkan-amdgpu-pro/vulkan-amdgpu-pro_${major_short}-${minor}.${ubuntu_ver}_i386.deb 45 | https://repo.radeon.com/amdgpu/${repo_folder_ver}/ubuntu/pool/proprietary/v/vulkan-amdgpu-pro/vulkan-amdgpu-pro_${major_short}-${minor}.${ubuntu_ver}_amd64.deb) 46 | sha256sums=(feb74796c3152cbafaba89d96e68a152f209bd3058c7eb0413cbe1ab0764e96f 47 | e32801c38b475cd8df17a407726b86db3de26410f563d688325b4d4314fc5354 48 | 9c18bf369b20b2216ba59e5b913de22296d262f7644207b2b7a92179faf9beca 49 | 22021c6ee8096648812f6a76c56ec2eb3ff5c6034481da660dba348475333ffd 50 | 28e13fbee4e4d6bdf6e1efb3124dba4ce1940050d4c8bb8f481c7107cf32a485 51 | d26af55053a115500cf71c7be40dd4949672fc001c936506abc031890a7d03de 52 | 68829112a19a69aa4ff00df2083c20d39a772640f909b23f108a0fd0d4377e8b 53 | bf1204d287104cb30a8316a26ce57560de6129d75fe65bc1b5b055757e2d3669 54 | 9abcd4522facb0b45f5fc3af013cced60be48c1e4909436edffff7ce54afee78 55 | dfd883f33b323cffafec331f4f60e6ae625b99d0682cb0926817f3b2aab0e2bb 56 | 2ed5137a2b7e6962690a73a43ec28c91fb197f2410868de7d5b7ee1710290174 57 | ecdc83032e5de80678d5c4b1b99266282ec268af54b87007e25747f8f99af988 58 | 08ed6eab10a0bc1232464b3f8f991ee6d5250fd4abdece5432c8278398e45de5 59 | 89f63f1a1f1911bb0cc4f604379ee81889a73ea1b1cd75c58c8ffa6967af86d7 60 | 56ea9e91daf51820561832c4f30fc8eb2c0f91022d9b01de59e7643b325fd85b 61 | f7fabe430fdcc96d11495b7366e90df17139e9d84a085971b454f4f679debc73 62 | 0755c952c9e4045203084f14812e92b29f5271515cbb2e7304ca0bf06f08baf7 63 | 117af2d9b64a5b4971cb5298605309b8c3ac931d9494d2b2cb5b9b226728c701) 64 | 65 | 66 | 67 | # extracts a debian package 68 | # $1: deb file to extract 69 | extract_deb() { 70 | local tmpdir="$(basename "${1%.deb}")" 71 | rm -Rf "$tmpdir" 72 | mkdir "$tmpdir" 73 | cd "$tmpdir" 74 | ar x "$1" 75 | tar -C "${pkgdir}" -xf data.tar.xz 76 | } 77 | # move ubuntu specific /usr/lib/x86_64-linux-gnu to /usr/lib 78 | # $1: debian package library dir (goes from opt/amdgpu or opt/amdgpu-pro and from x86_64 or i386) 79 | # $2: arch package library dir (goes to usr/lib or usr/lib32) 80 | move_libdir() { 81 | local deb_libdir="$1" 82 | local arch_libdir="$2" 83 | 84 | if [ -d "${pkgdir}/${deb_libdir}" ]; then 85 | if [ ! -d "${pkgdir}/${arch_libdir}" ]; then 86 | mkdir -p "${pkgdir}/${arch_libdir}" 87 | fi 88 | mv -t "${pkgdir}/${arch_libdir}/" "${pkgdir}/${deb_libdir}"/* 89 | find ${pkgdir} -type d -empty -delete 90 | fi 91 | } 92 | # move copyright file to proper place and remove debian changelog 93 | move_copyright() { 94 | find ${pkgdir}/usr/share/doc -name "changelog.Debian.gz" -delete 95 | mkdir -p ${pkgdir}/usr/share/licenses/${pkgname} 96 | find ${pkgdir}/usr/share/doc -name "copyright" -exec mv {} ${pkgdir}/usr/share/licenses/${pkgname} \; 97 | find ${pkgdir}/usr/share/doc -type d -empty -delete 98 | } 99 | 100 | package_amf-amdgpu-pro () { 101 | pkgdesc="AMDGPU Pro Advanced Multimedia Framework" 102 | license=('custom: AMDGPU-PRO EULA') 103 | depends=("libdrm" "vulkan-icd-loader") 104 | optdepends=("rocm-opencl-runtime: Warning unspecified optdep description" 105 | "vulkan-radeon: Warning unspecified optdep description") 106 | 107 | extract_deb "${srcdir}"/amf-amdgpu-pro_1.4.36-${minor}.${ubuntu_ver}_amd64.deb 108 | extract_deb "${srcdir}"/libamdenc-amdgpu-pro_1.0-${minor}.${ubuntu_ver}_amd64.deb 109 | move_libdir "opt/amdgpu-pro/lib/x86_64-linux-gnu" "usr/lib" 110 | move_copyright 111 | } 112 | 113 | package_amdgpu-pro-oglp () { 114 | pkgdesc="AMDGPU Pro OpenGL driver" 115 | license=('custom: AMDGPU-PRO EULA') 116 | provides=('libgl') 117 | depends=("libglvnd" "libx11") 118 | 119 | extract_deb "${srcdir}"/libegl1-amdgpu-pro-oglp_${major_short}-${minor}.${ubuntu_ver}_amd64.deb 120 | extract_deb "${srcdir}"/libgl1-amdgpu-pro-oglp-dri_${major_short}-${minor}.${ubuntu_ver}_amd64.deb 121 | extract_deb "${srcdir}"/libgl1-amdgpu-pro-oglp-ext_${major_short}-${minor}.${ubuntu_ver}_amd64.deb 122 | extract_deb "${srcdir}"/libgl1-amdgpu-pro-oglp-gbm_${major_short}-${minor}.${ubuntu_ver}_amd64.deb 123 | extract_deb "${srcdir}"/libgl1-amdgpu-pro-oglp-glx_${major_short}-${minor}.${ubuntu_ver}_amd64.deb 124 | extract_deb "${srcdir}"/libgles1-amdgpu-pro-oglp_${major_short}-${minor}.${ubuntu_ver}_amd64.deb 125 | extract_deb "${srcdir}"/libgles2-amdgpu-pro-oglp_${major_short}-${minor}.${ubuntu_ver}_amd64.deb 126 | move_libdir "opt/amdgpu-pro/lib/x86_64-linux-gnu" "usr/lib" 127 | move_copyright 128 | 129 | # extra_commands: 130 | move_libdir "usr/lib/x86_64-linux-gnu" "usr/lib" 131 | move_libdir "opt/amdgpu-pro/lib/x86_64-linux-gnu" "usr/lib/amdgpu-pro" 132 | move_libdir "opt/amdgpu-pro/lib/xorg" "usr/lib/amdgpu-pro/xorg" 133 | move_libdir "opt/amdgpu/share/drirc.d" "usr/share/drirc.d" 134 | install -Dm755 "${srcdir}"/progl "${pkgdir}"/usr/bin/progl 135 | install -Dm644 "${srcdir}"/progl.bash-completion "${pkgdir}"/usr/share/bash-completion/completions/progl 136 | # For some reason, applications started with normal OpenGL (i.e. without ag pro) crashes at launch if this conf file is presented, so hide it for now, until I find out the reason of that. 137 | mv "${pkgdir}"/usr/share/drirc.d/10-amdgpu-pro.conf "${pkgdir}"/usr/share/drirc.d/10-amdgpu-pro.conf.hide 138 | # For some reason, libs no more moved to the pro folder. Do it manually. 139 | mv -v -t "${pkgdir}/usr/lib/amdgpu-pro" "${pkgdir}/usr/lib/lib"* 140 | } 141 | 142 | package_lib32-amdgpu-pro-oglp () { 143 | pkgdesc="AMDGPU Pro OpenGL driver (32-bit)" 144 | license=('custom: AMDGPU-PRO EULA') 145 | provides=('lib32-libgl') 146 | depends=("lib32-libx11") 147 | 148 | extract_deb "${srcdir}"/libegl1-amdgpu-pro-oglp_${major_short}-${minor}.${ubuntu_ver}_i386.deb 149 | extract_deb "${srcdir}"/libgl1-amdgpu-pro-oglp-dri_${major_short}-${minor}.${ubuntu_ver}_i386.deb 150 | extract_deb "${srcdir}"/libgl1-amdgpu-pro-oglp-glx_${major_short}-${minor}.${ubuntu_ver}_i386.deb 151 | extract_deb "${srcdir}"/libgles1-amdgpu-pro-oglp_${major_short}-${minor}.${ubuntu_ver}_i386.deb 152 | extract_deb "${srcdir}"/libgles2-amdgpu-pro-oglp_${major_short}-${minor}.${ubuntu_ver}_i386.deb 153 | move_libdir "opt/amdgpu-pro/lib/i386-linux-gnu" "usr/lib32" 154 | move_copyright 155 | 156 | # extra_commands: 157 | rm "${pkgdir}"/opt/amdgpu/share/drirc.d/10-amdgpu-pro.conf 158 | move_libdir "usr/lib/i386-linux-gnu" "usr/lib32" 159 | move_libdir "opt/amdgpu-pro/lib/i386-linux-gnu" "usr/lib32/amdgpu-pro" 160 | # For some reason, libs no more moved to the pro folder. Do it manually. 161 | mkdir "${pkgdir}/usr/lib32/amdgpu-pro" 162 | mv -v -t "${pkgdir}/usr/lib32/amdgpu-pro" "${pkgdir}/usr/lib32/lib"* 163 | } 164 | 165 | package_vulkan-amdgpu-pro () { 166 | pkgdesc="AMDGPU Pro Vulkan driver" 167 | license=('custom: AMDGPU-PRO EULA') 168 | provides=('vulkan-driver') 169 | depends=("vulkan-icd-loader" "wayland" "zlib") 170 | optdepends=("openssl-1.1: Warning unspecified optdep description") 171 | 172 | extract_deb "${srcdir}"/vulkan-amdgpu-pro_${major_short}-${minor}.${ubuntu_ver}_amd64.deb 173 | move_libdir "opt/amdgpu-pro/lib/x86_64-linux-gnu" "usr/lib" 174 | move_copyright 175 | 176 | # extra_commands: 177 | mkdir -p "${pkgdir}"/usr/share/vulkan/icd.d/ 178 | mv "${pkgdir}"/opt/amdgpu-pro/etc/vulkan/icd.d/amd_icd64.json "${pkgdir}"/usr/share/vulkan/icd.d/amd_pro_icd64.json 179 | mv "${pkgdir}"/usr/lib/amdvlk64.so "${pkgdir}"/usr/lib/amdvlkpro64.so 180 | sed -i "s#/opt/amdgpu-pro/lib/x86_64-linux-gnu/amdvlk64.so#/usr/lib/amdvlkpro64.so#" "${pkgdir}"/usr/share/vulkan/icd.d/amd_pro_icd64.json 181 | find ${pkgdir} -type d -empty -delete 182 | } 183 | 184 | package_lib32-vulkan-amdgpu-pro () { 185 | pkgdesc="AMDGPU Pro Vulkan driver (32-bit)" 186 | license=('custom: AMDGPU-PRO EULA') 187 | provides=('lib32-vulkan-driver') 188 | depends=("lib32-vulkan-icd-loader" "lib32-wayland" "lib32-zlib") 189 | optdepends=("lib32-openssl-1.1: Warning unspecified optdep description") 190 | 191 | extract_deb "${srcdir}"/vulkan-amdgpu-pro_${major_short}-${minor}.${ubuntu_ver}_i386.deb 192 | move_libdir "opt/amdgpu-pro/lib/i386-linux-gnu" "usr/lib32" 193 | move_copyright 194 | 195 | # extra_commands: 196 | mkdir -p "${pkgdir}"/usr/share/vulkan/icd.d/ 197 | mv "${pkgdir}"/opt/amdgpu-pro/etc/vulkan/icd.d/amd_icd32.json "${pkgdir}"/usr/share/vulkan/icd.d/amd_pro_icd32.json 198 | mv "${pkgdir}"/usr/lib32/amdvlk32.so "${pkgdir}"/usr/lib32/amdvlkpro32.so 199 | sed -i "s#/opt/amdgpu-pro/lib/i386-linux-gnu/amdvlk32.so#/usr/lib32/amdvlkpro32.so#" "${pkgdir}"/usr/share/vulkan/icd.d/amd_pro_icd32.json 200 | find ${pkgdir} -type d -empty -delete 201 | } 202 | 203 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Arch Linux AMDGPU PRO 2 | 3 | This project contains a generator for the [amdgpu-pro-installer](https://aur.archlinux.org/pkgbase/amdgpu-pro-installer) PKGBUILD. 4 | 5 | This generator is needed because of the complexity of the distribution model of drivers. It handles packages dependencies (maps debian dependencies to arch linux alternatives), calculates sources hashes and so on. 6 | 7 | ## Prerequisites 8 | 9 | `pip install python-debian` # used in concat_packages_extracted.py 10 | `pacman -S dpkg-deb` # used in translate_deb_to_arch_dependency.sh 11 | `pacman -S aptly` # used for mirroring repo 12 | `yay -S debtap` # used in dependencies translation 13 | 14 | ## Steps to do when new version is released 15 | 1. Go to http://repo.radeon.com/amdgpu/ and see if there is a new version available. 16 | 2. Change versions in `versions` file. 17 | How to know the build id version? You can see it in `Packages` file of the release for distro. For example, here: http://repo.radeon.com/amdgpu/22.20.5/ubuntu/dists/jammy/proprietary/binary-amd64/ 18 | Note: focal=20.04, jammy=22.04. Table of versions: https://en.wikipedia.org/wiki/Ubuntu_version_history#Table_of_versions 19 | 3. Change pkgrel, url_ref in `gen-PKGBUILD.py` file. 20 | 4. Install aptly if not done yet. 21 | 5. Update the local mirror 22 | Note: focal=20.04, jammy=22.04. 23 | Note that `latest` link sometimes is not actually latest version. 24 | ``` 25 | #ver=latest 26 | #ver=22.20.5 27 | ver=5.4.1 28 | aptly -ignore-signatures mirror create agpro-$ver http://repo.radeon.com/amdgpu/$ver/ubuntu jammy proprietary 29 | aptly -ignore-signatures mirror update agpro-$ver 30 | 31 | aptly publish drop jammy 32 | aptly snapshot create snapshot-$(date +%F) from mirror agpro-$ver 33 | aptly publish --skip-signing snapshot snapshot-$(date +%F) # Or if not skipping signing, when it will ask a password, do not enter empty or it will fail 34 | ``` 35 | 36 | Now in ~/.aptly/public/pool (not in ~/.aptly/pool/) there will be our packages. 37 | 6. Run `./unpack_all_deb_packages.sh` 38 | 7. Bring the "Packages" file to "Packages-extracted" with the following command: 39 | `python concat_packages_extracted.py` 40 | Do not forget to replace "jammy" after new distribution is released. Note: focal=20.04, jammy=22.04. 41 | 42 | That command does merging Packages files for 32 bit and 64 bit, and then it automatically removes duplicated entries. 43 | This is a workaround. See more info in the gen_packages_map.sh in the beginning comment. 44 | 45 | There also could be such way: `aptly package show "Name (~ .*)" > Packages-extracted`. For some reason, this method shows filenames without relative path. So cannot use that until inversigate how to fix. 46 | 47 | Also files can be seen here (convenience links): 48 | http://repo.radeon.com/amdgpu/latest/ubuntu/dists/focal/proprietary/binary-amd64/Packages 49 | http://repo.radeon.com/amdgpu/latest/ubuntu/dists/focal/proprietary/binary-i386/Packages 50 | 8. Run `./gen_packages_map.sh > packages_map.py` 51 | See differences with `git diff -w packages_map.py` 52 | If there are differences, then make adjustments to gen_packages_map.sh if needed. Especially, look for the new appeared packages (they will have empty comment) and removed packages. If there are new or removed packages, then use make_pkgbuild_pkgs_template.sh and edit gen-PKGBUILD.py 53 | 9. Run `sudo debtap -u`. Then run `./gen_replace_deps.sh > replace_deps.py` 54 | See differences with `git diff -w replace_deps.py` 55 | If there are differences, then make adjustments to gen_replace_deps.sh if needed. 56 | 10. Note: this step is boring, and I let myself to skip it. But just in case, I will leave this instruction here, as it could be interesting to check some day. Also, don't forget to fill in old versions in versions file. 57 | Run `./extract_transaction_scripts_and_triggers.sh`. 58 | Compare transaction scripts and triggers from current and previous driver version in opened meld window. 59 | If you see explicit version numbers in file names, add additional rename instructions in extract_transaction_scripts_and_triggers.sh. This will help you to compare contents of the files in meld. 60 | If there are changes, see if it is needed to convert them to pacman .install files or hooks. 61 | 62 | 11. Create a local repository (if not done yet) by adding the following to your /etc/pacman.conf: 63 | ``` 64 | [amdgpu-dev] 65 | SigLevel = Optional TrustAll 66 | Server = File:///home/andrey/Development/archlinux-amdgpu-pro/ # edit path to your development directory. Do not keep this comment in the config. 67 | ``` 68 | 12. Regenerate PKGBUILD with `./remake_all.sh` 69 | 13. If you notice empty license in PKGBUILD, add its hash to the licenses_hashes_map in gen-PKGBUILD.py 70 | 14. Install from local repository and test it. 71 | 15. Make a new commit to project repo (not the aur). 72 | Then commit a new tag. 73 | ``` 74 | git tag $(source PKGBUILD; echo v${major}_${minor}-${pkgrel}) 75 | git push origin $(source PKGBUILD; echo v${major}_${minor}-${pkgrel}) 76 | ``` 77 | Create a release on github pointing to the new tag. 78 | 16. Update AUR package: copy PKGBUILD, .SRCINFO and other files as needed. 79 | 80 | ## Contributing 81 | 82 | Please run `reposetup.sh` prior to committing. This will install a git hook 83 | that will automatically re-generate `PKGBUILD` and `.SRCINFO` as needed 84 | before the commit completes. 85 | 86 | Note that running `gen-PKGBUILD.py` requires `python-debian` package. 87 | -------------------------------------------------------------------------------- /amdgpu-core-meta.install: -------------------------------------------------------------------------------- 1 | # 3f5f1e12af4667a5522a0d5862c92a3d amdgpu-core_19.20-812932_all.deb/postinst 2 | # Converted for arch linux: 3 | post_install() { 4 | prefix=/opt/amdgpu 5 | lib=lib/x86_64-linux-gnu 6 | conf=/etc/ld.so.conf.d/20-amdgpu.conf 7 | 8 | echo "$prefix/lib/x86_64-linux-gnu" >$conf 9 | echo "$prefix/lib/i386-linux-gnu" >>$conf 10 | } 11 | 12 | # e66513716fefe727886eadb5b95923f9 amdgpu-core_19.20-812932_all.deb/preinst 13 | # There is nothing but checking Ubuntu version there. So did not use it. 14 | 15 | # 9f9130053049b57ee04a078ddf71e927 amdgpu-core_19.20-812932_all.deb/prerm 16 | # Converted for arch linux: 17 | pre_remove() { 18 | rm -f /etc/ld.so.conf.d/20-amdgpu.conf && /sbin/ldconfig 19 | } 20 | -------------------------------------------------------------------------------- /amdgpu-pro-core-meta.install: -------------------------------------------------------------------------------- 1 | # 995d510d3099f2be343b1d6445a85bdc amdgpu-pro-core_19.20-812932_all.deb/postinst 2 | # Converted for arch linux: 3 | post_install() { 4 | prefix=/opt/amdgpu-pro 5 | conf=/etc/ld.so.conf.d/10-amdgpu-pro.conf 6 | 7 | echo "$prefix/lib/x86_64-linux-gnu" >$conf 8 | echo "$prefix/lib/i386-linux-gnu" >>$conf 9 | } 10 | 11 | # 41e43dfaf280600942eab53da384100d amdgpu-pro-core_19.20-812932_all.deb/prerm 12 | # Converted for arch linux: 13 | pre_remove() { 14 | rm -f /etc/ld.so.conf.d/10-amdgpu-pro.conf && /sbin/ldconfig 15 | } 16 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | if [[ `pacman -Q python-debian 2>&1` == "error: package 'python-debian' was not found" ]]; then 2 | echo "You need to install python-debian package" 3 | exit 1 4 | else 5 | python gen-PKGBUILD.py > PKGBUILD 6 | fi 7 | -------------------------------------------------------------------------------- /concat_packages_extracted.py: -------------------------------------------------------------------------------- 1 | import os 2 | from debian import deb822 3 | 4 | p64 = os.path.expanduser("~/.aptly/public/dists/jammy/proprietary/binary-amd64/Packages") 5 | p32 = os.path.expanduser("~/.aptly/public/dists/jammy/proprietary/binary-i386/Packages") 6 | 7 | print("Merging 32 and 64 Packages files", p32, p64) 8 | resulting_list = [] 9 | 10 | f = open(p32, "r") 11 | # Dropping multi arch packages from 32 bit packages list 12 | for deb_info in deb822.Packages.iter_paragraphs(f): 13 | if deb_info["Architecture"] == "all": 14 | print("info: dropping duplicated", deb_info["Package"]) 15 | continue 16 | resulting_list.append(deb_info) 17 | f.close() 18 | 19 | f = open(p64, "r") 20 | # Adding all packages from 64 bit packages list 21 | for deb_info in deb822.Packages.iter_paragraphs(f): 22 | resulting_list.append(deb_info) 23 | f.close() 24 | 25 | # Sorting them 26 | resulting_list.sort(key=lambda x: x["Package"], reverse=False) 27 | 28 | with open("Packages-extracted", 'w') as f: 29 | for deb_info in resulting_list: 30 | print(deb_info, file=f) 31 | print("Merged") 32 | -------------------------------------------------------------------------------- /extract_transaction_scripts_and_triggers.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script extracts transaction scripts of deb packages to a file, so it is possible to read it and compare with previous version. 4 | # After that its needed to carefully convert them to pacman .install files or hooks if needed 5 | 6 | . ./versions 7 | 8 | majornew=$pkgver_base 9 | minornew=$pkgver_build 10 | ubuntuvernew=$ubuntu_ver 11 | 12 | majorold=$old_pkgver_base 13 | minorold=$old_pkgver_build 14 | ubuntuverold=$old_ubuntu_ver 15 | 16 | function extract_them() { 17 | major="$1" 18 | minor="$2" 19 | ubuntu="$3" 20 | 21 | FOLDER=amdgpu-pro-$major-$minor-ubuntu-$ubuntu 22 | cd $FOLDER 23 | cd unpacked_debs 24 | rm -f *.install_scripts.sh 25 | rm -rf ../install_scripts_"$major"-"$minor" 26 | rm -rf ../install_scripts 27 | mkdir -p ../install_scripts 28 | > transaction_scripts_and_triggers_md5sums.txt # clear file 29 | echo -e "md5sums of transaction scripts and triggers of deb packages from archive ${ARCHIVE}\n" > transaction_scripts_and_triggers_md5sums.txt 30 | for dir in $(ls); do 31 | for file in postinst preinst prerm; do 32 | if [ -f $dir/$file ]; then 33 | file_md5=$(md5sum $dir/$file) 34 | # echo -e "# $file_md5" >> $dir.install_scripts.sh 35 | echo -e "$file_md5" >> transaction_scripts_and_triggers_md5sums.txt 36 | #cat $dir/$file >> $dir.install_scripts.sh 37 | cat $dir/$file > ../install_scripts/"$dir"_"$file".sh 38 | fi 39 | done 40 | done 41 | cd .. 42 | 43 | # As of 19.30-934563, all (except two) libs debian packages have just ldconfig awaiting trigger. It is done automatically by pacman, so we skip them. 44 | # Two exceptions are: 45 | #libgl1-amdgpu-mesa-dri_18.3.0-812932_amd64.deb 46 | #interest /usr/lib/x86_64-linux-gnu/dri 47 | #libgl1-amdgpu-mesa-dri_18.3.0-812932_i386.deb 48 | #interest /usr/lib/i386-linux-gnu/dri 49 | # They are triggered when files are changed in interest path. I (Ashark) created corresponding alpm hooks. 50 | 51 | cd unpacked_debs 52 | for dir in $(ls -d *deb); 53 | do 54 | if [ -f "$dir"/triggers ]; then 55 | if [[ $(cat "$dir"/triggers) == "# Triggers added by dh_makeshlibs/13.6ubuntu1 56 | activate-noawait ldconfig" ]]; 57 | then continue; fi 58 | file_md5=$(md5sum $dir/triggers) 59 | echo -e "$file_md5" >> transaction_scripts_and_triggers_md5sums.txt 60 | cat $dir/triggers > ../install_scripts/"$dir"_"triggers".sh 61 | fi 62 | done 63 | 64 | sed -i -e "1 ! s/$major/XX.XX/g" -e "1 ! s/$minor/XXXXXX/g" transaction_scripts_and_triggers_md5sums.txt 65 | cd .. 66 | 67 | rename "$major" "XX.XX" install_scripts/*.sh 68 | rename "$minor" "XXXXXX" install_scripts/*.sh 69 | 70 | rename "_2.1.0" "_C.C.C" install_scripts/*.sh # new comgr version 71 | rename "_2.0.0" "_C.C.C" install_scripts/*.sh # old comgr version 72 | 73 | rename "1.2.0" "_H.H.H" install_scripts/*.sh # old hsa-runtime-rocr-amdgpu version 74 | rename "1.3.0" "_H.H.H" install_scripts/*.sh # new hsa-runtime-rocr-amdgpu version 75 | 76 | rename "21.1.0" "YY.Y.Y" install_scripts/*.sh # new mesa version 77 | rename "20.3.4" "YY.Y.Y" install_scripts/*.sh # old mesa version 78 | 79 | rename "5.11.19.98" "Y.Y.Y.YY" install_scripts/*.sh # new amdgpu-dkms version 80 | rename "5.11.5.26" "Y.Y.Y.YY" install_scripts/*.sh # old amdgpu-dkms version 81 | 82 | rename "rocm_13.0" "rocm_RR.R" install_scripts/*.sh # new libllvm-amdgpu-pro-rocm 83 | rename "rocm_12.0" "rocm_RR.R" install_scripts/*.sh # old libllvm-amdgpu-pro-rocm 84 | 85 | rename "libllvm12.0-amdgpu_12.0" "libllvmZZ.Z-amdgpu_ZZ.Z" install_scripts/*.sh # new llvm-amdgpu version 86 | rename "libllvm11.0-amdgpu_11.0" "libllvmZZ.Z-amdgpu_ZZ.Z" install_scripts/*.sh # old llvm-amdgpu version 87 | 88 | rename "12.0-runtime_12.0" "LL.L-runtime_LL.L" install_scripts/*.sh # new llvm-amdgpu-XX.X-runtime_XX.X 89 | rename "11.0-runtime_11.0" "LL.L-runtime_LL.L" install_scripts/*.sh # old llvm-amdgpu-XX.X-runtime_XX.X 90 | 91 | rename "dev_12.0" "dev_DD.D" install_scripts/*.sh # new llvm-amdgpu-dev_XX.X 92 | rename "dev_11.0" "dev_DD.D" install_scripts/*.sh # old llvm-amdgpu-dev_XX.X 93 | 94 | mv install_scripts install_scripts_"$major"-"$minor" 95 | cd .. 96 | } 97 | 98 | # Specify the versions to run for (comment one of them if you want to disable running for it). 99 | # extract_them $majorold $minorold # Run for old version 100 | extract_them $majornew $minornew $ubuntuvernew # Run for new version 101 | 102 | echo "Opening meld for comparison..." 103 | pwd 104 | meld amdgpu-pro-$majorold-$minorold-ubuntu-$ubuntuverold/install_scripts_"$majorold"-"$minorold" amdgpu-pro-$majornew-$minornew-ubuntu-$ubuntuvernew/install_scripts_"$majornew"-"$minornew" 105 | -------------------------------------------------------------------------------- /gen-PKGBUILD.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | from replace_deps import replace_deps 4 | from packages_map import packages_map 5 | from debian import deb822 6 | from debian import debfile 7 | import re 8 | import hashlib 9 | import glob 10 | from pathlib import Path 11 | from importlib.util import spec_from_loader, module_from_spec 12 | from importlib.machinery import SourceFileLoader 13 | import os.path 14 | 15 | spec = spec_from_loader("versions", SourceFileLoader("versions", "versions")) 16 | versions = module_from_spec(spec) 17 | spec.loader.exec_module(versions) 18 | 19 | pkgver_base = versions.pkgver_base 20 | pkgver_base_short = ".".join(pkgver_base.split(".")[0:2]) 21 | pkgver_build = versions.pkgver_build 22 | ubuntu_ver = versions.ubuntu_ver 23 | repo_folder_ver = versions.repo_folder_ver 24 | pkgrel = 1 25 | 26 | debugging = False 27 | 28 | debug_pkgext = True if debugging else False 29 | 30 | url_ref = "https://www.amd.com/en/support/kb/release-notes/rn-amdgpu-unified-linux-22-40" 31 | 32 | source_repo_url = "https://repo.radeon.com/amdgpu/{0}/ubuntu/".format( 33 | repo_folder_ver) 34 | 35 | 36 | def gen_arch_packages(): 37 | pkgbuild_packages = { 38 | 39 | # Further is made by me (Ashark) 40 | # To make a more human readable Packages file I used this: 41 | # cat Packages | grep -vE "Filename|Size|MD5sum|SHA1|SHA256|Priority|Maintainer|Version: 19.20" > Packages-short 42 | 43 | # To generate pkgbuild_packages template I used: 44 | # bash make_pkgbuild_pkgs_template.sh > tmp_pkgbuild_pkgs_template.txt 45 | 46 | # To show packages with their conffiles I used this: 47 | # for file in $(ls *deb); 48 | # do 49 | # tmpdir=tmpdir; rm -rf "$tmpdir"; mkdir "$tmpdir"; cd "$tmpdir" 50 | # ar x ../$file control.tar.xz 51 | # files=$(tar -tf control.tar.xz | grep -vE "control|md5sums|./$" | grep conffiles) 52 | # if [[ $files != "" ]]; then 53 | # echo -e "$file:\n backup = [" 54 | # tar -xf control.tar.xz ./conffiles -O | sed 's/^\// '\''/' | sed 's/$/'\'',/' 55 | # echo " ]," 56 | # fi 57 | # files=""; cd .. 58 | # done 59 | # rm -rf tmpdir 60 | # They are added automatically, but you can override a backup array as shown in the example: 61 | 62 | # 'overriding-example': Package( 63 | # desc = "This overrides original description", 64 | # license = "lic_name", 65 | # arch = ["x86_64"], 66 | # provides = ["one", "two"], 67 | # conflicts = ["one", "two"], 68 | # optdepends = ["one", "two"], 69 | # install = "random_filename.install", 70 | # backup = [ 'file/one', 'file/two'], 71 | # depends = ["one", "two"], 72 | # extra_commands = [ 73 | # "do_one", 74 | # "do_two", 75 | # ], 76 | # ), 77 | 78 | 'amf-amdgpu-pro': Package(), 79 | # 'libdrm-amdgpu': Package( 80 | # provides = ['libdrm'], 81 | # extra_commands = [ 82 | # # This applies to libdrm2-amdgpu 83 | # "mv ${pkgdir}/lib/* ${pkgdir}/usr/lib", 84 | # "rmdir ${pkgdir}/lib" 85 | # ], 86 | # ), 87 | # 'lib32-libdrm-amdgpu': Package( 88 | # provides=['lib32-libdrm'], 89 | # extra_commands = [ 90 | # # This applies to libdrm2-amdgpu:i386 91 | # "mv ${pkgdir}/lib ${pkgdir}/usr" 92 | # ], 93 | # ), 94 | 'amdgpu-pro-oglp': Package( 95 | desc="AMDGPU Pro OpenGL driver", 96 | provides=['libgl'], 97 | extra_commands=[ 98 | # # This is instead of libgl1-amdgpu-pro-ext-hwe_19.20-812932_amd64.deb/postinst and libgl1-amdgpu-pro-ext-hwe_19.20-812932_amd64.deb/prerm 99 | # 'mv "${pkgdir}"/opt/amdgpu-pro/lib/xorg/modules/extensions/libglx-ext-hwe.so "${pkgdir}"/opt/amdgpu-pro/lib/xorg/modules/extensions/libglx.so', 100 | 'move_libdir "usr/lib/x86_64-linux-gnu" "usr/lib"', 101 | 'move_libdir "opt/amdgpu-pro/lib/x86_64-linux-gnu" "usr/lib/amdgpu-pro"', 102 | 'move_libdir "opt/amdgpu-pro/lib/xorg" "usr/lib/amdgpu-pro/xorg"', 103 | 'move_libdir "opt/amdgpu/share/drirc.d" "usr/share/drirc.d"', 104 | 105 | # The amdgpu-pro-core deb package postinst/prerm trigger creates a conf file that prioritises progl for the whole system. 106 | # That caused problems in Arch previously. So I do not create such config by pacman .install or hook. But if I do in the future, I can use this to still disable (comment) that line in config: 107 | # 'sed -i "s|/opt/amdgpu-pro/lib/x86_64-linux-gnu|#/usr/lib/amdgpu-pro # commented to prevent problems of booting with amdgpu-pro, use progl script|" "${pkgdir}"/etc/ld.so.conf.d/10-amdgpu-pro-x86_64.conf', 108 | 109 | 'install -Dm755 "${srcdir}"/progl "${pkgdir}"/usr/bin/progl', 110 | 'install -Dm644 "${srcdir}"/progl.bash-completion "${pkgdir}"/usr/share/bash-completion/completions/progl', 111 | 112 | '# For some reason, applications started with normal OpenGL (i.e. without ag pro) crashes at launch if this conf file is presented, so hide it for now, until I find out the reason of that.', 113 | 'mv "${pkgdir}"/usr/share/drirc.d/10-amdgpu-pro.conf "${pkgdir}"/usr/share/drirc.d/10-amdgpu-pro.conf.hide', 114 | 115 | '# For some reason, libs no more moved to the pro folder. Do it manually.', 116 | 'mv -v -t "${pkgdir}/usr/lib/amdgpu-pro" "${pkgdir}/usr/lib/lib"*', 117 | ] 118 | ), 119 | 'lib32-amdgpu-pro-oglp': Package( 120 | desc="AMDGPU Pro OpenGL driver (32-bit)", 121 | provides=['lib32-libgl'], 122 | extra_commands=[ 123 | # # This is instead of libgl1-amdgpu-pro-ext-hwe_19.20-812932_i386.deb/postinst and libgl1-amdgpu-pro-ext-hwe_19.20-812932_i386.deb/prerm 124 | # 'mv "${pkgdir}"/opt/amdgpu-pro/lib/xorg/modules/extensions/libglx-ext-hwe.so "${pkgdir}"/opt/amdgpu-pro/lib/xorg/modules/extensions/libglx.so', 125 | # Clean-up duplicated files to be able to install simultaneously with 64bit version 126 | 'rm "${pkgdir}"/opt/amdgpu/share/drirc.d/10-amdgpu-pro.conf', 127 | 128 | 'move_libdir "usr/lib/i386-linux-gnu" "usr/lib32"', 129 | 'move_libdir "opt/amdgpu-pro/lib/i386-linux-gnu" "usr/lib32/amdgpu-pro"', 130 | 131 | # Commented out, see the 64 bit package comment above. 132 | # 'sed -i "s|/opt/amdgpu-pro/lib/i386-linux-gnu|#/usr/lib32/amdgpu-pro # commented to prevent problems of booting with amdgpu-pro, use progl32 script|" "${pkgdir}"/etc/ld.so.conf.d/10-amdgpu-pro-i386.conf', 133 | 134 | '# For some reason, libs no more moved to the pro folder. Do it manually.', 135 | 'mkdir "${pkgdir}/usr/lib32/amdgpu-pro"', 136 | 'mv -v -t "${pkgdir}/usr/lib32/amdgpu-pro" "${pkgdir}/usr/lib32/lib"*', 137 | ] 138 | ), 139 | # 'opencl-amdgpu-pro-comgr': Package( desc = "Code object manager (COMGR)" ), 140 | # 'opencl-amdgpu-pro-dev': Package( ), 141 | # 'opencl-amdgpu-pro-pal': Package( 142 | # desc = "AMDGPU Pro OpenCL driver PAL", 143 | # provides=['opencl-driver'] 144 | # ), 145 | # 'opencl-amdgpu-pro-orca': Package( 146 | # desc = "AMDGPU Pro OpenCL driver ORCA aka legacy", 147 | # provides=['opencl-driver'] 148 | # ), 149 | # 'lib32-opencl-amdgpu-pro-orca': Package( 150 | # desc="AMDGPU Pro OpenCL driver ORCA aka legacy (32-bit)", 151 | # provides=['lib32-opencl-driver'] 152 | # ), 153 | 'vulkan-amdgpu-pro': Package( 154 | provides=['vulkan-driver'], 155 | extra_commands=[ 156 | # This is instead of vulkan-amdgpu-pro_19.20-812932_amd64.deb/postinst and vulkan-amdgpu-pro_19.20-812932_amd64.deb/prerm 157 | 'mkdir -p "${pkgdir}"/usr/share/vulkan/icd.d/', 158 | 'mv "${pkgdir}"/opt/amdgpu-pro/etc/vulkan/icd.d/amd_icd64.json "${pkgdir}"/usr/share/vulkan/icd.d/amd_pro_icd64.json', 159 | 'mv "${pkgdir}"/usr/lib/amdvlk64.so "${pkgdir}"/usr/lib/amdvlkpro64.so', 160 | 'sed -i "s#/opt/amdgpu-pro/lib/x86_64-linux-gnu/amdvlk64.so#/usr/lib/amdvlkpro64.so#" "${pkgdir}"/usr/share/vulkan/icd.d/amd_pro_icd64.json', 161 | 'find ${pkgdir} -type d -empty -delete', 162 | ] 163 | ), 164 | 'lib32-vulkan-amdgpu-pro': Package( 165 | provides=['lib32-vulkan-driver'], 166 | extra_commands=[ 167 | # This is instead of vulkan-amdgpu-pro_19.20-812932_i386.deb/postinst and vulkan-amdgpu-pro_19.20-812932_i386.deb/prerm 168 | 'mkdir -p "${pkgdir}"/usr/share/vulkan/icd.d/', 169 | 'mv "${pkgdir}"/opt/amdgpu-pro/etc/vulkan/icd.d/amd_icd32.json "${pkgdir}"/usr/share/vulkan/icd.d/amd_pro_icd32.json', 170 | 'mv "${pkgdir}"/usr/lib32/amdvlk32.so "${pkgdir}"/usr/lib32/amdvlkpro32.so', 171 | 'sed -i "s#/opt/amdgpu-pro/lib/i386-linux-gnu/amdvlk32.so#/usr/lib32/amdvlkpro32.so#" "${pkgdir}"/usr/share/vulkan/icd.d/amd_pro_icd32.json', 172 | 'find ${pkgdir} -type d -empty -delete', 173 | ] 174 | ), 175 | 176 | } 177 | for key in pkgbuild_packages: 178 | pkgbuild_packages[key].arch_pkg_name = key 179 | return pkgbuild_packages 180 | 181 | 182 | # This maps which deb packages should go into specific arch package 183 | 184 | # This maps debian dependencies to arch linux dependencies 185 | 186 | # Almost every pro package depends on these two, but I omited them (hoping they are not needed, but not tested), so disabling these dependencies globally 187 | replace_deps['libwayland-amdgpu-client0'] = None 188 | replace_deps['libwayland-amdgpu-server0'] = None 189 | 190 | # do not convert the dependencies listed to lib32 variants 191 | no_lib32_convert = [ 192 | # "some_debian_package_name", 193 | ] 194 | 195 | # override the version requirement extracted from deb 196 | replace_version = { 197 | # "some-debian-package-name": "=redefinedVersion", 198 | } 199 | 200 | # maps debians archs to arch's archs 201 | architectures_map = { 202 | "amd64": "x86_64", 203 | "i386": "i686", 204 | "all": "any" 205 | } 206 | 207 | # To see list of uniq licences files and packages that uses them, I used this: 208 | # cd unpacked_debs 209 | # for dir in $(ls -d *); do 210 | # md5sum $dir/copyright 211 | # done | sort 212 | # Then I mapped each copyright hash to its short licence name: 213 | 214 | licenses_hashes_map = { 215 | "063e0448ac11bde832bec75b88775293": "custom", 216 | "1cc2ccbd48178dec3ac4fe3f75deb273": "MIT", 217 | "241ed682eeb4973b7b7ac9131624f31f": "custom", 218 | "41133d491f0177abc7dcd732e55763d3": "custom", 219 | "65863e6b7e72f9b0d6921bfb874872e2": "MIT", 220 | "66f2e857194d9a397e5d81fedef2fb99": "X11", 221 | "7409e7a90acac9454eac07568798ae6e": "MIT", 222 | "757ddbf4ba06bfecb85c5bd02f8e188c": "custom", 223 | "75da66945980a43adf1e1856271b9d4a": "custom", 224 | "acc80450c1bd42944061a30272f0c132": "MIT", 225 | "b1afa13daf74f4073c4813368bc1b1b0": "MIT", 226 | "c7b12b6702da38ca028ace54aae3d484": "MIT", 227 | "d41d8cd98f00b204e9800998ecf8427e": "empty license?", 228 | "0edd336396b019512b94c98b0240ea77": "custom: AMDGPU-PRO EULA", 229 | "f2b0e0926d102efc9a09f8b9a740209d": "GPL2", 230 | } 231 | 232 | # To see list of suggested and recommended packages: 233 | # cat Packages-extracted | egrep "Suggest|Recommends" | sort -u 234 | optdepends_descriptions = { 235 | "libegl1-amdgpu-mesa-drivers": "TODO_some_description", 236 | "libgl1-amdgpu-mesa-dri": "TODO_some_description", 237 | "libgl1-amdgpu-pro-dri": "TODO_some_description", 238 | "libtxc-dxtn-s2tc0": "TODO_some_description", 239 | "llvm-amdgpu-7.1-dev": "TODO_some_description", 240 | "libglide3": "TODO_some_description", 241 | "linux-firmware": "TODO_some_description", 242 | "llvm-amdgpu-7.1-doc": "TODO_some_description", 243 | "vulkan-icd-loader": "Vulkan Installable Client Driver (ICD) Loader", 244 | } 245 | 246 | 247 | def hashFile(file): 248 | block = 64 * 1024 249 | hash = hashlib.sha256() 250 | with open(file, 'rb') as f: 251 | buf = f.read(block) 252 | while len(buf) > 0: 253 | hash.update(buf) 254 | buf = f.read(block) 255 | return hash.hexdigest() 256 | 257 | 258 | sources = ["progl::https://raw.githubusercontent.com/Ashark/archlinux-amdgpu-pro/master/progl", 259 | "progl.bash-completion::https://raw.githubusercontent.com/Ashark/archlinux-amdgpu-pro/master/progl.bash-completion"] 260 | sha256sums = [hashFile("progl"), hashFile("progl.bash-completion")] 261 | 262 | patches = sorted(glob.glob("*.patch")) 263 | 264 | for patch in patches: 265 | sources.append(patch) 266 | sha256sums.append(hashFile(patch)) 267 | 268 | # sources.append("20-amdgpu.conf") 269 | # sha256sums.append(hashFile("20-amdgpu.conf")) 270 | 271 | 272 | header_tpl = """# Author: Janusz Lewandowski 273 | # Contributor: David McFarland 274 | # Maintainer: Andrew Shark 275 | # Autogenerated from AMD's Packages file 276 | # with https://github.com/Ashark/archlinux-amdgpu-pro/blob/master/gen-PKGBUILD.py 277 | 278 | major={pkgver_base} 279 | major_short={pkgver_base_short} 280 | minor={pkgver_build} 281 | ubuntu_ver={ubuntu_ver} 282 | repo_folder_ver={repo_folder_ver} 283 | 284 | pkgbase=amdgpu-pro-installer 285 | pkgname={package_names} 286 | pkgver=${{major}}_${{minor}} 287 | pkgrel={pkgrel} 288 | arch=('x86_64') 289 | url={url} 290 | license=('custom: multiple') 291 | groups=('Radeon_Software_for_Linux') 292 | 293 | source=({source}) 294 | sha256sums=({sha256sums}) 295 | 296 | """ 297 | 298 | if debug_pkgext: 299 | header_tpl += "PKGEXT=\".pkg.tar\"\n" 300 | 301 | package_functions = """ 302 | # extracts a debian package 303 | # $1: deb file to extract 304 | extract_deb() { 305 | local tmpdir="$(basename "${1%.deb}")" 306 | rm -Rf "$tmpdir" 307 | mkdir "$tmpdir" 308 | cd "$tmpdir" 309 | ar x "$1" 310 | tar -C "${pkgdir}" -xf data.tar.xz 311 | } 312 | # move ubuntu specific /usr/lib/x86_64-linux-gnu to /usr/lib 313 | # $1: debian package library dir (goes from opt/amdgpu or opt/amdgpu-pro and from x86_64 or i386) 314 | # $2: arch package library dir (goes to usr/lib or usr/lib32) 315 | move_libdir() { 316 | local deb_libdir="$1" 317 | local arch_libdir="$2" 318 | 319 | if [ -d "${pkgdir}/${deb_libdir}" ]; then 320 | if [ ! -d "${pkgdir}/${arch_libdir}" ]; then 321 | mkdir -p "${pkgdir}/${arch_libdir}" 322 | fi 323 | mv -t "${pkgdir}/${arch_libdir}/" "${pkgdir}/${deb_libdir}"/* 324 | find ${pkgdir} -type d -empty -delete 325 | fi 326 | } 327 | # move copyright file to proper place and remove debian changelog 328 | move_copyright() { 329 | find ${pkgdir}/usr/share/doc -name "changelog.Debian.gz" -delete 330 | mkdir -p ${pkgdir}/usr/share/licenses/${pkgname} 331 | find ${pkgdir}/usr/share/doc -name "copyright" -exec mv {} ${pkgdir}/usr/share/licenses/${pkgname} \; 332 | find ${pkgdir}/usr/share/doc -type d -empty -delete 333 | } 334 | """ 335 | 336 | package_header_tpl = """package_{NAME} () {{ 337 | pkgdesc={DESC} 338 | """ 339 | 340 | package_deb_extract_tpl = """ extract_deb "${{srcdir}}"/{BaseFilename} 341 | """ 342 | 343 | package_move_libdir_tpl = """ move_libdir "opt/amdgpu{PRO}/lib/{DEBDIR}-linux-gnu" "usr/lib{ARCHDIR}" 344 | """ 345 | 346 | package_move_copyright = """ move_copyright 347 | """ 348 | 349 | package_lib32_cleanup = """ 350 | # lib32 cleanup 351 | rm -rf "${pkgdir}"/usr/{bin,lib,include,share} "${pkgdir}/var" "${pkgdir}"/opt/amdgpu-pro/{bin,include,share} 352 | rm -rf "${pkgdir}"/opt/amdgpu-pro/lib/xorg/modules/extensions/ 353 | """ 354 | 355 | package_footer = """} 356 | """ 357 | 358 | default_arch = ['x86_64'] 359 | 360 | 361 | def quote(string): 362 | return "\"" + string.replace("\\", "\\\\").replace("\"", "\\\"") + "\"" 363 | 364 | 365 | class Package: 366 | def __init__(self, **kwargs): 367 | for arg in kwargs: 368 | setattr(self, arg, kwargs[arg]) 369 | 370 | if not hasattr(self, "arch"): 371 | self.arch = default_arch 372 | self.deb_source_infos = [] 373 | 374 | self.optdepends = [] 375 | 376 | def fill_arch_info(self, deb_info): 377 | self.deb_source_infos.append(deb_info) 378 | 379 | try: 380 | self.arch = [architectures_map[deb_info["Architecture"]], ] 381 | except: 382 | self.arch = default_arch 383 | 384 | if deb_info["Architecture"] == "i386": 385 | if self.arch_pkg_name.startswith('lib32-'): 386 | self.arch = ['x86_64'] 387 | else: 388 | import sys 389 | sys.stderr.write("ERROR: There is a bug in this script, package '%s' is i386 (came from %s) and should start with 'lib32'. Check packages_map!\n" % ( 390 | self.arch_pkg_name, deb_info["Package"])) 391 | 392 | try: 393 | deb_deps = deb_info["Depends"].split(', ') 394 | except: 395 | deb_deps = None 396 | 397 | domap = True 398 | # if self.arch_pkg_name == "amdgpu-pro" or self.arch_pkg_name == "lib32-amdgpu-pro": 399 | # domap = False 400 | 401 | # Removing unneeded dependencies 402 | # if self.arch_pkg_name == "amdgpu-pro-meta" or self.arch_pkg_name == "lib32-amdgpu-pro-meta": 403 | # # Removes dependency on many open components, which are provided by standard arch repos 404 | # deb_deps.remove('amdgpu-hwe (= %s-%s)' % (pkgver_base, pkgver_build)) # for hwe releases 405 | # # deb_deps.remove('amdgpu (= %s-%s)' % (pkgver_base, pkgver_build)) # for non-hwe releases, i.e. LTS release with xx.xx.0 version 406 | # if self.arch_pkg_name == "amdgpu-pro-lib32-meta": 407 | # deb_deps.remove('amdgpu (= %s-%s) | amdgpu-hwe (= %s-%s)' % (pkgver_base, pkgver_build, pkgver_base, pkgver_build)) 408 | # deb_deps.remove('amdgpu-lib32 (= %s-%s)' % (pkgver_base, pkgver_build)) 409 | if self.arch_pkg_name == "opencl-amdgpu-pro-dev": 410 | deb_deps.remove('ocl-icd-libopencl1-amdgpu-pro (= %s-%s)' % 411 | (pkgver_base, pkgver_build)) 412 | if self.arch_pkg_name == "opencl-amdgpu-pro-meta": 413 | # I do not know why it wants amdgpu-dkms, but I did not built it, so just rm this dep for now 414 | deb_deps.remove('amdgpu-dkms (= %s-%s)' % 415 | (pkgver_base, pkgver_build)) 416 | deb_deps.remove('clinfo-amdgpu-pro (= %s-%s)' % 417 | (pkgver_base, pkgver_build)) 418 | deb_deps.remove('ocl-icd-libopencl1-amdgpu-pro (= %s-%s)' % 419 | (pkgver_base, pkgver_build)) 420 | # if self.arch_pkg_name == "amf-amdgpu-pro": 421 | # deb_deps.remove('opencl-amdgpu-pro-icd') # looks like amf works ok even without opencl part 422 | # if self.arch_pkg_name == "vulkan-amdgpu-pro": 423 | # deb_deps.remove('amdgpu-pro-core') # already removed, as I dropped ag-core-meta 424 | # if self.arch_pkg_name == "lib32-vulkan-amdgpu-pro": 425 | # deb_deps.remove('amdgpu-pro-core') # already removed, as I dropped ag-core-meta 426 | 427 | if deb_deps: 428 | deb_deps = [depWithAlt_to_singleDep(dep) if dependencyWithAltRE.search( 429 | dep) else dep for dep in deb_deps] 430 | deb_deps = [dependencyNameWithVersionRE.match( 431 | dep).groups() for dep in deb_deps] 432 | deb_deps = [(replace_deps[deb_pkg_name] if deb_pkg_name in replace_deps else deb_pkg_name, version) 433 | for deb_pkg_name, version in deb_deps] 434 | deb_deps = ["\"" + convertName(deb_pkg_name, deb_info, domap) + convertVersionSpecifier( 435 | deb_pkg_name, version) + "\"" for deb_pkg_name, version in deb_deps if deb_pkg_name] 436 | deb_deps = [dep for dep in deb_deps if dep != "\"\""] 437 | deb_deps = [dep for dep in deb_deps if not dep.startswith("\"=")] 438 | 439 | # if self.arch_pkg_name == "opencl-amdgpu-pro-orca": 440 | # deb_deps.append('\"libdrm-amdgpu=${major}_${minor}-${pkgrel}\"') 441 | # if self.arch_pkg_name == "lib32-opencl-amdgpu-pro-orca": 442 | # deb_deps.append('\"lib32-libdrm-amdgpu=${major}_${minor}-${pkgrel}\"') 443 | # # I am not sure if it is needed for pal variant, but just to be safe: 444 | # if self.arch_pkg_name == "opencl-amdgpu-pro-pal": 445 | # deb_deps.append('\"libdrm-amdgpu=${major}_${minor}-${pkgrel}\"') 446 | 447 | # remove all dependencies on itself 448 | deb_deps = [dep for dep in deb_deps if dep[1:len( 449 | self.arch_pkg_name)+1] != self.arch_pkg_name] 450 | 451 | if hasattr(self, 'depends') and self.depends: 452 | deb_deps += self.depends 453 | 454 | # remove duplicates and append to already existing dependencies 455 | self.depends = list(sorted(set(deb_deps))) 456 | 457 | try: 458 | deb_suggs = deb_info["Suggests"].split(', ') 459 | except: 460 | deb_suggs = None 461 | 462 | try: 463 | deb_recomms = deb_info["Recommends"].split(', ') 464 | except: 465 | deb_recomms = None 466 | 467 | deb_optdeps = [] 468 | if deb_suggs: 469 | deb_optdeps = deb_suggs 470 | if deb_recomms: 471 | deb_optdeps = deb_optdeps + deb_recomms 472 | 473 | if deb_optdeps: 474 | deb_optdeps = [depWithAlt_to_singleDep(dep) if dependencyWithAltRE.search( 475 | dep) else dep for dep in deb_optdeps] 476 | deb_optdeps = [dependencyNameWithVersionRE.match( 477 | dep).groups() for dep in deb_optdeps] 478 | deb_optdeps = [(replace_deps[deb_pkg_name] if deb_pkg_name in replace_deps else deb_pkg_name, version) 479 | for deb_pkg_name, version in deb_optdeps] 480 | deb_optdeps = ["\"" + convertName(deb_pkg_name, deb_info, domap) + convertVersionSpecifier(deb_pkg_name, version) + ": " 481 | + (optdepends_descriptions[deb_pkg_name] if deb_pkg_name in optdepends_descriptions else "Warning unspecified optdep description") 482 | + "\"" for deb_pkg_name, version in deb_optdeps if deb_pkg_name] 483 | 484 | # remove all optional dependencies on itself 485 | deb_optdeps = [dep for dep in deb_optdeps if dep[1:len( 486 | self.arch_pkg_name) + 1] != self.arch_pkg_name] 487 | 488 | self.optdepends = self.optdepends + list(sorted(set(deb_optdeps))) 489 | 490 | if not hasattr(self, 'desc'): 491 | desc = deb_info["Description"].split("\n") 492 | if len(desc) > 2: 493 | desc = desc[0] 494 | else: 495 | desc = " ".join(x.strip() for x in desc) 496 | 497 | if deb_info["Architecture"] == "i386": 498 | desc += ' (32-bit)' 499 | 500 | self.desc = desc 501 | 502 | sources.append(source_repo_url.replace(repo_folder_ver, "${repo_folder_ver}") + deb_info["Filename"].replace("/"+pkgver_base, "/"+"${major}") 503 | .replace("_"+pkgver_base_short, "_${major_short}").replace(pkgver_build, "${minor}").replace("."+ubuntu_ver, ".${ubuntu_ver}")) 504 | sha256sums.append(deb_info["SHA256"]) 505 | 506 | deb_file = debfile.DebFile(os.path.expanduser( 507 | "~/.aptly/public/%s" % (deb_info["Filename"]))) 508 | 509 | if not hasattr(self, 'license'): 510 | copyright_md5 = deb_file.md5sums( 511 | )[b'usr/share/doc/%s/copyright' % (str.encode(deb_info["Package"]))] 512 | if copyright_md5 in licenses_hashes_map: 513 | self.license = "('%s')" % licenses_hashes_map[copyright_md5] 514 | else: 515 | self.license = "('NOT_IN_MAP')" 516 | 517 | if not hasattr(self, 'backup'): 518 | if deb_file.control.has_file("conffiles"): 519 | self.backup = [line.decode('utf-8').replace("\n", "") 520 | for line in deb_file.control.get_file("conffiles") if line.decode('utf-8')] 521 | # removing leading slash 522 | self.backup = [re.sub("^/", "", line) for line in self.backup] 523 | 524 | if not hasattr(self, 'install'): 525 | if Path("%s.install" % self.arch_pkg_name).is_file(): 526 | self.install = "%s.install" % self.arch_pkg_name 527 | 528 | def toPKGBUILD(self): 529 | ret = package_header_tpl.format( 530 | NAME=self.arch_pkg_name, 531 | DESC=quote(self.desc) if hasattr(self, 'desc') else quote( 532 | "No description for package %s" % self.arch_pkg_name), 533 | ) 534 | 535 | if hasattr(self, 'license'): 536 | ret += " license=%s\n" % self.license 537 | if hasattr(self, 'install'): 538 | ret += " install=%s\n" % self.install 539 | 540 | if hasattr(self, 'arch'): 541 | if self.arch != default_arch: # omitting default arch for making pkgbuild cleaner 542 | ret += " arch=('%s')\n" % " ".join(self.arch) 543 | 544 | # add any given list/array with one of those names to the pkgbuild 545 | for array in ('provides', 'conflicts', 'replaces', 'groups'): 546 | if (hasattr(self, array)): 547 | ret += " %s=('%s')\n" % (array, 548 | "' '".join(getattr(self, array))) 549 | 550 | if hasattr(self, 'depends'): 551 | ret += " depends=(%s)\n" % " ".join(self.depends) 552 | if self.optdepends: 553 | ret += " optdepends=(%s)\n" % "\n ".join(self.optdepends) 554 | if hasattr(self, 'backup'): 555 | ret += " backup=(%s)\n" % " ".join(self.backup) 556 | 557 | ret += "\n" # separating variables and functions with empty line 558 | 559 | for info in self.deb_source_infos: 560 | tmp_str = package_deb_extract_tpl.format( 561 | BaseFilename=os.path.basename(info["Filename"])) 562 | ret += tmp_str.replace("/"+str(pkgver_base), "/"+"${major}").replace(str(pkgver_build), "${minor}").replace( 563 | str(pkgver_base_short), "${major_short}").replace(str(ubuntu_ver), "${ubuntu_ver}") 564 | 565 | if self.arch_pkg_name != "amdgpu-pro-libgl" and self.arch_pkg_name != "lib32-amdgpu-pro-libgl": 566 | # for ag-p-lgl and l32-ag-p-lgl I have temporary disabled movelibdir function (because it requires further investigation) 567 | 568 | PRO = "" 569 | DEBDIR = "" 570 | ARCHDIR = "" 571 | if "amdgpu-pro" in self.arch_pkg_name: 572 | PRO = "-pro" 573 | if self.arch_pkg_name.startswith('lib32-'): 574 | DEBDIR = "i386" 575 | ARCHDIR = "32" 576 | else: 577 | DEBDIR = "x86_64" 578 | ARCHDIR = "" 579 | ret += package_move_libdir_tpl.format( 580 | PRO=PRO, 581 | DEBDIR=DEBDIR, 582 | ARCHDIR=ARCHDIR, 583 | ) 584 | 585 | ret += package_move_copyright 586 | 587 | if hasattr(self, 'extra_commands'): 588 | ret += "\n # extra_commands:\n " 589 | ret += "\n ".join(self.extra_commands) 590 | ret += "\n" 591 | 592 | # if self.arch_pkg_name.startswith('lib32-'): 593 | # ret += package_lib32_cleanup 594 | ret += package_footer 595 | return ret 596 | 597 | 598 | pkgbuild_packages = gen_arch_packages() 599 | 600 | 601 | # regex for parsing version information of a deb dependency 602 | dependencyNameWithVersionRE = re.compile(r"([^ ]+)(?: \((.+)\))?") 603 | 604 | # regex for detecting dependency with alternative 605 | dependencyWithAltRE = re.compile(r" \| ") 606 | 607 | 608 | def depWithAlt_to_singleDep(depWithAlt): 609 | # I (Ashark) used this to get a list of dependencies with alternatives: 610 | # cat Packages | grep -vE "Filename|Size|MD5sum|SHA1|SHA256|Priority|Maintainer|Version|Description|^ +" > Packages-short-nodesc 611 | # cat Packages-short-nodesc | egrep "Depends|Suggests|Recommends" | grep "|" | sed 's/Depends: //' | sed 's/Suggests: //' | sed 's/Recommends: //' | sed "s/, /\n/g" | grep "|" | sort -u 612 | # And I got this list: 613 | # amdgpu (= 19.20-812932) | amdgpu-hwe (= 19.20-812932) 614 | # amdgpu-lib (= 19.20-812932) | amdgpu-lib-hwe (= 19.20-812932) 615 | # amdgpu-pro (= 19.20-812932) | amdgpu-pro-hwe (= 19.20-812932) 616 | # libtxc-dxtn-s2tc0 | libtxc-dxtn0 617 | # libudev1 | libudev0 618 | # libva1-amdgpu | libva2-amdgpu | libva1 | libva2 619 | # libvdpau1-amdgpu | libvdpau1 620 | 621 | splitted_alts = dependencyWithAltRE.split(depWithAlt) 622 | splitted_name_and_ver = [dependencyNameWithVersionRE.match( 623 | dep).groups() for dep in splitted_alts] 624 | 625 | if splitted_name_and_ver[0][0] + "-hwe" == splitted_name_and_ver[1][0]: 626 | return splitted_alts[1] # use hwe variant (i.e. latest) 627 | # from libgl1-amdgpu-mesa-dri Recommends array 628 | if splitted_name_and_ver[0][0] == "libtxc-dxtn-s2tc0" and splitted_name_and_ver[1][0] == "libtxc-dxtn0": 629 | # use libtxc-dxtn-s2tc0. libtxc-dxtn0 is a virtual package, which is provided by libtxc-dxtn-s2tc0 630 | return splitted_alts[0] 631 | if splitted_name_and_ver[0][0] == "libudev1" and splitted_name_and_ver[1][0] == "libudev0": 632 | return splitted_alts[0] # use libudev1 (i.e. latest) 633 | if splitted_name_and_ver[0][0] == "libva1-amdgpu" and splitted_name_and_ver[1][0] == "libva2-amdgpu" and splitted_name_and_ver[2][0] == "libva1" and splitted_name_and_ver[3][0] == "libva2": 634 | # use libva2. libva*-amdgpu doesn't exist in repos and not provided in bundle. Probably amd's mistake 635 | return splitted_alts[3] 636 | if splitted_name_and_ver[0][0] == "libvdpau1-amdgpu" and splitted_name_and_ver[1][0] == "libvdpau1": 637 | # use libvdpau1. libvdpau1-amdgpu doesn't exist in repos and not provided in bundle. Probably amd's mistake 638 | return splitted_alts[1] 639 | if splitted_name_and_ver[0][0] == "libwayland-amdgpu-client0" and splitted_name_and_ver[1][0] == "libwayland-client0": 640 | # they both resolves to wayland (automatically) in Arch 641 | return "wayland" 642 | 643 | if splitted_name_and_ver[0][0] == "mesa-vulkan-drivers": 644 | return splitted_alts[0] # use mesa-vulkan-drivers (i.e. latest) 645 | 646 | return "Warning_Do_not_know_which_alt_to_choose" 647 | 648 | 649 | deb_pkgs_avail_archs = {} 650 | 651 | dep32RE = re.compile(r"(.*):i386") 652 | 653 | 654 | def convertName(name, deb_info, domap=True): 655 | ret = name 656 | match = dep32RE.match(name) 657 | if match: # explicit :i386 dependency 658 | ret = match.group(1) 659 | if not ret in no_lib32_convert: 660 | ret = 'lib32-%s' % ret 661 | 662 | if deb_info["Architecture"] == "i386" and (name not in deb_pkgs_avail_archs or "all" not in deb_pkgs_avail_archs[name]): 663 | if not name in no_lib32_convert: 664 | ret = "lib32-" + name 665 | 666 | unambiguous_name = name 667 | if deb_info["Architecture"] == "i386": 668 | unambiguous_name = name + ":i386" 669 | 670 | if unambiguous_name in packages_map: 671 | if domap: 672 | # this is to prevent returning None type, because we want to concatenate with str type 673 | if packages_map[unambiguous_name]: 674 | return packages_map[unambiguous_name] 675 | return "" 676 | return "" 677 | 678 | if ret in packages_map: 679 | # this is to prevent returning None type, because we want to concatenate with str type 680 | if packages_map[ret]: 681 | return packages_map[ret] 682 | return "" 683 | return ret 684 | 685 | 686 | def convertVersionSpecifier(name, spec): 687 | if name in replace_version: 688 | return replace_version[name] 689 | 690 | if name in deb_package_names: 691 | # Different pkgver is not supported for split packages, see here: https://bbs.archlinux.org/viewtopic.php?id=246815 692 | # So we use the same pkgver for all split packages. 693 | return "=${major}_${minor}-${pkgrel}" 694 | 695 | if not spec: 696 | return "" 697 | 698 | sign, spec = spec.split(" ", 1) 699 | spec = spec.strip() 700 | 701 | if sign == ">" or sign == ">=": # assume Arch users have latest versions of all packages 702 | return "" 703 | 704 | if ":" in spec: # debian epochs means nothing in arch context, so strip them 705 | deb_epoch, spec = spec.rsplit(":", 1) 706 | # also would be good to omit debian-revision, as it has nothing to do with arch's pkgrel 707 | # but anyway we omit > and >= deps, so I did not implemented it yet 708 | return sign + spec 709 | 710 | 711 | # get list of unique arch packages from package map 712 | arch_package_names = list(pkgbuild_packages.keys()) 713 | deb_package_names = [] 714 | 715 | # f = open("Packages-debugging", "r") 716 | f = open("Packages-extracted", "r") 717 | 718 | deb_package_list = [] 719 | 720 | for deb_info in deb822.Packages.iter_paragraphs(f): 721 | if not deb_info["Package"] in deb_pkgs_avail_archs: 722 | deb_pkgs_avail_archs[deb_info["Package"]] = set() 723 | 724 | deb_pkgs_avail_archs[deb_info["Package"]].add(deb_info["Architecture"]) 725 | deb_package_list.append(deb_info) 726 | 727 | deb_package_names = [info["Package"] + ":i386" if info["Architecture"] 728 | == "i386" else info["Package"] for info in deb_package_list] 729 | 730 | f.close() 731 | 732 | for deb_info in deb_package_list: 733 | name = deb_info["Package"] 734 | arch_pkg = None 735 | if deb_info["Architecture"] == "i386": 736 | name = deb_info["Package"] + ":i386" 737 | if name in packages_map: # to allow temporary commenting out mappings from packages_map while using full Packages file 738 | # to allow temporary commenting out packages from pkgbuild_packages 739 | if packages_map[name] in pkgbuild_packages: 740 | arch_pkg = pkgbuild_packages[packages_map[name]] 741 | 742 | if arch_pkg: 743 | arch_pkg.fill_arch_info(deb_info) 744 | 745 | if not debugging: 746 | print(header_tpl.format( 747 | package_names="(\n" + "\n".join(arch_package_names) + "\n)", 748 | pkgrel=pkgrel, 749 | url=url_ref, 750 | pkgver_base=pkgver_base, 751 | pkgver_base_short=pkgver_base_short, 752 | pkgver_build=pkgver_build, 753 | ubuntu_ver=ubuntu_ver, 754 | repo_folder_ver=repo_folder_ver, 755 | source="\n\t".join(sources), 756 | sha256sums="\n\t".join(sha256sums) 757 | )) 758 | 759 | print(package_functions) 760 | 761 | for pkg in arch_package_names: 762 | print(pkgbuild_packages[pkg].toPKGBUILD()) 763 | -------------------------------------------------------------------------------- /gen_packages_map.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script prepares a packages mapping dict for using in gen-PKGBUILD.py 4 | 5 | # TODO fix duplication of stanzas for packages (remove them as 32 bit) that are Architecture=all / Multiarch: Foreign. 6 | # This problem arised bacause I combined two Packages files and they both contain them. 7 | # There are currently (as for 21.50.2) two such packages: amdgpu-pro-core and libgl1-amdgpu-pro-appprofiles. 8 | # 9 | # Proper solution is to make aptly to show relative path in Filename fields. I created bug report for that: 10 | # https://github.com/aptly-dev/aptly/issues/1040 11 | # 12 | # The workaround for now is to manually remove duplicated stanzas in Packages-extracted (concated from two files). 13 | # So, search for amdgpu-pro-core and libgl1-amdgpu-pro-appprofiles there and keep only one entry for them. 14 | 15 | echo "# Generated with ./gen_packages_map.sh > packages_map.py" 16 | echo -e "# for driver version `grep "Version" Packages-extracted | head -n1 | cut -f 2 -d " "`\n" 17 | 18 | echo "packages_map = {" 19 | # get list of deb-metapackages: 20 | cat Packages-extracted | grep -vE "Filename|Size|MD5sum|SHA1|SHA256|Priority|Maintainer|Version|Description|^ +" | grep -B4 "Section: metapackages" | grep -vE "Depends:|Section:" > tmp_Packages.txt 21 | echo > tmp_deb_metapackages_list.txt 22 | 23 | while read line; do 24 | if [[ $line =~ ^Package* ]]; then pkg=$(echo $line | sed "s/^Package: //"); continue; fi 25 | if [[ $line =~ ^Architecture* ]]; then 26 | arch=$(echo $line | sed "s/^Architecture: //") 27 | if [[ $arch == i386 ]]; then arch=":i386"; else arch=""; fi 28 | echo "$pkg$arch" >> tmp_deb_metapackages_list.txt; continue; 29 | fi 30 | done < tmp_Packages.txt 31 | rm tmp_Packages.txt 32 | 33 | 34 | cat Packages-extracted | grep Package | cut -f2 -d " " > tmp_all_presented_debian_packages.txt 35 | prev=""; 36 | for line in $(cat tmp_all_presented_debian_packages.txt | sort); do 37 | if [[ $prev != $line ]]; then 38 | echo $line; 39 | else 40 | echo $line:i386; 41 | fi; 42 | prev=$line; 43 | done > tmp_renamed_deb_32bit_packages.txt 44 | echo > tmp_non_hwe_list.txt 45 | if grep amdgpu-hwe tmp_renamed_deb_32bit_packages.txt > /dev/null; then # hwe version presented 46 | grep hwe tmp_renamed_deb_32bit_packages.txt | sed 's/-hwe//' > tmp_non_hwe_list.txt 47 | fi 48 | 49 | shopt -s extglob # needed for expanding syntax in case patterns 50 | for line in $(cat tmp_renamed_deb_32bit_packages.txt); do 51 | str=" '$line': "; comment=""; 52 | if [[ $line != *"i386" ]]; then archpkg=$line; else archpkg="lib32-${line//:i386/}"; fi; 53 | ##if [[ $archpkg == *"-dev" ]]; then archpkg=${archpkg//-dev/}; fi; # disable for now, I will combine packages later, but now I will make 1:1 conversion 54 | 55 | if grep -Fx $line tmp_non_hwe_list.txt > /dev/null; then archpkg=None; comment="disabled_because_hwe_version_is_available"; fi; 56 | 57 | if [[ $archpkg == *"-hwe"* ]]; then archpkg=${archpkg//-hwe/}; fi; 58 | 59 | if grep $line tmp_deb_metapackages_list.txt > /dev/null && [[ $archpkg != None ]]; then archpkg="$archpkg-meta" comment="mapped_manually"; fi; 60 | 61 | case $line in 62 | amdgpu@(-dkms|-dkms-firmware||-hwe|-lib32)\ 63 | |amdgpu-lib@(|-hwe)\ 64 | |glamor-amdgpu@(|-dev)\ 65 | |gst-omx-amdgpu@(|:i386)\ 66 | |libegl1-amdgpu-mesa@(|:i386|-dev|-dev:i386)\ 67 | |libegl1-amdgpu-mesa-drivers@(|:i386)\ 68 | |libgbm-amdgpu-dev@(|:i386)\ 69 | |libgbm1-amdgpu@(|:i386)\ 70 | |libgl1-amdgpu-mesa@(-dev|-dev:i386|-dri|-dri:i386|-glx|-glx:i386)\ 71 | |libglapi-amdgpu-mesa@(|:i386)\ 72 | |libgles1-amdgpu-mesa@(|:i386|-dev|-dev:i386)\ 73 | |libgles2-amdgpu-mesa@(|:i386|-dev|-dev:i386)\ 74 | |libllvm12.0-amdgpu@(|:i386)\ 75 | |libxatracker2-amdgpu@(|:i386)\ 76 | |mesa-amdgpu-omx-drivers@(|:i386)\ 77 | |mesa-amdgpu-va-drivers@(|:i386)\ 78 | |mesa-amdgpu-vdpau-drivers@(|:i386)\ 79 | |xserver-xorg-amdgpu-video-amdgpu\ 80 | |xserver-xorg-hwe-amdgpu-video-amdgpu\ 81 | |vulkan-amdgpu@(|:i386)\ 82 | |libwayland-amdgpu-@(bin|bin:i386|client0|client0:i386|cursor0|cursor0:i386|dev|dev:i386|doc|egl-backend-dev|egl-backend-dev:i386|egl1|egl1:i386|server0|server0:i386)\ 83 | |wayland-protocols-amdgpu\ 84 | ) 85 | archpkg=None; comment="unneeded_open_component" 86 | ;; 87 | clinfo-amdgpu-pro@(|:i386)\ 88 | |ocl-icd-libopencl1-amdgpu-pro@(|:i386|-dev|-dev:i386)\ 89 | ) 90 | archpkg=None; comment="unneeded_pro_component" 91 | ;; 92 | llvm-amdgpu@(|:i386)\ 93 | |llvm-amdgpu-12.0@(|:i386|-dev|-dev:i386|-doc|-runtime|-runtime:i386)\ 94 | |llvm-amdgpu@(-dev|-dev:i386|-runtime|-runtime:i386)\ 95 | |libdrm-amdgpu-dev@(|:i386)\ 96 | |libdrm-amdgpu-radeon1@(|:i386)\ 97 | |libdrm-amdgpu-utils@(|:i386)\ 98 | |libxatracker-amdgpu-dev@(|:i386)\ 99 | |mesa-amdgpu-common-dev@(|:i386)\ 100 | ) 101 | archpkg=None; comment="not_installed_even_in_ubuntu" 102 | ;; 103 | amdgpu-pro-pin|amdgpu-pin) 104 | archpkg=None; comment="debian_specific_package,_not_needed" 105 | ;; 106 | "amdgpu-doc") 107 | archpkg=None; comment="arch_specific_instructions_will_be_covered_in_archwiki" 108 | ;; 109 | amdgpu-core|amdgpu-pro-core) 110 | archpkg=None; comment="unneeded_meta_package" # because they just put conf file in ld.so.conf.d, which amdgpu-pro-libgl already does 111 | ;; 112 | amdgpu-pro-oglp@(|:i386)) 113 | archpkg=None; comment="unneeded_meta_package" 114 | ;; 115 | libdrm-amdgpu@(-amdgpu1|-common)\ 116 | |libdrm2-amdgpu\ 117 | ) 118 | #archpkg=libdrm-amdgpu; comment="needed_because_probably_changed_by_amd_and_doesnt_work_with_standard_libdrm" # since 19.30-838629 it seems not true anymore 119 | archpkg=None; comment="unneeded_open_component" 120 | ;; 121 | libdrm-amdgpu@(-amdgpu1:i386)\ 122 | |libdrm2-amdgpu:i386\ 123 | ) 124 | # archpkg=lib32-libdrm-amdgpu; comment="needed_because_probably_changed_by_amd_and_doesnt_work_with_standard_libdrm" # since 19.30-838629 it seems not true anymore 125 | archpkg=None; comment="unneeded_open_component" 126 | ;; 127 | 128 | libegl1-amdgpu-pro-oglp\ 129 | |libgl1-amdgpu-pro-oglp-@(dri|ext|gbm|glx)\ 130 | |libgles1-amdgpu-pro-oglp\ 131 | |libgles2-amdgpu-pro-oglp\ 132 | ) 133 | archpkg=amdgpu-pro-oglp; comment="mapped_manually" 134 | ;; 135 | 136 | libegl1-amdgpu-pro-oglp:i386\ 137 | |libgl1-amdgpu-pro-oglp-@(dri|glx):i386\ 138 | |libgles1-amdgpu-pro-oglp:i386\ 139 | |libgles2-amdgpu-pro-oglp:i386\ 140 | ) 141 | archpkg=lib32-amdgpu-pro-oglp; comment="mapped_manually" 142 | ;; 143 | amdgpu-pro-@(hwe|lib32)|amdgpu-pro\ 144 | ) 145 | archpkg=None; comment="we_have_already_combined_libgl_to_single_package" 146 | ;; 147 | # Disabling opencl related packages, as they go to opencl-amd 148 | amdgpu-pro-rocr-opencl\ 149 | |comgr-amdgpu-pro@(|-dev)\ 150 | |hip-rocr-amdgpu-pro\ 151 | |hsa-runtime-rocr-amdgpu@(|-dev)\ 152 | |hsakmt-roct-amdgpu@(|-dev)\ 153 | |kfdtest-amdgpu\ 154 | |libllvm-amdgpu-pro-rocm\ 155 | |llvm-amdgpu-pro-rocm@(|-dev)\ 156 | |opencl-orca-amdgpu-pro-icd@(|:i386)\ 157 | |opencl-rocr-amdgpu-pro@(|-dev)\ 158 | |rocm-device-libs-amdgpu-pro\ 159 | |opencl-legacy-amdgpu-pro-icd@(|:i386)\ 160 | ) 161 | archpkg=None; comment="opencl_goes_to_opencl-amd" 162 | ;; 163 | amf-amdgpu-pro\ 164 | |vulkan-amdgpu-pro\ 165 | ) 166 | archpkg=$line; comment="mapped_manually" 167 | ;; 168 | vulkan-amdgpu-pro:i386) 169 | archpkg=lib32-vulkan-amdgpu-pro; comment="mapped_manually" 170 | ;; 171 | libamdenc-amdgpu-pro) 172 | archpkg=amf-amdgpu-pro; comment="mapped_manually.Maybe_this_should_go_to_a_saparate_package?" 173 | ;; 174 | 175 | esac 176 | if [[ $archpkg == "None" ]]; then 177 | str="$str $archpkg, #$comment"; 178 | else 179 | str="$str '$archpkg', #$comment" 180 | fi 181 | echo -e "$str"; 182 | # echo -e "$str" | egrep -v "None|opencl|amf|meta|vulkan|wsa|libdrm|roct|wayland" # debugging 183 | done | column -t | sed 's/^/ /' 184 | rm tmp_deb_metapackages_list.txt 185 | rm tmp_non_hwe_list.txt 186 | rm tmp_all_presented_debian_packages.txt 187 | rm tmp_renamed_deb_32bit_packages.txt 188 | #Then it's needed to carefully check pkgs mapping 189 | echo "}" 190 | -------------------------------------------------------------------------------- /gen_replace_deps.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # This script generates a dependencies map of debian packages to arch linux packages dict for using in gen-PKGBUILD.py 3 | 4 | cat Packages-extracted | egrep "Depends|Suggests|Recommends" | sed 's/Depends: //' | sed 's/Suggests: //' | sed 's/Recommends: //' | sed 's/, /\n/g' | sort -u | grep -v "amdgpu" | sed "s/ | /\n/g" >tmp_extra_deps_in_debian.txt 5 | cat tmp_extra_deps_in_debian.txt | cut -f1 -d" " | sort -u >tmp_extra_deps_in_debian_removed_versions.txt # removed versions 6 | 7 | # Detecting dependencies, named with amdgpu (and their alternatives), that are not provided in bundled amd archive 8 | cat Packages-extracted | egrep "Depends|Suggests|Recommends" | sed 's/Pre-Depends: //' | sed 's/Depends: //' | sed 's/Suggests: //' | sed 's/Recommends: //' | sed 's/, /\n/g' | sort -u | grep "amdgpu" | sed "s/ | /\n/g" >tmp_deps_in_debian_amdgpu.txt 9 | cat tmp_deps_in_debian_amdgpu.txt | cut -f1 -d" " | sort -u >tmp_removed_versions_amdgpu.txt # removed versions 10 | cat tmp_removed_versions_amdgpu.txt | sed "s/:i386$//g" | sort -u >tmp_amdgpu_deps_in_debian.txt 11 | >tmp_extra_deps_in_debian_amdgpu.txt # clear file 12 | for line in $(cat tmp_amdgpu_deps_in_debian.txt); do 13 | if grep -q "Package: $line" Packages-extracted; then continue; fi 14 | echo $line >>tmp_extra_deps_in_debian_amdgpu.txt 15 | done 16 | 17 | sed -i 's/-hwe//g' tmp_extra_deps_in_debian_amdgpu.txt 18 | 19 | echo >tmp_translated_deps.txt # clear file 20 | 21 | function dep_convert { 22 | line=$1 23 | case $line in 24 | 25 | libc6) arch_str="None, #manually_mapped" ;; # It maps to 'glibc', which is required by base, so no need to explicitly depend on it 26 | libvulkan1) arch_str="'vulkan-icd-loader', #manually_mapped" ;; # It maps to 'vulkan-icd-loader', because the automatic sets to use dicord for this lib 27 | libgcc-s1) arch_str="None, #manually_mapped" ;; # It maps to 'gcc', but I doubt it depends on gcc, the compiler 28 | libgl1) arch_str="'libglvnd', #manually_mapped" ;; 29 | libjs-jquery) arch_str="'jquery', #manually_mapped" ;; 30 | libjs-underscore) arch_str="'underscorejs', #manually_mapped" ;; 31 | libstdc++6) arch_str="None, #manually_mapped" ;; # It maps to 'gcc-libs', which is required by base, so no need to explicitly depend on it 32 | libtxc-dxtn-s2tc0) arch_str="'libtxc_dxtn', #manually_mapped" ;; 33 | libtxc-dxtn0) arch_str="None, #manually_mapped" ;; # have alternative libtxc-dxtn-s2tc0 34 | libtinfo5) arch_str="'ncurses5-compat-libs', #manually_mapped" ;; 35 | libwayland-amdgpu-client0) arch_str="'wayland', #manually_mapped" ;; 36 | libtinfo-dev) arch_str="'ncurses', #manually_mapped" ;; 37 | libudev0) arch_str="None, #manually_mapped" ;; # have alternative libudev1 38 | linux-firmware) arch_str="'linux-firmware', #manually_mapped" ;; # debtap takes very long time and finally faulty auto translates to None. 39 | libgbm1-amdgpu) arch_str="None, #manually_Do_not_know_what_it_is" ;; 40 | libssl1.1) arch_str="'openssl-1.1', #manually_mapped" ;; #for libssl1.1 to have correct dependency 41 | mesa-vulkan-drivers) arch_str="'vulkan-radeon', #manually_mapped" ;; #for now it works with mesa 42 | rocm-opencl-runtime) arch_str="'rocm-opencl-runtime', #manually_mapped" ;; # we anyway do not use it, but let's keep the dependency 43 | libwayland-client0) arch_str="'wayland', #manually_mapped" ;; # we anyway do not use it, but let's keep the dependency 44 | zlib1g) arch_str="'zlib', #manually_mapped" ;; # it seems to need the zlib, so we put it 45 | #---) arch_str="'---', #manually_mapped" ;; # templpate 46 | 47 | *) 48 | arch_dep=$(bash ./translate_deb_to_arch_dependency.sh $line) # https://github.com/helixarch/debtap/issues/41#issuecomment-489166020 49 | if [[ $arch_dep == "could_not_translate" ]]; then 50 | arch_str="'$line', #could_not_auto_translate" 51 | elif [[ $arch_dep == "" ]]; then 52 | arch_str="None, #auto_translated" 53 | else 54 | arch_str="'$arch_dep', #auto_translated" 55 | fi 56 | ;; 57 | esac 58 | str="'$line': " 59 | str="$str $arch_str" 60 | echo $str >>tmp_translated_deps.txt 61 | } 62 | 63 | for line in $(cat tmp_extra_deps_in_debian_removed_versions.txt tmp_extra_deps_in_debian_amdgpu.txt | sort); do 64 | echo now processing $line >&2 65 | dep_convert $line & 66 | done 67 | wait 68 | cat tmp_translated_deps.txt | sort -k2,2 -t "'" | column -t | sed 's/^'\''/ '\''/' >tmp_prepared_columns.txt 69 | 70 | echo -e "# Generated with ./gen_replace_deps.sh > replace_deps.py\n\ 71 | # for driver version $(sed -n 2p Packages-extracted | cut -f 2 -d " ")\n" 72 | echo "replace_deps = {" 73 | cat tmp_prepared_columns.txt 74 | echo "}" 75 | 76 | rm tmp_amdgpu_deps_in_debian.txt 77 | rm tmp_deps_in_debian_amdgpu.txt 78 | rm tmp_extra_deps_in_debian_amdgpu.txt 79 | rm tmp_extra_deps_in_debian_removed_versions.txt 80 | rm tmp_extra_deps_in_debian.txt 81 | rm tmp_prepared_columns.txt 82 | rm tmp_removed_versions_amdgpu.txt 83 | rm tmp_translated_deps.txt 84 | -------------------------------------------------------------------------------- /git/hooks/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | files=`git diff --cached --name-status` 4 | re="gen-PKGBUILD.py" 5 | if [[ $files =~ $re ]] 6 | then 7 | echo "Re-generating PKGBUILD..." 8 | ./build.sh 9 | git add PKGBUILD 10 | echo "Re-generating .SRCINFO..." 11 | makepkg --printsrcinfo > .SRCINFO 12 | git add .SRCINFO 13 | fi 14 | -------------------------------------------------------------------------------- /lib32-libgl1-amdgpu-mesa-dri.install: -------------------------------------------------------------------------------- 1 | # f00d6adb58ed0b888cc28a3b83af9a30 libgl1-amdgpu-mesa-dri_18.3.0-812932_i386.deb/postinst 2 | # Converted for arch linux (install script part): 3 | post_install() { 4 | source /usr/share/libalpm/scripts/update-amdgpu-dri-links-32 5 | create_links 6 | } 7 | 8 | # 84cfe30e8c9c8e424e230d3c7743c969 libgl1-amdgpu-mesa-dri_18.3.0-812932_i386.deb/prerm 9 | # Converted for arch linux: 10 | pre_remove() { 11 | rm -f /opt/amdgpu/lib/i386-linux-gnu/dri/i965_dri.so 12 | 13 | for f in /opt/amdgpu/lib/i386-linux-gnu/dri/*_dri.so; do 14 | f=${f##*/} 15 | if [ -f /usr/lib32/dri/$f~ ]; then 16 | mv -f /usr/lib32/dri/$f~ /usr/lib32/dri/$f 17 | else 18 | rm -f /usr/lib32/dri/$f 19 | fi 20 | done 21 | } 22 | -------------------------------------------------------------------------------- /lib32-mesa-amdgpu-va-drivers.install: -------------------------------------------------------------------------------- 1 | # 80f11220eb7082272a4468d4fba5cf4f mesa-amdgpu-va-drivers_18.3.0-812932_i386.deb/postinst 2 | # Converted for arch linux: 3 | post_install() { 4 | for f in /opt/amdgpu/lib/i386-linux-gnu/dri/*_drv_video.so; do 5 | ln -sb $f /usr/lib32/dri 6 | done 7 | } 8 | 9 | # ae29d92f96011da12e92203a4899b1a9 mesa-amdgpu-va-drivers_18.3.0-812932_i386.deb/prerm 10 | # Converted for arch linux: 11 | pre_remove() { 12 | for f in /opt/amdgpu/lib/i386-linux-gnu/dri/*_drv_video.so; do 13 | f=${f##*/} 14 | if [ -f /usr/lib32/dri/$f~ ]; then 15 | mv -f /usr/lib32/dri/$f~ /usr/lib32/dri/$f 16 | else 17 | rm -f /usr/lib32/dri/$f 18 | fi 19 | done 20 | } 21 | -------------------------------------------------------------------------------- /libgl1-amdgpu-mesa-dri.install: -------------------------------------------------------------------------------- 1 | # d92079d94c43be3c80dfdc3fc0221a71 libgl1-amdgpu-mesa-dri_18.3.0-812932_amd64.deb/postinst 2 | # Converted for arch linux (install script part): 3 | post_install() { 4 | source /usr/share/libalpm/scripts/update-amdgpu-dri-links 5 | create_links 6 | } 7 | 8 | # f81f8fbe57013765c0514e53e83caf37 libgl1-amdgpu-mesa-dri_18.3.0-812932_amd64.deb/prerm 9 | # Converted for arch linux: 10 | pre_remove() { 11 | rm -f /opt/amdgpu/lib/x86_64-linux-gnu/dri/i965_dri.so 12 | 13 | for f in /opt/amdgpu/lib/x86_64-linux-gnu/dri/*_dri.so; do 14 | f=${f##*/} 15 | if [ -f /usr/lib/dri/$f~ ]; then 16 | mv -f /usr/lib/dri/$f~ /usr/lib/dri/$f 17 | else 18 | rm -f /usr/lib/dri/$f 19 | fi 20 | done 21 | } 22 | -------------------------------------------------------------------------------- /make_pkgbuild_pkgs_template.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script prepares a template for pkgbuild_packages in gen-PKGBUILD.py 4 | 5 | cat packages_map.py | cut -s -f4 -d"'" > tmp_arch_packages.txt 6 | echo "" > tmp_already_used.txt 7 | for line in $(cat tmp_arch_packages.txt); do 8 | if grep -Fxq "$line" tmp_already_used.txt; then continue; 9 | else 10 | echo $line >> tmp_already_used.txt 11 | echo -e " '$line': Package( ),"; 12 | fi 13 | done 14 | rm tmp_already_used.txt 15 | rm tmp_arch_packages.txt 16 | 17 | -------------------------------------------------------------------------------- /mesa-amdgpu-va-drivers.install: -------------------------------------------------------------------------------- 1 | # 903d1cf9f8a969554e901f2bfd91cab7 mesa-amdgpu-va-drivers_18.3.0-812932_amd64.deb/postinst 2 | # Converted for arch linux: 3 | post_install() { 4 | for f in /opt/amdgpu/lib/x86_64-linux-gnu/dri/*_drv_video.so; do 5 | ln -sb $f /usr/lib/dri 6 | done 7 | } 8 | 9 | # f1b401b23a832bdf38fd7c08ac19c8b7 mesa-amdgpu-va-drivers_18.3.0-812932_amd64.deb/prerm 10 | # Converted for arch linux: 11 | pre_remove() { 12 | for f in /opt/amdgpu/lib/x86_64-linux-gnu/dri/*_drv_video.so; do 13 | f=${f##*/} 14 | if [ -f /usr/lib/dri/$f~ ]; then 15 | mv -f /usr/lib/dri/$f~ /usr/lib/dri/$f 16 | else 17 | rm -f /usr/lib/dri/$f 18 | fi 19 | done 20 | } 21 | -------------------------------------------------------------------------------- /packages_map.py: -------------------------------------------------------------------------------- 1 | # Generated with ./gen_packages_map.sh > packages_map.py 2 | # for driver version 24.30-2125449.22.04 3 | 4 | packages_map = { 5 | 'amdgpu-pro': None, #we_have_already_combined_libgl_to_single_package 6 | 'amdgpu-pro-core': None, #unneeded_meta_package 7 | 'amdgpu-pro-lib32': None, #we_have_already_combined_libgl_to_single_package 8 | 'amdgpu-pro-oglp': None, #unneeded_meta_package 9 | 'amdgpu-pro-oglp:i386': None, #unneeded_meta_package 10 | 'amf-amdgpu-pro': 'amf-amdgpu-pro', #mapped_manually 11 | 'libamdenc-amdgpu-pro': 'amf-amdgpu-pro', #mapped_manually.Maybe_this_should_go_to_a_saparate_package? 12 | 'libegl1-amdgpu-pro-oglp': 'amdgpu-pro-oglp', #mapped_manually 13 | 'libegl1-amdgpu-pro-oglp:i386': 'lib32-amdgpu-pro-oglp', #mapped_manually 14 | 'libgl1-amdgpu-pro-oglp-dri': 'amdgpu-pro-oglp', #mapped_manually 15 | 'libgl1-amdgpu-pro-oglp-dri:i386': 'lib32-amdgpu-pro-oglp', #mapped_manually 16 | 'libgl1-amdgpu-pro-oglp-ext': 'amdgpu-pro-oglp', #mapped_manually 17 | 'libgl1-amdgpu-pro-oglp-gbm': 'amdgpu-pro-oglp', #mapped_manually 18 | 'libgl1-amdgpu-pro-oglp-glx': 'amdgpu-pro-oglp', #mapped_manually 19 | 'libgl1-amdgpu-pro-oglp-glx:i386': 'lib32-amdgpu-pro-oglp', #mapped_manually 20 | 'libgles1-amdgpu-pro-oglp': 'amdgpu-pro-oglp', #mapped_manually 21 | 'libgles1-amdgpu-pro-oglp:i386': 'lib32-amdgpu-pro-oglp', #mapped_manually 22 | 'libgles2-amdgpu-pro-oglp': 'amdgpu-pro-oglp', #mapped_manually 23 | 'libgles2-amdgpu-pro-oglp:i386': 'lib32-amdgpu-pro-oglp', #mapped_manually 24 | 'vulkan-amdgpu-pro': 'vulkan-amdgpu-pro', #mapped_manually 25 | 'vulkan-amdgpu-pro:i386': 'lib32-vulkan-amdgpu-pro', #mapped_manually 26 | } 27 | -------------------------------------------------------------------------------- /progl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script applies amdgpu-pro OpenGL driver for specific application. 4 | # For example, running "$ progl davinci-resolve" will start DR with AMDGPU PRO driver. 5 | # You can test the difference (GL_VENDOR, GL_RENDERER, GL_VERSION) with glmark2 utility. 6 | 7 | progl() { 8 | export LD_LIBRARY_PATH="/usr/lib/amdgpu-pro/:${LD_LIBRARY_PATH}" 9 | # export LIBGL_DRIVERS_PATH="/usr/lib/dri/" # unneeded, because already a system path 10 | } 11 | 12 | progl32() { 13 | export LD_LIBRARY_PATH="/usr/lib32/amdgpu-pro/:${LD_LIBRARY_PATH}" 14 | # export LIBGL_DRIVERS_PATH="/usr/lib32/dri/" # unneeded, because already a system path 15 | } 16 | 17 | # export dri_driver="amdgpu" # Do not know if needed, there is already a file in drirc.d, is not it sufficient? 18 | 19 | 20 | if [[ $(basename $0) == progl ]]; then 21 | progl 22 | elif [[ $(basename $0) == progl32 ]]; then 23 | progl32 24 | else 25 | echo "Unknown function" 26 | exit 1 27 | fi 28 | 29 | # applied variables, now execute the rest of the command 30 | "$@" 31 | -------------------------------------------------------------------------------- /progl.bash-completion: -------------------------------------------------------------------------------- 1 | _have progl && complete -F _command progl 2 | -------------------------------------------------------------------------------- /remake_all.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | bash uninstall_packages_group.sh && \ 4 | echo "Removing *pkg.tar.zst files"; rm -f *.pkg.tar.zst && \ 5 | echo "Generating PKGBUILD..."; ./build.sh && \ 6 | echo "Invoking makepkg..."; makepkg && \ 7 | echo "Updating local repository..."; bash update-local-repo.sh 1>/dev/null 8 | -------------------------------------------------------------------------------- /replace_deps.py: -------------------------------------------------------------------------------- 1 | # Generated with ./gen_replace_deps.sh > replace_deps.py 2 | # for driver version optional 3 | 4 | replace_deps = { 5 | 'amdgpu-core': 'amdgpu-core', #could_not_auto_translate 6 | 'amdgpu-lib32': 'amdgpu-lib32', #could_not_auto_translate 7 | 'libc6': None, #manually_mapped 8 | 'libdrm2-amdgpu': 'libdrm', #auto_translated 9 | 'libgbm1-amdgpu': None, #manually_Do_not_know_what_it_is 10 | 'libgcc-s1': None, #manually_mapped 11 | 'libgl1': 'libglvnd', #manually_mapped 12 | 'libssl1.1': 'openssl-1.1', #manually_mapped 13 | 'libstdc++6': None, #manually_mapped 14 | 'libvulkan1': 'vulkan-icd-loader', #manually_mapped 15 | 'libwayland-amdgpu-client0': 'wayland', #manually_mapped 16 | 'libwayland-client0': 'wayland', #manually_mapped 17 | 'libx11-6': 'libx11', #auto_translated 18 | 'mesa-amdgpu-vulkan-drivers': 'mesa', #auto_translated 19 | 'mesa-vulkan-drivers': 'vulkan-radeon', #manually_mapped 20 | 'rocm-opencl-runtime': 'rocm-opencl-runtime', #manually_mapped 21 | 'zlib1g': 'zlib', #manually_mapped 22 | } 23 | -------------------------------------------------------------------------------- /reposetup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | ROOT=$(cd $(dirname $0); pwd -P) 4 | 5 | for hook in $ROOT/git/hooks/* 6 | do 7 | hookName=$(basename $hook) 8 | echo "Installing $hookName..." 9 | ln -s -f -r $hook $ROOT/.git/hooks/$hookName 10 | done 11 | -------------------------------------------------------------------------------- /translate_deb_to_arch_dependency.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script takes a name of debian package name and outputs suggested arch linux package name 4 | 5 | # Making it in individual folder to support multi processing 6 | tmp_dir=$(mktemp -d -t deb_to_arch_${line}-$(date +%Y-%m-%d-%H-%M-%S)-XXX) 7 | cd $tmp_dir 8 | 9 | rm -rf tmp-mapdeps-pkg 10 | mkdir -p tmp-mapdeps-pkg/DEBIAN 11 | cat << EOF > tmp-mapdeps-pkg/DEBIAN/control 12 | Package: tmp-mapdeps-pkg 13 | Version: 1.0-1 14 | Section: base 15 | Priority: optional 16 | Architecture: amd64 17 | Depends: $1 18 | Maintainer: Your Name 19 | Description: Temporary package to workaround https://github.com/helixarch/debtap/issues/41 20 | EOF 21 | 22 | dpkg-deb --build tmp-mapdeps-pkg > /dev/null 23 | 24 | debtap -P -Q tmp-mapdeps-pkg.deb 2>/dev/null > tmpfile 25 | if grep "Warning: These dependencies" tmpfile > /dev/null; then 26 | echo could_not_translate 27 | rm tmp-mapdeps-pkg.deb tmpfile 28 | rm -rf tmp-mapdeps-pkg 29 | exit 1 30 | fi 31 | 32 | cat tmp-mapdeps-pkg/PKGBUILD | grep depends | sed 's/depends=('\''//' | sed 's/'\'' '\''/\n/g' | sed 's/'\'')//g' 33 | rm tmp-mapdeps-pkg.deb tmpfile 34 | rm -rf tmp-mapdeps-pkg 35 | 36 | cd .. 37 | rm -rf $tmp_dir 38 | -------------------------------------------------------------------------------- /uninstall_packages_group.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | pkgs_installed=$(pacman -Qg Radeon_Software_for_Linux | cut -f2 -d" ") 4 | echo Uninstalling packages of Radeon_Software_for_Linux group... 5 | if [[ $pkgs_installed != "" ]]; then 6 | echo Removing: $pkgs_installed 7 | sudo pacman -Rdd $pkgs_installed 8 | else 9 | echo Nothing to uninstall. 10 | fi 11 | 12 | # remove cached packages, because they will be considered as currupted after newly created will be added to repo 13 | echo Removing cached packages... 14 | for file in $(expac -S %f $(pacman -Sg Radeon_Software_for_Linux | cut -f2 -d " ")); do 15 | if [ -f /var/cache/pacman/pkg/$file ]; then 16 | echo $file: 17 | sudo rm -v /var/cache/pacman/pkg/$file 18 | fi 19 | done 20 | -------------------------------------------------------------------------------- /unpack_all_deb_packages.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script unpacks all deb packages (control and data). It is for simplifying operations of checking preinst scripts, making list of licenses hashes and so on. 4 | 5 | . ./versions 6 | FOLDER=amdgpu-pro-$pkgver_base-$pkgver_build-ubuntu-$ubuntu_ver 7 | mkdir $FOLDER 8 | cd $FOLDER 9 | 10 | # TODO: make it extract in parallel? # cat /tmp/links | parallel --gnu "wget {}" 11 | tmpdir=unpacked_debs; rm -rf "$tmpdir"; mkdir "$tmpdir"; 12 | # for file in $(ls *deb); 13 | for file in $(find ~/.aptly/public/pool/proprietary -name '*.deb'); 14 | do 15 | echo processing $file 16 | 17 | cd "$tmpdir"; mkdir $(basename $file); cd $(basename $file) 18 | ar x $file 19 | rm debian-binary 20 | tar -xf control.tar.xz; rm control.tar.xz; 21 | tar -xf data.tar.xz; rm data.tar.xz; 22 | 23 | find usr/share/doc -type f -name 'copyright' -exec mv {} . \; 24 | find usr/share/doc -type f -name "changelog.Debian.gz" -exec mv {} . \; 25 | 26 | find . -type d -empty -delete 27 | 28 | cd ../.. 29 | done 30 | -------------------------------------------------------------------------------- /update-amdgpu-dri-links-32.hook: -------------------------------------------------------------------------------- 1 | # f00d6adb58ed0b888cc28a3b83af9a30 libgl1-amdgpu-mesa-dri_18.3.0-812932_i386.deb/postinst 2 | # Converted for arch linux (hook trigger part): 3 | 4 | [Trigger] 5 | Type = File 6 | Operation = Install 7 | Operation = Upgrade 8 | Operation = Remove 9 | # Target path taken from interest trigger of a debian package, corrected for arch linux 10 | Target = usr/lib32/dri/* 11 | 12 | [Action] 13 | Description = Updating amdgpu dri links 32... 14 | When = PostTransaction 15 | Exec = . /usr/share/libalpm/scripts/update-amdgpu-dri-links-32; remove_links; create_links 16 | -------------------------------------------------------------------------------- /update-amdgpu-dri-links-32.script: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # f00d6adb58ed0b888cc28a3b83af9a30 libgl1-amdgpu-mesa-dri_18.3.0-812932_i386.deb/postinst 4 | # Converted for arch linux (hook script part): 5 | create_links() { 6 | for f in /opt/amdgpu/lib/i386-linux-gnu/dri/*_dri.so; do 7 | ln -sb $f /usr/lib32/dri 8 | done 9 | 10 | # Support I+A hybrid graphics 11 | if [ -f /usr/lib32/dri/i965_dri.so ] ; then # there also was && [ "/usr/lib32/dri" != "/opt/amdgpu/lib/x86_64-linux-gnu/dri" ] , but this will always be true due to they compare two strings. 12 | ln -s /usr/lib32/dri/i965_dri.so /opt/amdgpu/lib/i386-linux-gnu/dri 13 | fi 14 | } 15 | 16 | remove_links() { 17 | rm -f /opt/amdgpu/lib/i386-linux-gnu/dri/i965_dri.so 18 | 19 | for f in $(readlink -e /usr/lib32/dri/*.so); do 20 | if [ "${f%/*}" = "/opt/amdgpu/lib/i386-linux-gnu/dri" ]; then # I (Ashark) fixed ${f%%/*} -> ${f%/*} 21 | f=${f##*/} 22 | rm -f /usr/lib32/dri/$f 23 | if [ -f /usr/lib32/dri/$f~ ]; then 24 | mv -f /usr/lib32/dri/$f{~,} 25 | fi 26 | fi 27 | done 28 | } 29 | -------------------------------------------------------------------------------- /update-amdgpu-dri-links.hook: -------------------------------------------------------------------------------- 1 | # d92079d94c43be3c80dfdc3fc0221a71 libgl1-amdgpu-mesa-dri_18.3.0-812932_amd64.deb/postinst 2 | # Converted for arch linux (hook trigger part): 3 | 4 | [Trigger] 5 | Type = File 6 | Operation = Install 7 | Operation = Upgrade 8 | Operation = Remove 9 | # Target path taken from interest trigger of a debian package, corrected for arch linux 10 | Target = usr/lib/dri/* 11 | 12 | [Action] 13 | Description = Updating amdgpu dri links... 14 | When = PostTransaction 15 | Exec = . /usr/share/libalpm/scripts/update-amdgpu-dri-links; remove_links; create_links 16 | -------------------------------------------------------------------------------- /update-amdgpu-dri-links.script: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # d92079d94c43be3c80dfdc3fc0221a71 libgl1-amdgpu-mesa-dri_18.3.0-812932_amd64.deb/postinst 4 | # Converted for arch linux (hook script part): 5 | create_links() { 6 | for f in /opt/amdgpu/lib/x86_64-linux-gnu/dri/*_dri.so; do 7 | ln -sb $f /usr/lib/dri 8 | done 9 | 10 | # Support I+A hybrid graphics 11 | if [ -f /usr/lib/dri/i965_dri.so ] ; then # there also was && [ "/usr/lib/dri" != "/opt/amdgpu/lib/x86_64-linux-gnu/dri" ] , but this will always be true due to they compare two strings. 12 | ln -s /usr/lib/dri/i965_dri.so /opt/amdgpu/lib/x86_64-linux-gnu/dri 13 | fi 14 | } 15 | 16 | remove_links() { 17 | rm -f /opt/amdgpu/lib/x86_64-linux-gnu/dri/i965_dri.so 18 | 19 | for f in $(readlink -e /usr/lib/dri/*.so); do 20 | if [ "${f%/*}" = "/opt/amdgpu/lib/x86_64-linux-gnu/dri" ]; then # I (Ashark) fixed ${f%%/*} -> ${f%/*} 21 | f=${f##*/} 22 | rm -f /usr/lib/dri/$f 23 | if [ -f /usr/lib/dri/$f~ ]; then 24 | mv -f /usr/lib/dri/$f{~,} 25 | fi 26 | fi 27 | done 28 | } 29 | -------------------------------------------------------------------------------- /update-local-repo.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | all_pkgs_in_repo=$(pacman -Sl amdgpu-dev | cut -f2 -d" ") 4 | if [ "$all_pkgs_in_repo" != "" ]; then 5 | repo-remove amdgpu-dev.db.tar.gz $all_pkgs_in_repo 6 | fi 7 | echo "Removed all packages from repo" 8 | 9 | repo-add amdgpu-dev.db.tar.gz *.pkg.tar.zst 10 | 11 | sudo pacman -Sy 12 | -------------------------------------------------------------------------------- /versions: -------------------------------------------------------------------------------- 1 | # This file is interpreted by both python and bash 2 | 3 | pkgver_base="24.30" 4 | pkgver_build="2125449" 5 | ubuntu_ver="22.04" 6 | repo_folder_ver="6.3.4" 7 | 8 | # Old version is specified for use in extract_transaction_scripts_and_triggers.sh 9 | # I stopped checking transaction script and triggers, it seems it's rather safe to ignore that step. But if some day I want to check it again, I need to uncomment and fill in the old versions too. 10 | # old_pkgver_base="22.10.3" 11 | # old_pkgver_build="1420322" 12 | # old_ubuntu_ver="20.04" 13 | --------------------------------------------------------------------------------