Skip to contentSkip to conversation

packages: do not use := to append to FOO_LICENSE variables (branch yem/pkg-no-immediate-assignment)

PATCH New Yann E. MORIN 2 participants 16 messages Oct 26, 2019 – Oct 27, 2019

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

cover packages: do not use := to append to FOO_LICENSE variables (branch yem/pkg-no-immediate-assignment)

Hello All!

This let us drop the last case where we had to use immediate assignment in thr packages .mk files., and thus makes the rule much simpler: we never use immediate assignment.

Regards,
Yann E. MORIN.

The following changes since commit c0ffd16e40f15938f4a440a1048fc3d7fba2f7c4

package/kvm-unit-tests: fix build on Arch Linux x86_64 (2019-10-26 10:31:20 +0200)

are available in the git repository at:

git://git.buildroot.org/~ymorin/git/buildroot.git

for you to fetch changes up to 9c2c26f0d6e2967ef96cf5602e193a397cd4cc6a

utils/check-package: report := that apends to variables (2019-10-26 10:40:20 +0200)

----------------------------------------------------------------
Yann E. MORIN (9):
core/legal-info: don't require overriding _LICENSE
package: do not override LICENSE, but append to it
package: get rid of remnants of using := in LICENSE package/ligpgme: don't use :=, use += and subst package/zmqpp: don't override variable package/gcc: don't override a variable
fs: don't use := when not needed
arc/riscv: get rid of immediate-assignment utils/check-package: report := that apends to variables

 arch/arch.mk.riscv                                 | 22 +++++++++++-----------
 docs/manual/adding-packages-generic.txt            | 16 ++++++++++------
 fs/btrfs/btrfs.mk                                  |  2 +-
 fs/ext2/ext2.mk                                    |  2 +-
 fs/f2fs/f2fs.mk                                    |  2 +-
 fs/jffs2/jffs2.mk                                  |  4 ++--
 fs/tar/tar.mk                                      |  2 +-
 fs/ubi/ubi.mk                                      |  2 +-
 package/dtc/dtc.mk                                 |  2 +-
 package/elfutils/elfutils.mk                       |  2 +-
 package/freeswitch/freeswitch.mk                   |  6 +++---
 package/gcc/gcc-final/gcc-final.mk                 |  8 +++-----
 package/gnutls/gnutls.mk                           |  2 +-
 .../gst1-plugins-bad/gst1-plugins-bad.mk           |  8 ++++----
 package/iwd/iwd.mk                                 |  2 +-
 package/kmod/kmod.mk                               |  2 +-
 package/kodi/kodi.mk                               |  2 +-
 package/libgpgme/libgpgme.mk                       | 14 +++++++-------
 package/libidn2/libidn2.mk                         |  4 ++--
 package/libuci/libuci.mk                           |  2 +-
 package/pkg-generic.mk                             |  2 +-
 package/qt5/qt5base/qt5base.mk                     |  4 ++--
 package/qt5/qt5connectivity/qt5connectivity.mk     |  2 +-
 package/qt5/qt5enginio/qt5enginio.mk               |  2 +-
 package/qt5/qt5multimedia/qt5multimedia.mk         |  2 +-
 package/qt5/qt5scxml/qt5scxml.mk                   |  2 +-
 .../qt5/qt5virtualkeyboard/qt5virtualkeyboard.mk   |  8 ++++----
 package/qt5/qt5webchannel/qt5webchannel.mk         |  2 +-
 package/qt5/qt5websockets/qt5websockets.mk         |  2 +-
 package/qt5/qt5webview/qt5webview.mk               |  2 +-
 package/qt5/qt5xmlpatterns/qt5xmlpatterns.mk       |  2 +-
 package/sg3_utils/sg3_utils.mk                     |  2 +-
 package/usbredir/usbredir.mk                       |  2 +-
 package/zmqpp/zmqpp.mk                             |  9 ++++-----
 utils/checkpackagelib/lib_mk.py                    |  4 +++-
 35 files changed, 78 insertions(+), 75 deletions(-)
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#1 lore raw

PATCH 1/9 core/legal-info: don't require overriding _LICENSE

Currently, the formatting we impose on the _LICENSE variable requires that we also use the seldom used := assignment operator, which makes the _LICENSE variable the only variable that users have to write with this operator.

This really departs from the simplicity and consistency of using the append-assignment, which we use for every other variables.

This is because the append-assignment operator surreptiotiously introduces a sapce between the original value and the append one. But we can use this knowledge, to match any instance of a space followed by a comma, and turn it into a single comma.

This allows users to now have a consistent use of the '=' and '+=' operators we use everywhere else in .mk files.

---
 docs/manual/adding-packages-generic.txt | 16 ++++++++++------
 package/pkg-generic.mk                  |  2 +-
 2 files changed, 11 insertions(+), 7 deletions(-)
docs/manual/adding-packages-generic.txt +10 -6
index b402767b05..b2386f2c01 100644
@@ -429,13 +429,17 @@ not and can not work as people would expect it should:
   the +license+ field of the manifest file for this package. +
   The expected format for this variable must comply with the following rules:
   ** If different parts of the package are released under different
-  licenses, then +comma+ separate licenses (e.g. +`LIBFOO_LICENSE =
-  GPL-2.0+, LGPL-2.1+`+). If there is clear distinction between which
-  component is licensed under what license, then annotate the license
-  with that component, between parenthesis (e.g. +`LIBFOO_LICENSE =
-  GPL-2.0+ (programs), LGPL-2.1+ (libraries)`+).
+     licenses, then +comma+ separate licenses (e.g. +`LIBFOO_LICENSE =
+     GPL-2.0+, LGPL-2.1+`+). If there is clear distinction between which
+     component is licensed under what license, then annotate the license
+     with that component, between parenthesis (e.g. +`LIBFOO_LICENSE =
+     GPL-2.0+ (programs), LGPL-2.1+ (libraries)`+).
+  ** If some licenses are conditioned on a sub-option being enabled, append
+     the conditional licenses with a comma (e.g.: `FOO_LICENSE += , GPL-2.0+
+     (programs)`); the infrastructure will internally remove the space before
+     the comma.
   ** If the package is dual licensed, then separate licenses with the
-  +or+ keyword (e.g. +`LIBFOO_LICENSE = AFL-2.1 or GPL-2.0+`+).
+     +or+ keyword (e.g. +`LIBFOO_LICENSE = AFL-2.1 or GPL-2.0+`+).
 
 * +LIBFOO_LICENSE_FILES+ is a space-separated list of files in the package
   tarball that contain the license(s) under which the package is released.
package/pkg-generic.mk +1 -1
index 1f24b52a69..893faba22a 100644
@@ -1006,7 +1006,7 @@ ifeq ($$($(2)_REDISTRIBUTE),YES)
 endif # redistribute
 
 endif # other packages
-	@$$(call legal-manifest,$$(call UPPERCASE,$(4)),$$($(2)_RAWNAME),$$($(2)_VERSION),$$($(2)_LICENSE),$$($(2)_MANIFEST_LICENSE_FILES),$$($(2)_ACTUAL_SOURCE_TARBALL),$$($(2)_ACTUAL_SOURCE_SITE),$$(call legal-deps,$(1)))
+	@$$(call legal-manifest,$$(call UPPERCASE,$(4)),$$($(2)_RAWNAME),$$($(2)_VERSION),$$(subst $$(space)$$(comma),$$(comma),$$($(2)_LICENSE)),$$($(2)_MANIFEST_LICENSE_FILES),$$($(2)_ACTUAL_SOURCE_TARBALL),$$($(2)_ACTUAL_SOURCE_SITE),$$(call legal-deps,$(1)))
 endif # ifneq ($$(call qstrip,$$($(2)_SOURCE)),)
 	$$(foreach hook,$$($(2)_POST_LEGAL_INFO_HOOKS),$$(call $$(hook))$$(sep))
 
Signature · 1 line
2.20.1
#2 lore raw

PATCH 2/9 package: do not override LICENSE, but append to it

In reply to Yann E. MORIN

Now that the infra takes care of removing extraneous spaces before commas, we can safely append to LICENSE variables.

This removes the only case where we had to use immediate assignment to append to a variable.

Mechanical change, with:

    $ sed -r -i -e 's/\<([^[:space:]]+_LICENSE) := \$\(\1\),/\1 += ,/' \
        $(git grep -l -E '\<([^[:space:]]+_LICENSE) := \$\(\1\),')

---
Note: I really said "where we _had_ to". There are other places where we do use immediate assignment, but where we don't have to; further patches will take care of that too.

---
 package/dtc/dtc.mk                                      | 2 +-
 package/elfutils/elfutils.mk                            | 2 +-
 package/freeswitch/freeswitch.mk                        | 6 +++---
 package/gnutls/gnutls.mk                                | 2 +-
 package/gstreamer1/gst1-plugins-bad/gst1-plugins-bad.mk | 6 +++---
 package/iwd/iwd.mk                                      | 2 +-
 package/kmod/kmod.mk                                    | 2 +-
 package/kodi/kodi.mk                                    | 2 +-
 package/libidn2/libidn2.mk                              | 2 +-
 package/libuci/libuci.mk                                | 2 +-
 package/qt5/qt5base/qt5base.mk                          | 4 ++--
 package/qt5/qt5connectivity/qt5connectivity.mk          | 2 +-
 package/qt5/qt5enginio/qt5enginio.mk                    | 2 +-
 package/qt5/qt5multimedia/qt5multimedia.mk              | 2 +-
 package/qt5/qt5scxml/qt5scxml.mk                        | 2 +-
 package/qt5/qt5virtualkeyboard/qt5virtualkeyboard.mk    | 8 ++++----
 package/qt5/qt5webchannel/qt5webchannel.mk              | 2 +-
 package/qt5/qt5websockets/qt5websockets.mk              | 2 +-
 package/qt5/qt5webview/qt5webview.mk                    | 2 +-
 package/qt5/qt5xmlpatterns/qt5xmlpatterns.mk            | 2 +-
 package/sg3_utils/sg3_utils.mk                          | 2 +-
 package/usbredir/usbredir.mk                            | 2 +-
 22 files changed, 30 insertions(+), 30 deletions(-)
package/dtc/dtc.mk +1 -1
index 0ed914ba41..a0fffa5b80 100644
@@ -36,7 +36,7 @@ endef
 
 ifeq ($(BR2_PACKAGE_DTC_PROGRAMS),y)
 
-DTC_LICENSE := $(DTC_LICENSE), GPL-2.0+ (programs)
+DTC_LICENSE += , GPL-2.0+ (programs)
 DTC_INSTALL_GOAL = install
 ifeq ($(BR2_PACKAGE_BASH),)
 DTC_POST_INSTALL_TARGET_HOOKS += DTC_POST_INSTALL_TARGET_RM_DTDIFF
package/elfutils/elfutils.mk +1 -1
index 29cfdc2159..c3df7303b7 100644
@@ -72,7 +72,7 @@ endif
 
 ifeq ($(BR2_PACKAGE_ELFUTILS_PROGS),y)
 ELFUTILS_CONF_OPTS += --enable-progs
-ELFUTILS_LICENSE := $(ELFUTILS_LICENSE), GPL-3.0+ (programs)
+ELFUTILS_LICENSE += , GPL-3.0+ (programs)
 ELFUTILS_LICENSE_FILES += COPYING
 else
 ELFUTILS_CONF_OPTS += --disable-progs
package/freeswitch/freeswitch.mk +3 -3
index 4736ef4531..41f298a313 100644
@@ -164,7 +164,7 @@ FREESWITCH_PRE_CONFIGURE_HOOKS += FREESWITCH_ENABLE_MODULES
 # mod_isac supports a limited set of archs
 # src/mod/codecs/mod_isac/typedefs.h
 ifeq ($(BR2_i386)$(BR2_mips)$(BR2_mipsel)$(BR2_mips64)$(BR2_mips64el)$(BR2_x86_64),y)
-FREESWITCH_LICENSE := $(FREESWITCH_LICENSE), BSD-3-Clause (mod_isac)
+FREESWITCH_LICENSE += , BSD-3-Clause (mod_isac)
 FREESWITCH_LICENSE_FILES += src/mod/codecs/mod_isac/LICENSE
 FREESWITCH_ENABLED_MODULES += codecs/mod_isac
 endif
@@ -221,7 +221,7 @@ FREESWITCH_ENABLED_MODULES += applications/mod_memcache
 endif
 
 ifeq ($(BR2_PACKAGE_LIBOPENH264),y)
-FREESWITCH_LICENSE := $(FREESWITCH_LICENSE), BSD-2-Clause (libopenh264)
+FREESWITCH_LICENSE += , BSD-2-Clause (libopenh264)
 FREESWITCH_LICENSE_FILES += docs/OPENH264_BINARY_LICENSE.txt
 FREESWITCH_DEPENDENCIES += libopenh264
 FREESWITCH_ENABLED_MODULES += codecs/mod_openh264
@@ -303,7 +303,7 @@ FREESWITCH_DEPENDENCIES += xz
 endif
 
 ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_4_8)$(BR2_PACKAGE_FFMPEG),yy)
-FREESWITCH_LICENSE := $(FREESWITCH_LICENSE), BSD-3-Clause (libvpx, libyuv)
+FREESWITCH_LICENSE += , BSD-3-Clause (libvpx, libyuv)
 FREESWITCH_LICENSE_FILES += libs/libvpx/LICENSE libs/libyuv/LICENSE
 FREESWITCH_CONF_OPTS += --enable-libvpx --enable-libyuv
 FREESWITCH_DEPENDENCIES += host-yasm ffmpeg
package/gnutls/gnutls.mk +1 -1
index 13029bbe2f..efdcd21d9d 100644
@@ -12,7 +12,7 @@ GNUTLS_LICENSE = LGPL-2.1+ (core library)
 GNUTLS_LICENSE_FILES = doc/COPYING.LESSER
 
 ifeq ($(BR2_PACKAGE_GNUTLS_OPENSSL),y)
-GNUTLS_LICENSE := $(GNUTLS_LICENSE), GPL-3.0+ (gnutls-openssl library)
+GNUTLS_LICENSE += , GPL-3.0+ (gnutls-openssl library)
 GNUTLS_LICENSE_FILES += doc/COPYING
 endif
 
package/gstreamer1/gst1-plugins-bad/gst1-plugins-bad.mk +3 -3
index f4a7a65871..59eb332e57 100644
@@ -724,18 +724,18 @@ endif
 
 # Add GPL license if GPL licensed plugins enabled.
 ifeq ($(GST1_PLUGINS_BAD_HAS_GPL_LICENSE),y)
-GST1_PLUGINS_BAD_LICENSE := $(GST1_PLUGINS_BAD_LICENSE), GPL-2.0+
+GST1_PLUGINS_BAD_LICENSE += , GPL-2.0+
 GST1_PLUGINS_BAD_LICENSE_FILES += COPYING
 endif
 
 # Add BSD license if BSD licensed plugins enabled.
 ifeq ($(GST1_PLUGINS_BAD_HAS_BSD2C_LICENSE),y)
-GST1_PLUGINS_BAD_LICENSE := $(GST1_PLUGINS_BAD_LICENSE), BSD-2-Clause
+GST1_PLUGINS_BAD_LICENSE += , BSD-2-Clause
 endif
 
 # Add Unknown license if Unknown licensed plugins enabled.
 ifeq ($(GST1_PLUGINS_BAD_HAS_UNKNOWN_LICENSE),y)
-GST1_PLUGINS_BAD_LICENSE := $(GST1_PLUGINS_BAD_LICENSE), UNKNOWN
+GST1_PLUGINS_BAD_LICENSE += , UNKNOWN
 endif
 
 # Use the following command to extract license info for plugins.
package/iwd/iwd.mk +1 -1
index 40ee06ba6f..fc8b83d1bb 100644
@@ -32,7 +32,7 @@ endif
 
 ifeq ($(BR2_PACKAGE_READLINE),y)
 # iwd client depends on readline (GPL-3.0+)
-IWD_LICENSE := $(IWD_LICENSE), GPL-3.0+ (client)
+IWD_LICENSE += , GPL-3.0+ (client)
 IWD_CONF_OPTS += --enable-client
 IWD_DEPENDENCIES += readline
 else
package/kmod/kmod.mk +1 -1
index a5bcf2f2d6..bec46684a4 100644
@@ -50,7 +50,7 @@ endif
 ifeq ($(BR2_PACKAGE_KMOD_TOOLS),y)
 
 # add license info for kmod tools
-KMOD_LICENSE := $(KMOD_LICENSE), GPL-2.0+ (tools)
+KMOD_LICENSE += , GPL-2.0+ (tools)
 KMOD_LICENSE_FILES += COPYING
 
 # /sbin is really /usr/sbin with merged /usr, so adjust relative symlink
package/kodi/kodi.mk +1 -1
index 6e482e615c..028bf551bc 100644
@@ -195,7 +195,7 @@ endif
 
 ifeq ($(BR2_PACKAGE_KODI_NONFREE),y)
 KODI_CONF_OPTS += -DENABLE_NONFREE=ON
-KODI_LICENSE := $(KODI_LICENSE), unrar
+KODI_LICENSE += , unrar
 KODI_LICENSE_FILES += lib/UnrarXLib/license.txt
 else
 KODI_CONF_OPTS += -DENABLE_NONFREE=OFF
package/libidn2/libidn2.mk +1 -1
index 10f179ebcc..bd6c559d04 100644
@@ -24,7 +24,7 @@ define LIBIDN2_REMOVE_BINARY
 endef
 LIBIDN2_POST_INSTALL_TARGET_HOOKS += LIBIDN2_REMOVE_BINARY
 else
-LIBIDN2_LICENSE := $(LIBIDN2_LICENSE), GPL-3.0+ (program)
+LIBIDN2_LICENSE += , GPL-3.0+ (program)
 endif
 
 $(eval $(autotools-package))
package/libuci/libuci.mk +1 -1
index 642238c2e8..55afd53c10 100644
@@ -15,7 +15,7 @@ LIBUCI_DEPENDENCIES += lua
 LIBUCI_CONF_OPTS += -DBUILD_LUA=ON \
 	-DLUAPATH=/usr/lib/lua/5.1 \
 	-DLUA_CFLAGS=-I$(STAGING_DIR)/usr/include
-LIBUCI_LICENSE := $(LIBUCI_LICENSE), GPL-2.0 (lua bindings)
+LIBUCI_LICENSE += , GPL-2.0 (lua bindings)
 else
 LIBUCI_CONF_OPTS += -DBUILD_LUA=OFF
 endif
package/qt5/qt5base/qt5base.mk +2 -2
index e4aa76908a..15c9650391 100644
@@ -101,7 +101,7 @@ QT5BASE_LICENSE = GPL-3.0 or LGPL-2.1 with exception or LGPL-3.0, GFDL-1.3 (docs
 QT5BASE_LICENSE_FILES = LICENSE.GPLv3 LICENSE.LGPLv21 LGPL_EXCEPTION.txt LICENSE.LGPLv3 LICENSE.FDL
 endif
 ifeq ($(BR2_PACKAGE_QT5BASE_EXAMPLES),y)
-QT5BASE_LICENSE := $(QT5BASE_LICENSE), BSD-3-Clause (examples)
+QT5BASE_LICENSE += , BSD-3-Clause (examples)
 QT5BASE_LICENSE_FILES += header.BSD
 endif
 
@@ -153,7 +153,7 @@ QT5BASE_DEPENDENCIES += harfbuzz
 else
 # qt harfbuzz otherwise (using QAtomic instead)
 QT5BASE_CONFIGURE_OPTS += -qt-harfbuzz
-QT5BASE_LICENSE := $(QT5BASE_LICENSE), MIT (harfbuzz)
+QT5BASE_LICENSE += , MIT (harfbuzz)
 QT5BASE_LICENSE_FILES += src/3rdparty/harfbuzz-ng/COPYING
 endif
 else
package/qt5/qt5connectivity/qt5connectivity.mk +1 -1
index 24dbc2cba0..8e4e4669b9 100644
@@ -18,7 +18,7 @@ QT5CONNECTIVITY_LICENSE = GPL-2.0 or GPL-3.0 or LGPL-2.1 with exception or LGPL-
 QT5CONNECTIVITY_LICENSE_FILES = LICENSE.GPLv2 LICENSE.GPLv3 LICENSE.LGPLv21 LGPL_EXCEPTION.txt LICENSE.LGPLv3 LICENSE.FDL
 endif
 ifeq ($(BR2_PACKAGE_QT5BASE_EXAMPLES),y)
-QT5CONNECTIVITY_LICENSE := $(QT5CONNECTIVITY_LICENSE), BSD-3-Clause (examples)
+QT5CONNECTIVITY_LICENSE += , BSD-3-Clause (examples)
 endif
 
 QT5CONNECTIVITY_DEPENDENCIES += $(if $(BR2_PACKAGE_QT5DECLARATIVE),qt5declarative)
package/qt5/qt5enginio/qt5enginio.mk +1 -1
index 2a4cf72ec7..ebd99e4cb7 100644
@@ -15,7 +15,7 @@ QT5ENGINIO_INSTALL_STAGING = YES
 QT5ENGINIO_LICENSE = GPL-3.0 or LGPL-2.1 with exception or LGPL-3.0, GFDL-1.3 (docs)
 QT5ENGINIO_LICENSE_FILES = LICENSE.GPLv3 LICENSE.LGPLv21 LGPL_EXCEPTION.txt LICENSE.LGPLv3 LICENSE.FDL
 ifeq ($(BR2_PACKAGE_QT5BASE_EXAMPLES),y)
-QT5ENGINIO_LICENSE := $(QT5ENGINIO_LICENSE), BSD-3-Clause (examples)
+QT5ENGINIO_LICENSE += , BSD-3-Clause (examples)
 endif
 
 ifeq ($(BR2_PACKAGE_QT5DECLARATIVE),y)
package/qt5/qt5multimedia/qt5multimedia.mk +1 -1
index b8a1c4ff75..611b41a8c7 100644
@@ -74,7 +74,7 @@ endef
 endif
 
 ifeq ($(BR2_PACKAGE_QT5BASE_EXAMPLES),y)
-QT5MULTIMEDIA_LICENSE := $(QT5MULTIMEDIA_LICENSE), LGPL-2.1+ (examples/multimedia/spectrum/3rdparty/fftreal)
+QT5MULTIMEDIA_LICENSE += , LGPL-2.1+ (examples/multimedia/spectrum/3rdparty/fftreal)
 QT5MULTIMEDIA_LICENSE_FILES += examples/multimedia/spectrum/3rdparty/fftreal/license.txt
 define QT5MULTIMEDIA_INSTALL_TARGET_EXAMPLES
 	cp -dpfr $(STAGING_DIR)/usr/lib/qt/examples/multimedia* $(TARGET_DIR)/usr/lib/qt/examples/
package/qt5/qt5scxml/qt5scxml.mk +1 -1
index b54ef0e43a..c0776314d5 100644
@@ -13,7 +13,7 @@ QT5SCXML_INSTALL_STAGING = YES
 QT5SCXML_LICENSE = GPL-2.0+ or LGPL-3.0, GPL-3.0 with exception(tools), GFDL-1.3 (docs)
 QT5SCXML_LICENSE_FILES = LICENSE.GPL3-EXCEPT LICENSE.LGPL3 LICENSE.FDL
 ifeq ($(BR2_PACKAGE_QT5BASE_EXAMPLES),y)
-QT5SCXML_LICENSE := $(QT5SCXML_LICENSE), BSD-3-Clause (examples)
+QT5SCXML_LICENSE += , BSD-3-Clause (examples)
 endif
 
 define QT5SCXML_CONFIGURE_CMDS
package/qt5/qt5virtualkeyboard/qt5virtualkeyboard.mk +4 -4
index 814b454010..59ee30c2d2 100644
@@ -25,7 +25,7 @@ ifneq ($(strip $(QT5VIRTUALKEYBOARD_LANGUAGE_LAYOUTS)),)
 QT5VIRTUALKEYBOARD_QMAKEFLAGS += CONFIG+="$(foreach lang,$(QT5VIRTUALKEYBOARD_LANGUAGE_LAYOUTS),lang-$(lang))"
 
 ifneq ($(filter ja_JP all,$(QT5VIRTUALKEYBOARD_LANGUAGE_LAYOUTS)),)
-QT5VIRTUALKEYBOARD_LICENSE := $(QT5VIRTUALKEYBOARD_LICENSE), Apache-2.0 (openwnn)
+QT5VIRTUALKEYBOARD_LICENSE += , Apache-2.0 (openwnn)
 ifeq ($(BR2_PACKAGE_QT5_VERSION_5_6),y)
 QT5VIRTUALKEYBOARD_LICENSE_FILES += src/virtualkeyboard/3rdparty/openwnn/NOTICE
 else
@@ -35,7 +35,7 @@ endif
 
 ifneq ($(filter zh_CN all,$(QT5VIRTUALKEYBOARD_LANGUAGE_LAYOUTS)),)
 QT5VIRTUALKEYBOARD_3RDPARTY_PARTS = YES
-QT5VIRTUALKEYBOARD_LICENSE := $(QT5VIRTUALKEYBOARD_LICENSE), Apache-2.0 (pinyin)
+QT5VIRTUALKEYBOARD_LICENSE += , Apache-2.0 (pinyin)
 ifeq ($(BR2_PACKAGE_QT5_VERSION_5_6),y)
 QT5VIRTUALKEYBOARD_LICENSE_FILES += src/virtualkeyboard/3rdparty/pinyin/NOTICE
 else
@@ -45,7 +45,7 @@ endif
 
 ifneq ($(filter zh_TW all,$(QT5VIRTUALKEYBOARD_LANGUAGE_LAYOUTS)),)
 QT5VIRTUALKEYBOARD_3RDPARTY_PARTS = YES
-QT5VIRTUALKEYBOARD_LICENSE := $(QT5VIRTUALKEYBOARD_LICENSE), Apache-2.0 (tcime), BSD-3-Clause (tcime)
+QT5VIRTUALKEYBOARD_LICENSE += , Apache-2.0 (tcime), BSD-3-Clause (tcime)
 ifeq ($(BR2_PACKAGE_QT5_VERSION_5_6),y)
 QT5VIRTUALKEYBOARD_LICENSE_FILES += src/virtualkeyboard/3rdparty/tcime/COPYING
 else
@@ -57,7 +57,7 @@ endif
 ifeq ($(BR2_PACKAGE_QT5VIRTUALKEYBOARD_HANDWRITING),y)
 QT5VIRTUALKEYBOARD_3RDPARTY_PARTS = YES
 QT5VIRTUALKEYBOARD_QMAKEFLAGS += CONFIG+=handwriting
-QT5VIRTUALKEYBOARD_LICENSE := $(QT5VIRTUALKEYBOARD_LICENSE), MIT (lipi-toolkit)
+QT5VIRTUALKEYBOARD_LICENSE += , MIT (lipi-toolkit)
 ifeq ($(BR2_PACKAGE_QT5_VERSION_5_6),y)
 QT5VIRTUALKEYBOARD_LICENSE_FILES += src/virtualkeyboard/3rdparty/lipi-toolkit/license.txt
 else
package/qt5/qt5webchannel/qt5webchannel.mk +1 -1
index d136041980..22523036e7 100644
@@ -18,7 +18,7 @@ QT5WEBCHANNEL_LICENSE = GPL-2.0 or GPL-3.0 or LGPL-2.1 with exception or LGPL-3.
 QT5WEBCHANNEL_LICENSE_FILES = LICENSE.GPLv2 LICENSE.GPLv3 LICENSE.LGPLv21 LGPL_EXCEPTION.txt LICENSE.LGPLv3 LICENSE.FDL
 endif
 ifeq ($(BR2_PACKAGE_QT5BASE_EXAMPLES),y)
-QT5WEBCHANNEL_LICENSE := $(QT5WEBCHANNEL_LICENSE), BSD-3-Clause (examples)
+QT5WEBCHANNEL_LICENSE += , BSD-3-Clause (examples)
 endif
 
 ifeq ($(BR2_PACKAGE_QT5DECLARATIVE),y)
package/qt5/qt5websockets/qt5websockets.mk +1 -1
index d026a44ff1..6e734a3bf3 100644
@@ -18,7 +18,7 @@ QT5WEBSOCKETS_LICENSE = GPL-3.0 or LGPL-2.1 with exception or LGPL-3.0
 QT5WEBSOCKETS_LICENSE_FILES = LICENSE.GPLv3 LICENSE.LGPLv21 LGPL_EXCEPTION.txt LICENSE.LGPLv3
 endif
 ifeq ($(BR2_PACKAGE_QT5BASE_EXAMPLES),y)
-QT5WEBSOCKETS_LICENSE := $(QT5WEBSOCKETS_LICENSE), BSD-3-Clause (examples)
+QT5WEBSOCKETS_LICENSE += , BSD-3-Clause (examples)
 endif
 
 ifeq ($(BR2_PACKAGE_QT5DECLARATIVE),y)
package/qt5/qt5webview/qt5webview.mk +1 -1
index d9b913d68e..0a80dba612 100644
@@ -13,7 +13,7 @@ QT5WEBVIEW_LICENSE = GPL-2.0+ or LGPL-3.0, GPL-3.0, GFDL-1.3 (docs)
 QT5WEBVIEW_LICENSE_FILES = LICENSE.GPLv2 LICENSE.GPLv3 LICENSE.LGPLv3 LICENSE.FDL
 
 ifeq ($(BR2_PACKAGE_QT5BASE_EXAMPLES),y)
-QT5WEBVIEW_LICENSE := $(QT5WEBVIEW_LICENSE), BSD-3-Clause (examples)
+QT5WEBVIEW_LICENSE += , BSD-3-Clause (examples)
 endif
 
 define QT5WEBVIEW_CONFIGURE_CMDS
package/qt5/qt5xmlpatterns/qt5xmlpatterns.mk +1 -1
index 8be708844b..6ed247fd59 100644
@@ -18,7 +18,7 @@ QT5XMLPATTERNS_LICENSE = GPL-3.0 or LGPL-2.1 with exception or LGPL-3.0, GFDL-1.
 QT5XMLPATTERNS_LICENSE_FILES = LICENSE.GPLv3 LICENSE.LGPLv21 LGPL_EXCEPTION.txt LICENSE.LGPLv3 LICENSE.FDL
 endif
 ifeq ($(BR2_PACKAGE_QT5BASE_EXAMPLES),y)
-QT5XMLPATTERNS_LICENSE := $(QT5XMLPATTERNS_LICENSE), BSD-3-Clause (examples)
+QT5XMLPATTERNS_LICENSE += , BSD-3-Clause (examples)
 endif
 
 define QT5XMLPATTERNS_CONFIGURE_CMDS
package/sg3_utils/sg3_utils.mk +1 -1
index 79521fd06e..7070d6f83d 100644
@@ -10,7 +10,7 @@ SG3_UTILS_SITE = http://sg.danny.cz/sg/p
 SG3_UTILS_LICENSE = BSD-3-Clause (library)
 # Some utils progs are GPL-2.0+ licensed while others are BSD-3-Clause
 ifeq ($(BR2_PACKAGE_SG3_UTILS_PROGS),y)
-SG3_UTILS_LICENSE := $(SG3_UTILS_LICENSE), GPL-2.0+ (programs), BSD-3-Clause (programs)
+SG3_UTILS_LICENSE += , GPL-2.0+ (programs), BSD-3-Clause (programs)
 endif
 SG3_UTILS_LICENSE_FILES = COPYING BSD_LICENSE
 
package/usbredir/usbredir.mk +1 -1
index 229a9a5618..8848670ea9 100644
@@ -14,7 +14,7 @@ USBREDIR_DEPENDENCIES = host-pkgconf libusb
 
 ifeq ($(BR2_PACKAGE_USBREDIR_SERVER),y)
 
-USBREDIR_LICENSE := $(USBREDIR_LICENSE), GPL-2.0+ (program)
+USBREDIR_LICENSE += , GPL-2.0+ (program)
 USBREDIR_LICENSE_FILES += COPYING
 
 else # BR2_PACKAGE_USBREDIR_SERVER != y
Signature · 1 line
2.20.1
#3 lore raw

PATCH 2/9 package: do not override LICENSE, but append to it

Quoted 10 lines · Yann E. MORIN

Now that the infra takes care of removing extraneous spaces before commas, we can safely append to LICENSE variables.

This removes the only case where we had to use immediate assignment to append to a variable.

Mechanical change, with:

    $ sed -r -i -e 's/\<([^[:space:]]+_LICENSE) := \$\(\1\),/\1 += ,/' \
        $(git grep -l -E '\<([^[:space:]]+_LICENSE) := \$\(\1\),')

Great that you put the script in the commit message!

Normally, we want a single patch per package, but in case of a mechanical
change I agree it's better to do all together.

Regards,
Arnout

Quoted 2 lines
#4 lore raw

PATCH 3/9 package: get rid of remnants of using := in LICENSE

In reply to Yann E. MORIN

There is no longer any reason to assign to LICENSE using an immediate assignment. There was even no reason to use it either in the first assignment.

Drop it.

---
 package/gstreamer1/gst1-plugins-bad/gst1-plugins-bad.mk | 2 +-
 package/libidn2/libidn2.mk                              | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
package/gstreamer1/gst1-plugins-bad/gst1-plugins-bad.mk +1 -1
index 59eb332e57..856db88e49 100644
@@ -11,7 +11,7 @@ GST1_PLUGINS_BAD_INSTALL_STAGING = YES
 # Additional plugin licenses will be appended to GST1_PLUGINS_BAD_LICENSE and
 # GST1_PLUGINS_BAD_LICENSE_FILES if enabled.
 GST1_PLUGINS_BAD_LICENSE_FILES = COPYING.LIB
-GST1_PLUGINS_BAD_LICENSE := LGPL-2.0+, LGPL-2.1+
+GST1_PLUGINS_BAD_LICENSE = LGPL-2.0+, LGPL-2.1+
 
 GST1_PLUGINS_BAD_LDFLAGS = $(TARGET_LDFLAGS) $(TARGET_NLS_LIBS)
 
package/libidn2/libidn2.mk +1 -1
index bd6c559d04..5e05634942 100644
@@ -6,7 +6,7 @@
 
 LIBIDN2_VERSION = 2.2.0
 LIBIDN2_SITE = $(BR2_GNU_MIRROR)/libidn
-LIBIDN2_LICENSE := GPL-2.0+ or LGPL-3.0+ (library)
+LIBIDN2_LICENSE = GPL-2.0+ or LGPL-3.0+ (library)
 LIBIDN2_LICENSE_FILES = COPYING COPYINGv2 COPYING.LESSERv3 COPYING.unicode
 LIBIDN2_DEPENDENCIES = \
 	host-pkgconf \
Signature · 1 line
2.20.1
#5 lore raw

PATCH 3/9 package: get rid of remnants of using := in LICENSE

Quoted 7 lines · Yann E. MORIN

There is no longer any reason to assign to LICENSE using an immediate assignment. There was even no reason to use it either in the first assignment.

Drop it.

We want one patch per pacakge, so I split this in two.

Regards,
Arnout

Quoted 32 lines
---
 package/gstreamer1/gst1-plugins-bad/gst1-plugins-bad.mk | 2 +-
 package/libidn2/libidn2.mk                              | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
package/gstreamer1/gst1-plugins-bad/gst1-plugins-bad.mk +1 -1
index 59eb332e57..856db88e49 100644
@@ -11,7 +11,7 @@ GST1_PLUGINS_BAD_INSTALL_STAGING = YES
 # Additional plugin licenses will be appended to GST1_PLUGINS_BAD_LICENSE and
 # GST1_PLUGINS_BAD_LICENSE_FILES if enabled.
 GST1_PLUGINS_BAD_LICENSE_FILES = COPYING.LIB
-GST1_PLUGINS_BAD_LICENSE := LGPL-2.0+, LGPL-2.1+
+GST1_PLUGINS_BAD_LICENSE = LGPL-2.0+, LGPL-2.1+
 
 GST1_PLUGINS_BAD_LDFLAGS = $(TARGET_LDFLAGS) $(TARGET_NLS_LIBS)
 
package/libidn2/libidn2.mk +1 -1
index bd6c559d04..5e05634942 100644
@@ -6,7 +6,7 @@
 
 LIBIDN2_VERSION = 2.2.0
 LIBIDN2_SITE = $(BR2_GNU_MIRROR)/libidn
-LIBIDN2_LICENSE := GPL-2.0+ or LGPL-3.0+ (library)
+LIBIDN2_LICENSE = GPL-2.0+ or LGPL-3.0+ (library)
 LIBIDN2_LICENSE_FILES = COPYING COPYINGv2 COPYING.LESSERv3 COPYING.unicode
 LIBIDN2_DEPENDENCIES = \
 	host-pkgconf \
#6 lore raw

PATCH 4/9 package/ligpgme: don't use :=, use += and subst

In reply to Yann E. MORIN

This makes it more in-line with how we handle such case in the rest of Buildroot.

Also, move the variable assignment before its use. Even though in a makefile that does not matter, it makes it cleaner, more logical, and easier to follow (for us petty humans).

---
 package/libgpgme/libgpgme.mk | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
package/libgpgme/libgpgme.mk +7 -7
index 1a045862dd..1951cc6675 100644
@@ -11,9 +11,14 @@ LIBGPGME_LICENSE = LGPL-2.1+
 LIBGPGME_LICENSE_FILES = COPYING.LESSER
 LIBGPGME_INSTALL_STAGING = YES
 LIBGPGME_DEPENDENCIES = libassuan libgpg-error
-LIBGPGME_LANGUAGE_BINDINGS = cl
 LIBGPGME_CONFIG_SCRIPTS = gpgme-config
 
+LIBGPGME_LANGUAGE_BINDINGS = cl
+# C++ bindings require a C++11 capable gcc, and -Wsuggest-override support
+ifeq ($(BR2_INSTALL_LIBSTDCPP)$(BR2_TOOLCHAIN_GCC_AT_LEAST_5),yy)
+LIBGPGME_LANGUAGE_BINDINGS += cpp
+endif
+
 LIBGPGME_CONF_OPTS = \
 	--with-gpg-error-prefix=$(STAGING_DIR)/usr \
 	--with-libassuan-prefix=$(STAGING_DIR)/usr \
@@ -21,12 +26,7 @@ LIBGPGME_CONF_OPTS = \
 	--disable-gpgconf-test \
 	--disable-g13-test \
 	--disable-gpg-test \
-	--enable-languages=$(LIBGPGME_LANGUAGE_BINDINGS)
-
-# C++ bindings require a C++11 capable gcc, and -Wsuggest-override support
-ifeq ($(BR2_INSTALL_LIBSTDCPP)$(BR2_TOOLCHAIN_GCC_AT_LEAST_5),yy)
-LIBGPGME_LANGUAGE_BINDINGS := $(LIBGPGME_LANGUAGE_BINDINGS),cpp
-endif
+	--enable-languages=$(subst $(space),$(comma),$(LIBGPGME_LANGUAGE_BINDINGS))
 
 # Handle argp-standalone or it errors out during build
 ifeq ($(BR2_PACKAGE_ARGP_STANDALONE),y)
Signature · 1 line
2.20.1
#7 lore raw

PATCH 5/9 package/zmqpp: don't override variable

In reply to Yann E. MORIN

Instead of reseting the variable when we can't set it, just set it when we can: we just have to negate the condition.

---
 package/zmqpp/zmqpp.mk | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
package/zmqpp/zmqpp.mk +4 -5
index ea6b50e826..383be90bc6 100644
@@ -12,15 +12,14 @@ ZMQPP_LICENSE = MPL-2.0
 ZMQPP_LICENSE_FILES = LICENSE
 ZMQPP_MAKE_OPTS = LD="$(TARGET_CXX)" BUILD_PATH=./build PREFIX=/usr
 ZMQPP_LDFLAGS = $(TARGET_LDFLAGS) -lpthread
-ZMQPP_CONFIG = $(if $(BR2_ENABLE_DEBUG),debug,release)
 
 # gcc bug internal compiler error: in merge_overlapping_regs, at
 # regrename.c:304. This bug is fixed since gcc 6.
 # By setting CONFIG to empty, all optimizations such as -funroll-loops
-# -ffast-math -finline-functions -fomit-frame-pointer are disabled
-ifeq ($(BR2_or1k):$(BR2_TOOLCHAIN_GCC_AT_LEAST_6),y:)
-# check-package OverriddenVariable
-ZMQPP_CONFIG =
+# -ffast-math -finline-functions -fomit-frame-pointer are disabled,
+# So, only set CONFIG for the non-affected cases.
+ifneq ($(BR2_or1k):$(BR2_TOOLCHAIN_GCC_AT_LEAST_6),y:)
+ZMQPP_CONFIG = $(if $(BR2_ENABLE_DEBUG),debug,release)
 endif
 
 ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
Signature · 1 line
2.20.1
#8 lore raw

PATCH 6/9 package/gcc: don't override a variable

In reply to Yann E. MORIN
---
 package/gcc/gcc-final/gcc-final.mk | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
package/gcc/gcc-final/gcc-final.mk +3 -5
index 79c88a5d60..30fb87856c 100644
@@ -64,18 +64,16 @@ HOST_GCC_FINAL_CONF_OPTS = \
 	--enable-languages=$(GCC_FINAL_CROSS_LANGUAGES) \
 	--with-build-time-tools=$(HOST_DIR)/$(GNU_TARGET_NAME)/bin
 
-HOST_GCC_FINAL_GCC_LIB_DIR = $(HOST_DIR)/$(GNU_TARGET_NAME)/lib*
 # The kernel wants to use the -m4-nofpu option to make sure that it
 # doesn't use floating point operations.
 ifeq ($(BR2_sh4)$(BR2_sh4eb),y)
 HOST_GCC_FINAL_CONF_OPTS += "--with-multilib-list=m4,m4-nofpu"
-# check-package OverriddenVariable
 HOST_GCC_FINAL_GCC_LIB_DIR = $(HOST_DIR)/$(GNU_TARGET_NAME)/lib/!m4*
-endif
-ifeq ($(BR2_sh4a)$(BR2_sh4aeb),y)
+else ifeq ($(BR2_sh4a)$(BR2_sh4aeb),y)
 HOST_GCC_FINAL_CONF_OPTS += "--with-multilib-list=m4a,m4a-nofpu"
-# check-package OverriddenVariable
 HOST_GCC_FINAL_GCC_LIB_DIR = $(HOST_DIR)/$(GNU_TARGET_NAME)/lib/!m4*
+else
+HOST_GCC_FINAL_GCC_LIB_DIR = $(HOST_DIR)/$(GNU_TARGET_NAME)/lib*
 endif
 
 ifeq ($(BR2_GCC_SUPPORTS_LIBCILKRTS),y)
Signature · 1 line
2.20.1
#9 lore raw

PATCH 6/9 package/gcc: don't override a variable

Quoted 15 lines · Yann E. MORIN
---
 package/gcc/gcc-final/gcc-final.mk | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
package/gcc/gcc-final/gcc-final.mk +0 -1
index 79c88a5d60..30fb87856c 100644
@@ -64,18 +64,16 @@ HOST_GCC_FINAL_CONF_OPTS = \
 	--enable-languages=$(GCC_FINAL_CROSS_LANGUAGES) \
 	--with-build-time-tools=$(HOST_DIR)/$(GNU_TARGET_NAME)/bin
 
-HOST_GCC_FINAL_GCC_LIB_DIR = $(HOST_DIR)/$(GNU_TARGET_NAME)/lib*
 # The kernel wants to use the -m4-nofpu option to make sure that it

package/gcc/gcc-final/gcc-final.mk HOST_GCC_FINAL_CONF_OPTS = \ · line 77

Quoted 10 lines
package/gcc/gcc-final/gcc-final.mk +1 -4
 # doesn't use floating point operations.
 ifeq ($(BR2_sh4)$(BR2_sh4eb),y)
 HOST_GCC_FINAL_CONF_OPTS += "--with-multilib-list=m4,m4-nofpu"
-# check-package OverriddenVariable
 HOST_GCC_FINAL_GCC_LIB_DIR = $(HOST_DIR)/$(GNU_TARGET_NAME)/lib/!m4*
-endif
-ifeq ($(BR2_sh4a)$(BR2_sh4aeb),y)
+else ifeq ($(BR2_sh4a)$(BR2_sh4aeb),y)
 HOST_GCC_FINAL_CONF_OPTS += "--with-multilib-list=m4a,m4a-nofpu"
-# check-package OverriddenVariable

Note that this was the last user of OverriddenVariable, so maybe we should
remove support for it?

Regards,
Arnout

Quoted 7 lines
package/gcc/gcc-final/gcc-final.mk +2 -0
 HOST_GCC_FINAL_GCC_LIB_DIR = $(HOST_DIR)/$(GNU_TARGET_NAME)/lib/!m4*
+else
+HOST_GCC_FINAL_GCC_LIB_DIR = $(HOST_DIR)/$(GNU_TARGET_NAME)/lib*
 endif
 
 ifeq ($(BR2_GCC_SUPPORTS_LIBCILKRTS),y)
#10 lore raw

PATCH 7/9 fs: don't use := when not needed

In reply to Yann E. MORIN
---
 fs/btrfs/btrfs.mk | 2 +-
 fs/ext2/ext2.mk   | 2 +-
 fs/f2fs/f2fs.mk   | 2 +-
 fs/jffs2/jffs2.mk | 4 ++--
 fs/tar/tar.mk     | 2 +-
 fs/ubi/ubi.mk     | 2 +-
 6 files changed, 7 insertions(+), 7 deletions(-)
fs/btrfs/btrfs.mk +1 -1
index 388516389b..70e3ead97c 100644
@@ -14,7 +14,7 @@ BTRFS_SIZE_SECTOR = $(call qstrip,$(BR2_TARGET_ROOTFS_BTRFS_SIZE_SECTOR))
 BTRFS_FEATURES = $(call qstrip,$(BR2_TARGET_ROOTFS_BTRFS_FEATURES))
 # qstrip results in stripping consecutive spaces into a single one. So the
 # variable is not qstrip-ed to preserve the integrity of the string value.
-BTRFS_LABEL := $(subst ",,$(BR2_TARGET_ROOTFS_BTRFS_LABEL))
+BTRFS_LABEL = $(subst ",,$(BR2_TARGET_ROOTFS_BTRFS_LABEL))
 # ")
 
 BTRFS_OPTS = \
fs/ext2/ext2.mk +1 -1
index 6bb4b1c7f8..74c99bd7b1 100644
@@ -13,7 +13,7 @@ EXT2_MKFS_OPTS = $(call qstrip,$(BR2_TARGET_ROOTFS_EXT2_MKFS_OPTIONS))
 
 # qstrip results in stripping consecutive spaces into a single one. So the
 # variable is not qstrip-ed to preserve the integrity of the string value.
-EXT2_LABEL := $(subst ",,$(BR2_TARGET_ROOTFS_EXT2_LABEL))
+EXT2_LABEL = $(subst ",,$(BR2_TARGET_ROOTFS_EXT2_LABEL))
 #" Syntax highlighting... :-/ )
 
 EXT2_OPTS = \
fs/f2fs/f2fs.mk +1 -1
index f35bb60ad0..21a2879c17 100644
@@ -11,7 +11,7 @@ endif
 
 # qstrip results in stripping consecutive spaces into a single one. So the
 # variable is not qstrip-ed to preserve the integrity of the string value.
-F2FS_LABEL := $(subst ",,$(BR2_TARGET_ROOTFS_F2FS_LABEL))
+F2FS_LABEL = $(subst ",,$(BR2_TARGET_ROOTFS_F2FS_LABEL))
 # ")
 F2FS_COLD_FILES = $(call qstrip,$(BR2_TARGET_ROOTFS_F2FS_COLD_FILES))
 F2FS_HOT_FILES = $(call qstrip,$(BR2_TARGET_ROOTFS_F2FS_HOT_FILES))
fs/jffs2/jffs2.mk +2 -2
index 740ab3e03d..2adbc2320e 100644
@@ -4,8 +4,8 @@
 #
 ################################################################################
 
-JFFS2_OPTS := -e $(BR2_TARGET_ROOTFS_JFFS2_EBSIZE)
-SUMTOOL_OPTS := $(JFFS2_OPTS)
+JFFS2_OPTS = -e $(BR2_TARGET_ROOTFS_JFFS2_EBSIZE)
+SUMTOOL_OPTS = -e $(BR2_TARGET_ROOTFS_JFFS2_EBSIZE)
 
 ifeq ($(BR2_TARGET_ROOTFS_JFFS2_PAD),y)
 ifneq ($(strip $(BR2_TARGET_ROOTFS_JFFS2_PADSIZE)),0x0)
fs/tar/tar.mk +1 -1
index 393d01bfe8..841af14706 100644
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-TAR_OPTS := $(call qstrip,$(BR2_TARGET_ROOTFS_TAR_OPTIONS))
+TAR_OPTS = $(call qstrip,$(BR2_TARGET_ROOTFS_TAR_OPTIONS))
 
 ROOTFS_TAR_DEPENDENCIES = $(BR2_TAR_HOST_DEPENDENCY)
 
fs/ubi/ubi.mk +1 -1
index 9874e73ff6..d848f8b23a 100644
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-UBI_UBINIZE_OPTS := -m $(BR2_TARGET_ROOTFS_UBIFS_MINIOSIZE)
+UBI_UBINIZE_OPTS = -m $(BR2_TARGET_ROOTFS_UBIFS_MINIOSIZE)
 UBI_UBINIZE_OPTS += -p $(BR2_TARGET_ROOTFS_UBI_PEBSIZE)
 ifneq ($(BR2_TARGET_ROOTFS_UBI_SUBSIZE),0)
 UBI_UBINIZE_OPTS += -s $(BR2_TARGET_ROOTFS_UBI_SUBSIZE)
Signature · 1 line
2.20.1
#11 lore raw

PATCH 7/9 fs: don't use := when not needed

Quoted 8 lines · Yann E. MORIN
---
 fs/btrfs/btrfs.mk | 2 +-
 fs/ext2/ext2.mk   | 2 +-
 fs/f2fs/f2fs.mk   | 2 +-
 fs/jffs2/jffs2.mk | 4 ++--
 fs/tar/tar.mk     | 2 +-
 fs/ubi/ubi.mk     | 2 +-

We normally want one patch per package :-)

I didn't bother splitting those though.

Regards,
Arnout

#12 lore raw

PATCH 8/9 arc/riscv: get rid of immediate-assignment

In reply to Yann E. MORIN
---
 arch/arch.mk.riscv | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)
arch/arch.mk.riscv +11 -11
index f3bf2b3467..da2188706c 100644
@@ -5,26 +5,26 @@
 
 ifeq ($(BR2_riscv),y)
 
-ifeq ($(BR2_RISCV_64),y)
-GCC_TARGET_ARCH := rv64i
-else
-GCC_TARGET_ARCH := rv32i
-endif
-
 ifeq ($(BR2_RISCV_ISA_RVM),y)
-GCC_TARGET_ARCH := $(GCC_TARGET_ARCH)m
+GCC_TARGET_ARCH_SUFFIX += m
 endif
 ifeq ($(BR2_RISCV_ISA_RVA),y)
-GCC_TARGET_ARCH := $(GCC_TARGET_ARCH)a
+GCC_TARGET_ARCH_SUFFIX += a
 endif
 ifeq ($(BR2_RISCV_ISA_RVF),y)
-GCC_TARGET_ARCH := $(GCC_TARGET_ARCH)f
+GCC_TARGET_ARCH_SUFFIX += f
 endif
 ifeq ($(BR2_RISCV_ISA_RVD),y)
-GCC_TARGET_ARCH := $(GCC_TARGET_ARCH)d
+GCC_TARGET_ARCH_SUFFIX += d
 endif
 ifeq ($(BR2_RISCV_ISA_RVC),y)
-GCC_TARGET_ARCH := $(GCC_TARGET_ARCH)c
+GCC_TARGET_ARCH_SUFFIX += c
+endif
+
+ifeq ($(BR2_RISCV_64),y)
+GCC_TARGET_ARCH = rv64i$(subst $(space),,$(GCC_TARGET_ARCH_SUFFIX))
+else
+GCC_TARGET_ARCH = rv32i$(subst $(space),,$(GCC_TARGET_ARCH_SUFFIX))
 endif
 
 endif
Signature · 1 line
2.20.1
#13 lore raw

PATCH 8/9 arc/riscv: get rid of immediate-assignment

Quoted 35 lines · Yann E. MORIN
---
 arch/arch.mk.riscv | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)
arch/arch.mk.riscv +4 -10
index f3bf2b3467..da2188706c 100644
@@ -5,26 +5,26 @@
 
 ifeq ($(BR2_riscv),y)
 
-ifeq ($(BR2_RISCV_64),y)
-GCC_TARGET_ARCH := rv64i
-else
-GCC_TARGET_ARCH := rv32i
-endif
-
 ifeq ($(BR2_RISCV_ISA_RVM),y)
-GCC_TARGET_ARCH := $(GCC_TARGET_ARCH)m
+GCC_TARGET_ARCH_SUFFIX += m
 endif
 ifeq ($(BR2_RISCV_ISA_RVA),y)
-GCC_TARGET_ARCH := $(GCC_TARGET_ARCH)a
+GCC_TARGET_ARCH_SUFFIX += a
 endif
 ifeq ($(BR2_RISCV_ISA_RVF),y)
-GCC_TARGET_ARCH := $(GCC_TARGET_ARCH)f
+GCC_TARGET_ARCH_SUFFIX += f
 endif
 ifeq ($(BR2_RISCV_ISA_RVD),y)
-GCC_TARGET_ARCH := $(GCC_TARGET_ARCH)d
+GCC_TARGET_ARCH_SUFFIX += d
 endif

arch/arch.mk.riscv line 28

Quoted 10 lines
arch/arch.mk.riscv +7 -1
 ifeq ($(BR2_RISCV_ISA_RVC),y)
-GCC_TARGET_ARCH := $(GCC_TARGET_ARCH)c
+GCC_TARGET_ARCH_SUFFIX += c
+endif
+
+ifeq ($(BR2_RISCV_64),y)
+GCC_TARGET_ARCH = rv64i$(subst $(space),,$(GCC_TARGET_ARCH_SUFFIX))
+else
+GCC_TARGET_ARCH = rv32i$(subst $(space),,$(GCC_TARGET_ARCH_SUFFIX))
 endif

I think we're loosing a bit of symmetry with this approach. How about this?

GCC_TARGET_ARCH_COMPONENTS = \
	rv \
	$(if $(BR2_RISCV_64),64,32) \
	i \
	$(if $(BR2_RISCV_ISA_RVM),m) \
	...

?

Of course, we could just immediately do

GCC_TARGET_ARCH_COMPONENTS = rv$(if $(BR2_RISCV_64),64,32)i$(if $(BR2_RISCV_ISA_RVM),m)..

but that's majorly ugly...

Anyway, this is a bit of bikeshedding, so I haven't marked as Changes
Requested, but I didn't apply yet either.

BTW, note that check-package does NOT fail on the concatenations that are still
left in this file, because it's inside a conditional. So maybe that should be fixed as well.

Regards,
Arnout

Quoted 3 lines
arch/arch.mk.riscv +0 -0
 endif
 
#14 lore raw

PATCH 9/9 utils/check-package: report := that apends to variables

In reply to Yann E. MORIN
---
 utils/checkpackagelib/lib_mk.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
utils/checkpackagelib/lib_mk.py +3 -1
index dd04ffd58f..b805cd9925 100644
@@ -126,7 +126,9 @@ class OverriddenVariable(_CheckFunction):
                 self.conditionally_set.append(variable)
                 return
             if self.CONCATENATING.search(text):
-                return
+                return ["{}:{}: immediate assignment to append to variable {}"
+                        .format(self.filename, lineno, variable),
+                        text]
             if self.USUALLY_OVERRIDDEN.search(text):
                 return
             if assignment in self.OVERRIDING_ASSIGNMENTS:
Signature · 1 line
2.20.1
#15 lore raw

cover packages: do not use := to append to FOO_LICENSE variables (branch yem/pkg-no-immediate-assignment)

In reply to Yann E. MORIN
Quoted 5 lines · Yann E. MORIN

Hello All!

This let us drop the last case where we had to use immediate assignment in thr packages .mk files., and thus makes the rule much simpler: we never use immediate assignment.

Series, applied to master, with a few exceptions, see individual replies.

Thanks,

Regards,
Arnout

Quoted 69 lines

Regards,
Yann E. MORIN.

The following changes since commit c0ffd16e40f15938f4a440a1048fc3d7fba2f7c4

package/kvm-unit-tests: fix build on Arch Linux x86_64 (2019-10-26 10:31:20 +0200)

are available in the git repository at:

git://git.buildroot.org/~ymorin/git/buildroot.git

for you to fetch changes up to 9c2c26f0d6e2967ef96cf5602e193a397cd4cc6a

utils/check-package: report := that apends to variables (2019-10-26 10:40:20 +0200)

----------------------------------------------------------------
Yann E. MORIN (9):
core/legal-info: don't require overriding _LICENSE
package: do not override LICENSE, but append to it
package: get rid of remnants of using := in LICENSE package/ligpgme: don't use :=, use += and subst package/zmqpp: don't override variable package/gcc: don't override a variable
fs: don't use := when not needed
arc/riscv: get rid of immediate-assignment utils/check-package: report := that apends to variables

 arch/arch.mk.riscv                                 | 22 +++++++++++-----------
 docs/manual/adding-packages-generic.txt            | 16 ++++++++++------
 fs/btrfs/btrfs.mk                                  |  2 +-
 fs/ext2/ext2.mk                                    |  2 +-
 fs/f2fs/f2fs.mk                                    |  2 +-
 fs/jffs2/jffs2.mk                                  |  4 ++--
 fs/tar/tar.mk                                      |  2 +-
 fs/ubi/ubi.mk                                      |  2 +-
 package/dtc/dtc.mk                                 |  2 +-
 package/elfutils/elfutils.mk                       |  2 +-
 package/freeswitch/freeswitch.mk                   |  6 +++---
 package/gcc/gcc-final/gcc-final.mk                 |  8 +++-----
 package/gnutls/gnutls.mk                           |  2 +-
 .../gst1-plugins-bad/gst1-plugins-bad.mk           |  8 ++++----
 package/iwd/iwd.mk                                 |  2 +-
 package/kmod/kmod.mk                               |  2 +-
 package/kodi/kodi.mk                               |  2 +-
 package/libgpgme/libgpgme.mk                       | 14 +++++++-------
 package/libidn2/libidn2.mk                         |  4 ++--
 package/libuci/libuci.mk                           |  2 +-
 package/pkg-generic.mk                             |  2 +-
 package/qt5/qt5base/qt5base.mk                     |  4 ++--
 package/qt5/qt5connectivity/qt5connectivity.mk     |  2 +-
 package/qt5/qt5enginio/qt5enginio.mk               |  2 +-
 package/qt5/qt5multimedia/qt5multimedia.mk         |  2 +-
 package/qt5/qt5scxml/qt5scxml.mk                   |  2 +-
 .../qt5/qt5virtualkeyboard/qt5virtualkeyboard.mk   |  8 ++++----
 package/qt5/qt5webchannel/qt5webchannel.mk         |  2 +-
 package/qt5/qt5websockets/qt5websockets.mk         |  2 +-
 package/qt5/qt5webview/qt5webview.mk               |  2 +-
 package/qt5/qt5xmlpatterns/qt5xmlpatterns.mk       |  2 +-
 package/sg3_utils/sg3_utils.mk                     |  2 +-
 package/usbredir/usbredir.mk                       |  2 +-
 package/zmqpp/zmqpp.mk                             |  9 ++++-----
 utils/checkpackagelib/lib_mk.py                    |  4 +++-
 35 files changed, 78 insertions(+), 75 deletions(-)