From 05d14541c707157e3bdb297e578ca1ffd5dcaede Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 14 Apr 2016 16:21:49 -0400 Subject: libre/pacman: Generate and install the configs for _every_ architecture. Slightly invasive changes: - moving the makepkg.conf sed bit into build() from package() - git mv makepkg.conf makepkg.conf.in --- libre/pacman/PKGBUILD | 65 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 38 insertions(+), 27 deletions(-) (limited to 'libre/pacman/PKGBUILD') diff --git a/libre/pacman/PKGBUILD b/libre/pacman/PKGBUILD index 9f8ac5a1d..b7969083c 100644 --- a/libre/pacman/PKGBUILD +++ b/libre/pacman/PKGBUILD @@ -32,7 +32,7 @@ backup=('etc/pacman.conf' 'etc/makepkg.conf') options=('strip' 'debug') source=(https://sources.archlinux.org/other/pacman/$pkgname-$pkgver.tar.gz{,.sig} $pkgname.conf.{i686,x86_64,armv7h} - makepkg.conf + makepkg.conf.in $pkgname-keyring.service $pkgname-keyring.timer 0001-libmakepkg-fix-is_array-function.patch @@ -79,6 +79,36 @@ build() { --with-ldconfig=/usr/bin/ldconfig make V=1 make -C contrib + + # Generate the architecture-specific makepkg.conf files + local carch mycarch mychost myflags myldflags + for carch in "${arch[@]}"; do + case $carch in + i686) + mycarch="i686" + mychost="i686-pc-linux-gnu" + myflags="-march=i686 -mtune=generic -O2 -pipe -fstack-protector-strong" + ;; + x86_64) + mycarch="x86_64" + mychost="x86_64-unknown-linux-gnu" + myflags="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong" + ;; + armv7h) + mycarch="armv7h" + mychost="armv7l-unknown-linux-gnueabihf" + myflags="-march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16 -O2 -pipe -fstack-protector --param=ssp-buffer-size=4" + ;; + esac + myldflags="-Wl,-O1,--sort-common,--as-needed,-z,relro" + + # set things correctly in the default conf file + sed < "$srcdir/makepkg.conf.in" > "$srcdir/makepkg.conf.$carch" \ + -e "s|@CARCH[@]|$mycarch|g" \ + -e "s|@CHOST[@]|$mychost|g" \ + -e "s|@LDFLAGS[@]|$myldflags|g" \ + -e "s|@CARCHFLAGS[@]|$myflags|g" + done } #check() { @@ -94,33 +124,14 @@ package() { # install Parabola specific stuff install -dm755 "$pkgdir/etc" install -m644 "$srcdir/$pkgname.conf.$CARCH" "$pkgdir/etc/$pkgname.conf" + install -m644 "$srcdir/makepkg.conf.$CARCH" "$pkgdir/etc/makepkg.conf" - case $CARCH in - i686) - mycarch="i686" - mychost="i686-pc-linux-gnu" - myflags="-march=i686 -mtune=generic -O2 -pipe -fstack-protector-strong" - ;; - x86_64) - mycarch="x86_64" - mychost="x86_64-unknown-linux-gnu" - myflags="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong" - ;; - armv7h) - mycarch="armv7h" - mychost="armv7l-unknown-linux-gnueabihf" - myflags="-march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16 -O2 -pipe -fstack-protector --param=ssp-buffer-size=4" - ;; - esac - myldflags="-Wl,-O1,--sort-common,--as-needed,-z,relro" - - # set things correctly in the default conf file - install -m644 "$srcdir/makepkg.conf" "$pkgdir/etc" - sed -i "$pkgdir/etc/makepkg.conf" \ - -e "s|@CARCH[@]|$mycarch|g" \ - -e "s|@CHOST[@]|$mychost|g" \ - -e "s|@LDFLAGS[@]|$myldflags|g" \ - -e "s|@CARCHFLAGS[@]|$myflags|g" + install -dm755 "$pkgdir/usr/share/pacman/defaults" + local carch + for carch in "${arch[@]}"; do + install -m644 "$srcdir/$pkgname.conf.$CARCH" "$pkgdir/usr/share/pacman/defaults/" + install -m644 "$srcdir/makepkg.conf.$CARCH" "$pkgdir/usr/share/pacman/defaults/" + done # put bash_completion in the right location install -dm755 "$pkgdir/usr/share/bash-completion/completions" -- cgit v1.2.3