actions.py 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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 autotools
  7. from pisi.actionsapi import pisitools
  8. from pisi.actionsapi import shelltools
  9. from pisi.actionsapi import pythonmodules
  10. from pisi.actionsapi import get
  11. from pisi.actionsapi import qt5
  12. WorkDir = "QScintilla_src-%s" % get.srcVERSION()
  13. NoStrip = ["/usr/share/doc"]
  14. def setup():
  15. shelltools.cd("src")
  16. shelltools.system("qmake qscintilla.pro")
  17. # Change C/XXFLAGS
  18. pisitools.dosed("Makefile", "^CFLAGS.*\\$\\(DEFINES\\)", "CFLAGS = %s -fPIC $(DEFINES)" % get.CFLAGS())
  19. pisitools.dosed("Makefile", "^CXXFLAGS.*\\$\\(DEFINES\\)", "CXXFLAGS = %s -fPIC $(DEFINES)" % get.CXXFLAGS())
  20. # Get designer plugin's Makefile
  21. shelltools.cd("../designer/")
  22. shelltools.system("qmake designer.pro INCLUDEPATH+=../src QMAKE_LIBDIR+=../src")
  23. # Change C/XXFLAGS of designer plugin's makefile
  24. pisitools.dosed("Makefile", "^CFLAGS.*\\$\\(DEFINES\\)", "CFLAGS = %s -fPIC $(DEFINES)" % get.CFLAGS())
  25. pisitools.dosed("Makefile", "^CXXFLAGS.*\\$\\(DEFINES\\)", "CXXFLAGS = %s -fPIC $(DEFINES)" % get.CXXFLAGS())
  26. def build():
  27. shelltools.system("cp -rf Python Python3")
  28. shelltools.cd("src")
  29. qt5.make()
  30. shelltools.cd("../designer/")
  31. qt5.make()
  32. # Get Makefile of qscintilla-python via sip
  33. # shelltools.cd("../Python")
  34. # pythonmodules.run("configure.py -n ../src -o ../src -c --pyqt=PyQt5 --pyqt-sipdir=/usr/share/sip/Py2Qt5 --qsci-sipdir=/usr/share/sip/Py2Qt5 --sip-incdir=/usr/lib/python2.7/site-packages --qmake /usr/bin/qmake --sip=/usr/bin/py2sip")
  35. # pisitools.dosed("Makefile", "/usr/include/qt/QtPrintSupport", "/usr/include/qt5/QtPrintSupport")
  36. # pisitools.dosed("Makefile", "/usr/include/qt/QtWidgets", "/usr/include/qt5/QtWidgets")
  37. # autotools.make()
  38. shelltools.cd("../Python3")
  39. shelltools.sym("pyproject-qt5.toml", "pyproject.toml")
  40. shelltools.system("sip-build \
  41. --no-make \
  42. --qsci-features-dir ../src/features \
  43. --qsci-include-dir ../src \
  44. --qsci-library-dir ../src \
  45. --api-dir /usr/share/qt5/qsci/api/python")
  46. # pythonmodules.run("configure.py -n ../src -o ../src -c --pyqt=PyQt5 --qmake /usr/bin/qmake", pyVer = "3")
  47. shelltools.cd("../Python3/build")
  48. pisitools.dosed("Makefile", "/usr/include/qt/QtPrintSupport", "/usr/include/qt5/QtPrintSupport")
  49. pisitools.dosed("Makefile", "/usr/include/qt/QtWidgets", "/usr/include/qt5/QtWidgets")
  50. autotools.make()
  51. def install():
  52. shelltools.cd("src")
  53. qt5.install("INSTALL_ROOT=%s" % get.installDIR())
  54. shelltools.cd("../designer/")
  55. qt5.install("INSTALL_ROOT=%s" % get.installDIR())
  56. #build and install qscintilla-python
  57. shelltools.cd("../Python3/build")
  58. #autotools.rawInstall("DESTDIR=%s" % get.installDIR())
  59. qt5.install("INSTALL_ROOT=%s" % get.installDIR())
  60. #pisitools.insinto("/usr/lib/python3.6/site-packages/PyQt5", "Qsci.so")
  61. # shelltools.cd("../Python")
  62. #autotools.rawInstall("DESTDIR=%s" % get.installDIR())
  63. # qt5.install("INSTALL_ROOT=%s" % get.installDIR())
  64. #pisitools.insinto("/usr/lib/python2.7/site-packages/PyQt5", "Qsci.so")
  65. # shelltools.cd("..")
  66. pisitools.dohtml("../../doc/html/")
  67. shelltools.cd("../..")
  68. pisitools.insinto("/usr/share/doc/%s/Scintilla" % get.srcNAME(), "doc/Scintilla/*")
  69. pisitools.dodoc("LICENSE*", "NEWS")