Processed: Re: Bug#937144: syrthes: Python2 removal in sid/bullseye

2020-01-31 Thread Debian Bug Tracking System
Processing control commands:

> tags -1 + patch
Bug #937144 [src:nipype] nipype: Python2 removal in sid/bullseye
Added tag(s) patch.

-- 
937144: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=937144
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems



Bug#937144: syrthes: Python2 removal in sid/bullseye

2020-01-31 Thread Stuart Prescott
Control: tags -1 + patch

Dear maintainer,

The attached patches port the build system to Python 3. The package seems to 
build OK using them but I don't know enough about this package to test them 
further and there are no autopkgtest tests to verify that the package is OK.

regards
Stuart

-- 
Stuart Prescotthttp://www.nanonanonano.net/   stu...@nanonanonano.net
Debian Developer   http://www.debian.org/ stu...@debian.org
GPG fingerprint90E2 D2C1 AD14 6A1B 7EBB 891D BBC1 7EBB 1396 F2F7>From 67b33f9471a4df23d69d093a1f230b4fab8f8f93 Mon Sep 17 00:00:00 2001
From: Stuart Prescott 
Date: Sat, 1 Feb 2020 01:14:04 +1100
Subject: [PATCH 1/3] Update dependencies to use Python 3

---
 debian/control | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/debian/control b/debian/control
index 26d7580..5d9dc92 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,7 @@ Section: science
 Priority: optional
 Maintainer: Debian Science Maintainers 
 Uploaders: Gilles Filippini 
-Build-Depends: debhelper (>= 9~), python, dh-python, libmedc-dev, libhdf5-mpi-dev, libmetis-dev, libscotch-dev,
+Build-Depends: debhelper (>= 9~), python3, dh-python, libmedc-dev, libhdf5-mpi-dev, libmetis-dev, libscotch-dev,
  code-saturne-bin (>= 4.0.0) [!s390x], code-saturne-include (>= 4.0.0) [!s390x]
 Standards-Version: 4.3.0
 Homepage: https://www.edf.fr/en/the-edf-group/world-s-largest-power-company/activities/research-and-development/scientific-communities/simulation-softwares?logiciel=10818
@@ -12,7 +12,7 @@ Vcs-Git: https://salsa.debian.org/science-team/syrthes.git
 
 Package: syrthes
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}, gcc, make
+Depends: ${shlibs:Depends}, ${misc:Depends}, ${python3:Depends}, gcc, make
 Recommends: syrthes-tools
 Suggests: syrthes-gui, syrthes-tests, code-saturne
 Description: Transient thermal simulations in complex solid geometries
@@ -35,7 +35,7 @@ Description: Transient thermal simulations in complex solid geometries - tools
 
 Package: syrthes-tests
 Architecture: all
-Depends: ${misc:Depends}, ${python:Depends}, python
+Depends: ${misc:Depends}, ${python3:Depends}, python3
 Recommends: syrthes (>= 4.1.1~)
 Description: Test cases for SYRTHES
  SYRTHES is a general purpose thermal software developed at EDF R which
-- 
2.20.1

>From e80e93223da154ef5232f40639c88a1d745eb969 Mon Sep 17 00:00:00 2001
From: Stuart Prescott 
Date: Sat, 1 Feb 2020 01:14:56 +1100
Subject: [PATCH 3/3] Use dh_python3 in build

---
 debian/rules | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/debian/rules b/debian/rules
index 0319b14..3b0add7 100755
--- a/debian/rules
+++ b/debian/rules
@@ -33,7 +33,7 @@ ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
 endif	
 
 %:
-	dh $@ --with python2
+	dh $@ --with python3
 
 override_dh_auto_configure:
 	sed -i.orig src/syrthes-install/setup.ini \
@@ -74,5 +74,5 @@ override_dh_auto_install:
 	# Remove extra license file
 	rm arch/Debian/syrthes-gui/22x22/license
 
-override_dh_python2:
-	dh_python2 -N syrthes-tests
+override_dh_python3:
+	dh_python3 -N syrthes-tests --shebang=/usr/bin/python3
-- 
2.20.1

>From f5f49a24a99edb2b0113eea3a9597d1d15508e65 Mon Sep 17 00:00:00 2001
From: Stuart Prescott 
Date: Sat, 1 Feb 2020 01:14:38 +1100
Subject: [PATCH 2/3] Add patches to build with Python 3

---
 debian/patches/python3-conf.patch |  243 +
 debian/patches/python3.patch  | 1667 +
 debian/patches/series |2 +
 debian/patches/setup.patch|   14 +-
 4 files changed, 1919 insertions(+), 7 deletions(-)
 create mode 100644 debian/patches/python3-conf.patch
 create mode 100644 debian/patches/python3.patch

diff --git a/debian/patches/python3-conf.patch b/debian/patches/python3-conf.patch
new file mode 100644
index 000..71a2f6a
--- /dev/null
+++ b/debian/patches/python3-conf.patch
@@ -0,0 +1,243 @@
+--- a/src/syrthes-install/config_env.py
 b/src/syrthes-install/config_env.py
+@@ -78,8 +78,8 @@
+ #
+ # syrthes.profile file update
+ #	
+-	print "!!! ",self.installPath+'/syrthes.profile_'+self.arch
+-	profileFile = file(self.installPath+'/syrthes.profile_'+self.arch, mode='w')
++print("!!! ",self.installPath+'/syrthes.profile_'+self.arch)
++profileFile = open(self.installPath+'/syrthes.profile_'+self.arch, mode='w')
+ 
+ profileFile.write("""#!/bin/bash
+ #---
+@@ -121,8 +121,8 @@
+ """)
+ 
+ #profileFile.write("DEST_LIB="+self.installPath+'/../arch/'+self.arch+'lib'+"\n")
+-print "SYRTHES4_HOME="+self.syrthesDir+"/arch/"+self.arch
+-print "NOM_ARCH="+self.arch
++print("SYRTHES4_HOME="+self.syrthesDir+"/arch/"+self.arch)
++print("NOM_ARCH="+self.arch)
+ profileFile.write("SYRTHES4_HOME="+self.syrthesDir+"/arch/"+self.arch+"\n")
+