Browse Source

LV2: Fix LV2 codesign command during plugin copy step

- The LV2 bundle rather than the executable was incorrectly be signed
v7.0.12
Anthony Nicholls Tom Poole 1 year ago
parent
commit
b6a06ebf24
1 changed files with 30 additions and 29 deletions
  1. +30
    -29
      extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Xcode.h

+ 30
- 29
extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Xcode.h View File

@@ -2561,7 +2561,7 @@ private:
&& target->type == XcodeTarget::UnityPlugIn)
embedUnityScript();
ScriptBuilder copyPluginScript;
ScriptBuilder copyPluginStepScript;
for (ConstConfigIterator config (*this); config.next();)
{
@@ -2576,36 +2576,37 @@ private:
installPath = installPath.replace ("$(HOME)", "${HOME}");
const auto copyScript = [&]
{
const auto generateCopyScript = [](String sourcePlugin, String destinationDir)
{
return ScriptBuilder{}
.set ("destinationPlugin", destinationDir + "/$(basename " + doubleQuoted (sourcePlugin) + ")")
.remove ("${destinationPlugin}")
.copy (sourcePlugin, "${destinationPlugin}")
.insertLine()
.ifSet ("CODE_SIGN_ENTITLEMENTS",
R"(entitlementsArg=(--entitlements "${CODE_SIGN_ENTITLEMENTS}"))")
.run ("codesign --verbose=4 --force --sign",
doubleQuoted ("${CODE_SIGN_IDENTITY:--}"),
"${entitlementsArg[*]-}",
"${OTHER_CODE_SIGN_ARGS-}",
doubleQuoted ("${destinationPlugin}"));
};
if (target->type == XcodeTarget::Target::LV2PlugIn)
return generateCopyScript ("${TARGET_BUILD_DIR}", installPath);
return generateCopyScript ("${TARGET_BUILD_DIR}/${FULL_PRODUCT_NAME}", installPath);
}();
copyPluginScript.ifEqual (doubleQuoted ("${CONFIGURATION}"), doubleQuoted (config->getName()),
copyScript.toString());
const auto sourcePlugin = target->type == XcodeTarget::Target::LV2PlugIn
? "${TARGET_BUILD_DIR}"
: "${TARGET_BUILD_DIR}/${FULL_PRODUCT_NAME}";
const auto copyScript = ScriptBuilder{}
.set ("destinationPlugin", installPath + "/$(basename " + doubleQuoted (sourcePlugin) + ")")
.remove ("${destinationPlugin}")
.copy (sourcePlugin, "${destinationPlugin}");
const auto objectToSignTail = target->type == XcodeTarget::Target::LV2PlugIn
? "/$(basename \"${TARGET_BUILD_DIR}\")/${FULL_PRODUCT_NAME}"
: "/${FULL_PRODUCT_NAME}";
const auto codesignScript = ScriptBuilder{}
.ifSet ("CODE_SIGN_ENTITLEMENTS",
R"(entitlementsArg=(--entitlements "${CODE_SIGN_ENTITLEMENTS}"))")
.run ("codesign --verbose=4 --force --sign",
doubleQuoted ("${CODE_SIGN_IDENTITY:--}"),
"${entitlementsArg[*]-}",
"${OTHER_CODE_SIGN_ARGS-}",
doubleQuoted (installPath + objectToSignTail));
copyPluginStepScript.ifEqual (doubleQuoted ("${CONFIGURATION}"), doubleQuoted (config->getName()),
ScriptBuilder{}.insertScript (copyScript.toString())
.insertLine()
.insertScript (codesignScript.toString())
.toString());
}
if (! copyPluginScript.isEmpty())
target->addShellScriptBuildPhase ("Plugin Copy Step", copyPluginScript.toStringWithDefaultShellOptions());
if (! copyPluginStepScript.isEmpty())
target->addShellScriptBuildPhase ("Plugin Copy Step", copyPluginStepScript.toStringWithDefaultShellOptions());
addTargetObject (*target);
}


Loading…
Cancel
Save