Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update noarch build #6250

Merged
merged 18 commits into from
Oct 5, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 31 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ on:
options:
- 'true'
- 'false'
add_noarch_builds:
description: 'Include noarch packages'
required: false
default: 'true'
type: choice
options:
- 'true'
- 'false'
add_dsm72_builds:
description: 'Include DSM 7.2 archs'
required: false
Expand Down Expand Up @@ -126,19 +134,27 @@ jobs:
steps:
- id: set-matrix
run: |
# Start with the noarch architectures at the top
# Create a matrix as a JSON object
matrix='{"include": ['
matrix+='{"arch": "noarch"},'
matrix+='{"arch": "noarch-6.1"},'
matrix+='{"arch": "noarch-7.0"},'

# Add other architectures based on input flags
if [ "${{ github.event.inputs.add_dsm52_builds }}" == "true" ]; then
matrix+='{"arch": "x86-5.2"},'
matrix+='{"arch": "88f6281-5.2"},'
matrix+='{"arch": "ppc853x-5.2"},'

if [ "${{ github.event.inputs.add_noarch_builds }}" == "true" -o "${{ github.event.inputs.add_noarch_builds }}" == "" ]; then
mreid-tt marked this conversation as resolved.
Show resolved Hide resolved
matrix+='{"arch": "noarch-1.1"},'
matrix+='{"arch": "noarch-3.1"},'
matrix+='{"arch": "noarch-6.1"},'
matrix+='{"arch": "noarch-7.0"},'
fi
if [ "${{ github.event.inputs.add_dsm72_builds }}" == "true" ]; then
matrix+='{"arch": "x64-7.2"},'
matrix+='{"arch": "aarch64-7.2"},'
fi
if [ "${{ github.event.inputs.add_dsm71_builds }}" == "true" -o "${{ github.event.inputs.add_dsm71_builds }}" == "" ]; then
matrix+='{"arch": "x64-7.1"},'
matrix+='{"arch": "aarch64-7.1"},'
matrix+='{"arch": "evansport-7.1"},'
matrix+='{"arch": "armv7-7.1"},'
matrix+='{"arch": "comcerto2k-7.1"},'
fi
if [ "${{ github.event.inputs.add_dsm62_builds }}" == "true" ]; then
if [ "${{ github.event.inputs.add_dsm62_builds }}" == "true" -o "${{ github.event.inputs.add_dsm62_builds }}" == "" ]; then
matrix+='{"arch": "x64-6.2.4"},'
matrix+='{"arch": "aarch64-6.2.4"},'
matrix+='{"arch": "evansport-6.2.4"},'
Expand All @@ -147,16 +163,10 @@ jobs:
matrix+='{"arch": "88f6281-6.2.4"},'
matrix+='{"arch": "qoriq-6.2.4"},'
fi
if [ "${{ github.event.inputs.add_dsm71_builds }}" == "true" ]; then
matrix+='{"arch": "x64-7.1"},'
matrix+='{"arch": "aarch64-7.1"},'
matrix+='{"arch": "evansport-7.1"},'
matrix+='{"arch": "armv7-7.1"},'
matrix+='{"arch": "comcerto2k-7.1"},'
fi
if [ "${{ github.event.inputs.add_dsm72_builds }}" == "true" ]; then
matrix+='{"arch": "x64-7.2"},'
matrix+='{"arch": "aarch64-7.2"},'
if [ "${{ github.event.inputs.add_dsm52_builds }}" == "true" ]; then
matrix+='{"arch": "x86-5.2"},'
matrix+='{"arch": "88f6281-5.2"},'
matrix+='{"arch": "ppc853x-5.2"},'
fi
if [ "${{ github.event.inputs.add_srm12_builds }}" == "true" ]; then
matrix+='{"arch": "armv7-1.2"},'
Expand Down
2 changes: 2 additions & 0 deletions mk/spksrc.cross-cc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ DIST_FILE = $(DISTRIB_DIR)/$(LOCAL_FILE)
DIST_EXT = $(PKG_EXT)

ifneq ($(ARCH),)
ifneq ($(ARCH),noarch)
ARCH_SUFFIX = -$(ARCH)-$(TCVERSION)
TC = syno$(ARCH_SUFFIX)
endif
endif

#####

Expand Down
2 changes: 2 additions & 0 deletions mk/spksrc.cross-cmake.mk
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ DIST_FILE = $(DISTRIB_DIR)/$(LOCAL_FILE)
DIST_EXT = $(PKG_EXT)

ifneq ($(ARCH),)
ifneq ($(ARCH),noarch)
ARCH_SUFFIX = -$(ARCH)-$(TCVERSION)
TC = syno$(ARCH_SUFFIX)
endif
endif

###

Expand Down
2 changes: 2 additions & 0 deletions mk/spksrc.cross-dotnet.mk
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ DIST_FILE = $(DISTRIB_DIR)/$(LOCAL_FILE)
DIST_EXT = $(PKG_EXT)

ifneq ($(ARCH),)
ifneq ($(ARCH),noarch)
ARCH_SUFFIX = -$(ARCH)-$(TCVERSION)
TC = syno$(ARCH_SUFFIX)
endif
endif

##### dotnet specific configurations
include ../../mk/spksrc.cross-dotnet-env.mk
Expand Down
2 changes: 2 additions & 0 deletions mk/spksrc.cross-go.mk
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ DIST_FILE = $(DISTRIB_DIR)/$(LOCAL_FILE)
DIST_EXT = $(PKG_EXT)

ifneq ($(ARCH),)
ifneq ($(ARCH),noarch)
ARCH_SUFFIX = -$(ARCH)-$(TCVERSION)
TC = syno$(ARCH_SUFFIX)
endif
endif

##### golang specific configurations
include ../../mk/spksrc.cross-go-env.mk
Expand Down
2 changes: 2 additions & 0 deletions mk/spksrc.cross-rust-env.mk
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ endif
# When calling directly from toolchain/syno-<arch>-<version>
# ARCH variable is still unset thus using $(TC_ARCH) although
# in generic archs we must rely on $(TC_NANE)
ifneq ($(ARCH),noarch)
RUST_ARCH = $(or $(ARCH),$(lastword $(subst -, ,$(TC_NAME))),$(TC_ARCH))
endif

# When building toolchain Tier-3 arch support
# While stage-2 is the truly current compiler, stage-1 suffice our needs
Expand Down
2 changes: 2 additions & 0 deletions mk/spksrc.cross-rust.mk
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ DIST_FILE = $(DISTRIB_DIR)/$(LOCAL_FILE)
DIST_EXT = $(PKG_EXT)

ifneq ($(ARCH),)
ifneq ($(ARCH),noarch)
ARCH_SUFFIX = -$(ARCH)-$(TCVERSION)
TC = syno$(ARCH_SUFFIX)
endif
endif

##### rust specific configurations
include ../../mk/spksrc.cross-rust-env.mk
Expand Down
2 changes: 2 additions & 0 deletions mk/spksrc.install-resources.mk
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ DIST_FILE = $(DISTRIB_DIR)/$(LOCAL_FILE)
DIST_EXT = $(PKG_EXT)

ifneq ($(ARCH),)
ifneq ($(ARCH),noarch)
ARCH_SUFFIX = -$(ARCH)-$(TCVERSION)
TC = syno$(ARCH_SUFFIX)
endif
endif


#####
Expand Down
2 changes: 2 additions & 0 deletions mk/spksrc.main-depends.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ NAME = $(PKG_NAME)
COOKIE_PREFIX = $(PKG_NAME)-

ifneq ($(ARCH),)
ifneq ($(ARCH),noarch)
ARCH_SUFFIX = -$(ARCH)-$(TCVERSION)
TC = syno$(ARCH_SUFFIX)
endif
endif

#####

Expand Down
26 changes: 16 additions & 10 deletions mk/spksrc.spk.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Most of the rules are imported from spksrc.*.mk files
#
# Variables:
# ARCH A dedicated arch, a generic arch or empty for arch independent packages
# ARCH A dedicated arch, a generic arch or 'noarch' for arch independent packages
# SPK_NAME Package name
# MAINTAINER Package maintainer (mandatory)
# MAINTAINER_URL URL of package maintainer (optional when MAINTAINER is a valid github user)
Expand Down Expand Up @@ -34,6 +34,7 @@ include ../../mk/spksrc.directories.mk
NAME = $(SPK_NAME)

ifneq ($(ARCH),)
ifneq ($(ARCH),noarch)
# arch specific packages
ifneq ($(SPK_PACKAGE_ARCHS),)
SPK_ARCH = $(SPK_PACKAGE_ARCHS)
Expand All @@ -50,11 +51,14 @@ endif
SPK_TCVERS = $(TCVERSION)
ARCH_SUFFIX = -$(ARCH)-$(TCVERSION)
TC = syno$(ARCH_SUFFIX)
else
endif
endif

ifeq ($(ARCH),noarch)
ifneq ($(strip $(TCVERSION)),)
# different noarch packages
SPK_ARCH = noarch
SPK_NAME_ARCH = noarch
ifneq ($(strip $(TCVERSION)),)
ifeq ($(call version_ge, $(TCVERSION), 7.0),1)
SPK_TCVERS = dsm7
TC_OS_MIN_VER = 7.0-40000
Expand All @@ -68,12 +72,9 @@ else
SPK_TCVERS = srm
TC_OS_MIN_VER = 1.1-6931
endif
else
SPK_TCVERS = all
TC_OS_MIN_VER = 3.1-1594
endif
ARCH_SUFFIX = -$(SPK_TCVERS)
endif
endif

ifeq ($(call version_lt, ${TC_OS_MIN_VER}, 6.1)$(call version_ge, ${TC_OS_MIN_VER}, 3.0),11)
OS_MIN_VER = $(TC_OS_MIN_VER)
Expand Down Expand Up @@ -157,9 +158,14 @@ $(WORK_DIR)/INFO:
$(create_target_dir)
@$(MSG) "Creating INFO file for $(SPK_NAME)"
@if [ -z "$(SPK_ARCH)" ]; then \
echo "ERROR: Arch '$(ARCH)' is not a supported architecture" ; \
echo " - There is no remaining arch in '$(TC_ARCH)' for unsupported archs '$(UNSUPPORTED_ARCHS)'"; \
exit 1; \
if [ "$(ARCH)" = "noarch" ]; then \
echo "ERROR: 'noarch' package without TCVERSION is not supported" ; \
exit 1; \
else \
echo "ERROR: Arch '$(ARCH)' is not a supported architecture" ; \
echo " - There is no remaining arch in '$(TC_ARCH)' for unsupported archs '$(UNSUPPORTED_ARCHS)'"; \
exit 1; \
fi; \
fi
@echo package=\"$(SPK_NAME)\" > $@
@echo version=\"$(SPK_VERS)-$(SPK_REV)\" >> $@
Expand Down
4 changes: 2 additions & 2 deletions spk/adminer/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ WIZARDS_DIR = src/wizard/

POST_STRIP_TARGET = adminer_extra_install

# Pure PHP package, make sure ARCH is not defined
override ARCH=
# Pure PHP package, make sure ARCH is noarch
override ARCH=noarch

include ../../mk/spksrc.spk.mk

Expand Down