build_proton.sh: Add support for building selected components

This commit is contained in:
Józef Kucia 2018-03-21 16:43:41 +01:00 committed by Andrew Eikum
parent b46ebbd333
commit b63199deff

View File

@ -199,6 +199,17 @@ else
INSTALL_PROGRAM_FLAGS='' INSTALL_PROGRAM_FLAGS=''
fi fi
BUILD_COMPONENTS='all'
if [ "$#" -ge 2 ]; then
for (( i=1; i <= $# - 1; i++)); do
if [ "${!i}" == "--build" ]; then
j=$((i+1))
BUILD_COMPONENTS="${!j}"
break
fi
done
fi
DST_DIR="$TOP/build/dist" DST_DIR="$TOP/build/dist"
TOOLS_DIR64="$TOP/build/tools.win64" TOOLS_DIR64="$TOP/build/tools.win64"
TOOLS_DIR32="$TOP/build/tools.win32" TOOLS_DIR32="$TOP/build/tools.win32"
@ -244,125 +255,136 @@ if [ "$PLATFORM" == "Darwin" ]; then
build_libSDL build_libSDL
fi fi
function build_wine64
{
cd "$TOP"/build/wine.win64
STRIP="$STRIP" CFLAGS="-I$TOOLS_DIR64/include -g -O2" LDFLAGS="-L$TOOLS_DIR64/lib" PKG_CONFIG_PATH="$TOOLS_DIR64/lib/pkgconfig" CC="$CC" \
PNG_CFLAGS="$PNG64_CFLAGS" PNG_LIBS="$PNG64_LIBS" ac_cv_lib_soname_png="$ac_cv_lib_soname_png64" \
JPEG_CFLAGS="$JPEG64_CFLAGS" JPEG_LIBS="$JPEG64_LIBS" ac_cv_lib_soname_jpeg="$ac_cv_lib_soname_jpeg64" \
FREETYPE_CFLAGS="$FREETYPE64_CFLAGS" FREETYPE_LIBS="$FREETYPE64_LIBS" ac_cv_lib_soname_freetype="$ac_cv_lib_soname_freetype64" \
$AMD64_WRAPPER "$TOP"/wine/configure \
--enable-win64 --disable-tests --prefix="$DST_DIR"
STRIP="$STRIP" $AMD64_WRAPPER make $JOBS
INSTALL_PROGRAM_FLAGS="$INSTALL_PROGRAM_FLAGS" STRIP="$STRIP" $AMD64_WRAPPER make install-lib
INSTALL_PROGRAM_FLAGS="$INSTALL_PROGRAM_FLAGS" STRIP="$STRIP" $AMD64_WRAPPER make prefix="$TOOLS_DIR64" libdir="$TOOLS_DIR64/lib64" dlldir="$TOOLS_DIR64/lib64/wine" install-dev install-lib
rm -f "$DST_DIR"/bin/{msiexec,notepad,regedit,regsvr32,wineboot,winecfg,wineconsole,winedbg,winefile,winemine,winepath}
rm -rf "$DST_DIR/share/man/"
}
#build wine64 function build_wine32
cd "$TOP"/build/wine.win64 {
STRIP="$STRIP" CFLAGS="-I$TOOLS_DIR64/include -g -O2" LDFLAGS="-L$TOOLS_DIR64/lib" PKG_CONFIG_PATH="$TOOLS_DIR64/lib/pkgconfig" CC="$CC" \ cd "$TOP"/build/wine.win32
PNG_CFLAGS="$PNG64_CFLAGS" PNG_LIBS="$PNG64_LIBS" ac_cv_lib_soname_png="$ac_cv_lib_soname_png64" \ STRIP="$STRIP" CFLAGS="-I$TOOLS_DIR32/include -g -O2" LDFLAGS="-L$TOOLS_DIR32/lib" PKG_CONFIG_PATH="$TOOLS_DIR32/lib/pkgconfig" CC="$CC" \
JPEG_CFLAGS="$JPEG64_CFLAGS" JPEG_LIBS="$JPEG64_LIBS" ac_cv_lib_soname_jpeg="$ac_cv_lib_soname_jpeg64" \ PNG_CFLAGS="$PNG32_CFLAGS" PNG_LIBS="$PNG32_LIBS" ac_cv_lib_soname_png="$ac_cv_lib_soname_png32" \
FREETYPE_CFLAGS="$FREETYPE64_CFLAGS" FREETYPE_LIBS="$FREETYPE64_LIBS" ac_cv_lib_soname_freetype="$ac_cv_lib_soname_freetype64" \ JPEG_CFLAGS="$JPEG32_CFLAGS" JPEG_LIBS="$JPEG32_LIBS" ac_cv_lib_soname_jpeg="$ac_cv_lib_soname_jpeg32" \
$AMD64_WRAPPER "$TOP"/wine/configure \ FREETYPE_CFLAGS="$FREETYPE32_CFLAGS" FREETYPE_LIBS="$FREETYPE32_LIBS" ac_cv_lib_soname_freetype="$ac_cv_lib_soname_freetype32" \
--enable-win64 --disable-tests --prefix="$DST_DIR" $I386_WRAPPER "$TOP"/wine/configure \
STRIP="$STRIP" $AMD64_WRAPPER make $JOBS --disable-tests --prefix="$TOP/build/dist.win32/"
INSTALL_PROGRAM_FLAGS="$INSTALL_PROGRAM_FLAGS" STRIP="$STRIP" $AMD64_WRAPPER make install-lib STRIP="$STRIP" $I386_WRAPPER make $JOBS
INSTALL_PROGRAM_FLAGS="$INSTALL_PROGRAM_FLAGS" STRIP="$STRIP" $AMD64_WRAPPER make prefix="$TOOLS_DIR64" libdir="$TOOLS_DIR64/lib64" dlldir="$TOOLS_DIR64/lib64/wine" install-dev install-lib INSTALL_PROGRAM_FLAGS="$INSTALL_PROGRAM_FLAGS" STRIP="$STRIP" $I386_WRAPPER make install-lib
rm -f "$DST_DIR"/bin/{msiexec,notepad,regedit,regsvr32,wineboot,winecfg,wineconsole,winedbg,winefile,winemine,winepath} INSTALL_PROGRAM_FLAGS="$INSTALL_PROGRAM_FLAGS" STRIP="$STRIP" $I386_WRAPPER make prefix="$TOOLS_DIR32" libdir="$TOOLS_DIR32/lib" dlldir="$TOOLS_DIR32/lib/wine" install-dev install-lib
rm -rf "$DST_DIR/share/man/"
#build wine32 #install 32-bit stuff manually, see
cd "$TOP"/build/wine.win32 # https://wiki.winehq.org/Packaging#WoW64_Workarounds
STRIP="$STRIP" CFLAGS="-I$TOOLS_DIR32/include -g -O2" LDFLAGS="-L$TOOLS_DIR32/lib" PKG_CONFIG_PATH="$TOOLS_DIR32/lib/pkgconfig" CC="$CC" \ cd "$TOP"/build/dist.win32/
PNG_CFLAGS="$PNG32_CFLAGS" PNG_LIBS="$PNG32_LIBS" ac_cv_lib_soname_png="$ac_cv_lib_soname_png32" \ cp -a lib "$DST_DIR"/
JPEG_CFLAGS="$JPEG32_CFLAGS" JPEG_LIBS="$JPEG32_LIBS" ac_cv_lib_soname_jpeg="$ac_cv_lib_soname_jpeg32" \ cp -a bin/wine "$DST_DIR"/bin/
FREETYPE_CFLAGS="$FREETYPE32_CFLAGS" FREETYPE_LIBS="$FREETYPE32_LIBS" ac_cv_lib_soname_freetype="$ac_cv_lib_soname_freetype32" \ if [ "$PLATFORM" != "Darwin" ]; then
$I386_WRAPPER "$TOP"/wine/configure \ cp -a bin/wine-preloader "$DST_DIR"/bin/
--disable-tests --prefix="$TOP/build/dist.win32/" fi
STRIP="$STRIP" $I386_WRAPPER make $JOBS cp -a bin/wineserver "$DST_DIR"/bin/wineserver32
INSTALL_PROGRAM_FLAGS="$INSTALL_PROGRAM_FLAGS" STRIP="$STRIP" $I386_WRAPPER make install-lib }
INSTALL_PROGRAM_FLAGS="$INSTALL_PROGRAM_FLAGS" STRIP="$STRIP" $I386_WRAPPER make prefix="$TOOLS_DIR32" libdir="$TOOLS_DIR32/lib" dlldir="$TOOLS_DIR32/lib/wine" install-dev install-lib
#install 32-bit stuff manually, see function build_lsteamclient64
# https://wiki.winehq.org/Packaging#WoW64_Workarounds {
cd "$TOP"/build/dist.win32/ cd "$TOP"
cp -a lib "$DST_DIR"/ rm -rf build/lsteamclient.win64
cp -a bin/wine "$DST_DIR"/bin/ cp -a lsteamclient build/lsteamclient.win64
if [ "$PLATFORM" != "Darwin" ]; then cd "$TOP"/build/lsteamclient.win64/
cp -a bin/wine-preloader "$DST_DIR"/bin/ $AMD64_WRAPPER "$TOP"/wine/tools/winemaker/winemaker \
fi --nosource-fix --nolower-include --nodlls --nomsvcrt \
cp -a bin/wineserver "$DST_DIR"/bin/wineserver32 -DSTEAM_API_EXPORTS \
-I"$TOOLS_DIR64"/include/ \
-I"$TOOLS_DIR64"/include/wine/ \
-I"$TOOLS_DIR64"/include/wine/windows/ \
-L"$TOOLS_DIR64"/lib64/ \
-L"$TOOLS_DIR64"/lib64/wine/ \
--dll .
CXXFLAGS="-Wno-attributes -O2" CFLAGS="-O2 -g" PATH="$TOOLS_DIR64/bin:$PATH" $AMD64_WRAPPER make $JOBS
if [ x"$STRIP" != x ]; then
$AMD64_WRAPPER $STRIP lsteamclient.dll.so
fi
cp -a lsteamclient.dll.so "$DST_DIR"/lib64/wine/
}
#build 64-bit lsteamclient function build_lsteamclient32
cd "$TOP" {
rm -rf build/lsteamclient.win64 cd "$TOP"
cp -a lsteamclient build/lsteamclient.win64 rm -rf build/lsteamclient.win32
cd "$TOP"/build/lsteamclient.win64/ cp -a lsteamclient build/lsteamclient.win32
$AMD64_WRAPPER "$TOP"/wine/tools/winemaker/winemaker \ cd "$TOP"/build/lsteamclient.win32/
--nosource-fix --nolower-include --nodlls --nomsvcrt \ $I386_WRAPPER "$TOP"/wine/tools/winemaker/winemaker \
-DSTEAM_API_EXPORTS \ --nosource-fix --nolower-include --nodlls --nomsvcrt --wine32 \
-I"$TOOLS_DIR64"/include/ \ -DSTEAM_API_EXPORTS \
-I"$TOOLS_DIR64"/include/wine/ \ -I"$TOOLS_DIR32"/include/ \
-I"$TOOLS_DIR64"/include/wine/windows/ \ -I"$TOOLS_DIR32"/include/wine/ \
-L"$TOOLS_DIR64"/lib64/ \ -I"$TOOLS_DIR32"/include/wine/windows/ \
-L"$TOOLS_DIR64"/lib64/wine/ \ -L"$TOOLS_DIR32"/lib/ \
--dll . -L"$TOOLS_DIR32"/lib/wine/ \
CXXFLAGS="-Wno-attributes -O2" CFLAGS="-O2 -g" PATH="$TOOLS_DIR64/bin:$PATH" $AMD64_WRAPPER make $JOBS --dll .
if [ x"$STRIP" != x ]; then CXXFLAGS="-Wno-attributes -O2" CFLAGS="-O2 -g" PATH="$TOOLS_DIR32/bin:$PATH" $I386_WRAPPER make $JOBS
$AMD64_WRAPPER $STRIP lsteamclient.dll.so if [ x"$STRIP" != x ]; then
fi $I386_WRAPPER $STRIP lsteamclient.dll.so
cp -a lsteamclient.dll.so "$DST_DIR"/lib64/wine/ fi
cp -a lsteamclient.dll.so "$DST_DIR"/lib/wine/
}
#build 32-bit lsteamclient function build_vrclient64
cd "$TOP" {
rm -rf build/lsteamclient.win32 cd "$TOP"
cp -a lsteamclient build/lsteamclient.win32 rm -rf build/vrclient_x64
cd "$TOP"/build/lsteamclient.win32/ cp -a vrclient_x64 build/vrclient_x64
$I386_WRAPPER "$TOP"/wine/tools/winemaker/winemaker \ cd "$TOP"/build/vrclient_x64/
--nosource-fix --nolower-include --nodlls --nomsvcrt --wine32 \ $AMD64_WRAPPER "$TOP"/wine/tools/winemaker/winemaker \
-DSTEAM_API_EXPORTS \ --nosource-fix --nolower-include --nodlls --nomsvcrt \
-I"$TOOLS_DIR32"/include/ \ -I"$TOOLS_DIR64"/include/ \
-I"$TOOLS_DIR32"/include/wine/ \ -I"$TOOLS_DIR64"/include/wine/ \
-I"$TOOLS_DIR32"/include/wine/windows/ \ -I"$TOOLS_DIR64"/include/wine/windows/ \
-L"$TOOLS_DIR32"/lib/ \ -L"$TOOLS_DIR64"/lib64/ \
-L"$TOOLS_DIR32"/lib/wine/ \ -L"$TOOLS_DIR64"/lib64/wine/ \
--dll . --dll .
CXXFLAGS="-Wno-attributes -O2" CFLAGS="-O2 -g" PATH="$TOOLS_DIR32/bin:$PATH" $I386_WRAPPER make $JOBS CXXFLAGS="-Wno-attributes -std=c++0x -O2 -g" CFLAGS="-O2 -g" PATH="$TOOLS_DIR64/bin:$PATH" $AMD64_WRAPPER make $JOBS
if [ x"$STRIP" != x ]; then PATH="$TOOLS_DIR64/bin:$PATH" $AMD64_WRAPPER winebuild --dll --fake-module -E vrclient_x64.spec -o vrclient_x64.dll.fake
$I386_WRAPPER $STRIP lsteamclient.dll.so if [ x"$STRIP" != x ]; then
fi $AMD64_WRAPPER $STRIP vrclient_x64.dll.so
cp -a lsteamclient.dll.so "$DST_DIR"/lib/wine/ fi
cp -a vrclient_x64.dll.so "$DST_DIR"/lib64/wine/
cp -a vrclient_x64.dll.fake "$DST_DIR"/lib64/wine/fakedlls/vrclient_x64.dll
}
#build 64-bit vrclient function build_vrclient32
cd "$TOP" {
rm -rf build/vrclient_x64 cd "$TOP"
cp -a vrclient_x64 build/vrclient_x64 rm -rf build/vrclient
cd "$TOP"/build/vrclient_x64/ cp -a vrclient_x64 build/vrclient
$AMD64_WRAPPER "$TOP"/wine/tools/winemaker/winemaker \ cd "$TOP"/build/vrclient/
--nosource-fix --nolower-include --nodlls --nomsvcrt \ mv vrclient_x64.spec vrclient.spec
-I"$TOOLS_DIR64"/include/ \ $I386_WRAPPER "$TOP"/wine/tools/winemaker/winemaker \
-I"$TOOLS_DIR64"/include/wine/ \ --nosource-fix --nolower-include --nodlls --nomsvcrt --wine32 \
-I"$TOOLS_DIR64"/include/wine/windows/ \ -I"$TOOLS_DIR32"/include/ \
-L"$TOOLS_DIR64"/lib64/ \ -I"$TOOLS_DIR32"/include/wine/ \
-L"$TOOLS_DIR64"/lib64/wine/ \ -I"$TOOLS_DIR32"/include/wine/windows/ \
--dll . -L"$TOOLS_DIR32"/lib/ \
CXXFLAGS="-Wno-attributes -std=c++0x -O2 -g" CFLAGS="-O2 -g" PATH="$TOOLS_DIR64/bin:$PATH" $AMD64_WRAPPER make $JOBS -L"$TOOLS_DIR32"/lib/wine/ \
PATH="$TOOLS_DIR64/bin:$PATH" $AMD64_WRAPPER winebuild --dll --fake-module -E vrclient_x64.spec -o vrclient_x64.dll.fake --dll .
if [ x"$STRIP" != x ]; then CXXFLAGS="-Wno-attributes -std=c++0x -O2 -g" CFLAGS="-O2 -g" PATH="$TOOLS_DIR32/bin:$PATH" $I386_WRAPPER make $JOBS
$AMD64_WRAPPER $STRIP vrclient_x64.dll.so PATH="$TOOLS_DIR32/bin:$PATH" $I386_WRAPPER winebuild --dll --fake-module -E vrclient.spec -o vrclient.dll.fake
fi if [ x"$STRIP" != x ]; then
cp -a vrclient_x64.dll.so "$DST_DIR"/lib64/wine/ $I386_WRAPPER $STRIP vrclient.dll.so
cp -a vrclient_x64.dll.fake "$DST_DIR"/lib64/wine/fakedlls/vrclient_x64.dll fi
cp -a vrclient.dll.so "$DST_DIR"/lib/wine/
#build 32-bit vrclient cp -a vrclient.dll.fake "$DST_DIR"/lib/wine/fakedlls/vrclient.dll
cd "$TOP" }
rm -rf build/vrclient
cp -a vrclient_x64 build/vrclient
cd "$TOP"/build/vrclient/
mv vrclient_x64.spec vrclient.spec
$I386_WRAPPER "$TOP"/wine/tools/winemaker/winemaker \
--nosource-fix --nolower-include --nodlls --nomsvcrt --wine32 \
-I"$TOOLS_DIR32"/include/ \
-I"$TOOLS_DIR32"/include/wine/ \
-I"$TOOLS_DIR32"/include/wine/windows/ \
-L"$TOOLS_DIR32"/lib/ \
-L"$TOOLS_DIR32"/lib/wine/ \
--dll .
CXXFLAGS="-Wno-attributes -std=c++0x -O2 -g" CFLAGS="-O2 -g" PATH="$TOOLS_DIR32/bin:$PATH" $I386_WRAPPER make $JOBS
PATH="$TOOLS_DIR32/bin:$PATH" $I386_WRAPPER winebuild --dll --fake-module -E vrclient.spec -o vrclient.dll.fake
if [ x"$STRIP" != x ]; then
$I386_WRAPPER $STRIP vrclient.dll.so
fi
cp -a vrclient.dll.so "$DST_DIR"/lib/wine/
cp -a vrclient.dll.fake "$DST_DIR"/lib/wine/fakedlls/vrclient.dll
if [ "$PLATFORM" != "Darwin" ]; then if [ "$PLATFORM" != "Darwin" ]; then
#build dxvk #build dxvk
@ -402,6 +424,24 @@ if [ "$PLATFORM" != "Darwin" ]; then
#cp -a dxvk/dist.win64/bin/d3d11.dll "$DST_DIR"/lib64/wine/dxvk/ #cp -a dxvk/dist.win64/bin/d3d11.dll "$DST_DIR"/lib64/wine/dxvk/
fi fi
case "$BUILD_COMPONENTS" in
"all")
build_wine64
build_wine32
build_lsteamclient64
build_lsteamclient32
build_vrclient64
build_vrclient32
;;
"wine") build_wine64; build_wine32 ;;
"wine32") build_wine64 ;;
"wine64") build_wine64 ;;
"vrclient") build_vrclient32; build_vrclient64 ;;
"vrclient32") build_vrclient32 ;;
"vrclient64") build_vrclient64 ;;
*) echo "Invalid build components: $BUILD_COMPONENTS" ;;
esac
echo "Packaging..." echo "Packaging..."
cd "$TOP" cd "$TOP"