wok-next annotate go/receipt @ rev 21020

Cleaning is almost finished... I should proceed to upgrades.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Fri Nov 02 14:15:08 2018 +0200 (2018-11-02)
parents fb26e10987dc
children bb7e704ffcaf
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"
al@21020 7 MAINTAINER="devel@slitaz.org"
domcox@16005 8 LICENSE="BSD"
al@21020 9 WEB_SITE="https://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@21020 15 SPLIT="$PACKAGE-sources emacs-pkg-go-mode $PACKAGE"
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).
al@21020 41 export GOARCH="amd64";;
domcox@16005 42 i486)
domcox@16005 43 # Comparable to the amd64
al@21020 44 export GOARCH="386";;
domcox@16005 45 esac
domcox@16005 46
domcox@16005 47 # Build go
al@20383 48 /bin/bash make.bash --no-clean || return 1
al@20383 49
al@20383 50 # Installation
al@20383 51 mkdir -p $install$GOROOT_FINAL/src
al@20383 52 # bin
al@20383 53 cp -a $src/bin $install/usr
al@20383 54 # go tree
al@20383 55 cp -a $src/pkg $install$GOROOT_FINAL
al@20383 56 # lib
al@20383 57 cp -a $src/lib $install$GOROOT_FINAL
al@20383 58 # include
al@20383 59 cp -a $src/include $install$GOROOT_FINAL
al@20383 60 # pkg
al@20383 61 cp -a $src/src/pkg $install$GOROOT_FINAL/src
al@20383 62 cp -a $src/src/cmd $install$GOROOT_FINAL/src
al@20383 63 cp -a $src/src/lib9 $install$GOROOT_FINAL/src
al@20383 64
al@20383 65 mkdir -p $install/usr/share/emacs/site-lisp/site-start.d
al@20383 66 cp -a $stuff/80-go-init.el $install/usr/share/emacs/site-lisp/site-start.d
al@20383 67 mkdir -p $install/usr/share/emacs/site-lisp/go-mode
al@20383 68 cp -a $src/misc/emacs/* $install/usr/share/emacs/site-lisp/go-mode
al@20383 69
al@20383 70 # misc
al@20383 71 mkdir -p $install$GOROOT_FINAL/misc
al@20383 72 for dir in arm cgo goplay swig; do
al@20383 73 cp -a $src/misc/$dir $install$GOROOT_FINAL/misc
al@20383 74 done
al@20383 75
al@20383 76 # test
al@20383 77 cp -a $src/test/ $install$GOROOT_FINAL
al@20383 78
al@20383 79 # doc
al@20383 80 cp -a $src/doc/ $install$GOROOT_FINAL
al@20383 81
al@20383 82 # tools
al@20383 83 mkdir -p $install$GOROOT_FINAL/src
al@20383 84 cp -a $src/src/*.bash $install$GOROOT_FINAL/src
al@20383 85 cp -a $src/src/*.rc $install$GOROOT_FINAL/src
domcox@16005 86 }
domcox@16005 87
al@20383 88 genpkg_rules() {
pascal@20185 89 case $PACKAGE in
al@20383 90 go-sources)
al@20383 91 copy /usr/lib/go/misc/ \
al@20383 92 /usr/lib/go/test/ \
al@20383 93 /usr/lib/go/src/
al@20383 94 CAT="development|sources files"
al@20383 95 TAGS="go"
al@20383 96 DEPENDS="go"
al@20383 97 ;;
al@20383 98 emacs-pkg-go-mode)
al@20383 99 copy 80-go-init.el go-mode/
al@20383 100 CAT="development|an Emacs major mode for editing Go code"
al@20383 101 TAGS="emacs go"
al@20383 102 DEPENDS="emacs"
al@20383 103 ;;
al@20383 104 go)
al@20383 105 copy @std @rm
al@20383 106 TAGS="go"
al@21020 107 DEPENDS=" "
al@20383 108 ;;
pascal@20185 109 esac
domcox@16005 110 }
pascal@20185 111
al@20383 112 post_install_emacs_pkg_go_mode() {
pascal@20185 113 chroot "$1/" tazpkg reconfigure emacs
pascal@20185 114 }
pascal@20185 115
al@20383 116 post_remove_emacs_pkg_go_mode() {
pascal@20185 117 chroot "$1/" tazpkg reconfigure emacs
pascal@20185 118 }