summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamien Nguyen2020-09-24 15:45:41 +0200
committerDamien Nguyen2020-09-24 16:08:00 +0200
commit52ce0ebeb4c091ded7772d1fecbdc587ee3535c9 (patch)
tree7aa87d1ceb8f09701007cf98c87d5737bf258e3a
downloadaur-52ce0ebeb4c091ded7772d1fecbdc587ee3535c9.tar.gz
Initial commit (v0.0.2-4)
-rw-r--r--.SRCINFO37
-rw-r--r--PKGBUILD120
2 files changed, 157 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..2b51d6080dbf
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,37 @@
+pkgbase = python-hiq-circuit
+ pkgdesc = A high performance distributed quantum simulator
+ pkgver = 0.0.2.post4
+ pkgrel = 1
+ url = https://hiq.huaweicloud.com/en/
+ arch = x86_64
+ groups = python-hiq
+ license = Apache
+ checkdepends = boost-libs
+ checkdepends = gflags
+ checkdepends = google-glog
+ checkdepends = hwloc
+ checkdepends = openmpi
+ checkdepends = python
+ checkdepends = python-pytest
+ makedepends = cmake
+ makedepends = gcc
+ makedepends = boost
+ makedepends = python-setuptools
+ depends = boost-libs
+ depends = gflags
+ depends = google-glog
+ depends = hwloc
+ depends = openmpi
+ depends = python
+ source = https://files.pythonhosted.org/packages/source/h/hiq-circuit/hiq-circuit-0.0.2.post4.tar.gz
+ sha512sums = a890fb3c62e03f40840c8cd097a5bc03e439f2061407095c8dfcc824c4b7a725ba33da9028ac15a74e2de56bc714f20d2aaac2d0d075b59dd03dce73a32089fa
+
+pkgname = python-hiq-circuit
+ depends = boost-libs
+ depends = gflags
+ depends = google-glog
+ depends = hwloc
+ depends = openmpi
+ depends = python
+ depends = python-hiq-projectq
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..a5cd4fa74c12
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,120 @@
+# Maintainer: Damien Nguyen <damien1@huawei.com>
+
+# ==============================================================================
+#
+# Copyright 2020 <Huawei Technologies Co., Ltd>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# ==============================================================================
+
+pkgname=python-hiq-circuit
+_name=${pkgname#python-}
+
+pkgver=0.0.2.post4
+pkgrel=1
+pkgdesc="A high performance distributed quantum simulator"
+arch=('x86_64')
+url="https://hiq.huaweicloud.com/en/"
+license=('Apache')
+depends=('boost-libs'
+ 'gflags'
+ 'google-glog'
+ 'hwloc'
+ 'openmpi'
+ 'python')
+makedepends=('cmake'
+ 'gcc'
+ 'boost'
+ 'python-setuptools')
+checkdepends=('boost-libs'
+ 'gflags'
+ 'google-glog'
+ 'hwloc'
+ 'openmpi'
+ 'python'
+ 'python-pytest')
+source=("https://files.pythonhosted.org/packages/source/${_name::1}/$_name/$_name-$pkgver.tar.gz")
+sha512sums=('a890fb3c62e03f40840c8cd097a5bc03e439f2061407095c8dfcc824c4b7a725ba33da9028ac15a74e2de56bc714f20d2aaac2d0d075b59dd03dce73a32089fa')
+groups=(python-hiq)
+
+prepare() {
+ cd "$srcdir/$_name-$pkgver"
+ # patch -p1 -i "$srcdir/$pkgname-$pkgver.patch"
+}
+
+build() {
+ cd "$srcdir/$_name-$pkgver"
+ python setup.py build
+
+ if [[ -d examples ]]; then
+ python setup.py build_ext --inplace
+ fi
+
+ if [ -d doc ]; then
+ cd doc && make html
+ fi
+}
+
+check() {
+ cd "$srcdir/$_name-$pkgver"
+
+ if [[ -d examples ]]; then
+ python examples/BV_algorithm_constant_mpi.py
+ python examples/exactgrover_mpi.py
+ python examples/grover_mpi.py
+ python examples/maximum_search_constant_mpi.py
+ python examples/phase_estimation_mpi.py
+ python examples/qecc9_sta.py
+ python examples/SymMatrixSolver_mpi.py
+ python examples/teleport_mpi.py
+ python examples/ToeplitzSimplify_constant.py
+ python examples/grover_mpi.py
+ python examples/unknown_num_search_constant_mpi.py
+ fi
+}
+
+package() {
+ depends+=("python-hiq-projectq")
+ check_depends+=("python-hiq-projectq")
+
+ cd "$srcdir/$_name-$pkgver"
+ python setup.py install --root="$pkgdir" --optimize=1 --skip-build
+
+ # Remove files that are already in python-hiq-projectq
+ pushd "$pkgdir/usr/lib/"python*/site-packages/projectq
+ rm -fv __init__.py
+ rm -fv __pycache__/__init__.*.pyc
+ rm -fv backends/__init__.py
+ rm -fv backends/__pycache__/__init__.*.pyc
+ rm -fv cengines/__init__.py
+ rm -fv cengines/__pycache__/__init__.*.pyc
+ rm -fv ops/__init__.py
+ rm -fv ops/__pycache__/__init__.*.pyc
+ popd
+
+ install -d "$pkgdir"/usr/share/doc/$pkgname
+ install -Dm 644 README.rst "$pkgdir"/usr/share/doc/$pkgname/README.rst
+
+ if [ -d doc ]; then
+ cp -r docs/_build/html "$pkgdir"/usr/share/doc/$pkgname
+ fi
+
+ if [ -d examples ]; then
+ cp -r examples "$pkgdir"/usr/share/doc/$pkgname
+ find "$pkgdir"/usr/share/doc/$pkgname/examples -type f -exec chmod 644 {} +
+ fi
+}
+
+
+# vim:set ts=2 sw=2 et: