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

redesign dependency-list creation for github prepare action #6255

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
8 changes: 1 addition & 7 deletions .github/actions/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,7 @@ DEPENDENT_PACKAGES=$(echo "${GH_FILES}" | tr ' ' '\n' | grep -oP "(cross|native)
# get dependency list
# dependencies in this list include the cross or native folder (i.e. native/python cross/glib)
echo "Building dependency list..."
DEPENDENCY_LIST=
for package in $(find spk/ -maxdepth 1 -type d | cut -c 5- | sort)
do
if [ ! -f "./spk/${package}/BROKEN" ]; then
DEPENDENCY_LIST+=$(DEPENDENCY_WALK=1 make -s -C spk/${package} dependency-list 2> /dev/null)$'\n'
fi
done
DEPENDENCY_LIST=$(make dependency-list 2> /dev/null)

# search for dependent spk packages
for package in ${DEPENDENT_PACKAGES}
Expand Down
7 changes: 2 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,9 @@ dependency-tree:
done

# build dependency list for all packages
# - exclude broken packages
# - broken packages are excluded
dependency-list:
@for spk in $(filter-out $(dir $(wildcard spk/*/BROKEN)),$(dir $(wildcard spk/*/Makefile))) ; \
do \
$(MAKE) -s -C $${spk} dependency-list ; \
done
@mk/dependency-list.sh

# define a template that instantiates a 'python3-avoton-6.1' -style target for
# every ($2) arch, every ($1) spk
Expand Down
2 changes: 1 addition & 1 deletion cross/jellyfin/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ COMMENT = The Free Software Media System. It is an alternative to the proprieta
LICENSE = GPLv2

DOTNET_VERSION = 8.0
BUILD_DEPENDS = native/dotnet-sdk-$(DOTNET_VERSION)
BUILD_DEPENDS = native/dotnet-sdk-8.0

DOTNET_OUTPUT_PATH = share
DOTNET_PACKAGE_NAME = Jellyfin.Server
Expand Down
2 changes: 1 addition & 1 deletion cross/libicu/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ PKG_DIST_NAME = icu4c-$(subst .,_,$(PKG_VERS))-src.$(PKG_EXT)
PKG_DIST_SITE = https://github.com/unicode-org/icu/releases/download/release-$(subst .,-,$(PKG_VERS))
PKG_DIR = icu/source

BUILD_DEPENDS = native/$(PKG_NAME)
BUILD_DEPENDS = native/libicu

HOMEPAGE = http://site.icu-project.org/home
COMMENT = International Components for Unicode.
Expand Down
2 changes: 1 addition & 1 deletion cross/python2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ PKG_DIST_SITE = https://www.python.org/ftp/python/$(PKG_VERS)
PKG_DIR = Python-$(PKG_VERS)

DEPENDS = cross/zlib cross/openssl cross/sqlite cross/readline cross/ncursesw cross/bzip2
DEPENDS += cross/berkeleydb-5.3 native/$(PKG_NAME)
DEPENDS += cross/berkeleydb-5.3 native/python2

HOMEPAGE = http://www.python.org
COMMENT = Python Programming Language
Expand Down
2 changes: 1 addition & 1 deletion cross/python310/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ PKG_DIST_NAME = Python-$(PKG_VERS).$(PKG_EXT)
PKG_DIST_SITE = https://www.python.org/ftp/python/$(PKG_VERS)
PKG_DIR = Python-$(PKG_VERS)

BUILD_DEPENDS = native/$(PKG_NAME)
BUILD_DEPENDS = native/python310

DEPENDS = cross/zlib cross/sqlite cross/readline cross/ncursesw cross/bzip2 cross/xz
# required for Sleepycat^WOracle Berkeley DB interface
Expand Down
2 changes: 1 addition & 1 deletion cross/python311/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ PKG_DIR = Python-$(PKG_VERS)
# And compiler must support std=c++11 (OlD_PPC_ARCHS fail, but ARMv5_ARCHS have no issue).
UNSUPPORTED_ARCHS = $(OLD_PPC_ARCHS)

BUILD_DEPENDS = native/$(PKG_NAME)
BUILD_DEPENDS = native/python311

DEPENDS = cross/zlib cross/sqlite cross/readline cross/ncursesw cross/bzip2 cross/xz
# required for Sleepycat^WOracle Berkeley DB interface
Expand Down
2 changes: 1 addition & 1 deletion cross/python38/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ PKG_DIST_NAME = Python-$(PKG_VERS).$(PKG_EXT)
PKG_DIST_SITE = https://www.python.org/ftp/python/$(PKG_VERS)
PKG_DIR = Python-$(PKG_VERS)

BUILD_DEPENDS = native/$(PKG_NAME)
BUILD_DEPENDS = native/python38

DEPENDS = cross/zlib cross/sqlite cross/readline cross/ncursesw cross/bzip2 cross/xz
# required for uuid module
Expand Down
4 changes: 2 additions & 2 deletions cross/vim/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ifeq ($(strip $(PYTHON_PACKAGE)),)
PYTHON_PACKAGE = python311
endif

OPTIONAL_DEPENDS = cross/$(PYTHON_PACKAGE)
OPTIONAL_DEPENDS = cross/python311
DEPENDS = cross/ncursesw

HOMEPAGE = https://www.vim.org/
Expand All @@ -26,7 +26,7 @@ CONFIGURE_ARGS += vim_cv_getcwd_broken=yes vim_cv_stat_ignores_slash=yes vim_cv_
include ../../mk/spksrc.archs.mk

ifneq ($(findstring $(ARCH),$(ARMv5_ARCHS) $(OLD_PPC_ARCHS)),$(ARCH))
BUILD_DEPENDS = cross/$(PYTHON_PACKAGE)
BUILD_DEPENDS = cross/python311
CONFIGURE_ARGS += --enable-python3interp=dynamic --with-python3-command=$(HOSTPYTHON)
CONFIGURE_ARGS += vi_cv_path_python3_conf=$(PYTHON_CFG_PATH)
CONFIGURE_ARGS += vi_cv_path_python3_pfx=$(PYTHON_PREFIX)
Expand Down
2 changes: 1 addition & 1 deletion cross/znc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ifeq ($(strip $(PYTHON_PACKAGE)),)
PYTHON_PACKAGE = python311
endif

BUILD_DEPENDS = cross/$(PYTHON_PACKAGE)
BUILD_DEPENDS = cross/python311
DEPENDS = cross/openssl3 cross/libicu cross/zlib

# configure: No compiler with C++11 support was found
Expand Down
2 changes: 1 addition & 1 deletion diyspk/bandwhich/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ SPK_NAME = bandwhich
SPK_VERS = 0.20.0
SPK_REV = 1

DEPENDS = cross/$(SPK_NAME)
DEPENDS = cross/bandwhich

# unknown relocation type 95 ...
UNSUPPORTED_ARCHS = $(OLD_PPC_ARCHS)
Expand Down
2 changes: 1 addition & 1 deletion diyspk/bottom/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ SPK_NAME = bottom
SPK_VERS = 0.6.8
SPK_REV = 1

DEPENDS = cross/$(SPK_NAME)
DEPENDS = cross/bottom

UNSUPPORTED_ARCHS = $(OLD_PPC_ARCHS)

Expand Down
2 changes: 1 addition & 1 deletion diyspk/cpulimit/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ SPK_NAME = cpulimit
SPK_VERS = 0.2
SPK_REV = 1

DEPENDS = cross/$(SPK_NAME)
DEPENDS = cross/cpulimit

MAINTAINER = SynoCommunity
DESCRIPTION = CPU usage limiter for Linux.
Expand Down
2 changes: 1 addition & 1 deletion diyspk/duf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ SPK_NAME = duf
SPK_VERS = 0.8.1
SPK_REV = 1

DEPENDS = cross/$(SPK_NAME)
DEPENDS = cross/duf

UNSUPPORTED_ARCHS = $(PPC_ARCHS)

Expand Down
2 changes: 1 addition & 1 deletion diyspk/dutree/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ SPK_NAME = dutree
SPK_VERS = 0.2.18
SPK_REV = 1

DEPENDS = cross/$(SPK_NAME)
DEPENDS = cross/dutree

UNSUPPORTED_ARCHS = $(OLD_PPC_ARCHS)

Expand Down
2 changes: 1 addition & 1 deletion diyspk/etherwake/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ SPK_NAME = etherwake
SPK_VERS = 1.09
SPK_REV = 1

DEPENDS = cross/$(SPK_NAME)
DEPENDS = cross/etherwake

MAINTAINER = SynoCommunity
DESCRIPTION = Generate and transmit a Wake-On-LAN (WOL) Magic Packet
Expand Down
4 changes: 2 additions & 2 deletions diyspk/fritzctl/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
SPK_NAME = fritzctl
SPK_VERS = 1.4.23
SPK_REV = 1
SPK_ICON = src/$(SPK_NAME).png
SPK_ICON = src/fritzctl.png

DEPENDS = cross/$(SPK_NAME)
DEPENDS = cross/fritzctl

MAINTAINER = bpicode
DESCRIPTION = A lightweight, easy to use console client for the AVM FRITZ!Box Home Automation.
Expand Down
2 changes: 1 addition & 1 deletion diyspk/jupp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ SPK_VERS = 40
SPK_REV = 2
SPK_ICON = src/jupp.png

DEPENDS = cross/$(SPK_NAME)
DEPENDS = cross/jupp

MAINTAINER = SynoCommunity
DESCRIPTION = text editor jupp comes with the editor flavours known from joe, specifically, jmacs, joe, jpico, jstar, and rjoe.
Expand Down
2 changes: 1 addition & 1 deletion diyspk/mtr/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ SPK_NAME = mtr
SPK_VERS = 0.95
SPK_REV = 1

DEPENDS = cross/$(SPK_NAME)
DEPENDS = cross/mtr

MAINTAINER = SynoCommunity
DESCRIPTION = mtr \(My traceroute\) combines the functionality of the 'traceroute' and 'ping' programs in a single network diagnostic tool.
Expand Down
2 changes: 1 addition & 1 deletion diyspk/procs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ SPK_NAME = procs
SPK_VERS = 0.12.3
SPK_REV = 1

DEPENDS = cross/$(SPK_NAME)
DEPENDS = cross/procs

UNSUPPORTED_ARCHS = $(OLD_PPC_ARCHS)

Expand Down
2 changes: 1 addition & 1 deletion diyspk/tdu/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ SPK_NAME = tdu
SPK_VERS = 1.36
SPK_REV = 1

DEPENDS = cross/$(SPK_NAME)
DEPENDS = cross/tdu

UNSUPPORTED_ARCHS = $(PPC_ARCHS)

Expand Down
2 changes: 1 addition & 1 deletion diyspk/testdisk/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ SPK_VERS = 7.1
SPK_REV = 4
SPK_ICON = src/testdisk.png

DEPENDS = cross/$(SPK_NAME)
DEPENDS = cross/testdisk

MAINTAINER = hgy59
DESCRIPTION = "TestDisk is powerful free data recovery software."
Expand Down
104 changes: 104 additions & 0 deletions mk/dependency-list.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
#!/bin/bash

# Build dependency list
#
# list dependencies for all spk packages
# - used by github prepare action to evaluate packages to build, regarding the modified files
# - broken packages are excluded
# This script must be called in the top folder (spksrc) of the repository
# It is called by the dependency-list target of the toplevel Makefile
#
# This script has benefits over iterating all spk folders and call "make dependency-list"
# - it is much faster (typ. 15 s instead of 180 s)
# - it does not require "OPTIONAL_DEPENDS" defitions anymore
# caveats
# - makefile variables like $(SPK_NAME) are not allowed in dependency definitions anymore
# - definition of dependencies in included make files are not evaluated.
# Those are
# - native/cmake, native/cmake-legacy, native/nasm for cmake/rust packages (^1)
# - cross/$(PYTHON_PACKAGE) for packages reusing prebuilt python (^2)
# - cross/$(FFMPEG_PACKAGE) for packages reusing prebuilt ffmpeg (^2)
# ^1: We could introduce a new OPTIONAL_DEPENDS (ADDITIONAL_DEPENDS) variable to fix this
# But it will hardly happen, that nasm or cmake changes (and are deprecated since those are installed to dev environment)
# ^2: The missing dependencies with packages using prebuilt ffmpeg/python where not
# evaluated in the former solution too.
# So far we did not want to trigger the build of all related packages when only the prebuilt package had changes
# Otherwise we could introduce a new OPTIONAL_DEPENDS (ADDITIONAL_DEPENDS) variable for this

# get SPK_NAME of a package
# since the spk name might be different to the (spk/){package} folder
# we need to parse the variable in the Makefile
# param1: package folder
function get_spk_name ()
{
if [ -f ${1}/Makefile ]; then
grep "^SPK_NAME" ${1}/Makefile | cut -d= -f2 | xargs
fi
}

# evaluates all dependencies in a single Makefile
# param1: folder (like spk/{name}, cross/{name}, native/{name})
function get_file_dependencies ()
{
if [ -f ${1}/Makefile ]; then
grep "^DEPENDS\|^NATIVE_DEPENDS\|^BUILD_DEPENDS" ${1}/Makefile | cut -d= -f2 | sort -u | tr '\n' ' '
fi
}

# search for substring in a list of strings
# param1 list of space separated strings
# param2 substring
function contains ()
{
if [ -z "${1}" -o -z "${2}" ]; then
echo "false";
else
if [ "$(echo ${1} | tr ' ' '\n' | grep -w ${2})" = "${2}" ]; then
echo "true"
else
echo "false"
fi
fi
}

# get direct package dependencies
# param1: list of folders containing Makefile to parse
function get_dependencies ()
{
local dependencies=
for dep in "${1}"; do
dependencies+="${dep} "
dependencies+="$(get_file_dependencies ${dep}) "
done
echo ${dependencies} | tr ' ' '\n' | sort -u | tr '\n' ' '
}

# get all dependencies of a package
# param1: list of toplevel dependencies
function get_spk_dependencies ()
{
local dependencies=$(get_dependencies "${1}")
local cumulated_dependencies=$(get_dependencies "${dependencies}")
while [ "${cumulated_dependencies}" != "${dependencies}" ]; do
dependencies=${cumulated_dependencies}
cumulated_dependencies=$(get_dependencies "${dependencies}")
done
echo ${cumulated_dependencies} | tr ' ' '\n' | sort -u | tr '\n' ' '
}

# get the dependency list for a package
# param1: package name
function get_dependency_list ()
{
local spk_name=$(get_spk_name spk/${package})
local toplevel_dependencies=$(get_file_dependencies spk/${package})
local spk_dependencies=$(get_spk_dependencies "${toplevel_dependencies}")
echo "${spk_name}: ${spk_dependencies}"
}

# iterate all packages
for package in $(find spk/ -maxdepth 1 -type d | cut -c 5- | sort); do
if [ ! -f spk/${package}/BROKEN ]; then
get_dependency_list spk/${package}
fi
done
2 changes: 1 addition & 1 deletion spk/adminer/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ SPK_REV = 5
SPK_ICON = src/adminer.png
DSM_UI_DIR = app

DEPENDS = cross/$(SPK_NAME)
DEPENDS = cross/adminer

MAINTAINER = piwi82
DESCRIPTION = Adminer is a full-featured database management tool available for MySQL, PostgreSQL, SQLite, MS SQL, Oracle, Firebird, SimpleDB, Elasticsearch and MongoDB.
Expand Down
2 changes: 1 addition & 1 deletion spk/bazarr/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ SPK_DEPENDS = "python311:ffmpeg"

WHEELS = src/requirements-crossenv.txt src/requirements-pure.txt

DEPENDS = cross/$(SPK_NAME)
DEPENDS = cross/bazarr
DEPENDS += cross/unrar

# [lxml]
Expand Down
2 changes: 1 addition & 1 deletion spk/bicbucstriim/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ SPK_VERS = 3.4.2
SPK_REV = 7
SPK_ICON = src/bicbucstriim.png

DEPENDS = cross/$(SPK_NAME)
DEPENDS = cross/bicbucstriim
# Pure PHP package, make sure ARCH is noarch
override ARCH=noarch

Expand Down
2 changes: 1 addition & 1 deletion spk/chromaprint/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ SPK_REV = 22
SPK_ICON = src/chromaprint.png

FFMPEG_PACKAGE = ffmpeg7
DEPENDS = cross/$(SPK_NAME)
DEPENDS = cross/chromaprint
SPK_DEPENDS = $(FFMPEG_PACKAGE)

# ffmpeg7 requires c11 support
Expand Down
2 changes: 1 addition & 1 deletion spk/comskip/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ SPK_REV = 12
SPK_ICON = src/comskip.png

FFMPEG_PACKAGE = ffmpeg5
DEPENDS = cross/$(SPK_NAME)
DEPENDS = cross/comskip
SPK_DEPENDS = $(FFMPEG_PACKAGE)

STARTABLE = no
Expand Down
2 changes: 1 addition & 1 deletion spk/curaengine/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ SPK_VERS = 2.1.3
SPK_REV = 2
SPK_ICON = src/curaengine.png

DEPENDS = cross/$(SPK_NAME)
DEPENDS = cross/curaengine

# c++11 compiler required
UNSUPPORTED_ARCHS = $(OLD_PPC_ARCHS) $(ARMv5_ARCHS)
Expand Down
2 changes: 1 addition & 1 deletion spk/dante-sockd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ SPK_VERS = 1.4.3
SPK_REV = 1
SPK_ICON = src/dante.png

DEPENDS = cross/$(SPK_NAME)
DEPENDS = cross/dante-sockd

MAINTAINER = Anonym-tsk
# From Inferno Nettverk A/S
Expand Down
2 changes: 1 addition & 1 deletion spk/darkstat/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ SPK_REV = 5
SPK_ICON = src/darkstat.png
DSM_UI_DIR = app

DEPENDS = cross/$(SPK_NAME)
DEPENDS = cross/darkstat

# DSM 7 does not allow to run package as root
# error: pcap_open_live(): ovs_eth0: You don't have permission to capture on that device (socket: Operation not permitted)
Expand Down
Loading
Loading