138 Commits

Author SHA1 Message Date
6849173c50 Try make a github release 2024-08-10 13:05:49 -05:00
771a43f2f9 try push to itch.io 2024-08-10 12:54:05 -05:00
cc6d6f1c28 itch.io butler install script 2024-08-10 12:37:54 -05:00
330b7f7447 sfml_suffixes 2024-08-08 16:07:52 -05:00
259290ecca print what you're checking 2024-08-08 15:59:54 -05:00
aa9d704bf6 try run build with bash 2024-08-08 15:50:10 -05:00
04a86e1be9 -d suffix for sfml debug builds 2024-08-08 15:49:18 -05:00
618439492c show debug flag 2024-08-08 15:43:19 -05:00
554cff06bf try different 2024-08-08 15:36:46 -05:00
e9a52de14b fix ga syntax 2024-08-08 15:35:38 -05:00
979d9609f5 try env variable 2024-08-08 15:35:02 -05:00
6487bfa07c try fix ga syntax 2024-08-08 15:32:43 -05:00
9399cdba34 try pass debug to scons 2024-08-08 15:31:42 -05:00
a64bb8b0ef try add Debug build 2024-08-08 15:21:13 -05:00
57fa5421fa disable test in release build 2024-08-08 15:01:40 -05:00
b82735be54 try again fix syntax 2024-08-08 14:32:05 -05:00
b5376b2efb try fix syntax 2024-08-08 14:21:22 -05:00
bd102fca6d blank line trigger a build 2024-08-07 13:37:58 -05:00
5215bc8852 patch library rpaths 2024-07-18 14:38:29 -06:00
52cfee7f17 fix rpath 2024-07-18 14:35:16 -06:00
bbd0d91a09 fix bad logic 2024-07-18 14:31:03 -06:00
bbb9a86dcd rpath with patchelf 2024-07-18 14:22:04 -06:00
6db5a4a743 fix paren 2024-07-18 14:02:31 -06:00
40ed3d818b try grab more libs 2024-07-18 13:55:50 -06:00
685b90795a fix tabs 2024-07-18 13:51:42 -06:00
b66be91123 try get all .so.version files 2024-07-18 13:45:06 -06:00
cc13306e2d refactor 2024-07-18 13:41:20 -06:00
588e45b136 don't package prebuilt zlib 2024-07-18 12:45:37 -06:00
13e10fc2cd bundle tgui 2024-07-18 12:42:21 -06:00
65ad8bf803 not else 2024-07-18 12:31:21 -06:00
bf3e1f963d check /usr/local/lib for zlib 2024-07-18 12:30:04 -06:00
ae2ddf046b make check for zlib + debug x86_64-linux-gnu 2024-07-18 11:58:27 -06:00
feed54de9a on linux bundle libz 2024-07-18 11:50:56 -06:00
c54cc07a1a check x86_64-linux-gnu 2024-07-18 11:48:14 -06:00
79e2efb3bb handle bundled libs for linux 2024-07-18 11:35:13 -06:00
58433a7658 flip the scons-scripts back 2024-07-18 11:25:53 -06:00
97b0f90807 debug linux library bundling 2024-07-18 11:13:49 -06:00
d62bf04380 refactor the build matrix 2024-07-18 11:07:21 -06:00
ba0d07d01e fix upload artifact conflict 2024-07-18 11:00:46 -06:00
32d71fe86a upload boost built libs 2024-07-18 10:56:09 -06:00
3755023960 try with nodefaultlib and no vcpkg integrate 2024-07-18 10:54:01 -06:00
2db8561b91 Try without vcpkg integrate 2024-07-18 09:27:28 -06:00
782d80857f debug LINK and _LINK_ 2024-07-18 09:27:16 -06:00
f8871cd51d try NODEFAULTLIB 2024-07-17 20:32:53 -06:00
7f6963b0dc try link /verbose 2024-07-17 19:17:34 -06:00
79162c43f5 zlib/build include directory 2024-07-17 18:58:23 -06:00
98be2ff395 add zlib include path 2024-07-17 18:05:06 -06:00
6df0e3b72b project includes 2024-07-17 17:55:04 -06:00
9e73baa92f capital A 2024-07-17 17:44:22 -06:00
448bd6520a windows libpath zlib 2024-07-17 17:39:06 -06:00
e928204386 zlib build no manifest mode 2024-07-17 17:29:42 -06:00
61a6ab922a x64 2024-07-17 17:20:24 -06:00
dfa86143a9 64-bit 2024-07-17 17:18:20 -06:00
132920072d fix 2024-07-17 17:15:12 -06:00
b0f267337e don't install zlib from apt-get 2024-07-17 17:13:12 -06:00
a23ff469fa zlib-build.bat 2024-07-17 17:11:50 -06:00
042d2eaaa7 h 2024-07-17 17:10:14 -06:00
65c167743b try batch file 2024-07-17 17:08:16 -06:00
6d6f593978 shell cmd 2024-07-17 17:00:44 -06:00
e77fa3c278 try with msbuild 2024-07-17 16:58:58 -06:00
49c823f6e6 Try same on windows 2024-07-17 16:55:24 -06:00
6f08767437 ls first 2024-07-17 16:50:04 -06:00
3ab173a89d fix 2024-07-17 16:45:59 -06:00
b92c74362b try make 2024-07-17 16:44:19 -06:00
8e0410c35b fix ls 2024-07-17 16:39:18 -06:00
8ba3160798 ls zlib 2024-07-17 16:35:39 -06:00
fa6db361bc fix cmake --install 2024-07-17 16:31:00 -06:00
1197e39e73 fix working-directory 2024-07-17 16:28:04 -06:00
ef08399eca try install zlib from source 2024-07-17 16:26:37 -06:00
005a4198d2 add zlib submodule 2024-07-17 16:19:09 -06:00
da73d5bce7 fix 2024-07-17 15:57:33 -06:00
e3abaffc92 Try without vcpkg libpaths 2024-07-17 15:50:01 -06:00
ea74fea314 try build static on windows 2024-07-17 15:36:51 -06:00
595d1f4145 fix print 2024-07-17 15:23:51 -06:00
e4fe82f68f export github actions cache stuff 2024-07-17 15:17:56 -06:00
2ac950be91 debug linux copying libs 2024-07-17 15:12:28 -06:00
010191dffe windows thing 2024-07-17 15:12:19 -06:00
cb94817500 Try to debug boost libs 2024-07-17 14:53:25 -06:00
334013f8f3 try debug 2024-07-17 14:38:24 -06:00
dafe6a1c37 try empty suffixes 2024-07-17 13:55:01 -06:00
32b5070b6f windows expect boost 1_85 2024-07-17 13:42:05 -06:00
f892bdfbea try bundling linux dynamic libs 2024-07-17 13:39:54 -06:00
bb977d6f95 update cache version 2024-07-17 13:30:31 -06:00
25a4ba4f28 windows scons-build.bat pass args to scons 2024-07-17 13:29:37 -06:00
d57aeb5fae actually fix 2024-07-17 13:16:37 -06:00
867ec735ef try fix path separator of scons call 2024-07-17 13:14:02 -06:00
c8d7fd9c73 no debug builds 2024-07-17 13:00:00 -06:00
2fa006b62d fix windows script path 2024-07-17 12:59:54 -06:00
5bc822f39f don't fail fast 2024-07-17 12:49:31 -06:00
a690348879 try fix last 2024-07-17 12:39:13 -06:00
ee522f156b try if without quotes 2024-07-17 12:36:02 -06:00
301a29e5bd fix tabs 2024-07-17 12:34:46 -06:00
77a9f5b7ee rest of release.yml 2024-07-17 12:33:33 -06:00
f8fc76485c try mapping as list element 2024-07-17 12:16:24 -06:00
766bdb6cb9 try braces 2024-07-17 12:15:21 -06:00
097c6fbc84 try fix last 2024-07-17 12:13:16 -06:00
841d441067 fix last 2024-07-17 12:08:50 -06:00
3136da51dd add on: to yaml 2024-07-17 12:08:07 -06:00
0425675b86 fix indentation 2024-07-17 12:05:53 -06:00
e3687fc5df fix indentation 2024-07-17 12:04:52 -06:00
c5b7e61ffb WIP release.yml action 2024-07-17 12:02:07 -06:00
1c6f181fb0 double quotes 2024-07-02 20:51:12 -06:00
4eedc58988 another quote 2024-07-02 20:49:08 -06:00
3d2d1b91a4 try quotes? 2024-07-02 20:48:11 -06:00
7d26a05b5c move the env lines up? 2024-07-02 20:46:32 -06:00
cb8a15727a +x 2024-07-02 20:45:13 -06:00
61c01b9804 no if 2024-07-02 20:44:16 -06:00
5188ceb837 hyphen out of name 2024-07-02 20:43:39 -06:00
9291927e7f trailing comma? 2024-07-02 20:42:49 -06:00
ad229c841d comments? 2024-07-02 20:41:31 -06:00
381987efbe try fix again 2024-07-02 20:40:17 -06:00
3c195437de try fix again? 2024-07-02 20:37:42 -06:00
0d685f250e fix if syntax 2024-07-02 20:36:20 -06:00
bc510b3d6e try to sign and notarize mac app 2024-07-02 20:34:34 -06:00
2be2df51c6 specify MACOS_DEPLOYMENT_TARGET at job level 2024-07-02 14:47:15 -06:00
5f9399e1ba try specify macos target for dependency source builds 2024-07-02 14:34:15 -06:00
a900db290b fix reference to sfml action outputs 2024-07-02 14:00:46 -06:00
c0fa62d3fc try no ls 2024-07-02 13:41:27 -06:00
06c2c9b228 try add FRAMEWORKPATH 2024-07-02 13:12:48 -06:00
19a390f589 fix rpath possibilities from install-sfml 2024-07-02 13:12:31 -06:00
163d264986 ls sfml/lib 2024-07-02 13:11:33 -06:00
0a08c27c50 mac try to build sfml from source 2024-07-02 12:47:32 -06:00
a1b5f57d1e try root for INCLUDEPATH 2024-07-02 12:16:46 -06:00
3f5234ffbc ls the directories 2024-07-02 12:12:25 -06:00
94980110ed try printing scons-build.sh extra args 2024-07-02 12:06:57 -06:00
e0601420c6 try caching boost build 2024-07-02 12:05:51 -06:00
dbd456af54 mac try building boost with github action 2024-07-02 11:55:46 -06:00
b0dd719502 fix-rpaths.sh fix last dylib connections 2024-07-01 15:16:45 -06:00
4f746673d2 fix-rpaths.sh fix bundled ogg version suffix 2024-07-01 14:50:02 -06:00
bd3aafc246 fix-rpaths.sh connect libpng16 2024-07-01 14:39:00 -06:00
98e1aba749 fix-rpaths.sh connect sfml-audio dependencies 2024-07-01 14:34:56 -06:00
83cd04f085 fix-rpaths.sh connect zlib and boost libs 2024-07-01 14:13:37 -06:00
423340f1a5 call fix-rpaths.sh subprocess with absolute script path 2024-07-01 13:45:09 -06:00
90ceaf9b69 call fix-rpaths.sh in proper working directory 2024-07-01 13:28:05 -06:00
0e67eaff55 linux upload build artifact 2024-07-01 13:02:26 -06:00
c6bd39509d mac connect executables with bundled dylibs 2024-07-01 12:59:37 -06:00
0630dd27d2 Mac upload build artifact 2024-06-29 16:04:30 -06:00
f8860f3aa8 win-scons upload build artifact 2024-06-29 15:04:43 -06:00
11 changed files with 477 additions and 35 deletions

View File

@@ -3,7 +3,7 @@
on: {
push: {
branches: [ master, ci ]
branches: [ master, ci, builds ]
},
pull_request: {
branches: [ master ]
@@ -46,19 +46,75 @@
},
macos-scons: {
runs-on: macos-12,
env: {
MACOSX_DEPLOYMENT_TARGET: '10.15',
PROD_MACOS_CERTIFICATE: '${{ secrets.PROD_MACOS_CERTIFICATE }}',
PROD_MACOS_CERTIFICATE_PWD: '${{ secrets.PROD_MACOS_CERTIFICATE_PWD }}',
PROD_MACOS_CERTIFICATE_NAME: '${{ secrets.PROD_MACOS_CERTIFICATE_NAME }}',
PROD_MACOS_CI_KEYCHAIN_PWD: '${{ secrets.PROD_MACOS_CI_KEYCHAIN_PWD }}',
PROD_MACOS_NOTARIZATION_APPLE_ID: '${{ secrets.PROD_MACOS_NOTARIZATION_APPLE_ID }}',
PROD_MACOS_NOTARIZATION_TEAM_ID: '${{ secrets.PROD_MACOS_NOTARIZATION_TEAM_ID }}',
PROD_MACOS_NOTARIZATION_PWD: '${{ secrets.PROD_MACOS_NOTARIZATION_PWD }}'
},
steps: [
{
name: checkout,
uses: actions/checkout@v2,
with: { submodules: true }
with: { submodules: true }
},
{
name: install dependencies,
run: brew install scons SFML Boost
name: Cache Boost,
uses: actions/cache@v2,
with: {
path: '${{ runner.workspace }}/boost_*.tar.gz',
key: 'boost-1.85.0'
}
},
{
name: Build Boost,
id: boost,
uses: egor-tensin/build-boost@v1,
with: {
version: 1.85.0,
libraries: filesystem system,
platform: x64,
configuration: Release
},
},
{
name: Build SFML,
id: sfml,
uses: oprypin/install-sfml@v1,
with: {
sfml: 2.6.1,
config: Release
}
},
{
name: install build dependencies,
run: brew install scons
},
{
name: build and unit test,
run: ./.github/workflows/scripts/mac/scons-build.sh
run: './.github/workflows/scripts/mac/scons-build.sh INCLUDEPATH="${{ steps.boost.outputs.root }}:${{steps.sfml.outputs.path}}/include" LIBPATH="${{ steps.boost.outputs.librarydir }}:${{steps.sfml.outputs.path}}/lib" FRAMEWORKPATH="${{steps.sfml.outputs.path}}/lib"',
},
{
name: codesign the app,
if: "${{ github.ref == 'refs/heads/builds' }}",
run: './.github/workflows/scripts/mac/sign-apps.sh',
},
{
name: 'Tar files',
run: 'tar -cvf cboe-mac.tar "Blades of Exile"',
working-directory: '${{ github.workspace }}/build'
},
{
name: 'Upload Artifact',
uses: actions/upload-artifact@v4,
with: {
name: cboe-mac,
path: '${{ github.workspace }}/build/cboe-mac.tar'
}
}
]
},
@@ -155,7 +211,19 @@
name: build and unit test,
run: '.\.github\workflows\scripts\win\scons-build.bat'
},
{
name: 'Tar files',
run: 'tar -cvf cboe-win.tar "Blades of Exile"',
working-directory: '${{ github.workspace }}/build'
},
{
name: 'Upload Artifact',
uses: actions/upload-artifact@v4,
with: {
name: cboe-win,
path: '${{ github.workspace }}/build/cboe-win.tar'
}
},
]
},
# win-mingw: {
@@ -200,6 +268,19 @@
{
name: build and unit test,
run: CCFLAGS=-fdiagnostics-color=always scons
},
{
name: 'Tar files',
run: 'tar -cvf cboe-linux.tar "Blades of Exile"',
working-directory: '${{ github.workspace }}/build'
},
{
name: 'Upload Artifact',
uses: actions/upload-artifact@v4,
with: {
name: cboe-linux,
path: '${{ github.workspace }}/build/cboe-linux.tar'
}
}
],
}

131
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,131 @@
on:
push:
branches: [ builds ]
pull_request:
branches: [ builds ]
jobs:
release:
env:
MACOSX_DEPLOYMENT_TARGET: 10.15
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
PROD_MACOS_CERTIFICATE: '${{ secrets.PROD_MACOS_CERTIFICATE }}'
PROD_MACOS_CERTIFICATE_PWD: '${{ secrets.PROD_MACOS_CERTIFICATE_PWD }}'
PROD_MACOS_CERTIFICATE_NAME: '${{ secrets.PROD_MACOS_CERTIFICATE_NAME }}'
PROD_MACOS_CI_KEYCHAIN_PWD: '${{ secrets.PROD_MACOS_CI_KEYCHAIN_PWD }}'
PROD_MACOS_NOTARIZATION_APPLE_ID: '${{ secrets.PROD_MACOS_NOTARIZATION_APPLE_ID }}'
PROD_MACOS_NOTARIZATION_TEAM_ID: '${{ secrets.PROD_MACOS_NOTARIZATION_TEAM_ID }}'
PROD_MACOS_NOTARIZATION_PWD: '${{ secrets.PROD_MACOS_NOTARIZATION_PWD }}'
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
DEBUG_FLAG: ${{ matrix.configuration == 'Debug' && 'true' || 'false' }}
BUILD_OS: ${{ matrix.os.name }}
strategy:
fail-fast: false
matrix:
os:
- name: macos
version: 12
scons-script: './.github/workflows/scripts/mac/scons-build.sh'
path-separator: ':'
- name: ubuntu
version: 22.04
scons-script: scons
path-separator: ':'
- name: windows
version: 2019
scons-script: './.github/workflows/scripts/win/scons-build.bat'
path-separator: ';'
boost-version:
- 1.85.0
sfml-version:
- 2.6.1
configuration:
- Release
- Debug
runs-on: '${{ matrix.os.name }}-${{ matrix.os.version }}'
steps:
- run: echo $DEBUG_FLAG
- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v7
with:
script: "core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');"
- name: checkout
uses: actions/checkout@v4
with:
submodules: true
- name: CMake zlib for linux
run: cmake -S . -B build
working-directory: deps/zlib
if: ${{ matrix.os.name == 'ubuntu' }}
- name: CMake zlib for windows
run: cmake -S . -B build -D CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
working-directory: deps/zlib
if: ${{ matrix.os.name == 'windows' }}
- name: Build zlib for linux
run: make && sudo make install
working-directory: deps/zlib/build
if: ${{ matrix.os.name == 'ubuntu' }}
- name: Build zlib for windows
run: './.github/workflows/scripts/win/zlib-build.bat x64'
if: ${{ matrix.os.name == 'windows' }}
- name: Cache Boost
uses: actions/cache@v4
with:
path: '${{ runner.workspace }}/boost_*.tar.gz'
key: 'boost-${{ matrix.boost-version }}'
- name: Build Boost
id: boost
uses: egor-tensin/build-boost@v1
with:
version: ${{ matrix.boost-version }}
libraries: filesystem system
platform: x64
configuration: ${{ matrix.configuration }}
static: ${{ matrix.os.name == 'windows' }}
- name: upload boost libs for inspection
uses: actions/upload-artifact@v4
with:
name: boost-artifact-${{ matrix.os.name }}-${{ matrix.configuration }}
path: ${{ steps.boost.outputs.librarydir }}
- name: Build SFML
id: sfml
uses: oprypin/install-sfml@v1
with:
sfml: ${{ matrix.sfml-version }}
config: ${{ matrix.configuration }}
- name: Windows build dependencies
run: 'vcpkg install libxml2 && pip install scons'
if: ${{ matrix.os.name == 'windows' }}
- name: Mac build dependencies
run: brew install scons
if: ${{ matrix.os.name == 'macos' }}
- name: Linux build dependencies
run: sudo apt-get update && sudo apt-get install scons libxml2-utils zenity
if: ${{ matrix.os.name == 'ubuntu' }}
- name: Install TGUI
run: 'sudo ./.github/workflows/scripts/linux/install-tgui.sh'
if: ${{ matrix.os.name == 'ubuntu' }}
- name: Build
run: '${{ matrix.os.scons-script }} INCLUDEPATH="${{ steps.boost.outputs.root }}${{ matrix.os.path-separator }}${{steps.sfml.outputs.path}}/include" LIBPATH="${{ steps.boost.outputs.librarydir }}${{ matrix.os.path-separator }}${{steps.sfml.outputs.path}}/lib${{ matrix.os.path-separator }}/usr/local/lib" FRAMEWORKPATH="${{steps.sfml.outputs.path}}/lib" test=false debug=$DEBUG_FLAG'
shell: bash
- name: Codesign and notarize
run: './.github/workflows/scripts/mac/sign-apps.sh'
if: ${{ matrix.os.name == 'macos' }}
- name: 'Tar files'
run: 'tar -cvf cboe-${{ matrix.os.name }}.tar "Blades of Exile"'
working-directory: '${{ github.workspace }}/build'
- name: 'Upload Artifact'
uses: actions/upload-artifact@v4
with:
name: cboe-${{ matrix.os.name }}-${{ matrix.configuration }}
path: '${{ github.workspace }}/build/cboe-${{ matrix.os.name }}.tar'
- name: Github release
uses: softprops/action-gh-release@v2
with:
files: '${{ github.workspace }}/build/cboe-${{ matrix.os.name }}.tar'
if: startsWith(github.ref, 'refs/tags/')
- name: 'Itch.io release'
run: './.github/workflows/scripts/butler_push.sh'
if: startsWith(github.ref, 'refs/tags/')

28
.github/workflows/scripts/butler_push.sh vendored Executable file
View File

@@ -0,0 +1,28 @@
#! /bin/bash
butler_channel=""
butler_exe=""
release_dir=""
if [ "$BUILD_OS" = "ubuntu" ]; then
butler_channel=linux-amd64
butler_exe=butler
release_dir="linux"
elif [ "$BUILD_OS" = "windows" ]; then
butler_channel=windows-amd64
butler_exe=butler.exe
release_dir="windows"
elif [ "$BUILD_OS" = "macos" ]; then
butler_channel=darwin-amd64
butler_exe=butler
release_dir="macos"
fi
# -L follows redirects
# -O specifies output name
curl -L -o butler.zip https://broth.itch.ovh/butler/${butler_channel}/LATEST/archive/default
unzip butler.zip
# GNU unzip tends to not set the executable bit even though it's set in the .zip
chmod +x ${butler_exe}
# just a sanity check run (and also helpful in case you're sharing CI logs)
./${butler_exe} -V
./${butler_exe} push build/Blades of Exile/ nqn/blades-of-exile:${butler_channel}

73
.github/workflows/scripts/mac/fix-rpaths.sh vendored Executable file
View File

@@ -0,0 +1,73 @@
#!/bin/sh -v
# This janky script is meant to fix the dylib connections of your
# Blades of Exile build whether you installed them via homebrew,
# built them from source, or whatever.
# add_rpath_to_app <app name>
add_rpath_to_app() {
APP="$1.app/Contents/MacOS/$1"
install_name_tool -add_rpath @loader_path/../Frameworks "$APP"
}
# connect_dylib_in_app <app name> <system lib path> <lib name> <system lib version suffix> <bundled lib version suffix>
connect_dylib_in_app() {
APP="$1.app/Contents/MacOS/$1"
FRAMEWORKS="$1.app/Contents/Frameworks"
OLD_SUFFIX=${4:-""}
if [ -n "$OLD_SUFFIX" ]; then
OLD_SUFFIX=".${OLD_SUFFIX}"
fi
NEW_SUFFIX=${5:-""}
if [ -n "$NEW_SUFFIX" ]; then
NEW_SUFFIX=".${NEW_SUFFIX}"
fi
# Connect the executable to the bundled dylib:
install_name_tool -change "$2/$3$OLD_SUFFIX.dylib" "@rpath/$3$NEW_SUFFIX.dylib" "$APP"
# Connect the other dylibs to the bundled dylib
# (This is a safe no-op for other dylibs which don't depend on this dylib
# and in cases where the paths don't match exactly)
install_name_tool -change "@rpath/$3$OLD_SUFFIX.dylib" "@rpath/$3$NEW_SUFFIX.dylib" "$FRAMEWORKS/libsfml-window.2.6.1.dylib"
install_name_tool -change "$2/$3$OLD_SUFFIX.dylib" "@rpath/$3$NEW_SUFFIX.dylib" "$FRAMEWORKS/libsfml-window.2.6.1.dylib"
install_name_tool -change "@rpath/$3$OLD_SUFFIX.dylib" "@rpath/$3$NEW_SUFFIX.dylib" "$FRAMEWORKS/libsfml-audio.2.6.1.dylib"
install_name_tool -change "$2/$3$OLD_SUFFIX.dylib" "@rpath/$3$NEW_SUFFIX.dylib" "$FRAMEWORKS/libsfml-audio.2.6.1.dylib"
install_name_tool -change "@rpath/$3$OLD_SUFFIX.dylib" "@rpath/$3$NEW_SUFFIX.dylib" "$FRAMEWORKS/libsfml-graphics.2.6.1.dylib"
install_name_tool -change "$2/$3$OLD_SUFFIX.dylib" "@rpath/$3$NEW_SUFFIX.dylib" "$FRAMEWORKS/libsfml-graphics.2.6.1.dylib"
install_name_tool -change "@rpath/$3$OLD_SUFFIX.dylib" "@rpath/$3$NEW_SUFFIX.dylib" "$FRAMEWORKS/libvorbisenc.2.dylib"
install_name_tool -change "$2/$3$OLD_SUFFIX.dylib" "@rpath/$3$NEW_SUFFIX.dylib" "$FRAMEWORKS/libvorbisenc.2.dylib"
install_name_tool -change "@rpath/$3$OLD_SUFFIX.dylib" "@rpath/$3$NEW_SUFFIX.dylib" "$FRAMEWORKS/libvorbisfile.3.dylib"
install_name_tool -change "$2/$3$OLD_SUFFIX.dylib" "@rpath/$3$NEW_SUFFIX.dylib" "$FRAMEWORKS/libvorbisfile.3.dylib"
install_name_tool -change "@rpath/$3$OLD_SUFFIX.dylib" "@rpath/$3$NEW_SUFFIX.dylib" "$FRAMEWORKS/libfreetype.6.dylib"
install_name_tool -change "$2/$3$OLD_SUFFIX.dylib" "@rpath/$3$NEW_SUFFIX.dylib" "$FRAMEWORKS/libfreetype.6.dylib"
}
# fix_app <app name>
fix_app() {
if [ -e "$1.app" ]; then
add_rpath_to_app "$1"
connect_dylib_in_app "$1" /usr/local/opt/zlib/lib libz "1" "1.3.1"
connect_dylib_in_app "$1" /usr/local/opt/boost/lib libboost_system
connect_dylib_in_app "$1" /usr/local/opt/boost/lib libboost_filesystem
connect_dylib_in_app "$1" /usr/local/opt/sfml/lib libsfml-system "2.6" "2.6.1"
connect_dylib_in_app "$1" @rpath libsfml-system "2.6" "2.6.1"
connect_dylib_in_app "$1" /usr/local/opt/sfml/lib libsfml-window "2.6" "2.6.1"
connect_dylib_in_app "$1" @rpath libsfml-window "2.6" "2.6.1"
connect_dylib_in_app "$1" /usr/local/opt/sfml/lib libsfml-audio "2.6" "2.6.1"
connect_dylib_in_app "$1" @rpath libsfml-audio "2.6" "2.6.1"
connect_dylib_in_app "$1" /usr/local/opt/sfml/lib libsfml-graphics "2.6" "2.6.1"
connect_dylib_in_app "$1" @rpath libsfml-graphics "2.6" "2.6.1"
connect_dylib_in_app "$1" /usr/local/opt/freetype/lib libfreetype "6" "6"
connect_dylib_in_app "$1" /usr/local/opt/flac/lib libFLAC "12" "12"
connect_dylib_in_app "$1" /usr/local/opt/libogg/lib libogg "0" "0.8.5"
connect_dylib_in_app "$1" /usr/local/opt/libvorbis/lib libvorbis "0" "0"
connect_dylib_in_app "$1" /usr/local/Cellar/libvorbis/1.3.7/lib libvorbis "0" "0"
connect_dylib_in_app "$1" /usr/local/opt/libvorbis/lib libvorbisenc "2" "2"
connect_dylib_in_app "$1" /usr/local/opt/libvorbis/lib libvorbisfile "3" "3"
connect_dylib_in_app "$1" /usr/local/opt/libpng/lib libpng16 "16" "16"
fi
}
fix_app "Blades of Exile"
fix_app "BoE Scenario Editor"
fix_app "BoE Character Editor"

View File

@@ -4,4 +4,4 @@ export CC="$(brew --prefix llvm)/bin/clang"
export CXX="$(brew --prefix llvm)/bin/clang++"
export SDKROOT="$(xcrun --show-sdk-path)"
scons CXXFLAGS="-I/usr/local/opt/zlib/include" LINKFLAGS="-L/usr/local/opt/zlib/lib"
scons CXXFLAGS="-I/usr/local/opt/zlib/include" LINKFLAGS="-L/usr/local/opt/zlib/lib" $@

64
.github/workflows/scripts/mac/sign-apps.sh vendored Executable file
View File

@@ -0,0 +1,64 @@
#! /bin/bash
# CODE-SIGNING STEP
# Original Source: https://federicoterzi.com/blog/automatic-code-signing-and-notarization-for-macos-apps-using-github-actions/
# Modified by NQNStudios
# Turn our base64-encoded certificate back to a regular .p12 file
echo $PROD_MACOS_CERTIFICATE | base64 --decode > certificate.p12
# We need to create a new keychain, otherwise using the certificate will prompt
# with a UI dialog asking for the certificate password, which we can't
# use in a headless CI environment
security create-keychain -p "$PROD_MACOS_CI_KEYCHAIN_PWD" build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p "$PROD_MACOS_CI_KEYCHAIN_PWD" build.keychain
security import certificate.p12 -k build.keychain -P "$PROD_MACOS_CERTIFICATE_PWD" -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$PROD_MACOS_CI_KEYCHAIN_PWD" build.keychain
sign() {
APP_PATH="build/Blades of Exile/$1.app"
# We finally codesign our app bundle, specifying the Hardened runtime option
/usr/bin/codesign --force -s "$PROD_MACOS_CERTIFICATE_NAME" --options runtime "$APP_PATH"/Contents/Frameworks/*.dylib -v
/usr/bin/codesign --force -s "$PROD_MACOS_CERTIFICATE_NAME" --options runtime "$APP_PATH"/Contents/Frameworks/*.framework -v
/usr/bin/codesign --force -s "$PROD_MACOS_CERTIFICATE_NAME" --options runtime "$APP_PATH/Contents/Info.plist" -v
/usr/bin/codesign --force -s "$PROD_MACOS_CERTIFICATE_NAME" --options runtime "$APP_PATH" -v
# NOTARIZATION STEP
# (same source)
# Store the notarization credentials so that we can prevent a UI password dialog
# from blocking the CI
echo "Create keychain profile"
xcrun notarytool store-credentials "notarytool-profile" --apple-id "$PROD_MACOS_NOTARIZATION_APPLE_ID" --team-id "$PROD_MACOS_NOTARIZATION_TEAM_ID" --password "$PROD_MACOS_NOTARIZATION_PWD"
# We can't notarize an app bundle directly, but we need to compress it as an archive.
# Therefore, we create a zip file containing our app bundle, so that we can send it to the
# notarization service
echo "Creating temp notarization archive"
ditto -c -k --keepParent "$APP_PATH" "notarization.zip"
# Here we send the notarization request to the Apple's Notarization service, waiting for the result.
# This typically takes a few seconds inside a CI environment, but it might take more depending on the App
# characteristics. Visit the Notarization docs for more information and strategies on how to optimize it if
# you're curious
echo "Notarize app"
xcrun notarytool submit "notarization.zip" --keychain-profile "notarytool-profile" --wait
# Finally, we need to "attach the staple" to our executable, which will allow our app to be
# validated by macOS even when an internet connection is not available.
echo "Attach staple"
xcrun stapler staple "$APP_PATH"
}
sign "Blades of Exile"
sign "BoE Scenario Editor"
sign "BoE Character Editor"

View File

@@ -12,4 +12,7 @@ REM )
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64
scons bits=64
@echo %LINK%
@echo %_LINK_%
scons bits=64 %*

View File

@@ -0,0 +1,7 @@
setlocal enabledelayedexpansion
for /f "usebackq tokens=*" %%i in (`vswhere -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe`) do (
"%%i" -clp:ForceConsoleColor -target:Build -property:Configuration=Release -property:Platform=%1 "deps/zlib/build/zlib.sln"
exit /b !errorlevel!
)

4
.gitmodules vendored
View File

@@ -5,3 +5,7 @@
path = deps/TGUI
url = https://github.com/texus/TGUI.git
branch = 0.9
[submodule "deps/zlib"]
path = deps/zlib
url = https://github.com/madler/zlib
branch = master

View File

@@ -203,12 +203,12 @@ elif platform == "win32":
for (root, dirs, files) in os.walk('src'):
project_includes.append(path.join(os.getcwd(), root))
include_paths=[path.join(vcpkg_installed, 'include')] + vcpkg_other_includes + project_includes
include_paths=project_includes
env.Append(
LINKFLAGS=['/SUBSYSTEM:WINDOWS','/ENTRY:mainCRTStartup',f'/MACHINE:X{arch_short}'],
LINKFLAGS=['/SUBSYSTEM:WINDOWS','/ENTRY:mainCRTStartup',f'/MACHINE:X{arch_short}', '/VERBOSE', '/NODEFAULTLIB:libboost_filesystem-vc142-mt-x64-1_85.lib'],
CXXFLAGS=['/EHsc','/MD','/FIglobal.hpp'],
CPPPATH=include_paths,
LIBPATH=[path.join(vcpkg_installed, 'lib')] + vcpkg_other_libs + vcpkg_other_bins,
LIBPATH=[],
LIBS=Split("""
kernel32
user32
@@ -283,6 +283,10 @@ if path.exists('deps/lib64'):
if path.exists('deps/include'):
env.Append(CPPPATH=[path.join(os.getcwd(), '/deps/include')])
env.Append(CPPPATH=[path.join(os.getcwd(), 'deps/zlib')])
env.Append(CPPPATH=[path.join(os.getcwd(), 'deps/zlib/build')])
env.Append(LIBPATH=[path.join(os.getcwd(), 'deps/zlib/build/Release')])
# Include directories
@@ -303,10 +307,6 @@ if not env.GetOption('clean'):
print("There's a problem with your compiler!")
Exit(1)
if not conf.CheckLib('zlib' if (platform == "win32" and 'mingw' not in env["TOOLS"]) else 'z'):
print('zlib must be installed!')
Exit(1)
def check_lib(lib, disp, suffixes=[], versions=[], msvc_versions=[]):
if "mingw" in env["TOOLS"] and lib.startswith("sfml"):
lib = "lib" + lib
@@ -321,12 +321,15 @@ if not env.GetOption('clean'):
for suff in suffixes:
possible_names.append(possible_names[i] + suff)
for test in possible_names:
print(f'checking {test}')
if conf.CheckLib(test, language='C++'):
bundled_libs.append(test)
print(test)
return # Success!
for ver in versions:
if conf.CheckLib(test + ver, language='C++'):
bundled_libs.append(test + ver)
print(test + ver)
return # Success!
print(disp, 'must be installed!')
print(" If you're sure it's installed, try passing LIBPATH=...")
@@ -341,6 +344,8 @@ if not env.GetOption('clean'):
boost_versions = ['-1_84'] # This is a bit of a hack. :(
suffixes = ['-mt', f'-mt-x{env["bits"]}']
zlib = 'zlib' if (platform == "win32" and 'mingw' not in env["TOOLS"]) else 'z'
check_lib(zlib, 'zlib', [], [])
check_header('boost/lexical_cast.hpp', 'Boost.LexicalCast')
check_header('boost/optional.hpp', 'Boost.Optional')
@@ -350,10 +355,11 @@ if not env.GetOption('clean'):
check_header('boost/spirit/include/classic.hpp', 'Boost.Spirit.Classic')
check_lib('boost_system', 'Boost.System', suffixes, boost_versions)
check_lib('boost_filesystem', 'Boost.Filesystem', suffixes, boost_versions)
check_lib('sfml-system', 'SFML-system')
check_lib('sfml-window', 'SFML-window')
check_lib('sfml-audio', 'SFML-audio')
check_lib('sfml-graphics', 'SFML-graphics')
sfml_suffixes = ['-d']
check_lib('sfml-system', 'SFML-system', sfml_suffixes)
check_lib('sfml-window', 'SFML-window', sfml_suffixes)
check_lib('sfml-audio', 'SFML-audio', sfml_suffixes)
check_lib('sfml-graphics', 'SFML-graphics', sfml_suffixes)
# If building the tests, make sure Catch2 is cloned
if 'test' in targets and not path.exists('deps/Catch2/README.md'):
@@ -363,6 +369,7 @@ if not env.GetOption('clean'):
if platform == 'posix':
def check_tgui(conf, second_attempt=False):
if conf.CheckLib('libtgui', language='C++'):
bundled_libs.append('tgui')
return conf
else:
if second_attempt:
@@ -438,7 +445,31 @@ Export("data_dir")
SConscript(["rsrc/SConscript", "doc/SConscript"])
# Bundle required frameworks and libraries
def handle_bundled_libs(extension, prefix=''):
target_dirs = ["#build/Blades of Exile", "#build/test"]
for lib in bundled_libs:
for lpath in env['LIBPATH']:
def check_path(src_file):
_dir = os.path.dirname(src_file)
print(f'checking {_dir} for {prefix}{lib}')
try:
print(os.listdir(_dir))
except:
pass
if path.exists(src_file) and src_file != "/usr/lib/x86_64-linux-gnu/libz.so":
for targ in target_dirs:
for so in os.listdir(_dir):
if os.path.basename(src_file) in so:
print(f'found {path.join(_dir, so)}')
env.Install(targ, path.join(_dir, so))
return True
return False
if check_path(path.join(lpath, prefix + lib + extension)):
break
elif check_path(path.join(lpath.replace('lib', 'bin'), prefix + lib + extension)):
break
elif check_path(path.join(lpath, 'x86_64-linux-gnu', prefix + lib + extension)):
break
if platform == "darwin":
targets = [
"Blades of Exile",
@@ -449,6 +480,8 @@ if platform == "darwin":
target_dir = path.join(install_dir, targ + '.app', 'Contents/Frameworks')
binary = path.join(install_dir, targ + '.app', 'Contents/MacOS', targ)
env.Command(Dir(target_dir), binary, [Delete(target_dir), bundle_libraries_for])
# After building, fix the rpaths of the executables and their bundled libs:
atexit.register(lambda: subprocess.call([path.join(os.getcwd(), '.github/workflows/scripts/mac/fix-rpaths.sh')], cwd='build/Blades of Exile'))
elif platform == "win32":
bundled_libs += Split("""
libsndfile-1
@@ -468,20 +501,7 @@ elif platform == "win32":
brotlidec
brotlicommon
""")
target_dirs = ["#build/Blades of Exile", "#build/test"]
for lib in bundled_libs:
for lpath in env['LIBPATH']:
src_file = path.join(lpath, lib + ".dll")
if path.exists(src_file):
for targ in target_dirs:
env.Install(targ, src_file)
break
elif 'lib' in lpath:
src_file = path.join(lpath.replace('lib', 'bin'), lib + ".dll")
if path.exists(src_file):
for targ in target_dirs:
env.Install(targ, src_file)
break
handle_bundled_libs(".dll")
# Extra: Microsoft redistributable libraries installer
if 'msvc' in env["TOOLS"]:
if path.exists("deps/VCRedistInstall.exe"):
@@ -489,11 +509,41 @@ elif platform == "win32":
else:
print("WARNING: Cannot find installer for the MSVC redistributable libraries for your version of Visual Studio.")
print("Please download it from Microsoft's website and place it at:")
print(" deps/VCRedistInstall.exe")
print(" deps/VCRedistInstall.exe")
# Create it so its lack doesn't cause makensis to break
# (Because the installer is an optional component.)
os.makedirs("build/Blades of Exile", exist_ok=True)
open("build/Blades of Exile/VCRedistInstall.exe", 'w').close()
elif platform == "posix":
targets = [
"Blades of Exile",
"BoE Character Editor",
"BoE Scenario Editor",
]
def patchelf():
to_patch = targets + [so for so in os.listdir("build/Blades of Exile") if '.so' in so]
for targ in to_patch:
subprocess.call(['patchelf', '--set-rpath', '.', targ], cwd='build/Blades of Exile')
atexit.register(patchelf)
bundled_libs += Split("""
GL
X11
stdc++
Xrandr
Xcursor
udev
openal
vorbisenc
vorbisfile
vorbis
ogg
FLAC
freetype
GLdispatch
GLX
xcb
""")
handle_bundled_libs(".so", "lib")
if env["package"]:
if platform == "darwin":

1
deps/zlib vendored Submodule

Submodule deps/zlib added at 51b7f2abda