summaryrefslogtreecommitdiff
blob: 77026b12bc5ade91e5dd0baf077ece6dccb2832e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Copyright 2022-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{9..10} )

inherit distutils-r1

DESCRIPTION="Library for analysis, compilation, synthesis, optimization of quantum circuits"
HOMEPAGE="https://github.com/boschmitt/tweedledum"
SRC_URI="https://github.com/boschmitt/tweedledum/archive/refs/tags/v${PV}.tar.gz -> ${P}.gh.tar.gz"
# Drop on next bump, see bug #858200
SRC_URI+=" https://github.com/boschmitt/tweedledum/commit/e73beb23a3feeba02a851e3f8131e3c85a29de2b.patch -> ${P}-fmt-e73beb23a3feeba02a851e3f8131e3c85a29de2b.patch"

LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64"

# Unbundle dev-python/pybind11[${PYTHON_USEDEP}]?
RDEPEND="
	dev-cpp/nlohmann_json
	dev-libs/libfmt:=
"
DEPEND="
	${RDEPEND}
	dev-cpp/eigen
"
BDEPEND=">=dev-python/scikit-build-0.12.0"

PATCHES=(
	"${DISTDIR}"/${P}-fmt-e73beb23a3feeba02a851e3f8131e3c85a29de2b.patch
	"${FILESDIR}"/${PN}-1.1.1-gcc-13.patch
)

distutils_enable_tests pytest

python_compile() {
	# -DTWEEDLEDUM_USE_EXTERNAL_PYBIND11=ON
	local -x SKBUILD_CONFIGURE_OPTIONS="-DCMAKE_BUILD_TYPE=RelWithDebInfo"
	distutils-r1_python_compile
}

python_test() {
	epytest python/test
}