Compare commits

...

51 commits

Author SHA1 Message Date
John Schoenick
d616614dce makefile_base.mak: Fix inverted logic on wine-preloader install
Should not install on OS X, rather than only install on OS X (oops!)
2018-09-07 17:11:11 -07:00
John Schoenick
c3a326be07 makefile_base.mak: Replace container-test step with sudo test
The real use of this step is obtaining sudo access to avoid having
sudo prompts buried in the build output when building in parallel,
making it non-obvious why the build is hanging.  Just warn that this
may happen and obtain sudo immediately to mitigate.  Building without
-j will always build subprojects in serial and won't have this
issue (similar to build_proton.sh)
2018-09-07 16:58:53 -07:00
John Schoenick
e5efde2575 build: Add --with-ffmpeg to makefile path
Rather than having 'ffmpeg' be an optional thing that may or may not
be in your build depending on if you've run 'make ffmpeg'
2018-09-07 16:57:30 -07:00
John Schoenick
15b4f5b84a makefile_base.mak: Don't install wine-preloader on OS X
Carryover from build_proton.sh
2018-09-06 15:56:25 -07:00
John Schoenick
dde5b89ecc makefile_base.mak: Remove some already-addressed OS X TODO comments 2018-09-06 15:55:39 -07:00
John Schoenick
accb799a68 configure.sh: Add --help / --usage
Just shows the usage text anyway, but without scolding you
2018-09-06 15:42:31 -07:00
John Schoenick
9cc535e653 makefile_base.mak: Fix autoconf flags passed to wine for OS X builds
This wasn't really fully hooked up, just mimic'd from build_proton.sh
2018-09-06 15:25:43 -07:00
John Schoenick
0330fc30dc makefile_base.mak: Re-order config sections so FREETYPE_CFLAGS works
TOOLS_DIR32 needs to be defined before this chunk
2018-09-06 15:25:43 -07:00
John Schoenick
c6e558f947 makefile_base.mak: Fix and improve targets, add help
make help or make targets will show a target list, the 'all' and
all32/etc helper targets now work right.
2018-09-06 15:25:43 -07:00
John Schoenick
452ce8de07 makefile_base.mak: Fix nested_make with no goals specified 2018-09-06 15:25:43 -07:00
John Schoenick
e47b3646b2 makefile_base.mak: Additional wine deps are OS X only 2018-09-06 15:25:43 -07:00
John Schoenick
1bf5b59071 makefile_base.mak: Add moltenvk build steps for OS X 2018-09-06 15:25:43 -07:00
John Schoenick
de1796ae91 makefile_base.mak: Fix quoting hazards
Some of these variables are expanded into shell assignments, in which
case we want them to be single-element variables and not lists under
make.
2018-09-06 15:25:43 -07:00
John Schoenick
e6d905c135 makefile_base.mak: Add libsdl build steps for OS X 2018-09-06 15:25:43 -07:00
John Schoenick
6bff02aff6 makefile_base.mak: Add libjpeg build steps for OS X 2018-09-06 15:25:43 -07:00
John Schoenick
bbe3decd78 makefile_base.mak: Add libpng build steps for OS X 2018-09-06 15:25:43 -07:00
John Schoenick
5cd4f01d85 makefile_base.mak: Use clang for CC/CXX on OS X 2018-09-06 15:25:43 -07:00
John Schoenick
53ae49fc44 makefile_base.mak: Proper platform-specific variable handling
Split variables section for platform-specific variables.  Import OS X
values from build_proton, ensure they are quoted properly when defined
and passed to shell in recipes.
2018-09-06 15:25:43 -07:00
John Schoenick
fc98b7b36a makefile_base.mak: Finish freetype build steps for OS X 2018-09-06 15:25:43 -07:00
John Schoenick
303c9d680c makefile_base.mak: Don't run symlink-vrclient step in container
Unnecessary container annotation
2018-09-06 15:25:43 -07:00
John Schoenick
5934094828 makefile_base.mak: Export HOME in container invocation
This was causing weird bugs in docker-on-OS X which wasn't determining
home correctly.  (Not really a supported setup)
2018-09-06 15:25:43 -07:00
John Schoenick
a556fa1983 makefile_base.mak: Fix nested make invoking wrong makefile
Effectively a no-op since outer makefile only sets variables we'd
inherit either way, but a silly landmine
2018-09-06 15:25:43 -07:00
John Schoenick
d751c57451 makefile_base.mak: Fix winemaker dependencies
This doesn't really need to be a dependency, but you'll get a cleaner
warning about your wine submodule not being setup
2018-09-06 15:25:43 -07:00
John Schoenick
09a672bd52 makefile_base.mak: Don't use 'undefine'
Breaks OS X/Homebrew make
2018-09-06 15:25:43 -07:00
John Schoenick
35e76391fe configure.sh: Fix grammatical typo 2018-09-06 15:25:43 -07:00
John Schoenick
30ea538cef build: Add --build-name to configure.sh step 2018-09-06 15:25:43 -07:00
John Schoenick
0b192a548a build: Install proper license file for OS X builds
Pass OSX variable to make, conditionally select LICENSE.osx
2018-09-06 15:25:43 -07:00
John Schoenick
f5e8954c5f makefile_base.mak: Comment expected settings from configure.sh 2018-09-06 15:25:43 -07:00
John Schoenick
154cda1b7f build: Disable dxvk by default on OS X 2018-09-06 15:25:05 -07:00
John Schoenick
4b65a3531c makefile_base.mak: Clean-up remaining FIXME/TODO comments 2018-08-27 17:01:23 -07:00
John Schoenick
7ff739f1d8 makefile_base.mak: Add LICENSE dist step 2018-08-27 17:01:23 -07:00
John Schoenick
94f38d6278 makefile_base.mak: Add make install target 2018-08-27 17:01:23 -07:00
John Schoenick
8a65ba1e7c configure.sh: Improve help text 2018-08-27 17:01:23 -07:00
John Schoenick
055183eaa5 configure.sh: Remove --force 2018-08-27 17:01:23 -07:00
John Schoenick
3ccfeffa32 Add configure.sh / configuration step to generate final makefile 2018-08-27 17:01:23 -07:00
John Schoenick
8f26580178 Add steamrt-bootstrap.sh for use with steam-runtime setup scripts 2018-08-27 17:01:23 -07:00
John Schoenick
fdda818065 makefile_base.mak: Add nested make for better failure handling 2018-08-27 17:01:23 -07:00
John Schoenick
d92a0f1210 makefile_base.mak: Misc build step fixes
make all should succeed now
2018-08-27 17:01:22 -07:00
John Schoenick
2f7d77caae makefile_base.mak: ffmpeg is optional, don't build by default 2018-08-27 17:01:22 -07:00
John Schoenick
b88db76760 makefile_base.mak: 'make all succeeded' output for meta targets 2018-08-27 17:01:22 -07:00
John Schoenick
432f8ec03b makefile_base.mak: Fix intermediate targets
Cannot use multiple-target rules in this way unless they are pattern
rules
2018-08-27 17:01:22 -07:00
John Schoenick
dd1dcbbb8f makefile_base.mak: Cleanup wine targets and winebuild dependencies 2018-08-27 17:01:22 -07:00
John Schoenick
3ebca56e77 makefile_base.mak: Fix docker not accepting SIGINT 2018-08-27 17:01:22 -07:00
John Schoenick
8b81f7c69e makefile_base.mak: Include cmake, build for openal
Removes need for special cmake setup to get builds working, as Steam
Runtime currently doesn't provide cmake 3
2018-08-27 17:01:22 -07:00
John Schoenick
e0d5e7f9d2 makefile_base.mak: Initial support for docker builds 2018-08-27 17:01:22 -07:00
John Schoenick
23cdb57144 makefile_base.mak: Install openvr_api_dll in the dist step 2018-08-27 17:01:22 -07:00
John Schoenick
3bc14bd7f1 makefile_base.mak: Build the initial wine prefix in the dist step 2018-08-27 17:01:22 -07:00
John Schoenick
9a75ea7791 makefile_base.mak: Generate compatibilitytool.vdf from dist step 2018-08-27 17:01:22 -07:00
John Schoenick
8666551881 makefile_base.mak: Add initial dist step 2018-08-27 17:01:22 -07:00
John Schoenick
e95225687f makefile_base.mak: Make depending on the makefile itself optional
Many of the configure steps below depend on the makefile itself, such
that they are dirtied by changing the recipes that create them.  This
can be annoying when working on the makefile, allow disabling this via

    make NO_MAKEFILE_DEPENDENCY=1
2018-08-27 17:01:19 -07:00
John Schoenick
5c1306671d makefile_base.mak: Initial 2018-08-27 17:01:16 -07:00
6 changed files with 1729 additions and 0 deletions

3
.gitmodules vendored
View file

@ -28,3 +28,6 @@
[submodule "openvr"]
path = openvr
url = https://github.com/ValveSoftware/openvr
[submodule "cmake"]
path = cmake
url = https://github.com/Kitware/CMake

1414
build/makefile_base.mak Normal file

File diff suppressed because it is too large Load diff

1
cmake Submodule

@ -0,0 +1 @@
Subproject commit c4ab098097f4fe1bc85ee29c6de390dff435f63f

View file

@ -0,0 +1,25 @@
"compatibilitytools"
{
"compat_tools"
{
"proton-localbuild" // Internal name of this tool
{
// Can register this tool with Steam in two ways:
//
// - The tool can be placed as a subdirectory in compatibilitytools.d, in which case this
// should be '.'
//
// - This manifest can be placed directly in compatibilitytools.d, in which case this should
// be the relative or absolute path to the tool's dist directory.
"install_path" "."
// For this template, we're going to substitute the display_name key in here, e.g.:
// "display_name" "Proton - local build 3/2"
//##DISPLAY_NAME##
"from_oslist" "windows"
"to_oslist" "linux"
}
}
}

263
configure.sh Executable file
View file

@ -0,0 +1,263 @@
#!/bin/bash
set -eu
SRCDIR="$(dirname "$0")"
DEFAULT_BUILD_NAME="proton-localbuild" # If no --build-name specified
# Output helpers
COLOR_ERR=""
COLOR_STAT=""
COLOR_INFO=""
COLOR_CMD=""
COLOR_CLEAR=""
if [[ $(tput colors 2>/dev/null || echo 0) -gt 0 ]]; then
COLOR_ERR=$'\e[31;1m'
COLOR_STAT=$'\e[32;1m'
COLOR_INFO=$'\e[30;1m'
COLOR_CMD=$'\e[93;1m'
COLOR_CLEAR=$'\e[0m'
fi
sh_quote() { local quoted="$(printf '%q ' "$@")"; [[ $# -eq 0 ]] || echo "${quoted:0:-1}"; }
err() { echo >&2 "${COLOR_ERR}!!${COLOR_CLEAR} $*"; }
stat() { echo >&2 "${COLOR_STAT}::${COLOR_CLEAR} $*"; }
info() { echo >&2 "${COLOR_INFO}::${COLOR_CLEAR} $*"; }
showcmd() { echo >&2 "+ ${COLOR_CMD}$(sh_quote "$@")${COLOR_CLEAR}"; }
die() { err "$@"; exit 1; }
finish() { stat "$@"; exit 0; }
cmd() { showcmd "$@"; "$@"; }
# Environment
OSX=""
[[ $(uname || true) != Darwin ]] || OSX=1
#
# Configure
#
THIS_COMMAND="$0 $*" # For printing, not evaling
MAKEFILE="./Makefile"
function check_steamrt_image() {
local type="$1"
local name="$2"
# nil nil -> no container
[[ -n $type || -n $name ]] || return 0;
# Otherwise both needed
[[ -n $type && -n $name ]] || die "Steam Runtime SDK option must be of form type:image"
# Type known?
[[ $type = docker ]] || die "Only supported Steam Runtime type is currently docker"
# Name must be alphanumericish for dumping into makefile and sanity.
[[ $name =~ ^[a-zA-Z0-9_.-]+$ ]] || die "Runtime image name should be alphanumeric ($name)"
}
# This is not rigorous. Do not use this for untrusted input. Do not. If you need a version of
# this for untrusted input, rethink the path that got you here.
function escape_for_make() {
local escape="$1"
escape="${escape//\\/\\\\}" # '\' -> '\\'
escape="${escape//#/\\#}" # '#' -> '\#'
escape="${escape//\$/\$\$}" # '$' -> '$$'
escape="${escape// /\\ }" # ' ' -> '\ '
echo "$escape"
}
function configure() {
local steamrt64_type="${1%:*}"
local steamrt64_name="${1#*:}"
local steamrt32_type="${2%:*}"
local steamrt32_name="${2#*:}"
check_steamrt_image "$steamrt64_type" "$steamrt64_name"
check_steamrt_image "$steamrt32_type" "$steamrt32_name"
local srcdir="$(dirname "$0")"
# Build name
local build_name="$arg_build_name"
if [[ -n $build_name ]]; then
info "Configuring with build name: $build_name"
else
build_name="$DEFAULT_BUILD_NAME"
info "No build name specified, using default: $build_name"
fi
## Write out config
# Don't die after this point or we'll have rather unhelpfully deleted the Makefile
[[ ! -e "$MAKEFILE" ]] || rm "$MAKEFILE"
# Config
echo >> "$MAKEFILE" "# Generated by: $THIS_COMMAND"
echo >> "$MAKEFILE" ""
echo >> "$MAKEFILE" "SRCDIR := $(escape_for_make "$srcdir")"
echo >> "$MAKEFILE" "BUILD_NAME := $(escape_for_make "$build_name")"
# DXVK?
if [[ -n $OSX && ! -n $arg_force_dxvk ]]; then
echo >> "$MAKEFILE" "NO_DXVK := 1"
fi
# ffmpeg?
if [[ -n $arg_ffmpeg ]]; then
echo >> "$MAKEFILE" "WITH_FFMPEG := 1"
fi
# OS X?
if [[ -n $OSX ]]; then
echo >> "$MAKEFILE" "OSX := 1"
fi
# SteamRT
echo >> "$MAKEFILE" "STEAMRT64_MODE := $(escape_for_make "$steamrt64_type")"
echo >> "$MAKEFILE" "STEAMRT64_IMAGE := $(escape_for_make "$steamrt64_name")"
echo >> "$MAKEFILE" "STEAMRT32_MODE := $(escape_for_make "$steamrt32_type")"
echo >> "$MAKEFILE" "STEAMRT32_IMAGE := $(escape_for_make "$steamrt32_name")"
# Include base
echo >> "$MAKEFILE" ""
echo >> "$MAKEFILE" "include \$(SRCDIR)/build/makefile_base.mak"
stat "Created $MAKEFILE, now run make to build."
stat " See BUILDING.md for make targets and instructions"
}
#
# Parse arguments
#
arg_steamrt32=""
arg_steamrt64=""
arg_no_steamrt=""
arg_force_dxvk=""
arg_ffmpeg=""
arg_build_name=""
arg_help=""
invalid_args=""
function parse_args() {
local arg;
local val;
local val_used;
local val_passed;
while [[ $# -gt 0 ]]; do
arg="$1"
val=''
val_used=''
val_passed=''
if [[ -z $arg ]]; then # Sanity
err "Unexpected empty argument"
return 1
elif [[ ${arg:0:2} != '--' ]]; then
err "Unexpected positional argument ($1)"
return 1
fi
# Looks like an argument does it have a --foo=bar value?
if [[ ${arg%=*} != $arg ]]; then
val="${arg#*=}"
arg="${arg%=*}"
val_passed=1
else
# Otherwise for args that want a value, assume "--arg val" form
val="${2:-}"
fi
# The args
if [[ $arg = --help || $arg = --usage ]]; then
arg_help=1
elif [[ $arg = --build-name ]]; then
arg_build_name="$val"
val_used=1
elif [[ $arg = --with-ffmpeg ]]; then
arg_ffmpeg=1
elif [[ $arg = --osx-force-dxvk ]]; then
arg_force_dxvk=1
elif [[ $arg = --steam-runtime32 ]]; then
val_used=1
arg_steamrt32="$val"
elif [[ $arg = --steam-runtime64 ]]; then
val_used=1
arg_steamrt64="$val"
elif [[ $arg = --no-steam-runtime ]]; then
arg_no_steamrt=1
else
err "Unrecognized option $arg"
return 1
fi
# Check if this arg used the value and shouldn't have or vice-versa
if [[ -n $val_used && ! -n $val_passed ]]; then
# "--arg val" form, used $2 as the value.
# Don't allow this if it looked like "--arg --val"
if [[ ${val#--} != $val ]]; then
err "Ambiguous format for argument with value \"$arg $val\""
err " (use $arg=$val or $arg='' $val)"
return 1
fi
# Error if this was the last positional argument but expected $val
if [[ $# -le 1 ]]; then
err "$arg takes a parameter, but none given"
return 1
fi
shift # consume val
elif [[ -z $val_used && -n $val_passed ]]; then
# Didn't use a value, but passed in --arg=val form
err "$arg does not take a parameter"
return 1
fi
shift # consume arg
done
}
usage() {
"$1" "Usage: $0 { --no-steam-runtime | --steam-runtime32=<image> --steam-runtime64=<image> }"
"$1" " Generate a Makefile for building Proton. May be run from another directory to create"
"$1" " out-of-tree build directories (e.g. mkdir mybuild && cd mybuild && ../configure.sh)"
"$1" ""
"$1" " Options"
"$1" " --help / --usage Show this help text and exit"
"$1" ""
"$1" " --build-name=<name> Set the name of the build that displays when used in Steam"
"$1" ""
"$1" " --osx-force-dxvk Attempt to build DXVK on OS X - not currently functioning,"
"$1" " development use"
"$1" ""
"$1" " --with-ffmpeg Build ffmpeg for WMA audio support"
"$1" ""
"$1" " Steam Runtime"
"$1" " Proton builds that are to be installed & run under the steam client must be built with"
"$1" " the Steam Runtime SDK to ensure compatibility. See BUILDING.md for more information."
"$1" ""
"$1" " --steam-runtime64=docker:<image> Automatically invoke the Steam Runtime SDK in <image>"
"$1" " for build steps that must be run in an SDK"
"$1" " environment. See BUILDING.md for instructions to"
"$1" " create this image."
"$1" ""
"$1" " --steam-runtime32=docker:<image> The 32-bit docker image to use for steps that require"
"$1" " a 32-bit environment. See --steam-runtime64."
"$1" ""
"$1" " --no-steam-runtime Do not automatically invoke any runtime SDK as part of the build."
"$1" " Build steps may still be manually run in a runtime environment."
exit 1;
}
[[ $# -gt 0 ]] || usage info
parse_args "$@" || usage err
[[ -z $arg_help ]] || usage info
# Sanity check arguments
if [[ -n $arg_no_steamrt && (-n $arg_steamrt32 || -n $arg_steamrt64) ]]; then
die "Cannot specify a Steam Runtime SDK as well as --no-steam-runtime"
elif [[ -z $arg_no_steamrt && ( -z $arg_steamrt32 || -z $arg_steamrt64 ) ]]; then
die "Must specify either --no-steam-runtime or both --steam-runtime32 and --steam-runtime64"
fi
configure "$arg_steamrt64" "$arg_steamrt32"

23
steamrt-bootstrap.sh Executable file
View file

@ -0,0 +1,23 @@
#!/bin/bash
# Expect to be setting up a container or chroot
if [[ $(stat -c %d:%i /) != $(stat -c %d:%i /proc/1/root/.) ]]; then
echo "Running in chroot environment. Continuing..."
elif [[ -f /.dockerenv ]]; then
echo "Running in docker environment. Continuing..."
else
echo "Script must be running in a chroot environment. Exiting..."
exit 1
fi
set -xe
apt-get install -y gcc-5 g++-5 g++-5-multilib flex bison libosmesa6-dev libpcap-dev \
libhal-dev libsane-dev libv4l-dev libgphoto2-2-dev libcapi20-dev \
libgsm1-dev libmpg123-dev libvulkan-dev libxslt1-dev nasm yasm ccache
update-alternatives --install `which gcc` gcc `which gcc-5` 50
update-alternatives --set gcc `which gcc-5`
update-alternatives --install `which g++` g++ `which g++-5` 50
update-alternatives --set g++ `which g++-5`
update-alternatives --install `which cpp` cpp-bin `which cpp-5` 50
update-alternatives --set cpp-bin `which cpp-5`