wok-next annotate go/receipt @ rev 20779
typo
author | Erkan Yilmaz <erkan@slitaz.org> |
---|---|
date | Fri Jun 08 09:48:36 2018 +0000 (2018-06-08) |
parents | 8164c0612ccf |
children | d5aab818505e |
rev | line source |
---|---|
pascal@20185 | 1 # SliTaz package receipt v2. |
domcox@16005 | 2 |
domcox@16005 | 3 PACKAGE="go" |
al@20777 | 4 VERSION="1.10.2" |
domcox@16005 | 5 CATEGORY="development" |
al@20383 | 6 SHORT_DESC="The Go programming language" |
domcox@16005 | 7 MAINTAINER="domcox@slitaz.org" |
domcox@16005 | 8 LICENSE="BSD" |
al@20383 | 9 WEB_SITE="http://golang.org/" |
domcox@16005 | 10 |
al@20777 | 11 TARBALL="$PACKAGE$VERSION.src.tar.gz" |
al@20777 | 12 WGET_URL="https://dl.google.com/go/$TARBALL" |
domcox@16005 | 13 |
al@20383 | 14 BUILD_DEPENDS="go-bin bash bison make ed" |
al@20383 | 15 SPLIT="go-sources emacs-pkg-go-mode go" |
al@20383 | 16 |
al@20383 | 17 compile_rules() { |
domcox@16005 | 18 cd $src/src |
domcox@16005 | 19 |
domcox@16005 | 20 # Setting up environnment before building go. |
domcox@16005 | 21 # For more information, see: http://golang.org/doc/install/source |
domcox@16005 | 22 |
domcox@16005 | 23 # Go tree, binaries and scripts locations. |
domcox@16005 | 24 export GOROOT_FINAL=/usr/lib/go |
al@20383 | 25 export GOROOT_BOOTSTRAP=/usr/lib/go |
domcox@16005 | 26 |
domcox@16005 | 27 # Support all x86 chips (Pentium MMX or later) |
domcox@16005 | 28 # or optionaly only Pentium 4/Opteron/Athlon 64 or later. |
domcox@16005 | 29 export GO386=387 # Pentium MMX or later |
domcox@16005 | 30 # export GO386=sse2 # Pentium 4/Opteron/Athlon 64 or later |
domcox@16005 | 31 |
domcox@16005 | 32 # Target operating system (optional). |
domcox@16005 | 33 export GOOS=linux |
domcox@16005 | 34 |
domcox@16005 | 35 # Target compilation architecture. |
domcox@16005 | 36 case $ARCH in |
domcox@16005 | 37 x86_64) |
domcox@16005 | 38 # A mature implementation. The compiler has an effective optimizer |
domcox@16005 | 39 # (registerizer) and generates good code (although gccgo can do |
domcox@16005 | 40 # noticeably better sometimes). |
domcox@16005 | 41 export GOARCH="amd64" ;; |
domcox@16005 | 42 i486) |
domcox@16005 | 43 # Comparable to the amd64 |
domcox@16005 | 44 export GOARCH="386" ;; |
domcox@16005 | 45 arm) |
domcox@16005 | 46 # Supports Linux, FreeBSD and NetBSD binaries. Less widely used |
domcox@16005 | 47 # than the other ports. |
domcox@16005 | 48 export GOARCH="arm" |
domcox@16005 | 49 # ARM11 (VFPv1) or better cores + cross-compiling. |
domcox@16005 | 50 export GOARM=6 ;; |
domcox@16005 | 51 esac |
domcox@16005 | 52 |
domcox@16005 | 53 # Build go |
al@20383 | 54 /bin/bash make.bash --no-clean || return 1 |
al@20383 | 55 |
al@20383 | 56 # Installation |
al@20383 | 57 mkdir -p $install$GOROOT_FINAL/src |
al@20383 | 58 # bin |
al@20383 | 59 cp -a $src/bin $install/usr |
al@20383 | 60 # go tree |
al@20383 | 61 cp -a $src/pkg $install$GOROOT_FINAL |
al@20383 | 62 # lib |
al@20383 | 63 cp -a $src/lib $install$GOROOT_FINAL |
al@20383 | 64 # include |
al@20383 | 65 cp -a $src/include $install$GOROOT_FINAL |
al@20383 | 66 # pkg |
al@20383 | 67 cp -a $src/src/pkg $install$GOROOT_FINAL/src |
al@20383 | 68 cp -a $src/src/cmd $install$GOROOT_FINAL/src |
al@20383 | 69 cp -a $src/src/lib9 $install$GOROOT_FINAL/src |
al@20383 | 70 |
al@20383 | 71 mkdir -p $install/usr/share/emacs/site-lisp/site-start.d |
al@20383 | 72 cp -a $stuff/80-go-init.el $install/usr/share/emacs/site-lisp/site-start.d |
al@20383 | 73 mkdir -p $install/usr/share/emacs/site-lisp/go-mode |
al@20383 | 74 cp -a $src/misc/emacs/* $install/usr/share/emacs/site-lisp/go-mode |
al@20383 | 75 |
al@20383 | 76 # misc |
al@20383 | 77 mkdir -p $install$GOROOT_FINAL/misc |
al@20383 | 78 for dir in arm cgo goplay swig; do |
al@20383 | 79 cp -a $src/misc/$dir $install$GOROOT_FINAL/misc |
al@20383 | 80 done |
al@20383 | 81 |
al@20383 | 82 # test |
al@20383 | 83 cp -a $src/test/ $install$GOROOT_FINAL |
al@20383 | 84 |
al@20383 | 85 # doc |
al@20383 | 86 cp -a $src/doc/ $install$GOROOT_FINAL |
al@20383 | 87 |
al@20383 | 88 # tools |
al@20383 | 89 mkdir -p $install$GOROOT_FINAL/src |
al@20383 | 90 cp -a $src/src/*.bash $install$GOROOT_FINAL/src |
al@20383 | 91 cp -a $src/src/*.rc $install$GOROOT_FINAL/src |
domcox@16005 | 92 } |
domcox@16005 | 93 |
al@20383 | 94 genpkg_rules() { |
pascal@20185 | 95 case $PACKAGE in |
al@20383 | 96 go-sources) |
al@20383 | 97 copy /usr/lib/go/misc/ \ |
al@20383 | 98 /usr/lib/go/test/ \ |
al@20383 | 99 /usr/lib/go/src/ |
al@20383 | 100 CAT="development|sources files" |
al@20383 | 101 TAGS="go" |
al@20383 | 102 DEPENDS="go" |
al@20383 | 103 ;; |
al@20383 | 104 emacs-pkg-go-mode) |
al@20383 | 105 copy 80-go-init.el go-mode/ |
al@20383 | 106 CAT="development|an Emacs major mode for editing Go code" |
al@20383 | 107 TAGS="emacs go" |
al@20383 | 108 DEPENDS="emacs" |
al@20383 | 109 ;; |
al@20383 | 110 go) |
al@20383 | 111 copy @std @rm |
al@20383 | 112 TAGS="go" |
al@20383 | 113 DEPENDS="" |
al@20383 | 114 ;; |
pascal@20185 | 115 esac |
domcox@16005 | 116 } |
pascal@20185 | 117 |
al@20383 | 118 post_install_emacs_pkg_go_mode() { |
pascal@20185 | 119 chroot "$1/" tazpkg reconfigure emacs |
pascal@20185 | 120 } |
pascal@20185 | 121 |
al@20383 | 122 post_remove_emacs_pkg_go_mode() { |
pascal@20185 | 123 chroot "$1/" tazpkg reconfigure emacs |
pascal@20185 | 124 } |