Search
SailfishOS Open Build Service
>
Projects
>
home:fooxl
:
sailfish
>
go
> go.spec
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File go.spec of Package go
%define debug_package %{nil} # strip will cause Go's .a archives to become invalid because strip appears to # reassemble the archive incorrectly. This is a known issue upstream # (https://github.com/golang/go/issues/17890), but we have to deal with it in # the meantime. %undefine _build_create_debug %define __arch_install_post export NO_BRP_STRIP_DEBUG=true %define with_gccgo 0 Name: go Version: 1.10 Release: 1 Summary: A compiled, garbage-collected, concurrent programming language License: BSD-3-Clause Group: Development/Languages/Other Url: http://golang.org Source0: http://go.googlecode.com/files/go%{version}.src.tar.gz #Patch0: default-buildmode-pie.patch #BuildRequires: go-bin BuildRequires: go1.4 Provides: go-devel = %{name}%{version} Provides: go-devel-static = %{name}%{version} Obsoletes: go-devel < %{name}%{version} #The Go compilers support three instruction sets. There are important differences in the quality of the compilers for the different architectures. ExclusiveArch: %ix86 x86_64 %arm %if %{with_gccgo} Requires: gcc %endif %description Go is an expressive, concurrent, garbage collected systems programming language that is type safe and memory safe. It has pointers but no pointer arithmetic. Go has fast builds, clean syntax, garbage collection, methods for any type, and run-time reflection. It feels like a dynamic language but has the speed and safety of a static language. %package doc Summary: Go documentation Group: Documentation/Other Requires: %{name} = %{version} %description doc Go examples and documentation. %prep # setup go_arch (BSD-like scheme) %ifarch %ix86 # 386 (a.k.a. x86 or x86-32); 8g,8l,8c,8a %define go_arch 386 %endif %ifarch x86_64 # amd64 (a.k.a. x86-64); 6g,6l,6c,6a %define go_arch amd64 %endif %ifarch %arm # arm (a.k.a. ARM); 5g,5l,5c,5a %define go_arch arm #Starting from Go 1.1, the appropriate GOARM value will be chosen if you compile Go from source on the target machine. In cross compilation situations, it is recommended that you always export an appropriate GOARM value. #ARMv6 supported GOARM=6 is the default value %endif %setup -q -n %{name} #%patch0 -p1 %build # Remove the pre-included .sysos, to avoid shipping things we didn't compile # (which is against the openSUSE guidelines for packaging). find . -type f -name '*.syso' -exec rm -vf {} \; %if %{with_gccgo} export GOROOT_BOOTSTRAP=%{_prefix} %else export GOROOT_BOOTSTRAP=%{_libdir}/go1.4 %endif export GOROOT_FINAL=%{_libdir}/go export GOARCH=%{go_arch} export GOOS=linux export GOROOT="`pwd`" export GOBIN="$GOROOT/bin" export GOPATH="%{_builddir}" mkdir -p "$GOBIN" cd src HOST_EXTRA_CFLAGS="%{optflags} -Wno-error" ./make.bash -v #%if ! 0%{?qemu_user_space_build} echo "check: running tests on uninstalled code" export GOBIN="$GOROOT/bin" export PATH="$GOBIN:$PATH" bash run.bash --no-rebuild #%endif %install # https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/go #go 1.10 opensuse: https://build.opensuse.org/package/view_file/devel:languages:go/go1.10/go1.10.spec?expand=1 export GOROOT="%{buildroot}%{_libdir}/go" # locations for third party libraries, see README-openSUSE for info about locations. install -d %{buildroot}%{_datadir}/go/contrib install -d $GOROOT/contrib/pkg/linux_%{go_arch} ln -s %{_libdir}/go/contrib/pkg/ %{buildroot}%{_datadir}/go/contrib/pkg install -d %{buildroot}%{_datadir}/go/contrib/cmd install -d %{buildroot}%{_datadir}/go/contrib/src ln -s %{_datadir}/go/contrib/src/ %{buildroot}%{_libdir}/go/contrib/src # source files for go install, godoc, etc install -d %{buildroot}%{_datadir}/go for ext in *.{go,c,h,s,S,py,syso}; do find src -name ${ext} -exec install -Dm644 \{\} %{buildroot}%{_datadir}/go/\{\} \; done mkdir -p $GOROOT/src for i in $(ls %{buildroot}/usr/share/go/src);do ln -s /usr/share/go/src/$i $GOROOT/src/$i done # add lib files that are needed (such as the timezone database). install -d $GOROOT/lib find lib -type f -exec install -D -m644 {} $GOROOT/{} \; # copy document templates, packages, obj libs and command utilities mkdir -p $GOROOT/bin # remove bootstrap rm -rf pkg/bootstrap mv pkg $GOROOT mv bin/* $GOROOT/bin mkdir -p $GOROOT/misc/trace mv misc/trace/*.html $GOROOT/misc/trace rm -f %{buildroot}%{_bindir}/{hgpatch,quietgcc} install -d %{buildroot}%{_bindir} ln -sf /usr/lib/go/bin/go "%{buildroot}%{_bindir}/go" ln -sf /usr/lib/go/bin/gofmt "%{buildroot}%{_bindir}/gofmt" #ln -sf /usr/share/doc/go "$GOROOT_FINAL/doc" # documentation and examples # fix documetation permissions (rpmlint warning) find doc/ misc/ -type f -exec chmod 0644 '{}' \; # remove unwanted arch-dependant binaries (rpmlint warning) rm -rf misc/cgo/test/{_*,*.o,*.out,*.6,*.8} # prepare go-doc mkdir -p %{buildroot}%{_docdir}/go cp -r AUTHORS CONTRIBUTORS CONTRIBUTING.md LICENSE PATENTS README.md %{buildroot}%{_docdir}/go cp -r doc/* %{buildroot}%{_docdir}/go %pre %post %preun %postun %files %defattr(-,root,root,-) %doc AUTHORS CONTRIBUTORS CONTRIBUTING.md LICENSE PATENTS README.md %{_bindir}/go* %{_libdir}/go/ %{_datadir}/go/ %files doc %defattr(-,root,root,-) %doc %{_docdir}/go %changelog