Skip to content

Commit

Permalink
Redesign dependency-list creation for github prepare action (#6255)
Browse files Browse the repository at this point in the history
* redesign dependency-list creation for github prepare action
- add script to evaluate the dependencies
- use new script in global Makefile for the dependency-list target
- use global Makefile to create dependency-list in prepare.sh
- avoid variables in DEPENDS definitions
- make dependency-list.sh executable

* stockfish-webgui: fix digests

* dependency-list: add python and ffmpeg dependency based on include file

* revert changes in sabnzbd
- avoid conflicting changes with #6366

* revert changes in vim
- avoid conflicting changes with #6398

* revert changes in java-11-openjdk
- avoid conflicting changes with #6394
  • Loading branch information
hgy59 authored Jan 18, 2025
1 parent 0e05b07 commit bdc87a5
Show file tree
Hide file tree
Showing 42 changed files with 180 additions and 57 deletions.
8 changes: 1 addition & 7 deletions .github/actions/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,7 @@ SPK_TO_BUILD="${USER_SPK_TO_BUILD} ${GH_SPK_PACKAGES} "
# 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 ${GH_DEPENDENCY_FOLDERS}
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/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/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
6 changes: 3 additions & 3 deletions cross/stockfish-webgui/digests
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
stockfish-webgui-gite474343.tar.gz SHA1 50fa54b5d6fbebe817fa0438619bcc5a74224f95
stockfish-webgui-gite474343.tar.gz SHA256 f2abdc0f2bd29804f7473d87e84d3d105775f4b242c7be879c5459975f0e7399
stockfish-webgui-gite474343.tar.gz MD5 5293d2fb00b57335e6d05e587b59e081
stockfish-webgui-gite474343.tar.gz SHA1 cf17da9801ae61e20b04c7a794bbf128d7bcf507
stockfish-webgui-gite474343.tar.gz SHA256 a9e240b642773e6faae59ab3fc851054ff7743bb436953190d9b0dd8ab4509f7
stockfish-webgui-gite474343.tar.gz MD5 d8cdcb7ecd833e858e2e852a07419273
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 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
129 changes: 129 additions & 0 deletions mk/dependency-list.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
#!/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
}

# evaluate python dependency in an spk Makefile
# param1: spk package folder (like spk/{name})
function get_python_dependency ()
{
if [ -f ${1}/Makefile -a "$(grep ^include.*\/spksrc\.python\.mk ${1}/Makefile)" ]; then
local dep=$(grep "PYTHON_PACKAGE\s*=" ${1}/Makefile | cut -d= -f2 | xargs)
echo "cross/${dep} "
fi
}

# evaluate ffmpeg dependency in an spk Makefile
# param1: spk package folder (like spk/{name})
function get_ffmpeg_dependency ()
{
if [ -f ${1}/Makefile -a "$(grep ^include.*\/spksrc\.ffmpeg\.mk ${1}/Makefile)" ]; then
local dep=$(grep "FFMPEG_PACKAGE\s*=" ${1}/Makefile | cut -d= -f2 | xargs)
echo "cross/${dep} "
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
if [ "$(dirname ${1})" = "spk" ]; then
get_python_dependency ${1}
get_ffmpeg_dependency ${1}
fi
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: spk package folder (like spk/{name})
function get_dependency_list ()
{
local spk_name=$(get_spk_name ${1})
local toplevel_dependencies=$(get_file_dependencies ${1})
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/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
2 changes: 1 addition & 1 deletion spk/dnscrypt-proxy/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ SPK_VERS = 2.0.44
SPK_REV = 5
SPK_ICON = src/dnscrypt-proxy.png

DEPENDS = cross/$(SPK_NAME)
DEPENDS = cross/dnscrypt-proxy
SPK_CONFLICT = DNSServer
UNSUPPORTED_ARCHS = $(PPC_ARCHS)

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

DEPENDS = cross/busybox cross/dtach cross/$(SPK_NAME)
DEPENDS = cross/busybox cross/dtach cross/gateone
WHEELS = src/requirements.txt
SPK_DEPENDS = "python>=2.7.11-15"

Expand Down
2 changes: 1 addition & 1 deletion spk/haproxy/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ SPK_ICON = src/haproxy.png
DSM_UI_DIR = app
DSM_APP_NAME = SYNOCOMMUNITY.HAProxy.AppInstance

DEPENDS = cross/$(SPK_NAME)
DEPENDS = cross/haproxy
WHEELS = src/requirements.txt
SPK_DEPENDS = "python>2.7.18-25"

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

DEPENDS = cross/$(SPK_NAME)
DEPENDS = cross/he853
REQUIRED_MIN_DSM = 5.0

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

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

MAINTAINER = SynoCommunity
DESCRIPTION = Icecast is a streaming media server which currently supports Ogg \(Vorbis and Theora\), Opus, WebM and MP3 audio streams. It can be used to create an Internet radio station or a privately running jukebox and many things in between. It is very versatile in that new formats can be added relatively easily and supports open standards for communication and interaction. This package includes Ezstream, a command line source client for Icecast media streaming servers.
Expand Down
Loading

0 comments on commit bdc87a5

Please sign in to comment.