ctucx.git: alpine-pkgs

My personal alpine-packages [deprecated in favor of nixos]

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 
67 
68 
69 
70 
71 
72 
73 
74 
75 
76 
77 
78 
79 
80 
81 
82 
83 
84 
85 
86 
87 
88 
89 
90 
91 
92 
93 
94 
95 
96 
97 
98 
99 
100 
101 
102 
103 
104 
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Leah (ctucx) <leah@ctu.cx>
pkgname=nim
pkgver=1.4.8
pkgrel=1
pkgdesc="Imperative, multi-paradigm, compiled programming language"
url="https://nim-lang.org/"
arch="all !s390x"
license="MIT"
checkdepends="nodejs"
subpackages="${pkgname}-doc nimsuggest niminst"
depends=""
makedepends="gc-dev"
source="${pkgname}-${pkgver}.tar.gz::https://github.com/nim-lang/Nim/archive/v${pkgver}.tar.gz
        ${pkgname}-csources-0.20.0.tar.gz::https://github.com/nim-lang/csources/archive/v0.20.0.tar.gz"
builddir="${srcdir}/Nim-${pkgver}"

# Don't run tests on armhf, it'd take eternity...
# Can't run tests on mips, no nodejs...
case "$CARCH" in
	armhf) options="!check";;
	mips*) options="!check";;
esac

prepare() {
	mv "${srcdir}"/csources-0.20.0 "${builddir}"/csources
	default_prepare
}

build() {
	cd ${builddir}/csources

	msg2 "Building nim csources..."
	./build.sh

	cd ..

	msg2 "Building koch..."
	./bin/nim compile -d:release koch

	msg2 "Building nim..."
	./koch boot -d:release -d:useGnuReadline

	msg2 "Building libs"
	(cd lib
		../bin/nim c --app:lib -d:createNimRtl -d:release nimrtl.nim
	)

	msg2 "Building tools"
	./koch toolsNoExternal
	(cd tools
		../bin/nim c -d:release nimgrep.nim
	)

	msg2 "Building nimsuggest..."
	./bin/nim compile -d:release nimsuggest/nimsuggest.nim
}


check() {
	cd ${builddir}
	# XXX: Some tests fail!
	./koch tests --pedantic --targets="c js" all || true
}

package() {
	export PATH="{$builddir}/bin:${PATH}"

	./koch install ${pkgdir}

	install -d ${pkgdir}/usr/lib

	cp -a lib ${pkgdir}/usr/lib/nim
	cp -a compiler ${pkgdir}/usr/lib/nim

	install -Dm 644 compiler.nimble "${pkgdir}/usr/lib/nim/compiler"
	install -m 755 lib/libnimrtl.so "${pkgdir}/usr/lib/libnimrtl.so"

	ln -s /usr/share/nim/doc "${pkgdir}/usr/lib/nim/doc"

	install -Dm 644 config/* -t "${pkgdir}/etc/nim"
	install -Dm 755 bin/* -t "${pkgdir}/usr/bin"

	mkdir -p "${pkgdir}/usr/include"
	cp -a ${pkgdir}/usr/lib/nim/*.h "${pkgdir}/usr/include"

	install -d ${pkgdir}/usr/share/nim/doc
	cp -a examples doc/* ${pkgdir}/usr/share/nim/doc

	install -Dm 644 copying.txt -t ${pkgdir}/usr/share/licenses/${pkgname}/COPYING
}

nimsuggest() {
	pkgdesc="idetools for the nim language"
	install -D -m 755 ${builddir}/nimsuggest/nimsuggest ${subpkgdir}/usr/bin/nimsuggest
}

niminst() {
	pkgdesc="A tool to generate an installer for a Nim program"
	install -D -m 755 ${builddir}/tools/niminst/niminst ${subpkgdir}/usr/bin/niminst
}

sha512sums="6fec50c5cc5e25cb445c93363470c327536f97f90c544f1c199e22a4abd91a18834f7c037a34663b20478ae017e419ea84877c8bbb7d22b664f7c848e45a105a  nim-1.4.8.tar.gz
4da00678cb92cfd3b2425e4698cbbef8111c711f9457ba969367638437b5fad7928ca0a91fd24f53dcd9d341cfc420e87ec85d245767531bc57ccafd6feba258  nim-csources-0.20.0.tar.gz"