From 9f375a543df38f8f2f1f3db50f5792e6caab45e2 Mon Sep 17 00:00:00 2001 From: allan Date: Tue, 17 Feb 2015 12:56:47 +0100 Subject: [PATCH] New package: nim-0.10.2 --- srcpkgs/nim/template | 59 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 srcpkgs/nim/template diff --git a/srcpkgs/nim/template b/srcpkgs/nim/template new file mode 100644 index 0000000000..f146a1e748 --- /dev/null +++ b/srcpkgs/nim/template @@ -0,0 +1,59 @@ +# Template file for 'nim' +pkgname=nim +version=0.10.2 +revision=1 +depends="gcc" +makedepends="libzip" +hostmakedepends="git ed" +short_desc="The Nim programming language" +maintainer="allan " +license="MIT" +homepage="http://nim-lang.org/" +distfiles="https://github.com/Araq/Nim/archive/v${version}.tar.gz" +checksum=66d8ce904abdad628629f214593ee79da4eb342db8f022c4e451e153872a236d +wrksrc=Nim-$version + +post_extract() { + cd $wrksrc + test -d csources || + git clone --depth=1 https://github.com/nim-lang/csources +} + +do_build() { + case "$XBPS_TARGET_MACHINE" in + arm*) + ed >/dev/null 2>&1 config/nim.cfg <<-EDIT + ,s/^arm.linux.gcc.exe .*/arm.linux.gcc.exe = "$CC"/ + ,s/^arm.linux.gcc.linkerexe .*/arm.linux.gcc.linkerexe = "$CC"/ + w + q + EDIT + esac + + cd csources && sh build.sh + cd .. + + ed >/dev/null 2>&1 koch.nim <<-EDIT + ,s/-d:useLibzipSrc// + w + q + EDIT + bin/nim c koch + + case "$XBPS_TARGET_MACHINE" in + arm*) bin/nim c -d:release --os:linux --cpu:arm compiler/nim;; + *) ./koch boot -d:release + esac +} + +do_install() { + ./koch install ${DESTDIR}/usr/lib + + if [ "$CROSS_BUILD" ]; then + mv compiler/nim ${DESTDIR}/usr/lib/nim/bin/nim + fi + + vmkdir usr/bin + ln -s /usr/lib/nim/bin/nim \ + ${DESTDIR}/usr/bin/nim +}