actions.py 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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 autotools
  7. from pisi.actionsapi import pisitools
  8. from pisi.actionsapi import get
  9. from pisi.actionsapi import shelltools
  10. from pisi.actionsapi import libtools
  11. def setup():
  12. options = "-with-xinput=yes \
  13. --enable-man"
  14. #shelltools.export("CFLAGS", get.CFLAGS().replace("-fomit-frame-pointer",""))
  15. #gtk2 needs -DGTK_COMPILATION CPPFLAG when compiling itself
  16. #Avoid "Only <gtk/gtk.h> can be included directly error"
  17. shelltools.export("CPPFLAGS", "-DGTK_COMPILATION")
  18. if get.buildTYPE() == "emul32":
  19. options += " --libdir=/usr/lib32 \
  20. --bindir=/usr/bin32 \
  21. --sbindir=/usr/sbin32 \
  22. --disable-cups"
  23. shelltools.export("CC", "%s -m32" % get.CC())
  24. shelltools.export("CXX", "%s -m32" % get.CC())
  25. shelltools.export("CXXFLAGS", "%s -m32" % get.CFLAGS())
  26. shelltools.export("LDFLAGS", "%s -m32" % get.LDFLAGS())
  27. shelltools.export("CPPFLAGS", "-DGTK_COMPILATION")
  28. autotools.autoconf()
  29. autotools.configure(options)
  30. pisitools.dosed("libtool"," -shared ", " -Wl,-O1,--as-needed -shared ")
  31. def build():
  32. autotools.make()
  33. def install():
  34. autotools.rawInstall("DESTDIR=%s" % get.installDIR())
  35. # remove empty dir
  36. #pisitools.removeDir("/usr/share/man")
  37. pisitools.dodoc("AUTHORS", "README*", "HACKING", "ChangeLog*", "NEWS*")
  38. if get.buildTYPE() == "emul32":
  39. for binaries in ["gtk-query-immodules-2.0", "gtk-demo"]:
  40. pisitools.domove("/usr/bin32/%s" % binaries, "/usr/bin/", "%s-32bit" % binaries)
  41. pisitools.removeDir("/usr/bin32")
  42. #hack to install gdkconfig.h in gdk headers dir
  43. pisitools.dosym("/usr/lib/gtk-2.0/include/gdkconfig.h","/usr/include/gtk-2.0/gdk/gdkconfig.h")