-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #87 from xmoto/prep-for-release
Prep for release
- Loading branch information
Showing
19 changed files
with
323 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,41 @@ | ||
language: cpp | ||
dist: bionic | ||
|
||
before_install: | ||
- sudo apt-get install -y ninja-build | ||
- sudo apt-get install -y curl | ||
- sudo apt-get install -y libsqlite3-dev libjpeg-dev libbz2-dev liblua5.1-0-dev zlib1g-dev libpng-dev libglu1-mesa-dev | ||
- sudo apt-get install -y libcurl3-openssl-dev libxdg-basedir-dev libxml2-dev | ||
- sudo apt-get install -y libsdl1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsdl-net1.2-dev | ||
- sudo apt-get install -y libgl1-mesa-dev rpm | ||
|
||
script: | ||
- mkdir build && cd $_ | ||
- mkdir -p /tmp/xminstall | ||
- cmake -DCMAKE_INSTALL_PREFIX=/tmp/xminstall -G Ninja .. | ||
- ninja | ||
- ninja xmoto_pack | ||
- ninja install | ||
- cpack -G "DEB" | ||
- cpack -G "RPM" | ||
|
||
matrix: | ||
include: | ||
- os: linux | ||
dist: bionic | ||
install: ".travis/linux/deps.sh" | ||
script: ".travis/linux/build.sh" | ||
|
||
- os: osx | ||
osx_image: xcode10.1 # =10.13/high sierra | ||
install: ".travis/macos/deps.sh" | ||
script: ".travis/macos/build.sh" | ||
cache: | ||
directories: | ||
- $HOME/Library/Caches/Homebrew | ||
before_cache: | ||
- brew cleanup | ||
|
||
- os: linux | ||
dist: bionic | ||
name: "Linux MXE" | ||
install: ".travis/linux-mxe/deps.sh" | ||
script: ".travis/linux-mxe/build.sh" | ||
|
||
deploy: | ||
provider: releases | ||
api_key: | ||
secure: "XjHXrtaq9VSLL/zA1BKnrFNHrDuz4WUtn9JJs0EnngUt6zjw1q4Z2suVIw4iXWXkblWLIuA+HHXbM0RsiKHvc8FLFuZWpVkV/hz/AXLEZ40Yn+hW3b3z1zaNXFotXiKC+gmJcOgVo3/BQst1dG3gmUv2IM3JhYa4I3jzR9q5AqSqWbH8B1UdpB46St7D27kGdqt6tJAHZtKmyYRP7GfgeIVrCoOrhvgpFgzrj4p2yKy5voQWulXpyRyooaGOfXMzkcFzsiZLbJhLm3BaiFUOyRINufijjeDlyX5Df05a5x6uVxTZfjLFOyfzxTPpI/fMqNoYlRqvheoMVjGAu3s+e3KvllMM4hxD2M0J6WFV6beyzJqIwgR7Z3wgac5E2RJfQYo3S4V2SlKUAxqx4KXdQAiJ3VqdlE8V6p4eyoPIQFrJpsUfUye4d5rKj/U3SOD9OP9PDqNUEzzdwxYh4V0qexHJnegw4BOHIqIS+yr/fv2thJ27/mghG6a4rqxwbhANL7B3ZUVkFh6X+lW9lqsI+HQViJj7KbrFZNsg3rN6vwtfJsEPJctdvC26Dl8+A8vJWTQwPkiMJJSqliakR2P3XPuRRvHc28Q1tqytuVEJAJvF2/yGnGWauFLtI1D1yWlfMCNHnWftFUA3pXwr3DQoc7agKiBQjS+LU+Z58gGYB7o=" | ||
file: | ||
file: | ||
- 'xmoto-0.6.0.deb' | ||
- 'xmoto-0.6.0.rpm' | ||
- 'xmoto-0.6.0.dmg' | ||
- 'xmoto-0.6.0-setup.exe' | ||
- 'xmoto-0.6.0-win32.zip' | ||
skip_cleanup: true | ||
on: | ||
branch: "release" | ||
tags: true | ||
|
||
addons: | ||
apt: | ||
update: true | ||
packages: | ||
- cmake | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
#!/bin/sh | ||
|
||
set -ex | ||
|
||
# needed for cmake to find some programs | ||
export PATH="/usr/lib/mxe/usr/bin:$PATH" | ||
|
||
mkdir build && cd build | ||
mkdir -p /tmp/xmoto | ||
|
||
MXE_PATH=/usr/lib/mxe | ||
MXE_TARGET="i686-w64-mingw32.shared" | ||
|
||
is_broken_symlink() { | ||
if [ -L "$1" ] && [ ! -e "$1" ]; then | ||
return 0 | ||
else | ||
return 1 | ||
fi | ||
} | ||
|
||
relink() { | ||
for prog in "$@"; do | ||
if is_broken_symlink "$MXE_HOST_PFX-$prog"; then | ||
sudo rm "$MXE_HOST_PFX-$prog" | ||
sudo ln -s "$MXE_CROSS_PFX-$prog" "$MXE_HOST_PFX-$prog" | ||
fi | ||
done | ||
} | ||
|
||
MXE_HOST_PFX="$MXE_PATH/usr/x86_64-pc-linux-gnu/bin/$MXE_TARGET" | ||
MXE_CROSS_PFX="$MXE_PATH/usr/bin/$MXE_TARGET" | ||
|
||
# add the mxe DLLs to wine's path | ||
export WINEPATH="$MXE_PATH/usr/$MXE_TARGET/bin${WINEPATH:+:${WINEPATH}}" | ||
export WINEARCH=win32 | ||
|
||
echo "MXE_PATH: $MXE_PATH" | ||
echo "MXE HOST PREFIX: $MXE_HOST_PFX" | ||
echo "MXE CROSS PREFIX: $MXE_CROSS_PFX" | ||
echo "WINEPATH: $WINEPATH" | ||
|
||
relink "gcc" "g++" | ||
|
||
"$MXE_CROSS_PFX-cmake" \ | ||
-DCMAKE_INSTALL_PREFIX=/tmp/xmoto \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DXMOTO_PACK=manual .. | ||
|
||
make -j"$(nproc)" | ||
|
||
Xvfb :0 -screen 0 1024x768x16 & | ||
xvfb_pid=$! | ||
|
||
sleep 5 | ||
|
||
echo "pidof Xvfb:" | ||
pidof Xvfb | ||
|
||
make xmoto_pack | ||
|
||
# not that any reasonable PID 1 responds to SIGTERM anyway ;) | ||
if [ "$xvfb_pid" -gt 1 ]; then | ||
kill -15 "$xvfb_pid" || true | ||
fi | ||
|
||
# aaand if the graceful termination doesn't work.. | ||
jobs -p | xargs -r kill -9 | ||
|
||
#make install | ||
|
||
"$MXE_CROSS_PFX"-cpack -G "NSIS" | ||
"$MXE_CROSS_PFX"-cpack -G "ZIP" | ||
|
||
fix_pkg_name() { | ||
if [ -z "$1" ] || [ -z "$2" ]; then | ||
>&2 echo "Error: [fix_pkg_name]: 2 parameters required" | ||
fi | ||
file="$1" | ||
ext="${file##*.}" | ||
mv "$file" "${file%.$ext}-$2${ext:+.${ext}}" | ||
} | ||
|
||
# add -win32 to .zip files, and -setup to .exe files | ||
for pkg in xmoto-*.zip; do fix_pkg_name "$pkg" "win32"; done | ||
for pkg in xmoto-*.exe; do fix_pkg_name "$pkg" "setup"; done | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
set -ex | ||
|
||
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 86B72ED9 | ||
sudo add-apt-repository 'deb [arch=amd64] http://mirror.mxe.cc/repos/apt bionic main' | ||
|
||
# for xvfb | ||
sudo add-apt-repository universe | ||
|
||
sudo apt-get update | ||
|
||
sudo apt-get install -y \ | ||
mxe-i686-w64-mingw32.shared-{cc,curl,jpeg,libpng,zlib,libxml2,sqlite,gettext} \ | ||
mxe-i686-w64-mingw32.shared-{smpeg2,sdl,sdl-mixer,sdl-net,sdl-ttf,lzma,bzip2,nsis} \ | ||
wine-stable wine32 xvfb | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/sh | ||
|
||
set -ex | ||
|
||
mkdir build && cd build | ||
mkdir -p /tmp/xminstall | ||
cmake -DCMAKE_INSTALL_PREFIX=/tmp/xminstall \ | ||
-DCMAKE_BUILD_TYPE=Release -G Ninja .. | ||
ninja | ||
ninja xmoto_pack | ||
ninja install | ||
|
||
cpack -G "DEB" | ||
cpack -G "RPM" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/sh | ||
|
||
set -ex | ||
|
||
sudo apt-get update | ||
sudo apt-get install -y \ | ||
curl ninja-build rpm \ | ||
libsqlite3-dev libjpeg-dev libbz2-dev liblua5.1-0-dev \ | ||
zlib1g-dev libpng-dev libglu1-mesa-dev \ | ||
libcurl3-openssl-dev libxdg-basedir-dev libxml2-dev libgl1-mesa-dev \ | ||
libsdl1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsdl-net1.2-dev | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
|
||
set -ex | ||
|
||
mkdir build && cd build | ||
cmake -DCMAKE_BUILD_TYPE=Release \ | ||
-DBUILD_MACOS_BUNDLE=ON -G Ninja .. | ||
ninja | ||
|
||
# Homebrew on Catalina (10.15) sets inconsistent permissions on dylibs | ||
# and CMake happily copies them as is, and then chokes on its own brilliance. | ||
sudo \ | ||
cpack -G DragNDrop | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/sh | ||
|
||
set -ex | ||
|
||
brew update | ||
|
||
# packages to be checked for before installing them | ||
for pkg in cmake ninja jpeg libpng \ | ||
bzip2 curl sqlite3 libxml2 zlib; do | ||
brew list "$pkg" &>/dev/null || brew install "$pkg" | ||
done | ||
|
||
# install the rest of the packages | ||
brew install gettext sdl sdl_mixer sdl_net sdl_ttf | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,23 @@ | ||
set(CPACK_BUNDLE_NAME "XMoto") | ||
set(CPACK_BUNDLE_PLIST macos/Info.plist) | ||
set(CPACK_BUNDLE_ICON macos/xmoto.icns) | ||
set(CPACK_BUNDLE_PLIST ${PROJECT_SOURCE_DIR}/macos/Info.plist) | ||
set(CPACK_BUNDLE_ICON ${PROJECT_SOURCE_DIR}/macos/xmoto.icns) | ||
|
||
if(MACOS) | ||
#install(FILES macos/) | ||
set(CPACK_DMG_VOLUME_NAME "X-Moto-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") | ||
|
||
include(InstallRequiredSystemLibraries) | ||
|
||
if(BUILD_MACOS_BUNDLE) | ||
set_target_properties(xmoto PROPERTIES | ||
MACOSX_BUNDLE_INFO_PLIST | ||
"${PROJECT_SOURCE_DIR}/macos/Info.plist" | ||
) | ||
install(TARGETS xmoto | ||
RUNTIME DESTINATION . COMPONENT Runtime | ||
BUNDLE DESTINATION . COMPONENT Runtime | ||
) | ||
|
||
install(CODE " | ||
include(BundleUtilities) | ||
fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/xmoto.app\" \"\" \"\") | ||
" COMPONENT Runtime) | ||
endif() |
Oops, something went wrong.