@@ -319,6 +319,35 @@ local function getLiveBuildCopyIconScript(src, dest, options)
319319end
320320
321321---- ----------------------------------------------------------------------------
322+ local function getCodesignScript ( entitlements , path , identity , developerBase )
323+
324+ codesign_allocate = xcodetoolhelper [' codesign_allocate' ]
325+ codesign = xcodetoolhelper [' codesign' ]
326+
327+ -- Remove any extended macOS attributes from files in the bundle because
328+ -- codesign doesn't like them
329+ local removeXattrs = " /usr/bin/xattr -cr " .. quoteString (path ) .. " && "
330+
331+ -- quote for spaces
332+ codesign_allocate = quoteString (codesign_allocate )
333+ codesign = quoteString (codesign )
334+ developerBase = quoteString (developerBase )
335+
336+ local devbase_shell = " DEVELOPER_BASE=" .. developerBase .. " \n "
337+ local export_path = [==[
338+ export PATH="$DEVELOPER_BASE/Platforms/iPhoneOS.platform/Developer/usr/bin:$DEVELOPER_BASE/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
339+ ]==]
340+
341+ local script = ' export CODESIGN_ALLOCATE=' .. codesign_allocate .. ' \n '
342+
343+ local quotedpath = quoteString ( path )
344+ local cmd = removeXattrs .. codesign .. " --verbose -f -s " .. quoteString (identity ).. " --entitlements " .. entitlements .. " " .. quotedpath
345+
346+ -- print("getCodesignScript: codesign: ".. codesign)
347+ -- print("getCodesignScript: codesign_allocate: ".. codesign_allocate)
348+ -- print("getCodesignScript: ".. devbase_shell .. export_path .. script .. cmd)
349+ return devbase_shell .. export_path .. script .. cmd
350+ end
322351
323352local function getCodesignAPPXScriptAndPackage (path , identity , entitlements , developerBase , bundleId , isBuildForDistribution )
324353
0 commit comments