wok-next view go/receipt @ rev 21727

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