actions.py 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. # -*- coding: utf-8 -*-
  2. #
  3. # Licensed under the GNU General Public License, version 3.
  4. # See the file http://www.gnu.org/licenses/gpl.txt
  5. from pisi.actionsapi import get
  6. from pisi.actionsapi import autotools
  7. from pisi.actionsapi import pisitools
  8. from pisi.actionsapi import shelltools
  9. WorkDir = "."
  10. SkipList = (".", "filelist", "patches", "pisiBuildState", "tmp")
  11. def setup():
  12. # Speed up xkbcomp
  13. shelltools.export("CFLAGS","%s -DHAVE_STRCASECMP" % get.CFLAGS())
  14. for package in shelltools.ls("."):
  15. if package.startswith(SkipList):
  16. continue
  17. print "\nConfiguring %s..." % package
  18. print "-" * (len(package) + 15)
  19. shelltools.cd(package)
  20. if package.startswith(("xcursorgen", "xsm")) or \
  21. not shelltools.isFile("configure"):
  22. autotools.autoreconf("-vif")
  23. elif package.startswith("luit"):
  24. pisitools.dosed("configure.ac", "(-D_XOPEN_SOURCE)=500", "\\1=600")
  25. autotools.autoreconf("-vif")
  26. autotools.configure("--disable-dependency-tracking \
  27. --disable-devel-docs \
  28. --with-cpp=/usr/bin/cpp,/usr/bin/mcpp")
  29. shelltools.cd("../")
  30. def build():
  31. for package in shelltools.ls("."):
  32. if package.startswith(SkipList):
  33. continue
  34. shelltools.cd(package)
  35. if package.startswith("xfwp"): pisitools.dosed("io.c", "^(#include <unistd.h>)", r"#define __USE_XOPEN\n\1")
  36. autotools.make()
  37. shelltools.cd("../")
  38. def install():
  39. for package in shelltools.ls("."):
  40. if package.startswith(SkipList):
  41. continue
  42. shelltools.cd(package)
  43. autotools.rawInstall("DESTDIR=%s" % get.installDIR())
  44. shelltools.cd("../")