Skip to contentSkip to conversation

go: add environment setup batch file for go

PATCH In review Peter Morrow 2 participants 3 messages Apr 7, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 go: add environment setup batch file for go

When building the nativesdk for mingw we need to set GOROOT in order to build anything out of the box.

---
 recipes-devtools/go/go_%.bbappend | 9 +++++++++
 1 file changed, 9 insertions(+)
 create mode 100644 recipes-devtools/go/go_%.bbappend
recipes-devtools/go/go_%.bbappend new file +9 -0
new file mode 100644
index 0000000..9933108
@@ -0,0 +1,9 @@
+do_install_append_class-nativesdk_mingw32() {
+    install -d ${D}${SDKPATHNATIVE}/environment-setup.d
+
+    cat <<EOF > ${D}${SDKPATHNATIVE}/environment-setup.d/go.bat
+set GOROOT=%OECORE_NATIVE_SYSROOT%\\usr\\lib\\${BPN}
+EOF
+}
+
+FILES_${PN}_append_class-nativesdk_mingw32 = " ${SDKPATHNATIVE}/environment-setup.d"
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 26 lines · Peter Morrow

When building the nativesdk for mingw we need to set GOROOT in order to build anything out of the box.

---
 recipes-devtools/go/go_%.bbappend | 9 +++++++++
 1 file changed, 9 insertions(+)
 create mode 100644 recipes-devtools/go/go_%.bbappend
recipes-devtools/go/go_%.bbappend new file +9 -1
new file mode 100644
index 0000000..9933108
@@ -0,0 +1,9 @@
+do_install_append_class-nativesdk_mingw32() {
+    install -d ${D}${SDKPATHNATIVE}/environment-setup.d
+
+    cat <<EOF > ${D}${SDKPATHNATIVE}/environment-setup.d/go.bat
+set GOROOT=%OECORE_NATIVE_SYSROOT%\\usr\\lib\\${BPN}
+EOF
+}
+
+FILES_${PN}_append_class-nativesdk_mingw32 = " ${SDKPATHNATIVE}/environment-setup.d"
--
Quoted 2 lines

1.8.3.1

I've put this patch in master-next oe meta-mingw. This is the wrong mailing list for these patches, please use [email protected] time.

#2 lore raw
Quoted 26 lines · Joshua Watt
Quoted 24 lines · Peter Morrow

When building the nativesdk for mingw we need to set GOROOT in order to build anything out of the box.

---
 recipes-devtools/go/go_%.bbappend | 9 +++++++++
 1 file changed, 9 insertions(+)
 create mode 100644 recipes-devtools/go/go_%.bbappend
recipes-devtools/go/go_%.bbappend new file +8 -0
new file mode 100644
index 0000000..9933108
@@ -0,0 +1,9 @@
+do_install_append_class-nativesdk_mingw32() {
+    install -d ${D}${SDKPATHNATIVE}/environment-setup.d
+
+    cat <<EOF > ${D}${SDKPATHNATIVE}/environment-setup.d/go.bat
+set GOROOT=%OECORE_NATIVE_SYSROOT%\\usr\\lib\\${BPN}
+EOF
+}
+
Quoted 8 lines
Quoted 4 lines
recipes-devtools/go/go_%.bbappend new file +1 -1
+FILES_${PN}_append_class-nativesdk_mingw32 = " ${SDKPATHNATIVE}/environment-setup.d"
--

1.8.3.1

I've put this patch in master-next oe meta-mingw. This is the wrong mailing list for these patches, please use [email protected] time.

Thanks, noted.

Peter.