Changeset 28394


Ignore:
Timestamp:
2011-10-09T18:33:59+02:00 (6 years ago)
Author:
nbd
Message:

build system: add a feature that allows you to pull sources from a git tree instead of the usual tarball

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Config.in

    r27403 r28394  
    431431                  If enabled log files will be written to the ./log directory 
    432432 
     433        config SRC_TREE_OVERRIDE 
     434                bool "Enable package source tree override" if DEVEL 
     435                help 
     436                  If enabled, you can force a package to use a git tree as source 
     437                  code instead of the normal tarball. Create a symlink 'git-src' 
     438                  in the package directory, pointing to the .git tree that you want 
     439                  to pull the source code from 
     440 
    433441menuconfig TARGET_OPTIONS 
    434442        bool "Target Options"  if DEVEL 
  • trunk/include/package.mk

    r28322 r28394  
    3838 
    3939STAGING_FILES_LIST:=$(PKG_NAME)$(if $(BUILD_VARIANT),.$(BUILD_VARIANT),).list 
     40ifneq ($(if $(CONFIG_SRC_TREE_OVERRIDE),$(wildcard ./git-src)),) 
     41  USE_GIT_TREE:=1 
     42  QUILT:=1 
     43endif 
    4044 
    4145include $(INCLUDE_DIR)/download.mk 
     
    8589endef 
    8690 
     91ifdef USE_GIT_TREE 
     92  define Build/Prepare/Default 
     93        mkdir -p $(PKG_BUILD_DIR) 
     94        ln -s $(CURDIR)/git-src $(PKG_BUILD_DIR)/.git 
     95        ( cd $(PKG_BUILD_DIR); git checkout .) 
     96  endef 
     97endif 
     98 
    8799define Build/Exports/Default 
    88100  $(1) : export ACLOCAL_INCLUDE=$$(foreach p,$$(wildcard $$(STAGING_DIR)/usr/share/aclocal $$(STAGING_DIR)/usr/share/aclocal-* $$(STAGING_DIR)/host/share/aclocal $$(STAGING_DIR)/host/share/aclocal-*),-I $$(p)) 
     
    98110define Build/DefaultTargets 
    99111  $(if $(QUILT),$(Build/Quilt)) 
    100   $(if $(strip $(PKG_SOURCE_URL)),$(call Download,default)) 
     112  $(if $(USE_GIT_TREE),$(if $(strip $(PKG_SOURCE_URL)),$(call Download,default))) 
    101113  $(call Build/Autoclean) 
    102114 
Note: See TracChangeset for help on using the changeset viewer.