actions.py 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #!/usr/bin/env 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 cmaketools
  7. from pisi.actionsapi import mesontools
  8. from pisi.actionsapi import shelltools
  9. from pisi.actionsapi import autotools
  10. from pisi.actionsapi import pisitools
  11. from pisi.actionsapi import get
  12. def setup():
  13. # shelltools.system("rm -rf cmake/external/glib/cppgir/expected-lite")
  14. # shelltools.copy("expected-lite-*/*", "cmake/external/glib/cppgir/expected-lite")
  15. # shelltools.copy("cppgir-*/*", "cmake/external/glib/cppgir")
  16. shelltools.export("NINJAJOBS", "-j 4")
  17. shelltools.system("patch -p1 < fix-tgcalls-cstdint.patch -d Telegram/ThirdParty/tgcalls")
  18. shelltools.system("sed -i 's/DESKTOP_APP_USE_PACKAGED/NO_ONE_WILL_EVER_SET_THIS/' \
  19. cmake/external/rlottie/CMakeLists.txt || die")
  20. shelltools.system('echo "target_link_libraries(external_webrtc INTERFACE jpeg Xcomposite Xdamage Xext Xfixes Xrandr Xrender Xtst X11)" | tee -a cmake/external/webrtc/CMakeLists.txt')
  21. pisitools.cxxflags.add("-Wno-deprecated-declarations -Wno-error=deprecated-declarations -Wno-switch -Wp,-U_GLIBCXX_ASSERTIONS")
  22. # shelltools.system("rm -rf Telegram/ThirdParty/libtgvoip/webrtc_dsp/absl")
  23. params = ' '.join([
  24. '-B build',
  25. '-G Ninja',
  26. '-Ddisable_autoupdate=1',
  27. '-DCMAKE_BUILD_TYPE=Release',
  28. '-DCMAKE_INSTALL_PREFIX="/usr"',
  29. '-DTDESKTOP_API_TEST=ON',
  30. '-DDESKTOP_APP_QT6=ON',
  31. '-DDESKTOP_APP_USE_PACKAGED=ON',
  32. '-DDESKTOP_APP_DISABLE_CRASH_REPORTS=ON',
  33. '-DDESKTOP_APP_SPECIAL_TARGET=""',
  34. '-DDESKTOP_APP_DISABLE_WAYLAND_INTEGRATION=ON',
  35. '-DCMAKE_DEPENDS_IN_PROJECT_ONLY=ON',
  36. '-DTDESKTOP_API_ID=611335',
  37. '-DTDESKTOP_API_HASH=d524b414d21f4d37f08684c1df41ac9c',
  38. '-DTDESKTOP_LAUNCHER_BASENAME="telegramdesktop"'
  39. ])
  40. cmaketools.configure(params)
  41. def build():
  42. # shelltools.cd("build")
  43. shelltools.system("ninja -C build")
  44. # cmaketools.make("-j4")
  45. def install():
  46. shelltools.cd("build")
  47. shelltools.system("DESTDIR=%s ninja install" % get.installDIR())
  48. # shelltools.cd("build")
  49. # cmaketools.rawInstall("DESTDIR=%s" % get.installDIR())