[packages/python-parted] upstream patch to fix build with gcc 10; rel 3

atler atler at pld-linux.org
Sat Mar 6 12:55:50 CET 2021


commit baa4a6a796ade13215d3563c5be38709e68d67cd
Author: Jan Palus <atler at pld-linux.org>
Date:   Sat Mar 6 12:55:27 2021 +0100

    upstream patch to fix build with gcc 10; rel 3

 gcc10.patch        | 101 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 python-parted.spec |   4 ++-
 2 files changed, 104 insertions(+), 1 deletion(-)
---
diff --git a/python-parted.spec b/python-parted.spec
index c310a82..b76255d 100644
--- a/python-parted.spec
+++ b/python-parted.spec
@@ -8,12 +8,13 @@ Summary:	Python 2.x bindings for libparted library
 Summary(pl.UTF-8):	Wiązania Pythona 2.x do biblioteki libparted
 Name:		python-%{module}
 Version:	3.11.2
-Release:	2
+Release:	3
 License:	GPL v2+
 Group:		Libraries/Python
 #Source0Download: https://github.com/dcantrell/pyparted/releases
 Source0:	https://github.com/dcantrell/pyparted/releases/download/v%{version}/pyparted-%{version}.tar.gz
 # Source0-md5:	9477016f5a00bd2d7a280879cdeec3a4
+Patch0:		gcc10.patch
 URL:		https://github.com/dcantrell/pyparted
 BuildRequires:	parted-devel >= 3.1
 BuildRequires:	pkgconfig
@@ -54,6 +55,7 @@ tablic partycji.
 
 %prep
 %setup -q -n pyparted-%{version}
+%patch0 -p1
 
 %build
 %if %{with python2}
diff --git a/gcc10.patch b/gcc10.patch
new file mode 100644
index 0000000..3cc25b6
--- /dev/null
+++ b/gcc10.patch
@@ -0,0 +1,101 @@
+From 104ca13567c08c1188b126a395c4602841aae2c6 Mon Sep 17 00:00:00 2001
+From: David Cantrell <dcantrell at redhat.com>
+Date: Tue, 11 Feb 2020 11:24:08 -0500
+Subject: [PATCH] Move exception declarations to _pedmodule.c
+
+Change the definitions in exceptions.h to extern declarations.  This
+is correct and what I was doing was just lazy.  gcc 10 defaults to
+-fno-common now.
+---
+ include/exceptions.h | 32 ++++++++++++++++----------------
+ src/_pedmodule.c     | 20 +++++++++++++++++++-
+ 2 files changed, 35 insertions(+), 17 deletions(-)
+
+diff --git a/include/exceptions.h b/include/exceptions.h
+index 2a3e1f5..b548214 100644
+--- a/include/exceptions.h
++++ b/include/exceptions.h
+@@ -1,7 +1,7 @@
+ /*
+  * exceptions.h
+  *
+- * Copyright (C) 2007-2013 Red Hat, Inc.
++ * Copyright (C) 2007-2020 Red Hat, Inc.
+  *
+  * This copyrighted material is made available to anyone wishing to use,
+  * modify, copy, or redistribute it subject to the terms and conditions of
+@@ -27,21 +27,21 @@
+ #include <Python.h>
+ 
+ /* custom exceptions for _ped */
+-PyObject *AlignmentException;
+-PyObject *CreateException;
+-PyObject *ConstraintException;
+-PyObject *DeviceException;
+-PyObject *DiskException;
+-PyObject *DiskLabelException;
+-PyObject *FileSystemException;
+-PyObject *GeometryException;
+-PyObject *IOException;
+-PyObject *NotNeededException;
+-PyObject *PartedException;
+-PyObject *PartitionException;
+-PyObject *TimerException;
+-PyObject *UnknownDeviceException;
+-PyObject *UnknownTypeException;
++extern PyObject *AlignmentException;
++extern PyObject *CreateException;
++extern PyObject *ConstraintException;
++extern PyObject *DeviceException;
++extern PyObject *DiskException;
++extern PyObject *DiskLabelException;
++extern PyObject *FileSystemException;
++extern PyObject *GeometryException;
++extern PyObject *IOException;
++extern PyObject *NotNeededException;
++extern PyObject *PartedException;
++extern PyObject *PartitionException;
++extern PyObject *TimerException;
++extern PyObject *UnknownDeviceException;
++extern PyObject *UnknownTypeException;
+ 
+ extern unsigned int partedExnRaised;
+ extern char *partedExnMessage;
+diff --git a/src/_pedmodule.c b/src/_pedmodule.c
+index 3e98788..6c26747 100644
+--- a/src/_pedmodule.c
++++ b/src/_pedmodule.c
+@@ -5,7 +5,7 @@
+  * Python module that implements the libparted functionality via Python
+  * classes and other high level language features.
+  *
+- * Copyright (C) 2007-2015 Red Hat, Inc.
++ * Copyright (C) 2007-2020 Red Hat, Inc.
+  *
+  * This copyrighted material is made available to anyone wishing to use,
+  * modify, copy, or redistribute it subject to the terms and conditions of
+@@ -59,6 +59,24 @@ unsigned int partedExnRaised = 0;
+ 
+ PyObject *exn_handler = NULL;
+ 
++/* custom exceptions for _ped */
++/* These are declared in exceptions.h for use elsewhere. */
++PyObject *AlignmentException;
++PyObject *CreateException;
++PyObject *ConstraintException;
++PyObject *DeviceException;
++PyObject *DiskException;
++PyObject *DiskLabelException;
++PyObject *FileSystemException;
++PyObject *GeometryException;
++PyObject *IOException;
++PyObject *NotNeededException;
++PyObject *PartedException;
++PyObject *PartitionException;
++PyObject *TimerException;
++PyObject *UnknownDeviceException;
++PyObject *UnknownTypeException;
++
+ /* Docs strings are broken out of the module structure here to be at least a
+  * little bit readable.
+  */
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-parted.git/commitdiff/baa4a6a796ade13215d3563c5be38709e68d67cd



More information about the pld-cvs-commit mailing list