mirror of
https://github.com/logos-messaging/nim-sds.git
synced 2026-01-02 14:13:07 +00:00
For some unknown reason the builds would fail with: /bin/sh: line 1: clang: command not found Unless we added Android NDK toolchains/llvm/prebuilt to PATH. Signed-off-by: Jakub Sokołowski <jakub@status.im>
30 lines
1.1 KiB
Bash
Executable File
30 lines
1.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# This script is used for building Nix derivation which doesn't allow Git commands.
|
|
# It implements similar logic as $(NIMBLE_DIR) target in nimbus-build-system Makefile.
|
|
|
|
create_nimble_link_script_path="$(pwd)/${BUILD_SYSTEM_DIR}/scripts/create_nimble_link.sh"
|
|
|
|
process_gitmodules() {
|
|
local gitmodules_file="$1"
|
|
local gitmodules_dir=$(dirname "$gitmodules_file")
|
|
|
|
# Extract all submodule paths from the .gitmodules file
|
|
grep "path" $gitmodules_file | awk '{print $3}' | while read submodule_path; do
|
|
# Change pwd to the submodule dir and execute script
|
|
pushd "$gitmodules_dir/$submodule_path" > /dev/null
|
|
NIMBLE_DIR=$NIMBLE_DIR PWD_CMD=$PWD_CMD EXCLUDED_NIM_PACKAGES=$EXCLUDED_NIM_PACKAGES \
|
|
"$create_nimble_link_script_path" "$submodule_path"
|
|
popd > /dev/null
|
|
done
|
|
}
|
|
|
|
# Create the base directory if it doesn't exist
|
|
mkdir -p "${NIMBLE_DIR}/pkgs"
|
|
|
|
# Find all .gitmodules files and process them
|
|
for gitmodules_file in $(find . -name '.gitmodules'); do
|
|
echo "Processing .gitmodules file: $gitmodules_file"
|
|
process_gitmodules "$gitmodules_file"
|
|
done
|