From 2022f310c357f4e387b6a599a85cd39085b5c3de Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Tue, 7 Jul 2020 17:07:55 +0200 Subject: [PATCH] - added system-protobuf patch to use system protobuf; but build still fails due to some make issues with per-rule variable overrides --- apache-mod_pagespeed-system-protobuf.patch | 81 ++++++++++++++++++++++ apache-mod_pagespeed.spec | 6 ++ 2 files changed, 87 insertions(+) create mode 100644 apache-mod_pagespeed-system-protobuf.patch diff --git a/apache-mod_pagespeed-system-protobuf.patch b/apache-mod_pagespeed-system-protobuf.patch new file mode 100644 index 0000000..a29df0f --- /dev/null +++ b/apache-mod_pagespeed-system-protobuf.patch @@ -0,0 +1,81 @@ +--- modpagespeed-1.9.32.4/third_party/protobuf/protobuf.gyp.orig 2015-07-14 01:17:15.000000000 +0200 ++++ modpagespeed-1.9.32.4/third_party/protobuf/protobuf.gyp 2020-07-05 14:36:08.211183327 +0200 +@@ -430,6 +430,33 @@ + }, + }, + { ++ 'target_name': 'protobuf_full_do_not_use', ++ 'type': 'none', ++ 'direct_dependent_settings': { ++ 'cflags': [ ++ ', which requires RTTI. ++ 'GOOGLE_PROTOBUF_NO_RTTI', ++ 'GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER', ++ ], ++ }, ++ 'link_settings': { ++ # Use full protobuf, because vanilla protobuf doesn't have ++ # our custom patch to retain unknown fields in lite mode. ++ 'ldflags': [ ++ ' <(protoc_out_dir)/<(instaweb_protoc_subdir)/<(RULE_INPUT_ROOT).proto && <(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)protoc<(EXECUTABLE_SUFFIX) --proto_path=<(protoc_out_dir)/ <(protoc_out_dir)/<(instaweb_protoc_subdir)/<(RULE_INPUT_ROOT).proto --cpp_out=<(protoc_out_dir)', ++ 'cat <(instaweb_root)/<(instaweb_protoc_subdir)/<(RULE_INPUT_NAME) | sed \'s!"third_party/pagespeed!"pagespeed!\' | sed \'s!// \[opensource\] !!\' > <(protoc_out_dir)/<(instaweb_protoc_subdir)/<(RULE_INPUT_ROOT).proto && <(protoc_executable) --proto_path=<(protoc_out_dir)/ <(protoc_out_dir)/<(instaweb_protoc_subdir)/<(RULE_INPUT_ROOT).proto --cpp_out=<(protoc_out_dir)', + ], + }, + ], diff --git a/apache-mod_pagespeed.spec b/apache-mod_pagespeed.spec index 2667e19..5d80913 100644 --- a/apache-mod_pagespeed.spec +++ b/apache-mod_pagespeed.spec @@ -71,6 +71,7 @@ Patch7: no-arch-opt.patch Patch8: %{name}-icu.patch Patch9: %{name}-format.patch Patch10: serf-openssl1.1.patch +Patch11: %{name}-system-protobuf.patch URL: https://developers.google.com/speed/pagespeed/module BuildRequires: %{apxs} BuildRequires: apache-devel >= 2.2 @@ -85,6 +86,7 @@ BuildRequires: libstdc++-devel >= 5:4.1 BuildRequires: opencv-devel >= 2.3.1 BuildRequires: openssl-devel >= 1.1 BuildRequires: pkgconfig +BuildRequires: protobuf-devel BuildRequires: python-devel >= 1:2.6 BuildRequires: yasm # This version of gyp is new enough that it knows to use make for Linux 3.x @@ -131,6 +133,7 @@ site is maintained. %patch8 -p1 %patch9 -p1 %patch10 -p1 +%patch11 -p1 %if 0 sh -x %{_sourcedir}/clean-source.sh @@ -143,6 +146,8 @@ install -d third_party/icu/source/{common,i18n} ln -s %{_includedir}/unicode third_party/icu/source/i18n/unicode ln -s %{_includedir}/unicode third_party/icu/source/common/unicode +%{__rm} -r third_party/protobuf/src + %build # re-gen makefiles CC="%{__cc}" \ @@ -159,6 +164,7 @@ CXX="%{__cxx}" \ -Duse_system_libpng=1 \ -Duse_system_opencv=1 \ -Duse_system_openssl=1 \ + -Duse_system_protobuf=1 \ -Duse_system_yasm=1 \ -Duse_system_zlib=1 \ -Dsystem_include_path_apr=%{_includedir}/apr \ -- 2.44.0