diff options
author | Daniel Bermond | 2018-11-22 15:23:31 +0000 |
---|---|---|
committer | Daniel Bermond | 2018-11-22 15:32:29 +0000 |
commit | 30a6e26b4d4593d54fc14685352c0e3a7877c7be (patch) | |
tree | e309b87f929a1448552eccf91b759bbde71ad8cb /PKGBUILD | |
parent | ea5909413e867d84aa39a0707ae9bedabe46b548 (diff) | |
download | aur-30a6e26b4d4593d54fc14685352c0e3a7877c7be.tar.gz |
Add full relro. Add missing lib.
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 35 |
1 files changed, 21 insertions, 14 deletions
@@ -31,7 +31,7 @@ _pytorchver=1.0rc1 # pytorch stable release version pkgname=caffe2 pkgver="0.8.2.pytorch.${_pytorchver}" -pkgrel=5 +pkgrel=6 pkgdesc='A new lightweight, modular, and scalable deep learning framework' arch=('i686' 'x86_64') url='https://caffe2.ai/' @@ -90,6 +90,8 @@ source=( "git+https://github.com/onnx/onnx-tensorrt.git#commit=${_onnx_tensorrt_commit}" "git+https://github.com/shibatch/sleef.git#commit=${_sleef_commit}" "git+https://github.com/intel/ideep.git#commit=${_ideep_commit}" + # patches: + 'caffe2-1.0rc1-add-full-relro.patch' ) sha256sums=('473cd4af032ddec4279cf3a90dd9508b6fa0be5cd89c842945f88b5a576a4231' 'SKIP' @@ -117,10 +119,11 @@ sha256sums=('473cd4af032ddec4279cf3a90dd9508b6fa0be5cd89c842945f88b5a576a4231' 'SKIP' 'SKIP' 'SKIP' - 'SKIP') + 'SKIP' + 'c41dd34bdf0bfbe62bba8527e950a14b356bef136edc53ea40c6469644502583') prepare() { - cd "${srcdir}/pytorch-${_pytorchver}/third_party" + cd "pytorch-${_pytorchver}/third_party" local _component local _thirdparty_list="pybind11 cub googletest nervanagpu benchmark \ @@ -142,6 +145,10 @@ prepare() { rm -rf "$_component" ln -sf "${srcdir}/${_component}" "${_component}" done + + # add full relro + cd "${srcdir}/pytorch-${_pytorchver}" + patch -Np1 -i "${srcdir}/caffe2-1.0rc1-add-full-relro.patch" } build() { @@ -173,7 +180,7 @@ build() { -DPYTHON_LIBRARY:FILEPATH="/usr/lib/libpython${_pythonver}m.so" \ \ -DUSE_ACL:BOOL='OFF' \ - -DUSE_ASAN:BOOL='ON' \ + -DUSE_ASAN:BOOL='OFF' \ -DUSE_CUDA:BOOL='OFF' \ -DUSE_CUDNN:BOOL='OFF' \ -DUSE_DISTRIBUTED:BOOL='ON' \ @@ -227,17 +234,17 @@ package() { # remove unneeded files local _entry local _exclude_dirs - local _exclude_libs mapfile -t -d '' _exclude_dirs < <(find "${pkgdir}/usr/include" -mindepth 1 -maxdepth 1 -type d ! -name 'caffe*' -print0) - mapfile -t -d '' _exclude_libs < <(find -L "${pkgdir}/usr/lib" -maxdepth 1 -type f ! -name 'libcaffe*' -print0) - rm -f "$pkgdir"/usr/bin/{protoc,unzstd,zstd{cat,mt,}} - rm -f "$pkgdir"/usr/include/{*.h,*.py} - rm -rf "$pkgdir"/usr/lib/cmake/protobuf - rm -f "$pkgdir"/usr/lib/pkgconfig/{protobuf-lite,protobuf}.pc - rm -rf "$pkgdir"/usr/share/pkgconfig - rm -rf "$pkgdir"/usr/share/{ATen,cmake/{ATen,ONNX}} - rm -f "$pkgdir"/usr/share/man/man1/{unzstd,zstd{cat,}}.1 - for _entry in "${_exclude_dirs[@]}" "${_exclude_libs[@]}" + rm "$pkgdir"/usr/bin/{protoc,unzstd,zstd{cat,mt,}} + rm "$pkgdir"/usr/include/{*.h,*.py} + rm "$pkgdir"/usr/lib/*.a + rm "$pkgdir"/usr/lib/lib{zstd,onnxifi}* + rm -r "$pkgdir"/usr/lib/cmake/protobuf + rm "$pkgdir"/usr/lib/pkgconfig/{protobuf-lite,protobuf}.pc + rm "$pkgdir"/usr/share/pkgconfig/libzstd.pc + rm -r "$pkgdir"/usr/share/{ATen,cmake/{ATen,ONNX}} + rm "$pkgdir"/usr/share/man/man1/{unzstd,zstd{cat,}}.1 + for _entry in "${_exclude_dirs[@]}" do rm -rf "$_entry" done |