feeds.mk 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #
  2. # Copyright (C) 2014 OpenWrt.org
  3. # Copyright (C) 2016 LEDE Project
  4. #
  5. # This is free software, licensed under the GNU General Public License v2.
  6. # See /LICENSE for more information.
  7. #
  8. -include $(TMP_DIR)/.packagesubdirs
  9. FEEDS_INSTALLED:=$(notdir $(wildcard $(TOPDIR)/package/feeds/*))
  10. FEEDS_AVAILABLE:=$(sort $(FEEDS_INSTALLED) $(shell $(SCRIPT_DIR)/feeds list -n))
  11. FEEDS_ENABLED:=$(foreach feed,$(FEEDS_AVAILABLE),$(if $(CONFIG_FEED_$(feed)),$(feed)))
  12. FEEDS_DISABLED:=$(filter-out $(FEEDS_ENABLED),$(FEEDS_AVAILABLE))
  13. PACKAGE_SUBDIRS=$(PACKAGE_DIR)
  14. ifneq ($(CONFIG_PER_FEED_REPO),)
  15. PACKAGE_SUBDIRS += $(OUTPUT_DIR)/packages/$(ARCH_PACKAGES)/base
  16. ifneq ($(CONFIG_PER_FEED_REPO_ADD_DISABLED),)
  17. PACKAGE_SUBDIRS += $(foreach FEED,$(FEEDS_AVAILABLE),$(OUTPUT_DIR)/packages/$(ARCH_PACKAGES)/$(FEED))
  18. else
  19. PACKAGE_SUBDIRS += $(foreach FEED,$(FEEDS_ENABLED),$(OUTPUT_DIR)/packages/$(ARCH_PACKAGES)/$(FEED))
  20. endif
  21. endif
  22. PACKAGE_DIR_ALL := $(TOPDIR)/staging_dir/packages/$(BOARD)
  23. opkg_package_files = $(wildcard \
  24. $(foreach dir,$(PACKAGE_SUBDIRS), \
  25. $(foreach pkg,$(1), $(dir)/$(pkg)_*.ipk)))
  26. PKG_CONFIG_DEPENDS += \
  27. CONFIG_PER_FEED_REPO \
  28. CONFIG_PER_FEED_REPO_ADD_DISABLED \
  29. CONFIG_PER_FEED_REPO_ADD_COMMENTED \
  30. $(foreach feed,$(FEEDS_INSTALLED),CONFIG_FEED_$(feed))
  31. # 1: package name
  32. define FeedPackageDir
  33. $(strip $(if $(CONFIG_PER_FEED_REPO), \
  34. $(if $(Package/$(1)/subdir), \
  35. $(abspath $(OUTPUT_DIR)/packages/$(ARCH_PACKAGES)/$(Package/$(1)/subdir)), \
  36. $(PACKAGE_DIR)), \
  37. $(PACKAGE_DIR)))
  38. endef
  39. # 1: destination file
  40. define FeedSourcesAppend
  41. ( \
  42. echo "src/gz %n_core %U/targets/%S/packages"; \
  43. $(strip $(if $(CONFIG_PER_FEED_REPO), \
  44. $(foreach feed,base $(FEEDS_ENABLED),echo "src/gz %n_$(feed) %U/packages/%A/$(feed)";) \
  45. $(if $(CONFIG_PER_FEED_REPO_ADD_DISABLED), \
  46. $(foreach feed,$(FEEDS_DISABLED),echo "$(if $(CONFIG_PER_FEED_REPO_ADD_COMMENTED),# )src/gz %n_$(feed) %U/packages/%A/$(feed)";)))) \
  47. ) >> $(1)
  48. endef