actions.py 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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. WorkDir = "."
  11. WORKDIR = "%s/%s-%s" % (get.workDIR(), get.srcNAME(), get.srcVERSION())
  12. NCURSES = "ncurses-build"
  13. NCURSESW = "ncursesw-build"
  14. CONFIGPARAMS = "--without-debug \
  15. --with-shared \
  16. --with-normal \
  17. --without-profile \
  18. --disable-rpath \
  19. --enable-const \
  20. --enable-largefile \
  21. --with-terminfo-dirs='/etc/terminfo:/usr/share/terminfo' \
  22. --disable-termcap \
  23. --enable-hard-tabs \
  24. --enable-xmc-glitch \
  25. --enable-colorfgbg \
  26. --with-rcs-ids \
  27. --with-mmask-t='long' \
  28. --without-ada \
  29. --enable-symlinks \
  30. --without-gpm"
  31. def setup():
  32. shelltools.move("ncurses-*", "ncurses-6.4")
  33. shelltools.makedirs(NCURSES)
  34. shelltools.makedirs(NCURSESW)
  35. shelltools.cd(NCURSESW)
  36. global CONFIGPARAMS
  37. if get.buildTYPE() == "_emul32":
  38. pisitools.flags.add("-m32")
  39. pisitools.ldflags.add("-m32")
  40. shelltools.export("CC", "gcc -m32")
  41. shelltools.export("CXX", "g++ -m32")
  42. shelltools.export("PKG_CONFIG_LIBDIR", "/usr/lib32/pkgconfig")
  43. pisitools.dosed("%s/misc/gen-pkgconfig.in" % WORKDIR, "^(show_prefix=).*", "\\1'/usr'")
  44. CONFIGPARAMS += " --prefix=/_emul32 \
  45. --libdir=/usr/lib32 \
  46. --includedir=/_emul32/include \
  47. --libexecdir=/_emul32/lib \
  48. --bindir=/_emul32/bin \
  49. --sbindir=/_emul32/sbin \
  50. --mandir=/_emul32/share/man \
  51. --with-pkg-config-libdir=/usr/lib32/pkgconfig"
  52. else:
  53. CONFIGPARAMS += " --prefix=/usr \
  54. --libdir=/usr/lib \
  55. --libexecdir=/usr/lib \
  56. --bindir=/usr/bin \
  57. --sbindir=/usr/sbin \
  58. --mandir=/usr/share/man \
  59. --with-pkg-config-libdir=/usr/lib/pkgconfig"
  60. shelltools.system("%s/configure --enable-widec --enable-pc-files %s" % (WORKDIR, CONFIGPARAMS))
  61. def build():
  62. global CONFIGPARAMS
  63. shelltools.cd(NCURSESW)
  64. autotools.make()
  65. if not get.buildTYPE() == "_emul32" and get.ARCH() == "x86_64": CONFIGPARAMS += " --with-chtype=long"
  66. shelltools.cd("../%s" % NCURSES)
  67. shelltools.system("%s/configure %s" % (WORKDIR, CONFIGPARAMS))
  68. autotools.make()
  69. def install():
  70. shelltools.cd(NCURSESW)
  71. autotools.rawInstall("DESTDIR=%s" % get.installDIR())
  72. LIB = "/usr/lib32" if get.buildTYPE() == "_emul32" else "/usr/lib"
  73. print LIB
  74. for lib in ["ncurses", "form", "panel", "menu"]:
  75. shelltools.echo("lib%s.so" % lib, "INPUT(-l%sw)" % lib)
  76. pisitools.dolib_so("lib%s.so" % lib, destinationDirectory = LIB)
  77. pisitools.dosym("lib%sw.a" % lib, "%s/lib%s.a" % (LIB, lib))
  78. pisitools.dosym("libncurses++w.a", "%s/libncurses++.a" % LIB)
  79. for lib in ["ncurses", "ncurses++", "form", "panel", "menu"]:
  80. pisitools.dosym("%sw.pc" % lib, "%s/pkgconfig/%s.pc" % (LIB, lib))
  81. shelltools.echo("libcursesw.so", "INPUT(-lncursesw)")
  82. pisitools.dolib_so("libcursesw.so", destinationDirectory = LIB)
  83. pisitools.dosym("libncurses.so", "%s/libcurses.so" % LIB)
  84. pisitools.dosym("libncursesw.a", "%s/libcursesw.a" % LIB)
  85. pisitools.dosym("libncurses.a", "%s/libcurses.a" % LIB)
  86. #for fix
  87. pisitools.dosym("libncursesw.so.6.4", "%s/libncursesw.so.5" % LIB)
  88. # pisitools.dosym("libncurses.so.6.4", "%s/libncurses.so.5" % LIB)
  89. pisitools.dosym("libpanelw.so.6.4", "%s/libpanelw.so.5" % LIB)
  90. pisitools.dosym("libformw.so.6.4", "%s/libformw.so.5" % LIB)
  91. pisitools.dosym("libmenuw.so.6.4", "%s/libmenuw.so.5" % LIB)
  92. # shelltools.cd("../%s" % NCURSES)
  93. # for lib in ["ncurses", "form", "panel", "menu"]:
  94. # pisitools.dolib_so("lib/lib%s.so.%s" % (lib, get.srcVERSION()), destinationDirectory = LIB)
  95. # pisitools.dosym("lib%s.so.%s" % (lib, get.srcVERSION()), "%s/lib%s.so.6" % (LIB, lib))
  96. if get.buildTYPE() == "_emul32":
  97. pisitools.removeDir("/_emul32")
  98. return
  99. shelltools.cd(WORKDIR)
  100. shelltools.system("grep -B 100 '$Id' README > license.txt")
  101. pisitools.dodoc("ANNOUNCE", "NEWS", "README*", "TO-DO", "license.txt")