summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Beste2018-09-24 14:25:36 -0500
committerDan Beste2018-09-24 14:27:16 -0500
commite9c82fe153e08f3c6dc94c63b816e4ee45cbc0e0 (patch)
treeaaf8753804ff9b08ad400336e62fe61353707aa7
parentfb38bccd3862c6de349127dd898a50a429356d73 (diff)
downloadaur-e9c82fe153e08f3c6dc94c63b816e4ee45cbc0e0.tar.gz
Update PKGBUILD
TODO: Determine whether or not users want the PDF documentation included with the rest of the documentation. I don't see any reason to include it since we're already including the entire wiki... However, I have nothing against including it if requested.
-rw-r--r--.SRCINFO18
-rw-r--r--.gitignore8
-rw-r--r--PKGBUILD182
-rw-r--r--makepkg-conf.patch25
4 files changed, 151 insertions, 82 deletions
diff --git a/.SRCINFO b/.SRCINFO
index bf525049e404..961c367daf97 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,8 @@
pkgbase = nim-git
- pkgver = 20180612
+ pkgdesc = Nim is a compiled, garbage-collected systems programming language with a design that focuses on efficiency, expressiveness, and elegance (in that order of priority).
+ pkgver = 0.18.0.r1444.g276a05e57
pkgrel = 1
+ epoch = 1
arch = i686
arch = x86_64
groups = nim
@@ -9,14 +11,15 @@ pkgbase = nim-git
source = git+https://github.com/nim-lang/Nim.wiki
source = git+https://github.com/nim-lang/csources
source = git+https://github.com/nim-lang/nimble
+ source = makepkg-conf.patch
sha256sums = SKIP
sha256sums = SKIP
sha256sums = SKIP
sha256sums = SKIP
+ sha256sums = 9d73290e81a2e2a79f7bb8058d47854d90ba9301dda1bee107294e2d82f631bf
pkgname = nim-git
- pkgdesc = Compiled, garbage-collected systems programming language which has an excellent productivity/performance ratio
- url = https://github.com/nim-lang/Nim
+ url = https://nim-lang.org/
license = MIT
provides = nim
conflicts = nim
@@ -30,9 +33,16 @@ pkgname = nimble-git
conflicts = nimble
pkgname = nimsuggest-git
- pkgdesc = Tool for providing auto completion data for Nim source code
+ pkgdesc = Nimsuggest is a tool that helps to give editors IDE like capabilities.
url = https://github.com/nim-lang/nimsuggest
license = MIT
provides = nimsuggest
conflicts = nimsuggest
+pkgname = nimpretty-git
+ pkgdesc = Standard tool for pretty printing.
+ url = https://github.com/nim-lang/Nim/tree/devel/nimpretty
+ license = MIT
+ provides = nimpretty
+ conflicts = nimpretty
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..f0c038b07691
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,8 @@
+# Blacklist:
+*
+
+# Whitelist:
+!.SRCINFO
+!.gitignore
+!PKGBUILD
+!makepkg-conf.patch
diff --git a/PKGBUILD b/PKGBUILD
index a6ce1de0f684..ce44be8383b2 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,117 +1,128 @@
-# Maintainer: Andy Weidenbaum <archbaum@gmail.com>
+# Maintainer: Dan Beste <dan.ray.beste+aur@gmail.com>
+# Contributor: Andy Weidenbaum <archbaum@gmail.com>
# Contributor: Alexander F Rødseth <xyproto@archlinux.org>
# Contributor: Dominik Picheta <morfeusz8@gmail.com>
# Contributor: Sven-Hendrik Haase <sh@lutzhaase.com>
# Contributor: Jesus Alvarez <jeezusjr@gmail.com>
# Contributor: Zion Nimchuk <zionnimchuk@gmail.com>
-# build PDF documentation
-_pdf=false
-
-pkgbase=nim-git
-pkgname=('nim-git' 'nimble-git' 'nimsuggest-git')
-pkgver=20180612
+pkgbase='nim-git'
+pkgname=('nim-git' 'nimble-git' 'nimsuggest-git' 'nimpretty-git')
+pkgdesc='Nim is a compiled, garbage-collected systems programming language with a design that focuses on efficiency, expressiveness, and elegance (in that order of priority).'
+epoch=1
+pkgver=0.18.0.r1444.g276a05e57
pkgrel=1
arch=('i686' 'x86_64')
groups=('nim')
makedepends=('git')
-[[ "$_pdf" == true ]] \
- && makedepends+=('texlive-bin' 'texlive-core' 'texlive-fontsextra')
-source=(git+https://github.com/nim-lang/Nim
- git+https://github.com/nim-lang/Nim.wiki
- git+https://github.com/nim-lang/csources
- git+https://github.com/nim-lang/nimble)
-sha256sums=('SKIP' 'SKIP' 'SKIP' 'SKIP')
+source=(
+ 'git+https://github.com/nim-lang/Nim'
+ 'git+https://github.com/nim-lang/Nim.wiki'
+ 'git+https://github.com/nim-lang/csources'
+ 'git+https://github.com/nim-lang/nimble'
+ 'makepkg-conf.patch'
+)
+sha256sums=(
+ 'SKIP' 'SKIP' 'SKIP' 'SKIP'
+ '9d73290e81a2e2a79f7bb8058d47854d90ba9301dda1bee107294e2d82f631bf'
+)
pkgver() {
- cd "$srcdir/Nim"
- git log -1 --format="%cd" --date=short --no-show-signature | sed "s|-||g"
+ cd Nim
+
+ git describe --long --tags \
+ | sed 's/\([^-]*-g\)/r\1/;s/-/./g' \
+ | sed 's/v//'
}
prepare() {
- cd "$srcdir/Nim"
-
- msg2 'Cloning csources...'
- git clone --local "$srcdir/csources"
+ cd Nim
+
+ # Prevent the build from failing if it is not cleanbuilt:
+ [[ -d ./csources ]] && rm -rf ./csources
+ cp -r "${srcdir}/csources" .
+ # Remove `-O3` from build.sh's COMP_FLAGS:
+ patch ./csources/build.sh \
+ --strip=1 \
+ --fuzz 5 \
+ -N \
+ < "${srcdir}/makepkg-conf.patch"
}
build() {
- cd "$srcdir/Nim"
+ cd Nim
- msg2 'Building csources...'
- pushd csources
- sh build.sh
- popd
+ # Build the pre-generated C sources of the Nim compiler which aid in
+ # bootstrapping:
+ cd csources
+ ./build.sh
+ cd -
- msg2 'Building Nim...'
+ # Build a release version of the "koch" maintenance program:
./bin/nim c -d:release koch
- ./koch boot -d:release -d:nativeStacktrace -d:useGnuReadline
-
- if [[ "$_pdf" == true ]]; then
- msg2 'Building Nim PDF documentation...'
- ./koch pdf
- fi
-
- msg2 'Building Nimble...'
- ./koch nimble
-
- msg2 'Building nimgrep and nimsuggest...'
+ # Build a release version of the nim compiler:
+ ./koch boot -d:release -d:nativeStacktrace
+ # Build nimsuggest, nimgrep, and nimpretty:
./koch tools
- msg2 'Building libnimrtl...'
- pushd lib
- ../bin/nim c --app:lib -d:createNimRtl -d:release nimrtl.nim
- popd
+ # Build nimrtl.nim:
+ cd lib
+ ../bin/nim c --app:lib -d:createNimRtl -d:release nimrtl.nim
+ cd -
}
package_nim-git() {
- pkgdesc="Compiled, garbage-collected systems programming language which has an excellent productivity/performance ratio"
- url="https://github.com/nim-lang/Nim"
+ url="https://nim-lang.org/"
license=('MIT')
options=('!emptydirs')
provides=('nim')
conflicts=('nim')
- cd "$srcdir/Nim"
+ cd Nim
- msg2 'Installing Nim license...'
- install -Dm 644 "copying.txt" -t "$pkgdir/usr/share/licenses/nim"
+ # License
+ install -dm 755 "${pkgdir}/usr/share/licenses/nim"
+ install -m 644 "copying.txt" "${pkgdir}/usr/share/licenses/nim/LICENSE"
- 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"
+ # Docs
+ install -dm 755 "${pkgdir}/usr/share/doc/nim"
+ cp -dpr --no-preserve=ownership \
+ examples web doc/* \
+ -t "${pkgdir}/usr/share/doc/nim"
- msg2 'Installing Nim wiki...'
- cp -dpr --no-preserve=ownership "$srcdir/Nim.wiki" \
- "$pkgdir/usr/share/doc/nim/wiki"
+ # Docs: Wiki
+ cp -dpr --no-preserve=ownership \
+ "${srcdir}/Nim.wiki" \
+ "${pkgdir}/usr/share/doc/nim/wiki"
- msg2 'Installing Nim...'
- ./koch install "$pkgdir"
+ # Nim
+ ./koch install "${pkgdir}"
install -Dm 755 bin/{nim,nimgrep} -t "$pkgdir/usr/bin"
- cd "$pkgdir/nim"
- install -dm 755 "$pkgdir/etc" "$pkgdir/usr/lib/nim"
+ cd "${pkgdir}/nim"
+ install -dm 755 "${pkgdir}"/{etc,usr/lib/nim}
find lib -mindepth 1 -maxdepth 1 -exec \
- cp -dpr --no-preserve=ownership '{}' "$pkgdir/usr/lib/nim" \;
+ cp -dpr --no-preserve=ownership '{}' -t "$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"
+ cp -dpr --no-preserve=ownership '{}' -t "$pkgdir/etc/" \;
+ cp -dpr --no-preserve=ownership \
+ "$srcdir/Nim/lib/packages" \
+ -t "$pkgdir/usr/lib/nim"
+
+ # Workaround Nim's nonstandard header file placement
+ # (https://bugs.archlinux.org/task/50252):
+ 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...'
+ # Fix unusual placement of shared object files:
ln -s "/usr/lib/nim/libnimrtl.so" "$pkgdir/usr/lib/libnimrtl.so"
- msg2 'Cleaning up pkgdir...'
+ # Clean up $pkgdir
+ rm -rf "$pkgdir/nim"
find "$pkgdir" -type d -name .git -exec rm -r '{}' +
find "$pkgdir" -type f -name .gitignore -exec rm -r '{}' +
- rm -rf "$pkgdir/nim"
}
package_nimble-git() {
@@ -121,15 +132,16 @@ package_nimble-git() {
provides=('nimble')
conflicts=('nimble')
- cd "$srcdir/nimble"
+ cd nimble
- msg2 'Installing Nimble license...'
- install -Dm 644 license.txt -t "$pkgdir/usr/share/licenses/nimble"
+ # License
+ install -dm 755 "${pkgdir}/usr/share/licenses/nimble"
+ install -Dm 644 license.txt "${pkgdir}/usr/share/licenses/nimble/LICENSE"
- msg2 'Installing Nimble documentation...'
+ # Docs
install -Dm 644 *.markdown -t "$pkgdir/usr/share/doc/nimble"
- msg2 'Installing Nimble...'
+ # Nimble
install -Dm 755 "$srcdir/Nim/bin/nimble" -t "$pkgdir/usr/bin"
# Nimble looks for nimscriptapi.nim in /usr/bin/nimblepkg/, of all places.
@@ -137,18 +149,32 @@ package_nimble-git() {
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"
+ # Bash completion
+ install -Dm 644 \
+ nimble.bash-completion \
+ "${pkgdir}/usr/share/bash-completion/completions/nimble"
}
package_nimsuggest-git() {
- pkgdesc="Tool for providing auto completion data for Nim source code"
+ pkgdesc="Nimsuggest is a tool that helps to give editors IDE like capabilities."
url="https://github.com/nim-lang/nimsuggest"
license=('MIT')
provides=('nimsuggest')
conflicts=('nimsuggest')
- msg2 'Installing Nimsuggest...'
- install -Dm 755 "$srcdir/Nim/bin/nimsuggest" -t "$pkgdir/usr/bin"
+ # Nimsuggest
+ install -Dm 755 "Nim/bin/nimsuggest" -t "${pkgdir}/usr/bin"
}
+
+package_nimpretty-git() {
+ pkgdesc="Standard tool for pretty printing."
+ url="https://github.com/nim-lang/Nim/tree/devel/nimpretty"
+ license=('MIT')
+ provides=('nimpretty')
+ conflicts=('nimpretty')
+
+ # Nimpretty
+ install -Dm 755 "Nim/bin/nimpretty" -t "${pkgdir}/usr/bin"
+}
+
+# vim: sw=2 ts=2 et:
diff --git a/makepkg-conf.patch b/makepkg-conf.patch
new file mode 100644
index 000000000000..56b36b0eda3f
--- /dev/null
+++ b/makepkg-conf.patch
@@ -0,0 +1,25 @@
+From 36f5830ea50af5c3c21fc0e132d25273c0391879 Mon Sep 17 00:00:00 2001
+From: Dan Beste <dan.ray.beste@gmail.com>
+Date: Mon, 24 Sep 2018 11:19:01 -0500
+Subject: [PATCH] C{,XX}FLAG normalization
+
+---
+ build.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/build.sh b/build.sh
+index 3caee529..b4fdda14 100755
+--- a/build.sh
++++ b/build.sh
+@@ -40,7 +40,7 @@ done
+
+ CC="gcc"
+ LINKER="gcc"
+-COMP_FLAGS="${CPPFLAGS:-} ${CFLAGS:-} -w -O3 -fno-strict-aliasing$extraBuildArgs"
++COMP_FLAGS="${CPPFLAGS:-} ${CFLAGS:-} -w -fno-strict-aliasing"
+ LINK_FLAGS="${LDFLAGS:-} "
+ PS4=""
+ # platform detection
+--
+2.19.0
+