diff options
author | Eli Schwartz | 2017-12-26 18:37:03 -0500 |
---|---|---|
committer | Eli Schwartz | 2017-12-26 18:37:03 -0500 |
commit | 41a698329f79e84e21cbe198683efdba4382783e (patch) | |
tree | 2ca2b907df33cb8a7237ab82a83df42243cefc0c | |
download | aur-41a698329f79e84e21cbe198683efdba4382783e.tar.gz |
Initial upload: glibc-git 2.26.r1039.g48a8f83281-1
This was originally authored by Earnestly, and has a very cool approach
to locale-gen. ;)
-rw-r--r-- | .SRCINFO | 29 | ||||
-rw-r--r-- | MKPKG | 3 | ||||
-rw-r--r-- | PKGBUILD | 126 | ||||
-rw-r--r-- | glibc-git.install | 4 | ||||
-rw-r--r-- | locale-gen | 24 |
5 files changed, 186 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..2b7978af9047 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,29 @@ +pkgbase = glibc-git + pkgdesc = GNU C Library, from git + pkgver = 2.26.r1039.g48a8f83281 + pkgrel = 1 + url = https://www.gnu.org/software/libc/ + install = glibc-git.install + arch = i686 + arch = x86_64 + groups = base + license = GPL + license = LGPL + makedepends = git + depends = linux-api-headers + depends = tzdata + depends = filesystem + optdepends = gd: graph image generation with memusage + provides = glibc=2.26 + conflicts = glibc + options = !strip + options = staticlibs + backup = etc/gai.conf + backup = etc/nscd.conf + source = git+https://sourceware.org/git/glibc.git + source = locale-gen + sha256sums = SKIP + sha256sums = 7e4a8d3fd37c67ec57b5e27575155d958628a92729098cf8a01ba9aba7078a80 + +pkgname = glibc-git + diff --git a/MKPKG b/MKPKG new file mode 100644 index 000000000000..59ac80b4b1c4 --- /dev/null +++ b/MKPKG @@ -0,0 +1,3 @@ +pkgname=(glibc-git glibc-git-debug) +chroot=(debug) +check_git glibc diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..13a27802ba87 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,126 @@ +# Maintainer: Eli Schwartz <eschwartz@archlinux.org> +# Contributor: Earnestly <zibeon@googlemail.com> + +# All my PKGBUILDs are managed at https://github.com/eli-schwartz/pkgbuilds + +pkgname=glibc-git +pkgver=2.26.r1039.g48a8f83281 +pkgrel=1 +pkgdesc='GNU C Library, from git' +arch=('i686' 'x86_64') +url='https://www.gnu.org/software/libc/' +license=('GPL' 'LGPL') +groups=('base') +depends=('linux-api-headers' 'tzdata' 'filesystem') +optdepends=('gd: graph image generation with memusage') +makedepends=('git') +# XXX Arch Linux's valgrind package requires an exact version +provides=("glibc=${pkgver%%.r*}") +conflicts=('glibc') +backup=('etc/gai.conf' 'etc/nscd.conf') +options=('!strip' 'staticlibs') +install='glibc-git.install' +source=('git+https://sourceware.org/git/glibc.git' + 'locale-gen') +sha256sums=('SKIP' + '7e4a8d3fd37c67ec57b5e27575155d958628a92729098cf8a01ba9aba7078a80') + +pkgver() { + cd glibc + # wtf is tag "glibc-2.26.9000" + git describe --exclude '*.*.9000' | sed 's/^glibc-//; s/-/.r/; s/-/./' +} + +prepare() { + rm -rf build + mkdir build +} + +build() { + cd build + + if [[ ${CARCH} = "i686" ]]; then + # Hack to fix NPTL issues with Xen, only required on 32bit platforms + export CFLAGS="${CFLAGS} -mno-tls-direct-seg-refs" + fi + + { printf 'slibdir=/usr/lib\n' + printf 'rtlddir=/usr/lib\n' + printf 'sbindir=/usr/bin\n' + printf 'rootsbindir=/usr/bin\n' + } >> configparms + + # remove fortify for building libraries + CPPFLAGS=${CPPFLAGS/-D_FORTIFY_SOURCE=2/} + + "$srcdir"/glibc/configure \ + --prefix=/usr \ + --libdir=/usr/lib \ + --libexecdir=/usr/lib \ + --with-headers=/usr/include \ + --with-bugurl=https://bugs.archlinux.org/ \ + --enable-add-ons \ + --enable-bind-now \ + --enable-lock-elision \ + --enable-multi-arch \ + --enable-obsolete-nsl \ + --enable-obsolete-rpc \ + --enable-stack-protector=strong \ + --enable-stackguard-randomization \ + --disable-profile \ + --disable-werror + + printf 'build-programs=no\n' >> configparms + make + + # Re-enable hardening for programs. + sed -i '/build-programs=/s/no/yes/' configparms + { printf 'CC += -D_FORTIFY_SOURCE=2\n' + printf 'CXX += -D_FORTIFY_SOURCE=2\n' + } >> configparms + make + +} + +check() { + cd build + + # Remove harding in preparation to run test-suite. + sed -i '/FORTIFY/d' configparms + make check || true +} + +package() { + make -C build install_root="$pkgdir" install + + install -dm0755 "$pkgdir"/usr/lib/locale + install -dm0755 "$pkgdir"/etc/locales + install -Dm0755 locale-gen "$pkgdir"/usr/bin/locale-gen + install -Dm0644 glibc/posix/gai.conf "$pkgdir"/etc/gai.conf + install -Dm0644 glibc/nscd/nscd.conf "$pkgdir"/etc/nscd.conf + install -Dm0644 glibc/nscd/nscd.tmpfiles "$pkgdir"/usr/lib/tmpfiles.d/nscd.conf + install -Dm0644 glibc/nscd/nscd.service "$pkgdir"/usr/lib/systemd/system/nscd.service + + # Only support UTF-8 charmaps. + find "$pkgdir"/usr/share/i18n/charmaps ! -name UTF-8.gz -type f -delete + + # We generate these in the post-install with ldconfig -r . + rm "$pkgdir"/etc/ld.so.cache + + if check_option 'debug' n; then + # I use 2> /dev/null for all of these due to many false-positives as it + # attempts to strip scripts or other unstrippable files. + find "$pkgdir"/usr/bin -type f -executable -exec strip $STRIP_BINARIES {} + 2> /dev/null || true + + # Do not strip these for gdb and valgrind functionality, but strip the + # rest. + find "$pkgdir"/usr/lib ! -name 'ld-*.so' \ + ! -name 'libc-*.so' \ + ! -name 'libpthread-*.so' \ + ! -name 'libthread_db-*.so' \ + -name '*-*.so' -type f -exec strip $STRIP_SHARED {} + 2> /dev/null || true + + # Strip the remaining static libraries. + find "$pkgdir"/usr/lib -name '*.a' -type f -exec strip $STRIP_STATIC {} + 2> /dev/null || true + fi +} diff --git a/glibc-git.install b/glibc-git.install new file mode 100644 index 000000000000..257530bb546e --- /dev/null +++ b/glibc-git.install @@ -0,0 +1,4 @@ +post_upgrade() { + locale-gen + ldconfig -r . +} diff --git a/locale-gen b/locale-gen new file mode 100644 index 000000000000..1bc79322b6e9 --- /dev/null +++ b/locale-gen @@ -0,0 +1,24 @@ +#!/bin/sh -- +# locale-gen: generate system locales + +if [ ! -d /etc/locales ]; then + printf '/etc/locales: no such directory\n' >&2 + exit 1 +fi + +for locale in /etc/locales/*; do + if [ -f "$locale" ]; then + locale=${locale##*/} + else + continue + fi + + printf '%s: generating locale\n' "$locale".UTF-8 >&2 + + localedef -i "$locale" -f UTF-8 -c "$locale".UTF-8 + + case $? in + 4) printf '%s: invalid locale\n' "$locale" >&2 ;; + 1) exit + esac +done |