titaniumenv: add hack to reduce keychain blocking problems

+13 -1
+13 -1
pkgs/development/mobile/titaniumenv/build-app.nix
··· 19 deleteKeychain = '' 20 security default-keychain -s login.keychain 21 security delete-keychain $keychainName 22 ''; 23 24 # On macOS, the java executable shows an -unoffical postfix in the version ··· 131 then 132 ln -s ${titaniumsdk}/modules modules 133 fi 134 - 135 # Do the actual build 136 titanium build --config-file $TMPDIR/config.json --force --no-colors --platform ios --target dist-adhoc --pp-uuid $provisioningId --distribution-name "${iosCertificateName}" --keychain $HOME/Library/Keychains/$keychainName-db --device-family universal --ios-version ${iosVersion} --output-dir $out 137
··· 19 deleteKeychain = '' 20 security default-keychain -s login.keychain 21 security delete-keychain $keychainName 22 + rm -f $HOME/lock-keychain 23 ''; 24 25 # On macOS, the java executable shows an -unoffical postfix in the version ··· 132 then 133 ln -s ${titaniumsdk}/modules modules 134 fi 135 + 136 + # Take precautions to prevent concurrent builds blocking the keychain 137 + while [ -f $HOME/lock-keychain ] 138 + do 139 + echo "Keychain locked, waiting for a couple of seconds, or remove $HOME/lock-keychain to unblock..." 140 + sleep 3 141 + done 142 + 143 + touch $HOME/lock-keychain 144 + 145 + security default-keychain -s $keychainName 146 + 147 # Do the actual build 148 titanium build --config-file $TMPDIR/config.json --force --no-colors --platform ios --target dist-adhoc --pp-uuid $provisioningId --distribution-name "${iosCertificateName}" --keychain $HOME/Library/Keychains/$keychainName-db --device-family universal --ios-version ${iosVersion} --output-dir $out 149