From 8a93388a495e1620a8a5f924be5744fc9d4c17f4 Mon Sep 17 00:00:00 2001 From: casey langen Date: Tue, 13 Dec 2022 21:07:07 -0800 Subject: [PATCH] Remove a bunch of old, unused scripts. --- .cmake/PostBuild.cmake | 2 +- script/archive-rpi.sh | 9 --- script/archive-standalone-nix.sh | 3 +- script/copy-artifacts-to-host.sh | 28 --------- script/download-vendor-libraries-win.sh | 57 ----------------- script/patch-macos-rpath.sh | 14 ----- .../{patch-linux-rpath.sh => patch-rpath.sh} | 13 +++- script/run-circle-ci.sh | 63 ------------------- script/run-rpm-build.sh | 11 ---- script/update-version-hash.sh | 5 -- 10 files changed, 14 insertions(+), 191 deletions(-) delete mode 100755 script/archive-rpi.sh delete mode 100755 script/copy-artifacts-to-host.sh delete mode 100644 script/download-vendor-libraries-win.sh delete mode 100755 script/patch-macos-rpath.sh rename script/{patch-linux-rpath.sh => patch-rpath.sh} (53%) mode change 100755 => 100644 delete mode 100755 script/run-circle-ci.sh delete mode 100755 script/run-rpm-build.sh delete mode 100755 script/update-version-hash.sh diff --git a/.cmake/PostBuild.cmake b/.cmake/PostBuild.cmake index 9724f75a7..b8d221b16 100644 --- a/.cmake/PostBuild.cmake +++ b/.cmake/PostBuild.cmake @@ -7,7 +7,7 @@ add_custom_command(TARGET postbuild POST_BUILD COMMAND cmake .) # ensure the binaries can find libmusikcore.so, which lives in the same directory. if (CMAKE_SYSTEM_NAME MATCHES "Darwin") message(STATUS "[post-build] patching macOS rpath...") - add_custom_command(TARGET postbuild POST_BUILD COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/script/patch-macos-rpath.sh") + add_custom_command(TARGET postbuild POST_BUILD COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/script/patch-rpath.sh") endif() # copy boost and ffmpeg libraries (which can't be statically linked) to bin/ diff --git a/script/archive-rpi.sh b/script/archive-rpi.sh deleted file mode 100755 index 71cf1d1c5..000000000 --- a/script/archive-rpi.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -SCRIPT_DIR=`dirname "$0"` - -rm -rf bin -${SCRIPT_DIR}/clean-nix.sh -cmake -DENABLE_PCH=true -DGENERATE_DEB=true -DDEB_ARCHITECTURE=armhf -DDEB_PLATFORM=rpi -DDEB_DISTRO=buster -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release . -make -j4 -cpack diff --git a/script/archive-standalone-nix.sh b/script/archive-standalone-nix.sh index 3769b4ce1..d19b45ec6 100755 --- a/script/archive-standalone-nix.sh +++ b/script/archive-standalone-nix.sh @@ -73,8 +73,7 @@ else make ${JOBS} || exit $? fi -./script/patch-linux-rpath.sh || exit $? -./script/patch-macos-rpath.sh || exit $? +./script/patch-rpath.sh || exit $? rm -rf dist/$VERSION/*${OS_ARCH}_$VERSION* 2> /dev/null diff --git a/script/copy-artifacts-to-host.sh b/script/copy-artifacts-to-host.sh deleted file mode 100755 index e615a29e8..000000000 --- a/script/copy-artifacts-to-host.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -if [[ -z "${MUSIKCUBE_BUILD_HOST_IP}" ]]; then - echo "no build host ip specified" - exit -fi - -if [[ -z "${MUSIKCUBE_BUILD_HOST_PW}" ]]; then - echo "no build host pw specified" - exit -fi - -if [[ -z "${MUSIKCUBE_BUILD_HOST_PORT}" ]]; then - MUSIKCUBE_BUILD_HOST_PORT=22 -fi - -GLOB=${1} - -if [[ -z "${GLOB}" ]]; then - echo "no file glob specified." - exit -fi - -echo "copying build artifacts to host..." -echo " from: ${GLOB}" -ls -al "${GLOB}" -sshpass -p ${MUSIKCUBE_BUILD_HOST_PW} scp -P ${MUSIKCUBE_BUILD_HOST_PORT} -o StrictHostKeyChecking=no "${GLOB}" build@${MUSIKCUBE_BUILD_HOST_IP}:/home/build/ 2> /dev/null -echo "finished copying build artifacts." diff --git a/script/download-vendor-libraries-win.sh b/script/download-vendor-libraries-win.sh deleted file mode 100644 index fc430a464..000000000 --- a/script/download-vendor-libraries-win.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/bash - -function copy_or_download { - url_path=$1 - fn=$2 - wget_cache="/tmp/musikcube_build_wget_cache" - mkdir -p wget_cache 2> /dev/null - if [[ -f "$wget_cache/$fn" ]]; then - cp "$wget_cache/$fn" . - else - wget -P $wget_cache "$url_path/$fn" || exit $? - cp "$wget_cache/$fn" . || exit $? - fi - unzip $fn -} - -function stage_arch { - arch=$1 - mkdir -p $arch/lib - mkdir -p $arch/dll - mkdir -p $arch/include - mv stage/bin/ - mkdir lib -} - -function process_x86() { - mkdir x86 - cd x86 - copy_or_download https://windows.php.net/downloads/php-sdk/deps/vs16/x86 zlib-1.2.12-vs16-x86.zip - copy_or_download https://windows.php.net/downloads/php-sdk/deps/vs16/x86 openssl-1.1.1n-vs16-x86.zip - copy_or_download https://windows.php.net/downloads/php-sdk/deps/vs16/x86 libcurl-7.83.0-vs16-x86.zip - copy_or_download https://lib.openmpt.org/files/libopenmpt/dev libopenmpt-0.6.3+release.dev.windows.vs2022.zip - rm *.zip - mkdir stage - mv * stage/ - cd .. -} - -function process_x64() { - mkdir x64 - cd x64 - copy_or_download https://windows.php.net/downloads/php-sdk/deps/vs16/x64 zlib-1.2.12-vs16-x64.zip - copy_or_download https://windows.php.net/downloads/php-sdk/deps/vs16/x64 openssl-1.1.1n-vs16-x64.zip - copy_or_download https://windows.php.net/downloads/php-sdk/deps/vs16/x64 libcurl-7.83.0-vs16-x64.zip - copy_or_download https://lib.openmpt.org/files/libopenmpt/dev libopenmpt-0.6.3+release.dev.windows.vs2022.zip - rm *.zip - mkdir stage - mv * stage - cd .. -} - -rm -rf vendor -mkdir vendor -cd vendor -process_x86 -process_x64 -cd .. \ No newline at end of file diff --git a/script/patch-macos-rpath.sh b/script/patch-macos-rpath.sh deleted file mode 100755 index 0d2e4f1de..000000000 --- a/script/patch-macos-rpath.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -PLATFORM=$(uname) - -if [[ "$PLATFORM" == 'Darwin' ]]; then - echo "[patch-macos-rpath] patch macOS binaries..." - - install_name_tool -add_rpath "@executable_path/" bin/musikcube - install_name_tool -add_rpath "@executable_path/lib" bin/musikcube - install_name_tool -add_rpath "@executable_path/" bin/musikcubed - install_name_tool -add_rpath "@executable_path/lib" bin/musikcubed -fi - -exit 0 \ No newline at end of file diff --git a/script/patch-linux-rpath.sh b/script/patch-rpath.sh old mode 100755 new mode 100644 similarity index 53% rename from script/patch-linux-rpath.sh rename to script/patch-rpath.sh index 6a299dd58..d5a7b0c63 --- a/script/patch-linux-rpath.sh +++ b/script/patch-rpath.sh @@ -3,7 +3,7 @@ PLATFORM=$(uname) if [[ "$PLATFORM" == 'Linux' ]]; then - echo "[patch-linux-rpath] patch Linux .so files..." + echo "[patch-rpath] patch Linux .so files..." # update the RPATH so libraries in libs/ can discover each other, # and plugins can discover themselves, and libs/ (but not the @@ -23,3 +23,14 @@ if [[ "$PLATFORM" == 'Linux' ]]; then chmod -x ./bin/lib/* fi + +if [[ "$PLATFORM" == 'Darwin' ]]; then + echo "[patch-rpath] patch macOS binaries..." + + install_name_tool -add_rpath "@executable_path/" bin/musikcube + install_name_tool -add_rpath "@executable_path/lib" bin/musikcube + install_name_tool -add_rpath "@executable_path/" bin/musikcubed + install_name_tool -add_rpath "@executable_path/lib" bin/musikcubed +fi + +exit 0 \ No newline at end of file diff --git a/script/run-circle-ci.sh b/script/run-circle-ci.sh deleted file mode 100755 index 53892c0a9..000000000 --- a/script/run-circle-ci.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash - -IP=$1 -PORT=$2 -PW=$3 -JOB_COUNT=$4 - -if [[ -z "${IP}" ]]; then - echo "no ip address specified." - echo "invoke with 'run-circle-ci.sh '" - exit -fi - -if [[ -z "${PORT}" ]]; then - echo "no file port address specified." - echo "invoke with 'run-circle-ci.sh '" - exit -fi - -if [[ -z "${PW}" ]]; then - echo "no scp password address specified." - echo "invoke with 'run-circle-ci.sh '" - exit -fi - -if [[ -z "${JOB_COUNT}" ]]; then - echo "no job count specified." - echo "invoke with 'run-circle-ci.sh '" - exit -fi - -# pre-process the yml file, and change max processes from 2 to 7 -circleci config process .circleci/config.yml > local-circle-ci.yml -sed -i "s/-j2/-j${JOB_COUNT}/g" local-circle-ci.yml - -ALL_JOBS=( - "build_ubuntu_focal" - "build_ubuntu_hirsute" - "build_ubuntu_impish" - "build_fedora_32" - "build_fedora_33" - "build_fedora_34" - "build_fedora_35" - "build_mint_una" - "build_debian_buster" - "build_debian_bullseye" -) - -BRANCH="master" -REPO="https://github.com/clangen/musikcube" - -for JOB in ${ALL_JOBS[@]}; do - circleci local execute \ - -c local-circle-ci.yml \ - -e CIRCLE_BRANCH=${BRANCH} \ - -e CIRCLE_REPOSITORY_URL=${REPO} \ - -e MUSIKCUBE_BUILD_HOST_IP=${IP} \ - -e MUSIKCUBE_BUILD_HOST_PORT=${PORT} \ - -e MUSIKCUBE_BUILD_HOST_PW=${PW} \ - -e MUSIKCUBE_BUILD_JOB_COUNT=${JOB_COUNT} \ - --job ${JOB} -done - diff --git a/script/run-rpm-build.sh b/script/run-rpm-build.sh deleted file mode 100755 index c8f4d79de..000000000 --- a/script/run-rpm-build.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -JOB_COUNT=${MUSIKCUBE_BUILD_JOB_COUNT} -if [[ -z "${JOB_COUNT}" ]]; then - JOB_COUNT=2 -fi - -echo "configuring rpm with ${JOB_COUNT} jobs" -sed -i "s/-j2/-j${JOB_COUNT}/g" musikcube.spec -rpmbuild -ba -vv musikcube.spec - diff --git a/script/update-version-hash.sh b/script/update-version-hash.sh deleted file mode 100755 index 53f600906..000000000 --- a/script/update-version-hash.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -COMMIT_HASH=`git rev-parse --short HEAD 2> /dev/null | sed "s/\(.*\)/#\1/"` -sed -Ei.bak "s/(\s*)(#define VERSION_COMMIT_HASH )(.*)/\1\2\"${COMMIT_HASH}\"/g" src/musikcore/version.h -rm src/musikcore/version.h.bak