From af65381d8ab07fd0d63b2b8afbbb4b1272994700 Mon Sep 17 00:00:00 2001 From: Jonathon Fowler Date: Sun, 3 Mar 2024 13:26:52 +1000 Subject: [PATCH] kenbuild: macos packaging --- .gitignore | 1 + kenbuild/tools/package-macos.sh | 75 ++++++++++++++++++++++ xcode/Common.xcconfig | 4 ++ xcode/Version.xcconfig.sample | 2 + xcode/build-Info.plist | 4 +- xcode/engine.xcodeproj/project.pbxproj | 87 ++++++++++++++++++++++++++ xcode/game-Info.plist | 4 +- xcode/game.xcodeproj/project.pbxproj | 42 ++++++++++++- 8 files changed, 215 insertions(+), 4 deletions(-) create mode 100755 kenbuild/tools/package-macos.sh create mode 100644 xcode/Version.xcconfig.sample diff --git a/.gitignore b/.gitignore index 208d069a..eac9d57e 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ /xcode/*.xcodeproj/project.xcworkspace /xcode/*.xcodeproj/xcuserdata /xcode/Signing.xcconfig +/xcode/Version.xcconfig /xcode/build /xcode/frameworks diff --git a/kenbuild/tools/package-macos.sh b/kenbuild/tools/package-macos.sh new file mode 100755 index 00000000..21d09575 --- /dev/null +++ b/kenbuild/tools/package-macos.sh @@ -0,0 +1,75 @@ +#!/bin/bash + +APPLEID=appledev@jonof.id.au +KEYCHAINPROFILE=default +PRODUCT=jfbuild +BUNDLEID=au.id.jonof.kenbuild +VERSION=$(date +%Y%m%d) + +if [ "$1" = "build" ]; then + set -xe + + # Clean everything. + (cd ../xcode && xcrun xcodebuild -project game.xcodeproj -alltargets clean) + + # Configure code signing. + cat >../xcode/Signing.xcconfig <../xcode/Version.xcconfig <APPL CFBundleSignature ???? + CFBundleShortVersionString + $(CURRENT_PROJECT_VERSION) CFBundleVersion - 1.0 + $(CURRENT_PROJECT_VERSION) LSMinimumSystemVersionByArchitecture x86_64 diff --git a/xcode/engine.xcodeproj/project.pbxproj b/xcode/engine.xcodeproj/project.pbxproj index 16d44b19..87f4584d 100644 --- a/xcode/engine.xcodeproj/project.pbxproj +++ b/xcode/engine.xcodeproj/project.pbxproj @@ -27,6 +27,7 @@ AB77B4D6171AC3F700982712 /* PBXTargetDependency */, AB77B4D8171AC3F700982712 /* PBXTargetDependency */, AB77B4DA171AC3F700982712 /* PBXTargetDependency */, + AB392FF92B9427F3002B0F5D /* PBXTargetDependency */, ABD03E291A518A1F0012B9D1 /* PBXTargetDependency */, ); name = tools; @@ -36,6 +37,11 @@ /* Begin PBXBuildFile section */ AB1751270CEF5AF8003AF128 /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB1751260CEF5AF8003AF128 /* SDL2.framework */; }; + AB392FEE2B9427BA002B0F5D /* compat.c in Sources */ = {isa = PBXBuildFile; fileRef = AB735F510A29A39C003261DC /* compat.c */; }; + AB392FEF2B9427BA002B0F5D /* osxbits.m in Sources */ = {isa = PBXBuildFile; fileRef = AB735F5C0A29A39C003261DC /* osxbits.m */; }; + AB392FF12B9427BA002B0F5D /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB7029840AEB2D69004FCD2A /* AppKit.framework */; }; + AB392FF72B9427E5002B0F5D /* klist.c in Sources */ = {isa = PBXBuildFile; fileRef = AB392FF62B9427E5002B0F5D /* klist.c */; }; + AB3930042B9428B2002B0F5D /* crc32.c in Sources */ = {isa = PBXBuildFile; fileRef = AB735F520A29A39C003261DC /* crc32.c */; }; AB3B2A0E0EE3FC0400944CD1 /* hightile.c in Sources */ = {isa = PBXBuildFile; fileRef = AB3B2A0D0EE3FC0400944CD1 /* hightile.c */; }; AB3B2A1D0EE3FCF900944CD1 /* polymost.c in Sources */ = {isa = PBXBuildFile; fileRef = AB3B2A1C0EE3FCF900944CD1 /* polymost.c */; }; AB3B2AB60EE402B600944CD1 /* engine_priv.h in Headers */ = {isa = PBXBuildFile; fileRef = AB3B2AB50EE402B600944CD1 /* engine_priv.h */; }; @@ -139,6 +145,13 @@ /* End PBXBuildRule section */ /* Begin PBXContainerItemProxy section */ + AB392FF82B9427F3002B0F5D /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = AB735F3A0A29A24A003261DC /* Project object */; + proxyType = 1; + remoteGlobalIDString = AB392FEB2B9427BA002B0F5D; + remoteInfo = klist; + }; AB3FE4660C0433A600D5DBDC /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = AB735F3A0A29A24A003261DC /* Project object */; @@ -197,6 +210,8 @@ /* Begin PBXFileReference section */ AB1751260CEF5AF8003AF128 /* SDL2.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL2.framework; path = frameworks/SDL2.framework; sourceTree = SOURCE_ROOT; }; + AB392FF52B9427BA002B0F5D /* klist */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = klist; sourceTree = BUILT_PRODUCTS_DIR; }; + AB392FF62B9427E5002B0F5D /* klist.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = klist.c; sourceTree = ""; }; AB3B2A0D0EE3FC0400944CD1 /* hightile.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = hightile.c; sourceTree = ""; }; AB3B2A1C0EE3FCF900944CD1 /* polymost.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = polymost.c; sourceTree = ""; usesTabs = 1; }; AB3B2A6B0EE4007B00944CD1 /* mdsprite.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mdsprite.c; sourceTree = ""; usesTabs = 1; }; @@ -209,6 +224,7 @@ AB3E07290A33035B00FF2442 /* EditorStartupWinController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EditorStartupWinController.m; sourceTree = ""; }; AB3FE4550C04336F00D5DBDC /* libeditorsupp.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libeditorsupp.a; sourceTree = BUILT_PRODUCTS_DIR; }; AB4C36DB2B74EFC50092B8DD /* engine-version.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = "engine-version.c"; sourceTree = BUILT_PRODUCTS_DIR; }; + AB6465A12B94376000A757A9 /* Common.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Common.xcconfig; sourceTree = ""; }; AB66C6A92907E89F0063C874 /* glbuild_priv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = glbuild_priv.h; sourceTree = ""; }; AB66C6AB2907E8BE0063C874 /* rg_etc1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rg_etc1.h; sourceTree = ""; }; AB66C6AC2907E8BE0063C874 /* polymosttexcompress.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = polymosttexcompress.h; sourceTree = ""; }; @@ -299,6 +315,14 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + AB392FF02B9427BA002B0F5D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + AB392FF12B9427BA002B0F5D /* AppKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; AB3FE4510C04336F00D5DBDC /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -407,6 +431,7 @@ AB735F380A29A24A003261DC = { isa = PBXGroup; children = ( + AB6465A12B94376000A757A9 /* Common.xcconfig */, AB735FBF0A29A89F003261DC /* Editor */, AB735F720A29A3A0003261DC /* Engine */, AB4C36DB2B74EFC50092B8DD /* engine-version.c */, @@ -428,6 +453,7 @@ ABAE9C390F0CC81900A528DC /* kgroup */, ABD03E211A5189E00012B9D1 /* transpal */, ABE362492144CA6500BA44B3 /* bin2c */, + AB392FF52B9427BA002B0F5D /* klist */, ); name = Products; sourceTree = ""; @@ -545,6 +571,7 @@ ABAE9ADA0F0B30D500A528DC /* Tools */ = { isa = PBXGroup; children = ( + AB392FF62B9427E5002B0F5D /* klist.c */, ABE3624A2144CA9000BA44B3 /* bin2c.cc */, ABAE9ADB0F0B310900A528DC /* kextract.c */, ABAE9ADC0F0B310900A528DC /* kgroup.c */, @@ -608,6 +635,22 @@ /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ + AB392FEB2B9427BA002B0F5D /* klist */ = { + isa = PBXNativeTarget; + buildConfigurationList = AB392FF22B9427BA002B0F5D /* Build configuration list for PBXNativeTarget "klist" */; + buildPhases = ( + AB392FEC2B9427BA002B0F5D /* Sources */, + AB392FF02B9427BA002B0F5D /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = klist; + productName = arttool; + productReference = AB392FF52B9427BA002B0F5D /* klist */; + productType = "com.apple.product-type.tool"; + }; AB3FE44A0C04336F00D5DBDC /* editorsupp */ = { isa = PBXNativeTarget; buildConfigurationList = AB3FE4520C04336F00D5DBDC /* Build configuration list for PBXNativeTarget "editorsupp" */; @@ -792,6 +835,7 @@ ABE362422144CA6500BA44B3 /* bin2c */, ABAE9C270F0CC80200A528DC /* kextract */, ABAE9C320F0CC81900A528DC /* kgroup */, + AB392FEB2B9427BA002B0F5D /* klist */, ABD03E201A5189E00012B9D1 /* transpal */, AB77B4D2171AC3E800982712 /* tools */, AB4C36E32B75852A0092B8DD /* fetch-deps */, @@ -841,6 +885,17 @@ /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ + AB392FEC2B9427BA002B0F5D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + AB392FF72B9427E5002B0F5D /* klist.c in Sources */, + AB3930042B9428B2002B0F5D /* crc32.c in Sources */, + AB392FEE2B9427BA002B0F5D /* compat.c in Sources */, + AB392FEF2B9427BA002B0F5D /* osxbits.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; AB3FE44D0C04336F00D5DBDC /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -954,6 +1009,11 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ + AB392FF92B9427F3002B0F5D /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = AB392FEB2B9427BA002B0F5D /* klist */; + targetProxy = AB392FF82B9427F3002B0F5D /* PBXContainerItemProxy */; + }; AB3FE4670C0433A600D5DBDC /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = AB3FE44A0C04336F00D5DBDC /* editorsupp */; @@ -987,6 +1047,22 @@ /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ + AB392FF32B9427BA002B0F5D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + INSTALL_PATH = "$(HOME)/bin"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + AB392FF42B9427BA002B0F5D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + INSTALL_PATH = "$(HOME)/bin"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; AB3FE4530C04336F00D5DBDC /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -1021,6 +1097,7 @@ }; AB735F3C0A29A24B003261DC /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = AB6465A12B94376000A757A9 /* Common.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "c++98"; @@ -1053,6 +1130,7 @@ }; AB735F3D0A29A24B003261DC /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = AB6465A12B94376000A757A9 /* Common.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "c++98"; @@ -1214,6 +1292,15 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + AB392FF22B9427BA002B0F5D /* Build configuration list for PBXNativeTarget "klist" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + AB392FF32B9427BA002B0F5D /* Debug */, + AB392FF42B9427BA002B0F5D /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; AB3FE4520C04336F00D5DBDC /* Build configuration list for PBXNativeTarget "editorsupp" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/xcode/game-Info.plist b/xcode/game-Info.plist index e1f2bb5d..8f8db483 100644 --- a/xcode/game-Info.plist +++ b/xcode/game-Info.plist @@ -16,8 +16,10 @@ APPL CFBundleSignature ???? + CFBundleShortVersionString + $(CURRENT_PROJECT_VERSION) CFBundleVersion - 1.0 + $(CURRENT_PROJECT_VERSION) LSMinimumSystemVersionByArchitecture x86_64 diff --git a/xcode/game.xcodeproj/project.pbxproj b/xcode/game.xcodeproj/project.pbxproj index 8e490d68..1adb8454 100644 --- a/xcode/game.xcodeproj/project.pbxproj +++ b/xcode/game.xcodeproj/project.pbxproj @@ -8,14 +8,15 @@ /* Begin PBXBuildFile section */ AB053FAF0A33136D00FA2918 /* startwin.game.nib in Resources */ = {isa = PBXBuildFile; fileRef = AB053FAE0A33136D00FA2918 /* startwin.game.nib */; }; + AB3930032B942820002B0F5D /* klist in Copy additional editor tools */ = {isa = PBXBuildFile; fileRef = AB3930022B942814002B0F5D /* klist */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; AB3DEDA21BD23DAB0009D070 /* Game Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = AB3DEDA11BD23DAB0009D070 /* Game Images.xcassets */; }; AB3DEDA41BD23EE70009D070 /* Editor Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = AB3DEDA31BD23EE70009D070 /* Editor Images.xcassets */; }; AB3E07660A33068500FF2442 /* startwin.editor.nib in Resources */ = {isa = PBXBuildFile; fileRef = AB3E07650A33068500FF2442 /* startwin.editor.nib */; }; AB3FE4680C0433D000D5DBDC /* libeditorsupp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AB3FE4580C04338D00D5DBDC /* libeditorsupp.a */; }; AB43D734219DAA2200718BCE /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB7361220A29B9D4003261DC /* SDL2.framework */; }; - AB43D735219DAA2200718BCE /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = AB7361220A29B9D4003261DC /* SDL2.framework */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; + AB43D735219DAA2200718BCE /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = AB7361220A29B9D4003261DC /* SDL2.framework */; settings = {ATTRIBUTES = ( ); }; }; AB43D737219DAA3300718BCE /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB7361220A29B9D4003261DC /* SDL2.framework */; }; - AB43D738219DAA3300718BCE /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = AB7361220A29B9D4003261DC /* SDL2.framework */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; + AB43D738219DAA3300718BCE /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = AB7361220A29B9D4003261DC /* SDL2.framework */; settings = {ATTRIBUTES = ( ); }; }; AB63425724305DAA002CDE1A /* names.h in Copy KenBuild game data */ = {isa = PBXBuildFile; fileRef = AB726D650F046E6E00730EAA /* names.h */; }; AB63426924305F35002CDE1A /* arttool in Copy additional editor tools */ = {isa = PBXBuildFile; fileRef = ABAE9AD60F0B308900A528DC /* arttool */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; AB63426A24305F35002CDE1A /* kextract in Copy additional editor tools */ = {isa = PBXBuildFile; fileRef = ABAE9C3E0F0CC83700A528DC /* kextract */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; @@ -47,6 +48,20 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + AB392FFA2B942813002B0F5D /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = AB7360140A29AA70003261DC /* engine.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = AB392FEB2B9427BA002B0F5D; + remoteInfo = klist; + }; + AB3930012B942814002B0F5D /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = AB7360140A29AA70003261DC /* engine.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = AB392FF52B9427BA002B0F5D; + remoteInfo = klist; + }; AB3FE4570C04338D00D5DBDC /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = AB7360140A29AA70003261DC /* engine.xcodeproj */; @@ -215,6 +230,7 @@ AB63426924305F35002CDE1A /* arttool in Copy additional editor tools */, AB63426A24305F35002CDE1A /* kextract in Copy additional editor tools */, AB63426B24305F35002CDE1A /* kgroup in Copy additional editor tools */, + AB3930032B942820002B0F5D /* klist in Copy additional editor tools */, AB63426C24305F35002CDE1A /* transpal in Copy additional editor tools */, ); name = "Copy additional editor tools"; @@ -325,6 +341,7 @@ ABD2DF9421AC1C3D00BDB555 /* bin2c */, ABAE9C3E0F0CC83700A528DC /* kextract */, ABAE9C400F0CC83700A528DC /* kgroup */, + AB3930022B942814002B0F5D /* klist */, ABF1DD221BB82822007DE427 /* transpal */, ); name = Products; @@ -421,6 +438,7 @@ AB63426124305EE4002CDE1A /* PBXTargetDependency */, AB63426324305EE4002CDE1A /* PBXTargetDependency */, AB63426524305EE4002CDE1A /* PBXTargetDependency */, + AB392FFB2B942813002B0F5D /* PBXTargetDependency */, AB63426724305EE4002CDE1A /* PBXTargetDependency */, ); name = build; @@ -434,6 +452,14 @@ AB73600B0A29AA64003261DC /* Project object */ = { isa = PBXProject; attributes = { + TargetAttributes = { + AB7360290A29AB08003261DC = { + ProvisioningStyle = Manual; + }; + AB73604F0A29AD92003261DC = { + ProvisioningStyle = Manual; + }; + }; }; buildConfigurationList = AB73600C0A29AA64003261DC /* Build configuration list for PBXProject "game" */; compatibilityVersion = "Xcode 8.0"; @@ -461,6 +487,13 @@ /* End PBXProject section */ /* Begin PBXReferenceProxy section */ + AB3930022B942814002B0F5D /* klist */ = { + isa = PBXReferenceProxy; + fileType = "compiled.mach-o.executable"; + path = klist; + remoteRef = AB3930012B942814002B0F5D /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; AB3FE4580C04338D00D5DBDC /* libeditorsupp.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; @@ -564,6 +597,11 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ + AB392FFB2B942813002B0F5D /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = klist; + targetProxy = AB392FFA2B942813002B0F5D /* PBXContainerItemProxy */; + }; AB63426124305EE4002CDE1A /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = arttool;