Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

Commit

Permalink
Auto-merge pull request #6321 from livecodepanos/bugfix-20946
Browse files Browse the repository at this point in the history
[20946] Remove 32bit slice from Mac externals if we build for 64bit only

Setting this to blocker as it affects Mac App Store submission
  • Loading branch information
livecode-vulcan committed Feb 9, 2018
2 parents a8f7126 + 66902a8 commit b074753
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
1 change: 1 addition & 0 deletions docs/notes/bugfix-20946.md
@@ -0,0 +1 @@
# Remove 32 bit slice from Mac externals if the standalone supports 64 bit only
2 changes: 1 addition & 1 deletion ide-support/revsaveasstandalone.livecodescript
Expand Up @@ -2175,7 +2175,7 @@ private command revCopyModule pPlatform, pModuleName, pSourceFile, pSourceFolder
if there is a folder pStandaloneRoot & slash & pTargetFolder then
return empty
end if
revSBCopyFolderToDestination tSourcePath, pStandaloneRoot & slash & pTargetFolder, "revStandaloneProgressCallback", the long id of me
revSBCopyFolderToDestination tSourcePath, pStandaloneRoot & slash & pTargetFolder, "revStandaloneProgressCallback", the long id of me, sStandaloneSettingsA
else
if there is no file tSourcePath then
return "not found"
Expand Down
30 changes: 25 additions & 5 deletions ide-support/revsblibrary.livecodescript
Expand Up @@ -52,14 +52,14 @@ on revSBCopyFolder pSource, pTarget, pCallback, pCallbackTarget
end revSBCopyFolder

# Slightly unfortunate naming, perhaps, but what do I call it folderToFolder?!
on revSBCopyFolderToDestination pSourceFolder, pDestinationFolder, pCallback, pCallbackTarget
on revSBCopyFolderToDestination pSourceFolder, pDestinationFolder, pCallback, pCallbackTarget, pSettings
if there is no folder pDestinationFolder then
return "destination folder not found"
end if
set the itemDelimiter to "/"
local tTargetFolder
put pDestinationFolder & "/" & item -1 of pSourceFolder into tTargetFolder
__revSBCopyFolder pSourceFolder, tTargetFolder, pCallback, pCallbackTarget
__revSBCopyFolder pSourceFolder, tTargetFolder, pCallback, pCallbackTarget, pSettings
return the result
end revSBCopyFolderToDestination

Expand Down Expand Up @@ -209,7 +209,7 @@ end revSBWriteFile
# - bsd symlinks (TO DO)
#?author
# Marcus van Houdt
private command __revSBCopyFolder pSource, pTarget, pCallback, pCallbackTarget
private command __revSBCopyFolder pSource, pTarget, pCallback, pCallbackTarget, pSettings
local tResourceList
local tResult

Expand Down Expand Up @@ -268,7 +268,7 @@ private command __revSBCopyFolder pSource, pTarget, pCallback, pCallbackTarget
else if tResource is not empty then
local tFileCallback
put pCallback && tNumberCopied, tTotalNumber & comma into tFileCallback
__revSBCopyFile pSource & "/" & tResource, pTarget & "/" & tResource, tFileCallback, pCallbackTarget
__revSBCopyFile pSource & "/" & tResource, pTarget & "/" & tResource, tFileCallback, pCallbackTarget, pSettings
if the result is not empty then
put the result into tResult
exit repeat
Expand Down Expand Up @@ -298,7 +298,7 @@ end __revSBCopyFolder
# Sends a callback with the number of bytes currently copied and the number left to copy..
#?author
# Marcus van Houdt
private command __revSBCopyFile pSourceFile, pTargetFile, pCallback, pCallbackTarget
private command __revSBCopyFile pSourceFile, pTargetFile, pCallback, pCallbackTarget, pSettings
-- Stat the source file
local tOldFolder, tSize, tPermissions, tUser, tGroup, tFileType
local tResult
Expand Down Expand Up @@ -398,6 +398,26 @@ private command __revSBCopyFile pSourceFile, pTargetFile, pCallback, pCallbackTa
end if
end if

-- Remove unneeded slices from the MacOS externals
if the platform is "macos" and pSettings is not empty then
local tRemove
if pSettings["MacOSX x86-64"] is true and pSettings["MacOSX x86-32"] is not true then
put "i386" into tRemove
else if pSettings["MacOSX x86-32"] is true and pSettings["MacOSX x86-64"] is not true then
put "x86_64" into tRemove
end if

if tRemove is not empty then
set the itemDel to slash
if pSettings["externals"] contains item -1 of pTargetFile then
replace " " with "\ " in pTargetFile
local tShell
put "lipo " & pTargetFile & " -remove " & tRemove & " -output " & pTargetFile into tShell
get shell(tShell)
end if
end if
end if

if tOldFolder is not empty then
set the defaultFolder to tOldFolder
end if
Expand Down

0 comments on commit b074753

Please sign in to comment.