summarylogtreecommitdiffstats
path: root/gen-PKGBUILD.py
diff options
context:
space:
mode:
authorDavid McFarland2016-05-17 23:25:31 -0300
committerDavid McFarland2016-05-18 00:34:54 -0300
commit41464be3cc5b9e0cf4c292c994abe2b58afbfc3c (patch)
tree11cd43ea83a697bc64f3d5c72af9d7cf75213b04 /gen-PKGBUILD.py
parent6eed4701b02b819d19f09f5b14227155f5c7cba8 (diff)
downloadaur-41464be3cc5b9e0cf4c292c994abe2b58afbfc3c.tar.gz
Fix a few problems I had getting this running
default to xorg 1.18 driver add modprobe conf add ld conf and run ldconfig on install remove firmwares remove upstream version from pkgrel remove conflicting docs and includes from lib32 packages
Diffstat (limited to 'gen-PKGBUILD.py')
-rw-r--r--gen-PKGBUILD.py55
1 files changed, 34 insertions, 21 deletions
diff --git a/gen-PKGBUILD.py b/gen-PKGBUILD.py
index 03eaba8dbdd..9d62318a947 100644
--- a/gen-PKGBUILD.py
+++ b/gen-PKGBUILD.py
@@ -6,17 +6,20 @@ header_tpl = """# Maintainer: Janusz Lewandowski <lew21@xtreeme.org>
# Autogenerated from AMD's Packages file
# with https://github.com/LEW21/archlinux-amdgpu/blob/master/gen-PKGBUILD.py
+pkgver_base=16.15.2
+pkgver_build=277429
+
pkgbase=amdgpu-pro-installer
pkgname={PACKAGES}
-pkgver=16.15.2
-pkgrel=277429
+pkgver=${{pkgver_base}}.${{pkgver_build}}
+pkgrel=1
arch=('x86_64')
url="http://www.amd.com"
url_ref="http://support.amd.com/en-us/kb-articles/Pages/AMDGPU-PRO-Beta-Driver-for-Vulkan-Release-Notes.aspx"
DLAGENTS="https::/usr/bin/curl --referer ${{url_ref}} -o %o %u"
-source=(https://www2.ati.com/drivers/beta/amdgpu-pro_${{pkgver}}-277429.tar.xz)
+source=(https://www2.ati.com/drivers/beta/amdgpu-pro_${{pkgver_base}}-${{pkgver_build}}.tar.xz)
sha256sums=('e857cc74959706c276328b5876dfeba7d1ec0cbfacf966b607c50a748f7f5233')
"""
@@ -37,8 +40,15 @@ package_footer = """}
"""
special_ops = {
- "amdgpu-pro-firmware": "mv ${pkgdir}/lib ${pkgdir}/usr/",
- "amdgpu-pro-core": "mv ${pkgdir}/lib ${pkgdir}/usr/",
+ "amdgpu-pro-core": """
+ mv ${pkgdir}/lib ${pkgdir}/usr/
+ mkdir -p ${pkgdir}/etc/ld.so.conf.d/
+ ln -s /usr/lib/amdgpu-pro/ld.conf ${pkgdir}/etc/ld.so.conf.d/10-amdgpu-pro.conf
+ mkdir -p ${pkgdir}/etc/modprobe.d/
+ ln -s /usr/lib/amdgpu-pro/modprobe.conf ${pkgdir}/etc/modprobe.d/amdgpu-pro.conf
+ install=amdgpu-pro-core.install
+""",
+ "xserver-xorg-video-amdgpu-pro": "\tln -sfn 1.18 ${pkgdir}/usr/lib/x86_64-linux-gnu/amdgpu-pro/xorg",
}
replace_deps = {
@@ -65,6 +75,7 @@ replace_deps = {
"xserver-xorg-core": "xorg-server",
"libcunit1": "cunit",
"libdrm-radeon1": "libdrm",
+ "amdgpu-pro-firmware": "linux-firmware",
}
dependency = re.compile(r"([^ ]+)(?: \((.+)\))?")
@@ -89,7 +100,11 @@ def convertName(name):
return "lib32-" + name
return name
-def convertVersionSpecifier(spec):
+def convertVersionSpecifier(name, spec, names):
+ if name == "linux-firmware":
+ return ""
+ if name in names:
+ return ""
if not spec:
return ""
@@ -100,7 +115,7 @@ def convertVersionSpecifier(spec):
whatever, spec = spec.rsplit(":", 1)
return sign + spec
-def convertPackage(info):
+def convertPackage(info, names):
if info["Architecture"] == "i386":
name = "lib32-" + info["Package"]
arch = "x86_64"
@@ -115,7 +130,7 @@ def convertPackage(info):
deps = [dependency.match(dep).groups() for dep in deps]
deps = [(replace_deps[name] if name in replace_deps else name, version) for name, version in deps]
- deps = ["'" + convertName(name) + convertVersionSpecifier(version) + "'" for name, version in deps if name]
+ deps = ["'" + convertName(name) + convertVersionSpecifier(name, version, names) + "'" for name, version in deps if name]
deps2 = []
for dep in deps:
if not dep in deps2:
@@ -130,9 +145,11 @@ def convertPackage(info):
else:
desc = " ".join(x.strip() for x in desc)
- ret = package_header_tpl.format(DEPENDS=deps, NAME=name, ARCH=arch, SPECIAL_OPS=special_op, DESC=quote(desc), **info)
+ ret = package_header_tpl.format(DEPENDS=deps, NAME=name, ARCH=arch, DESC=quote(desc), **info)
if special_op:
- ret += "\n\t" + special_op + "\n"
+ ret += special_op + "\n"
+ if info["Architecture"] == "i386":
+ ret += "\trm -Rf ${pkgdir}/usr/share/doc ${pkgdir}/usr/include\n"
ret += package_footer
return ret
@@ -141,6 +158,8 @@ with gzip.open("src/amdgpu-pro-driver/Packages.gz", "r") as f:
package_list=[]
for info in deb822.Packages.iter_paragraphs(f):
+ if info["Package"] == "amdgpu-pro-firmware":
+ continue
if info["Filename"].startswith("./dkms/dst/amdgpu-pro/"):
continue
@@ -149,20 +168,14 @@ with gzip.open("src/amdgpu-pro-driver/Packages.gz", "r") as f:
deb_archs[info["Package"]].add(info["Architecture"])
- if info["Architecture"] == "i386":
- name = "lib32-" + info["Package"]
- else:
- name = info["Package"]
+ package_list.append(info)
- package_list.append(name)
+ names = ["lib32-" + info["Package"] if info["Architecture"] == "i386" else info["Package"] for info in package_list]
- print(header_tpl.format(PACKAGES="(" + " ".join(package_list) + ")"))
+ print(header_tpl.format(PACKAGES="(" + " ".join(names) + ")"))
f.seek(0)
- for info in deb822.Packages.iter_paragraphs(f):
- if info["Filename"].startswith("./dkms/dst/amdgpu-pro/"):
- continue
-
- print(convertPackage(info))
+ for info in package_list:
+ print(convertPackage(info, names))