actions.py 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #!/usr/bin/python
  2. # -*- coding: utf-8 -*-
  3. #
  4. # Licensed under the GNU General Public License, version 3.
  5. # See the file https://www.gnu.org/licenses/gpl-3.0.txt
  6. from pisi.actionsapi import autotools
  7. from pisi.actionsapi import pisitools
  8. from pisi.actionsapi import shelltools
  9. from pisi.actionsapi import libtools
  10. from pisi.actionsapi import get
  11. WorkDir = "SDL2-%s" % get.srcVERSION()
  12. docdir = "%s/%s" % (get.docDIR(), get.srcNAME())
  13. def setup():
  14. shelltools.export("CFLAGS", "%s -fPIC -O3" % get.CFLAGS())
  15. shelltools.export("CXXFLAGS", "%s -fPIC -O3" % get.CXXFLAGS())
  16. # for libtool version matching
  17. #shelltools.copy("/usr/share/aclocal/ltversion.m4", "acinclude/")
  18. shelltools.system("./autogen.sh")
  19. #libtools.libtoolize("--force --copy")
  20. options = "--enable-sdl-dlopen \
  21. --disable-arts \
  22. --disable-esd \
  23. --disable-nas \
  24. --enable-pulseaudio-shared \
  25. --enable-alsa \
  26. --disable-rpath"
  27. if get.buildTYPE() == "emul32":
  28. options += " --libdir=/usr/lib32 \
  29. --disable-ibus \
  30. --bindir=/emul32/bin \
  31. --mandir=/emul32/man \
  32. "
  33. shelltools.export("PKG_CONFIG_PATH", "/usr/lib32/pkgconfig")
  34. shelltools.export("CFLAGS", "%s -fPIC -O3 -m32" % get.CFLAGS())
  35. shelltools.export("CXXFLAGS", "%s -fPIC -O3 -m32" % get.CXXFLAGS())
  36. shelltools.export("LDFLAGS", "%s -m32" % get.LDFLAGS())
  37. autotools.configure(options)
  38. def build():
  39. autotools.make()
  40. def install():
  41. autotools.rawInstall("DESTDIR=%s" % get.installDIR())
  42. libtools.preplib()
  43. if get.buildTYPE() == "emul32":
  44. pisitools.dosed("%s/usr/lib32/cmake/SDL2/*.cmake" % get.installDIR(), "emul32", "usr")
  45. return
  46. pisitools.dodoc("BUGS.txt", "CREDITS.txt", "README*", "README-SDL.txt", "TODO.txt", "WhatsNew.txt")