projectfiles/Xcode/README.md
This README describes the way to create the wesnoth release packages for macOS.
The default Xcode dependency workflow in this directory remains macOS-oriented.
For the iOS simulator dependency bootstrap and audit workflow, use:
projectfiles/Xcode/ios/build_ios_deps.shprojectfiles/Xcode/ios/audit_ios_linkage.shgitscons and gettext (if you want to compile translations)The Battle for Wesnoth: Builds the actual game, depends on wesnothd. If you don't want to build wesnothd, get info on the Wesnoth target, go to the General tab, and remove wesnothd from its dependencies.
wesnothd: Builds the multiplayer server. The MP server is needed for hosting a local MP server, not for connecting to the official one.
unit_tests: Builds the unit tests. This is mainly useful when trying to fix a failing Travis build.
campaignd: Builds the addons server.
liblua: Builds the lua library for Wesnoth.
Release: Builds for maximum (runtime) speed and compatibility; it builds for 64-bit, with the latest SDK, but targets 10.11. You do not however need 10.11 SDK to build it. This is what's used for official releases.
Debug: Builds for maximum compiling speed, and uses the current OS as the SDK. If you just want to compile for testing things yourself, this is the way to go.
To compile translations you need gettext-tools and scons. You can obtain these tools using brew install gettext scons. You also have to force-link Homebrew's gettext tools using brew link --force gettext command. In the Terminal, cd /PATH/TO/PROJECT and run scons translations. This will compile all the translations into a translations directory.
When compiling Wesnoth for an official release, the following steps should be taken. Packaging is separated to the 4 subchapters:
.dmg image and we will release it to SourceForge.git clone -b BRANCH --depth 10 https://github.com/wesnoth/wesnoth /PATH/TO/PROJECT or use your favourite git program.cd /PATH/TO/PROJECT ; git checkout TAG or use your favourite git program.Finder to navigate into /PATH/TO/PROJECT/projectfiles/Xcode.Fix_Xcode_Dependencies script and wait until it finishes.The Battle for Wesnoth.xcodeproj file in Xcode.dist file using touch /PATH/TO/PROJECT/data/dist.dist file in path /PATH/TO/PROJECT/data/dist. For Steam it must contain Steam.Product > Archive from the menubar.Distribute App, select Developer ID and select Upload.Distribute App again, select Developer ID and select export location.dist file in path /PATH/TO/PROJECT/data/dist. For SourceForge it must contain SourceForge.Product > Archive from the menubar.Distribute App, select Developer ID and select Upload.Distribute App again, select Developer ID and select export location./PATH/TO/PROJECT/packaging/macOS/Wesnoth_dmg_packaging_template.dmghdiutil convert /PATH/TO/TEMPLATE.dmg -format UDRW -o /PATH/TO/NEW/RW_IMAGE.dmg and mount it.cp -R /PATH/TO/THE/EXPORTED/PACKAGE.app "/Volumes/The Battle for Wesnoth/The Battle for Wesnoth.app".hdiutil convert /PATH/TO/RW_IMAGE.dmg -format ULFO -o /PATH/TO/NEW/IMAGE.dmg command.Wesnoth_1.15.2.dmgcodesign -s "Developer ID Application: Wesnoth, Inc (N5CYW96P9T)" /PATH/TO/NEW/IMAGE.dmg. (You must have Wesnoth's signing certificate.).dmg properly using spctl -a -t open --context context:primary-signature -v /PATH/TO/NEW/IMAGE.dmg..dmg image. You must have app specific password for your AppleID prepared.xcrun altool --notarize-app -f /PATH/TO/NEW/IMAGE.dmg --primary-bundle-id org.wesnoth.Wesnoth -u YOUR_APPLE_ID_EMAIL -p YOUR_APPLE_ID_APP_SPECIFIC_PASSWORD --asc-provider N5CYW96P9T and wait. After successful execution it should give you RequestUUID.xcrun altool --notarization-info REQUEST_UUID -u YOUR_APPLE_ID_EMAIL -p YOUR_APPLE_ID_APP_SPECIFIC_PASSWORD command. Wait until it returns the Package Approved status message.shasum -a 256 /PATH/TO/NEW/IMAGE.dmg > Wesnoth_x.x.x.dmg.sha256 command.wesnothd.The Battle for Wesnoth project in the left sidebar.wesnothd target.Signing & Capabilities from the top bar.+ Capability while in the All tab.App Sandbox.Incoming and Outgoing connections.dist file in path /PATH/TO/PROJECT/data/dist. For Mac AppStore it must contain macOS App Store.Product > Archive from the menubar.Distribute App, select App Store Connect and proceed with all steps by clicking Next.