From bba9306e4ac646d8fe96e7e3b7994f5933fec309 Mon Sep 17 00:00:00 2001 From: EnumDev Date: Sun, 12 Oct 2025 11:28:19 +0300 Subject: [PATCH] Add patches --- pkg.info | 23 ++++- source-files/debian-887908.patch | 31 ++++++ source-files/kde-paths.patch | 22 ++++ source-files/python3.patch | 163 ++++++++++++++++++++++++++++++ source-files/title-matching.patch | 11 ++ source-files/which.patch | 11 ++ source.sh | 20 ++-- 7 files changed, 268 insertions(+), 13 deletions(-) create mode 100644 source-files/debian-887908.patch create mode 100644 source-files/kde-paths.patch create mode 100644 source-files/python3.patch create mode 100644 source-files/title-matching.patch create mode 100644 source-files/which.patch diff --git a/pkg.info b/pkg.info index dfce261..e5ef523 100644 --- a/pkg.info +++ b/pkg.info @@ -1,10 +1,27 @@ name: openbox description: A minimalistic, highly configurable, next generation window manager with extensive standards support version: 3.6.1 +revision: 2 url: http://openbox.org/ license: GPL2 architecture: any -depends: ["imlib2","librsvg","libsm","libxcursor","libxinerama","libxml2","libxrandr","pango","startup-notification"] -optional_depends: ["python-pyxdg"] -make_depends: ["python-pyxdg"] type: source +depends: + - imlib2 + - librsvg + - libsm + - libxcursor + - libxinerama + - libxml2 + - libxrandr + - pango + - startup-notification +optional_depends: + - python-pyxdg +make_depends: + - python-pyxdg +downloads: + - url: http://openbox.org/dist/openbox/openbox-${BPM_PKG_VERSION}.tar.gz + extract_to: ${BPM_SOURCE} + extract_strip_components: 1 + checksum: 8b4ac0760018c77c0044fab06a4f0c510ba87eae934d9983b10878483bde7ef7 diff --git a/source-files/debian-887908.patch b/source-files/debian-887908.patch new file mode 100644 index 0000000..2c8794e --- /dev/null +++ b/source-files/debian-887908.patch @@ -0,0 +1,31 @@ +Description: Fix toggled hover and pressed images masks not loaded +Author: "E. Serradilla" +Debian-Bugs: https://bugs.debian.org/887908 + +--- a/obrender/theme.c ++++ b/obrender/theme.c +@@ -1494,8 +1494,10 @@ static void read_button_styles(XrmDataba + READ_BUTTON_MASK_COPY(disabled, btn->unpressed_mask); + READ_BUTTON_MASK_COPY(hover, btn->unpressed_mask); + if (toggled_mask) { +- READ_BUTTON_MASK_COPY(pressed_toggled, btn->unpressed_toggled_mask); +- READ_BUTTON_MASK_COPY(hover_toggled, btn->unpressed_toggled_mask); ++ g_snprintf(name, 128, "%s_toggled_pressed.xbm", btnname); ++ READ_MASK_COPY(name, btn->pressed_toggled_mask, btn->unpressed_toggled_mask); ++ g_snprintf(name, 128, "%s_toggled_hover.xbm", btnname); ++ READ_MASK_COPY(name, btn->hover_toggled_mask, btn->unpressed_toggled_mask); + } + + #define READ_BUTTON_APPEARANCE(typedots, type, fallback) \ +@@ -1532,8 +1534,8 @@ static void read_button_styles(XrmDataba + READ_BUTTON_APPEARANCE("disabled", disabled, 0); + READ_BUTTON_APPEARANCE("hover", hover, 0); + if (toggled_mask) { +- READ_BUTTON_APPEARANCE("unpressed.toggled", unpressed_toggled, 1); +- READ_BUTTON_APPEARANCE("pressed.toggled", pressed_toggled, 0); +- READ_BUTTON_APPEARANCE("hover.toggled", hover_toggled, 0); ++ READ_BUTTON_APPEARANCE("toggled.unpressed", unpressed_toggled, 1); ++ READ_BUTTON_APPEARANCE("toggled.pressed", pressed_toggled, 0); ++ READ_BUTTON_APPEARANCE("toggled.hover", hover_toggled, 0); + } + } diff --git a/source-files/kde-paths.patch b/source-files/kde-paths.patch new file mode 100644 index 0000000..249af1f --- /dev/null +++ b/source-files/kde-paths.patch @@ -0,0 +1,22 @@ +diff --git a/data/xsession/openbox-kde-session.in b/data/xsession/openbox-kde-session.in +index 35722796..ee91c16f 100644 +--- a/data/xsession/openbox-kde-session.in ++++ b/data/xsession/openbox-kde-session.in +@@ -17,4 +17,4 @@ xprop -root -remove _NET_NUMBER_OF_DESKTOPS \ + + # Run KDE with Openbox as its window manager + export KDEWM="@bindir@/openbox" +-exec startkde "$@" ++exec /usr/bin/startplasma-x11 "$@" +diff --git a/data/xsession/openbox-kde.desktop.in b/data/xsession/openbox-kde.desktop.in +index bc78a97c..a9bcc219 100644 +--- a/data/xsession/openbox-kde.desktop.in ++++ b/data/xsession/openbox-kde.desktop.in +@@ -2,6 +2,6 @@ + Name=KDE/Openbox + Comment=Use the Openbox window manager inside of the K Desktop Environment + Exec=@bindir@/openbox-kde-session +-TryExec=startkde ++TryExec=/usr/bin/startplasma-x11 + Icon=openbox + Type=Application diff --git a/source-files/python3.patch b/source-files/python3.patch new file mode 100644 index 0000000..60c11dc --- /dev/null +++ b/source-files/python3.patch @@ -0,0 +1,163 @@ +From acfbbc4ea40932f183617bb7006700140fe5f61e Mon Sep 17 00:00:00 2001 +From: Troy Curtis Jr +Date: Wed, 13 Sep 2017 21:59:48 -0500 +Subject: [PATCH] Add python3 support to openbox-xdg-autostart. + +Updated syntax in openbox-xdg-autostart to support both python2 and +python3. + +Added a configure substitution to set the choosen python at build time. + +https://bugzilla.icculus.org/show_bug.cgi?id=6444 +--- + .gitignore | 1 + + configure.ac | 3 + + ...xdg-autostart => openbox-xdg-autostart.in} | 70 +++++++++---------- + 3 files changed, 38 insertions(+), 36 deletions(-) + rename data/autostart/{openbox-xdg-autostart => openbox-xdg-autostart.in} (77%) + +diff --git a/configure.ac b/configure.ac +index ca1602670..9a31e9845 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -103,6 +103,8 @@ AC_CHECK_HEADERS(ctype.h dirent.h errno.h fcntl.h grp.h locale.h pwd.h) + AC_CHECK_HEADERS(signal.h string.h stdio.h stdlib.h unistd.h sys/stat.h) + AC_CHECK_HEADERS(sys/select.h sys/socket.h sys/time.h sys/types.h sys/wait.h) + ++AM_PATH_PYTHON([2],,) ++ + AC_PATH_PROG([SED], [sed], [no]) + if test "$SED" = "no"; then + AC_MSG_ERROR([The program "sed" is not available. This program is required to build Openbox.]) +@@ -259,6 +261,7 @@ AC_CONFIG_FILES([ + obrender/version.h + obt/version.h + version.h ++ data/autostart/openbox-xdg-autostart + ]) + AC_CONFIG_COMMANDS([doc], + [test -d doc || mkdir doc]) +diff --git a/data/autostart/openbox-xdg-autostart b/data/autostart/openbox-xdg-autostart.in +similarity index 77% +rename from data/autostart/openbox-xdg-autostart +rename to data/autostart/openbox-xdg-autostart.in +index 04a17a199..3c365b112 100755 +--- a/data/autostart/openbox-xdg-autostart ++++ b/data/autostart/openbox-xdg-autostart.in +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!@PYTHON@ + + # openbox-xdg-autostart runs things based on the XDG autostart specification + # Copyright (C) 2008 Dana Jansens +@@ -28,9 +28,7 @@ try: + from xdg.DesktopEntry import DesktopEntry + from xdg.Exceptions import ParsingError + except ImportError: +- print +- print >>sys.stderr, "ERROR:", ME, "requires PyXDG to be installed" +- print ++ sys.stderr.write("\nERROR: %s requires PyXDG to be installed\n" % ME) + sys.exit(1) + + def main(argv=sys.argv): +@@ -51,7 +49,7 @@ def main(argv=sys.argv): + try: + autofile = AutostartFile(path) + except ParsingError: +- print "Invalid .desktop file: " + path ++ print("Invalid .desktop file: " + path) + else: + if not autofile in files: + files.append(autofile) +@@ -99,9 +97,9 @@ class AutostartFile: + + def _alert(self, str, info=False): + if info: +- print "\t ", str ++ print("\t ", str) + else: +- print "\t*", str ++ print("\t*", str) + + def _showInEnvironment(self, envs, verbose=False): + default = not self.de.getOnlyShowIn() +@@ -146,14 +144,14 @@ class AutostartFile: + + def display(self, envs): + if self._shouldRun(envs): +- print "[*] " + self.de.getName() ++ print("[*] " + self.de.getName()) + else: +- print "[ ] " + self.de.getName() ++ print("[ ] " + self.de.getName()) + self._alert("File: " + self.path, info=True) + if self.de.getExec(): + self._alert("Executes: " + self.de.getExec(), info=True) + self._shouldRun(envs, True) +- print ++ print() + + def run(self, envs): + here = os.getcwd() +@@ -165,34 +163,34 @@ class AutostartFile: + os.chdir(here) + + def show_help(): +- print "Usage:", ME, "[OPTION]... [ENVIRONMENT]..." +- print +- print "This tool will run xdg autostart .desktop files" +- print +- print "OPTIONS" +- print " --list Show a list of the files which would be run" +- print " Files which would be run are marked with an asterix" +- print " symbol [*]. For files which would not be run," +- print " information is given for why they are excluded" +- print " --help Show this help and exit" +- print " --version Show version and copyright information" +- print +- print "ENVIRONMENT specifies a list of environments for which to run autostart" +- print "applications. If none are specified, only applications which do not " +- print "limit themselves to certain environments will be run." +- print +- print "ENVIRONMENT can be one or more of:" +- print " GNOME Gnome Desktop" +- print " KDE KDE Desktop" +- print " ROX ROX Desktop" +- print " XFCE XFCE Desktop" +- print " Old Legacy systems" +- print ++ print("Usage:", ME, "[OPTION]... [ENVIRONMENT]...") ++ print() ++ print("This tool will run xdg autostart .desktop files") ++ print() ++ print("OPTIONS") ++ print(" --list Show a list of the files which would be run") ++ print(" Files which would be run are marked with an asterix") ++ print(" symbol [*]. For files which would not be run,") ++ print(" information is given for why they are excluded") ++ print(" --help Show this help and exit") ++ print(" --version Show version and copyright information") ++ print() ++ print("ENVIRONMENT specifies a list of environments for which to run autostart") ++ print("applications. If none are specified, only applications which do not ") ++ print("limit themselves to certain environments will be run.") ++ print() ++ print("ENVIRONMENT can be one or more of:") ++ print(" GNOME Gnome Desktop") ++ print(" KDE KDE Desktop") ++ print(" ROX ROX Desktop") ++ print(" XFCE XFCE Desktop") ++ print(" Old Legacy systems") ++ print() + + def show_version(): +- print ME, VERSION +- print "Copyright (c) 2008 Dana Jansens" +- print ++ print(ME, VERSION) ++ print("Copyright (c) 2008 Dana Jansens") ++ print() + + if __name__ == "__main__": + sys.exit(main()) diff --git a/source-files/title-matching.patch b/source-files/title-matching.patch new file mode 100644 index 0000000..fdfe28a --- /dev/null +++ b/source-files/title-matching.patch @@ -0,0 +1,11 @@ +--- openbox-3.5.0/openbox/client.c 2011-08-01 22:14:58.000000000 +0200 ++++ openbox-3.5.0/openbox/client.c 2011-10-22 14:59:56.000000000 +0200 +@@ -883,7 +883,7 @@ + !g_pattern_match(app->role, + strlen(self->role), self->role, NULL)) + match = FALSE; +- else if (app->title && ++ else if (app->title && self->title && + !g_pattern_match(app->title, + strlen(self->title), self->title, NULL)) + match = FALSE; diff --git a/source-files/which.patch b/source-files/which.patch new file mode 100644 index 0000000..f947d6a --- /dev/null +++ b/source-files/which.patch @@ -0,0 +1,11 @@ +--- openbox-3.5.0/data/autostart/autostart.in~ 2011-08-02 15:50:01.963531310 +0000 ++++ openbox-3.5.0/data/autostart/autostart.in 2011-08-02 15:51:57.277879458 +0000 +@@ -8,7 +8,7 @@ + # + #if test -x @libexecdir@/gnome-settings-daemon >/dev/null; then + # @libexecdir@/gnome-settings-daemon & +-#elif which gnome-settings-daemon >/dev/null; then ++#elif which gnome-settings-daemon >/dev/null 2>&1; then + # gnome-settings-daemon & + #fi + diff --git a/source.sh b/source.sh index f6d7f63..86b1338 100644 --- a/source.sh +++ b/source.sh @@ -2,24 +2,23 @@ # BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE # BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT -DOWNLOAD="http://openbox.org/dist/openbox/openbox-${BPM_PKG_VERSION}.tar.gz" -FILENAME="${DOWNLOAD##*/}" - # The prepare function is executed in the root of the temp directory -# This function is used for downloading files and putting them into the correct location +# This function is used for putting downloaded files to the correct location or applying patches prepare() { - wget "$DOWNLOAD" - tar -xvf "$FILENAME" --strip-components=1 -C "$BPM_SOURCE" - - # Convert a script to Python 3 cd "$BPM_SOURCE" - 2to3-3.12 -w data/autostart/openbox-xdg-autostart + # Apply patches + for patch in "$BPM_WORKDIR"/*.patch; do + patch -Np1 -i "$patch" + done + + autoreconf -fi } # The build function is executed in the source directory # This function is used to compile the source code build() { - ./configure --prefix=/usr --sysconfdir=/etc --disable-static + ./configure --prefix=/usr --sysconfdir=/etc --disable-static --with-x --with-startup-notification + make } @@ -31,5 +30,6 @@ package() { # Remove additional sessions for DEs with currently non-existent packages rm "$BPM_OUTPUT"/usr/share/xsessions/openbox-{gnome,kde}.desktop + # Install package license install -Dm644 COPYING "$BPM_OUTPUT"/usr/share/licenses/openbox/COPYING }