summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a90e9a90046a177d77cdebbedb6cc48bb8403490 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
# Author: Janusz Lewandowski <lew21@xtreeme.org>
# Contributor: David McFarland <corngood@gmail.com>
# Maintainer: Andrew Shark <ashark @at@ linuxcomp.ru>
# Autogenerated from AMD's Packages file
# with https://github.com/Ashark/archlinux-amdgpu-pro/blob/master/gen-PKGBUILD.py

major=23.20
major_short=23.20
minor=1654522
ubuntu_ver=22.04
repo_folder_ver=5.7

pkgbase=amdgpu-pro-legacy
pkgname=(
amf-amdgpu-pro-legacy
amdgpu-pro-oglp-legacy
lib32-amdgpu-pro-oglp-legacy
vulkan-amdgpu-pro-legacy
lib32-vulkan-amdgpu-pro-legacy
)
pkgver=${major}_${minor}
pkgrel=1
arch=('x86_64')
url=https://www.amd.com/en/support/kb/release-notes/rn-amdgpu-unified-linux-23.20
license=('custom: multiple')
groups=('Radeon_Software_for_Linux')

source=(progl::https://raw.githubusercontent.com/Ashark/archlinux-amdgpu-pro/master/progl
	progl.bash-completion::https://raw.githubusercontent.com/Ashark/archlinux-amdgpu-pro/master/progl.bash-completion
	https://repo.radeon.com/amdgpu/${repo_folder_ver}/ubuntu/pool/proprietary/a/amf-amdgpu-pro/amf-amdgpu-pro_1.4.31-${minor}.${ubuntu_ver}_amd64.deb
	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
	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
	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
	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
	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
	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
	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
	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
	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
	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
	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
	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
	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
	https://repo.radeon.com/amdgpu/5.7.3/ubuntu/pool/proprietary/v/vulkan-amdgpu-pro/vulkan-amdgpu-pro_23.30-1697785.${ubuntu_ver}_i386.deb
	https://repo.radeon.com/amdgpu/5.7.3/ubuntu/pool/proprietary/v/vulkan-amdgpu-pro/vulkan-amdgpu-pro_23.30-1697785.${ubuntu_ver}_amd64.deb)
sha256sums=(feb74796c3152cbafaba89d96e68a152f209bd3058c7eb0413cbe1ab0764e96f
e32801c38b475cd8df17a407726b86db3de26410f563d688325b4d4314fc5354
6486b32a80f9243996b24917ac7cb8a6cea78f280ca94604d96b28c530e82aa2
6c1a74a635b2de70850cc831638cc63176a8abb5d6811d23888a367432fa2b63
6b142ad1319141660e73305a13c866a7924064681263dcc8424fd402f3b8f830
49794cfd3d2b1226365b19882da4237626da7fe7157b51b560f83b5eb75b2a52
be25a5fe4efeb91066ec345613e373193b7cd3db22201045f34cbd1d7f47b2ba
54754f38b1f6306d4863439263c1b09ca183c948ddce63230d0b83636ec45d05
57244d45f35d89823b2fe3c55386d8dd3233478802f9e6359be460cb5d6a8239
d659cedd625b6c16ee3d26c7f825aa1769243e43b666afd73214bbcb3429a485
f774d763a53fcfec605214c4058a653d26c6fb479457260a0781aee8af9b8708
010bb70ef8353fbb12a614857e8b4778de3150b6c18ddff5e270d03029eb47e6
8b1a6066d8a8d0a08ff5abf1998be223caa24cb5f1203185d85a93ba8e727fef
b96b60631c11aea3a0b599fdbedcc9ad77db3161cf071daeccb763db2807a0e7
c5e6aec8fd970dbc2bdcd5504abc3db3ef8bdaa9666b66542151e30d83cccd3a
282117b91ff682b4a0a04e448aaa6d371f6c0f9f15efa0d1378c6af007df55c9
0917adb9be8e0f471ca94a1bf35c511731f24741164cd1077d5126b80ef7b97f
100f41d2937e9b9244f41c722c56615e641fe6fe9c8040c1a0e606b07421a09b)



# extracts a debian package
# $1: deb file to extract
extract_deb() {
    local tmpdir="$(basename "${1%.deb}")"
    rm -Rf "$tmpdir"
    mkdir "$tmpdir"
    cd "$tmpdir"
    ar x "$1"
    tar -C "${pkgdir}" -xf data.tar.xz
}
# move ubuntu specific /usr/lib/x86_64-linux-gnu to /usr/lib
# $1: debian package library dir (goes from opt/amdgpu or opt/amdgpu-pro and from x86_64 or i386)
# $2: arch package library dir (goes to usr/lib or usr/lib32)
move_libdir() {
    local deb_libdir="$1"
    local arch_libdir="$2"

    if [ -d "${pkgdir}/${deb_libdir}" ]; then
        if [ ! -d "${pkgdir}/${arch_libdir}" ]; then
            mkdir -p "${pkgdir}/${arch_libdir}"
        fi
        mv -t "${pkgdir}/${arch_libdir}/" "${pkgdir}/${deb_libdir}"/*
        find ${pkgdir} -type d -empty -delete
    fi
}
# move copyright file to proper place and remove debian changelog
move_copyright() {
    find ${pkgdir}/usr/share/doc -name "changelog.Debian.gz" -delete
    mkdir -p ${pkgdir}/usr/share/licenses/${pkgname}
    find ${pkgdir}/usr/share/doc -name "copyright" -exec mv {} ${pkgdir}/usr/share/licenses/${pkgname} \;
    find ${pkgdir}/usr/share/doc -type d -empty -delete
}

package_amf-amdgpu-pro-legacy () {
    pkgdesc="AMDGPU Pro Advanced Multimedia Framework with latest RX 4xx/5xx/VEGA supports."
    license=('custom: AMDGPU-PRO EULA')
    depends=("libdrm" "vulkan-amdgpu-pro=${major}_${minor}-${pkgrel}")
    optdepends=("rocm-opencl-runtime: Warning unspecified optdep description")

    extract_deb "${srcdir}"/amf-amdgpu-pro_1.4.31-${minor}.${ubuntu_ver}_amd64.deb
    extract_deb "${srcdir}"/libamdenc-amdgpu-pro_1.0-${minor}.${ubuntu_ver}_amd64.deb
    move_libdir "opt/amdgpu-pro/lib/x86_64-linux-gnu" "usr/lib"
    move_copyright
}

package_amdgpu-pro-oglp-legacy () {
    pkgdesc="AMDGPU Pro OpenGL driver with latest RX 4xx/5xx/VEGA supports."
    license=('custom: AMDGPU-PRO EULA')
    provides=('libgl')
    depends=("libdrm" "libglvnd" "libx11")

    extract_deb "${srcdir}"/libegl1-amdgpu-pro-oglp_${major_short}-${minor}.${ubuntu_ver}_amd64.deb
    extract_deb "${srcdir}"/libgl1-amdgpu-pro-oglp-dri_${major_short}-${minor}.${ubuntu_ver}_amd64.deb
    extract_deb "${srcdir}"/libgl1-amdgpu-pro-oglp-ext_${major_short}-${minor}.${ubuntu_ver}_amd64.deb
    extract_deb "${srcdir}"/libgl1-amdgpu-pro-oglp-gbm_${major_short}-${minor}.${ubuntu_ver}_amd64.deb
    extract_deb "${srcdir}"/libgl1-amdgpu-pro-oglp-glx_${major_short}-${minor}.${ubuntu_ver}_amd64.deb
    extract_deb "${srcdir}"/libgles1-amdgpu-pro-oglp_${major_short}-${minor}.${ubuntu_ver}_amd64.deb
    extract_deb "${srcdir}"/libgles2-amdgpu-pro-oglp_${major_short}-${minor}.${ubuntu_ver}_amd64.deb
    move_libdir "opt/amdgpu-pro/lib/x86_64-linux-gnu" "usr/lib"
    move_copyright

    # extra_commands:
    move_libdir "usr/lib/x86_64-linux-gnu" "usr/lib"
    move_libdir "opt/amdgpu-pro/lib/x86_64-linux-gnu" "usr/lib/amdgpu-pro"
    move_libdir "opt/amdgpu-pro/lib/xorg" "usr/lib/amdgpu-pro/xorg"
    move_libdir "opt/amdgpu/share/drirc.d" "usr/share/drirc.d"
    install -Dm755 "${srcdir}"/progl "${pkgdir}"/usr/bin/progl
    install -Dm644 "${srcdir}"/progl.bash-completion "${pkgdir}"/usr/share/bash-completion/completions/progl
    # 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.
    mv "${pkgdir}"/usr/share/drirc.d/10-amdgpu-pro.conf "${pkgdir}"/usr/share/drirc.d/10-amdgpu-pro.conf.hide
    # For some reason, libs no more moved to the pro folder. Do it manually.
    mv -v -t "${pkgdir}/usr/lib/amdgpu-pro" "${pkgdir}/usr/lib/lib"*
}

package_lib32-amdgpu-pro-oglp-legacy () {
    pkgdesc="AMDGPU Pro OpenGL driver (32-bit) with latest RX 4xx/5xx/VEGA supports."
    license=('custom: AMDGPU-PRO EULA')
    provides=('lib32-libgl')
    depends=("lib32-libx11")

    extract_deb "${srcdir}"/libegl1-amdgpu-pro-oglp_${major_short}-${minor}.${ubuntu_ver}_i386.deb
    extract_deb "${srcdir}"/libgl1-amdgpu-pro-oglp-dri_${major_short}-${minor}.${ubuntu_ver}_i386.deb
    extract_deb "${srcdir}"/libgl1-amdgpu-pro-oglp-glx_${major_short}-${minor}.${ubuntu_ver}_i386.deb
    extract_deb "${srcdir}"/libgles1-amdgpu-pro-oglp_${major_short}-${minor}.${ubuntu_ver}_i386.deb
    extract_deb "${srcdir}"/libgles2-amdgpu-pro-oglp_${major_short}-${minor}.${ubuntu_ver}_i386.deb
    move_libdir "opt/amdgpu-pro/lib/i386-linux-gnu" "usr/lib32"
    move_copyright

    # extra_commands:
    rm "${pkgdir}"/opt/amdgpu/share/drirc.d/10-amdgpu-pro.conf
    move_libdir "usr/lib/i386-linux-gnu" "usr/lib32"
    move_libdir "opt/amdgpu-pro/lib/i386-linux-gnu" "usr/lib32/amdgpu-pro"
    # For some reason, libs no more moved to the pro folder. Do it manually.
    mkdir "${pkgdir}/usr/lib32/amdgpu-pro"
    mv -v -t "${pkgdir}/usr/lib32/amdgpu-pro" "${pkgdir}/usr/lib32/lib"*
}

package_vulkan-amdgpu-pro-legacy () {
    pkgdesc="AMDGPU Pro Vulkan driver with latest RX 4xx/5xx/VEGA supports."
    license=('custom: AMDGPU-PRO EULA')
    provides=('vulkan-driver')
    depends=("vulkan-icd-loader" "wayland" "zlib")
    optdepends=("openssl-1.1: Warning unspecified optdep description")

    extract_deb "${srcdir}"/vulkan-amdgpu-pro_23.30-1697785.${ubuntu_ver}_amd64.deb
    move_libdir "opt/amdgpu-pro/lib/x86_64-linux-gnu" "usr/lib"
    move_copyright

    # extra_commands:
    mkdir -p "${pkgdir}"/usr/share/vulkan/icd.d/
    mv "${pkgdir}"/opt/amdgpu-pro/etc/vulkan/icd.d/amd_icd64.json "${pkgdir}"/usr/share/vulkan/icd.d/amd_pro_icd64.json
    mv "${pkgdir}"/usr/lib/amdvlk64.so "${pkgdir}"/usr/lib/amdvlkpro64.so
    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
    find ${pkgdir} -type d -empty -delete
}

package_lib32-vulkan-amdgpu-pro-legacy () {
    pkgdesc="AMDGPU Pro Vulkan driver (32-bit) with latest RX 4xx/5xx/VEGA supports."
    license=('custom: AMDGPU-PRO EULA')
    provides=('lib32-vulkan-driver')
    depends=("lib32-vulkan-icd-loader" "lib32-wayland" "lib32-zlib")
    optdepends=("lib32-openssl-1.1: Warning unspecified optdep description")

    extract_deb "${srcdir}"/vulkan-amdgpu-pro_23.30-1697785.${ubuntu_ver}_i386.deb
    move_libdir "opt/amdgpu-pro/lib/i386-linux-gnu" "usr/lib32"
    move_copyright

    # extra_commands:
    mkdir -p "${pkgdir}"/usr/share/vulkan/icd.d/
    mv "${pkgdir}"/opt/amdgpu-pro/etc/vulkan/icd.d/amd_icd32.json "${pkgdir}"/usr/share/vulkan/icd.d/amd_pro_icd32.json
    mv "${pkgdir}"/usr/lib32/amdvlk32.so "${pkgdir}"/usr/lib32/amdvlkpro32.so
    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
    find ${pkgdir} -type d -empty -delete
}