Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 1 | inherit cross |
| 2 | |
| 3 | DEPENDS += "go-native" |
| 4 | |
| 5 | export GOHOSTOS = "${BUILD_GOOS}" |
| 6 | export GOHOSTARCH = "${BUILD_GOARCH}" |
| 7 | export GOOS = "${TARGET_GOOS}" |
| 8 | export GOARCH = "${TARGET_GOARCH}" |
| 9 | export GOARM = "${TARGET_GOARM}" |
| 10 | export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go" |
| 11 | export GOROOT_FINAL = "${libdir}/go" |
| 12 | export CGO_ENABLED = "1" |
| 13 | export CC_FOR_TARGET="${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}" |
| 14 | export CXX_FOR_TARGET="${TARGET_PREFIX}g++ ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}" |
| 15 | CC = "${@d.getVar('BUILD_CC', True).strip()}" |
| 16 | |
| 17 | do_configure[noexec] = "1" |
| 18 | |
| 19 | do_compile() { |
| 20 | export GOBIN="${B}/bin" |
| 21 | rm -rf ${GOBIN} ${B}/pkg |
| 22 | mkdir ${GOBIN} |
| 23 | |
| 24 | export TMPDIR=${WORKDIR}/build-tmp |
| 25 | mkdir -p ${WORKDIR}/build-tmp |
| 26 | |
| 27 | cd src |
| 28 | ./make.bash --host-only |
| 29 | } |
| 30 | |
| 31 | do_install() { |
| 32 | install -d ${D}${libdir}/go |
| 33 | cp -a ${B}/pkg ${D}${libdir}/go/ |
| 34 | install -d ${D}${libdir}/go/src |
| 35 | (cd ${S}/src; for d in *; do \ |
| 36 | [ -d $d ] && cp -a ${S}/src/$d ${D}${libdir}/go/src/; \ |
| 37 | done) |
| 38 | install -d ${D}${bindir} |
| 39 | for f in ${B}/bin/* |
| 40 | do |
| 41 | install -m755 $f ${D}${bindir} |
| 42 | done |
| 43 | } |
| 44 | |
| 45 | do_package[noexec] = "1" |
| 46 | do_packagedata[noexec] = "1" |
| 47 | do_package_write_ipk[noexec] = "1" |
| 48 | do_package_write_deb[noexec] = "1" |
| 49 | do_package_write_rpm[noexec] = "1" |