diff options
author | Waldemar Brodkorb <wbx@openadk.org> | 2017-02-20 23:08:39 +0100 |
---|---|---|
committer | Waldemar Brodkorb <wbx@openadk.org> | 2017-02-20 23:08:44 +0100 |
commit | ee4fdb76d5fc14ce338d67314c58a757235a6fd0 (patch) | |
tree | c42cb92b942bfbca4fc0324e6142dc123a1fe95c | |
parent | 6eac6fcd18e2d6adc52ad323ffd485fc3f37d6dc (diff) |
add new package hugo, this requires google go. logic mostly from buildroot
-rw-r--r-- | mk/go.mk | 34 | ||||
-rw-r--r-- | package/go-bootstrap/Makefile | 44 | ||||
-rw-r--r-- | package/go/Makefile | 69 | ||||
-rw-r--r-- | package/hugo/Makefile | 37 |
4 files changed, 184 insertions, 0 deletions
diff --git a/mk/go.mk b/mk/go.mk new file mode 100644 index 000000000..8b980b8a2 --- /dev/null +++ b/mk/go.mk @@ -0,0 +1,34 @@ +ifeq ($(ADK_TARGET_ARCH_ARM),y) +ADK_GO_ARCH:= aarch64 +endif +ifeq ($(ADK_TARGET_ARCH_ARM),y) +ADK_GO_ARCH:= arm +endif +ifeq ($(ADK_TARGET_ARCH_MIPS),y) +ADK_GO_ARCH:= mips +endif +ifeq ($(ADK_TARGET_ARCH_MIPS64),y) +ADK_GO_ARCH:= mips64 +endif +ifeq ($(ADK_TARGET_ARCH_PPC64),y) +ADK_GO_ARCH:= ppc64 +endif +ifeq ($(ADK_TARGET_ARCH_X86),y) +ADK_GO_ARCH:= i386 +endif +ifeq ($(ADK_TARGET_ARCH_X86_64),y) +ADK_GO_ARCH:= amd64 +endif +ADK_GO_ROOT:= $(STAGING_HOST_DIR)/usr/lib/go +ADK_GO_PATH:= $(STAGING_HOST_DIR)/usr/lib/gopath +ADK_GO_BINPATH:= $(ADK_GO_PATH)/bin/linux_$(ADK_GO_ARCH) +ADK_GO_TOOLDIR:= $(ADK_GO_ROOT)/pkg/tool/linux_$(ADK_GO_ARCH) +ADK_GO:= $(ADK_GO_ROOT)/bin/go +ADK_GO_TARGET_ENV:= CGO_ENABLED=1 \ + GOARCH=$(ADK_GO_ARCH) \ + GOROOT="$(ADK_GO_ROOT)" \ + GOPATH="$(ADK_GO_PATH)" \ + CC="$(TARGET_CC)" \ + CXX="$(TARGET_CXX)" \ + GOTOOLDIR="$(ADK_GO_TOOLDIR)" + diff --git a/package/go-bootstrap/Makefile b/package/go-bootstrap/Makefile new file mode 100644 index 000000000..cfd07f599 --- /dev/null +++ b/package/go-bootstrap/Makefile @@ -0,0 +1,44 @@ +# This file is part of the OpenADK project. OpenADK is copyrighted +# material, please see the LICENCE file in the top-level directory. + +include $(ADK_TOPDIR)/rules.mk + +PKG_NAME:= go-bootstrap +PKG_VERSION:= 1.4.3 +PKG_RELEASE:= 1 +PKG_HASH:= 9947fc705b0b841b5938c48b22dc33e9647ec0752bae66e50278df4f23f64959 +PKG_DESCR:= go bootstrap compiler +PKG_SECTION:= dev/tools +PKG_URL:= http://www.golang.org/ +PKG_SITES:= https://storage.googleapis.com/golang/ + +PKG_CFLINE_GO_BOOTSTRAP:= depends on ADK_HOST_ONLY + +DISTFILES:= go$(PKG_VERSION).src.tar.gz +WRKDIST= ${WRKDIR}/go/src + +include $(ADK_TOPDIR)/mk/host.mk +include $(ADK_TOPDIR)/mk/package.mk + +$(eval $(call HOST_template,GO_BOOTSTRAP,go-bootstrap,$(PKG_VERSION)-${PKG_RELEASE})) + +HOST_STYLE:= manual +HOST_MAKE_ENV+= GOOS=linux \ + GOROOT="$(WRKBUILD)" \ + GOBIN="$(WRKBUILD)/bin" \ + GOROOT_FINAL="$(STAGING_HOST_DIR)/usr/lib/go-bootstrap" \ + CGO_ENABLED=0 + +host-build: + (cd ${WRKBUILD} && env ${HOST_MAKE_ENV} ./make.bash) + +go-bootstrap-hostinstall: + $(INSTALL_DIR) $(STAGING_HOST_DIR)/usr/lib/go-bootstrap/bin + $(CP) $(WRKBUILD)/../lib $(STAGING_HOST_DIR)/usr/lib/go-bootstrap + $(CP) $(WRKBUILD)/../pkg $(STAGING_HOST_DIR)/usr/lib/go-bootstrap + $(CP) $(WRKBUILD)/../src $(STAGING_HOST_DIR)/usr/lib/go-bootstrap + $(INSTALL_BIN) $(WRKBUILD)/bin/go $(STAGING_HOST_DIR)/usr/lib/go-bootstrap/bin + $(INSTALL_BIN) $(WRKBUILD)/bin/gofmt $(STAGING_HOST_DIR)/usr/lib/go-bootstrap/bin + +include ${ADK_TOPDIR}/mk/host-bottom.mk +include ${ADK_TOPDIR}/mk/pkg-bottom.mk diff --git a/package/go/Makefile b/package/go/Makefile new file mode 100644 index 000000000..cd218acfa --- /dev/null +++ b/package/go/Makefile @@ -0,0 +1,69 @@ +# This file is part of the OpenADK project. OpenADK is copyrighted +# material, please see the LICENCE file in the top-level directory. + +include $(ADK_TOPDIR)/rules.mk + +PKG_NAME:= go +PKG_VERSION:= 1.8 +PKG_RELEASE:= 1 +PKG_HASH:= 406865f587b44be7092f206d73fc1de252600b79b3cacc587b74b5ef5c623596 +PKG_DESCR:= go compiler and tools +PKG_SECTION:= dev/lang +HOST_BUILDDEP:= go-bootstrap-host +PKG_URL:= http://www.golang.org +PKG_SITES:= https://storage.googleapis.com/golang/ + +PKG_ARCH_DEPENDS:= aarch64 arm mips mips64 ppc64 x86 x86_64 + +PKG_CFLINE_GO:= depends on ADK_HOST_ONLY + +DISTFILES:= $(PKG_NAME)$(PKG_VERSION).src.tar.gz +WRKDIST= ${WRKDIR}/go/src + +include $(ADK_TOPDIR)/mk/host.mk +include $(ADK_TOPDIR)/mk/package.mk + +$(eval $(call HOST_template,GO,go,$(PKG_VERSION)-${PKG_RELEASE})) + +HOST_STYLE:= manual + +include $(ADK_TOPDIR)/mk/go.mk + +ADK_GO_BOOTSTRAP:= $(STAGING_HOST_DIR)/usr/lib/go-bootstrap +ADK_GO_TEMP:= $(WRKBUILD)/go-temp +ADK_GO_HOST_ENV:= GOROOT_BOOTSTRAP="$(ADK_GO_BOOTSTRAP)" \ + GOROOT_FINAL="$(ADK_GO_ROOT)" \ + GOROOT="$(WRKBUILD)" \ + GOBIN="$(WRKBUILD)/bin" \ + GOARCH=$(ADK_GO_ARCH) \ + GOOS=linux + +host-build: + (cd $(WRKBUILD) && \ + CGO_ENABLED=0 \ + CC_FOR_TARGET=$(HOST_CC) \ + CXX_FOR_TARGET=$(HOST_CXX) \ + $(ADK_GO_HOST_ENV) ./make.bash) + mkdir -p $(ADK_GO_TEMP) + mv $(WRKBUILD)/../pkg/tool $(ADK_GO_TEMP) + mv $(WRKBUILD)/../bin $(ADK_GO_TEMP) + (cd $(WRKBUILD) && \ + CGO_ENABLED=1 \ + CC_FOR_TARGET=$(TARGET_CC) \ + CXX_FOR_TARGET=$(TARGET_CXX) \ + $(ADK_GO_HOST_ENV) ./make.bash) + +go-hostinstall: + $(INSTALL_DIR) $(ADK_GO_ROOT)/bin + $(INSTALL_BIN) $(ADK_GO_TEMP)/bin/{go,gofmt} $(ADK_GO_ROOT)/bin + ln -sf ../lib/go/bin/go $(STAGING_HOST_DIR)/usr/bin/ + ln -sf ../lib/go/bin/gofmt $(STAGING_HOST_DIR)/usr/bin/ + $(CP) $(WRKBUILD)/../lib $(ADK_GO_ROOT) + $(INSTALL_DIR) $(ADK_GO_ROOT)/pkg + $(CP) $(WRKBUILD)/../pkg/include $(ADK_GO_ROOT)/pkg + $(CP) $(WRKBUILD)/../pkg/linux_* $(ADK_GO_ROOT)/pkg + $(CP) $(ADK_GO_TEMP)/tool $(ADK_GO_ROOT)/pkg + $(CP) $(WRKBUILD)/../src $(ADK_GO_ROOT) + +include ${ADK_TOPDIR}/mk/host-bottom.mk +include $(ADK_TOPDIR)/mk/pkg-bottom.mk diff --git a/package/hugo/Makefile b/package/hugo/Makefile new file mode 100644 index 000000000..ab25a693f --- /dev/null +++ b/package/hugo/Makefile @@ -0,0 +1,37 @@ +# This file is part of the OpenADK project. OpenADK is copyrighted +# material, please see the LICENCE file in the top-level directory. + +include $(ADK_TOPDIR)/rules.mk + +PKG_NAME:= hugo +PKG_VERSION:= 0.18.1 +PKG_RELEASE:= 1 +PKG_HASH:= 29db2524a3042f507162164ec3ce9071277a7608547f4ea4f739d63cac4b39e4 +PKG_DESCR:= fast website generator +PKG_SECTION:= net/http +PKG_BUILDDEP:= go-host +PKG_URL:= https://gohugo.io +PKG_SITES:= https://github.com/spf13/hugo/archive/ + +DISTFILES:= v$(PKG_VERSION).tar.gz + +include $(ADK_TOPDIR)/mk/package.mk + +$(eval $(call PKG_template,HUGO,hugo,$(PKG_VERSION)-$(PKG_RELEASE),$(PKG_DEPENDS),$(PKG_DESCR),$(PKG_SECTION))) + +CONFIG_STYLE:= manual +BUILD_STYLE:= manual +INSTALL_STYLE:= manual + +include $(ADK_TOPDIR)/mk/go.mk + +do-build: + (cd $(WRKBUILD) && $(ADK_GO_TARGET_ENV) $(ADK_GO) \ + get -v github.com/spf13/hugo) + +hugo-install: + $(INSTALL_DIR) $(IDIR_HUGO)/usr/bin + $(INSTALL_BIN) $(ADK_GO_BINPATH)/hugo \ + $(IDIR_HUGO)/usr/bin + +include $(ADK_TOPDIR)/mk/pkg-bottom.mk |