blob: 91286d67abdb6fda16c9040a253f8f5fc8f851e9 (
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
60
61
62
63
64
65
66
|
# Maintainer: Kamil Cukrowski <kamilcukrowski@gmail.com>
_prefix=arm-none-eabi-
pkgname=${_prefix}yiolibc
pkgver=v0.3.0
pkgrel=3
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_compat
)
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/src" -I"build/$dir/gen" $opts -xc - -lyio -o "$tmp" <<'EOF'
#include <yio.h>
int main() {
yprint("Hello world", 5, "\n");
}
EOF
)
done
}
|