actions.py 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 shelltools
  7. from pisi.actionsapi import cmaketools
  8. from pisi.actionsapi import autotools
  9. from pisi.actionsapi import pisitools
  10. from pisi.actionsapi import get
  11. shelltools.export("JAVAC","/usr/lib/jvm/java-8-openjdk/bin/javac")
  12. shelltools.export("JAVA_HOME","/usr/lib/jvm/java-8-openjdk")
  13. def setup():
  14. cmaketools.configure("-DCMAKE_SKIP_BUILD_RPATH=1 \
  15. -DLIB_INSTALL_DIR=/usr/lib \
  16. -DCMAKE_BUILD_TYPE=Release \
  17. -DCMAKE_CACHEFILE_DIR=%s/build \
  18. -DINCLUDE_INSTALL_DIR=/usr/include \
  19. -DVERSION=%s" % (get.curDIR(), get.srcVERSION()))
  20. def build():
  21. autotools.make()
  22. shelltools.system("./build-pyportmidi")
  23. def install():
  24. autotools.rawInstall("DESTDIR=%s" % get.installDIR())
  25. pisitools.insinto("/usr/include", "pm_common/pmutil.h")
  26. shelltools.chmod("%s/usr/include/pmutil.h" % get.installDIR(), mode=0644)
  27. # Fix missing symlink for libporttime.so (FS#21528).
  28. pisitools.dosym("/usr/lib/libportmidi_s.a", "/usr/lib/libportmidi.a")
  29. pisitools.dosym("/usr/lib/libportmidi.so", "/usr/lib/libporttime.so")
  30. pisitools.dosym("/usr/lib/libportmidi.a", "/usr/lib/libporttime.a")
  31. # Install test applications
  32. for app in ["latency", "midithread", "midithru", "mm", "qtest", "sysex", "test"]:
  33. pisitools.insinto("/usr/bin", "build/Release/%s" % app, "portmidi-%s" % app)
  34. # Build and Install python module
  35. pisitools.dodir("/usr/lib/%s/site-packages/pyportmidi" % get.curPYTHON())
  36. pisitools.dolib("pm_python/pyportmidi/_pyportmidi.so", "/usr/lib/%s/site-packages/pyportmidi" % get.curPYTHON())
  37. pisitools.insinto("/usr/lib/%s/site-packages/pyportmidi" % get.curPYTHON(), "pm_python/pyportmidi/*.py")
  38. pisitools.dodoc("CHANGELOG.txt", "license.txt", "README.txt")