Commit 480ebdf6 authored by Michael Baudino's avatar Michael Baudino Committed by OyyoDams

chore(ci): add Buildroot codestyle linting

This commit adds a CI stage that runs Buildroot integrated linter
(`check-package`) against all our `.mk`, `.hash` and `Config.in` files.

This new CI stage can be run locally using:

```bash
gitlab-runner exec docker "lint buildroot packages"
```

It also fixes a few codestyle offenses introduced recently (necessary
for the CI to pass).
parent 42350819
...@@ -20,6 +20,14 @@ lint es_input: ...@@ -20,6 +20,14 @@ lint es_input:
- apk add --update --no-cache libxml2-utils - apk add --update --no-cache libxml2-utils
- xmllint --noout --relaxng board/recalbox/fsoverlay/recalbox/scripts/es_input.rng board/recalbox/fsoverlay/recalbox/share_init/system/.emulationstation/es_input.cfg - xmllint --noout --relaxng board/recalbox/fsoverlay/recalbox/scripts/es_input.rng board/recalbox/fsoverlay/recalbox/share_init/system/.emulationstation/es_input.cfg
lint buildroot packages:
stage: lint
image: python:2-alpine
script:
- buildroot/utils/check-package package/**/*.hash custom/package/**/*.hash
- buildroot/utils/check-package package/**/*.mk custom/package/**/*.mk
- buildroot/utils/check-package package/**/Config.in custom/package/**/Config.in
# Build # Build
.build_template: &build_definition .build_template: &build_definition
......
############################################################################### ################################################################################
# # #
# compiler-commons # # compiler-commons
# # #
############################################################################### ################################################################################
# Board options # Board options
ifneq ($(BR2_GCC_TARGET_ABI),) ifneq ($(BR2_GCC_TARGET_ABI),)
COMPILER_COMMONS_ABI += -mabi=$(BR2_GCC_TARGET_ABI) COMPILER_COMMONS_ABI += -mabi=$(BR2_GCC_TARGET_ABI)
endif endif
ifneq ($(BR2_GCC_TARGET_CPU),) ifneq ($(BR2_GCC_TARGET_CPU),)
COMPILER_COMMONS_CPU += -mcpu=$(BR2_GCC_TARGET_CPU) COMPILER_COMMONS_CPU += -mcpu=$(BR2_GCC_TARGET_CPU)
endif endif
ifneq ($(BR2_GCC_TARGET_FPU),) ifneq ($(BR2_GCC_TARGET_FPU),)
COMPILER_COMMONS_FPU += -mfpu=$(BR2_GCC_TARGET_FPU) COMPILER_COMMONS_FPU += -mfpu=$(BR2_GCC_TARGET_FPU)
endif endif
ifneq ($(BR2_GCC_TARGET_FLOAT_ABI),) ifneq ($(BR2_GCC_TARGET_FLOAT_ABI),)
COMPILER_COMMONS_FLOAT_ABI += -mfloat-abi=$(BR2_GCC_TARGET_FLOAT_ABI) COMPILER_COMMONS_FLOAT_ABI += -mfloat-abi=$(BR2_GCC_TARGET_FLOAT_ABI)
endif endif
ifneq ($(BR2_GCC_TARGET_ARCH),) ifneq ($(BR2_GCC_TARGET_ARCH),)
COMPILER_COMMONS_ARCH += -march=$(BR2_GCC_TARGET_ARCH) COMPILER_COMMONS_ARCH += -march=$(BR2_GCC_TARGET_ARCH)
endif endif
# x86 options # x86 options
ifneq ($(BR2_i386),) ifneq ($(BR2_i386),)
COMPILER_COMMONS_BITS += -m32 COMPILER_COMMONS_BITS += -m32
endif endif
ifneq ($(BR2_x86_64),) ifneq ($(BR2_x86_64),)
COMPILER_COMMONS_BITS += -m64 COMPILER_COMMONS_BITS += -m64
endif endif
# Build GCC board options # Build GCC board options
COMPILER_COMMONS_BOARD_OPTIONS += $(COMPILER_COMMONS_ARCH) $(COMPILER_COMMONS_ABI) $(COMPILER_COMMONS_CPU) $(COMPILER_COMMONS_FPU) $(COMPILER_COMMONS_FLOAT_ABI) $(COMPILER_COMMONS_BITS) COMPILER_COMMONS_BOARD_OPTIONS += $(COMPILER_COMMONS_ARCH) $(COMPILER_COMMONS_ABI) $(COMPILER_COMMONS_CPU) $(COMPILER_COMMONS_FPU) $(COMPILER_COMMONS_FLOAT_ABI) $(COMPILER_COMMONS_BITS)
...@@ -38,7 +38,7 @@ COMPILER_COMMONS_GCC_OPTIMIZATION_OPTIONS += -O3 ...@@ -38,7 +38,7 @@ COMPILER_COMMONS_GCC_OPTIMIZATION_OPTIONS += -O3
# Build GCC compiler/linker link optimizations # Build GCC compiler/linker link optimizations
COMPILER_COMMONS_GCC_LINKER_OPTIMIZATION_OPTIONS_OUTER += -fdata-sections -ffunction-sections -Wl,--gc-sections COMPILER_COMMONS_GCC_LINKER_OPTIMIZATION_OPTIONS_OUTER += -fdata-sections -ffunction-sections -Wl,--gc-sections
ifeq ($(BR2_GCC_ENABLE_LTO),y) ifeq ($(BR2_GCC_ENABLE_LTO),y)
COMPILER_COMMONS_GCC_LINKER_OPTIMIZATION_OPTIONS_INNER += -flto -fwhole-program -fuse-linker-plugin COMPILER_COMMONS_GCC_LINKER_OPTIMIZATION_OPTIONS_INNER += -flto -fwhole-program -fuse-linker-plugin
endif endif
COMPILER_COMMONS_GCC_LINKER_OPTIMIZATION_ALL += $(COMPILER_COMMONS_GCC_LINKER_OPTIMIZATION_OPTIONS_OUTER) $(COMPILER_COMMONS_GCC_LINKER_OPTIMIZATION_OPTIONS_INNER) COMPILER_COMMONS_GCC_LINKER_OPTIMIZATION_ALL += $(COMPILER_COMMONS_GCC_LINKER_OPTIMIZATION_OPTIONS_OUTER) $(COMPILER_COMMONS_GCC_LINKER_OPTIMIZATION_OPTIONS_INNER)
...@@ -49,4 +49,4 @@ COMPILER_COMMONS_LDFLAGS_SO = $(COMPILER_COMMONS_BOARD_OPTIONS) $(COMPILER_COMMO ...@@ -49,4 +49,4 @@ COMPILER_COMMONS_LDFLAGS_SO = $(COMPILER_COMMONS_BOARD_OPTIONS) $(COMPILER_COMMO
# Compiler/linker flags for executables: use full optimizations # Compiler/linker flags for executables: use full optimizations
COMPILER_COMMONS_CFLAGS_EXE = $(COMPILER_COMMONS_BOARD_OPTIONS) $(COMPILER_COMMONS_GCC_OPTIMIZATION_OPTIONS) $(COMPILER_COMMONS_GCC_LINKER_OPTIMIZATION_ALL) COMPILER_COMMONS_CFLAGS_EXE = $(COMPILER_COMMONS_BOARD_OPTIONS) $(COMPILER_COMMONS_GCC_OPTIMIZATION_OPTIONS) $(COMPILER_COMMONS_GCC_LINKER_OPTIMIZATION_ALL)
COMPILER_COMMONS_CXXFLAGS_EXE = $(COMPILER_COMMONS_CFLAGS_EXE) COMPILER_COMMONS_CXXFLAGS_EXE = $(COMPILER_COMMONS_CFLAGS_EXE)
COMPILER_COMMONS_LDFLAGS_EXE = $(COMPILER_COMMONS_BOARD_OPTIONS) $(COMPILER_COMMONS_GCC_OPTIMIZATION_OPTIONS) $(COMPILER_COMMONS_GCC_LINKER_OPTIMIZATION_ALL) COMPILER_COMMONS_LDFLAGS_EXE = $(COMPILER_COMMONS_BOARD_OPTIONS) $(COMPILER_COMMONS_GCC_OPTIMIZATION_OPTIONS) $(COMPILER_COMMONS_GCC_LINKER_OPTIMIZATION_ALL)
\ No newline at end of file
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
# FBALPHA # FBALPHA
# #
################################################################################ ################################################################################
LIBRETRO_FBALPHA_VERSION = 4eda6f1cf7e2dfe24d30e60a26cbc933cb8f710e LIBRETRO_FBALPHA_VERSION = 4eda6f1cf7e2dfe24d30e60a26cbc933cb8f710e
LIBRETRO_FBALPHA_SITE = $(call github,libretro,fbalpha,$(LIBRETRO_FBALPHA_VERSION)) LIBRETRO_FBALPHA_SITE = $(call github,libretro,fbalpha,$(LIBRETRO_FBALPHA_VERSION))
...@@ -22,9 +23,9 @@ define LIBRETRO_FBALPHA_INSTALL_TARGET_CMDS ...@@ -22,9 +23,9 @@ define LIBRETRO_FBALPHA_INSTALL_TARGET_CMDS
$(TARGET_DIR)/usr/lib/libretro/fbalpha_libretro.so $(TARGET_DIR)/usr/lib/libretro/fbalpha_libretro.so
mkdir -p $(TARGET_DIR)/recalbox/share_init/bios/fba/samples mkdir -p $(TARGET_DIR)/recalbox/share_init/bios/fba/samples
cp "$(@D)/dats/FB Alpha (ClrMame Pro XML, Arcade only).dat" \ cp "$(@D)/dats/FB Alpha (ClrMame Pro XML, Arcade only).dat" \
$(TARGET_DIR)/recalbox/share_init/bios/fba $(TARGET_DIR)/recalbox/share_init/bios/fba
cp "$(@D)/dats/FB Alpha (ClrMame Pro XML, Neogeo only).dat" \ cp "$(@D)/dats/FB Alpha (ClrMame Pro XML, Neogeo only).dat" \
$(TARGET_DIR)/recalbox/share_init/bios/fba $(TARGET_DIR)/recalbox/share_init/bios/fba
cp -R $(@D)/metadata/* $(TARGET_DIR)/recalbox/share_init/bios/fba cp -R $(@D)/metadata/* $(TARGET_DIR)/recalbox/share_init/bios/fba
endef endef
......
...@@ -9,4 +9,4 @@ config BR2_PACKAGE_LIBRETRO_MINIVMAC ...@@ -9,4 +9,4 @@ config BR2_PACKAGE_LIBRETRO_MINIVMAC
http://www.libretro.com http://www.libretro.com
comment "LIBRETRO_MINIVMAC needs a toolchain w/ C++" comment "LIBRETRO_MINIVMAC needs a toolchain w/ C++"
depends on !BR2_INSTALL_LIBSTDCPP depends on !BR2_INSTALL_LIBSTDCPP
\ No newline at end of file
...@@ -17,4 +17,4 @@ define LIBRETRO_MINIVMAC_INSTALL_TARGET_CMDS ...@@ -17,4 +17,4 @@ define LIBRETRO_MINIVMAC_INSTALL_TARGET_CMDS
$(TARGET_DIR)/usr/lib/libretro/minivmac_libretro.so $(TARGET_DIR)/usr/lib/libretro/minivmac_libretro.so
endef endef
$(eval $(generic-package)) $(eval $(generic-package))
\ No newline at end of file
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
# UzeBox # UzeBox
# #
################################################################################ ################################################################################
LIBRETRO_UZEM_VERSION = 3c1988cc0e02c8dd389130282a3b2db8d9c3d6c0 LIBRETRO_UZEM_VERSION = 3c1988cc0e02c8dd389130282a3b2db8d9c3d6c0
LIBRETRO_UZEM_SITE = $(call github,t-paul,uzebox,$(LIBRETRO_UZEM_VERSION)) LIBRETRO_UZEM_SITE = $(call github,t-paul,uzebox,$(LIBRETRO_UZEM_VERSION))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment