From 5f19f8726f156f4cd3b7d127397e160af9594912 Mon Sep 17 00:00:00 2001 From: Matteo Bernardini Date: Sat, 7 Dec 2019 20:10:05 +0100 Subject: 20191207.1 global branch merge. Signed-off-by: Matteo Bernardini --- libraries/vte2/README | 7 ++ libraries/vte2/fix_meta_alt_keybinding.patch | 74 ++++++++++++++++++ libraries/vte2/slack-desc | 19 +++++ libraries/vte2/vte.escape.cpu.usage.diff | 89 ++++++++++++++++++++++ libraries/vte2/vte2.SlackBuild | 109 +++++++++++++++++++++++++++ libraries/vte2/vte2.info | 10 +++ 6 files changed, 308 insertions(+) create mode 100644 libraries/vte2/README create mode 100644 libraries/vte2/fix_meta_alt_keybinding.patch create mode 100644 libraries/vte2/slack-desc create mode 100644 libraries/vte2/vte.escape.cpu.usage.diff create mode 100644 libraries/vte2/vte2.SlackBuild create mode 100644 libraries/vte2/vte2.info (limited to 'libraries/vte2') diff --git a/libraries/vte2/README b/libraries/vte2/README new file mode 100644 index 0000000000..4c78dea1a2 --- /dev/null +++ b/libraries/vte2/README @@ -0,0 +1,7 @@ +VTE2 is a terminal emulator widget for use with GTK+2. +This package contains the VTE library and development files and +a sample implementation (vte). + +This package can be installed side by side with vte included in +the default Slackware installation since this package is intended +for use with GTK+2. diff --git a/libraries/vte2/fix_meta_alt_keybinding.patch b/libraries/vte2/fix_meta_alt_keybinding.patch new file mode 100644 index 0000000000..bd364be584 --- /dev/null +++ b/libraries/vte2/fix_meta_alt_keybinding.patch @@ -0,0 +1,74 @@ +From 180dcc578e13c6096e277fb853e7162db640f207 Mon Sep 17 00:00:00 2001 +From: Alexandre Rostovtsev +Date: Tue, 15 Nov 2011 03:06:40 -0500 +Subject: [PATCH] Map both gdk's Meta and Alt to vte's Meta for >=gtk+-3.2.2 + compatibility + +Also, since VTE_META_MASK is now a mask with multiple bits set, code that +compares gdk key modifiers to VTE_META_MASK by numerical equality is no +longer guaranteed to work. Therefore, for such comparisons a new function, +vte_keymap_fixup_modifiers, is introduced; it ensures that if any bits +matching matching VTE_META_MASK are set, then all are set. + +https://bugzilla.gnome.org/show_bug.cgi?id=663779 +--- + src/keymap.c | 15 +++++++++++++-- + src/keymap.h | 2 +- + 2 files changed, 14 insertions(+), 3 deletions(-) + +diff --git a/src/keymap.c b/src/keymap.c +index 9a21669..95b4c5b 100644 +--- a/src/keymap.c ++++ b/src/keymap.c +@@ -990,6 +990,17 @@ static const struct _vte_keymap_group { + {GDK_KEY (F35), _vte_keymap_GDK_F35}, + }; + ++/* Restrict modifiers to the specified mask and ensure that VTE_META_MASK, ++ * despite being a compound mask, is treated as indivisible. */ ++GdkModifierType ++_vte_keymap_fixup_modifiers(GdkModifierType modifiers, ++ GdkModifierType mask) ++{ ++ if (modifiers & VTE_META_MASK) ++ modifiers |= VTE_META_MASK; ++ return modifiers & mask; ++} ++ + /* Map the specified keyval/modifier setup, dependent on the mode, to either + * a literal string or a capability name. */ + void +@@ -1104,7 +1115,7 @@ _vte_keymap_map(guint keyval, + } else { + fkey_mode = fkey_default; + } +- modifiers &= (GDK_SHIFT_MASK | GDK_CONTROL_MASK | VTE_META_MASK | VTE_NUMLOCK_MASK); ++ modifiers = _vte_keymap_fixup_modifiers(modifiers, GDK_SHIFT_MASK | GDK_CONTROL_MASK | VTE_META_MASK | VTE_NUMLOCK_MASK); + + /* Search for the conditions. */ + for (i = 0; entries[i].normal_length || entries[i].special[0]; i++) +@@ -1375,7 +1386,7 @@ _vte_keymap_key_add_key_modifiers(guint keyval, + return; + } + +- switch (modifiers & significant_modifiers) { ++ switch (_vte_keymap_fixup_modifiers(modifiers, significant_modifiers)) { + case 0: + modifier = 0; + break; +diff --git a/src/keymap.h b/src/keymap.h +index 243e22e..21d9b8e 100644 +--- a/src/keymap.h ++++ b/src/keymap.h +@@ -27,7 +27,7 @@ + + G_BEGIN_DECLS + +-#define VTE_META_MASK GDK_META_MASK ++#define VTE_META_MASK (GDK_META_MASK | GDK_MOD1_MASK) + #define VTE_NUMLOCK_MASK GDK_MOD2_MASK + + /* Map the specified keyval/modifier setup, dependent on the mode, to either +-- +1.7.8.rc3 + diff --git a/libraries/vte2/slack-desc b/libraries/vte2/slack-desc new file mode 100644 index 0000000000..1c583a507c --- /dev/null +++ b/libraries/vte2/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +vte2: vte2 (gtk+2 terminal emulator widget) +vte2: +vte2: VTE2 is a terminal emulator widget for use with GTK+2. This package +vte2: contains the VTE library and development files and a sample +vte2: implementation (vte). +vte2: +vte2: homepage: https://github.com/GNOME/vte +vte2: +vte2: +vte2: +vte2: diff --git a/libraries/vte2/vte.escape.cpu.usage.diff b/libraries/vte2/vte.escape.cpu.usage.diff new file mode 100644 index 0000000000..e82cf46877 --- /dev/null +++ b/libraries/vte2/vte.escape.cpu.usage.diff @@ -0,0 +1,89 @@ +--- ./src/table.c.orig 2011-08-16 16:52:48.000000000 -0500 ++++ ./src/table.c 2012-08-08 21:25:15.080344805 -0500 +@@ -550,7 +550,7 @@ + if (G_UNLIKELY (*array == NULL)) { + *array = g_value_array_new(1); + } +- g_value_set_long(&value, total); ++ g_value_set_long(&value, CLAMP (total, 0, G_MAXUSHORT)); + g_value_array_append(*array, &value); + } while (i++ < arginfo->length); + g_value_unset(&value); +--- ./src/vteseq.c.orig 2011-08-16 16:52:48.000000000 -0500 ++++ ./src/vteseq.c 2012-08-08 21:25:15.104344804 -0500 +@@ -557,7 +557,7 @@ + GValueArray *params, + VteTerminalSequenceHandler handler) + { +- vte_sequence_handler_multiple_limited(terminal, params, handler, G_MAXLONG); ++ vte_sequence_handler_multiple_limited(terminal, params, handler, G_MAXUSHORT); + } + + static void +@@ -1392,7 +1392,7 @@ + static void + vte_sequence_handler_DC (VteTerminal *terminal, GValueArray *params) + { +- vte_sequence_handler_multiple(terminal, params, vte_sequence_handler_dc); ++ vte_sequence_handler_multiple_r(terminal, params, vte_sequence_handler_dc); + } + + /* Delete a line at the current cursor position. */ +@@ -1785,7 +1785,7 @@ + static void + vte_sequence_handler_RI (VteTerminal *terminal, GValueArray *params) + { +- vte_sequence_handler_multiple(terminal, params, vte_sequence_handler_nd); ++ vte_sequence_handler_multiple_r(terminal, params, vte_sequence_handler_nd); + } + + /* Save cursor (position). */ +@@ -2777,8 +2777,7 @@ + { + GValue *value; + VteScreen *screen; +- long param, end, row; +- int i; ++ long param, end, row, i, limit; + screen = terminal->pvt->screen; + /* The default is one. */ + param = 1; +@@ -2796,7 +2795,13 @@ + } else { + end = screen->insert_delta + terminal->row_count - 1; + } +- /* Insert the new lines at the cursor. */ ++ ++ /* Only allow to insert as many lines as there are between this row ++ * and the end of the scrolling region. See bug #676090. ++ */ ++ limit = end - row + 1; ++ param = MIN (param, limit); ++ + for (i = 0; i < param; i++) { + /* Clear a line off the end of the region and add one to the + * top of the region. */ +@@ -2817,8 +2822,7 @@ + { + GValue *value; + VteScreen *screen; +- long param, end, row; +- int i; ++ long param, end, row, i, limit; + + screen = terminal->pvt->screen; + /* The default is one. */ +@@ -2837,6 +2841,13 @@ + } else { + end = screen->insert_delta + terminal->row_count - 1; + } ++ ++ /* Only allow to delete as many lines as there are between this row ++ * and the end of the scrolling region. See bug #676090. ++ */ ++ limit = end - row + 1; ++ param = MIN (param, limit); ++ + /* Clear them from below the current cursor. */ + for (i = 0; i < param; i++) { + /* Insert a line at the end of the region and remove one from diff --git a/libraries/vte2/vte2.SlackBuild b/libraries/vte2/vte2.SlackBuild new file mode 100644 index 0000000000..8d137f0f6d --- /dev/null +++ b/libraries/vte2/vte2.SlackBuild @@ -0,0 +1,109 @@ +#!/bin/sh + +# Slackware build script for vte2 + +# Copyright 2017 Matteo Bernardini +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PRGNAM=vte2 +SRCNAM=vte +VERSION=${VERSION:-0.28.2} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $SRCNAM-$VERSION +tar xvf $CWD/$SRCNAM-$VERSION.tar.?z* +cd $SRCNAM-$VERSION +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +# https://bugzilla.gnome.org/show_bug.cgi?id=663779 +patch -p1 < $CWD/fix_meta_alt_keybinding.patch + +# Escape sequences can cause high CPU usage (CVE-2012-2738): +patch -p1 < $CWD/vte.escape.cpu.usage.diff + +CFLAGS="$SLKCFLAGS" \ +./configure \ + --prefix=/usr \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --sysconfdir=/etc \ + --mandir=/usr/man \ + --docdir=/usr/doc/$PRGNAM-$VERSION \ + --disable-static \ + --disable-introspection \ + --enable-python \ + --enable-gnome-pty-helper \ + --with-gtk=2.0 \ + --with-default-emulation=xterm \ + --build=$ARCH-slackware-linux + +make +make install DESTDIR=$PKG + +find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a AUTHORS COPYING HACKING MAINTAINERS NEWS README* $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} + diff --git a/libraries/vte2/vte2.info b/libraries/vte2/vte2.info new file mode 100644 index 0000000000..2ed7a7f4f6 --- /dev/null +++ b/libraries/vte2/vte2.info @@ -0,0 +1,10 @@ +PRGNAM="vte2" +VERSION="0.28.2" +HOMEPAGE="https://github.com/GNOME/vte" +DOWNLOAD="http://ftp.gnome.org/pub/gnome/sources/vte/0.28/vte-0.28.2.tar.xz" +MD5SUM="497f26e457308649e6ece32b3bb142ff" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="Matteo Bernardini" +EMAIL="ponce@slackbuilds.org" -- cgit v1.2.3