GNU bug report logs - #53750
[PATCH] gnu: openbox: Build with Python 3.

Previous Next

Package: guix-patches;

Reported by: Vinicius Monego <monego <at> posteo.net>

Date: Thu, 3 Feb 2022 15:18:01 UTC

Severity: normal

Tags: patch

Merged with 53394

Done: Vinicius Monego <monego <at> posteo.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 53750 in the body.
You can then email your comments to 53750 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#53750; Package guix-patches. (Thu, 03 Feb 2022 15:18:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Vinicius Monego <monego <at> posteo.net>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Thu, 03 Feb 2022 15:18:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Vinicius Monego <monego <at> posteo.net>
To: guix-patches <at> gnu.org
Cc: Vinicius Monego <monego <at> posteo.net>
Subject: [PATCH] gnu: openbox: Build with Python 3.
Date: Thu,  3 Feb 2022 15:17:12 +0000
* gnu/packages/openbox.scm (openbox): Build with Python 3.
[source]: Make some cosmetic changes. Add patch.
[inputs]: Replace python with python-wrapper.
[propagated-inputs]: Replace python2-xdg with python-xdg.
* gnu/packages/patches/openbox-build-with-python3.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
---
 gnu/local.mk                                  |   3 +-
 gnu/packages/openbox.scm                      |  23 +--
 .../patches/openbox-build-with-python3.patch  | 162 ++++++++++++++++++
 3 files changed, 177 insertions(+), 11 deletions(-)
 create mode 100644 gnu/packages/patches/openbox-build-with-python3.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index dddda78efa..fd03d1b8cf 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -38,7 +38,7 @@
 # Copyright © 2020 Tanguy Le Carrour <tanguy <at> bioneland.org>
 # Copyright © 2020 Martin Becze <mjbecze <at> riseup.net>
 # Copyright © 2020 Malte Frank Gerdes <mate.f.gerdes <at> gmail.com>
-# Copyright © 2020 Vinicius Monego <monego <at> posteo.net>
+# Copyright © 2020, 2022 Vinicius Monego <monego <at> posteo.net>
 # Copyright © 2021 Björn Höfling <bjoern.hoefling <at> bjoernhoefling.de>
 # Copyright © 2021 Greg Hogan <code <at> greghogan.com>
 # Copyright © 2021 Philip McGrath <philip <at> philipmcgrath.com>
@@ -1571,6 +1571,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/onnx-shared-libraries.patch	\
   %D%/packages/patches/onnx-skip-model-downloads.patch		\
   %D%/packages/patches/openbabel-fix-crash-on-nwchem-output.patch	\
+  %D%/packages/patches/openbox-build-with-python3.patch	\
   %D%/packages/patches/opencascade-oce-glibc-2.26.patch		\
   %D%/packages/patches/openfoam-4.1-cleanup.patch			\
   %D%/packages/patches/openjdk-10-idlj-reproducibility.patch	\
diff --git a/gnu/packages/openbox.scm b/gnu/packages/openbox.scm
index 873592c19e..40288aa72c 100644
--- a/gnu/packages/openbox.scm
+++ b/gnu/packages/openbox.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2014 Julien Lepiller <julien <at> lepiller.eu>
 ;;; Copyright © 2016 Efraim Flashner <efraim <at> flashner.co.il>
 ;;; Copyright © 2017 Nikita <nikita <at> n0.is>
+;;; Copyright © 2022 Vinicius Monego <monego <at> posteo.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -24,6 +25,7 @@
   #:use-module (guix download)
   #:use-module (guix utils)
   #:use-module (guix build-system gnu)
+  #:use-module (gnu packages)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages gnome)
@@ -39,17 +41,18 @@
   (package
     (name "openbox")
     (version "3.6.1")
-    (source (origin
-              (method url-fetch)
-              (uri (string-append
-                    "http://openbox.org/dist/openbox/" name "-"
-                    version ".tar.xz"))
-              (sha256
-               (base32
-                "0vg2y1qddsdxkjv806mzpvmkgzliab8ll4s7zm7ma5jnriamirxb"))))
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "http://openbox.org/dist/openbox/" name "-"
+             version ".tar.xz"))
+       (patches (search-patches "openbox-build-with-python3.patch"))
+       (sha256
+        (base32 "0vg2y1qddsdxkjv806mzpvmkgzliab8ll4s7zm7ma5jnriamirxb"))))
     (build-system gnu-build-system)
     (native-inputs (list pkg-config))
-    (propagated-inputs (list python2-pyxdg))
+    (propagated-inputs (list python-pyxdg))
     (inputs (list imlib2
                   libxml2
                   (librsvg-for-system)
@@ -60,7 +63,7 @@
                   libxrandr
                   libxft
                   pango
-                  python-2))
+                  python-wrapper))
     (synopsis "Box style window manager")
     (description
      "Openbox is a highly configurable, next generation window manager with
diff --git a/gnu/packages/patches/openbox-build-with-python3.patch b/gnu/packages/patches/openbox-build-with-python3.patch
new file mode 100644
index 0000000000..29682a18f1
--- /dev/null
+++ b/gnu/packages/patches/openbox-build-with-python3.patch
@@ -0,0 +1,162 @@
+From acfbbc4ea40932f183617bb7006700140fe5f61e Mon Sep 17 00:00:00 2001
+From: Troy Curtis Jr <troycurtisjr <at> gmail.com>
+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 chosen python at build time.
+
+https://bugzilla.icculus.org/show_bug.cgi?id=6444
+---
+Patch imported from Debian: https://sources.debian.org/src/openbox/3.6.1-10/debian/patches/python3.patch/ with the following change: don't rename data/autostart/openbox-xdg-autostart to data/autostart/openbox-xdg-autostart.in.
+
+ .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
+index 04a17a199..3c365b112 100755
+--- a/data/autostart/openbox-xdg-autostart
++++ b/data/autostart/openbox-xdg-autostart
+@@ -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())
-- 
2.30.2





Merged 53394 53750. Request was from Leo Famulari <leo <at> famulari.name> to control <at> debbugs.gnu.org. (Thu, 03 Feb 2022 16:15:02 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#53750; Package guix-patches. (Fri, 04 Feb 2022 18:33:01 GMT) Full text and rfc822 format available.

Message #10 received at 53750 <at> debbugs.gnu.org (full text, mbox):

From: Leo Famulari <leo <at> famulari.name>
To: Vinicius Monego <monego <at> posteo.net>
Cc: 53750 <at> debbugs.gnu.org
Subject: Re: [bug#53750] [PATCH] gnu: openbox: Build with Python 3.
Date: Fri, 4 Feb 2022 13:32:17 -0500
On Thu, Feb 03, 2022 at 03:17:12PM +0000, Vinicius Monego wrote:
> * gnu/packages/openbox.scm (openbox): Build with Python 3.
> [source]: Make some cosmetic changes. Add patch.
> [inputs]: Replace python with python-wrapper.
> [propagated-inputs]: Replace python2-xdg with python-xdg.
> * gnu/packages/patches/openbox-build-with-python3.patch: New file.
> * gnu/local.mk (dist_patch_DATA): Add it.

Thanks! You might have noticed that I merged this patch ticket with my
own similar contribution at <https://issues.guix.gnu.org/53394>.

I missed the python2-xdg change in my patch, and I also did not replace
python with python-wrapper. Is the latter change necessary?

> +From acfbbc4ea40932f183617bb7006700140fe5f61e Mon Sep 17 00:00:00 2001
> +From: Troy Curtis Jr <troycurtisjr <at> gmail.com>
> +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 chosen python at build time.
> +
> +https://bugzilla.icculus.org/show_bug.cgi?id=6444
> +---
> +Patch imported from Debian: https://sources.debian.org/src/openbox/3.6.1-10/debian/patches/python3.patch/ with the following change: don't rename data/autostart/openbox-xdg-autostart to data/autostart/openbox-xdg-autostart.in.

Is this note about "Patch imported from Debian" written by you?

We always try to give links to the source of patches, as well as a note
that explains the context of the patch and a link to any discussions
within Guix.

So, the patch file should start with something like this:

------
Make Openbox compatible with Python 2:

https://issues.guix.gnu.org/53750

Openbox seems to be abandoned upstream, with no activity in their Git repo since
2015:

http://openbox.org/develop-git.php

Patch copied from XXX:

https://example.com/
------




Information forwarded to guix-patches <at> gnu.org:
bug#53750; Package guix-patches. (Sun, 06 Feb 2022 17:55:02 GMT) Full text and rfc822 format available.

Message #13 received at 53750 <at> debbugs.gnu.org (full text, mbox):

From: Vinicius Monego <monego <at> posteo.net>
To: Leo Famulari <leo <at> famulari.name>
Cc: 53750 <at> debbugs.gnu.org
Subject: Re: [bug#53750] [PATCH] gnu: openbox: Build with Python 3.
Date: Sun, 06 Feb 2022 17:53:57 +0000
Em sex, 2022-02-04 às 13:32 -0500, Leo Famulari escreveu:
> On Thu, Feb 03, 2022 at 03:17:12PM +0000, Vinicius Monego wrote:
> > * gnu/packages/openbox.scm (openbox): Build with Python 3.
> > [source]: Make some cosmetic changes. Add patch.
> > [inputs]: Replace python with python-wrapper.
> > [propagated-inputs]: Replace python2-xdg with python-xdg.
> > * gnu/packages/patches/openbox-build-with-python3.patch: New file.
> > * gnu/local.mk (dist_patch_DATA): Add it.
> 
> Thanks! You might have noticed that I merged this patch ticket with
> my
> own similar contribution at <https://issues.guix.gnu.org/53394>.
> 

Oh I didn't see that one!

> I missed the python2-xdg change in my patch, and I also did not
> replace
> python with python-wrapper. Is the latter change necessary?
> 

I use the wrapper because it is more failproof with calling the correct
interpreter. The autostart header begins with:

#!@PYTHON@

Not a direct call the path in the store, don't know if it would work
with only python.

> > +From acfbbc4ea40932f183617bb7006700140fe5f61e Mon Sep 17 00:00:00
> > 2001
> > +From: Troy Curtis Jr <troycurtisjr <at> gmail.com>
> > +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 chosen python at build
> > time.
> > +
> > +https://bugzilla.icculus.org/show_bug.cgi?id=6444
> > +---
> > +Patch imported from Debian:    
> > https://sources.debian.org/src/openbox/3.6.1-10/debian/patches/python3.patch/
> >  with the following change: don't rename data/autostart/openbox-
> > xdg-autostart to data/autostart/openbox-xdg-autostart.in.
> 
> Is this note about "Patch imported from Debian" written by you?
> 

Yes, that is my own comment.

> We always try to give links to the source of patches, as well as a
> note
> that explains the context of the patch and a link to any discussions
> within Guix.
> 
> So, the patch file should start with something like this:
> 
> ------
> Make Openbox compatible with Python 2:
> 
> https://issues.guix.gnu.org/53750
> 
> Openbox seems to be abandoned upstream, with no activity in their Git
> repo since
> 2015:
> 
> http://openbox.org/develop-git.php
> 
> Patch copied from XXX:
> 
> https://example.com/
> ------

Thanks for the suggestion. I'll check the other issue.





Reply sent to Vinicius Monego <monego <at> posteo.net>:
You have taken responsibility. (Sun, 21 Aug 2022 22:12:02 GMT) Full text and rfc822 format available.

Notification sent to Vinicius Monego <monego <at> posteo.net>:
bug acknowledged by developer. (Sun, 21 Aug 2022 22:12:02 GMT) Full text and rfc822 format available.

Message #18 received at 53750-done <at> debbugs.gnu.org (full text, mbox):

From: Vinicius Monego <monego <at> posteo.net>
To: 53750-done <at> debbugs.gnu.org
Subject: [PATCH] gnu: openbox: Build with Python 3.
Date: Sun, 21 Aug 2022 22:11:19 +0000
A similar patch was pushed in f451a8e80cf8d2da08bb65c4c07e3d41d7a17e58.
Closing.




Reply sent to Vinicius Monego <monego <at> posteo.net>:
You have taken responsibility. (Sun, 21 Aug 2022 22:12:02 GMT) Full text and rfc822 format available.

Notification sent to Leo Famulari <leo <at> famulari.name>:
bug acknowledged by developer. (Sun, 21 Aug 2022 22:12:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 19 Sep 2022 11:24:11 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 210 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.