actions.py 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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 shelltools
  7. from pisi.actionsapi import autotools
  8. from pisi.actionsapi import pisitools
  9. from pisi.actionsapi import cmaketools
  10. from pisi.actionsapi import qt6
  11. from pisi.actionsapi import get
  12. import os
  13. WorkDir = "qtbase-everywhere-src-%s" % get.srcVERSION().replace('_','-').replace('pre1', 'tp')
  14. qtbase = qt6.prefix
  15. absoluteWorkDir = "%s/%s" % (get.workDIR(), WorkDir)
  16. #Temporary bindir to avoid qt5 conflicts
  17. bindirQt6="/usr/lib/qt6/bin"
  18. def setup():
  19. #shelltools.system("patch -Rp1 < fb92bb07.patch")
  20. checkdeletepath="%s/qtbase/src/3rdparty" % absoluteWorkDir
  21. for dir in ('libjpeg', 'freetype', 'libpng', 'zlib', "xcb", "sqlite"):
  22. if os.path.exists(checkdeletepath+dir):
  23. shelltools.unlinkDir(checkdeletepath+dir)
  24. filteredCFLAGS = get.CFLAGS().replace("-g3", "-g")
  25. filteredCXXFLAGS = get.CXXFLAGS().replace("-g3", "-g")
  26. vars = {"PISILINUX_CC" : get.CC() + (" -m32" if get.buildTYPE() == "emul32" else ""),
  27. "PISILINUX_CXX": get.CXX() + (" -m32" if get.buildTYPE() == "emul32" else ""),
  28. "PISILINUX_CFLAGS": filteredCFLAGS + (" -m32" if get.buildTYPE() == "emul32" else ""),
  29. "PISILINUX_LDFLAGS": get.LDFLAGS() + (" -m32" if get.buildTYPE() == "emul32" else "")}
  30. for k, v in vars.items():
  31. pisitools.dosed("mkspecs/common/g++-base.conf", k, v)
  32. pisitools.dosed("mkspecs/common/g++-unix.conf", k, v)
  33. shelltools.export("CFLAGS", filteredCFLAGS)
  34. shelltools.export("CXXFLAGS", filteredCXXFLAGS)
  35. #check that dosed commands without releated patches
  36. pisitools.dosed("mkspecs/common/gcc-base-unix.conf", "\-Wl,\-rpath,")
  37. pisitools.dosed("mkspecs/common/gcc-base.conf", "\-O2", filteredCFLAGS)
  38. pisitools.dosed("mkspecs/common/gcc-base.conf", "^(QMAKE_LFLAGS\s+\+=)", r"\1 %s" % get.LDFLAGS())
  39. if not get.buildTYPE() == "emul32":
  40. #-no-pch makes build ccache-friendly
  41. options = " -DCMAKE_INSTALL_PREFIX=%s \
  42. -DCMAKE_BUILD_TYPE=Release \
  43. -DINSTALL_BINDIR=%s \
  44. -DINSTALL_INCLUDEDIR=%s \
  45. -DINSTALL_ARCHDATADIR=%s \
  46. -DINSTALL_DOCDIR=%s \
  47. -DINSTALL_DATADIR=%s \
  48. -DINSTALL_MKSPECSDIR=%s \
  49. -DINSTALL_EXAMPLESDIR=%s \
  50. -DQT_FEATURE_sql_ibase:BOOL=OFF \
  51. -DQT_FEATURE_libproxy=ON \
  52. -DQT_FEATURE_vulkan=ON \
  53. -DQT_FEATURE_system_freetype=ON \
  54. -DQT_FEATURE_system_harfbuzz=ON \
  55. -DQT_FEATURE_system_sqlite=ON \
  56. -DQT_FEATURE_dbus_linked=ON \
  57. -DQT_FEATURE_journald=ON \
  58. -DQT_FEATURE_system_zlib=ON \
  59. -DFEATURE_no_direct_extern_access=ON \
  60. -DFEATURE_system_xcb_xinput=ON \
  61. -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON \
  62. -DCMAKE_MESSAGE_LOG_LEVEL=STATUS \
  63. -DQT_FEATURE_system_xcb_xinput=ON \
  64. -DQT_FEATURE_openssl_linked=ON" % (qt6.prefix, bindirQt6, qt6.headerdir, qt6.archdatadir, qt6.docdir, qt6.datadir, qt6.mkspecsdir, qt6.examplesdir)
  65. #-G Ninja \
  66. #-DQT_FEATURE_directfb=ON \
  67. else:
  68. pisitools.dosed("mkspecs/linux-g++-64/qmake.conf", "-m64", "-m32")
  69. shelltools.export("LDFLAGS", "-m32 %s" % get.LDFLAGS())
  70. options = "-no-pch -v -confirm-license -opensource -no-use-gold-linker\
  71. -platform linux-g++-32 \
  72. -xplatform linux-g++-32 \
  73. -prefix /usr/lib32 \
  74. -bindir /usr/lib32/qt6/bin \
  75. -docdir /usr/share/doc/qt \
  76. -headerdir /usr/lib32/qt6/include/qt6 \
  77. -datadir /usr/share/qt6 \
  78. -sysconfdir /etc/xdg \
  79. -examplesdir /usr/share/doc/qt/examples \
  80. -system-sqlite \
  81. -openssl-linked \
  82. -nomake examples \
  83. -no-xcb \
  84. -no-rpath \
  85. -optimized-qmake \
  86. -dbus-linked \
  87. -system-harfbuzz \
  88. -libdir /usr/lib32/ \
  89. -archdatadir /usr/lib32/qt6/"
  90. qt6.configure(options)
  91. def build():
  92. shelltools.export("LD_LIBRARY_PATH", "%s/lib:%s" % (get.curDIR(), get.ENV("LD_LIBRARY_PATH")))
  93. qt6.make()
  94. def install():
  95. if get.buildTYPE() == "emul32":
  96. qt6.install("INSTALL_ROOT=%s32" % get.installDIR())
  97. shelltools.move("%s32/usr/lib32" % get.installDIR(), "%s/usr" % get.installDIR())
  98. return
  99. pisitools.dodir(qt6.libdir)
  100. qt6.install()
  101. #I hope qtchooser will manage this issue
  102. for bin in shelltools.ls("%s/usr/lib/qt6/bin" % get.installDIR()):
  103. pisitools.dosym("/usr/lib/qt6/bin/%s" % bin, "/usr/bin/%s-qt6" % bin)
  104. mkspecPath = "%s/mkspecs" % qt6.archdatadir
  105. pisitools.dodoc("LICENSES/*")