[packages/chromium-browser/DEVEL] add system libXNVCtrl support

glen glen at pld-linux.org
Fri Jan 4 22:45:08 CET 2013


commit 4884fc995902450f6cd5512b71e22d5566e4448d
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Fri Jan 4 15:52:12 2013 +0200

    add system libXNVCtrl support
    
    somewhy binary size grows when linking with static libXNVCtrl.a:
    -rwxr-xr-x    1 root    root         66006324 jaan   4 02:28 /usr/lib/chromium-browser/chromium-browser
    -rwxr-xr-x    1 root    root         66018684 jaan   4 01:12 /usr/lib/chromium-browser/chromium-browser

 chromium-browser.spec   |  4 +++
 system-libxnvctrl.patch | 68 +++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 72 insertions(+)
---
diff --git a/chromium-browser.spec b/chromium-browser.spec
index 8439ff2..d12d8f0 100644
--- a/chromium-browser.spec
+++ b/chromium-browser.spec
@@ -19,6 +19,7 @@
 %bcond_without	system_libmtp	# system libmtp
 %bcond_without	system_libusb	# system libusb-1
 %bcond_without	system_libwebp	# system libwebp
+%bcond_without	system_libxnvctrl	# system libxnvctrl
 %bcond_without	system_minizip	# system minizip
 %bcond_without	system_opus		# system opus codec support, http://www.opus-codec.org/examples/
 %bcond_without	system_speex	# system speex
@@ -90,6 +91,7 @@ Patch6:		get-webkit_revision.patch
 Patch7:		dlopen_sonamed_gl.patch
 Patch8:		chromium_useragent.patch.in
 Patch9:		chromium-ppapi.patch
+Patch10:		system-libxnvctrl.patch
 # https://bugs.gentoo.org/show_bug.cgi?id=393471
 # libjpeg-turbo >= 1.1.90 supports that feature
 Patch11:	chromium-revert-jpeg-swizzle-r2.patch
@@ -137,6 +139,7 @@ BuildRequires:	libstdc++-devel
 %{?with_system_libusb:BuildRequires:	libusb-devel >= 1.0}
 %{?with_system_libvpx:BuildRequires:	libvpx-devel >= 0.9.5-2}
 %{?with_system_libwebp:BuildRequires:	libwebp-devel >= 0.1.99}
+%{?with_system_libxvnctrl:BuildRequires:	libXNVCtrl-devel >= 310.19}
 BuildRequires:	libxml2-devel
 BuildRequires:	libxslt-devel
 BuildRequires:	lzma
@@ -369,6 +372,7 @@ test -e Makefile || %{__python} build/gyp_chromium \
 	%{gyp_with system_libusb} \
 	%{gyp_with system_libvpx} \
 	%{gyp_with system_libwebp} \
+	%{gyp_with system_libxnvctrl} \
 	%{gyp_with system_minizip} \
 	%{gyp_with system_opus} \
 	%{gyp_with system_speex} \
diff --git a/system-libxnvctrl.patch b/system-libxnvctrl.patch
new file mode 100644
index 0000000..5d161a6
--- /dev/null
+++ b/system-libxnvctrl.patch
@@ -0,0 +1,68 @@
+--- chromium-browser-24.0.1312.45/src/third_party/libXNVCtrl/libXNVCtrl.gyp~	2013-01-04 00:45:32.000000000 +0200
++++ chromium-browser-24.0.1312.45/src/third_party/libXNVCtrl/libXNVCtrl.gyp	2013-01-04 00:45:35.620067292 +0200
+@@ -3,16 +3,54 @@
+ # found in the LICENSE file.
+ 
+ {
+-  'targets': [
+-    {
+-      'target_name': 'libXNVCtrl',
+-      'type': 'static_library',
+-      'sources': [
+-        'NVCtrl.c',
+-        'NVCtrl.h',
+-        'NVCtrlLib.h',
+-        'nv_control.h',
++  'variables': {
++    'use_system_libxnvctrl%': 0,
++  },
++  'conditions': [
++    ['use_system_libxnvctrl==0', {
++      'targets': [
++        {
++          'target_name': 'libXNVCtrl',
++          'type': 'static_library',
++          'sources': [
++            'NVCtrl.c',
++            'NVCtrl.h',
++            'NVCtrlLib.h',
++            'nv_control.h',
++          ],
++        },
+       ],
+-    },
+-  ],
++    }, { # use_system_libxnvctrl==1
++      'conditions': [
++        ['sysroot!=""', {
++          'variables': {
++            'pkg-config': '../../build/linux/pkg-config-wrapper "<(sysroot)" "<(target_arch)"',
++          },
++        }, {
++          'variables': {
++            'pkg-config': 'pkg-config'
++          },
++        }],
++      ],
++      'targets': [
++        {
++          'target_name': 'libXNVCtrl',
++          'type': 'none',
++          'direct_dependent_settings': {
++            'cflags': [
++                '<!@(<(pkg-config) --cflags libXNVCtrl)',
++            ],
++          },
++          'link_settings': {
++            'ldflags': [
++              '<!@(<(pkg-config) --libs-only-L --libs-only-other libXNVCtrl)',
++            ],
++            'libraries': [
++              '<!@(<(pkg-config) --libs-only-l libXNVCtrl)',
++            ],
++          },
++        }
++      ],
++    }],
++  ]
+ }
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/chromium-browser.git/commitdiff/4884fc995902450f6cd5512b71e22d5566e4448d



More information about the pld-cvs-commit mailing list