From patchwork Thu Feb 3 15:17:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vinicius Monego X-Patchwork-Id: 36957 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 3C21127BBEA; Thu, 3 Feb 2022 15:19:27 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 0EFEC27BBE9 for ; Thu, 3 Feb 2022 15:19:26 +0000 (GMT) Received: from localhost ([::1]:41692 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nFdtN-0006Hn-3d for patchwork@mira.cbaines.net; Thu, 03 Feb 2022 10:19:25 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47930) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nFds2-0005u8-Mi for guix-patches@gnu.org; Thu, 03 Feb 2022 10:18:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:35273) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nFds2-00074V-21 for guix-patches@gnu.org; Thu, 03 Feb 2022 10:18:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nFds1-0004sq-Ku for guix-patches@gnu.org; Thu, 03 Feb 2022 10:18:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53750] [PATCH] gnu: openbox: Build with Python 3. Resent-From: Vinicius Monego Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 03 Feb 2022 15:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 53750 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 53750@debbugs.gnu.org Cc: Vinicius Monego X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.164390147718760 (code B ref -1); Thu, 03 Feb 2022 15:18:01 +0000 Received: (at submit) by debbugs.gnu.org; 3 Feb 2022 15:17:57 +0000 Received: from localhost ([127.0.0.1]:57403 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nFdro-0004sN-5U for submit@debbugs.gnu.org; Thu, 03 Feb 2022 10:17:57 -0500 Received: from lists.gnu.org ([209.51.188.17]:42686) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nFdrf-0004s8-In for submit@debbugs.gnu.org; Thu, 03 Feb 2022 10:17:47 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47856) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nFdre-0005TG-Dq for guix-patches@gnu.org; Thu, 03 Feb 2022 10:17:39 -0500 Received: from mout01.posteo.de ([185.67.36.65]:39379) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nFdra-000723-3R for guix-patches@gnu.org; Thu, 03 Feb 2022 10:17:38 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 00B72240027 for ; Thu, 3 Feb 2022 16:17:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1643901452; bh=WjqrVQ9gpI3BoC50TRDZQ/7j/+XDvZTA2TL+efRyY5A=; h=From:To:Cc:Subject:Date:From; b=Kdi3VJm70sMx96HdEqBNO35Wsmz1ENpGIKkNafq/P+eHWrPE7Qxn4PSTgvZ1Q4qma vDOeeDR2Fnhcv7wVS2PMgc+9rUXL0xQIALArHqHGlsauRrqdWOEnqB2MRho6mRrilT SmS25Sw51FclIQ6TtgmK27Zv5tEoHLEgiqdZNXwCx4a1SlOSkuRBCLX5Y5ZgEkq9bC jfeIEnv3xjJt2iu64bQNxSn//KcJ4FLPTYyfsx0ZLlresKvtegOTCRIRjIBushvL/I L1PWU3XLzRsspYw5atmF2NW2XIUdixEu376QTgTvXe+j/Ja1wMoYwbHfP3KPNMPhhc MK+7znP1ERi9Q== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4JqMjR07jJz6tmV; Thu, 3 Feb 2022 16:17:30 +0100 (CET) From: Vinicius Monego Date: Thu, 3 Feb 2022 15:17:12 +0000 Message-Id: <20220203151712.465416-1-monego@posteo.net> MIME-Version: 1.0 Received-SPF: pass client-ip=185.67.36.65; envelope-from=monego@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * 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 # Copyright © 2020 Martin Becze # Copyright © 2020 Malte Frank Gerdes -# Copyright © 2020 Vinicius Monego +# Copyright © 2020, 2022 Vinicius Monego # Copyright © 2021 Björn Höfling # Copyright © 2021 Greg Hogan # Copyright © 2021 Philip McGrath @@ -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 ;;; Copyright © 2016 Efraim Flashner ;;; Copyright © 2017 Nikita +;;; Copyright © 2022 Vinicius Monego ;;; ;;; 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 +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())