summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: fb785a4639d602e17c7f60a9ac4f5448089eb861 (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
# Maintainer:

# This package syncs with core/glibc on rebuild.

pkgver=2.40+r16+gaa533d58ff
pkgrel=2

## options
: ${_build_roco=true}

# delete old package
_file="glibc-main.tar.gz"
if [ -e "$_file" ]; then
  find . -maxdepth 0 -mtime +1 -type f -name "$_file" -delete
fi

# sync with core/glibc
if [ ! -e "$_file" ]; then
  curl --no-clobber -o "$_file" "https://gitlab.archlinux.org/archlinux/packaging/packages/glibc/-/archive/main/glibc-main.tar.gz"

  # unpack files
  rm -rf arch-glibc
  mkdir -p arch-glibc
  bsdtar -C arch-glibc --strip-components 1 -xf "$_file"

  # copy files
  _glibc_files=(
    $(grep -E '(source|install) = ' arch-glibc/.SRCINFO | grep -v http | sed 's&^.* = &&')
  )

  for i in ${_glibc_files[@]}; do
    rm -f "$i"
    cp arch-glibc/"$i" "$i"
  done
fi

# fixups
sed -E -e 's&^(pkgver=.*)$&_\1&' \
  -e 's&^(pkgrel=.*)$&_\1&' \
  -e 's&abbrev=[0-9]+&abbrev=10&' \
  -i "arch-glibc/PKGBUILD"

# package
source "arch-glibc/PKGBUILD"

if [ "${_build_roco::1}" == "t" ]; then
  source "$startdir/PKGBUILD.roco.append"
else
  source "$startdir/PKGBUILD.eac.append"
fi

source+=(
  'PKGBUILD.eac.append'
  'PKGBUILD.roco.append'
)
b2sums+=(
  'SKIP'
  'SKIP'
)