actions.py 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. import os
  7. env=os.environ.copy()
  8. from inary.actionsapi import shelltools
  9. from inary.actionsapi import autotools
  10. from inary.actionsapi import inarytools
  11. from inary.actionsapi import get
  12. def setup():
  13. if get.buildTYPE() == "emul32":
  14. set_emul32()
  15. autotools.configure("--disable-static \
  16. --enable-dependency-tracking \
  17. --disable-ldap \
  18. --disable-ldaps \
  19. --with-ssl \
  20. --with-zlib \
  21. --with-libidn \
  22. --with-libssh2 \
  23. --with-openssl \
  24. --with-gssapi=no \
  25. --with-nghttp2 \
  26. --with-libmetalink \
  27. --without-librtmp \
  28. --without-zstd \
  29. --without-brotli \
  30. --with-nghttp2 \
  31. --with-ngtcp2\
  32. --enable-ipv6 \
  33. --enable-http \
  34. --enable-ftp \
  35. --enable-file \
  36. --enable-dict \
  37. --enable-manual \
  38. --enable-gopher \
  39. --enable-telnet \
  40. --enable-largefile \
  41. --enable-nonblocking \
  42. --enable-threaded-resolver \
  43. --enable-hidden-symbols \
  44. --disable-versioned-symbols \
  45. ac_cv_header_gss_h=no \
  46. --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt \
  47. --prefix=/usr \
  48. --with-random=/dev/urandom \
  49. --mandir=/usr/share/man ")
  50. def build():
  51. if get.buildTYPE() == "emul32":
  52. set_emul32()
  53. shelltools.system("make -j$(nproc)")
  54. return
  55. autotools.make()
  56. def set_emul32():
  57. os.environ.clear()
  58. os.environ.update(env)
  59. shelltools.export("CC", "gcc -m32")
  60. shelltools.export("CXX", "g++ -m32")
  61. shelltools.export("HOST", "x86_64")
  62. shelltools.export("PKG_CONFIG_PATH", "/usr/lib32/pkgconfig")
  63. def check():
  64. pass
  65. #shelltools.export("LD_LIBRARY_PATH", "%s/lib" % get.curDIR())
  66. #autotools.make("-C tests test")
  67. def install():
  68. if get.buildTYPE() == "emul32":
  69. shelltools.system("make install DESTDIR=%s/emul32" % get.installDIR())
  70. shelltools.copytree("%s/emul32/usr/lib32" % get.installDIR(), "%s/usr/lib32" % get.installDIR())
  71. inarytools.removeDir("/emul32")
  72. return
  73. shelltools.system("make install DESTDIR=%s/" % get.installDIR())
  74. inarytools.dodoc("CHANGES", "docs/*.md")