actions.py 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/usr/bin/python
  2. # -*- coding: utf-8 -*-
  3. #
  4. # Licensed under the GNU General Public License, version 3.
  5. # See the file http://www.gnu.org/licenses/gpl.txt
  6. from pisi.actionsapi import pythonmodules
  7. from pisi.actionsapi import shelltools
  8. from pisi.actionsapi import autotools
  9. from pisi.actionsapi import pisitools
  10. from pisi.actionsapi import get
  11. #WorkDir="PyQt5_gpl-%s" % get.srcVERSION()
  12. def setup():
  13. pythonmodules.run("configure.py --confirm-license \
  14. --qsci-api \
  15. --destdir='/usr/lib/python2.7/site-packages' \
  16. --sip-incdir='/usr/include/python2.7' \
  17. --sip /usr/bin/py2sip \
  18. --qmake='/usr/bin/qmake' ")
  19. shelltools.system("find -name 'Makefile' | xargs sed -i 's|-Wl,-rpath,/usr/lib||g;s|-Wl,-rpath,.* ||g'")
  20. def build():
  21. autotools.make()
  22. def install():
  23. autotools.rawInstall("-C pyrcc DESTDIR=%(DESTDIR)s INSTALL_ROOT=%(DESTDIR)s" % {'DESTDIR':get.installDIR()})
  24. autotools.rawInstall("-C pylupdate DESTDIR=%(DESTDIR)s INSTALL_ROOT=%(DESTDIR)s" % {'DESTDIR':get.installDIR()})
  25. autotools.rawInstall("DESTDIR=%(DESTDIR)s INSTALL_ROOT=%(DESTDIR)s" % {'DESTDIR':get.installDIR()})
  26. # Fix conflicts with python3-pyqt5
  27. pisitools.rename("/usr/bin/pylupdate5", "py2lupdate5")
  28. pisitools.rename("/usr/bin/pyrcc5", "py2rcc5")
  29. pisitools.rename("/usr/lib/qt5/plugins/PyQt5/libpyqt5qmlplugin.so", "libpy2qt5qmlplugin.so")
  30. pisitools.rename("/usr/lib/qt5/plugins/designer/libpyqt5.so", "libpy2qt5.so")
  31. pisitools.rename("/usr/share/qt5/qsci/api/python/PyQt5.api", "Py2Qt5.api")
  32. pisitools.rename("/usr/bin/pyuic5", "py2uic5")
  33. pisitools.domove("/usr/share/sip/PyQt5/*", "/usr/share/sip/Py2Qt5")
  34. pisitools.removeDir("/usr/share/sip/PyQt5")