summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d23b2b1b1c61f7409d2357796aaa19334b44f2ef (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
# Maintainer: envolution
pkgname=clang17-bin
pkgver=17.0.6
pkgrel=18
pkgdesc="C, C++ and Objective-C compiler - sourced from Debian sid"
arch=(x86_64)
options=(!strip)
provides=("clang=${pkgver}" clang17)
depends=(patchelf libedit z3)
url="https://www.llvm.org/"
license=('Apache-2.0-LLVM-Exception')
_packages=(
    clang-17
    libclang1-17t64
    libclang-common-17-dev
    libclang-cpp17t64
    libllvm17t64
    llvm-17-linker-tools
)
source=(
    ${_packages[0]}-${pkgver}-${pkgrel}.deb::http://deb.debian.org/debian/pool/main/l/llvm-toolchain-17/${_packages[0]}_${pkgver}-${pkgrel}_amd64.deb
    ${_packages[1]}-${pkgver}-${pkgrel}.deb::http://deb.debian.org/debian/pool/main/l/llvm-toolchain-17/${_packages[1]}_${pkgver}-${pkgrel}_amd64.deb
    ${_packages[2]}-${pkgver}-${pkgrel}.deb::http://deb.debian.org/debian/pool/main/l/llvm-toolchain-17/${_packages[2]}_${pkgver}-${pkgrel}_amd64.deb
    ${_packages[3]}-${pkgver}-${pkgrel}.deb::http://deb.debian.org/debian/pool/main/l/llvm-toolchain-17/${_packages[3]}_${pkgver}-${pkgrel}_amd64.deb
    ${_packages[4]}-${pkgver}-${pkgrel}.deb::http://deb.debian.org/debian/pool/main/l/llvm-toolchain-17/${_packages[4]}_${pkgver}-${pkgrel}_amd64.deb
    ${_packages[5]}-${pkgver}-${pkgrel}.deb::http://deb.debian.org/debian/pool/main/l/llvm-toolchain-17/${_packages[5]}_${pkgver}-${pkgrel}_amd64.deb
)
noextract=(
    ${_packages[0]}-${pkgver}-${pkgrel}.deb
    ${_packages[1]}-${pkgver}-${pkgrel}.deb
    ${_packages[2]}-${pkgver}-${pkgrel}.deb
    ${_packages[3]}-${pkgver}-${pkgrel}.deb
    ${_packages[4]}-${pkgver}-${pkgrel}.deb
    ${_packages[5]}-${pkgver}-${pkgrel}.deb
)
sha256sums=('de7aed46e704d46e46ca02ac8ed2f111338993d7c6b02dde23d8621bd3b13900'
            'ec49ef1945b9b6a2b1fe978544af09705a05036b283036a3aaba01dc12908969'
            '86f5e4dfc41055ea3c8d5fe5d4c60dbb9512a854ae9caca198f491a05e9590df'
            'f17e493249e614d5f5db11c60690eefa366f5efbc28d75640a311a570a16ace1'
            '55f9668899c968e790412f1e0a014ae2d9e8beba7f0611841093859064cbe4dc'
            '78c11daa6465b688bd27e7d4489cd732352a80ecc27f521e318b7a8d1ab8a328')

package() {
    bsdtar -xOf "${_packages[0]}-${pkgver}-${pkgrel}.deb" data.tar.xz | bsdtar -xJf - -C "${pkgdir}"
    bsdtar -xOf "${_packages[1]}-${pkgver}-${pkgrel}.deb" data.tar.xz | bsdtar -xJf - -C "${pkgdir}"
    bsdtar -xOf "${_packages[2]}-${pkgver}-${pkgrel}.deb" data.tar.xz | bsdtar -xJf - -C "${pkgdir}"
    bsdtar -xOf "${_packages[3]}-${pkgver}-${pkgrel}.deb" data.tar.xz | bsdtar -xJf - -C "${pkgdir}"
    bsdtar -xOf "${_packages[4]}-${pkgver}-${pkgrel}.deb" data.tar.xz | bsdtar -xJf - -C "${pkgdir}"
    bsdtar -xOf "${_packages[5]}-${pkgver}-${pkgrel}.deb" data.tar.xz | bsdtar -xJf - -C "${pkgdir}"

    mv "${pkgdir}"/usr/lib/x86_64-linux-gnu/* "${pkgdir}"/usr/lib/
    rmdir "${pkgdir}"/usr/lib/x86_64-linux-gnu
    patchelf --add-rpath /usr/lib/llvm-17/lib "${pkgdir}/usr/bin/clang"*
    ln -s /usr/lib/libz3.so "${pkgdir}"/usr/lib/llvm-17/lib/libz3.so.4
    ln -s /usr/lib/libedit.so "${pkgdir}"/usr/lib/llvm-17/lib/libedit.so.2
    install -Dm644 ${pkgdir}/usr/share/doc/${_packages[0]}/copyright "${pkgdir}"/usr/share/licenses/${_packages[0]}/LICENSE
}