Last active
October 25, 2017 08:57
-
-
Save senden9/efd3cd2d55806c1a680f8b9e4c02a088 to your computer and use it in GitHub Desktop.
Workaround for the tensorboard PKGBUILD (See https://bugs.archlinux.org/task/56041)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# $Id: PKGBUILD 244979 2017-07-13 15:39:06Z svenstaro $ | |
# Maintainer: Sven-Hendrik Haase <[email protected]> | |
pkgname=tensorboard | |
pkgver=0.4.0rc1 | |
_pkgver=0.4.0-rc1 | |
pkgrel=2 | |
pkgdesc="TensorFlow's Visualization Toolkit" | |
url='https://github.com/tensorflow/tensorboard' | |
arch=('x86_64') | |
license=('APACHE') | |
depends=('python' 'python-werkzeug' 'python-numpy' 'python-bleach' 'python-wheel' 'python-markdown' | |
'python-html5lib' 'python-protobuf' 'python-tensorflow' 'python-setuptools') | |
makedepends=('bazel') | |
source=("https://github.com/tensorflow/tensorboard/archive/${_pkgver}.tar.gz") | |
sha512sums=('fd7867355aa578ce9dbdd0351d035fe26cff093f35b3e437df525a59d6c57bf42ce623bfe589d1a1f4d8c130f983d1047d214ff64974af6707529a3e6b5366c7') | |
build() { | |
cd "$pkgname-$_pkgver" | |
bazel build tensorboard:tensorboard | |
bazel build //tensorboard/pip_package:build_pip_package | |
mkdir pypackage | |
cp -R bazel-bin/tensorboard/pip_package/build_pip_package.runfiles/org_tensorflow_tensorboard/external pypackage | |
cp -R bazel-bin/tensorboard/pip_package/build_pip_package.runfiles/org_tensorflow_tensorboard/tensorboard pypackage | |
cp tensorboard/pip_package/MANIFEST.in pypackage | |
cp README.md pypackage | |
cp tensorboard/pip_package/setup.py pypackage | |
cd pypackage | |
python setup.py build | |
} | |
package() { | |
cd "$pkgname-$_pkgver" | |
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" | |
cd pypackage | |
python setup.py install --root="$pkgdir" --optimize=1 | |
rm -rf "$pkgdir"/usr/lib/python3.6/site-packages/external/ | |
# This is ugly: We need to patch it to use current bleach and html5lib | |
# because old ones are not even compatible with Python 3.6 and we don't have | |
# those in Arch of course. | |
requires="$pkgdir"/usr/lib/python3.6/site-packages/tensorflow_tensorboard-${pkgver}-py3.6.egg-info/requires.txt | |
sed -i 's/bleach==.*/bleach/' "$requires" | |
sed -i 's/html5lib==.*/html5lib/' "$requires" | |
# Other ugly hack: workaround for issues 650 | |
# https://github.com/tensorflow/tensorboard/issues/650 | |
sed -i '/^futures/d' "$requires" | |
} | |
# vim:set ts=2 sw=2 et: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment