[arch-commits] Commit in python-pytorch/trunk (PKGBUILD)

Konstantin Gizdov kgizdov at archlinux.org
Sat May 4 15:16:04 UTC 2019


    Date: Saturday, May 4, 2019 @ 15:16:03
  Author: kgizdov
Revision: 458911

make sure install does not re-run CMake

Modified:
  python-pytorch/trunk/PKGBUILD

----------+
 PKGBUILD |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2019-05-04 15:15:24 UTC (rev 458910)
+++ PKGBUILD	2019-05-04 15:16:03 UTC (rev 458911)
@@ -65,6 +65,8 @@
 
 package_python-pytorch() {
   cd "${srcdir}/${_pkgname}-${pkgver}"
+  # Prevent setup.py from re-running CMake and rebuilding
+  sed -e 's/RUN_BUILD_DEPS = True/RUN_BUILD_DEPS = False/g' -i setup.py
   python setup.py install --root="${pkgdir}"/ --optimize=1 --skip-build
   install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.txt"
   # put CMake files in correct place
@@ -85,6 +87,7 @@
   rm -rf "${pkgdir}/${pytorchpath}/share/cmake"
   rm -rf "${pkgdir}/${pytorchpath}/include"
   rm -rf "${pkgdir}/${pytorchpath}/bin"
+  rm -rf "${pkgdir}/usr/include/pybind11"
   # python module is hardcoded to look there at runtime
   ln -s /usr/bin "${pkgdir}/${pytorchpath}/bin"
   ln -s /usr/include "${pkgdir}/${pytorchpath}/include"
@@ -101,6 +104,8 @@
   provides=('python-pytorch')
   conflicts=('python-pytorch')
   cd "${srcdir}/${_pkgname}-${pkgver}-cuda"
+  # Prevent setup.py from re-running CMake and rebuilding
+  sed -e 's/RUN_BUILD_DEPS = True/RUN_BUILD_DEPS = False/g' -i setup.py
   python setup.py install --root="${pkgdir}"/ --optimize=1 --skip-build
   install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.txt"
   # put CMake files in correct place
@@ -114,7 +119,6 @@
   mv "${pkgdir}/${pytorchpath}/bin"/* "${pkgdir}/usr/bin/"
   mv "${pkgdir}/${pytorchpath}/include"/* "${pkgdir}/usr/include/"
   mv "${pkgdir}/${pytorchpath}/lib"/*.so* "${pkgdir}/usr/lib/pytorch/"
-  # mv "${pkgdir}/${pytorchpath}/bin/torch_shm_manager" "${pkgdir}/usr/bin/"
   # clean up duplicates
   # TODO: move towards direct shared library dependecy of:
   #   c10, caffe2, libcpuinfo, CUDA RT, gloo, GTest, Intel MKL,
@@ -122,6 +126,7 @@
   rm -rf "${pkgdir}/${pytorchpath}/share/cmake"
   rm -rf "${pkgdir}/${pytorchpath}/include"
   rm -rf "${pkgdir}/${pytorchpath}/bin"
+  rm -rf "${pkgdir}/usr/include/pybind11"
   # python module is hardcoded to look there at runtime
   ln -s /usr/bin "${pkgdir}/${pytorchpath}/bin"
   ln -s /usr/include "${pkgdir}/${pytorchpath}/include"


More information about the arch-commits mailing list