Skip to content

Commit

Permalink
Ports: Make array-like settings actual arrays
Browse files Browse the repository at this point in the history
We may need entries with spaces in makeopts, installopts, and
configopts, and at that point we should also convert depends and
auth_opts to avoid confusion.
  • Loading branch information
timschumi authored and awesomekling committed Oct 5, 2021
1 parent e507cfc commit c07f914
Show file tree
Hide file tree
Showing 149 changed files with 352 additions and 345 deletions.
33 changes: 20 additions & 13 deletions Ports/.port_include.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,16 @@ host_env() {

packagesdb="${DESTDIR}/usr/Ports/packages.db"

makeopts=-j$(nproc)
installopts=
makeopts=("-j$(nproc)")
installopts=()
configscript=configure
configopts=
configopts=()
useconfigure=false
depends=
depends=()
patchlevel=1
auth_type=
auth_import_key=
auth_opts=
auth_opts=()
launcher_name=
launcher_category=
launcher_command=
Expand Down Expand Up @@ -260,7 +260,7 @@ fetch() {
if $NO_GPG; then
echo "WARNING: gpg signature check was disabled by --no-gpg-verification"
else
if $(gpg --verify $auth_opts); then
if $(gpg --verify "${auth_opts[@]}"); then
echo "- Signature check OK."
else
echo "- Signature check NOT OK"
Expand Down Expand Up @@ -344,16 +344,16 @@ func_defined pre_configure || pre_configure() {
}
func_defined configure || configure() {
chmod +x "${workdir}"/"$configscript"
run ./"$configscript" --host="${SERENITY_ARCH}-pc-serenity" $configopts
run ./"$configscript" --host="${SERENITY_ARCH}-pc-serenity" "${configopts[@]}"
}
func_defined post_configure || post_configure() {
:
}
func_defined build || build() {
run make $makeopts
run make "${makeopts[@]}"
}
func_defined install || install() {
run make DESTDIR=$DESTDIR $installopts install
run make DESTDIR=$DESTDIR "${installopts[@]}" install
}
func_defined post_install || post_install() {
echo
Expand Down Expand Up @@ -402,10 +402,10 @@ addtodb() {
fi
}
installdepends() {
for depend in $depends; do
for depend in "${depends[@]}"; do
dependlist="${dependlist:-} $depend"
done
for depend in $depends; do
for depend in "${depends[@]}"; do
if ! grep "$depend" "$packagesdb" > /dev/null; then
(cd "../$depend" && ./package.sh --auto)
fi
Expand Down Expand Up @@ -489,11 +489,18 @@ do_uninstall() {
uninstall
}
do_showproperty() {
if [ -z ${!1+x} ]; then
if ! declare -p "${1}" > /dev/null 2>&1; then
echo "Property '$1' is not set." >&2
exit 1
fi
echo ${!1}
property_declaration="$(declare -p "${1}")"
if [[ "$property_declaration" =~ "declare -a" ]]; then
prop_array="${1}[@]"
# Some magic to avoid empty arrays being considered unset.
echo "${!prop_array+"${!prop_array}"}"
else
echo ${!1}
fi
}
do_all() {
do_installdepends
Expand Down
6 changes: 3 additions & 3 deletions Ports/Another-World/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
port=Another-World
useconfigure=true
version=git
depends="SDL2 zlib"
depends=("SDL2" "zlib")
workdir=Another-World-Bytecode-Interpreter-master
configopts="-DCMAKE_TOOLCHAIN_FILE=${SERENITY_BUILD_DIR}/CMakeToolchain.txt -DSDL2_INCLUDE_DIR=${SERENITY_INSTALL_ROOT}/usr/local/include/SDL2"
configopts=("-DCMAKE_TOOLCHAIN_FILE=${SERENITY_BUILD_DIR}/CMakeToolchain.txt" "-DSDL2_INCLUDE_DIR=${SERENITY_INSTALL_ROOT}/usr/local/include/SDL2")
files="https://github.com/fabiensanglard/Another-World-Bytecode-Interpreter/archive/refs/heads/master.zip master.zip 326de7622e5f83a83fce76e6032240157a9dde83c0d65319095c7e0b312af317"
auth_type=sha256
launcher_name="Another World"
launcher_category=Games
launcher_command="/opt/Another-World/raw --datapath=/opt/Another-World"

configure() {
run cmake $configopts
run cmake "${configopts[@]}"
}

install() {
Expand Down
2 changes: 1 addition & 1 deletion Ports/SDL2-GNUBoy/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ version=1.2
useconfigure=false
files="https://github.com/AlexOberhofer/SDL2-GNUBoy/archive/refs/tags/v${version}.tar.gz SDL2-GNUBoy-${version}.tar.gz 7d00a80e4b6bbb4c388b1ea0a34daca5f90fba574f09915c5135431f81091c8a"
auth_type=sha256
depends="SDL2"
depends=("SDL2")
4 changes: 2 additions & 2 deletions Ports/SDL2/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ version=git
workdir=SDL-main-serenity
useconfigure=true
files="https://github.com/SerenityPorts/SDL/archive/main-serenity.tar.gz SDL2-git.tar.gz"
configopts="-DCMAKE_TOOLCHAIN_FILE=${SERENITY_BUILD_DIR}/CMakeToolchain.txt -DPULSEAUDIO=OFF -DJACK=OFF"
configopts=("-DCMAKE_TOOLCHAIN_FILE=${SERENITY_BUILD_DIR}/CMakeToolchain.txt" "-DPULSEAUDIO=OFF" "-DJACK=OFF")

configure() {
run cmake $configopts
run cmake "${configopts[@]}"
}

install() {
Expand Down
6 changes: 3 additions & 3 deletions Ports/SDL2_gfx/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ port=SDL2_gfx
version=1.0.4
files="https://downloads.sourceforge.net/project/sdl2gfx/SDL2_gfx-${version}.tar.gz SDL2_gfx-${version}.tar.gz 63e0e01addedc9df2f85b93a248f06e8a04affa014a835c2ea34bfe34e576262"
auth_type=sha256
depends="SDL2"
depends=("SDL2")
useconfigure=true
configopts="--with-sdl-prefix=${SERENITY_INSTALL_ROOT}/usr/local"
configopts=("--with-sdl-prefix=${SERENITY_INSTALL_ROOT}/usr/local")

install() {
run make install DESTDIR=${SERENITY_INSTALL_ROOT} $installopts
run make install DESTDIR=${SERENITY_INSTALL_ROOT} "${installopts[@]}"
run ${CC} -shared -o ${SERENITY_INSTALL_ROOT}/usr/local/lib/libSDL2_gfx.so -Wl,-soname,libSDL2_gfx.so -Wl,--whole-archive ${SERENITY_INSTALL_ROOT}/usr/local/lib/libSDL2_gfx.a -Wl,--no-whole-archive
}
2 changes: 1 addition & 1 deletion Ports/SDL2_image/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
port=SDL2_image
useconfigure=true
version=2.0.5
depends="SDL2 libpng libjpeg libtiff"
depends=("SDL2" "libpng" "libjpeg" "libtiff")
files="https://www.libsdl.org/projects/SDL_image/release/SDL2_image-${version}.tar.gz SDL_image-${version}.tar.gz bdd5f6e026682f7d7e1be0b6051b209da2f402a2dd8bd1c4bd9c25ad263108d0"
auth_type=sha256

Expand Down
2 changes: 1 addition & 1 deletion Ports/SDL2_mixer/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version=2.0.4
useconfigure=true
files="https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-${version}.tar.gz SDL2_mixer-${version}.tar.gz b4cf5a382c061cd75081cf246c2aa2f9df8db04bdda8dcdc6b6cca55bede2419"
auth_type=sha256
depends="SDL2 libvorbis"
depends=("SDL2" "libvorbis")

configure() {
run ./configure \
Expand Down
4 changes: 2 additions & 2 deletions Ports/SDL2_net/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
port=SDL2_net
version=2.0.1
useconfigure=true
configopts=--with-sdl-prefix="${SERENITY_INSTALL_ROOT}/usr/local"
configopts=("--with-sdl-prefix=${SERENITY_INSTALL_ROOT}/usr/local")
files="https://www.libsdl.org/projects/SDL_net/release/SDL2_net-${version}.tar.gz SDL2_net-${version}.tar.gz 15ce8a7e5a23dafe8177c8df6e6c79b6749a03fff1e8196742d3571657609d21"
auth_type=sha256
depends="SDL2"
depends=("SDL2")

post_install() {
run ${CC} -shared -o ${SERENITY_INSTALL_ROOT}/usr/local/lib/libSDL2_net.so -Wl,-soname,libSDL2_net.so -Wl,--whole-archive ${SERENITY_INSTALL_ROOT}/usr/local/lib/libSDL2_net.a -Wl,--no-whole-archive
Expand Down
4 changes: 2 additions & 2 deletions Ports/SDL2_ttf/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version=2.0.15
useconfigure=true
files="https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-${version}.tar.gz SDL2_ttf-${version}.tar.gz a9eceb1ad88c1f1545cd7bd28e7cbc0b2c14191d40238f531a15b01b1b22cd33"
auth_type=sha256
depends="SDL2 freetype"
depends=("SDL2" "freetype")

configure() {
run ./configure \
Expand All @@ -16,6 +16,6 @@ configure() {
}

install() {
run make install DESTDIR=${SERENITY_INSTALL_ROOT} $installopts
run make install DESTDIR=${SERENITY_INSTALL_ROOT} "${installopts[@]}"
run ${CC} -shared -o ${SERENITY_INSTALL_ROOT}/usr/local/lib/libSDL2_ttf.so -Wl,-soname,libSDL2_ttf.so -Wl,--whole-archive ${SERENITY_INSTALL_ROOT}/usr/local/lib/libSDL2_ttf.a -Wl,--no-whole-archive -lfreetype
}
6 changes: 3 additions & 3 deletions Ports/SDLPoP/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
port=PrinceOfPersia
useconfigure=true
version=git
depends="SDL2 SDL2_image"
depends=("SDL2" "SDL2_image")
workdir=SDLPoP-86988c668eeaa10f218e1d4938fc5b4e42314d68
configopts="-DCMAKE_TOOLCHAIN_FILE=${SERENITY_BUILD_DIR}/CMakeToolchain.txt"
configopts=("-DCMAKE_TOOLCHAIN_FILE=${SERENITY_BUILD_DIR}/CMakeToolchain.txt")
files="https://github.com/NagyD/SDLPoP/archive/86988c668eeaa10f218e1d4938fc5b4e42314d68.zip PoP.zip d18cae8541fb8cbcc374fd998316993d561429a83f92061bc0754337ada774c5"
auth_type=sha256
launcher_name="Prince of Persia"
launcher_category=Games
launcher_command=/opt/PrinceOfPersia/prince

configure() {
run cmake $configopts ./src
run cmake "${configopts[@]}" ./src
}

install() {
Expand Down
6 changes: 3 additions & 3 deletions Ports/Super-Mario/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
port=Super-Mario
useconfigure=true
version=git
depends="SDL2 SDL2_mixer SDL2_image"
depends=("SDL2" "SDL2_mixer" "SDL2_image")
workdir=Super-Mario-Clone-Cpp-master
configopts="-DCMAKE_TOOLCHAIN_FILE=${SERENITY_BUILD_DIR}/CMakeToolchain.txt"
configopts=("-DCMAKE_TOOLCHAIN_FILE=${SERENITY_BUILD_DIR}/CMakeToolchain.txt")
files="https://github.com/Bennyhwanggggg/Super-Mario-Clone-Cpp/archive/refs/heads/master.zip master.zip fcacc15d3b5afccb3227f982d3e05f2cfeb198f0fffd008fdcda005cb7f87f91"
auth_type=sha256
launcher_name="Super Mario"
launcher_category=Games
launcher_command=/opt/Super_Mario/uMario

configure() {
run cmake $configopts
run cmake "${configopts[@]}"
}

install() {
Expand Down
4 changes: 2 additions & 2 deletions Ports/bash/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
port=bash
version=5.1.8
useconfigure=true
configopts="--disable-nls --without-bash-malloc"
configopts=("--disable-nls" "--without-bash-malloc")
files="https://ftpmirror.gnu.org/gnu/bash/bash-${version}.tar.gz bash-${version}.tar.gz 0cfb5c9bb1a29f800a97bd242d19511c997a1013815b805e0fdd32214113d6be"
auth_type="sha256"

build() {
run_replace_in_file "s/define GETCWD_BROKEN 1/undef GETCWD_BROKEN/" config.h
run_replace_in_file "s/define CAN_REDEFINE_GETENV 1/undef CAN_REDEFINE_GETENV/" config.h
run make $makeopts
run make "${makeopts[@]}"
}

post_install() {
Expand Down
2 changes: 1 addition & 1 deletion Ports/bass/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ port=bass
version="cd-1.2"
files="https://downloads.scummvm.org/frs/extras/Beneath%20a%20Steel%20Sky/bass-${version}.zip bass-${version}.zip 53209b9400eab6fd7fa71518b2f357c8de75cfeaa5ba57024575ab79cc974593"
auth_type=sha256
depends="scummvm"
depends=("scummvm")

bass_resource_path="/usr/local/share/games/${port}-${version}"

Expand Down
2 changes: 1 addition & 1 deletion Ports/bc/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ useconfigure=true
configscript=configure.sh
auth_type="sig"
auth_import_key="E2A30324A4465A4D5882692EC08038BDF280D33E"
auth_opts="bc-${version}.tar.xz.sig"
auth_opts=("bc-${version}.tar.xz.sig")

configure() {
# NLS needs many things, none of which we support.
Expand Down
4 changes: 2 additions & 2 deletions Ports/binutils/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
port=binutils
version=2.37
useconfigure=true
configopts="--target=${SERENITY_ARCH}-pc-serenity --with-sysroot=/ --with-build-sysroot=${SERENITY_INSTALL_ROOT} --disable-werror --disable-gdb --disable-nls"
configopts=("--target=${SERENITY_ARCH}-pc-serenity" "--with-sysroot=/" "--with-build-sysroot=${SERENITY_INSTALL_ROOT}" "--disable-werror" "--disable-gdb" "--disable-nls")
files="https://ftpmirror.gnu.org/gnu/binutils/binutils-${version}.tar.xz binutils-${version}.tar.xz 820d9724f020a3e69cb337893a0b63c2db161dadcb0e06fc11dc29eb1e84a32c"
auth_type="sha256"
auth_opts="--keyring ./gnu-keyring.gpg binutils-${version}.tar.xz.sig"
auth_opts=("--keyring" "./gnu-keyring.gpg" "binutils-${version}.tar.xz.sig")
export ac_cv_func_getrusage=no
2 changes: 1 addition & 1 deletion Ports/bison/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
port=bison
version=1.25
useconfigure=true
configopts="--prefix=${SERENITY_INSTALL_ROOT}/usr/local"
configopts=("--prefix=${SERENITY_INSTALL_ROOT}/usr/local")
files="https://ftpmirror.gnu.org/gnu/bison/bison-${version}.tar.gz bison-${version}.tar.gz 356bff0a058ca3d59528e0c49e68b90cdeb09779e0d626fc78a94270beed93a6"
auth_type=sha256
4 changes: 2 additions & 2 deletions Ports/brogue/package.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/usr/bin/env -S bash ../.port_include.sh
port=brogue
depends="SDL2 SDL2_image"
depends=("SDL2" "SDL2_image")
version=1.9.3
workdir="BrogueCE-${version}"
files="https://github.com/tmewett/BrogueCE/archive/refs/tags/v${version}.tar.gz brogue.tar.gz 441182916a16114bedfee614b09a198b4877a25db2544c5e087c86038aae2452"
auth_type=sha256
makeopts="bin/brogue"
makeopts=("bin/brogue")

install() {
datadir="$SERENITY_INSTALL_ROOT/usr/local/share/games/brogue/assets"
Expand Down
2 changes: 1 addition & 1 deletion Ports/byacc/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ https://invisible-mirror.net/archives/byacc/byacc-${version}.tgz.asc byacc-${ver
useconfigure=true
auth_type="sig"
auth_import_key="C52048C0C0748FEE227D47A2702353E0F7E48EDB"
auth_opts="byacc-${version}.tgz.asc byacc-${version}.tgz"
auth_opts=("byacc-${version}.tgz.asc byacc-${version}.tgz")
8 changes: 4 additions & 4 deletions Ports/bzip2/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ port=bzip2
version=1.0.8
files="https://sourceware.org/pub/bzip2/bzip2-${version}.tar.gz bzip2-${version}.tar.gz ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269"
auth_type=sha256
makeopts=bzip2
installopts="PREFIX=${SERENITY_INSTALL_ROOT}/usr/local"
makeopts=("bzip2")
installopts=("PREFIX=${SERENITY_INSTALL_ROOT}/usr/local")

build() {
run make CC="${CC}" $makeopts bzip2
run make CC="${CC}" "${makeopts[@]}" bzip2
}

install() {
run make DESTDIR=${SERENITY_INSTALL_ROOT} CC="${CC}" $installopts install
run make DESTDIR=${SERENITY_INSTALL_ROOT} CC="${CC}" "${installopts[@]}" install
}
6 changes: 3 additions & 3 deletions Ports/c-ray/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ version=c094d64570c30c70f4003e9428d31a2a0d9d3d41
useconfigure=true
files="https://github.com/vkoskiv/c-ray/archive/${version}.tar.gz ${version}.tar.gz 1e0663a1d83e8a9984aced33b9307471f3302c8a5ea7ec47954854d60902a747"
auth_type=sha256
configopts="-DCMAKE_TOOLCHAIN_FILE=${SERENITY_BUILD_DIR}/CMakeToolchain.txt"
depends="SDL2"
configopts=("-DCMAKE_TOOLCHAIN_FILE=${SERENITY_BUILD_DIR}/CMakeToolchain.txt")
depends=("SDL2")
workdir="${port}-${version}"

configure() {
run cmake $configopts
run cmake "${configopts[@]}"
}

install() {
Expand Down
6 changes: 3 additions & 3 deletions Ports/chester/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
port=chester
useconfigure=true
version=git
depends="SDL2"
depends=("SDL2")
workdir=chester-public
configopts="-DCMAKE_TOOLCHAIN_FILE=${SERENITY_BUILD_DIR}/CMakeToolchain.txt"
configopts=("-DCMAKE_TOOLCHAIN_FILE=${SERENITY_BUILD_DIR}/CMakeToolchain.txt")
files="https://github.com/veikkos/chester/archive/public.tar.gz chester.tar.gz b3ea7ad40608e1050fa434258f5c69b93e7bad10523c4c4a86fe08d1442a907b"
auth_type=sha256

configure() {
run cmake $configopts
run cmake "${configopts[@]}"
}

install() {
Expand Down
6 changes: 3 additions & 3 deletions Ports/cmake/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ version=3.19.4
useconfigure=true
files="https://github.com/Kitware/CMake/releases/download/v$version/cmake-$version.tar.gz cmake-$version.tar.gz 7d0232b9f1c57e8de81f38071ef8203e6820fe7eec8ae46a1df125d88dbcc2e1"
auth_type=sha256
depends="bash make sed ncurses libuv"
configopts="-DCMAKE_TOOLCHAIN_FILE=${SERENITY_BUILD_DIR}/CMakeToolchain.txt -DCMAKE_USE_SYSTEM_LIBRARY_LIBUV=1 -GNinja"
depends=("bash" "make" "sed" "ncurses" "libuv")
configopts=("-DCMAKE_TOOLCHAIN_FILE=${SERENITY_BUILD_DIR}/CMakeToolchain.txt" "-DCMAKE_USE_SYSTEM_LIBRARY_LIBUV=1" "GNinja")

configure() {
run cmake $configopts .
run cmake "${configopts[@]}" .
}

build() {
Expand Down
6 changes: 3 additions & 3 deletions Ports/cmatrix/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
port=cmatrix
useconfigure=true
version=git
depends="ncurses"
depends=("ncurses")
workdir=cmatrix-master
configopts="-DCMAKE_TOOLCHAIN_FILE=${SERENITY_BUILD_DIR}/CMakeToolchain.txt"
configopts=("-DCMAKE_TOOLCHAIN_FILE=${SERENITY_BUILD_DIR}/CMakeToolchain.txt")
files="https://github.com/abishekvashok/cmatrix/archive/refs/heads/master.zip cmatrix.zip c32ca7562e58fb1fd7a96ebdfbe51c5de060709d39b67fce3c0bc42547e0ccb2"
auth_type=sha256
launcher_name=cmatrix
Expand All @@ -13,7 +13,7 @@ launcher_command=cmatrix
launcher_run_in_terminal=true

configure() {
run cmake $configopts
run cmake "${configopts[@]}"
}

install() {
Expand Down
Loading

0 comments on commit c07f914

Please sign in to comment.