actions.py 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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 get
  7. from pisi.actionsapi import autotools
  8. from pisi.actionsapi import pisitools
  9. from pisi.actionsapi import shelltools
  10. from pisi.actionsapi import pythonmodules
  11. from pisi.actionsapi import cmaketools
  12. WorkDir="%s" % get.srcDIR()
  13. def setup():
  14. # create a folder for python3 build
  15. # shelltools.copy("python/", "python3/")
  16. # suppress compiler warnings
  17. pisitools.cxxflags.add("-Wno-stringop-overflow -Wno-unused-function -Wno-deprecated-declarations")
  18. shelltools.export("PTHREAD_LIBS", "-lpthread")
  19. # shelltools.system("./autogen.sh")
  20. # autotools.autoreconf("-vif")
  21. cmaketools.configure("-D CMAKE_BUILD_TYPE=None \
  22. -D CMAKE_INSTALL_PREFIX=/usr \
  23. -D protobuf_BUILD_SHARED_LIBS=ON \
  24. -D protobuf_USE_EXTERNAL_GTEST=ON \
  25. -D protobuf_ABSL_PROVIDER=package")
  26. # fix unused direct dependency analysis
  27. # pisitools.dosed("libtool", " -shared ", " -Wl,-O1,--as-needed -shared ")
  28. def build():
  29. cmaketools.make()
  30. # shelltools.cd("python")
  31. # pythonmodules.compile()
  32. # shelltools.cd("..")
  33. shelltools.cd("python")
  34. pythonmodules.compile(pyVer="3")
  35. shelltools.cd("..")
  36. # tests successfully completed but takes to much time!
  37. #def check():
  38. # autotools.make("check")
  39. # shelltools.cd("python")
  40. # pythonmodules.compile("test")
  41. # shelltools.cd("..")
  42. # shelltools.cd("python3")
  43. # pythonmodules.compile("test", pyVer="3")
  44. # shelltools.cd("..")
  45. def install():
  46. cmaketools.install()
  47. # shelltools.cd("python")
  48. # pythonmodules.install()
  49. # shelltools.cd("..")
  50. shelltools.cd("python")
  51. pythonmodules.install(pyVer="3")
  52. shelltools.cd("..")
  53. pisitools.insinto("/usr/share/vim/vimfiles/syntax/", "editors/proto.vim")
  54. pisitools.insinto("/usr/share/emacs/site-lisp/", "editors/protobuf-mode.el")
  55. pisitools.dodoc("LICENSE", "CONTRIBUTORS.txt", "LICENSE", "README.md")