actions.py 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/usr/bin/env python3
  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 inary.actionsapi import mesontools
  7. from inary.actionsapi import inarytools
  8. from inary.actionsapi import shelltools
  9. from inary.actionsapi import get
  10. def setup():
  11. shelltools.export("CFLAGS", "{} -DG_DISABLE_CAST_CHECKS".format(get.CFLAGS()))
  12. options=""
  13. if get.buildTYPE()=="emul32":
  14. shelltools.export("CC", "gcc -m32")
  15. shelltools.export("CXX", "g++ -m32")
  16. shelltools.export("PKG_CONFIG_PATH", "/usr/lib32/pkgconfig")
  17. shelltools.system("patch -p1 < multilib.patch")
  18. mesontools.meson_configure(options)
  19. def build():
  20. if get.buildTYPE()=="emul32":
  21. shelltools.export("CC", "gcc -m32 -mstackrealign -mfpmath=sse")
  22. shelltools.export("CXX", "g++ -m32 -mstackrealign -mfpmath=sse")
  23. shelltools.export("PKG_CONFIG_PATH", "/usr/lib32/pkgconfig")
  24. mesontools.ninja_build()
  25. def install():
  26. if get.buildTYPE()=="emul32":
  27. shelltools.system('DESTDIR="{}/emul32" ninja install -C inaryPackageBuild'.format(get.installDIR()))
  28. inarytools.domove("/emul32/usr/lib32", "/usr/")
  29. inarytools.domove("/emul32/usr/bin/*", "/usr/bin/32")
  30. inarytools.removeDir("/emul32")
  31. return
  32. else:
  33. mesontools.ninja_install()