Skip to content

Instantly share code, notes, and snippets.

@JaHIY
Last active October 12, 2019 08:18
Show Gist options
  • Save JaHIY/ecbcc10e6b3e87c917baeba61f5fee4f to your computer and use it in GitHub Desktop.
Save JaHIY/ecbcc10e6b3e87c917baeba61f5fee4f to your computer and use it in GitHub Desktop.
Arch Linux PKGBUILD for nim 1.0.0
# Modified by JaHIY (https://github.com/JaHIY)
# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: Alexander F Rødseth <[email protected]>
# Contributor: Dominik Picheta <[email protected]>
# Contributor: Sven-Hendrik Haase <[email protected]>
# Contributor: Jesus Alvarez <[email protected]>
pkgname=nim
pkgver=1.0.0
pkgrel=1
pkgdesc='Imperative, multi-paradigm, compiled programming language'
url='https://nim-lang.org/'
arch=('x86_64')
license=('MIT')
depends=('python' 'bash')
makedepends=('gcc' 'bash')
options=('!emptydirs')
backup=(
etc/nim/nim.cfg
etc/nim/nimdoc.cfg
etc/nim/nimdoc.tex.cfg
)
source=(${pkgname}-${pkgver}.tar.xz::https://nim-lang.org/download/nim-${pkgver}.tar.xz)
sha256sums=('034817cc4dec86b7099bcf3e79e9e38842b50212b2fd96cd741fe90855a7e0dd')
sha512sums=('951bbec06a6a1059214b485c5eddfa3c1be0a4ccf6ba98ac3ee624f57d36e86ae1212ffcb6d1bb7ea0938aabbe95a8a6587b140f3219ddb24ec7c93f5672266f')
prepare() {
cd ${pkgname}-${pkgver}
for nimcfg in {compiler,config}/nim.cfg; do
echo "gcc.options.always %= \"\${gcc.options.always} ${CFLAGS:-} ${CPPFLAGS}\"" >> "${nimcfg}"
echo "gcc.options.linker %= \"\${gcc.options.linker} ${LDFLAGS:-}\"" >> "${nimcfg}"
done
}
build() {
cd ${pkgname}-${pkgver}
sh build.sh
bin/nim c -d:release koch
./koch boot -d:release -d:nativeStacktrace
./koch tools
bin/nim c --app:lib -d:createNimRtl -d:release lib/nimrtl.nim
}
package() {
cd ${pkgname}-${pkgver}
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"
# Fix FS#48118, related to the doc2 command
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"
# Fix FS#50252, unusual placement of header files
install -d "${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}"
}
# vim: ts=2 sw=2 et:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment