summaryrefslogtreecommitdiff
path: root/Meta/install-ports-tree.sh
diff options
context:
space:
mode:
authorPeter Elliott <pelliott@ualberta.ca>2021-04-02 21:53:41 -0600
committerAndreas Kling <kling@serenityos.org>2021-04-12 14:06:24 +0200
commit938924f36de1f335903608c28c4ba5284d5dd883 (patch)
tree9c6fa78bc702ccc2b01b85d87719ead859d7b7d2 /Meta/install-ports-tree.sh
parent9c3948ef3e496839a7ae5f6bd4cfb93b7eada682 (diff)
downloadserenity-938924f36de1f335903608c28c4ba5284d5dd883.zip
Meta: Add install-ports CMake target
install-ports copys the necessary files from Ports/ to /usr/Ports. Also refactor the compiler and destiation variables from .port_include.sh into .hosted_defs.sh. .hosted_defs.sh does not exists when ports are built in serenity
Diffstat (limited to 'Meta/install-ports-tree.sh')
-rwxr-xr-xMeta/install-ports-tree.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/Meta/install-ports-tree.sh b/Meta/install-ports-tree.sh
new file mode 100755
index 0000000000..ceac2058fa
--- /dev/null
+++ b/Meta/install-ports-tree.sh
@@ -0,0 +1,10 @@
+#!/usr/bin/env bash
+
+SERENITY_PORTS_DIR="${SERENITY_ROOT}/Build/${SERENITY_ARCH}/Root/usr/Ports"
+
+for file in $(git ls-files "${SERENITY_ROOT}/Ports"); do
+ if [ "$(basename "$file")" != ".hosted_defs.sh" ]; then
+ target=${SERENITY_PORTS_DIR}/$(realpath --relative-to="${SERENITY_ROOT}/Ports" "$file")
+ mkdir -p "$(dirname "$target")" && cp "$file" "$target"
+ fi
+done