[packages/apache-mod_pagespeed] - added system-protobuf patch to use system protobuf; but build still fails due to some make issues

qboosh qboosh at pld-linux.org
Tue Jul 7 17:06:35 CEST 2020


commit 2022f310c357f4e387b6a599a85cd39085b5c3de
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Tue Jul 7 17:07:55 2020 +0200

    - 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(+)
---
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 \
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': [
++              '<!@(pkg-config --cflags protobuf)',
++            ],
++            'defines': [
++              'USE_SYSTEM_PROTOBUF',
++
++              # This macro must be defined to suppress the use
++              # of dynamic_cast<>, 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': [
++              '<!@(pkg-config --libs-only-L --libs-only-other protobuf)',
++            ],
++            'libraries': [
++              '<!@(pkg-config --libs-only-l protobuf)',
++            ],
++          },
++        },
++        {
+           'target_name': 'protoc',
+           'type': 'none',
+           'toolsets': ['host', 'target'],
+--- modpagespeed-1.9.32.4/pagespeed/kernel.gyp.orig	2015-07-14 01:16:53.000000000 +0200
++++ modpagespeed-1.9.32.4/pagespeed/kernel.gyp	2020-07-05 16:37:30.784292901 +0200
+@@ -16,8 +16,14 @@
+   'variables': {
+     'instaweb_root': '..',
+     'protoc_out_dir': '<(SHARED_INTERMEDIATE_DIR)/protoc_out/instaweb',
++    'conditions': [
++      [ 'use_system_protobuf==1', {
++        'protoc_executable': '<!(which protoc)',
++      }, {
+     'protoc_executable':
+         '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)protoc<(EXECUTABLE_SUFFIX)',
++      }],
++    ],
+     'data2c_out_dir': '<(SHARED_INTERMEDIATE_DIR)/data2c_out/instaweb',
+     'data2c_exe':
+         '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)instaweb_data2c<(EXECUTABLE_SUFFIX)',
+--- modpagespeed-1.9.32.4/net/instaweb/instaweb.gyp.orig	2015-07-14 01:16:53.000000000 +0200
++++ modpagespeed-1.9.32.4/net/instaweb/instaweb.gyp	2020-07-05 16:44:07.851679301 +0200
+@@ -16,8 +16,14 @@
+   'variables': {
+     'instaweb_root': '../..',
+     'protoc_out_dir': '<(SHARED_INTERMEDIATE_DIR)/protoc_out/instaweb',
++    'conditions': [
++      [ 'use_system_protobuf==1', {
++        'protoc_executable': '<!(which protoc)',
++      }, {
+     'protoc_executable':
+         '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)protoc<(EXECUTABLE_SUFFIX)',
++      }],
++    ],
+     'data2c_out_dir': '<(SHARED_INTERMEDIATE_DIR)/data2c_out/instaweb',
+     'data2c_exe':
+         '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)instaweb_data2c<(EXECUTABLE_SUFFIX)',
+--- modpagespeed-1.9.32.4/net/instaweb/protoc.gypi.orig	2015-07-14 01:16:53.000000000 +0200
++++ modpagespeed-1.9.32.4/net/instaweb/protoc.gypi	2020-07-05 17:00:48.997260176 +0200
+@@ -30,7 +30,7 @@
+       'action': [
+         'bash',
+         '-c',
+-        '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 && <(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)',
+       ],
+     },
+   ],
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/apache-mod_pagespeed.git/commitdiff/2022f310c357f4e387b6a599a85cd39085b5c3de



More information about the pld-cvs-commit mailing list