2015-02-17 12:56:47 +01:00
|
|
|
# Template file for 'nim'
|
|
|
|
pkgname=nim
|
2015-05-12 12:08:49 +02:00
|
|
|
version=0.11.2
|
2015-07-27 01:16:37 +02:00
|
|
|
revision=2
|
|
|
|
_csources_commit=c2c13f5a60dc635d1a9746e630cfb127348430cb
|
2015-02-17 12:56:47 +01:00
|
|
|
depends="gcc"
|
2015-07-27 01:16:37 +02:00
|
|
|
hostmakedepends="libzip ed"
|
2015-02-17 12:56:47 +01:00
|
|
|
short_desc="The Nim programming language"
|
|
|
|
maintainer="allan <mail@may.mooo.com>"
|
|
|
|
license="MIT"
|
|
|
|
homepage="http://nim-lang.org/"
|
2015-07-27 01:16:37 +02:00
|
|
|
distfiles="https://github.com/nim-lang/Nim/archive/v${version}.tar.gz
|
|
|
|
http://github.com/nim-lang/csources/archive/$_csources_commit.tar.gz"
|
|
|
|
checksum="8b46ca59461f870471060dcaff535c7203937c7ae67856f1ba027d000b5fa4c6
|
|
|
|
876d730d2a7c034b82626d892c65e1b26caa30bc4471c40067a56dc4404a2cfd"
|
2015-02-17 12:56:47 +01:00
|
|
|
wrksrc=Nim-$version
|
|
|
|
|
2015-07-25 23:04:32 +02:00
|
|
|
post_extract() {
|
|
|
|
cd $wrksrc
|
2015-07-27 01:16:37 +02:00
|
|
|
test -d csources || cp -r ../csources-$_csources_commit csources
|
2015-07-25 23:04:32 +02:00
|
|
|
}
|
|
|
|
|
2015-02-17 12:56:47 +01:00
|
|
|
do_build() {
|
|
|
|
case "$XBPS_TARGET_MACHINE" in
|
|
|
|
arm*)
|
2015-05-12 12:08:49 +02:00
|
|
|
ed config/nim.cfg <<-EDIT
|
2015-02-17 12:56:47 +01:00
|
|
|
,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 ..
|
2015-05-12 12:08:49 +02:00
|
|
|
ed koch.nim <<-EDIT
|
2015-02-17 12:56:47 +01:00
|
|
|
,s/-d:useLibzipSrc//
|
|
|
|
w
|
|
|
|
q
|
|
|
|
EDIT
|
2015-05-12 12:08:49 +02:00
|
|
|
ed lib/wrappers/zip/libzip.nim <<-EDIT
|
|
|
|
,s/.2|.1|.0/.4/
|
|
|
|
w
|
|
|
|
q
|
|
|
|
EDIT
|
|
|
|
|
2015-02-17 12:56:47 +01:00
|
|
|
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
|
2015-05-12 12:08:49 +02:00
|
|
|
ln -sf /usr/lib/nim/bin/nim ${DESTDIR}/usr/bin/nim
|
2015-02-17 12:56:47 +01:00
|
|
|
}
|