wok-next view go/receipt @ rev 21383

updated nbd again (3.3 -> 3.20)
author Hans-G?nter Theisgen
date Thu Apr 16 17:34:38 2020 +0100 (2020-04-16)
parents fb26e10987dc
children bb7e704ffcaf
line source
1 # SliTaz package receipt v2.
3 PACKAGE="go"
4 VERSION="1.10.2"
5 CATEGORY="development"
6 SHORT_DESC="The Go programming language"
7 MAINTAINER="devel@slitaz.org"
8 LICENSE="BSD"
9 WEB_SITE="https://golang.org/"
11 TARBALL="$PACKAGE$VERSION.src.tar.gz"
12 WGET_URL="https://dl.google.com/go/$TARBALL"
14 BUILD_DEPENDS="go-bin bash bison make ed"
15 SPLIT="$PACKAGE-sources emacs-pkg-go-mode $PACKAGE"
17 compile_rules() {
18 cd $src/src
20 # Setting up environnment before building go.
21 # For more information, see: http://golang.org/doc/install/source
23 # Go tree, binaries and scripts locations.
24 export GOROOT_FINAL=/usr/lib/go
25 export GOROOT_BOOTSTRAP=/usr/lib/go
27 # Support all x86 chips (Pentium MMX or later)
28 # or optionaly only Pentium 4/Opteron/Athlon 64 or later.
29 export GO386=387 # Pentium MMX or later
30 # export GO386=sse2 # Pentium 4/Opteron/Athlon 64 or later
32 # Target operating system (optional).
33 export GOOS=linux
35 # Target compilation architecture.
36 case $ARCH in
37 x86_64)
38 # A mature implementation. The compiler has an effective optimizer
39 # (registerizer) and generates good code (although gccgo can do
40 # noticeably better sometimes).
41 export GOARCH="amd64";;
42 i486)
43 # Comparable to the amd64
44 export GOARCH="386";;
45 esac
47 # Build go
48 /bin/bash make.bash --no-clean || return 1
50 # Installation
51 mkdir -p $install$GOROOT_FINAL/src
52 # bin
53 cp -a $src/bin $install/usr
54 # go tree
55 cp -a $src/pkg $install$GOROOT_FINAL
56 # lib
57 cp -a $src/lib $install$GOROOT_FINAL
58 # include
59 cp -a $src/include $install$GOROOT_FINAL
60 # pkg
61 cp -a $src/src/pkg $install$GOROOT_FINAL/src
62 cp -a $src/src/cmd $install$GOROOT_FINAL/src
63 cp -a $src/src/lib9 $install$GOROOT_FINAL/src
65 mkdir -p $install/usr/share/emacs/site-lisp/site-start.d
66 cp -a $stuff/80-go-init.el $install/usr/share/emacs/site-lisp/site-start.d
67 mkdir -p $install/usr/share/emacs/site-lisp/go-mode
68 cp -a $src/misc/emacs/* $install/usr/share/emacs/site-lisp/go-mode
70 # misc
71 mkdir -p $install$GOROOT_FINAL/misc
72 for dir in arm cgo goplay swig; do
73 cp -a $src/misc/$dir $install$GOROOT_FINAL/misc
74 done
76 # test
77 cp -a $src/test/ $install$GOROOT_FINAL
79 # doc
80 cp -a $src/doc/ $install$GOROOT_FINAL
82 # tools
83 mkdir -p $install$GOROOT_FINAL/src
84 cp -a $src/src/*.bash $install$GOROOT_FINAL/src
85 cp -a $src/src/*.rc $install$GOROOT_FINAL/src
86 }
88 genpkg_rules() {
89 case $PACKAGE in
90 go-sources)
91 copy /usr/lib/go/misc/ \
92 /usr/lib/go/test/ \
93 /usr/lib/go/src/
94 CAT="development|sources files"
95 TAGS="go"
96 DEPENDS="go"
97 ;;
98 emacs-pkg-go-mode)
99 copy 80-go-init.el go-mode/
100 CAT="development|an Emacs major mode for editing Go code"
101 TAGS="emacs go"
102 DEPENDS="emacs"
103 ;;
104 go)
105 copy @std @rm
106 TAGS="go"
107 DEPENDS=" "
108 ;;
109 esac
110 }
112 post_install_emacs_pkg_go_mode() {
113 chroot "$1/" tazpkg reconfigure emacs
114 }
116 post_remove_emacs_pkg_go_mode() {
117 chroot "$1/" tazpkg reconfigure emacs
118 }