actions.py 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. verMAJOR = "0"
  11. verMINOR = "0"
  12. staticlibfile = "/usr/lib/libx264.a"
  13. pisitools.cflags.sub("-O[\ds]", "-O3")
  14. def getMinorVersion():
  15. f = file("x264.h").read()
  16. for i in f.split("\n"):
  17. if i.startswith("#define X264_BUILD"):
  18. return i.split()[-1]
  19. return "0"
  20. def setup():
  21. shelltools.export("CFLAGS", "%s -O3" % get.CFLAGS())
  22. # force using shared gpac
  23. pisitools.dosed("configure", "-lgpac_static", "-lgpac")
  24. # these disables are here to prevent circular deps, especially with ffmpeg
  25. # Not delete --bit-depth=8 \
  26. autotools.rawConfigure("--prefix=/usr \
  27. --enable-pic \
  28. --disable-asm \
  29. --enable-shared \
  30. --disable-avs \
  31. --disable-ffms \
  32. --disable-lavf \
  33. --disable-swscale \
  34. --bit-depth=10 \
  35. --bit-depth=8 \
  36. ")
  37. def build():
  38. autotools.make()
  39. def install():
  40. autotools.rawInstall("DESTDIR=%s" % get.installDIR())
  41. #autotools.install()
  42. # verMINOR = getMinorVersion()
  43. # pisitools.dosym("libx264.so.%s.%s" % (verMAJOR, verMINOR), "/usr/lib/libx264.so.%s" % verMAJOR)
  44. # No static libs
  45. if shelltools.isFile("%s/%s" % (get.installDIR(), staticlibfile)):
  46. pisitools.remove(staticlibfile)