From e45e0eeb477629bd877e1837724e121f0c11b9ca Mon Sep 17 00:00:00 2001 From: Panagiotis Vasilopoulos Date: Tue, 20 Apr 2021 03:51:04 +0300 Subject: [PATCH] Everywhere: Replace SERENITY_ROOT with SERENITY_SOURCE_DIR --- .github/workflows/cmake.yml | 2 +- Base/usr/share/man/man1/test-js.md | 2 +- CMakeLists.txt | 6 +++--- Meta/build-image-grub.sh | 4 ++-- Meta/build-image-qemu.sh | 2 +- Meta/build-root-filesystem.sh | 24 ++++++++++++------------ Meta/install-ports-tree.sh | 6 +++--- Meta/refresh-serenity-qtcreator.sh | 8 ++++---- Meta/run.sh | 6 +++--- Meta/serenity.sh | 12 ++++++------ Ports/.hosted_defs.sh | 2 +- Ports/README.md | 4 ++-- Ports/SDL2/package.sh | 2 +- Ports/SDLPoP/package.sh | 2 +- Ports/Super-Mario/package.sh | 2 +- Ports/c-ray/package.sh | 2 +- Ports/chester/package.sh | 2 +- Ports/cmake/package.sh | 2 +- Ports/cmatrix/package.sh | 2 +- Ports/dialog/package.sh | 2 +- Ports/emu2/package.sh | 2 +- Ports/flatbuffers/package.sh | 2 +- Ports/frotz/package.sh | 2 +- Ports/genemu/package.sh | 2 +- Ports/hatari/package.sh | 2 +- Ports/libzip/package.sh | 2 +- Ports/nesalizer/package.sh | 2 +- Ports/oksh/package.sh | 2 +- Ports/pt2-clone/package.sh | 2 +- Ports/python3/package.sh | 2 +- Toolchain/CMake/CMakeToolchain.txt | 8 ++++---- Userland/Utilities/test-js.cpp | 8 ++++---- Userland/Utilities/test-web.cpp | 8 ++++---- 33 files changed, 69 insertions(+), 69 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 6bceeebd34a..4bf69fae7c4 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -6,7 +6,7 @@ env: # Don't mix these up! # runner.workspace = /home/runner/work/serenity # github.workspace = /home/runner/work/serenity/serenity - SERENITY_ROOT: ${{ github.workspace }} + SERENITY_SOURCE_DIR: ${{ github.workspace }} jobs: build_and_test_serenity: diff --git a/Base/usr/share/man/man1/test-js.md b/Base/usr/share/man/man1/test-js.md index 451743720fa..fde6b65d456 100644 --- a/Base/usr/share/man/man1/test-js.md +++ b/Base/usr/share/man/man1/test-js.md @@ -16,7 +16,7 @@ tests are using a custom JavaScript testing framework inspired by It also supports the [test262 parser tests](https://github.com/tc39/test262-parser-tests). -The test root directory is assumed to be `/home/anon/js-tests`, or `$SERENITY_ROOT/Libraries/LibJS/Tests` +The test root directory is assumed to be `/home/anon/js-tests`, or `$SERENITY_SOURCE_DIR/Libraries/LibJS/Tests` when using the Lagom build. Optionally you can pass a custom path to `test-js` to override these defaults. You can disable output from `dbgln()` calls by setting the `DISABLE_DBG_OUTPUT` environment variable. diff --git a/CMakeLists.txt b/CMakeLists.txt index ad04fb49e41..8ba74b58689 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,12 +48,12 @@ add_custom_target(image DEPENDS qemu-image ) add_custom_target(qemu-image - COMMAND ${CMAKE_COMMAND} -E env "SERENITY_ROOT=${CMAKE_SOURCE_DIR}" "SERENITY_ARCH=${SERENITY_ARCH}" ${CMAKE_SOURCE_DIR}/Meta/build-image-qemu.sh + COMMAND ${CMAKE_COMMAND} -E env "SERENITY_SOURCE_DIR=${CMAKE_SOURCE_DIR}" "SERENITY_ARCH=${SERENITY_ARCH}" ${CMAKE_SOURCE_DIR}/Meta/build-image-qemu.sh BYPRODUCTS ${CMAKE_BINARY_DIR}/_disk_image USES_TERMINAL ) add_custom_target(grub-image - COMMAND ${CMAKE_COMMAND} -E env "SERENITY_ROOT=${CMAKE_SOURCE_DIR}" "SERENITY_ARCH=${SERENITY_ARCH}" ${CMAKE_SOURCE_DIR}/Meta/build-image-grub.sh + COMMAND ${CMAKE_COMMAND} -E env "SERENITY_SOURCE_DIR=${CMAKE_SOURCE_DIR}" "SERENITY_ARCH=${SERENITY_ARCH}" ${CMAKE_SOURCE_DIR}/Meta/build-image-grub.sh BYPRODUCTS ${CMAKE_BINARY_DIR}/grub_disk_image USES_TERMINAL ) @@ -68,7 +68,7 @@ add_custom_target(check-style ) add_custom_target(install-ports - COMMAND ${CMAKE_COMMAND} -E env "SERENITY_ROOT=${CMAKE_SOURCE_DIR}" "SERENITY_ARCH=${SERENITY_ARCH}" ${CMAKE_SOURCE_DIR}/Meta/install-ports-tree.sh + COMMAND ${CMAKE_COMMAND} -E env "SERENITY_SOURCE_DIR=${CMAKE_SOURCE_DIR}" "SERENITY_ARCH=${SERENITY_ARCH}" ${CMAKE_SOURCE_DIR}/Meta/install-ports-tree.sh USES_TERMINAL ) diff --git a/Meta/build-image-grub.sh b/Meta/build-image-grub.sh index 7c72d1740e8..d4a55cc37e3 100755 --- a/Meta/build-image-grub.sh +++ b/Meta/build-image-grub.sh @@ -27,7 +27,7 @@ disk_usage() { du -sm "$1" | cut -f1 } -DISK_SIZE=$(($(disk_usage "$SERENITY_ROOT/Base") + $(disk_usage Root) + 300)) +DISK_SIZE=$(($(disk_usage "$SERENITY_SOURCE_DIR/Base") + $(disk_usage Root) + 300)) echo "setting up disk image..." if [ "$1" = "ebr" ]; then @@ -98,7 +98,7 @@ script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P) "$script_path/build-root-filesystem.sh" if [ -z "$2" ]; then - grub_cfg="$SERENITY_ROOT"/Meta/grub-"${partition_scheme}".cfg + grub_cfg="$SERENITY_SOURCE_DIR"/Meta/grub-"${partition_scheme}".cfg else grub_cfg=$2 fi diff --git a/Meta/build-image-qemu.sh b/Meta/build-image-qemu.sh index e826c556af0..c54f7b9a687 100755 --- a/Meta/build-image-qemu.sh +++ b/Meta/build-image-qemu.sh @@ -23,7 +23,7 @@ disk_usage() { expr "$(du -sk "$1" | cut -f1)" / 1024 } -DISK_SIZE=$(($(disk_usage "$SERENITY_ROOT/Base") + $(disk_usage Root) + 100)) +DISK_SIZE=$(($(disk_usage "$SERENITY_SOURCE_DIR/Base") + $(disk_usage Root) + 100)) echo "setting up disk image..." qemu-img create _disk_image "${DISK_SIZE:-600}"m || die "could not create disk image" diff --git a/Meta/build-root-filesystem.sh b/Meta/build-root-filesystem.sh index 6238fe6174f..62145dfc4d2 100755 --- a/Meta/build-root-filesystem.sh +++ b/Meta/build-root-filesystem.sh @@ -26,19 +26,19 @@ if [ "$(id -u)" != 0 ]; then die "this script needs to run as root" fi -[ -z "$SERENITY_ROOT" ] && die "SERENITY_ROOT is not set" -[ -d "$SERENITY_ROOT/Base" ] || die "$SERENITY_ROOT/Base doesn't exist" +[ -z "$SERENITY_SOURCE_DIR" ] && die "SERENITY_SOURCE_DIR is not set" +[ -d "$SERENITY_SOURCE_DIR/Base" ] || die "$SERENITY_SOURCE_DIR/Base doesn't exist" umask 0022 printf "installing base system... " -$CP -PdR "$SERENITY_ROOT"/Base/* mnt/ -$CP "$SERENITY_ROOT"/Toolchain/Local/i686/i686-pc-serenity/lib/libgcc_s.so mnt/usr/lib/ +$CP -PdR "$SERENITY_SOURCE_DIR"/Base/* mnt/ +$CP "$SERENITY_SOURCE_DIR"/Toolchain/Local/i686/i686-pc-serenity/lib/libgcc_s.so mnt/usr/lib/ $CP -PdR Root/* mnt/ # If umask was 027 or similar when the repo was cloned, # file permissions in Base/ are too restrictive. Restore # the permissions needed in the image. -chmod -R g+rX,o+rX "$SERENITY_ROOT"/Base/* mnt/ +chmod -R g+rX,o+rX "$SERENITY_SOURCE_DIR"/Base/* mnt/ chmod 660 mnt/etc/WindowServer/WindowServer.ini chown $window_uid:$window_gid mnt/etc/WindowServer/WindowServer.ini @@ -96,9 +96,9 @@ mkdir -p mnt/home/anon mkdir -p mnt/home/anon/Desktop mkdir -p mnt/home/anon/Downloads mkdir -p mnt/home/nona -cp "$SERENITY_ROOT"/README.md mnt/home/anon/ -cp -r "$SERENITY_ROOT"/Userland/Libraries/LibJS/Tests mnt/home/anon/js-tests -cp -r "$SERENITY_ROOT"/Userland/Libraries/LibWeb/Tests mnt/home/anon/web-tests +cp "$SERENITY_SOURCE_DIR"/README.md mnt/home/anon/ +cp -r "$SERENITY_SOURCE_DIR"/Userland/Libraries/LibJS/Tests mnt/home/anon/js-tests +cp -r "$SERENITY_SOURCE_DIR"/Userland/Libraries/LibWeb/Tests mnt/home/anon/web-tests chmod 700 mnt/root chmod 700 mnt/home/anon chmod 700 mnt/home/nona @@ -126,14 +126,14 @@ ln -s checksum mnt/bin/sha256sum ln -s checksum mnt/bin/sha512sum echo "done" -if [ -f "${SERENITY_ROOT}/Kernel/sync-local.sh" ] || [ -f "${SERENITY_ROOT}/Build/sync-local.sh" ]; then +if [ -f "${SERENITY_SOURCE_DIR}/Kernel/sync-local.sh" ] || [ -f "${SERENITY_SOURCE_DIR}/Build/sync-local.sh" ]; then # TODO: Deprecated on 2021-01-30. In a few months, remove this 'if'. tput setaf 1 echo echo " +-----------------------------------------------------------------------------+" echo " | |" echo " | WARNING: sync-local.sh, previously located in Kernel/ and later Build/ |" - echo " | must be moved to \$SERENITY_ROOT! |" + echo " | must be moved to \$SERENITY_SOURCE_DIR! |" echo " | See https://github.com/SerenityOS/serenity/pull/5172 for details. |" echo " | |" echo " +-----------------------------------------------------------------------------+" @@ -142,6 +142,6 @@ if [ -f "${SERENITY_ROOT}/Kernel/sync-local.sh" ] || [ -f "${SERENITY_ROOT}/Buil fi # Run local sync script, if it exists -if [ -f "${SERENITY_ROOT}/sync-local.sh" ]; then - sh "${SERENITY_ROOT}/sync-local.sh" +if [ -f "${SERENITY_SOURCE_DIR}/sync-local.sh" ]; then + sh "${SERENITY_SOURCE_DIR}/sync-local.sh" fi diff --git a/Meta/install-ports-tree.sh b/Meta/install-ports-tree.sh index ceac2058fa8..1003c83df4e 100755 --- a/Meta/install-ports-tree.sh +++ b/Meta/install-ports-tree.sh @@ -1,10 +1,10 @@ #!/usr/bin/env bash -SERENITY_PORTS_DIR="${SERENITY_ROOT}/Build/${SERENITY_ARCH}/Root/usr/Ports" +SERENITY_PORTS_DIR="${SERENITY_SOURCE_DIR}/Build/${SERENITY_ARCH}/Root/usr/Ports" -for file in $(git ls-files "${SERENITY_ROOT}/Ports"); do +for file in $(git ls-files "${SERENITY_SOURCE_DIR}/Ports"); do if [ "$(basename "$file")" != ".hosted_defs.sh" ]; then - target=${SERENITY_PORTS_DIR}/$(realpath --relative-to="${SERENITY_ROOT}/Ports" "$file") + target=${SERENITY_PORTS_DIR}/$(realpath --relative-to="${SERENITY_SOURCE_DIR}/Ports" "$file") mkdir -p "$(dirname "$target")" && cp "$file" "$target" fi done diff --git a/Meta/refresh-serenity-qtcreator.sh b/Meta/refresh-serenity-qtcreator.sh index f89825b0a4e..3fb4653144e 100755 --- a/Meta/refresh-serenity-qtcreator.sh +++ b/Meta/refresh-serenity-qtcreator.sh @@ -2,13 +2,13 @@ set -e -if [ -z "$SERENITY_ROOT" ] +if [ -z "$SERENITY_SOURCE_DIR" ] then - SERENITY_ROOT="$(git rev-parse --show-toplevel)" + SERENITY_SOURCE_DIR="$(git rev-parse --show-toplevel)" echo "Serenity root not set. This is fine! Other scripts may require you to set the environment variable first, e.g.:" - echo " export SERENITY_ROOT=${SERENITY_ROOT}" + echo " export SERENITY_SOURCE_DIR=${SERENITY_SOURCE_DIR}" fi -cd "$SERENITY_ROOT" +cd "$SERENITY_SOURCE_DIR" find . \( -name Base -o -name Patches -o -name Ports -o -name Root -o -name Toolchain -o -name Build \) -prune -o \( -name '*.ipc' -or -name '*.cpp' -or -name '*.idl' -or -name '*.c' -or -name '*.h' -or -name '*.S' -or -name '*.css' -or -name '*.json' -or -name '*.gml' -or -name 'CMakeLists.txt' \) -print > serenity.files diff --git a/Meta/run.sh b/Meta/run.sh index 26bbc54ec08..12779b20c63 100755 --- a/Meta/run.sh +++ b/Meta/run.sh @@ -91,9 +91,9 @@ cd -P -- "$SERENITY_BUILD" || die "Could not cd to \"$SERENITY_BUILD\"" if [ "$SERENITY_RUN" = "b" ]; then # Meta/run.sh b: bochs [ -z "$SERENITY_BOCHSRC" ] && { - # Make sure that SERENITY_ROOT is set and not empty - [ -z "$SERENITY_ROOT" ] && die 'SERENITY_ROOT not set or empty' - SERENITY_BOCHSRC="$SERENITY_ROOT/Meta/bochsrc" + # Make sure that SERENITY_SOURCE_DIR is set and not empty + [ -z "$SERENITY_SOURCE_DIR" ] && die 'SERENITY_SOURCE_DIR not set or empty' + SERENITY_BOCHSRC="$SERENITY_SOURCE_DIR/Meta/bochsrc" } "$SERENITY_BOCHS_BIN" -q -f "$SERENITY_BOCHSRC" elif [ "$SERENITY_RUN" = "qn" ]; then diff --git a/Meta/serenity.sh b/Meta/serenity.sh index ec412f6163d..77672bc3c43 100755 --- a/Meta/serenity.sh +++ b/Meta/serenity.sh @@ -106,14 +106,14 @@ create_build_dir() { cmd_with_target() { is_valid_target || ( >&2 echo "Unknown target: $TARGET"; usage ) - if [ ! -d "$SERENITY_ROOT" ]; then - SERENITY_ROOT="$(get_top_dir)" - export SERENITY_ROOT + if [ ! -d "$SERENITY_SOURCE_DIR" ]; then + SERENITY_SOURCE_DIR="$(get_top_dir)" + export SERENITY_SOURCE_DIR fi - BUILD_DIR="$SERENITY_ROOT/Build/$TARGET" + BUILD_DIR="$SERENITY_SOURCE_DIR/Build/$TARGET" if [ "$TARGET" != "lagom" ]; then export SERENITY_ARCH="$TARGET" - TOOLCHAIN_DIR="$SERENITY_ROOT/Toolchain/Build/$TARGET" + TOOLCHAIN_DIR="$SERENITY_SOURCE_DIR/Toolchain/Build/$TARGET" fi } @@ -140,7 +140,7 @@ delete_target() { } build_toolchain() { - ( cd "$SERENITY_ROOT/Toolchain" && ARCH="$TARGET" ./BuildIt.sh ) + ( cd "$SERENITY_SOURCE_DIR/Toolchain" && ARCH="$TARGET" ./BuildIt.sh ) } ensure_toolchain() { diff --git a/Ports/.hosted_defs.sh b/Ports/.hosted_defs.sh index ffab6a67b54..89e89b04e55 100644 --- a/Ports/.hosted_defs.sh +++ b/Ports/.hosted_defs.sh @@ -10,7 +10,7 @@ export PKG_CONFIG_DIR="" export PKG_CONFIG_SYSROOT_DIR="${SERENITY_BUILD_DIR}/Root" export PKG_CONFIG_LIBDIR="${PKG_CONFIG_SYSROOT_DIR}/usr/lib/pkgconfig/:${PKG_CONFIG_SYSROOT_DIR}/usr/local/lib/pkgconfig" -# To be removed. +# To be deprecated soon. export SERENITY_ROOT="$(realpath "${SCRIPT}/../")" enable_ccache diff --git a/Ports/README.md b/Ports/README.md index f698ff7b39f..42ab7d77a54 100644 --- a/Ports/README.md +++ b/Ports/README.md @@ -190,7 +190,7 @@ keyring and can later be used for verification using [`auth_opts`](#auth_opts). Options passed to `make install` in the default `install` function. -`DESTDIR="${SERENITY_BUILD_DIR}/Root"` (`"${SERENITY_ROOT}/Build/${SERENITY_ARCH}/Root"`) +`DESTDIR="${SERENITY_BUILD_DIR}/Root"` (`"${SERENITY_SOURCE_DIR}/Build/${SERENITY_ARCH}/Root"`) is always passed, override the `install` function if that's undesirable. #### `makeopts` @@ -215,7 +215,7 @@ is placed in. The location of the ports directory, only used for the `package.db` file for now. Don't override this in ports contributed to Serenity. -Defaults to `$SERENITY_ROOT/Ports`. +Defaults to `$SERENITY_SOURCE_DIR/Ports`. #### `useconfigure` diff --git a/Ports/SDL2/package.sh b/Ports/SDL2/package.sh index ad1f4011121..13ff708022e 100755 --- a/Ports/SDL2/package.sh +++ b/Ports/SDL2/package.sh @@ -5,7 +5,7 @@ workdir=SDL-main-serenity useconfigure=true files="https://github.com/SerenityOS/SDL/archive/main-serenity.tar.gz SDL2-git.tar.gz 18ce496be8644b0eb7fc4cad0d8dd5ff" auth_type=md5 -configopts="-DCMAKE_TOOLCHAIN_FILE=$SERENITY_ROOT/Toolchain/CMake/CMakeToolchain.txt -DPULSEAUDIO=OFF -DJACK=OFF" +configopts="-DCMAKE_TOOLCHAIN_FILE=$SERENITY_SOURCE_DIR/Toolchain/CMake/CMakeToolchain.txt -DPULSEAUDIO=OFF -DJACK=OFF" configure() { run cmake $configopts diff --git a/Ports/SDLPoP/package.sh b/Ports/SDLPoP/package.sh index 60fa734cbd5..0cdee7f07ac 100755 --- a/Ports/SDLPoP/package.sh +++ b/Ports/SDLPoP/package.sh @@ -4,7 +4,7 @@ useconfigure=true version=git depends="SDL2 SDL2_image" workdir=SDLPoP-86988c668eeaa10f218e1d4938fc5b4e42314d68 -configopts="-DCMAKE_TOOLCHAIN_FILE=$SERENITY_ROOT/Toolchain/CMake/CMakeToolchain.txt" +configopts="-DCMAKE_TOOLCHAIN_FILE=$SERENITY_SOURCE_DIR/Toolchain/CMake/CMakeToolchain.txt" files="https://github.com/NagyD/SDLPoP/archive/86988c668eeaa10f218e1d4938fc5b4e42314d68.zip PoP.zip d18cae8541fb8cbcc374fd998316993d561429a83f92061bc0754337ada774c5" auth_type=sha256 install_location="Root/opt/PrinceOfPersia" diff --git a/Ports/Super-Mario/package.sh b/Ports/Super-Mario/package.sh index 7ae580e9c82..480f96ba6bc 100755 --- a/Ports/Super-Mario/package.sh +++ b/Ports/Super-Mario/package.sh @@ -4,7 +4,7 @@ useconfigure=true version=git depends="SDL2 SDL2_mixer SDL2_image" workdir=Super-Mario-Clone-Cpp-master -configopts="-DCMAKE_TOOLCHAIN_FILE=$SERENITY_ROOT/Toolchain/CMake/CMakeToolchain.txt" +configopts="-DCMAKE_TOOLCHAIN_FILE=$SERENITY_SOURCE_DIR/Toolchain/CMake/CMakeToolchain.txt" files="https://github.com/Bennyhwanggggg/Super-Mario-Clone-Cpp/archive/refs/heads/master.zip master.zip 11f622721d1ba504acf75c024aa0dbe3" auth_type=md5 install_location="Root/opt/Super_Mario" diff --git a/Ports/c-ray/package.sh b/Ports/c-ray/package.sh index 27a68f9bd84..7a93152bea5 100755 --- a/Ports/c-ray/package.sh +++ b/Ports/c-ray/package.sh @@ -4,7 +4,7 @@ version=c094d64570c30c70f4003e9428d31a2a0d9d3d41 useconfigure=true files="https://github.com/vkoskiv/c-ray/archive/${version}.tar.gz ${version}.tar.gz b83e3c6a1462486257dfe38d309b47c2" auth_type=md5 -configopts="-DCMAKE_TOOLCHAIN_FILE=$SERENITY_ROOT/Toolchain/CMake/CMakeToolchain.txt" +configopts="-DCMAKE_TOOLCHAIN_FILE=$SERENITY_SOURCE_DIR/Toolchain/CMake/CMakeToolchain.txt" depends="SDL2" workdir="${port}-${version}" diff --git a/Ports/chester/package.sh b/Ports/chester/package.sh index c1bb8f7e087..c61e5502dbf 100755 --- a/Ports/chester/package.sh +++ b/Ports/chester/package.sh @@ -4,7 +4,7 @@ useconfigure=true version=git depends="SDL2" workdir=chester-public -configopts="-DCMAKE_TOOLCHAIN_FILE=$SERENITY_ROOT/Toolchain/CMake/CMakeToolchain.txt" +configopts="-DCMAKE_TOOLCHAIN_FILE=$SERENITY_SOURCE_DIR/Toolchain/CMake/CMakeToolchain.txt" files="https://github.com/veikkos/chester/archive/public.tar.gz chester.tar.gz f09d797209e7bfd9b1460d2540525186" auth_type=md5 diff --git a/Ports/cmake/package.sh b/Ports/cmake/package.sh index 3e6763649d9..499205dde15 100755 --- a/Ports/cmake/package.sh +++ b/Ports/cmake/package.sh @@ -5,7 +5,7 @@ useconfigure=true files="https://github.com/Kitware/CMake/releases/download/v$version/cmake-$version.tar.gz cmake-$version.tar.gz 2a71f16c61bac5402004066d193fc14e" auth_type=md5 depends="bash gcc make sed ncurses" -configopts="-DCMAKE_TOOLCHAIN_FILE=$SERENITY_ROOT/Toolchain/CMake/CMakeToolchain.txt" +configopts="-DCMAKE_TOOLCHAIN_FILE=$SERENITY_SOURCE_DIR/Toolchain/CMake/CMakeToolchain.txt" configure() { run cmake $configopts . diff --git a/Ports/cmatrix/package.sh b/Ports/cmatrix/package.sh index 246b0d7d28c..46def566f30 100755 --- a/Ports/cmatrix/package.sh +++ b/Ports/cmatrix/package.sh @@ -4,7 +4,7 @@ useconfigure=true version=git depends="ncurses" workdir=cmatrix-master -configopts="-DCMAKE_TOOLCHAIN_FILE=$SERENITY_ROOT/Toolchain/CMake/CMakeToolchain.txt" +configopts="-DCMAKE_TOOLCHAIN_FILE=$SERENITY_SOURCE_DIR/Toolchain/CMake/CMakeToolchain.txt" files="https://github.com/abishekvashok/cmatrix/archive/refs/heads/master.zip cmatrix.zip 2541321b89149b375d5732402e52d654" auth_type=md5 diff --git a/Ports/dialog/package.sh b/Ports/dialog/package.sh index c4e921ffeda..d2c82df23af 100755 --- a/Ports/dialog/package.sh +++ b/Ports/dialog/package.sh @@ -8,4 +8,4 @@ auth_type="sig" auth_import_key="C52048C0C0748FEE227D47A2702353E0F7E48EDB" auth_opts="dialog-${version}.tgz.asc dialog-${version}.tgz" useconfigure=true -configopts="--prefix=/usr/local --with-ncurses --with-curses-dir=${SERENITY_ROOT}/Build/i686/Root/usr/local/include/ncurses" +configopts="--prefix=/usr/local --with-ncurses --with-curses-dir=${SERENITY_SOURCE_DIR}/Build/i686/Root/usr/local/include/ncurses" diff --git a/Ports/emu2/package.sh b/Ports/emu2/package.sh index da04e3666ed..e63c42beee7 100755 --- a/Ports/emu2/package.sh +++ b/Ports/emu2/package.sh @@ -5,6 +5,6 @@ files="https://github.com/dmsc/emu2/archive/${version}.zip emu2-${version}.zip 2 auth_type=md5 build() { - export CC="${SERENITY_ROOT}/Toolchain/Local/${SERENITY_ARCH}/bin/${SERENITY_ARCH}-pc-serenity-gcc" + export CC="${SERENITY_SOURCE_DIR}/Toolchain/Local/${SERENITY_ARCH}/bin/${SERENITY_ARCH}-pc-serenity-gcc" run make DESTDIR="${SERENITY_BUILD_DIR}/Root" CC="${CC}" $installopts } diff --git a/Ports/flatbuffers/package.sh b/Ports/flatbuffers/package.sh index 569ee4fa8b3..0b2ecf2c098 100755 --- a/Ports/flatbuffers/package.sh +++ b/Ports/flatbuffers/package.sh @@ -7,7 +7,7 @@ files="https://github.com/google/flatbuffers/archive/refs/tags/v${version}.tar.g useconfigure=true # Since we are cross-compiling, we cannot build the tests, because we need # the flatbuffers compiler to build them -configopts="-DCMAKE_TOOLCHAIN_FILE=$SERENITY_ROOT/Toolchain/CMake/CMakeToolchain.txt -DFLATBUFFERS_BUILD_TESTS=off" +configopts="-DCMAKE_TOOLCHAIN_FILE=$SERENITY_SOURCE_DIR/Toolchain/CMake/CMakeToolchain.txt -DFLATBUFFERS_BUILD_TESTS=off" configure() { run cmake $configopts diff --git a/Ports/frotz/package.sh b/Ports/frotz/package.sh index 4147bcb8fbb..6229c3d0073 100755 --- a/Ports/frotz/package.sh +++ b/Ports/frotz/package.sh @@ -9,7 +9,7 @@ depends="ncurses" build() { run make \ PKG_CONFIG_CURSES=no \ - CURSES_CFLAGS="-I${SERENITY_ROOT}/Build/i686/Root/usr/local/include/ncurses" \ + CURSES_CFLAGS="-I${SERENITY_SOURCE_DIR}/Build/i686/Root/usr/local/include/ncurses" \ CURSES_LDFLAGS="-lncurses -ltinfo" \ CURSES=ncurses \ USE_UTF8=no \ diff --git a/Ports/genemu/package.sh b/Ports/genemu/package.sh index b683796604b..7259a844d6d 100755 --- a/Ports/genemu/package.sh +++ b/Ports/genemu/package.sh @@ -4,7 +4,7 @@ version=3bf6f7cd893db3451019d6e18a2d9ad1de0e7c8c useconfigure=true files="https://github.com/rasky/genemu/archive/${version}.tar.gz genemu-${version}.tar.gz 5704a21341ea56d026601e48e08f4605" auth_type=md5 -configopts="-DCMAKE_TOOLCHAIN_FILE=${SERENITY_ROOT}/Toolchain/CMake/CMakeToolchain.txt" +configopts="-DCMAKE_TOOLCHAIN_FILE=${SERENITY_SOURCE_DIR}/Toolchain/CMake/CMakeToolchain.txt" depends="SDL2" configure() { diff --git a/Ports/hatari/package.sh b/Ports/hatari/package.sh index 84c564e2166..aaec6041942 100755 --- a/Ports/hatari/package.sh +++ b/Ports/hatari/package.sh @@ -5,7 +5,7 @@ version=2.4.0-devel depends="SDL2 zlib" commit=353379e1f8a847cc0e284541d2b40fd49d175d22 workdir="${port}-${commit}" -configopts="-DCMAKE_TOOLCHAIN_FILE=$SERENITY_ROOT/Toolchain/CMake/CMakeToolchain.txt" +configopts="-DCMAKE_TOOLCHAIN_FILE=$SERENITY_SOURCE_DIR/Toolchain/CMake/CMakeToolchain.txt" files="https://github.com/hatari/hatari/archive/${commit}.tar.gz ${commit}.tar.gz 614d8c20a06deea6df464a5de32cc795" auth_type=md5 diff --git a/Ports/libzip/package.sh b/Ports/libzip/package.sh index 08883415dd0..e951a2dcedb 100755 --- a/Ports/libzip/package.sh +++ b/Ports/libzip/package.sh @@ -4,7 +4,7 @@ useconfigure=true version=1.7.3 depends="zlib" workdir=libzip-${version} -configopts="-DCMAKE_TOOLCHAIN_FILE=$SERENITY_ROOT/Toolchain/CMake/CMakeToolchain.txt" +configopts="-DCMAKE_TOOLCHAIN_FILE=$SERENITY_SOURCE_DIR/Toolchain/CMake/CMakeToolchain.txt" files="https://libzip.org/download/libzip-${version}.tar.gz libzip-${version}.tar.gz 76f8fea9b88f6ead7f15ed7712eb5aef" auth_type=md5 diff --git a/Ports/nesalizer/package.sh b/Ports/nesalizer/package.sh index 2aab4dbae9a..050c7df3730 100755 --- a/Ports/nesalizer/package.sh +++ b/Ports/nesalizer/package.sh @@ -1,7 +1,7 @@ #!/usr/bin/env -S bash ../.port_include.sh port=nesalizer version=master -makeopts="CONF=release EXTRA=-I${SERENITY_ROOT}/Build/i686/Root/usr/local/include/SDL2" +makeopts="CONF=release EXTRA=-I${SERENITY_SOURCE_DIR}/Build/i686/Root/usr/local/include/SDL2" files="https://github.com/SerenityOS/nesalizer/archive/master.zip nesalizer-master.zip 0bbcde24c2366ced827ad63935f557cf" auth_type=md5 depends=SDL2 diff --git a/Ports/oksh/package.sh b/Ports/oksh/package.sh index f2354b3c563..5301acaa08f 100755 --- a/Ports/oksh/package.sh +++ b/Ports/oksh/package.sh @@ -8,7 +8,7 @@ files="https://github.com/ibara/oksh/releases/download/oksh-${version}/oksh-${ve auth_type=md5 configure() { - export CC=${SERENITY_ROOT}/Toolchain/Local/${SERENITY_ARCH}/bin/${SERENITY_ARCH}-pc-serenity-gcc + export CC=${SERENITY_SOURCE_DIR}/Toolchain/Local/${SERENITY_ARCH}/bin/${SERENITY_ARCH}-pc-serenity-gcc export CFLAGS="" export LDFLAGS="-lncurses" run ./configure --no-thanks diff --git a/Ports/pt2-clone/package.sh b/Ports/pt2-clone/package.sh index 4d1bf693c19..5545e2e3904 100755 --- a/Ports/pt2-clone/package.sh +++ b/Ports/pt2-clone/package.sh @@ -4,7 +4,7 @@ version=1.28 useconfigure=true files="https://github.com/8bitbubsy/pt2-clone/archive/v${version}.tar.gz v${version}.tar.gz 42df939c03b7e598ed8b17a764150860" auth_type=md5 -configopts="-DCMAKE_TOOLCHAIN_FILE=$SERENITY_ROOT/Toolchain/CMake/CMakeToolchain.txt" +configopts="-DCMAKE_TOOLCHAIN_FILE=$SERENITY_SOURCE_DIR/Toolchain/CMake/CMakeToolchain.txt" depends="SDL2" configure() { diff --git a/Ports/python3/package.sh b/Ports/python3/package.sh index 62d2b15ed7e..3342f4896ba 100755 --- a/Ports/python3/package.sh +++ b/Ports/python3/package.sh @@ -27,7 +27,7 @@ pre_configure() { } post_configure() { - run cp "${SERENITY_ROOT}/Ports/${port}/Setup.local" "Modules/Setup.local" + run cp "${SERENITY_SOURCE_DIR}/Ports/${port}/Setup.local" "Modules/Setup.local" } if [ -x "$(command -v python3)" ]; then diff --git a/Toolchain/CMake/CMakeToolchain.txt b/Toolchain/CMake/CMakeToolchain.txt index 7d9920ee2c3..ef2551e9436 100644 --- a/Toolchain/CMake/CMakeToolchain.txt +++ b/Toolchain/CMake/CMakeToolchain.txt @@ -4,15 +4,15 @@ if (NOT DEFINED ENV{SERENITY_ARCH}) message(FATAL_ERROR "SERENITY_ARCH not set.") endif() -if (NOT DEFINED ENV{SERENITY_ROOT}) - message(FATAL_ERROR "SERENITY_ROOT not set.") +if (NOT DEFINED ENV{SERENITY_SOURCE_DIR}) + message(FATAL_ERROR "SERENITY_SOURCE_DIR not set.") endif() set(SERENITYOS 1) set(CMAKE_SYSTEM_PROCESSOR "$ENV{SERENITY_ARCH}") -set(SERENITY_BUILD_DIR $ENV{SERENITY_ROOT}/Build/$ENV{SERENITY_ARCH}) +set(SERENITY_BUILD_DIR $ENV{SERENITY_SOURCE_DIR}/Build/$ENV{SERENITY_ARCH}) # where to read from/write to set(CMAKE_SYSROOT ${SERENITY_BUILD_DIR}/Root) @@ -28,4 +28,4 @@ set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) -list(APPEND CMAKE_MODULE_PATH "$ENV{SERENITY_ROOT}/Toolchain/CMake") +list(APPEND CMAKE_MODULE_PATH "$ENV{SERENITY_SOURCE_DIR}/Toolchain/CMake") diff --git a/Userland/Utilities/test-js.cpp b/Userland/Utilities/test-js.cpp index e9fb4e51934..8b312ab77d6 100644 --- a/Userland/Utilities/test-js.cpp +++ b/Userland/Utilities/test-js.cpp @@ -744,12 +744,12 @@ int main(int argc, char** argv) #ifdef __serenity__ test_root = "/home/anon/js-tests"; #else - char* serenity_root = getenv("SERENITY_ROOT"); - if (!serenity_root) { - warnln("No test root given, test-js requires the SERENITY_ROOT environment variable to be set"); + char* serenity_source_dir = getenv("SERENITY_SOURCE_DIR"); + if (!serenity_source_dir) { + warnln("No test root given, test-js requires the SERENITY_SOURCE_DIR environment variable to be set"); return 1; } - test_root = String::formatted("{}/Userland/Libraries/LibJS/Tests", serenity_root); + test_root = String::formatted("{}/Userland/Libraries/LibJS/Tests", serenity_source_dir); #endif } if (!Core::File::is_directory(test_root)) { diff --git a/Userland/Utilities/test-web.cpp b/Userland/Utilities/test-web.cpp index e03445204a7..a05f0ae60be 100644 --- a/Userland/Utilities/test-web.cpp +++ b/Userland/Utilities/test-web.cpp @@ -676,12 +676,12 @@ int main(int argc, char** argv) #ifdef __serenity__ TestRunner("/home/anon/web-tests", "/home/anon/js-tests", view, print_times).run(); #else - char* serenity_root = getenv("SERENITY_ROOT"); - if (!serenity_root) { - printf("test-web requires the SERENITY_ROOT environment variable to be set"); + char* serenity_source_dir = getenv("SERENITY_SOURCE_DIR"); + if (!serenity_source_dir) { + printf("test-web requires the SERENITY_SOURCE_DIR environment variable to be set"); return 1; } - TestRunner(String::format("%s/Userland/Libraries/LibWeb/Tests", serenity_root), String::format("%s/Userland/Libraries/LibJS/Tests", serenity_root), view, print_times).run(); + TestRunner(String::format("%s/Userland/Libraries/LibWeb/Tests", serenity_source_dir), String::format("%s/Userland/Libraries/LibJS/Tests", serenity_source_dir), view, print_times).run(); #endif return 0; }