actions.py 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/usr/bin/python
  2. # -*- coding: utf-8 -*-
  3. # Licensed under the GNU General Public License, version 3.
  4. # See the file http://www.gnu.org/copyleft/gpl.txt
  5. from pisi.actionsapi import cmaketools
  6. from pisi.actionsapi import pisitools
  7. from pisi.actionsapi import shelltools
  8. from pisi.actionsapi import get
  9. def setup():
  10. shelltools.system("sed -i 's/lib64/lib/g' cmake/flann_utils.cmake")
  11. shelltools.system("sed -i '1 i #undef _GLIBCXX_ATOMIC_BUILTINS' src/cpp/flann/algorithms/kdtree_cuda_3d_index.cu")
  12. shelltools.system("sed -i '1 i #undef _GLIBCXX_USE_INT128' src/cpp/flann/algorithms/kdtree_cuda_3d_index.cu")
  13. shelltools.system("sed -i 's|#!/usr/bin/env python|#!/usr/bin/python2|' \
  14. bin/download_checkmd5.py \
  15. bin/run_test.py \
  16. src/python/setup.py.tpl \
  17. test/test_clustering.py \
  18. test/test_index_save.py \
  19. test/test_nn_autotune.py \
  20. test/test_nn_index.py \
  21. test/test_nn.py")
  22. shelltools.system('sed -i "s|setup\.py install|setup.py install --root=$pkgdir --optimize=1|" src/python/CMakeLists.txt')
  23. cmaketools.configure("-DCMAKE_BUILD_TYPE=Release \
  24. -DCMAKE_INSTALL_PREFIX=/usr \
  25. -DBUILD_MATLAB_BINDINGS=OFF \
  26. -DBUILD_PYTHON_BINDINGS=ON \
  27. -DPYTHON_EXECUTABLE=/usr/bin/python2.7 \
  28. -DNVCC_COMPILER_BINDIR=/usr/bin")
  29. def build():
  30. cmaketools.make()
  31. def install():
  32. cmaketools.rawInstall("DESTDIR=%s" % get.installDIR())
  33. #pisitools.dosym("libinput.so.5.0.0","/usr/lib/libinput.so.0")
  34. #pisitools.dodoc("COPYING", "README")