aports/testing/odin/APKBUILD
2025-06-03 14:18:53 +00:00

91 lines
2.5 KiB
Text

maintainer="fossdd <fossdd@pwned.life>"
pkgname=odin
_pkgname=Odin
pkgver=0.2025.06
_realver=${pkgver/0./dev-}
_realver=${_realver/./-}
pkgrel=0
_llvmver=20
pkgdesc="Fast, concise, readable, pragmatic and open sourced programming language"
url="https://odin-lang.org/"
arch="x86_64 aarch64"
license="BSD-2-Clause"
depends="
clang$_llvmver
llvm$_llvmver-libs
"
makedepends="
clang$_llvmver-dev
compiler-rt
llvm$_llvmver
llvm$_llvmver-dev
python3
"
subpackages="$pkgname-vendor $pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/odin-lang/Odin/archive/refs/tags/$_realver.tar.gz"
builddir="$srcdir/$_pkgname-$_realver"
options="net !check" # tests, tests fail
prepare() {
default_prepare
find "$builddir"/vendor \
\( \
-name windows -o \
-name macos -o \
-name macos-arm64 -o \
-name darwin -o \
-name "*.lib" -o \
-name "*.dll" -o \
-name "*.a" -o \
-name "*.dylib" -o \
-name "*.so.*" -o \
-name "*.so" -o \
\) \
-exec rm -rf {} +
}
build() {
export LLVM_CONFIG=/usr/lib/llvm$_llvmver/bin/llvm-config
export CXX=/usr/lib/llvm$_llvmver/bin/clang++
make release_native
make -C vendor/miniaudio/src
make -C vendor/stb/src unix
make -C vendor/cgltf/src unix
}
check() {
./odin check examples/all -strict-style
./odin test tests/benchmark -file -all-packages -define:ODIN_TEST_FANCY=false
./odin test tests/core/normal.odin -file -all-packages -define:ODIN_TEST_FANCY=false
./odin test tests/core/speed.odin -file -all-packages -o:speed -define:ODIN_TEST_FANCY=false
./odin test tests/vendor -all-packages -define:ODIN_TEST_FANCY=false
}
package() {
mkdir -p "$pkgdir"/usr/bin "$pkgdir"/usr/lib/odin
install -Dm755 odin "$pkgdir"/usr/lib/odin/odin
cp -r base "$pkgdir"/usr/lib/odin/base
cp -r core "$pkgdir"/usr/lib/odin/core
cp -r shared "$pkgdir"/usr/lib/odin/shared
mkdir "$pkgdir"/usr/lib/odin/vendor # has to exist for odin
ln -s /usr/lib/odin/odin "$pkgdir"/usr/bin/odin
install -Dm644 README.md "$pkgdir"/usr/share/doc/odin/README.md
install -Dm644 PROPOSAL-PROCESS.md "$pkgdir"/usr/share/doc/odin/PROPOSAL-PROCESS.md
install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/odin/LICENSE
}
vendor() {
pkgdesc="Vendor collection for Odin programming language"
mkdir -p "$subpkgdir"/usr/lib/odin/vendor
cp -r "$builddir"/vendor/* "$subpkgdir"/usr/lib/odin/vendor
}
sha512sums="
2dc1d406dd62206829fc3c7f430974612494e0938c2bf88d9d797eb07c511cc6c2e30f7cccd1a2ea35db9ee1d5c04644acaf4cac1496f667f74394e33b33ee74 odin-0.2025.06.tar.gz
"