actions.py 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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 libtools
  8. from pisi.actionsapi import autotools
  9. from pisi.actionsapi import pisitools
  10. from pisi.actionsapi import shelltools
  11. # FIXME: libpulsedsp.la should be added, but it doesn't build on our system
  12. emul32_libs = "libpulsecommon-%s.la \
  13. libpulse.la \
  14. libpulse-simple.la \
  15. libpulse-mainloop-glib.la \
  16. " % get.srcVERSION()
  17. def setup():
  18. options = "--prefix=/usr \
  19. --sysconfdir=/etc \
  20. --localstatedir=/var \
  21. --libexecdir=/usr/libexec \
  22. --disable-dependency-tracking \
  23. --disable-static \
  24. --disable-bluez4 \
  25. --disable-rpath \
  26. --disable-systemd \
  27. --disable-oss-output \
  28. --enable-largefile \
  29. --with-system-user=pulse \
  30. --with-system-group=pulse \
  31. --with-access-group=pulse-access \
  32. --with-database=tdb \
  33. --with-module-dir=/usr/lib/pulse/modules \
  34. --with-udev-rules-dir=/lib/udev/rules.d"
  35. if get.buildTYPE() == "emul32":
  36. options += " --libdir=/usr/lib32 \
  37. --libexecdir=/usr/lib32 \
  38. --disable-gconf \
  39. --disable-gtk2 \
  40. --disable-asyncns \
  41. --disable-lirc \
  42. --disable-x11 \
  43. --disable-bluez4 \
  44. --disable-oss-output \
  45. --disable-oss-wrapper \
  46. --disable-solaris \
  47. --disable-manpages \
  48. --disable-samplerate \
  49. --disable-default-build-tests"
  50. shelltools.echo(".tarball-version", get.srcVERSION())
  51. #shelltools.system("NOCONFIGURE=1 ./bootstrap.sh")
  52. autotools.configure(options)
  53. pisitools.dosed("libtool", "CC(\s-shared\s)", r"CC -Wl,-O1,--as-needed\1")
  54. def build():
  55. if get.buildTYPE() == "emul32":
  56. autotools.make("-C src %s" % emul32_libs)
  57. return
  58. autotools.make()
  59. #generate html docs
  60. autotools.make("doxygen")
  61. def install():
  62. if get.buildTYPE() == "emul32":
  63. autotools.rawInstall("-C src \
  64. lib_LTLIBRARIES=\"%s\" \
  65. DESTDIR=%s" % (emul32_libs, get.installDIR()),
  66. "install-libLTLIBRARIES")
  67. autotools.rawInstall("DESTDIR=%s" % get.installDIR(), "install-pkgconfigDATA")
  68. return
  69. autotools.rawInstall("DESTDIR=%s" % get.installDIR())
  70. # Disable autospawn by default
  71. shelltools.system("sed -e '/autospawn/iautospawn=yes' -i '%s/etc/pulse/client.conf'" % get.installDIR())
  72. # Speed up pulseaudio shutdown
  73. # Lower resample quality, saves CPU
  74. shelltools.system("sed -e '/exit-idle-time/iexit-idle-time=0' \
  75. -e '/resample-method/iresample-method=speex-float-0' \
  76. -i '%s/etc/pulse/daemon.conf'" % get.installDIR())
  77. # Needed for service.py
  78. pisitools.dodir("/run/pulse")
  79. pisitools.dodir("/var/lib/pulse")
  80. # HAL is no longer supported by default
  81. pisitools.removeDir("/etc/dbus-1")
  82. pisitools.dodoc("README", "LICENSE", "GPL", "LGPL")
  83. pisitools.dohtml("doxygen/html/*")