commit:     c774a4445fb38143628450af34608353efc1bd78
Author:     Aric Belsito <lluixhi <AT> gmail <DOT> com>
AuthorDate: Wed Nov 23 23:56:40 2016 +0000
Commit:     Michael Palimaka <kensington <AT> gentoo <DOT> org>
CommitDate: Tue Dec  6 06:54:11 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c774a444

dev-qt/qtwebengine: Fix on PaX kernels

Gentoo-Bug: 582558
Gentoo-Bug: 579712

 .../files/qtwebengine-paxmark-mksnapshot.patch     | 46 ++++++++++++++++++++++
 dev-qt/qtwebengine/metadata.xml                    |  1 +
 dev-qt/qtwebengine/qtwebengine-5.6.2.ebuild        | 13 +++++-
 dev-qt/qtwebengine/qtwebengine-5.7.0.ebuild        | 13 +++++-
 4 files changed, 69 insertions(+), 4 deletions(-)

diff --git a/dev-qt/qtwebengine/files/qtwebengine-paxmark-mksnapshot.patch 
b/dev-qt/qtwebengine/files/qtwebengine-paxmark-mksnapshot.patch
new file mode 100644
index 00000000..c71cedc
--- /dev/null
+++ b/dev-qt/qtwebengine/files/qtwebengine-paxmark-mksnapshot.patch
@@ -0,0 +1,46 @@
+--- 
qtwebengine-opensource-src-5.6.0-orig/src/3rdparty/chromium/v8/tools/gyp/v8.gyp 
   2016-03-04 01:48:36.000000000 +1100
++++ qtwebengine-opensource-src-5.6.0/src/3rdparty/chromium/v8/tools/gyp/v8.gyp 
2016-05-01 19:15:44.052770543 +1000
+@@ -33,6 +33,7 @@
+     'embed_script%': "",
+     'v8_extra_library_files%': [],
+     'mksnapshot_exec': 
'<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)mksnapshot<(EXECUTABLE_SUFFIX)',
++    'mksnapshot_u_exec': 
'<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)mksnapshot_u<(EXECUTABLE_SUFFIX)',
+     'remove_v8base_debug_symbols%': 0,
+   },
+   'includes': ['../../build/toolchain.gypi', '../../build/features.gypi'],
+@@ -1913,7 +1914,7 @@
+         ]
+     },
+     {
+-      'target_name': 'mksnapshot',
++      'target_name': 'mksnapshot_u',
+       'type': 'executable',
+       'dependencies': ['v8_base', 'v8_nosnapshot', 'v8_libplatform'],
+       'include_dirs+': [
+@@ -1936,5 +1937,26 @@
+         }],
+       ],
+     },
++    {
++      'target_name': 'mksnapshot',
++      'type': 'executable',
++      'dependencies': ['mksnapshot_u'],
++      'actions': [
++        {
++          'action_name': 'paxmark_m_mksnapshot',
++          'inputs': [
++            '<(mksnapshot_u_exec)',
++          ],
++          'outputs': [
++            '<(mksnapshot_exec)',
++          ],
++          'action': [
++            'sh',
++            '-c',
++            'cp <(mksnapshot_u_exec) <(mksnapshot_exec) && paxmark.sh m 
<(mksnapshot_exec)',
++          ],
++        },
++      ],
++    },
+   ],
+ }

diff --git a/dev-qt/qtwebengine/metadata.xml b/dev-qt/qtwebengine/metadata.xml
index 881cc17..9c08bb1 100644
--- a/dev-qt/qtwebengine/metadata.xml
+++ b/dev-qt/qtwebengine/metadata.xml
@@ -8,6 +8,7 @@
        <use>
                <flag name="geolocation">Enable physical position determination
                        via <pkg>dev-qt/qtpositioning</pkg></flag>
+               <flag name="pax_kernel">Enable building under a PaX enabled 
kernel</flag>
                <flag name="system-ffmpeg">Use the system-wide 
<pkg>media-video/ffmpeg</pkg>
                        instead of bundled.</flag>
                <flag name="system-icu">Use the system-wide 
<pkg>dev-libs/icu</pkg>

diff --git a/dev-qt/qtwebengine/qtwebengine-5.6.2.ebuild 
b/dev-qt/qtwebengine/qtwebengine-5.6.2.ebuild
index 38e8525..e7f210f 100644
--- a/dev-qt/qtwebengine/qtwebengine-5.6.2.ebuild
+++ b/dev-qt/qtwebengine/qtwebengine-5.6.2.ebuild
@@ -4,7 +4,7 @@
 
 EAPI=6
 PYTHON_COMPAT=( python2_7 )
-inherit python-any-r1 qt5-build
+inherit pax-utils python-any-r1 qt5-build
 
 DESCRIPTION="Library for rendering dynamic web content in Qt5 C++ and QML 
applications"
 
@@ -12,7 +12,7 @@ if [[ ${QT5_BUILD_TYPE} == release ]]; then
        KEYWORDS="~amd64 ~x86"
 fi
 
-IUSE="bindist geolocation +system-ffmpeg +system-icu widgets"
+IUSE="bindist geolocation pax_kernel +system-ffmpeg +system-icu widgets"
 
 RDEPEND="
        app-arch/snappy
@@ -68,9 +68,12 @@ DEPEND="${RDEPEND}
        dev-util/ninja
        dev-util/re2c
        sys-devel/bison
+       pax_kernel? ( sys-apps/elfix )
 "
 
 src_prepare() {
+       use pax_kernel && PATCHES+=( 
"${FILESDIR}/${PN}-paxmark-mksnapshot.patch" )
+
        if use system-icu; then
                # ensuire build against system headers - bug #601264
                rm -r src/3rdparty/chromium/third_party/icu/source || die
@@ -95,3 +98,9 @@ src_configure() {
        )
        qt5-build_src_configure
 }
+
+src_install() {
+       qt5-build_src_install
+
+       pax-mark m "${D%/}${QT5_LIBEXECDIR}"/QtWebEngineProcess
+}

diff --git a/dev-qt/qtwebengine/qtwebengine-5.7.0.ebuild 
b/dev-qt/qtwebengine/qtwebengine-5.7.0.ebuild
index 87c25c3..b8e0985 100644
--- a/dev-qt/qtwebengine/qtwebengine-5.7.0.ebuild
+++ b/dev-qt/qtwebengine/qtwebengine-5.7.0.ebuild
@@ -4,7 +4,7 @@
 
 EAPI=6
 PYTHON_COMPAT=( python2_7 )
-inherit python-any-r1 qt5-build
+inherit pax-utils python-any-r1 qt5-build
 
 DESCRIPTION="Library for rendering dynamic web content in Qt5 C++ and QML 
applications"
 
@@ -12,7 +12,7 @@ if [[ ${QT5_BUILD_TYPE} == release ]]; then
        KEYWORDS="~amd64 ~x86"
 fi
 
-IUSE="bindist geolocation +system-ffmpeg +system-icu widgets"
+IUSE="bindist geolocation pax_kernel +system-ffmpeg +system-icu widgets"
 
 RDEPEND="
        app-arch/snappy
@@ -68,6 +68,7 @@ DEPEND="${RDEPEND}
        dev-util/ninja
        dev-util/re2c
        sys-devel/bison
+       pax_kernel? ( sys-apps/elfix )
 "
 
 PATCHES=(
@@ -78,6 +79,8 @@ PATCHES=(
 )
 
 src_prepare() {
+       use pax_kernel && PATCHES+=( 
"${FILESDIR}/${PN}-paxmark-mksnapshot.patch" )
+
        if use system-icu; then
                # ensuire build against system headers - bug #601264
                rm -r src/3rdparty/chromium/third_party/icu/source || die
@@ -102,3 +105,9 @@ src_configure() {
        )
        qt5-build_src_configure
 }
+
+src_install() {
+       qt5-build_src_install
+
+       pax-mark m "${D%/}${QT5_LIBEXECDIR}"/QtWebEngineProcess
+}

Reply via email to