defs.mk: Move PKG_FORMAT definition into platform.mk

PKG_FORMAT is now more straightforward to get with from the revised
jw-pkg.py distro info --format '%{cascade}', so do that, and do it in
the context where all the other variables are set from the output of
that command.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-03-02 12:42:40 +00:00
commit e93338872f
2 changed files with 9 additions and 20 deletions

View file

@ -175,12 +175,6 @@ PKG_VENDOR ?= janware GmbH
# ----- packaging variables
ifneq ($(findstring $(OS_NAME),debian ubuntu),)
PKG_FORMAT ?= debian
else
PKG_FORMAT ?= rpm
endif
PKG_SH_EXE := /bin/bash $(JWB_SCRIPT_DIR)/pkg.sh
LOG_INSTALL_SH := $(PKG_SH_EXE) log-install -f $(PKG_FORMAT)
UPDATE_REPO_SH := /opt/packager-server/bin/packager-server schedule-rebuild

View file

@ -72,21 +72,16 @@ endif
# -- arch, vendor, os, libc
ifeq ($(HOST_TUPLE),)
HOST_TUPLE := $(shell $(JW_PKG_PY) distro info --format '%{gnu-triplet}')
HOST_TUPLE_WORDS := $(subst -, ,$(HOST_TUPLE))
HOST_ARCH := $(word 1,$(HOST_TUPLE_WORDS))
HOST_VENDOR := $(word 2,$(HOST_TUPLE_WORDS))
HOST_OS := $(word 3,$(HOST_TUPLE_WORDS))
HOST_ABI := $(word 4,$(HOST_TUPLE_WORDS))
HOST_TRIPLET := $(HOST_ARCH)-$(HOST_OS)-$(HOST_ABI)
else
HOST_TUPLE_WORDS := $(subst -, ,$(HOST_TUPLE))
HOST_ARCH := $(word 1,$(HOST_TUPLE_WORDS))
HOST_VENDOR := $(word 2,$(HOST_TUPLE_WORDS))
HOST_OS := $(word 3,$(HOST_TUPLE_WORDS))
HOST_ABI := $(word 4,$(HOST_TUPLE_WORDS))
HOST_TRIPLET := $(HOST_ARCH)-$(HOST_OS)-$(HOST_ABI)
HOST_TUPLE := $(shell $(JW_PKG_PY) distro info --format '%{gnu-triplet} %{cascade}')
endif
HOST_TUPLE_WORDS := $(subst -, ,$(HOST_TUPLE))
HOST_ARCH := $(word 1,$(HOST_TUPLE_WORDS))
HOST_VENDOR := $(word 2,$(HOST_TUPLE_WORDS))
HOST_OS := $(word 3,$(HOST_TUPLE_WORDS))
HOST_ABI := $(word 4,$(HOST_TUPLE_WORDS))
HOST_TRIPLET := $(HOST_ARCH)-$(HOST_OS)-$(HOST_ABI)
HOST_OS_CASCADE := $(wordlist 2,$(words $(HOST_TUPLE)),$(HOST_TUPLE))
PKG_FORMAT ?= $(patsubst pkg-%,%,$(filter pkg-%,$(HOST_OS_CASCADE)))
ifndef TARGET
ifneq ($(subst mingw,,$(CWD)),$(CWD))