Stop relying on 2to3 at build time.
authorAaron M. Ucko <ucko@debian.org>
Fri, 26 Jul 2024 00:00:49 +0000 (20:00 -0400)
committerAaron M. Ucko <ucko@debian.org>
Fri, 26 Jul 2024 00:00:49 +0000 (20:00 -0400)
* debian/control: Stop building against 2to3, which may not be around
  much longer.
* debian/patches/allow_pcre2 (new): Allow use of PCRE2.
* debian/rules: Drop build-time 2to3 invocation in favor of
  debian/patches/2to3.

debian/changelog
debian/control
debian/patches/2to3 [new file with mode: 0644]
debian/patches/series
debian/rules

index 40679e78537a9a48238ced1a923ae4fb4e6cfe49..ffb3c06fdd475aa32c6fb35f990d54f2a2fe27e9 100644 (file)
@@ -7,7 +7,10 @@ ncbi-blast+ (2.15.0+ds-1) UNRELEASED; urgency=medium
       needed.
     - Build against autoconf2.69.
     - Build against libpcre2-dev, as enabled by debian/patches/allow_pcre2.
+    - Stop building against 2to3, which may not be around much longer.
   * debian/patches: Update for new release, mostly formally.
+  * debian/patches/2to3 (new): Cache 2to3 diff for
+    windowmasker_2.2.22_adapter.
   * debian/patches/allow_pcre2 (new): Allow use of PCRE2.
   * debian/patches/series:
     - Move system_mbedtls_only up in conjunction with incorporating part
@@ -30,9 +33,10 @@ ncbi-blast+ (2.15.0+ds-1) UNRELEASED; urgency=medium
       dpkg-buildpackage's SOURCE_DATE_EPOCH injection should suffice.
     - Extend generated-sources cleanup to objtools/eutils (not entirely
       straightforward due to input format variation).
+    - Drop build-time 2to3 invocation in favor of debian/patches/2to3.
   * debian/source/lintian-overrides: No more rapidjson10 (just ...11).
 
- -- Aaron M. Ucko <ucko@debian.org>  Mon, 22 Jul 2024 23:16:26 -0400
+ -- Aaron M. Ucko <ucko@debian.org>  Thu, 25 Jul 2024 20:00:49 -0400
 
 ncbi-blast+ (2.12.0+ds-4) unstable; urgency=medium
 
index ef3909726bd22c94b987508f35cb174458d62719..5f960b939d0509f90021199ac48f5349a3a3566a 100644 (file)
@@ -7,8 +7,7 @@ Section: science
 Priority: optional
 Build-Depends: debhelper-compat (= 13),
                autoconf2.69
-Build-Depends-Arch: 2to3,
-                    libboost-test-dev,
+Build-Depends-Arch: libboost-test-dev,
                     libbz2-dev,
                     libc-dev-bin,
                     libgnutls28-dev,
diff --git a/debian/patches/2to3 b/debian/patches/2to3
new file mode 100644 (file)
index 0000000..18f1bd6
--- /dev/null
@@ -0,0 +1,48 @@
+--- a/c++/src/app/winmasker/windowmasker_2.2.22_adapter.py     (original)
++++ b/c++/src/app/winmasker/windowmasker_2.2.22_adapter.py     (refactored)
+@@ -79,7 +79,7 @@
+     while True:
+         if arg_pos >= len( sys.argv ): break
+         arg = sys.argv[arg_pos]
+-        if arg not in old_wm_opt_info.keys(): tmpres.append( arg )
++        if arg not in list(old_wm_opt_info.keys()): tmpres.append( arg )
+         else:
+             if arg == '-convert':
+                 arg_pos += 1
+@@ -159,7 +159,7 @@
+         elif state == 'copy': 
+             result.append( arg )
+             state = 'check'
+-        elif arg in old_wm_opt_info.keys():
++        elif arg in list(old_wm_opt_info.keys()):
+             if arg in excludes[wm_mode]:
+                 if not old_wm_opt_info[arg]: state = 'skip'
+             else:
+@@ -172,13 +172,13 @@
+     global HELP_STR
+     mode = 'exec'
+     if len( sys.argv ) <= 1: 
+-        print HELP_STR
++        print(HELP_STR)
+         return
+     else:
+          if sys.argv[1] == '--print-only': 
+             mode = 'print'
+             if len( sys.argv ) <= 2: 
+-                print HELP_STR
++                print(HELP_STR)
+                 return
+             else: 
+                   wm_name = sys.argv[2]
+@@ -188,9 +188,9 @@
+             start_idx = 1
+     new_args = process( start_idx )
+     result_str = wm_name + ' ' + ' '.join( new_args )
+-    if mode == 'print': print result_str
++    if mode == 'print': print(result_str)
+     else:
+-        print 'running "' + result_str + '"'
++        print('running "' + result_str + '"')
+         os.system( result_str )
+ if __name__ == '__main__':
index 434ae3329f4922842642412c6c707509526df710..5e632f4013e498c3a1c23844a0d1fcae49da4532 100644 (file)
@@ -19,3 +19,4 @@ spelling
 support_gcc10
 run_perl_directly
 tune_lmdb_defaults
+2to3
index 42a4eb0be99449658da405da5f4c6772d2a09519..30d50d9d3a2d1d67c4899b48894424b293195166 100755 (executable)
@@ -108,7 +108,6 @@ override_dh_install-arch:
        mv $(instroot)/bin/update_blastdb.pl $(instroot)/bin/update_blastdb
        sed -e '1s/$$/3/' $(instroot)/bin/windowmasker_2.2.22_adapter.py \
           > $(instroot)/bin/windowmasker_2.2.22_adapter
-       2to3 -w --nobackups $(instroot)/bin/windowmasker_2.2.22_adapter
        chmod +x $(instroot)/bin/windowmasker_2.2.22_adapter
        rm $(instroot)/bin/windowmasker_2.2.22_adapter.py*
 # Clean up tests, demos, and internal build tools