[packages/apache-mod_pagespeed] - really use system libjpeg-turbo and zlib - drop hardcoded hardware optimization and selection flag

baggins baggins at pld-linux.org
Sun May 29 11:57:18 CEST 2016


commit 3fa299a09fd2c73b581210f55bac547875b70e8d
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Sun May 29 11:57:00 2016 +0200

    - really use system libjpeg-turbo and zlib
    - drop hardcoded hardware optimization and selection flags
    - rel 4

 apache-mod_pagespeed.spec | 18 +++++++----
 no-arch-opt.patch         | 82 +++++++++++++++++++++++++++++++++++++++++++++++
 system-libs.patch         | 19 +++++++++--
 3 files changed, 111 insertions(+), 8 deletions(-)
---
diff --git a/apache-mod_pagespeed.spec b/apache-mod_pagespeed.spec
index 610c4ee..8dac081 100644
--- a/apache-mod_pagespeed.spec
+++ b/apache-mod_pagespeed.spec
@@ -1,6 +1,7 @@
 #
 # Conditional build:
 %bcond_without	verbose		# verbose build (V=1)
+%bcond_with	sse2		# use SSE2 instructions
 
 # NOTE
 # - relase notes: https://developers.google.com/speed/pagespeed/module/release_notes
@@ -51,7 +52,7 @@ Name:		apache-mod_%{mod_name}
 # beta: 1.9.32.x-beta
 # stable: 1.9.32.x-stable
 Version:	1.9.32.4
-Release:	3
+Release:	4
 License:	Apache v2.0
 Group:		Networking/Daemons/HTTP
 Source0:	modpagespeed-%{version}.tar.xz
@@ -64,6 +65,7 @@ Patch2:		bug-632.patch
 Patch4:		no-dev-stdout.patch
 Patch5:		apache24-config.patch
 Patch6:		no-force-xxbit.patch
+Patch7:		no-arch-opt.patch
 URL:		https://developers.google.com/speed/pagespeed/module
 BuildRequires:	%{apxs}
 BuildRequires:	apache-devel >= 2.2
@@ -71,6 +73,8 @@ BuildRequires:	bash
 BuildRequires:	glib2-devel
 BuildRequires:	gperf
 BuildRequires:	libicu-devel
+BuildRequires:	libjpeg-turbo-devel
+BuildRequires:	libpng-devel
 BuildRequires:	libselinux-devel
 BuildRequires:	libstdc++-devel >= 5:4.1
 BuildRequires:	opencv-devel >= 2.3.1
@@ -112,19 +116,20 @@ site is maintained.
 
 %prep
 %setup -q -n modpagespeed-%{version}
-%patch0 -p2
+%patch0 -p1
 %patch1 -p0
 %patch2 -p1
 %patch4 -p1
 %patch5 -p1
 %patch6 -p1
+%patch7 -p1
 
 %if 0
 sh -x %{_sourcedir}/clean-source.sh
 %endif
 
-rm -r third_party/icu/source
-rm -r third_party/icu/genfiles
+%{__rm} -r third_party/icu/source
+%{__rm} -r third_party/icu/genfiles
 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
@@ -137,6 +142,7 @@ CXX="%{__cxx}" \
 	--format=make \
 	--depth=. \
 	build/all.gyp \
+	%{!?with_sse2:-Ddisable_sse2=1} \
 	-Duse_openssl=1 \
 	-Duse_system_apache_dev=1 \
 	-Duse_system_icu=1 \
@@ -159,8 +165,8 @@ CXX="%{__cxx}" \
 	CC.host="%{__cc}" \
 	CXX.host="%{__cxx}" \
 	LINK.host="%{__cxx}" \
-	CFLAGS="%{rpmcflags} %{rpmcppflags}" \
-	CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}" \
+	CFLAGS="%{rpmcflags} %{rpmcppflags} -DUSE_SYSTEM_LIBJPEG" \
+	CXXFLAGS="%{rpmcxxflags} %{rpmcppflags} -DUSE_SYSTEM_LIBJPEG" \
 	%{nil}
 
 %install
diff --git a/no-arch-opt.patch b/no-arch-opt.patch
new file mode 100644
index 0000000..c9df8a7
--- /dev/null
+++ b/no-arch-opt.patch
@@ -0,0 +1,82 @@
+--- modpagespeed-1.8.31.6/third_party/mod_spdy/src/build/common.gypi~	2015-01-27 23:51:31.000000000 +0100
++++ modpagespeed-1.8.31.6/third_party/mod_spdy/src/build/common.gypi	2016-05-29 11:38:30.139293222 +0200
+@@ -584,11 +584,6 @@
+         },
+         'conditions': [
+           [ 'target_arch=="ia32"', {
+-            'asflags': [
+-              # Needed so that libs with .s files (e.g. libicudata.a)
+-              # are compatible with the general 32-bit-ness.
+-              '-32',
+-            ],
+             # All floating-point computations on x87 happens in 80-bit
+             # precision.  Because the C and C++ language standards allow
+             # the compiler to keep the floating-point values in higher
+@@ -621,28 +616,7 @@
+                   '-msse2',
+                   '-mfpmath=sse',
+                 ],
+-              }, { # else: sse2 disabled
+-                'cflags': [
+-                  '-march=i686',
+-                ],
+               }],
+-              # Install packages have started cropping up with
+-              # different headers between the 32-bit and 64-bit
+-              # versions, so we have to shadow those differences off
+-              # and make sure a 32-bit-on-64-bit build picks up the
+-              # right files.
+-              ['host_arch!="ia32"', {
+-                'include_dirs+': [
+-                  '/usr/include32',
+-                ],
+-              }],
+-            ],
+-            # -mmmx allows mmintrin.h to be used for mmx intrinsics.
+-            # video playback is mmx and sse2 optimized.
+-            'cflags': [
+-              '-mmmx',
+-            ],
+-            'ldflags': [
+             ],
+           }],
+           ['linux_fpic==1', {
+--- modpagespeed-1.8.31.6/third_party/chromium/src/build/common.gypi~	2015-01-27 23:51:10.000000000 +0100
++++ modpagespeed-1.8.31.6/third_party/chromium/src/build/common.gypi	2016-05-29 11:39:54.573657091 +0200
+@@ -3178,11 +3178,6 @@
+           ['target_arch=="ia32"', {
+             'target_conditions': [
+               ['_toolset=="target"', {
+-                'asflags': [
+-                  # Needed so that libs with .s files (e.g. libicudata.a)
+-                  # are compatible with the general 32-bit-ness.
+-                  '-32',
+-                ],
+                 # All floating-point computations on x87 happens in 80-bit
+                 # precision.  Because the C and C++ language standards allow
+                 # the compiler to keep the floating-point values in higher
+@@ -3235,24 +3230,6 @@
+                       '-fuse-ld=gold',
+                     ],
+                   }],
+-                  # Install packages have started cropping up with
+-                  # different headers between the 32-bit and 64-bit
+-                  # versions, so we have to shadow those differences off
+-                  # and make sure a 32-bit-on-64-bit build picks up the
+-                  # right files.
+-                  # For android build, use NDK headers instead of host headers
+-                  ['host_arch!="ia32" and OS!="android"', {
+-                    'include_dirs+': [
+-                      '/usr/include32',
+-                    ],
+-                  }],
+-                ],
+-                # -mmmx allows mmintrin.h to be used for mmx intrinsics.
+-                # video playback is mmx and sse2 optimized.
+-                'cflags': [
+-                  '-mmmx',
+-                ],
+-                'ldflags': [
+                 ],
+               }],
+             ],
diff --git a/system-libs.patch b/system-libs.patch
index a03dbb5..bff8cdd 100644
--- a/system-libs.patch
+++ b/system-libs.patch
@@ -1,5 +1,5 @@
---- modpagespeed/src/build/install.gyp~	2012-06-24 15:31:45.000000000 +0300
-+++ modpagespeed/src/build/install.gyp	2012-07-07 15:41:33.416812382 +0300
+--- modpagespeed/build/install.gyp~	2012-06-24 15:31:45.000000000 +0300
++++ modpagespeed/build/install.gyp	2012-07-07 15:41:33.416812382 +0300
 @@ -43,7 +43,6 @@
          ],
          'packaging_files_binaries': [
@@ -8,3 +8,18 @@
          ],
          'flock_bash': ['flock', '--', '/tmp/linux_package_lock', 'bash'],
          'deb_build': '<(PRODUCT_DIR)/install/debian/build.sh',
+--- modpagespeed-1.8.31.6/build/pagespeed_overrides.gypi~	2015-01-27 23:50:30.000000000 +0100
++++ modpagespeed-1.8.31.6/build/pagespeed_overrides.gypi	2016-05-29 11:16:44.940121546 +0200
+@@ -44,9 +44,9 @@
+     # (Chromium already has transitive dependencies on these libraries
+     # via gtk). We want to link these libraries into our binaries so
+     # we change the default behavior.
+-    'use_system_libjpeg': 0,
+-    'use_system_libpng': 0,
+-    'use_system_zlib': 0,
++    'use_system_libjpeg': 1,
++    'use_system_libpng': 0,
++    'use_system_zlib': 1,
+ 
+     # We don't use google API keys in the PageSpeed build, so disable them.
+     'use_official_google_api_keys': 0,
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/apache-mod_pagespeed.git/commitdiff/3fa299a09fd2c73b581210f55bac547875b70e8d



More information about the pld-cvs-commit mailing list