void-packages/srcpkgs/choosenim/template
q66 d693641c95 choosenim: update to 0.4.0 + add ppc32
This also fixes build. 0.5.0 update is not possible as nimarchive
is not cross-compiling friendly and doesn't even build natively
because it ignores CFLAGS.

I cherry-picked relevant 0.5.0 changes into patches.
2019-12-17 22:46:13 +01:00

43 lines
974 B
Bash

# Template file for 'choosenim'
pkgname=choosenim
version=0.4.0
revision=1
hostmakedepends="git nim"
makedepends="libressl-devel zlib-devel"
depends="gcc"
short_desc="Nim toolchain installer"
maintainer="SolitudeSF <solitudesf@protonmail.com>"
license="MIT"
homepage="https://github.com/dom96/choosenim"
distfiles="${homepage}/archive/v${version}.tar.gz"
checksum=d7b04314666a3647c255f89031deabe53f8e281b6cfbf3a0848272fc1799c0f3
if [ -n "$CROSS_BUILD" ]; then
hostmakedepends+=" libressl-devel"
fi
do_build() {
local arch args
case "$XBPS_TARGET_MACHINE" in
aarch64*) arch=arm64;;
arm*) arch=arm;;
mips*) arch=mips;;
ppc64le*) arch=powerpc64el;;
ppc64*) arch=powerpc64;;
ppc*) arch=powerpc;;
esac
if [ -n "$arch" ]; then
cat > nim.cfg <<EOF
$arch.linux.gcc.exe = "$CC"
$arch.linux.gcc.linkerexe = "$CC"
EOF
args="--cpu:$arch"
fi
nimble -y build -d:release --passC:-flto "$args"
}
do_install() {
vbin bin/choosenim
vlicense LICENSE
}