diff options
author | Kamil Cukrowski | 2021-10-06 13:54:00 +0200 |
---|---|---|
committer | Kamil Cukrowski | 2021-10-06 13:57:41 +0200 |
commit | b06dd9744328ca163c221f615ee1286a5462b377 (patch) | |
tree | dd6af15fdfdee908a89501dffaa11664dafd8cf3 /PKGBUILD | |
download | aur-b06dd9744328ca163c221f615ee1286a5462b377.tar.gz |
Initial commit
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..752d9479d177 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,66 @@ +# Maintainer: Kamil Cukrowski <kamilcukrowski@gmail.com> + +_prefix=arm-none-eabi- +pkgname=${_prefix}yiolibc +pkgver=v0.2.4 +pkgrel=1 +pkgdesc="Yio Input Output C Library that aims in type-safe printf replacement" +arch=(any) +url="https://gitlab.com/kamcuk/yio/" +license=(GPL) +groups=() +depends=() +makedepends=(cmake m4 ${_prefix}gcc ${_prefix}newlib git) +optdepends=() +provides=(arm-none-eabi-yiolibc) +conflicts=() +replaces=() +backup=() +options=(!emptydirs !strip) +source=("git+https://gitlab.com/kamcuk/yio#tag=${pkgver}") +md5sums=(SKIP) + +build() { + ${_prefix}gcc --print-multi-lib | + while IFS=';' read -r dir opts; do + opts=$(sed 's/@/ -/g' <<<"$opts") + ( set -x + cmake \ + -B "build/$dir" \ + -S "yio" \ + -D CMAKE_TOOLCHAIN_FILE="$PWD/yio/cmake/Toolchain/${_prefix}gcc.cmake" \ + -D CMAKE_BUILD_TYPE="Release" \ + -D CMAKE_C_FLAGS_RELEASE="-Os -DNDEBUG -g -ffunction-sections -fdata-sections" \ + -D CMAKE_C_FLAGS="$opts" \ + -D CMAKE_INSTALL_LIBDIR="lib/$dir" + cmake --build "build/$dir" --target yio + cmake --build "build/$dir" --target yio_decimallib + ) + done +} + +package() { + ${_prefix}gcc --print-multi-lib | + while IFS=';' read dir opts; do + cmake --install "build/$dir" --prefix "$pkgdir/usr/arm-none-eabi/" + done +} + +check() { + ${_prefix}gcc --print-multi-lib | + head -n1 | + while IFS=';' read dir opts; do + ( + tmp=$(mktemp) + trap 'rm "$tmp"' EXIT + set -x + ${_prefix}gcc --specs=rdimon.specs -L"build/$dir" -I"build/$dir" $opts -xc - -lyio -o "$tmp" <<'EOF' +#include <yio.h> +int main() { + yprint("Hello world", 5, "\n"); +} +EOF + ) + done +} + |