diff --git a/make/buildsystem-helpers.mk b/make/buildsystem-helpers.mk index c5c95075..25e1977b 100644 --- a/make/buildsystem-helpers.mk +++ b/make/buildsystem-helpers.mk @@ -64,6 +64,32 @@ endef # ----------------------------------------------------------------------------- +# apply single patches or patch sets +define APPLY_PATCHES # (patches or directory) + @$(call MESSAGE,"Patching") + $(foreach hook,$($(PKG)_PRE_PATCH_HOOKS),$(call $(hook))$(sep)) + $(Q)( \ + $(CHDIR)/$($(PKG)_DIR); \ + for i in $(1); do \ + if [ "$$i" == "$(PKG_PATCHES_DIR)" -a ! -d $$i ]; then \ + continue; \ + fi; \ + if [ -d $$i ]; then \ + for p in $$i/*.patch; do \ + $(call MESSAGE,"Applying $${p#$(PKG_PATCHES_DIR)/} (*)"); \ + patch -p1 -i $$p; \ + done; \ + else \ + $(call MESSAGE,"Applying $${i#$(PKG_PATCHES_DIR)/}"); \ + patch -p1 -i $(PKG_PATCHES_DIR)/$$i; \ + fi; \ + done; \ + ) + $(foreach hook,$($(PKG)_POST_PATCH_HOOKS),$(call $(hook))$(sep)) +endef + +# ----------------------------------------------------------------------------- + # start-up build define STARTUP @$(call MESSAGE,"Start-up build") @@ -137,42 +163,6 @@ endef # ----------------------------------------------------------------------------- -# apply patch sets -define apply_patches - @$(call MESSAGE,"Patching") - $(foreach hook,$($(PKG)_PRE_PATCH_HOOKS),$(call $(hook))$(sep)) - $(Q)( \ - l=$(strip $(2)); test -z $$l && l=1; \ - for i in $(1); do \ - if [ -e $$i -o -e $(PKG_PATCHES_DIR)/$$i ]; then \ - if [ -d $$i ]; then \ - for p in $$i/*.patch; do \ - $(call MESSAGE,"Applying $${p#$(PKG_PATCHES_DIR)/}"); \ - if [ $${p:0:1} == "/" ]; then \ - patch -p$$l -i $$p; \ - else \ - patch -p$$l -i $(PKG_PATCHES_DIR)/$$p; \ - fi; \ - done; \ - else \ - $(call MESSAGE,"Applying $${i#$(PKG_PATCHES_DIR)/}"); \ - if [ $${i:0:1} == "/" ]; then \ - patch -p$$l -i $$i; \ - else \ - patch -p$$l -i $(PKG_PATCHES_DIR)/$$i; \ - fi; \ - fi; \ - fi; \ - done; \ - ) - $(foreach hook,$($(PKG)_POST_PATCH_HOOKS),$(call $(hook))$(sep)) -endef - -# apply patch sets automatically -APPLY_PATCHES = $(call apply_patches,$(PKG_PATCHES_DIR)) - -# ----------------------------------------------------------------------------- - # github(user,package,version): returns site of GitHub repository github = https://github.com/$(1)/$(2)/archive/$(3) diff --git a/make/host-tools.mk b/make/host-tools.mk index 84a61a74..5f6b078b 100644 --- a/make/host-tools.mk +++ b/make/host-tools.mk @@ -70,8 +70,9 @@ host-zic: $(DL_DIR)/$(HOST_ZIC_SOURCE) | $(HOST_DIR) $(REMOVE)/$(PKG_DIR) $(MKDIR)/$(PKG_DIR) $(CHDIR)/$(PKG_DIR); \ - tar -xf $(DL_DIR)/$(PKG_SOURCE); \ - $(APPLY_PATCHES); \ + tar -xf $(DL_DIR)/$(PKG_SOURCE) + $(call APPLY_PATCHES,$(PKG_PATCHES_DIR)) + $(CHDIR)/$(PKG_DIR); \ $(MAKE) zic $(INSTALL_EXEC) -D $(PKG_BUILD_DIR)/zic $(HOST_ZIC) $(REMOVE)/$(PKG_DIR) @@ -138,8 +139,8 @@ HOST_MESON = $(HOST_DIR)/bin/meson host-meson: $(HOST_MESON_DEPENDENCIES) $(DL_DIR)/$(HOST_MESON_SOURCE) | $(HOST_DIR) $(REMOVE)/$(HOST_MESON_DIR) $(UNTAR)/$(HOST_MESON_SOURCE) + $(call APPLY_PATCHES,$(PKG_PATCHES_DIR)) $(CHDIR)/$(HOST_MESON_DIR); \ - $(APPLY_PATCHES); \ $(HOST_PYTHON_BUILD); \ $(HOST_PYTHON_INSTALL) $(REMOVE)/$(HOST_MESON_DIR) @@ -160,8 +161,8 @@ HOST_NINJA = $(HOST_DIR)/bin/ninja host-ninja: $(DL_DIR)/$(HOST_NINJA_SOURCE) | $(HOST_DIR) $(REMOVE)/$(PKG_DIR) $(UNTAR)/$(PKG_SOURCE) + $(call APPLY_PATCHES,$(PKG_PATCHES_DIR)) $(CHDIR)/$(PKG_DIR); \ - $(APPLY_PATCHES); \ $(HOST_CMAKE); \ $(MAKE) $(INSTALL_EXEC) -D $(PKG_BUILD_DIR)/ninja $(HOST_NINJA) @@ -226,8 +227,8 @@ HOST_PYTHON3_CONF_OPTS = \ host-python3: $(HOST_PYTHON3_DEPENDENCIES) $(DL_DIR)/$(HOST_PYTHON3_SOURCE) | $(HOST_DIR) $(REMOVE)/$(PKG_DIR) $(UNTAR)/$(PKG_SOURCE) + #$(call APPLY_PATCHES,$(PKG_PATCHES_DIR)) $(CHDIR)/$(PKG_DIR); \ - #$(APPLY_PATCHES); \ autoconf; \ $(HOST_CONFIGURE);\ $(MAKE); \ @@ -250,8 +251,8 @@ HOST_PYTHON3_SETUPTOOLS_DEPENDENCIES = host-python3 host-python3-setuptools: $(HOST_PYTHON3_SETUPTOOLS_DEPENDENCIES) $(DL_DIR)/$(HOST_PYTHON3_SETUPTOOLS_SOURCE) | $(HOST_DIR) $(REMOVE)/$(PKG_DIR) $(UNZIP)/$(PKG_SOURCE) + $(call APPLY_PATCHES,$(PKG_PATCHES_DIR)) $(CHDIR)/$(PKG_DIR); \ - $(APPLY_PATCHES); \ $(HOST_PYTHON_BUILD); \ $(HOST_PYTHON_INSTALL) $(REMOVE)/$(PKG_DIR) @@ -270,8 +271,8 @@ HOST_LIBFFI_SITE = https://github.com/libffi/libffi/releases/download/v$(HOST_LI host-libffi: $(DL_DIR)/$(HOST_LIBFFI_SOURCE) | $(HOST_DIR) $(REMOVE)/$(PKG_DIR) $(UNTAR)/$(PKG_SOURCE) + $(call APPLY_PATCHES,$(PKG_PATCHES_DIR)) $(CHDIR)/$(PKG_DIR); \ - $(APPLY_PATCHES); \ $(HOST_CONFIGURE);\ $(MAKE); \ $(MAKE) install @@ -296,8 +297,8 @@ HOST_LUA = $(HOST_DIR)/bin/lua host-lua: $(DL_DIR)/$(HOST_LUA_SOURCE) | $(HOST_DIR) $(REMOVE)/$(PKG_DIR) $(UNTAR)/$(PKG_SOURCE) + $(call APPLY_PATCHES,$(PKG_PATCH)) $(CHDIR)/$(PKG_DIR); \ - $(call apply_patches,$(addprefix $(PKG_PATCHES_DIR)/,$(PKG_PATCH))); \ $(MAKE) linux; \ $(MAKE) install INSTALL_TOP=$(HOST_DIR) INSTALL_MAN=$(HOST_DIR)/share/man/man1 $(REMOVE)/$(PKG_DIR) @@ -336,8 +337,8 @@ HOST_LUAROCKS = $(HOST_DIR)/bin/luarocks host-luarocks: $(HOST_LUAROCKS_DEPENDENCIES) $(DL_DIR)/$(HOST_LUAROCKS_SOURCE) | $(HOST_DIR) $(REMOVE)/$(PKG_DIR) $(UNTAR)/$(PKG_SOURCE) + $(call APPLY_PATCHES,$(PKG_PATCHES_DIR)) $(CHDIR)/$(PKG_DIR); \ - $(APPLY_PATCHES); \ $(HOST_CONFIGURE);\ $(MAKE); \ $(MAKE) install diff --git a/make/linux-drivers.mk b/make/linux-drivers.mk index a3d59d5c..2b5259e2 100644 --- a/make/linux-drivers.mk +++ b/make/linux-drivers.mk @@ -32,8 +32,8 @@ $(DL_DIR)/$(RTL8812AU_SOURCE): rtl8812au: kernel-$(BOXTYPE) $(DL_DIR)/$(RTL8812AU_SOURCE) | $(TARGET_DIR) $(REMOVE)/$(RTL8812AU_DIR) $(UNZIP)/$(RTL8812AU_SOURCE) + $(call APPLY_PATCHES,$(PKG_PATCHES_DIR)) $(CHDIR)/$(RTL8812AU_DIR); \ - $(APPLY_PATCHES); \ $(MAKE) $(KERNEL_MAKE_VARS); \ $(INSTALL_DATA) 8812au.ko $(TARGET_modulesdir)/kernel/drivers/net/wireless/ $(LINUX_RUN_DEPMOD) @@ -53,8 +53,8 @@ $(DL_DIR)/$(RTL8822BU_SOURCE): rtl8822bu: kernel-$(BOXTYPE) $(DL_DIR)/$(RTL8822BU_SOURCE) | $(TARGET_DIR) $(REMOVE)/$(RTL8822BU_DIR) $(UNZIP)/$(RTL8822BU_SOURCE) + $(call APPLY_PATCHES,$(PKG_PATCHES_DIR)) $(CHDIR)/$(RTL8822BU_DIR); \ - $(APPLY_PATCHES); \ $(MAKE) $(KERNEL_MAKE_VARS); \ $(INSTALL_DATA) 88x2bu.ko $(TARGET_modulesdir)/kernel/drivers/net/wireless/ $(LINUX_RUN_DEPMOD) @@ -84,8 +84,8 @@ hd6x-mali-drivers: kernel-$(BOXTYPE) hd6x-libgles-headers $(DL_DIR)/$(HD6x_MALI_ $(START_BUILD) $(REMOVE)/$(HD6x_MALI_DRIVERS_DIR) $(UNTAR)/$(HD6x_MALI_DRIVERS_SOURCE) + $(call APPLY_PATCHES,$(PKG_PATCHES_DIR)) $(CHDIR)/$(HD6x_MALI_DRIVERS_DIR); \ - $(APPLY_PATCHES); \ $(MAKE) -C $(KERNEL_OBJ_DIR) $(KERNEL_MAKE_VARS) $(HD6x_MALI_DRIVERS_MAKE_VARS); \ $(MAKE) -C $(KERNEL_OBJ_DIR) $(KERNEL_MAKE_VARS) $(HD6x_MALI_DRIVERS_MAKE_VARS) INSTALL_MOD_PATH=$(TARGET_DIR) modules_install $(LINUX_RUN_DEPMOD) diff --git a/make/linux-kernel.mk b/make/linux-kernel.mk index 42f69547..eb21920c 100644 --- a/make/linux-kernel.mk +++ b/make/linux-kernel.mk @@ -204,7 +204,6 @@ kernel.do_checkout: $(SOURCE_DIR)/$(NI_LINUX_KERNEL) kernel.do_prepare: | $(DEPS_DIR) $(BUILD_DIR) $(MAKE) kernel.do_prepare_$(if $(filter $(KERNEL_SOURCE),git),git,tar) - # $(REMOVE)/$(KERNEL_OBJ) $(REMOVE)/$(KERNEL_MODULES) $(MKDIR)/$(KERNEL_OBJ) @@ -227,8 +226,7 @@ kernel.do_prepare_git: kernel.do_prepare_tar: $(DL_DIR)/$(KERNEL_SOURCE) $(REMOVE)/$(KERNEL_DIR) $(UNTAR)/$(KERNEL_SOURCE) - $(CHDIR)/$(KERNEL_DIR); \ - $(call apply_patches,$(addprefix $(PKG_PATCHES_DIR)/,$(KERNEL_PATCH))) + $(call APPLY_PATCHES,$(KERNEL_PATCH)) kernel.do_compile: kernel.do_prepare $(MAKE) -C $(BUILD_DIR)/$(KERNEL_DIR) $(KERNEL_MAKE_VARS) modules $(KERNEL_MAKE_TARGETS) diff --git a/make/target-development.mk b/make/target-development.mk index f7b23fce..7a5f6b6d 100644 --- a/make/target-development.mk +++ b/make/target-development.mk @@ -22,8 +22,8 @@ VALGRIND_CONF_OPTS = \ valgrind: $(DL_DIR)/$(VALGRIND_SOURCE) | $(TARGET_DIR) $(REMOVE)/$(PKG_DIR) $(UNTAR)/$(PKG_SOURCE) + $(call APPLY_PATCHES,$(PKG_PATCH)) $(CHDIR)/$(PKG_DIR); \ - $(call apply_patches,$(PKG_PATCH)); \ $(CONFIGURE); \ $(MAKE); \ make install DESTDIR=$(TARGET_DIR) diff --git a/make/target-ffmpeg.mk b/make/target-ffmpeg.mk index 3e5ca4dc..849229b2 100644 --- a/make/target-ffmpeg.mk +++ b/make/target-ffmpeg.mk @@ -354,8 +354,7 @@ ffmpeg: $(FFMPEG_DEPENDENCIES) $(DL_DIR)/$(FFMPEG_SOURCE) | $(TARGET_DIR) $(REMOVE)/$(PKG_DIR) $(UNTAR)/$(PKG_SOURCE) ifneq ($($(PKG)_UNPATCHED),yes) - $(CHDIR)/$(PKG_DIR); \ - $(APPLY_PATCHES) + $(call APPLY_PATCHES,$(PKG_PATCHES_DIR)) endif $(CHDIR)/$(PKG_DIR); \ ./configure $($(PKG)_CONF_OPTS); \ diff --git a/make/target-libs-unused.mk b/make/target-libs-unused.mk index 278d2136..4d742bf3 100644 --- a/make/target-libs-unused.mk +++ b/make/target-libs-unused.mk @@ -21,8 +21,8 @@ LIBID3TAG_CONF_OPTS = \ libid3tag: $(LIBID3TAG_DEPENDENCIES) $(DL_DIR)/$(LIBID3TAG_SOURCE) | $(TARGET_DIR) $(REMOVE)/$(PKG_DIR) $(UNTAR)/$(PKG_SOURCE) + $(call APPLY_PATCHES,$(PKG_PATCHES_DIR)) $(CHDIR)/$(PKG_DIR); \ - $(APPLY_PATCHES); \ $(CONFIGURE); \ $(MAKE); \ $(MAKE) install DESTDIR=$(TARGET_DIR) @@ -51,8 +51,8 @@ FONTCONFIG_CONF_OPTS = \ fontconfig: $(FONTCONFIG_DEPENDENCIES) $(DL_DIR)/$(FONTCONFIG_SOURCE) | $(TARGET_DIR) $(REMOVE)/$(PKG_DIR) $(UNTAR)/$(PKG_SOURCE) + $(call APPLY_PATCHES,$(PKG_PATCHES_DIR)) $(CHDIR)/$(PKG_DIR); \ - $(APPLY_PATCHES); \ $(CONFIGURE); \ $(MAKE); \ $(MAKE) install DESTDIR=$(TARGET_DIR) @@ -81,8 +81,8 @@ PIXMAN_CONF_OPTS = \ pixman: $(PIXMAN_DEPENDENCIES) $(DL_DIR)/$(PIXMAN_SOURCE) | $(TARGET_DIR) $(REMOVE)/$(PKG_DIR) $(UNTAR)/$(PKG_SOURCE) + $(call APPLY_PATCHES,$(PKG_PATCHES_DIR)) $(CHDIR)/$(PKG_DIR); \ - $(APPLY_PATCHES); \ $(CONFIGURE); \ $(MAKE); \ $(MAKE) install DESTDIR=$(TARGET_DIR) @@ -118,8 +118,8 @@ CAIRO_CONF_OPTS = \ cairo: $(CAIRO_DEPENDENCIES) $(DL_DIR)/$(CAIRO_SOURCE) | $(TARGET_DIR) $(REMOVE)/$(PKG_DIR) $(UNTAR)/$(PKG_SOURCE) + $(call APPLY_PATCHES,$(PKG_PATCHES_DIR)) $(CHDIR)/$(PKG_DIR); \ - $(APPLY_PATCHES); \ $(CONFIGURE); \ $(MAKE); \ $(MAKE) install DESTDIR=$(TARGET_DIR) @@ -157,8 +157,8 @@ HARFBUZZ_CONF_OPTS = \ harfbuzz: $(HARFBUZZ_DEPENDENCIES) $(DL_DIR)/$(HARFBUZZ_SOURCE) | $(TARGET_DIR) $(REMOVE)/$(PKG_DIR) $(UNTAR)/$(PKG_SOURCE) + $(call APPLY_PATCHES,$(PKG_PATCHES_DIR)) $(CHDIR)/$(PKG_DIR); \ - $(APPLY_PATCHES); \ $(CONFIGURE); \ $(MAKE); \ $(MAKE) install DESTDIR=$(TARGET_DIR) diff --git a/make/target-libs.mk b/make/target-libs.mk index c6e199a8..efbadb01 100644 --- a/make/target-libs.mk +++ b/make/target-libs.mk @@ -22,8 +22,8 @@ ZLIB_CONF_OPTS = \ zlib: $(DL_DIR)/$(ZLIB_SOURCE) | $(TARGET_DIR) $(REMOVE)/$(PKG_DIR) $(UNTAR)/$(PKG_SOURCE) + $(call APPLY_PATCHES,$(PKG_PATCHES_DIR)) $(CHDIR)/$(PKG_DIR); \ - $(APPLY_PATCHES); \ $(TARGET_CONFIGURE_ENV) \ ./configure $($(PKG)_CONF_OPTS); \ $(MAKE); \ @@ -77,8 +77,8 @@ FREETYPE_CONF_OPTS = \ freetype: $(FREETYPE_DEPENDENCIES) $(DL_DIR)/$(FREETYPE_SOURCE) | $(TARGET_DIR) $(REMOVE)/$(PKG_DIR) $(UNTAR)/$(PKG_SOURCE) + $(call APPLY_PATCHES,$(PKG_PATCHES_DIR)) $(CHDIR)/$(PKG_DIR); \ - $(APPLY_PATCHES); \ $(SED) '/^FONT_MODULES += \(type1\|cid\|pfr\|type42\|pcf\|bdf\|winfonts\|cff\)/d' modules.cfg $(CHDIR)/$(PKG_DIR)/builds/unix; \ libtoolize --force --copy; \ @@ -137,8 +137,8 @@ OPENSSL_CONF_OPTS += \ openssl: $(DL_DIR)/$(OPENSSL_SOURCE) | $(TARGET_DIR) $(REMOVE)/$(PKG_DIR) $(UNTAR)/$(PKG_SOURCE) + $(call APPLY_PATCHES,$(PKG_PATCHES_DIR)) $(CHDIR)/$(PKG_DIR); \ - $(APPLY_PATCHES); \ ./Configure \ $($(PKG)_CONF_OPTS); \ $(SED) 's| build_tests||' Makefile; \ @@ -192,8 +192,8 @@ NCURSES_CONF_OPTS = \ ncurses: $(DL_DIR)/$(NCURSES_SOURCE) | $(TARGET_DIR) $(REMOVE)/$(PKG_DIR) $(UNTAR)/$(PKG_SOURCE) + $(call APPLY_PATCHES,$(PKG_PATCHES_DIR)) $(CHDIR)/$(PKG_DIR); \ - $(APPLY_PATCHES); \ $(CONFIGURE); \ $(MAKE) libs; \ $(MAKE) install.libs DESTDIR=$(TARGET_DIR) @@ -236,8 +236,8 @@ libdpf: $(LIBDPF_DEPENDENCIES) | $(TARGET_DIR) $(REMOVE)/$(PKG_DIR) $(GET_GIT_SOURCE) $(PKG_SITE)/$(PKG_SOURCE) $(DL_DIR)/$(PKG_SOURCE) $(CPDIR)/$(PKG_SOURCE) + $(call APPLY_PATCHES,$(PKG_PATCHES_DIR)) $(CHDIR)/$(PKG_DIR); \ - $(APPLY_PATCHES); \ $(MAKE1) -C dpflib libdpf.a $($(PKG)_MAKE_OPTS) $(INSTALL_DATA) -D $(PKG_BUILD_DIR)/dpflib/libdpf.a $(TARGET_libdir)/libdpf.a $(INSTALL_DATA) -D $(PKG_BUILD_DIR)/dpflib/dpf.h $(TARGET_includedir)/libdpf/libdpf.h @@ -307,8 +307,8 @@ LIBBLURAY_CONF_OPTS = \ libbluray: $(LIBBLURAY_DEPENDENCIES) $(DL_DIR)/$(LIBBLURAY_SOURCE) | $(TARGET_DIR) $(REMOVE)/$(PKG_DIR) $(UNTAR)/$(PKG_SOURCE) + $(call APPLY_PATCHES,$(PKG_PATCHES_DIR)) $(CHDIR)/$(PKG_DIR); \ - $(APPLY_PATCHES); \ ./bootstrap; \ $(CONFIGURE); \ $(MAKE); \ @@ -505,8 +505,8 @@ endif glib2: $(GLIB2_DEPENDENCIES) $(DL_DIR)/$(GLIB2_SOURCE) | $(TARGET_DIR) $(REMOVE)/$(PKG_DIR) $(UNTAR)/$(PKG_SOURCE) + $(call APPLY_PATCHES,$(PKG_PATCHES_DIR)) $(CHDIR)/$(PKG_DIR); \ - $(APPLY_PATCHES); \ echo "ac_cv_type_long_long=yes" > arm-linux.cache; \ echo "glib_cv_stack_grows=no" >> arm-linux.cache; \ echo "glib_cv_uscore=no" >> arm-linux.cache; \ @@ -572,8 +572,8 @@ graphlcd-base: $(GRAPHLCD_BASE_DEPENDENCIES) | $(TARGET_DIR) $(REMOVE)/$(PKG_DIR) $(GET_GIT_SOURCE) $(PKG_SITE)/$(PKG_SOURCE) $(DL_DIR)/$(PKG_SOURCE) $(CPDIR)/$(PKG_SOURCE) + $(call APPLY_PATCHES,$(PKG_PATCH)) $(CHDIR)/$(PKG_DIR); \ - $(call apply_patches,$(addprefix $(PKG_PATCHES_DIR)/,$(PKG_PATCH))); \ $(TARGET_CONFIGURE_ENV) \ $(MAKE); \ $(MAKE) install DESTDIR=$(TARGET_DIR) PREFIX=$(prefix) diff --git a/make/target-lua.mk b/make/target-lua.mk index d8a5df5f..09feed4f 100644 --- a/make/target-lua.mk +++ b/make/target-lua.mk @@ -17,8 +17,8 @@ LUA_DEPENDENCIES = ncurses lua: $(LUA_DEPENDENCIES) $(DL_DIR)/$(LUA_SOURCE) | $(TARGET_DIR) $(REMOVE)/$(LUA_DIR) $(UNTAR)/$(LUA_SOURCE) + $(call APPLY_PATCHES,$(PKG_PATCHES_DIR)) $(CHDIR)/$(LUA_DIR); \ - $(APPLY_PATCHES); \ $(MAKE) linux \ PKG_VERSION=$(LUA_VERSION) \ $(TARGET_MAKE_OPTS) \ @@ -77,9 +77,9 @@ LUA_FEEDPARSER_DEPENDENCIES = luaexpat lua-feedparser: $(LUA-DEEDPARSER_DEPENDENCIES) $(DL_DIR)/$(LUA_FEEDPARSER_SOURCE) | $(TARGET_DIR) $(REMOVE)/$(PKG_DIR) $(UNTAR)/$(PKG_SOURCE) + $(call APPLY_PATCHES,$(PKG_PATCHES_DIR)) $(CHDIR)/$(PKG_DIR); \ $(SED) 's|^PREFIX =|PREFIX ?=|' Makefile; \ - $(APPLY_PATCHES); \ $(MAKE) install PREFIX=$(TARGET_prefix) $(REMOVE)/$(PKG_DIR) $(TOUCH) @@ -167,10 +167,10 @@ $(DL_DIR)/$(SLINGSHOT_SOURCE): luaposix: $(LUAPOSIX_DEPENDENCIES) $(DL_DIR)/$(SLINGSHOT_SOURCE) $(DL_DIR)/$(GNULIB_SOURCE) $(DL_DIR)/$(LUAPOSIX_SOURCE) | $(TARGET_DIR) $(REMOVE)/$(PKG_DIR) $(UNTAR)/$(PKG_SOURCE) + $(call APPLY_PATCHES,$(PKG_PATCHES_DIR)) $(CHDIR)/$(PKG_DIR); \ tar -C gnulib --strip=1 -xf $(DL_DIR)/$(GNULIB_SOURCE); \ tar -C slingshot --strip=1 -xf $(DL_DIR)/$(SLINGSHOT_SOURCE); \ - $(APPLY_PATCHES); \ ./bootstrap; \ $(CONFIGURE); \ $(MAKE); \ diff --git a/make/target-neutrino-plugins.mk b/make/target-neutrino-plugins.mk index 0c9239a2..91d466fa 100644 --- a/make/target-neutrino-plugins.mk +++ b/make/target-neutrino-plugins.mk @@ -258,8 +258,8 @@ links: $(LINKS_DEPENDENCIES) $(DL_DIR)/$(LINKS_SOURCE) $(SHARE_PLUGINS) | $(TARG echo "english" > index.txt; \ echo "german" >> index.txt; \ ./gen-intl + $(call APPLY_PATCHES,$(LINKS_PATCH)) $(CHDIR)/$(LINKS_DIR); \ - $(call apply_patches,$(LINKS_PATCH)); \ $(CONFIGURE); \ $(MAKE); \ $(MAKE) install DESTDIR=$(TARGET_DIR) diff --git a/make/target-tools-unused.mk b/make/target-tools-unused.mk index df8988d7..269e7da6 100644 --- a/make/target-tools-unused.mk +++ b/make/target-tools-unused.mk @@ -17,8 +17,8 @@ USBUTILS_DEPENDENCIES = libusb-compat usbutils: $(USBUTILS_DEPENDENCIES) $(DL_DIR)/$(USBUTILS_SOURCE) | $(TARGET_DIR) $(REMOVE)/$(PKG_DIR) $(UNTAR)/$(PKG_SOURCE) + $(call APPLY_PATCHES,$(PKG_PATCHES_DIR)) $(CHDIR)/$(PKG_DIR); \ - $(APPLY_PATCHES); \ $(CONFIGURE); \ $(MAKE); \ $(MAKE) install DESTDIR=$(TARGET_DIR) @@ -75,8 +75,8 @@ $(DL_DIR)/$(BASE_PASSWD_SOURCE): base-passwd: $(DL_DIR)/$(BASE_PASSWD_SOURCE) | $(TARGET_DIR) $(REMOVE)/$(PKG_DIR) $(UNTAR)/$(PKG_SOURCE) + $(call APPLY_PATCHES,$(PKG_PATCHES_DIR)) $(CHDIR)/$(PKG_DIR); \ - $(APPLY_PATCHES); \ $(CONFIGURE); \ $(MAKE); \ $(MAKE) install DESTDIR=$(TARGET_DIR) @@ -124,8 +124,8 @@ $(DL_DIR)/$(BZIP2_SOURCE): bzip2: $(DL_DIR)/$(BZIP2_SOURCE) | $(TARGET_DIR) $(REMOVE)/$(PKG_DIR) $(UNTAR)/$(PKG_SOURCE) + $(call APPLY_PATCHES,$(PKG_PATCHES_DIR)) $(CHDIR)/$(PKG_DIR); \ - $(APPLY_PATCHES); \ mv Makefile-libbz2_so Makefile; \ $(TARGET_CONFIGURE_ENV) \ $(MAKE); \ diff --git a/make/target-tools.mk b/make/target-tools.mk index 43b30e17..5610bc01 100644 --- a/make/target-tools.mk +++ b/make/target-tools.mk @@ -150,8 +150,7 @@ endef busybox: $(BUSYBOX_DEPENDENCIES) $(DL_DIR)/$(BUSYBOX_SOURCE) | $(TARGET_DIR) $(REMOVE)/$(PKG_DIR) $(UNTAR)/$(PKG_SOURCE) - $(CHDIR)/$(PKG_DIR); \ - $(APPLY_PATCHES); \ + $(call APPLY_PATCHES,$(PKG_PATCHES_DIR)) $($(PKG)_INSTALL_CONFIG) $($(PKG)_MODIFY_CONFIG) $(CHDIR)/$(PKG_DIR); \ @@ -196,8 +195,8 @@ endef sysvinit: $(DL_DIR)/$(SYSVINIT_SOURCE) | $(TARGET_DIR) $(REMOVE)/$(PKG_DIR) $(UNTAR)/$(PKG_SOURCE) + $(call APPLY_PATCHES,$(PKG_PATCHES_DIR)) $(CHDIR)/$(PKG_DIR); \ - $(APPLY_PATCHES); \ $(TARGET_CONFIGURE_ENV) \ $(MAKE) -C src SULOGINLIBS=-lcrypt; \ $(MAKE) install ROOT=$(TARGET_DIR) MANDIR=$(REMOVE_mandir) @@ -236,8 +235,8 @@ XFSPROGS_CONF_OPTS = \ xfsprogs: $(XFSPROGS_DEPENDENCIES) $(DL_DIR)/$(XFSPROGS_SOURCE) | $(TARGET_DIR) $(REMOVE)/$(PKG_DIR) $(UNTAR)/$(PKG_SOURCE) + $(call APPLY_PATCHES,$(PKG_PATCHES_DIR)) $(CHDIR)/$(PKG_DIR); \ - $(APPLY_PATCHES); \ $(CONFIGURE); \ $(MAKE); \ $(MAKE) install DIST_ROOT=$(TARGET_DIR) @@ -322,8 +321,8 @@ $(DL_DIR)/$(HDPARM_SOURCE): hdparm: $(DL_DIR)/$(HDPARM_SOURCE) | $(TARGET_DIR) $(REMOVE)/$(PKG_DIR) $(UNTAR)/$(PKG_SOURCE) + $(call APPLY_PATCHES,$(PKG_PATCHES_DIR)) $(CHDIR)/$(PKG_DIR); \ - $(APPLY_PATCHES); \ $(TARGET_CONFIGURE_ENV) \ $(MAKE); \ $(MAKE) install DESTDIR=$(TARGET_DIR) mandir=$(REMOVE_mandir) @@ -461,8 +460,8 @@ DJMOUNT_CONF_OPTS = \ djmount: $(DJMOUNT_DEPENDENCIES) $(DL_DIR)/$(DJMOUNT_SOURCE) | $(TARGET_DIR) $(REMOVE)/$(PKG_DIR) $(UNTAR)/$(PKG_SOURCE) + $(call APPLY_PATCHES,$(PKG_PATCHES_DIR)) $(CHDIR)/$(PKG_DIR); \ - $(APPLY_PATCHES); \ touch libupnp/config.aux/config.rpath; \ $(CONFIGURE); \ $(MAKE1); \ @@ -495,8 +494,8 @@ USHARE_CONF_OPTS = \ ushare: $(USHARE_DEPENDENCIES) $(DL_DIR)/$(USHARE_SOURCE) | $(TARGET_DIR) $(REMOVE)/$(PKG_DIR) $(UNTAR)/$(PKG_SOURCE) + $(call APPLY_PATCHES,$(PKG_PATCHES_DIR)) $(CHDIR)/$(PKG_DIR); \ - $(APPLY_PATCHES); \ $(TARGET_CONFIGURE_ENV) ./configure $($(PKG)_CONF_OPTS); \ ln -sf ../config.h src/; \ $(MAKE); \ @@ -525,8 +524,8 @@ VSFTPD_DEPENDENCIES = openssl vsftpd: $(VSFTPD_DEPENDENCIES) $(DL_DIR)/$(VSFTPD_SOURCE) | $(TARGET_DIR) $(REMOVE)/$(PKG_DIR) $(UNTAR)/$(PKG_SOURCE) + $(call APPLY_PATCHES,$(PKG_PATCHES_DIR)) $(CHDIR)/$(PKG_DIR); \ - $(APPLY_PATCHES); \ $(SED) 's/.*VSF_BUILD_PAM/#undef VSF_BUILD_PAM/' builddefs.h; \ $(SED) 's/.*VSF_BUILD_SSL/#define VSF_BUILD_SSL/' builddefs.h; \ $(MAKE) clean; \ @@ -619,8 +618,8 @@ AUTOFS_MAKE_OPTS = \ autofs: $(AUTOFS_DEPENDENCIES) $(DL_DIR)/$(AUTOFS_SOURCE) | $(TARGET_DIR) $(REMOVE)/$(PKG_DIR) $(UNTAR)/$(PKG_SOURCE) + $(call APPLY_PATCHES,$(PKG_PATCHES_DIR)) $(CHDIR)/$(PKG_DIR); \ - $(APPLY_PATCHES); \ $(SED) "s|nfs/nfs.h|linux/nfs.h|" include/rpc_subs.h; \ $(CONFIGURE); \ $(MAKE) $($(PKG)_MAKE_OPTS) DONTSTRIP=1; \ @@ -688,8 +687,7 @@ SAMBA33_CONF_OPTS = \ samba33: $(SAMBA33_DEPENDENCIES) $(DL_DIR)/$(SAMBA33_SOURCE) | $(TARGET_DIR) $(REMOVE)/$(PKG_DIR) $(UNTAR)/$(PKG_SOURCE) - $(CHDIR)/$(PKG_DIR); \ - $(APPLY_PATCHES); \ + $(call APPLY_PATCHES,$(PKG_PATCHES_DIR)) $(CHDIR)/$(PKG_DIR)/source; \ ./autogen.sh; \ $(CONFIGURE); \ @@ -754,8 +752,7 @@ SAMBA36_CONF_OPTS = \ samba36: $(SAMBA36_DEPENDENCIES) $(DL_DIR)/$(SAMBA36_SOURCE) | $(TARGET_DIR) $(REMOVE)/$(PKG_DIR) $(UNTAR)/$(PKG_SOURCE) - $(CHDIR)/$(PKG_DIR); \ - $(APPLY_PATCHES); \ + $(call APPLY_PATCHES,$(PKG_PATCHES_DIR)) $(CHDIR)/$(PKG_DIR)/source3; \ ./autogen.sh; \ $(CONFIGURE); \ @@ -830,8 +827,8 @@ FBSHOT_DEPENDENCIES = libpng fbshot: $(FBSHOT_DEPENDENCIES) $(DL_DIR)/$(FBSHOT_SOURCE) | $(TARGET_DIR) $(REMOVE)/$(PKG_DIR) $(UNTAR)/$(PKG_SOURCE) + $(call APPLY_PATCHES,$(PKG_PATCHES_DIR)) $(CHDIR)/$(PKG_DIR); \ - $(APPLY_PATCHES); \ $(SED) 's| gcc | $(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_LDFLAGS) |' Makefile; \ $(SED) '/strip fbshot/d' Makefile; \ $(MAKE); \ @@ -935,9 +932,9 @@ xupnpd: $(XUPNPD_DEPENDENCIES) | $(TARGET_DIR) $(REMOVE)/$(PKG_DIR) $(GET_GIT_SOURCE) $(PKG_SITE)/$(PKG_SOURCE) $(DL_DIR)/$(PKG_SOURCE) $(CPDIR)/$(PKG_SOURCE) + $(call APPLY_PATCHES,$(PKG_PATCHES_DIR)) $(CHDIR)/$(PKG_DIR); \ git checkout $($(PKG)_CHECKOUT); \ - $(APPLY_PATCHES); \ $(TARGET_CONFIGURE_ENV) \ $(MAKE) -C src $($(PKG)_MAKE_OPTS) embedded ; \ $(INSTALL_EXEC) -D src/xupnpd $(TARGET_bindir)/xupnpd; \ @@ -1049,8 +1046,8 @@ dvb-apps: $(DVB_APPS_DEPENDENCIES) | $(TARGET_DIR) $(REMOVE)/$(PKG_DIR) $(GET_GIT_SOURCE) $(PKG_SITE)/$(PKG_SOURCE) $(DL_DIR)/$(PKG_SOURCE) $(CPDIR)/$(PKG_SOURCE) + $(call APPLY_PATCHES,$(PKG_PATCHES_DIR)) $(CHDIR)/$(PKG_DIR); \ - $(APPLY_PATCHES); \ $(TARGET_CONFIGURE_ENV) LDLIBS="-liconv" \ $(MAKE) $($(PKG)_MAKE_OPTS); \ $(MAKE) $($(PKG)_MAKE_OPTS) install DESTDIR=$(TARGET_DIR) @@ -1106,8 +1103,8 @@ GPTFDISK_SBINARIES = sgdisk gptfdisk: $(GPTFDISK_DEPENDENCIES) $(DL_DIR)/$(GPTFDISK_SOURCE) | $(TARGET_DIR) $(REMOVE)/$(PKG_DIR) $(UNTAR)/$(PKG_SOURCE) + $(call APPLY_PATCHES,$(PKG_PATCHES_DIR)) $(CHDIR)/$(PKG_DIR); \ - $(APPLY_PATCHES); \ $(TARGET_CONFIGURE_ENV) \ $(MAKE) $($(PKG)_SBINARIES); \ for sbin in $($(PKG)_SBINARIES); do \ diff --git a/package/crosstool-ng/crosstool-ng.mk b/package/crosstool-ng/crosstool-ng.mk index 21b3727b..85d0b5a3 100644 --- a/package/crosstool-ng/crosstool-ng.mk +++ b/package/crosstool-ng/crosstool-ng.mk @@ -44,8 +44,8 @@ crosstool-ng: $(CROSSTOOL_NG_DEPS) | $(BUILD_DIR) $(CPDIR)/$($(PKG)_SOURCE) ifeq ($(BOXSERIES),$(filter $(BOXSERIES),hd1 hd2)) $(CHDIR)/$($(PKG)_DIR); \ - git checkout 1dbb06f2; \ - $(APPLY_PATCHES) + git checkout 1dbb06f2 + $(call APPLY_PATCHES,$(PKG_PATCHES_DIR)) ifeq ($(BOXSERIES),$(filter $(BOXSERIES),hd2)) $(INSTALL_COPY) $(PKG_PATCHES_DIR)/gcc/* $(PKG_BUILD_DIR)/patches/gcc/linaro-6.3-2017.02 endif diff --git a/package/pkg-autotools.mk b/package/pkg-autotools.mk index db5d3738..426e66b1 100644 --- a/package/pkg-autotools.mk +++ b/package/pkg-autotools.mk @@ -9,8 +9,8 @@ define autotools-package $(call DOWNLOAD,$($(PKG)_SOURCE)) $(call STARTUP) $(call EXTRACT,$(BUILD_DIR)) + $(call APPLY_PATCHES,$(PKG_PATCHES_DIR)) $(CHDIR)/$($(PKG)_DIR); \ - $(APPLY_PATCHES); \ $(TARGET_CONFIGURE); \ $(MAKE); \ $(MAKE) install DESTDIR=$(TARGET_DIR) @@ -22,8 +22,8 @@ define host-autotools-package $(call DOWNLOAD,$($(PKG)_SOURCE)) $(call STARTUP) $(call EXTRACT,$(BUILD_DIR)) + $(call APPLY_PATCHES,$(PKG_PATCHES_DIR)) $(CHDIR)/$($(PKG)_DIR); \ - $(APPLY_PATCHES); \ $(HOST_CONFIGURE); \ $(MAKE); \ $(MAKE) install diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk index ddffdecc..74bf7486 100644 --- a/package/pkg-cmake.mk +++ b/package/pkg-cmake.mk @@ -9,8 +9,8 @@ define cmake-package $(call DOWNLOAD,$($(PKG)_SOURCE)) $(call STARTUP) $(call EXTRACT,$(BUILD_DIR)) + $(call APPLY_PATCHES,$(PKG_PATCHES_DIR)) $(CHDIR)/$($(PKG)_DIR); \ - $(APPLY_PATCHES); \ $(TARGET_CMAKE); \ $(MAKE); \ $(MAKE) install DESTDIR=$(TARGET_DIR) @@ -23,8 +23,8 @@ define host-cmake-package $(call DOWNLOAD,$($(PKG)_SOURCE)) $(call STARTUP) $(call EXTRACT,$(BUILD_DIR)) + $(call APPLY_PATCHES,$(PKG_PATCHES_DIR)) $(CHDIR)/$($(PKG)_DIR); \ - $(APPLY_PATCHES); \ $(HOST_CMAKE); \ $(MAKE); \ $(MAKE) install DESTDIR=$(TARGET_DIR)