actions.py 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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.install()
  41. # verMINOR = getMinorVersion()
  42. # pisitools.dosym("libx264.so.%s.%s" % (verMAJOR, verMINOR), "/usr/lib/libx264.so.%s" % verMAJOR)
  43. # No static libs
  44. if shelltools.isFile("%s/%s" % (get.installDIR(), staticlibfile)):
  45. pisitools.remove(staticlibfile)