From fbf8cd04b51269c89844810a5826c4242d5105c4 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 4 Sep 2017 13:19:06 +0300 Subject: [PATCH] Fix travis build. Regression was introduced in 5faca8d4f6. GYP patch for GCC precompiled header support was accidentally removed. --- .travis/build.sh | 2 +- Telegram/Patches/gyp.diff | 34 +++++++++++++++++++++++++++++++--- docs/building-cmake.md | 1 + docs/building-xcode.md | 2 ++ 4 files changed, 35 insertions(+), 4 deletions(-) diff --git a/.travis/build.sh b/.travis/build.sh index ca6610cbc..764d29e93 100755 --- a/.travis/build.sh +++ b/.travis/build.sh @@ -601,7 +601,7 @@ buildGYP() { git clone https://chromium.googlesource.com/external/gyp cd "$EXTERNAL/gyp" - git checkout 702ac58e4772 + git checkout 702ac58e47 git apply "$GYP_PATCH" cp -r * "$GYP_PATH/" } diff --git a/Telegram/Patches/gyp.diff b/Telegram/Patches/gyp.diff index 134ae28c0..e0b55c1c5 100644 --- a/Telegram/Patches/gyp.diff +++ b/Telegram/Patches/gyp.diff @@ -1,5 +1,33 @@ +diff --git a/pylib/gyp/generator/cmake.py b/pylib/gyp/generator/cmake.py +index a2b9629..68d7020 100644 +--- a/pylib/gyp/generator/cmake.py ++++ b/pylib/gyp/generator/cmake.py +@@ -1070,6 +1070,23 @@ def WriteTarget(namer, qualified_target, target_dicts, build_dir, config_to_use, + + output.write(')\n') + ++ # Precompile header ++ precompiled_header = config.get('cmake_precompiled_header', '') ++ if precompiled_header: ++ precompiled_header_script = config.get('cmake_precompiled_header_script', '') ++ if not precompiled_header_script: ++ print ('ERROR: cmake_precompiled_header requires cmake_precompiled_header_script') ++ cmake_precompiled_header = NormjoinPath(path_from_cmakelists_to_gyp, precompiled_header) ++ cmake_precompiled_header_script = NormjoinPathForceCMakeSource(path_from_cmakelists_to_gyp, precompiled_header_script) ++ output.write('include(') ++ output.write(cmake_precompiled_header_script) ++ output.write(')\n') ++ output.write('add_precompiled_header(') ++ output.write(cmake_target_name) ++ output.write(' ') ++ output.write(cmake_precompiled_header) ++ output.write(')\n') ++ + UnsetVariable(output, 'TOOLSET') + UnsetVariable(output, 'TARGET') + diff --git a/pylib/gyp/generator/xcode.py b/pylib/gyp/generator/xcode.py -index 0e3fb93..4c824ec 100644 +index db99d6a..8d56baf 100644 --- a/pylib/gyp/generator/xcode.py +++ b/pylib/gyp/generator/xcode.py @@ -72,6 +72,10 @@ generator_additional_non_configuration_keys = [ @@ -13,7 +41,7 @@ index 0e3fb93..4c824ec 100644 'mac_bundle', 'mac_bundle_resources', 'mac_framework_headers', -@@ -761,6 +765,26 @@ def GenerateOutput(target_list, target_dicts, data, params): +@@ -772,6 +776,26 @@ def GenerateOutput(target_list, target_dicts, data, params): xcode_targets[qualified_target] = xct xcode_target_to_target_dict[xct] = spec @@ -40,7 +68,7 @@ index 0e3fb93..4c824ec 100644 spec_actions = spec.get('actions', []) spec_rules = spec.get('rules', []) -@@ -1130,7 +1154,8 @@ exit 1 +@@ -1141,7 +1165,8 @@ exit 1 groups = [x for x in groups if not x.endswith('_excluded')] for group in groups: for item in rule.get(group, []): diff --git a/docs/building-cmake.md b/docs/building-cmake.md index 99a388c2c..accb94c8a 100644 --- a/docs/building-cmake.md +++ b/docs/building-cmake.md @@ -180,6 +180,7 @@ In Terminal go to **/home/user/TBuild/Libraries** and run wget https://cmake.org/files/v3.6/cmake-3.6.2.tar.gz tar -xf cmake-3.6.2.tar.gz cd gyp + git checkout 702ac58e47 git apply ../../tdesktop/Telegram/Patches/gyp.diff cd ../cmake-3.6.2 ./configure diff --git a/docs/building-xcode.md b/docs/building-xcode.md index 6cc793d2a..023025a9b 100644 --- a/docs/building-xcode.md +++ b/docs/building-xcode.md @@ -194,6 +194,8 @@ In Terminal go to **/Users/user/TBuild/Libraries** and run: git clone https://chromium.googlesource.com/external/gyp git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git cd gyp + git checkout 702ac58e47 + git apply ../../tdesktop/Telegram/Patches/gyp.diff ./setup.py build sudo ./setup.py install cd ..