Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
aports
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
650
Issues
650
List
Boards
Labels
Service Desk
Milestones
Merge Requests
215
Merge Requests
215
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alpine
aports
Commits
f5c4b298
Commit
f5c4b298
authored
Feb 23, 2017
by
Timo Teräs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
community/go: cross-build support
parent
fb8794ef
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
7 deletions
+35
-7
community/go/APKBUILD
community/go/APKBUILD
+30
-6
scripts/bootstrap.sh
scripts/bootstrap.sh
+5
-1
No files found.
community/go/APKBUILD
View file @
f5c4b298
...
...
@@ -15,24 +15,37 @@ makedepends="bash go-bootstrap"
options
=
"!strip"
provides
=
"go-bootstrap=
$pkgver
-r
$pkgrel
"
install
=
""
subpackages
=
"
$pkgname
-doc
$pkgname
-tools
"
subpackages
=
"
$pkgname
-doc"
source
=
"http://golang.org/dl/go
${
pkgver
/_/
}
.src.tar.gz
$pkgname
-tools-
${
pkgver
/_/
}
.tar.gz::https://github.com/golang/tools/archive/
${
_toolsver
}
.tar.gz
go
-tools-
${
pkgver
/_/
}
.tar.gz::https://github.com/golang/tools/archive/
${
_toolsver
}
.tar.gz
default-buildmode-pie.patch
"
# NOTE: building go for x86 with grsec kernel requires:
# sysctl -w kernel.modify_ldt=1
_gotools
=
"cover godoc stringer"
_tooldir
=
"
$srcdir
"
/tools-
${
_toolsver
}
if
[
"
$CBUILD
"
=
"
$CTARGET
"
]
;
then
makedepends
=
"go-bootstrap
$makedepends
"
provides
=
"go-bootstrap=
$pkgver
-r
$pkgrel
"
subpackages
=
"
$subpackages
$pkgname
-tools"
_gotools
=
"cover godoc stringer"
_gocross
=
"darwin freebsd openbsd windows"
else
pkgname
=
"go-bootstrap"
makedepends
=
"go
$makedepends
"
# Go expect host linker instead of the cross-compiler
export
CC_FOR_TARGET
=
"
$CC
"
export
CC
=
"
${
HOSTLD
:-
gcc
}
"
export
CXX
=
"
${
HOSTLD
:-
g
++
}
"
export
LD
=
"
${
HOSTLD
:-
ld
}
"
fi
_
gocross
=
"darwin freebsd openbsd windows"
_
tooldir
=
"
$srcdir
"
/tools-
${
_toolsver
}
for
os
in
$_gocross
;
do
subpackages
=
"
$subpackages
$pkgname
-cross-
${
os
}
:_crosspkg"
done
builddir
=
"
$srcdir
"
/
$pkgname
builddir
=
"
$srcdir
"
/
go
build
()
{
cd
"
$builddir
/src"
...
...
@@ -46,6 +59,7 @@ build() {
*
)
die
"Unsupported arch"
;;
esac
export
GOOS
=
"linux"
export
GOPATH
=
"
$srcdir
"
export
GOROOT
=
"
$builddir
"
export
GOBIN
=
"
$GOROOT
"
/bin
...
...
@@ -64,6 +78,16 @@ build() {
done
done
# copied from bootstrap.bash to fixup cross-built bootstrap go
if
[
"
$CBUILD
"
!=
"
$CTARGET
"
]
;
then
local
gohostos
=
"
$(
../bin/go
env
GOHOSTOS
)
"
local
gohostarch
=
"
$(
../bin/go
env
GOHOSTARCH
)
"
mv
../bin/
*
_
*
/
*
../bin
rmdir
../bin/
*
_
*
rm
-rf
"../pkg/
${
gohostos
}
_
${
gohostarch
}
"
*
"../pkg/tool/
${
gohostos
}
_
${
gohostarch
}
"
*
rm
-rf
../pkg/bootstrap ../pkg/obj
fi
# FIXME some tests fail:
# PATH="$GOROOT/bin:$PATH" ./run.bash -no-rebuild || return 1
...
...
scripts/bootstrap.sh
View file @
f5c4b298
...
...
@@ -20,7 +20,10 @@ CBUILDROOT="$(CTARGET=$TARGET_ARCH . /usr/share/abuild/functions.sh ; echo $CBUI
[
-e
"
$APORTS
/main/build-base"
]
||
die
"Unable to deduce aports base checkout"
apkbuildname
()
{
echo
$APORTS
/main/
$1
/APKBUILD
local
repo
=
"
${
1
%%/*
}
"
local
pkg
=
"
${
1
##*/
}
"
[
"
$repo
"
=
"
$1
"
]
&&
repo
=
"main"
echo
$APORTS
/
$repo
/
$pkg
/APKBUILD
}
msg
()
{
...
...
@@ -100,6 +103,7 @@ for PKG in fortify-headers linux-headers musl libc-dev pkgconf zlib \
attr libcap patch
sudo
acl fakeroot
tar
\
pax-utils abuild openssh
\
ncurses util-linux lvm2 popt xz cryptsetup kmod lddtree mkinitfs
\
community/go
\
$KERNEL_PKG
;
do
CHOST
=
$TARGET_ARCH
BOOTSTRAP
=
bootimage
APKBUILD
=
$(
apkbuildname
$PKG
)
abuild
-r
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment