summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorspider-mario2015-06-20 12:42:18 +0200
committerspider-mario2015-06-20 12:45:09 +0200
commit6cfea1d77588dda37b5c291edc79ebfff3bd439d (patch)
treeb4e7f1b12df99531a824b1efb4b313aad80ae1b0
downloadaur-6cfea1d77588dda37b5c291edc79ebfff3bd439d.tar.gz
aur4 port
-rw-r--r--.SRCINFO58
-rw-r--r--PKGBUILD125
-rw-r--r--rust.install19
3 files changed, 202 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..034a475cf013
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,58 @@
+pkgbase = rust-git
+ pkgdesc = A safe, concurrent, practical language from Mozilla.
+ pkgver = 1.0.0.beta.2833.gb850046
+ pkgrel = 1
+ epoch = 3
+ url = http://www.rust-lang.org/
+ arch = i686
+ arch = x86_64
+ license = MIT
+ license = Apache
+ makedepends = git
+ makedepends = gcc
+ makedepends = curl
+ makedepends = libffi
+ makedepends = python2
+ optdepends = haskell-pandoc: to build the documentation
+ optdepends = emacs: to build the emacs mode
+ source = git+https://github.com/rust-lang/rust.git
+ source = git+https://github.com/rust-lang/compiler-rt.git
+ source = git+https://github.com/rust-lang/jemalloc.git
+ source = git+https://github.com/rust-lang/llvm.git
+ source = git+https://github.com/rust-lang/hoedown.git
+ source = git+https://github.com/rust-lang/rust-installer.git
+ source = git+https://github.com/rust-lang/rust.vim.git
+ source = git+https://github.com/rust-lang/rust-mode.git
+ source = git+https://github.com/rust-lang/gedit-config.git
+ source = git+https://github.com/rust-lang/nano-config.git
+ source = git+https://github.com/rust-lang/zsh-config.git
+ sha512sums = SKIP
+ sha512sums = SKIP
+ sha512sums = SKIP
+ sha512sums = SKIP
+ sha512sums = SKIP
+ sha512sums = SKIP
+ sha512sums = SKIP
+ sha512sums = SKIP
+ sha512sums = SKIP
+ sha512sums = SKIP
+ sha512sums = SKIP
+
+pkgname = rust-git
+ install = rust.install
+ depends = shared-mime-info
+ optdepends = rust-doc-git: language and API documentation
+ provides = rust
+ conflicts = rust
+ options = staticlibs
+
+pkgname = rust-doc-git
+ pkgdesc = A safe, concurrent, practical language from Mozilla. (Language and API documentation)
+ arch = any
+ optdepends = rust-git: to compile and run the programs you can write using this documentation
+ provides = rust-doc
+ conflicts = rust-doc
+ options =
+ options = !strip
+ options = !emptydirs
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..f44d04b8c35d
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,125 @@
+# Maintainer: spider-mario <spidermario@free.fr>
+# Contributor: Taras Shpot <mrshpot@gmail.com>
+pkgname=('rust-git' 'rust-doc-git')
+pkgver=1.0.0.beta.2833.gb850046
+epoch=3
+pkgrel=1
+pkgdesc="A safe, concurrent, practical language from Mozilla."
+arch=('i686' 'x86_64')
+url="http://www.rust-lang.org/"
+license=('MIT' 'Apache')
+makedepends=('git' 'gcc' 'curl'
+ 'libffi' 'python2')
+optdepends=('haskell-pandoc: to build the documentation'
+ 'emacs: to build the emacs mode')
+source=("git+https://github.com/rust-lang/rust.git"
+ "git+https://github.com/rust-lang/compiler-rt.git"
+ "git+https://github.com/rust-lang/jemalloc.git"
+ "git+https://github.com/rust-lang/llvm.git"
+ "git+https://github.com/rust-lang/hoedown.git"
+ "git+https://github.com/rust-lang/rust-installer.git"
+
+ "git+https://github.com/rust-lang/rust.vim.git"
+ "git+https://github.com/rust-lang/rust-mode.git"
+ "git+https://github.com/rust-lang/gedit-config.git"
+ "git+https://github.com/rust-lang/nano-config.git"
+ "git+https://github.com/rust-lang/zsh-config.git")
+_noclone=(compiler-rt jemalloc llvm hoedown rust-installer)
+sha512sums=('SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP')
+
+pkgver() {
+ cd rust
+ git describe | sed -e 's/^release-//' -e 'y/-/./'
+}
+
+prepare() {
+ rm -rf -- "${_noclone[@]}"
+
+ cd rust
+ _srcdest="$SRCDEST" perl -pi -- /dev/stdin .gitmodules <<'END'
+ if (m{(?<assignment> \s* url \s* = \s*) .* / (?<submodule> [^/]*?)(?:\.git)?$}x) {
+ my $local = "$ENV{_srcdest}/$+{submodule}";
+ $_ = "$+{assignment}$local\n" if -d $local;
+ }
+END
+}
+
+build() {
+ cd rust
+
+ # src/rust/src/compiler-rt/make/platform/clang_linux.mk only exports LANG
+ # when parsing the output of gcc -v. Let us set LC_ALL as well.
+ export LANG=C LC_ALL=C
+
+ ./configure --prefix=/usr --disable-rpath
+ make all
+}
+
+package_rust-git() {
+ depends=('shared-mime-info')
+ optdepends=('rust-doc-git: language and API documentation')
+ provides=('rust')
+ conflicts=('rust')
+ options=('staticlibs')
+ install=rust.install
+
+ cd rust
+
+ make DESTDIR="$pkgdir" install
+ rm -fr "$pkgdir"/usr/share/doc/rust/html
+
+ rm -f "$pkgdir"/usr/lib/rustlib/{components,manifest-rustc,manifest-rust-docs,rust-installer-version,install.log,uninstall.sh}
+
+ install --directory "$pkgdir"/usr/share/licenses/rust-git/
+ install -m644 COPYRIGHT LICENSE-* "$pkgdir"/usr/share/licenses/rust-git/
+
+ install --directory "$pkgdir"/usr/share/vim/vimfiles/
+ cp -a "$srcdir"/rust.vim/*/ "$pkgdir"/usr/share/vim/vimfiles/
+
+ cp -a "$srcdir"/gedit-config/share "$pkgdir"/usr/
+
+ install --directory "$pkgdir"/usr/share/zsh/functions/Completion/Zsh/
+ cp -a "$srcdir"/zsh-config/_* "$pkgdir"/usr/share/zsh/functions/Completion/Zsh/
+
+ install --directory "$pkgdir"/usr/share/nano/
+ cp -a "$srcdir"/nano-config/*.nanorc "$pkgdir"/usr/share/nano/
+
+ cd "$srcdir"/rust-mode
+ emacs --eval '(byte-recompile-directory "." 0)' --quick --batch 2> /dev/null || true
+ install --directory "$pkgdir"/usr/share/emacs/site-lisp/
+ cp -a rust-mode.* "$pkgdir"/usr/share/emacs/site-lisp/
+}
+
+package_rust-doc-git() {
+ pkgdesc="A safe, concurrent, practical language from Mozilla. (Language and API documentation)"
+ arch=('any')
+ options+=('!strip' '!emptydirs')
+ optdepends=('rust-git: to compile and run the programs you can write using this documentation')
+ provides=('rust-doc')
+ conflicts=('rust-doc')
+
+ cd rust
+
+ _docdir="$pkgdir"/usr/share/doc/rust
+ install --directory "$_docdir"
+ cp -r doc/* "$_docdir"/ || true
+
+ chmod -R 644 "$_docdir"
+ find "$_docdir" -type d -exec chmod 755 {} +
+ for ext in aux out log toc; do
+ rm -f "$_docdir"/*."$ext"
+ done
+
+ install --directory "$pkgdir"/usr/share/licenses/rust-doc-git/
+ install -m644 COPYRIGHT LICENSE-* "$pkgdir"/usr/share/licenses/rust-doc-git/
+}
diff --git a/rust.install b/rust.install
new file mode 100644
index 000000000000..b51d20561be6
--- /dev/null
+++ b/rust.install
@@ -0,0 +1,19 @@
+update_mime() {
+ update-mime-database usr/share/mime >/dev/null
+}
+
+post_install() {
+ update_mime
+
+ echo ""
+ echo "==> Remember to add (require 'rust-mode) to your ~/.emacs if you wish to use it."
+ echo ""
+}
+
+post_upgrade() {
+ post_install "$@"
+}
+
+post_remove() {
+ update_mime
+}