aboutsummaryrefslogtreecommitdiff
path: root/glibc-source/PKGBUILD
blob: db7bb780f0df476fcc13c948371e27f3a4aac713 (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
# Contributor: Wojtek Kosior <kwojtus@protonmail.com>

# Loosely based on Hyperbola's glibc package

pkgname=glibc-source
pkgver=2.25
_debrel=3
pkgrel=1
pkgdesc="Source of the GNU C Library"
arch=('any')
url="https://www.gnu.org/software/libc"
license=('GPL-2' 'LGPL-2.1')
depends=('quilt')
source=(https://ftp.gnu.org/gnu/glibc/glibc-$pkgver.tar.bz2{,.sig}
	#https://deb.debian.org/debian/pool/main/g/glibc/glibc_$pkgver-$_debrel.debian.tar.xz # got removed from there
	https://launchpad.net/debian/+archive/primary/+sourcefiles/glibc/${pkgver}-${_debrel}/glibc_${pkgver}-${_debrel}.debian.tar.xz)
validpgpkeys=('BC7C7372637EC10C57D7AA6579C43DFBF1CF2187') # Siddhesh Poyarekar <siddhesh@gotplt.org>
sha512sums=('bb6c1b2deaf9c117ef5c19efdef587c5c9d4da9380066eaa85917b20cf1cb4df1406f612bb7f9482410275676916613d05a52a573eb14758eeea152e64fcdbe2'
            'SKIP'
            '7815c2adfa3751d8c95f09158ee486021f24d7c943d0c4388009cc3519c997b4a9ec1600b6c525372ae7a1e01787fb4c8faf90e1e525aa4aa2c099796c577ff9')

noextract=(glibc-$pkgver.tar.bz2)

# Many patches fail to apply and there're also unneeded files (e.g. README)
_undesired_patch_files=(debian/patches/all/local-remove-manual.diff
			debian/patches/any/local-bindresvport_blacklist.diff
			debian/patches/any/local-bits-sigstack.diff
			debian/patches/any/local-bootstrap-headers.diff
			debian/patches/any/local-disable-libnss-db.diff
			debian/patches/any/local-dynamic-resolvconf.diff
			debian/patches/any/local-ld-multiarch.diff
			debian/patches/any/local-ldconfig-fsync.diff
			debian/patches/any/local-ldconfig-ignore-ld.so.diff
			debian/patches/any/local-ldconfig-multiarch.diff
			debian/patches/any/local-ldconfig.diff
			debian/patches/any/local-ldso-disable-hwcap.diff
			debian/patches/any/local-libgcc-compat-abilists.diff
			debian/patches/any/local-libgcc-compat-main.diff
			debian/patches/any/local-libgcc-compat-ports.diff
			debian/patches/any/local-libpic.diff
			debian/patches/any/local-nss-upgrade.diff
			debian/patches/any/local-rtlddir-cross.diff
			debian/patches/any/local-tcsetaddr.diff
			debian/patches/any/submitted-bits-fcntl_h-at.diff
			debian/patches/any/submitted-intl-tstgettext.diff
			debian/patches/any/submitted-ldconfig-c-collation.diff
			debian/patches/any/unsubmitted-ldso-machine-mismatch.diff
			debian/patches/README
			debian/patches/series.hurd-i386
			debian/patches/series.kfreebsd-i386
			debian/patches/series.kfreebsd-amd64)

prepare() {
    cd "${srcdir}"
    
    rm -v ${_undesired_patch_files[@]}
    # some hurd and kfreebsd changes cause problems, remove whole directories
    rm -rv debian/patches/{hurd-i386,kfreebsd}/
    
    # Patches and 'series' file will go to /usr/src/glibc/debian_patches.
    # We're not interested in rest of the stuff in debian/.
    
    # here we create script to be used for unpacking glibc sources we'll install

    echo "\
#!/bin/sh

mkdir -p \"\$1\" && cd \"\$1\"

bsdtar -xf /usr/src/glibc/glibc-${pkgver}.tar.bz2

export QUILT_PATCHES=/usr/src/glibc/debian_patches
export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index'	
export QUILT_DIFF_ARGS='--no-timestamps'

cd glibc-${pkgver}

quilt push -av
rm -r .pc/" > prepare-glibc-source
}

package() {
    install -m755 -d "${pkgdir}/usr/src/glibc/debian_patches"

    # install patches
    # I should have probably used install instead of cp, but don't know how to do that concisely. Don't want to bother reading find manual, either.
    cp -R "${srcdir}/debian/patches/"* "${pkgdir}/usr/src/glibc/debian_patches/"
    
    # install tarballs
    install -m644 "${srcdir}/glibc-$pkgver.tar.bz2" "${pkgdir}/usr/src/glibc"

    # install our script
    install -m755 -d "${pkgdir}/usr/bin"
    install -m755 "${srcdir}/prepare-glibc-source" "${pkgdir}/usr/bin"
}