AnalogTapeModel

Physical modelling signal processing for analog tape recording
Log | Files | Refs | Submodules | README | LICENSE

aax_builds.sh (3594B)


      1 #!/bin/bash
      2 
      3 # expand bash aliases
      4 shopt -s expand_aliases
      5 source ~/.bashrc
      6 
      7 # exit on failure
      8 set -e
      9 
     10 # need to run in sudo mode on Mac
     11 if [[ "$OSTYPE" == "darwin"* ]]; then
     12     if [ "$EUID" -ne 0 ]; then
     13         echo "This script must be run in sudo mode! Exiting..."
     14         exit 1
     15     fi
     16 fi
     17 
     18 if [[ "$*" = *debug* ]]; then
     19     echo "Making DEBUG build"
     20     build_config="Debug"
     21 else
     22     echo "Making RELEASE build"
     23     build_config="Release"
     24 fi
     25 
     26 cd Plugin
     27 
     28 # clean up old builds
     29 if [[ $* = *clean* ]]; then
     30     echo "Cleaning previous build..."
     31     rm -rf build-aax/
     32 fi
     33 
     34 sed_cmakelist()
     35 {
     36     sed_args="$1"
     37 
     38     if [[ "$OSTYPE" == "darwin"* ]]; then
     39         sed -i '' "$sed_args" CMakeLists.txt
     40     else
     41         sed -i -e "$sed_args" CMakeLists.txt
     42     fi
     43 }
     44 
     45 # set up OS-dependent variables
     46 if [[ "$OSTYPE" == "darwin"* ]]; then
     47     echo "Building for MAC"
     48 
     49     AAX_PATH=~/Developer/AAX_SDK/
     50     ilok_pass=$(more ~/Developer/ilok_pass)
     51     aax_target_dir="/Library/Application Support/Avid/Audio/Plug-Ins"
     52     TEAM_ID=$(more ~/Developer/mac_id)
     53     TARGET_DIR="Mac"
     54 
     55 else # Windows
     56     echo "Building for WINDOWS"
     57 
     58     AAX_PATH=C:/Users/Jatin/SDKs/AAX_SDK_clang/
     59     ilok_pass=$(cat ~/ilok_pass)
     60     aax_target_dir="/c/Program Files/Common Files/Avid/Audio/Plug-Ins"
     61     TARGET_DIR="Win64"
     62 fi
     63 
     64 # set up build AAX
     65 sed_cmakelist "s~# juce_set_aax_sdk_path.*~juce_set_aax_sdk_path(${AAX_PATH})~"
     66 
     67 # cmake new builds
     68 if [[ "$OSTYPE" == "darwin"* ]]; then
     69     cmake -Bbuild-aax -GXcode -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY="Developer ID Application" \
     70         -DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM="$TEAM_ID" \
     71         -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGN_STYLE="Manual" \
     72         -D"CMAKE_OSX_ARCHITECTURES=arm64;x86_64" \
     73         -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGN_INJECT_BASE_ENTITLEMENTS=NO \
     74         -DCMAKE_XCODE_ATTRIBUTE_OTHER_CODE_SIGN_FLAGS="--timestamp" \
     75         -DMACOS_RELEASE=ON
     76 
     77     cmake --build build-aax --config $build_config -j12 --target CHOWTapeModel_AAX | xcpretty
     78 
     79 else # Windows
     80     cmake -Bbuild-aax -G"Visual Studio 17 2022" -A x64 -T ClangCl
     81     cmake --build build-aax --config $build_config --parallel $(nproc) --target CHOWTapeModel_AAX
     82 fi
     83 
     84 # sign with PACE
     85 aax_location=build-aax/CHOWTapeModel_artefacts/$build_config/AAX/CHOWTapeModel.aaxplugin
     86 wcguid="D3FA57E0-3DA5-11EC-8891-005056920FF7"
     87 if [[ "$OSTYPE" == "darwin"* ]]; then
     88     wraptool sign --verbose \
     89         --account chowdsp \
     90         --password "$ilok_pass" \
     91         --wcguid $wcguid \
     92         --dsig1-compat off \
     93         --signid "Developer ID Application: Jatin Chowdhury" \
     94         --in $aax_location \
     95         --out $aax_location
     96 
     97         # --keyfile $HOME/Downloads/jatin_aax_cert.p12 \
     98         # --keypassword "$ilok_pass" \
     99     wraptool verify --verbose --in $aax_location
    100 
    101 else # Windows
    102     wraptool sign --verbose \
    103         --account chowdsp \
    104         --password "$ilok_pass" \
    105         --wcguid $wcguid \
    106         --keyfile ~/jatin_aax_cert.p12 \
    107         --keypassword "$ilok_pass" \
    108         --in $aax_location \
    109         --out $aax_location
    110         
    111     wraptool verify --verbose --in $aax_location/Contents/x64/CHOWTapeModel.aaxplugin
    112 fi
    113 
    114 # reset AAX SDK field...
    115 sed_cmakelist "s~juce_set_aax_sdk_path.*~# juce_set_aax_sdk_path(NONE)~"
    116 
    117 rm -rf "$aax_target_dir/CHOWTapeModel.aaxplugin"
    118 cp -R "$aax_location" "$aax_target_dir/CHOWTapeModel.aaxplugin"
    119 
    120 if [[ "$*" = *deploy* ]]; then
    121     set +e
    122 
    123     ssh "jatin@ccrma-gate.stanford.edu" "rm -r ~/aax_builds/${TARGET_DIR}/CHOWTapeModel.aaxplugin"
    124     scp -r "$aax_location" "jatin@ccrma-gate.stanford.edu:~/aax_builds/${TARGET_DIR}/"
    125 fi