summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorChrister Solskogen2017-12-21 11:07:30 +0100
committerChrister Solskogen2017-12-21 11:07:30 +0100
commitbdad7d36445e888aeb23bcae8991ad85aa880456 (patch)
treef50a3431ec786ae0045d1237dc6c6b0a924fbb17
parent4bad328b3ff54d496c5d3632737414c51e50ef99 (diff)
downloadaur-bdad7d36445e888aeb23bcae8991ad85aa880456.tar.gz
Fix install error
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD30
2 files changed, 21 insertions, 11 deletions
diff --git a/.SRCINFO b/.SRCINFO
index f388dbfdfd79..83735fd220e5 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = m68k-elf-toolchain
pkgdesc = A complete gcc/binutils/newlib toolchain for m68k-elf
- pkgver = 20171220
+ pkgver = 20171221
pkgrel = 1
url = http://www.gnu.org
arch = x86_64
diff --git a/PKGBUILD b/PKGBUILD
index ff45dcb9e8d1..32f438641ea3 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,7 +3,7 @@
_target=m68k-elf
pkgname=$_target-toolchain
-pkgver=20171220
+pkgver=20171221
pkgrel=1
pkgdesc="A complete gcc/binutils/newlib toolchain for $_target"
depends=('zlib' 'bash' 'libmpc')
@@ -52,20 +52,30 @@ build()
package()
{
cd "${srcdir}/obj"
- make DESTDIR=${pkgdir} install -j2
- rm -rf "${pkgdir}/usr/share"
- rm -rf "${pkgdir}/usr/include"
- rm -rf "${pkgdir}/usr/lib/libcc1.*"
+ make DESTDIR="${pkgdir}" install -j2
+ rm -rf "${pkgdir}"/usr/share
+ rm -rf "${pkgdir}"/usr/include
+ rm -rf "${pkgdir}"/usr/lib/libcc1.*
find "${pkgdir}" -name '*.py' -delete
- # Strip it manually
- find "${pkgdir}" -print0 | xargs -0 file | grep -E "executable|shared object" | grep ELF | cut -f 1 -d : | xargs -0 strip
- find "${pkgdir}/usr/lib/gcc/${_target}" -print0 -type f -name '*.o' -o -name '*.a' | xargs -0 ${pkgdir}/usr/bin/${_target}-strip -g
- find "${pkgdir}/usr/${_target}/lib" -print0 -type f -name '*.o' -o -name '*.a' | xargs ${pkgdir}/usr/bin/${_target}-strip -g
+ # local variable is scoped to the function, for general tidiness.
+ local regex='ELF ().*(executable|shared object).*'
+ # read null-terminated filenames from stdin, and use a while loop to operate on each one
+ # for each run of the loop, the filename is stored in the intuitive variable "filename". :)
+ while read -r -d '' filename; do
+ # test if the output of `file` matches the regular expression defined earlier
+ if [[ $(file -b "$filename") =~ $regex ]]; then
+ # awesome, it matches! So, do the standard strip routine since this isn't an $_target executable
+ strip --strip-unneeded "$filename"
+ fi
+ # this find command uses process substitution to pass the output of find into the `while read` loop
+ done < <(find "$pkgdir" -type f -print0)
+
+ find "${pkgdir}"/usr/lib/gcc/${_target} "${pkgdir}"/usr/${_target}/lib -type f -name '*.o' -o -name '*.a' -print0 | xargs -0 "${pkgdir}"/usr/bin/${_target}-strip -g
#fix permissions to please namcap
- find "${pkgdir}/usr/${_target}/lib" -name '*.a' | xargs chmod 644
+ find "${pkgdir}/usr/${_target}/lib" -name '*.a' -print0 | xargs -0 chmod 644
}