Repository : ssh://git@open-mesh.org/openwrt-feed-devel
On branch : master
commit 5b3e6d820633a1e1a0798a35d42d3af13379060a Author: Sven Eckelmann sven@narfation.org Date: Sun Oct 7 15:47:51 2018 +0200
alfred-devel: Add option to select download source
The current way to download the alfred master branch sources via a special script on open-mesh.org doesn't work anymore because each https download requires the checksum of this file. Thus the whole download implementation has to be replaced to get everything via the native OpenWrt download helpers.
The supported methods are now:
* download via git - free selection of the git repository remote - free selection of the branch or tag * copy from local source directory
Signed-off-by: Sven Eckelmann sven@narfation.org
5b3e6d820633a1e1a0798a35d42d3af13379060a alfred-devel/Config.devel.in | 50 ++++++++++++++++++++++++++++++++++++++++++++ alfred-devel/Config.in | 10 --------- alfred-devel/Makefile | 36 ++++++++++++++++++++++++------- 3 files changed, 79 insertions(+), 17 deletions(-)
diff --git a/alfred-devel/Config.devel.in b/alfred-devel/Config.devel.in new file mode 100644 index 0000000..c5eccc3 --- /dev/null +++ b/alfred-devel/Config.devel.in @@ -0,0 +1,50 @@ +if PACKAGE_alfred-devel + +choice + prompt "Selected alfred-devel download method" + default alfred-devel_SOURCE_GIT + + config alfred-devel_SOURCE_GIT + bool "git repository" + + config alfred-devel_SOURCE_DIRECTORY + bool "directory" + +endchoice + +endif + +if alfred-devel_SOURCE_GIT + +config alfred-devel_REPOSITORY + string + prompt "alfred-devel repository to build" + depends on PACKAGE_alfred-devel + default "https://git.open-mesh.org/alfred.git" + help + Enter a alfred-devel repository url + +config alfred-devel_BRANCH + string + prompt "alfred-devel branch to build" + depends on PACKAGE_alfred-devel + default "master" + help + Enter a alfred branch name or git tag to override package + default value. This allows to build from non-master branches + to test unreleased features. + +endif + + +if alfred-devel_SOURCE_DIRECTORY + +config alfred-devel_DIRECTORY + string + prompt "alfred-devel source directory" + depends on PACKAGE_alfred-devel + default "/tmp/alfred-devel" + help + Enter a alfred-devel source directory + +endif diff --git a/alfred-devel/Config.in b/alfred-devel/Config.in index 5cf1a85..98c409b 100644 --- a/alfred-devel/Config.in +++ b/alfred-devel/Config.in @@ -20,13 +20,3 @@ config PACKAGE_ALFRED_DEVEL_GPSD depends on PACKAGE_alfred-devel select ALFRED_DEVEL_NEEDS_libgps default n - -config ALFRED_DEVEL_ALFRED_BRANCH - string - prompt "alfred branch to build package with" - depends on PACKAGE_alfred-devel - default "master" - help - Enter an alfred branch name or git tag to override package - default value. This allows to build from non-master branches - to test unreleased features. diff --git a/alfred-devel/Makefile b/alfred-devel/Makefile index d241da1..f308bf7 100644 --- a/alfred-devel/Makefile +++ b/alfred-devel/Makefile @@ -9,15 +9,26 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=alfred-devel
-PKG_BRANCH:=$(call qstrip,$(CONFIG_ALFRED_DEVEL_ALFRED_BRANCH)) -PKG_VERSION:=$(shell git ls-remote https://git@git.open-mesh.org/alfred.git $(PKG_BRANCH) | cut -c1-7) -PKG_ALFRED_FNAME:=alfred-devel-$(PKG_VERSION).tar.gz -PKG_ALFRED_DIR:=alfred-$(PKG_VERSION) +ifdef CONFIG_alfred-devel_SOURCE_GIT
-PKG_SOURCE_URL:=https://git.open-mesh.org/snapshot/ -PKG_SOURCE:=$(PKG_ALFRED_FNAME) +PKG_BRANCH:=$(call qstrip,$(CONFIG_alfred-devel_BRANCH)) +PKG_SOURCE_URL:=$(call qstrip,$(CONFIG_alfred-devel_REPOSITORY)) +PKG_REV:=$(shell git ls-remote $(PKG_SOURCE_URL) $(PKG_BRANCH)|cut -c1-40) +PKG_VERSION:=0.$(PKG_REV) +PKG_SOURCE_PROTO:=git + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_VERSION:=$(PKG_REV) + +endif + +ifdef CONFIG_alfred-devel_SOURCE_DIRECTORY + +PKG_REV:=0 +PKG_VERSION:=0.$(PKG_REV) + +endif
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_ALFRED_DIR) PKG_LICENSE:=GPL-2.0
include $(INCLUDE_DIR)/package.mk @@ -55,6 +66,7 @@ define Package/alfred-devel/conffiles endef
define Package/alfred-devel/config + source "$(SOURCE)/Config.devel.in" source "$(SOURCE)/Config.in" endef
@@ -69,6 +81,16 @@ MAKE_ALFRED_FLAGS=\ TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto TARGET_LDFLAGS += -Wl,--gc-sections -fuse-linker-plugin
+ifdef CONFIG_alfred-devel_SOURCE_DIRECTORY + +define Build/Prepare + mkdir -p $(PKG_BUILD_DIR) + $(CP) $(CONFIG_alfred-devel_DIRECTORY)/* $(PKG_BUILD_DIR)/ + $(call Build/Prepare/Default) +endef + +endif + define Build/Compile CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \ LDFLAGS="$(TARGET_LDFLAGS)" \