eden/tools/cpm/common.sh
crueter 2e9dbe3f1d
All checks were successful
GitHub Actions [CI] Build succeeded
[cmake, tools, docs] Update CPMUtil (#2790)
updates CPMUtil to
[`8f9b39fc98`](8f9b39fc98)

Makes the tooling/docs better and enforces usage of tar.gz everywhere as
opposed to zips

Signed-off-by: crueter <crueter@eden-emu.dev>

Reviewed-on: #2790
Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
2025-10-20 03:43:15 +02:00

31 lines
No EOL
861 B
Bash
Executable file

#!/bin/sh -e
# SPDX-FileCopyrightText: 2025 crueter
# SPDX-License-Identifier: GPL-3.0-or-later
##################################
# CHANGE THESE FOR YOUR PROJECT! #
##################################
# How many levels to go (3 is 2 subdirs max)
MAXDEPTH=3
# For your project you'll want to change this to define what dirs you have cpmfiles in
# Remember to account for the MAXDEPTH variable!
# Adding ./ before each will help to remove duplicates
[ -z "$CPMFILES" ] && CPMFILES=$(find . ./src -maxdepth "$MAXDEPTH" -name cpmfile.json | sort | uniq)
# shellcheck disable=SC2016
[ -z "$PACKAGES" ] && PACKAGES=$(echo "$CPMFILES" | xargs jq -s 'reduce .[] as $item ({}; . * $item)')
LIBS=$(echo "$PACKAGES" | jq -j 'keys_unsorted | join(" ")')
export PACKAGES
export CPMFILES
export LIBS
export DIRS
export MAXDEPTH
value() {
echo "$JSON" | jq -r ".$1"
}