summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD151
1 files changed, 103 insertions, 48 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 7ba04d12ddcb..c61dc731a8bd 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,93 +4,148 @@
# Contributor: Sven-Hendrik Haase <sh@lutzhaase.com>
# Contributor: Jesus Alvarez <jeezusjr@gmail.com>
-pkgname=nim-git
+pkgbase=nim-git
+pkgname=('nim-git' 'nimble-git' 'nimsuggest-git')
pkgver=20161201
pkgrel=1
-pkgdesc="Compiled, garbage-collected systems programming language which has an excellent productivity/performance ratio"
arch=('i686' 'x86_64')
-makedepends=('git' 'texlive-bin' 'texlive-core')
groups=('nim')
-url="https://github.com/nim-lang/Nim"
-license=('MIT')
-options=('!emptydirs')
-source=(${pkgname%-git}::git+https://github.com/nim-lang/Nim
- git+https://github.com/nim-lang/csources)
-sha256sums=('SKIP' 'SKIP')
-provides=('nim')
-conflicts=('nim')
+makedepends=('git' 'texlive-bin' 'texlive-core')
+source=(git+https://github.com/nim-lang/Nim
+ git+https://github.com/nim-lang/csources
+ git+https://github.com/nim-lang/nimble
+ git+https://github.com/nim-lang/nimsuggest)
+sha256sums=('SKIP' 'SKIP' 'SKIP' 'SKIP')
pkgver() {
- cd ${pkgname%-git}
+ cd "$srcdir/Nim"
git log -1 --format="%cd" --date=short | sed "s|-||g"
}
prepare() {
- cd ${pkgname%-git}
+ cd "$srcdir/Nim"
- msg2 'Copying csources...'
+ msg2 'Cloning csources...'
git clone --local "$srcdir/csources"
}
build() {
- cd ${pkgname%-git}
+ cd "$srcdir/Nim"
msg2 'Building csources...'
pushd csources
sh build.sh
popd
- msg2 'Building...'
- ./bin/nim c koch
- ./koch boot -d:release -d:useGnuReadline
+ msg2 'Building Nim...'
+ ./bin/nim c -d:release koch
+ ./koch boot -d:release -d:nativeStacktrace -d:useGnuReadline
- msg2 'Building PDF documentation...'
+ msg2 'Building Nim PDF documentation...'
./koch pdf
+ msg2 'Building Nimble...'
+ ./koch nimble
+
+ msg2 'Building nimgrep and nimsuggest...'
+ ./koch tools
+
msg2 'Building libnimrtl...'
pushd lib
../bin/nim c --app:lib -d:createNimRtl -d:release nimrtl.nim
popd
-
- msg2 'Building nimgrep...'
- cd tools
- ../bin/nim c -d:release nimgrep.nim
}
-package() {
- cd ${pkgname%-git}
+package_nim-git() {
+ pkgdesc="Compiled, garbage-collected systems programming language which has an excellent productivity/performance ratio"
+ url="https://github.com/nim-lang/Nim"
+ license=('MIT')
+ options=('!emptydirs')
+ provides=('nim')
+ conflicts=('nim')
- msg2 'Installing...'
+ cd "$srcdir/Nim"
+
+ msg2 'Installing Nim license...'
+ install -Dm 644 "copying.txt" -t "$pkgdir/usr/share/licenses/nim"
+
+ msg2 'Installing Nim documentation...'
+ install -dm 755 "$pkgdir/usr/share/doc/nim"
+ cp -dpr --no-preserve=ownership examples web doc/* "$pkgdir/usr/share/doc/nim"
+
+ msg2 'Installing Nim...'
./koch install "$pkgdir"
+ install -Dm 755 bin/{nim,nimgrep} -t "$pkgdir/usr/bin"
- install -dm 755 \
- "$pkgdir/etc" \
- "$pkgdir/usr/bin" \
- "$pkgdir/usr/lib/nim" \
- "$pkgdir/usr/share/doc/nim"
cd "$pkgdir/nim"
- mv lib/* "$pkgdir/usr/lib/nim/"
- mv config/* "$pkgdir/etc/"
- cp -dpr --no-preserve=ownership "$srcdir/${pkgname%-git}/lib/packages" \
- "$pkgdir/usr/lib/nim/"
- mv bin/* "$pkgdir/usr/bin/"
+ install -dm 755 "$pkgdir/etc" "$pkgdir/usr/lib/nim"
+ find lib -mindepth 1 -maxdepth 1 -exec \
+ cp -dpr --no-preserve=ownership '{}' "$pkgdir/usr/lib/nim" \;
+ find config -mindepth 1 -maxdepth 1 -exec \
+ cp -dpr --no-preserve=ownership '{}' "$pkgdir/etc/" \;
+ cp -dpr --no-preserve=ownership "$srcdir/Nim/lib/packages" \
+ "$pkgdir/usr/lib/nim"
+
+ # https://bugs.archlinux.org/task/50252
+ msg2 'Fixing unusual placement of header files...'
+ install -dm 755 "$pkgdir/usr/include"
+ for _header in cycle nimbase; do
+ ln -s "/usr/lib/nim/${_header}.h" "$pkgdir/usr/include/${_header}.h"
+ done
+
+ msg2 'Fixing unusual placement of shared object files...'
+ ln -s "/usr/lib/nim/libnimrtl.so" "$pkgdir/usr/lib/libnimrtl.so"
+
+ msg2 'Cleaning up pkgdir...'
+ rm -rf "$pkgdir/nim"
+}
- cd "$srcdir/${pkgname%-git}"
+package_nimble-git() {
+ pkgdesc="Package manager for the Nim programming language"
+ url="https://github.com/nim-lang/nimble"
+ license=('BSD')
+ provides=('nimble')
+ conflicts=('nimble')
- msg2 'Installing license...'
- install -Dm 644 copying.txt -t "$pkgdir/usr/share/licenses/nim"
+ cd "$srcdir/nimble"
- msg2 'Installing documentation...'
- rm -rf "$pkgdir/nim"
- mv examples web "$pkgdir/usr/share/doc/nim"
- mv doc/* "$pkgdir/usr/share/doc/nim"
+ msg2 'Installing Nimble license...'
+ install -Dm 644 "$srcdir/nimble/license.txt" \
+ -t "$pkgdir/usr/share/licenses/nimble"
+
+ msg2 'Installing Nimble documentation...'
+ install -Dm 644 changelog.markdown readme.markdown todo.markdown \
+ -t "$pkgdir/usr/share/doc/nimble"
- msg2 'Installing libnimrtl...'
- install -Dm 644 lib/libnimrtl.so -t "$pkgdir/usr/lib"
+ msg2 'Installing Nimble...'
+ install -Dm 755 "$srcdir/Nim/bin/nimble" -t "$pkgdir/usr/bin"
- msg2 'Installing nimgrep...'
- install -Dm 755 tools/nimgrep -t "$pkgdir/usr/bin"
+ # Nimble looks for nimscriptapi.nim in /usr/bin/nimblepkg/, of all places.
+ install -dm 755 "$pkgdir/usr/share/nimble"
+ cp -dpr --no-preserve=ownership src/nimblepkg "$pkgdir/usr/share/nimble"
+ ln -s "/usr/share/nimble" "$pkgdir/usr/bin/nimblepkg"
+
+ msg2 'Installing Nimble bash completion...'
+ install -Dm 644 nimble.bash-completion \
+ "$pkgdir/usr/share/bash-completion/completions/nimble"
}
-# vim:set ts=2 sw=2 et:
+package_nimsuggest-git() {
+ pkgdesc="Tool for providing auto completion data for Nim source code"
+ url="https://github.com/nim-lang/nimsuggest"
+ license=('MIT')
+ provides=('nimsuggest')
+ conflicts=('nimsuggest')
+
+ cd "$srcdir/nimsuggest"
+
+ msg2 'Installing Nimsuggest license...'
+ install -Dm 644 LICENSE -t "$pkgdir/usr/share/licenses/nimsuggest"
+
+ msg2 'Installing Nimsuggest documentation...'
+ install -Dm 644 README.md -t "$pkgdir/usr/share/doc/nimsuggest"
+
+ msg2 'Installing Nimsuggest...'
+ install -Dm 755 "$srcdir/Nim/bin/nimsuggest" -t "$pkgdir/usr/bin"
+}