Skip to content

Instantly share code, notes, and snippets.

@psstoyanov psstoyanov/PKGBUILD
Last active Jan 6, 2020

Embed
What would you like to do?
PKGBUILD for bootstrapping ada on arch arm based distros
# Original source: https://github.com/archlinuxarm/PKGBUILDs/pull/1557
#This package is useful for bootstrapping on aarch64:
pkgname=debian-gcc
pkgver=9.2.1
pkgrel=21
arch=('aarch64')
pkgdesc='binary gcc compiler from debian'
url="https://packages.debian.org/buster/gcc-${_majorver}"
license=('GPL')
provides=(gcc gcc-ada)
options=(!strip)
_majorver=${pkgver:0:1}
_files=(
"gcc-${_majorver}_${pkgver}-${pkgrel}_arm64"
"g++-${_majorver}_${pkgver}-${pkgrel}_arm64"
"cpp-${_majorver}_${pkgver}-${pkgrel}_arm64"
"gcc-${_majorver}-base_${pkgver}-${pkgrel}_arm64"
"libcc1-0_${pkgver}-${pkgrel}_arm64"
"libgcc-${_majorver}-dev_${pkgver}-${pkgrel}_arm64"
"libstdc++-${_majorver}-dev_${pkgver}-${pkgrel}_arm64"
"libgcc1_${pkgver}-${pkgrel}_arm64"
"gnat-${_majorver}_${pkgver}-${pkgrel}_arm64"
"libgnat-${_majorver}_${pkgver}-${pkgrel}_arm64"
"libgnatvsn${_majorver}_${pkgver}-${pkgrel}_arm64"
"libisl22_0.22-2_arm64"
)
source=()
md5sums=()
noextract=()
for i in ${_files[*]} ; do
case ${i} in
libisl*) source+=("http://ftp.debian.org/debian/pool/main/i/isl/${i}.deb") ;;
*) source+=("http://ftp.debian.org/debian/pool/main/g/gcc-${_majorver}/${i}.deb") ;;
esac
md5sums+=('SKIP')
noextract+=("${i}.deb")
done
prepare(){
# ALARM: Specify build host types, triplet patch
[[ $CARCH == "arm" ]] && CONFIGFLAG="--host=armv5tel-unknown-linux-gnueabi --build=armv5tel-unknown-linux-gnueabi --with-arch=armv5te --with-float=soft"
[[ $CARCH == "armv6h" ]] && CONFIGFLAG="--host=armv6l-unknown-linux-gnueabihf --build=armv6l-unknown-linux-gnueabihf --with-arch=armv6 --with-float=hard --with-fpu=vfp"
[[ $CARCH == "armv7h" ]] && CONFIGFLAG="--host=armv7l-unknown-linux-gnueabihf --build=armv7l-unknown-linux-gnueabihf --with-arch=armv7-a --with-float=hard --with-fpu=vfpv3-d16"
[[ $CARCH == "aarch64" ]] && CONFIGFLAG="--host=aarch64-unknown-linux-gnu --build=aarch64-unknown-linux-gnu --with-arch=armv8-a --enable-fix-cortex-a53-835769 --enable-fix-cortex-a53-843419"
}
package() {
for i in ${_files[@]} ; do
bsdtar -xf ${i}.deb
bsdtar -xf data.tar.xz
done
cd usr/lib/aarch64-linux-gnu
for i in * ; do
ln -s aarch64-linux-gnu/${i} ../${i}
done
cd ../../bin
ln -s cpp-${_majorver} cpp
ln -s gcc-${_majorver} gcc
ln -s g++-${_majorver} g++
ln -s gcc-ar-${_majorver} gcc-ar
ln -s gcc-nm-${_majorver} gcc-nm
ln -s gcc-ranlib-${_majorver} gcc-ranlib
ln -s gcov-${_majorver} gcov
ln -s gcov-dump-${_majorver} gcov-dump
ln -s gcov-tool-${_majorver} gcov-tool
cd ../..
mv usr ${pkgdir}/
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.