Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update buildenv/1.3.x/win32-static's protobuf to 3.2.0 #45

Merged
merged 2 commits into from
Mar 26, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
buildenv/1.3.x/win32-static: update protobuf to 3.2.0 and cmake build…
…-system
  • Loading branch information
Kissaki authored and mkrautz committed Mar 26, 2017
commit 6c06de82b1d7614b9fcc141c5ff4a5a6ec916252
8 changes: 0 additions & 8 deletions buildenv/1.3.x/win32-static/props/protobuf.props

This file was deleted.

89 changes: 16 additions & 73 deletions buildenv/1.3.x/win32-static/protobuf.build
Original file line number Diff line number Diff line change
Expand Up @@ -5,92 +5,35 @@
# <http://mumble.info/mumble-releng/LICENSE>.

urls=(
"http://releng-distfiles.mumble.info/releng-distfiles/protobuf-2.6.1.zip"
"https://github.com/google/protobuf/releases/download/v2.6.1/protobuf-2.6.1.zip"
"http://releng-distfiles.mumble.info/releng-distfiles/protobuf-cpp-3.2.0.tar.gz"
"https://github.com/google/protobuf/releases/download/v3.2.0/protobuf-cpp-3.2.0.tar.gz"
)

digests=(
"sha1:1ef890776a696173211639e33a01b4be2be301b2"
"sha256:146362958db8c07a3459e81edf3c3b73ec81b26e54293ec7340e510bbb930504"
"sha1:7518aef2471e7398ebd0d85a53836d6a076222d5"
"sha256:51d773e4297238b282eaa4c1dd317099675b12eef2b414732b851c00459225c6"
)

function extract {
unzip -q -o protobuf-2.6.1.zip
cd protobuf-2.6.1
}

function prepare {
patch -p1 < ${MUMBLE_BUILDENV_ROOT}/patches/protobuf-2.5.0-fix-missing-algorithm-h-msvs2013.patch
patch -p1 < ${MUMBLE_BUILDENV_ROOT}/patches/protobuf-2.5.0-win32-disable-OutputDirectoryIsFileError-test.patch
patch -p1 < ${MUMBLE_BUILDENV_ROOT}/patches/protobuf-2.6.1-fix-unused-parameter-warnings-in-headers.patch
patch -p1 < ${MUMBLE_BUILDENV_ROOT}/patches/protobuf-2.6.1-msvc2015-literal-suffix-ambiguity.patch
patch -p1 < ${MUMBLE_BUILDENV_ROOT}/patches/protobuf-2.6.1-GetTemporaryDirectoryName-msvc2015.patch

cd vsprojects

cmd /c extract_includes.bat

sed -i -re 's/Format Version 9.00/Format Version 11.00/g;
s/Visual Studio 2005/Visual Studio 2010/g;
s/\.vcproj/\.vcxproj/g;' protobuf.sln

for fn in `ls *.vcproj`; do
if [[ ${VSMAJOR} -gt 12 ]]; then
cmd /c devenv.exe /upgrade ${fn}
else
cmd /c vcupgrade.exe -overwrite ${fn}
fi
done

sed -i -re 's/Name="gtest"/Name="gtest" RelativePathToProject="gtest.vcproj"/g;' ../gtest/msvc/gtest_main.vcproj
if [[ ${VSMAJOR} -gt 12 ]]; then
cmd /c devenv.exe /upgrade ..\\gtest\\msvc\\gtest.vcproj
# XXX: upgrading gtest.vcproj also generates gtest_main, so skip it...
# cmd /c devenv.exe /upgrade ..\\gtest\\msvc\\gtest_main.vcproj
else
cmd /c vcupgrade.exe -overwrite ..\\gtest\\msvc\\gtest.vcproj
cmd /c vcupgrade.exe -overwrite ..\\gtest\\msvc\\gtest_main.vcproj
fi

cmd /c python.exe $(cygpath -w ${MUMBLE_PREFIX}/mumble-releng/tools/vs-sln-convert-to-per-project-deps.py) protobuf.sln

if [ "${ARCH}" == "amd64" ]; then
for fn in *.vcxproj *.sln ../gtest/msvc/*.vcxproj; do
sed -i -re "s,<Platform>Win32</Platform>,<Platform>X64</Platform>,g;
s,<TargetMachine>MachineX86</TargetMachine>,<TargetMachine>MachineX64</TargetMachine>,g;
s,Release\|Win32,Release|X64,g;
s,Debug\|Win32,Debug|X64,g" "${fn}"

done
fi

# Force /ARCH:IA32 if we're targetting pure x86.
# The EnableEnhancedInstructionSet is intended to
# be inserted into the <ClCompile> tag in the
# <ItemDefinitionGroup> tags for both Release and
# Debug builds.
if [[ ${VSMAJOR} -gt 10 && "${ARCH}" == "x86" ]]; then
for fn in `ls *.vcxproj`; do
sed -i -re "s,<ClCompile>,<ClCompile>\n <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>,g" "${fn}"
done
fi
tar -zxf protobuf-cpp-3.2.0.tar.gz
cd protobuf-3.2.0
}

function build {
cmd /c msbuild.exe protobuf.sln /p:Configuration=${MUMBLE_BUILD_CONFIGURATION} /p:PlatformToolset=${MUMBLE_VSTOOLSET} /p:ForceImportBeforeCppTargets="$(cygpath -w ${MUMBLE_BUILDENV_ROOT}/props/protobuf.props)"
if [ "${MUMBLE_BUILD_CONFIGURATION}" == "Release" ]; then
BUILD_TYPE="RelWithDebInfo"
elif [ "${MUMBLE_BUILD_CONFIGURATION}" == "Debug" ]; then
BUILD_TYPE="Debug"
fi
cd cmake
cmd /c $(cygpath -w ${MUMBLE_PREFIX}/cmake/bin/cmake.exe) -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=$(cygpath -w ${MUMBLE_PREFIX}/protobuf) -Dprotobuf_MSVC_STATIC_RUNTIME=off
cmd /c nmake
}

function testsuite {
cd "${MUMBLE_BUILD_CONFIGURATION}"
cmd /c set TEMP=%LOCALAPPDATA%\\Temp \& set TMP=%LOCALAPPDATA%\\Temp \& lite-test.exe
cmd /c set TEMP=%LOCALAPPDATA%\\Temp \& set TMP=%LOCALAPPDATA%\\Temp \& tests.exe
cd ..
cmd /c set TEMP=%LOCALAPPDATA%\\Temp \& set TMP=%LOCALAPPDATA%\\Temp \& nmake check
}

function install {
mkdir -p ${MUMBLE_PREFIX}/protobuf/vsprojects/include/
cp -R include/* ${MUMBLE_PREFIX}/protobuf/vsprojects/include/

mkdir -p ${MUMBLE_PREFIX}/protobuf/vsprojects/${MUMBLE_BUILD_CONFIGURATION}/
cp -R ${MUMBLE_BUILD_CONFIGURATION}/*.{exe,pdb,lib} ${MUMBLE_PREFIX}/protobuf/vsprojects/${MUMBLE_BUILD_CONFIGURATION}/
cmd /c nmake install
}