summarylogtreecommitdiffstats
path: root/gen-PKGBUILD.py
diff options
context:
space:
mode:
authorDavid McFarland2016-06-29 23:29:01 -0300
committerDavid McFarland2016-06-29 23:29:21 -0300
commitb9489951b2b01850cc7167b134bd626e8c7a6d6d (patch)
tree32e7006f5253d85edfc1ba75d5f73ffe9f9922db /gen-PKGBUILD.py
parent278cdb07c1dbe972c82f2785415bd08775a8a49f (diff)
downloadaur-b9489951b2b01850cc7167b134bd626e8c7a6d6d.tar.gz
update to 16.30.3.306809
Diffstat (limited to 'gen-PKGBUILD.py')
-rw-r--r--gen-PKGBUILD.py178
1 files changed, 0 insertions, 178 deletions
diff --git a/gen-PKGBUILD.py b/gen-PKGBUILD.py
deleted file mode 100644
index 713f76eab4a..00000000000
--- a/gen-PKGBUILD.py
+++ /dev/null
@@ -1,178 +0,0 @@
-from debian import deb822
-import re
-import gzip
-
-header_tpl = """# Maintainer: Janusz Lewandowski <lew21@xtreeme.org>
-# Autogenerated from AMD's Packages file
-
-pkgver_base=16.20.3
-pkgver_build=294842
-
-pkgbase=amdgpu-pro-installer
-pkgname={PACKAGES}
-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_base}}-${{pkgver_build}}.tar.xz)
-sha256sums=('4a2988f5047e858c3c6ae22528162b2537780deeaf5dda5d8a8f61e213058a66')
-"""
-
-package_header_tpl = """
-package_{NAME} () {{
- pkgdesc={DESC}
- depends={DEPENDS}
- arch=('{ARCH}')
-
- rm -Rf "${{srcdir}}"/{Package}_{Version}_{Architecture}
- mkdir "${{srcdir}}"/{Package}_{Version}_{Architecture}
- cd "${{srcdir}}"/{Package}_{Version}_{Architecture}
- ar x "${{srcdir}}"/amdgpu-pro-driver/{Filename}
- tar -C "${{pkgdir}}" -xf data.tar.xz
-"""
-
-package_footer = """}
-"""
-
-special_ops = {
- "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 = {
- "libc6": None,
- "libgcc1": None,
- "libstdc++6": None,
- "libx11-6": "libx11",
- "libx11-xcb1": None,
- "libxcb-dri2-0": "libxcb",
- "libxcb-dri3-0": "libxcb",
- "libxcb-present0": "libxcb",
- "libxcb-sync1": "libxcb",
- "libxcb-glx0": "libxcb",
- "libxcb1": "libxcb",
- "libxext6": "libxext",
- "libxshmfence1": "libxshmfence",
- "libxdamage1": "libxdamage",
- "libxfixes3": "libxfixes",
- "libxxf86vm1": "libxxf86vm",
- "libudev1": "libsystemd",
- "libpciaccess0": "libpciaccess",
- "libepoxy0": "libepoxy",
- "libelf1": None, # no lib32- package in Arch, just disabling for now
- "xserver-xorg-core": "xorg-server",
- "libcunit1": "cunit",
- "libdrm-radeon1": "libdrm",
- "amdgpu-pro-firmware": "linux-firmware",
- "libssl1.0.0": "openssl",
- "zlib1g": "zlib",
-}
-
-dependency = re.compile(r"([^ ]+)(?: \((.+)\))?")
-
-arch_map = {
- "amd64": "x86_64",
- "i386": "i686",
- "all": "any"
-}
-
-deb_archs={}
-
-def quote(string):
- return "\"" + string.replace("\\", "\\\\").replace("\"", "\\\"") + "\""
-
-def convertName(name):
- if info["Architecture"] == "i386" and (name not in deb_archs or "any" not in deb_archs[name]):
- return "lib32-" + name
- return name
-
-def convertVersionSpecifier(name, spec, names):
- if name == "linux-firmware":
- return ""
- if name in names:
- return ""
- if not spec:
- return ""
-
- sign, spec = spec.split(" ", 1)
-
- spec = spec.strip()
- if ":" in spec:
- whatever, spec = spec.rsplit(":", 1)
- return sign + spec
-
-def convertPackage(info, names):
- if info["Architecture"] == "i386":
- name = "lib32-" + info["Package"]
- arch = "x86_64"
- else:
- name = info["Package"]
- arch = arch_map[info["Architecture"]]
-
- try:
- deps = info["Depends"].split(", ")
- except:
- deps = []
-
- 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(name, version, names) + "'" for name, version in deps if name]
- deps2 = []
- for dep in deps:
- if not dep in deps2:
- deps2.append(dep)
- deps = "(" + " ".join(deps2) + ")"
-
- special_op = special_ops[info["Package"]] if info["Package"] in special_ops else ""
-
- desc = info["Description"].split("\n")
- if len(desc) > 2:
- desc = desc[0]
- else:
- desc = " ".join(x.strip() for x in desc)
-
- ret = package_header_tpl.format(DEPENDS=deps, NAME=name, ARCH=arch, DESC=quote(desc), **info)
- if special_op:
- ret += special_op + "\n"
- if info["Architecture"] == "i386":
- ret += "\trm -Rf ${pkgdir}/usr/share/doc ${pkgdir}/usr/include\n"
- ret += package_footer
-
- return ret
-
-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
-
- if not info["Package"] in deb_archs:
- deb_archs[info["Package"]] = set()
-
- deb_archs[info["Package"]].add(info["Architecture"])
-
- package_list.append(info)
-
- names = ["lib32-" + info["Package"] if info["Architecture"] == "i386" else info["Package"] for info in package_list]
-
- print(header_tpl.format(PACKAGES="(" + " ".join(names) + ")"))
-
- f.seek(0)
-
- for info in package_list:
- print(convertPackage(info, names))
-