wiki:python3
Last modified 6 years ago Last modified on 03/22/12 13:15:45

installing gentoo on my new laptop uses python3 by default. As not all packages have been updated to use python3, I collect the patches I use here.

build trouble

List of packages with build time fails (eg, python is only build dependency)

  • net-wireless/crda-1.0.1:gentoo
    • build failure:
        File "./utils/key2pub.py", line 6
          except ImportError, e:
                            ^
      SyntaxError: invalid syntax 
      
    • solution is simple, use the python eclass and rewrite the shebangs from python -> python2
      attachment:crda-1.0.1-r1.diff
  • net-wireless/crda-1.1.1:pentoo
    • build failure:
        File "./utils/key2pub.py", line 6
          except ImportError, e:
                            ^
      SyntaxError: invalid syntax 
      
    • solution is simple, use the python eclass and rewrite the shebangs from python -> python2
      attachment:crda-1.1.1.diff
  • net-wireless/wireless-regdb-20091125-r1:pentoo
    • build failure:
      Generating regulatory.bin digitally signed by Gentoo...
      ./db2bin.py regulatory.bin db.txt wireless-regdb-Gentoo.key.priv.pem
        File "./db2bin.py", line 13
          print 'Usage: %s output-file input-file [key-file]' % sys.argv[0]
                                                            ^
      SyntaxError: invalid syntax
      
    • solution is simple, use the python eclass and rewrite the shebangs from python -> python2
      attachment:wireless-regdb-20091125-r1.diff

runtime trouble

List of packages with runtime fails (eg, python is runtime dependency)

  • media-gfx/comix-4.0.4:gentoo
    • build failure:
        File "install.py", line 177
          print __doc__
                      ^
      SyntaxError: invalid syntax
      
    • solution: set python version to 2 for build process, and replace all shebangs from python -> python2
      patch from gentoo bugtracker attachment:comix.diff
    • better solution: emerge mcomix

Attachments