Removed app-misc/anki-25.02.7
This commit is contained in:
		| @@ -1,13 +0,0 @@ | ||||
| AUX 23.12.1/ninja-rules-for-cargo.patch 1498 BLAKE2B 6a889be0ee0b7a04dfde9f02a58cbe1f76d7c6db8ce1155787e69af9e8d144d4c15019ebb7930595ad5f4ece68156810f0e40edccc4ebb107ace38f387fdf434 SHA512 8a5753daf0585134f3fe650e1e35d22126289b526ac7764cd56a13f684f301e06c3db400a8a058dfc3d98a634127f4c19ea87013f0a373aaea0ec29377e1836e | ||||
| AUX 24.04.1/remove-mypy-protobuf.patch 1089 BLAKE2B 665fa1661619a959b7e52ba513d11a3b029355a15a3fdac14ce81b2c4ba10426f56337305fdf87439db054fb5c42bd2b15e889d0c879eccf0f0d746aa63e7e85 SHA512 29538828c2e10bad9f265ecdf3a103d6ce119527826afc5c6bcd6c455a0d3506c207c110babb0efded77ef033966c515492c2b0afd5150d8030a739c55b66645 | ||||
| AUX 24.04.1/revert-cert-store-hack.patch 754 BLAKE2B 4679bf3538d6e8d17a6a8b80564c1e04f6516b24b30f968685185408af0eb1167d51a849c640b86a8b78e28c98067c963f37aa8a575639887db4b11d23d32e73 SHA512 f9e6629cbe7af9d45db6ca9107ed2191c6b9c4bcc4dd3be8c93ab7ba22d61790fc6e36d19a95c590ce5bca092e440ebb2c6da80c1015c70bb090b86a00fcdf98 | ||||
| AUX 24.06.3/remove-yarn.patch 1803 BLAKE2B 8cbca735a5a11ba6ceb00d00c2041304a2b29fe653d62c4ee505d4d0eeeb92db6acedd1f3fd7a19a33a38e0003078f467d7e9e444467ccad2191dc4d8573f1b5 SHA512 638438a855be839e1ca7ae9dcf12547facbea3c02e5a1be53a48172fa344f8a20bac538fcdda2c0f09ae59801dae5868e81584656d899d17713e54898836ad92 | ||||
| DIST anki-25.02.4-node_modules.tar.xz 304237316 BLAKE2B 270db46a9d7d64f87a57052f82071108e78371805e68c7d426dad268edd4f548b2ace4e7f2712597f4894e7c4d20fa7a9e72e3cd2278f023317f40361bcf3a37 SHA512 820495a61a3bf5bdaeaf40c4ae6d1b1cf3a9b2924494c40c66065b4b4214e52cfaf6477af2b7e801500e180f8c6956881c5206b049996ab0ae58f45966a368f4 | ||||
| DIST anki-25.02.5-crates.tar.xz 57606472 BLAKE2B 40f976c4e20c6ecd0877db05a733bd66b608e1e054177479ec3068a5d9d8b8dcd32495a4c81caee4e37e12090bb8b000f41f7c3162e3d7b80dbe522bca797f47 SHA512 f382f304ead6edee5c64472945ac56fb418adf046129c45771862ff5732a1a944f84e6d80ef590f11bde2ca2058c989ed70847ebb791f101af9a3ad34285d396 | ||||
| DIST anki-25.02.7.gh.tar.gz 2433971 BLAKE2B 88517d5670f658f10fe87bb2fefba8eea6e0561b69b30f4d518ac1e2a9a5b43b2eb3ec739b7b7b840c8bf127c752e85d78fa147089bb610d191375c817a2f1e1 SHA512 3d2464d3be920df8c8f35b86d1a0b1d26bf3a88a9d416195c7ab0aba748b91dcc02d357d7d1eaf1bb8f52b2a044083176c8db36608fd34de821a33ce86994d58 | ||||
| DIST anki-core-i18n-0fe0162f4a18e8ef2fbac1d9a33af8e38cf7260e.gh.tar.gz 1521578 BLAKE2B 101505d871df70316222db08f2bc85fdd00be81320600c64c76bb51565a88c13fa6fdd9e059ed404931f2dc97611cf2a954650d10d6556cd181427dbffc4f1a6 SHA512 c72eaea9e0f350d092a44f7623a7cfdcb74ff99a97ca4b53c51b1b26af387c9c6cd64bfca3dc4577c14c3ee4040b8ce1a7a50f2e209b0fa47c5297f97c92a910 | ||||
| DIST anki-desktop-ftl-17216b03db7249600542e388bd4ea124478400e5.gh.tar.gz 235720 BLAKE2B 0e1a454dbfa5f0f8750000c86b1468c7cfde99e53e6e7683820f5523963c4187e76ef40c4be4c2ef7037cc269f258fe3270ba99006912fb2844ba6cc18dc91d3 SHA512 6d91607c6b0805e6dfce8a93dbf46ac945e9b1631aa054cb98e513d7a6da64d905035b8da8ea5d10c0d700a0aa96b056748d956342fe4ddf7232f7f7540ee88a | ||||
| DIST linkcheck-184b2ca50ed39ca43da13f0b830a463861adb9ca.gh.tar.gz 19408 BLAKE2B c5e4f155f2d79d6d4340eaf3caaab8cbc0a558bc351d06b6c77ac4b61afa4172f5e3497106d5535b79911c7697a74ef8765f3fdcb7b602edb7524d6b5169a6fc SHA512 2cff7ad872c9ce3b29a8c74f9ce1ca365f6c381e1d9bc5da46bb34d0687708164ad86fb78baecdb596de37f79f891d1326b994348e51f4e74ec2731da23034d4 | ||||
| DIST rust-url-bb930b8d089f4d30d7d19c12e54e66191de47b88.gh.tar.gz 394844 BLAKE2B e3c0cabca18a77cc71bb9982bbd7d49c540f5a597c993f66fb9cf52b0a4ecce2ef909cfe9b466767c0021c3adf8a0b9733d40e90d341bd2a97b5e9cbcc8e8037 SHA512 bad4ba7801168bed869ef3b9510566ed625fe345b3209f08d781ad07a03df61c28b52d1cb3992d614ffdf5af198c33bb725f612f5010b6965d8bbb519d818e2e | ||||
| EBUILD anki-25.02.7.ebuild 9071 BLAKE2B 79771f06a96d3c5c612b7f56e50c0c23a6cfe04f85b80f4a4813004d92c2eb8f750be77ab315b6055681a4ac2001a8514b5080639e694eec22ad005fbce8cee5 SHA512 729b2816c947edb2e25f1fdafde6403964b081f3d4873d0ae88f050ec369654f9ff3d2c38d2fb52c68c4d3e409c99a441c2c2f053c9198ade71895fd58ad95fc | ||||
| MISC metadata.xml 1057 BLAKE2B 578d8af6329481d995020ad891d553e79c484654f989ed0771e444ca46ee86eee1d592a61b094d9ec05e6cdd2904b6b4688967f2dc6d872b0c30263d80643cf7 SHA512 6a76ef84655dd5f713d86e9cc8a1f1fd8a24213c79ae2c4050fb51f9739656f8272d50dfe0945d4d01861734f8a9b96060ab7fec97171ade2edc2851c2b77fac | ||||
| @@ -1,320 +0,0 @@ | ||||
| # Copyright 2022-2025 Gentoo Authors | ||||
| # Distributed under the terms of the GNU General Public License v2 | ||||
|  | ||||
| EAPI=8 | ||||
|  | ||||
| DISTUTILS_EXT=1 | ||||
| DISTUTILS_OPTIONAL=1 | ||||
| DISTUTILS_SINGLE_IMPL=1 | ||||
| DISTUTILS_USE_PEP517=no | ||||
| PYTHON_COMPAT=( python3_{11..13} ) | ||||
|  | ||||
| declare -A GIT_CRATES=( | ||||
| 	[linkcheck]='https://github.com/ankitects/linkcheck;184b2ca50ed39ca43da13f0b830a463861adb9ca;linkcheck-%commit%' | ||||
| 	[percent-encoding-iri]='https://github.com/ankitects/rust-url;bb930b8d089f4d30d7d19c12e54e66191de47b88;rust-url-%commit%/percent_encoding' | ||||
| ) | ||||
| RUST_MIN_VER="1.82.0" | ||||
|  | ||||
| inherit cargo desktop distutils-r1 greadme multiprocessing ninja-utils \ | ||||
| 	optfeature toolchain-funcs xdg | ||||
|  | ||||
| DESCRIPTION="A spaced-repetition memory training program (flash cards)" | ||||
| HOMEPAGE="https://apps.ankiweb.net/" | ||||
|  | ||||
| declare -A COMMITS=( | ||||
| 	[anki]="6381f1845ff2e79f4a424e6978c2a3e9bbb91735" | ||||
| 	[ftl-core]="0fe0162f4a18e8ef2fbac1d9a33af8e38cf7260e" | ||||
| 	[ftl-desktop]="17216b03db7249600542e388bd4ea124478400e5" | ||||
| ) | ||||
| SRC_URI="${CARGO_CRATE_URIS} | ||||
| 	https://github.com/ankitects/anki/archive/refs/tags/${PV}.tar.gz -> ${P}.gh.tar.gz | ||||
| 	https://github.com/ankitects/anki-core-i18n/archive/${COMMITS[ftl-core]}.tar.gz | ||||
| 	-> anki-core-i18n-${COMMITS[ftl-core]}.gh.tar.gz | ||||
| 	https://github.com/ankitects/anki-desktop-ftl/archive/${COMMITS[ftl-desktop]}.tar.gz | ||||
| 	-> anki-desktop-ftl-${COMMITS[ftl-desktop]}.gh.tar.gz | ||||
| 	https://github.com/gentoo-crate-dist/anki/releases/download/25.02.5/anki-25.02.5-crates.tar.xz | ||||
| 	gui? ( | ||||
| 	https://home.cit.tum.de/~salu/distfiles/anki-25.02.4-node_modules.tar.xz | ||||
| 	) | ||||
| " | ||||
| # How to get an up-to-date summary of runtime JS libs' licenses: | ||||
| # ./node_modules/.bin/license-checker-rseidelsohn --production --excludePackages anki --summary | ||||
| LICENSE="AGPL-3+ BSD public-domain gui? ( 0BSD CC-BY-4.0 GPL-3+ )" | ||||
| # Dependent crate licenses | ||||
| LICENSE+=" | ||||
| 	Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD-2 CC0-1.0 ISC MIT | ||||
| 	MPL-2.0 Unicode-3.0 Unicode-DFS-2016 Unlicense ZLIB | ||||
| " | ||||
| # Manually added crate licenses | ||||
| LICENSE+=" openssl" | ||||
| SLOT="0" | ||||
| KEYWORDS="~amd64 ~x86" | ||||
|  | ||||
| IUSE="+gui" | ||||
| REQUIRED_USE="gui? ( ${PYTHON_REQUIRED_USE} )" | ||||
| RESTRICT="!gui? ( test ) !test? ( test )" | ||||
|  | ||||
| # Dependencies: | ||||
| # Python: python/requirements.{anki,aqt}.in | ||||
| # If ENABLE_QT5_COMPAT is set at runtime | ||||
| # additionally depend on PyQt6[dbus,printsupport]. | ||||
| # Qt: qt/{aqt/{sound.py,qt/*.py},tools/build_ui.py} | ||||
| # app-misc/certificates: The rust backend library is built against | ||||
| # rustls-native-certs to use the native certificate store. | ||||
| # No ${PYTHON_DEPS} in DEPEND despite external module because it doesn't link | ||||
| # against libpython | ||||
|  | ||||
| DEPEND=" | ||||
| 	>=app-arch/zstd-1.5.5:= | ||||
| 	dev-db/sqlite:3 | ||||
| " | ||||
| GUI_RDEPEND=" | ||||
| 	${PYTHON_DEPS} | ||||
| 	dev-qt/qtsvg:6 | ||||
| 	$(python_gen_cond_dep ' | ||||
| 		dev-python/beautifulsoup4[${PYTHON_USEDEP}] | ||||
| 		dev-python/distro[${PYTHON_USEDEP}] | ||||
| 		dev-python/decorator[${PYTHON_USEDEP}] | ||||
| 		dev-python/flask[${PYTHON_USEDEP}] | ||||
| 		dev-python/flask-cors[${PYTHON_USEDEP}] | ||||
| 		dev-python/jsonschema[${PYTHON_USEDEP}] | ||||
| 		dev-python/markdown[${PYTHON_USEDEP}] | ||||
| 		dev-python/protobuf[${PYTHON_USEDEP}] | ||||
| 		>=dev-python/pyqt6-6.6.1[gui,network,opengl,quick,webchannel,widgets,${PYTHON_USEDEP}] | ||||
| 		>=dev-python/pyqt6-sip-13.6.0[${PYTHON_USEDEP}] | ||||
| 		>=dev-python/pyqt6-webengine-6.6.0[widgets,${PYTHON_USEDEP}] | ||||
| 		dev-python/requests[${PYTHON_USEDEP}] | ||||
| 		dev-python/send2trash[${PYTHON_USEDEP}] | ||||
| 		dev-python/waitress[${PYTHON_USEDEP}] | ||||
| 	') | ||||
| " | ||||
| RDEPEND=" | ||||
| 	${DEPEND} | ||||
| 	app-misc/ca-certificates | ||||
| 	gui? ( ${GUI_RDEPEND} ) | ||||
| " | ||||
|  | ||||
| BDEPEND=" | ||||
| 	>=app-arch/zstd-1.5.5:= | ||||
| 	dev-libs/protobuf[protoc(+)] | ||||
| 	virtual/pkgconfig | ||||
| 	gui? ( | ||||
| 		${PYTHON_DEPS} | ||||
| 		app-alternatives/ninja | ||||
| 		>=net-libs/nodejs-20.12.1 | ||||
| 		sys-apps/yarn | ||||
| 		$(python_gen_cond_dep ' | ||||
| 			dev-python/pyqt6[${PYTHON_USEDEP}] | ||||
| 			dev-python/wheel[${PYTHON_USEDEP}] | ||||
| 		') | ||||
| 	) | ||||
| 	test? ( | ||||
| 		${RDEPEND} | ||||
| 		app-text/dvipng | ||||
| 		app-text/texlive | ||||
| 		dev-libs/openssl | ||||
| 		dev-util/cargo-nextest | ||||
| 		$(python_gen_cond_dep 'dev-python/mock[${PYTHON_USEDEP}]') | ||||
| 	) | ||||
| " | ||||
|  | ||||
| distutils_enable_sphinx python/sphinx \ | ||||
| 			dev-python/sphinx-autoapi \ | ||||
| 			dev-python/sphinx-rtd-theme | ||||
|  | ||||
| distutils_enable_tests pytest | ||||
|  | ||||
| PATCHES=( | ||||
| 	"${FILESDIR}"/24.06.3/remove-yarn.patch | ||||
| 	"${FILESDIR}"/24.04.1/remove-mypy-protobuf.patch | ||||
| 	"${FILESDIR}"/24.04.1/revert-cert-store-hack.patch | ||||
| 	"${FILESDIR}"/23.12.1/ninja-rules-for-cargo.patch | ||||
| ) | ||||
|  | ||||
| QA_FLAGS_IGNORED="usr/bin/anki-sync-server | ||||
| 	usr/lib/python.*/site-packages/anki/_rsbridge.so" | ||||
|  | ||||
| pkg_setup() { | ||||
| 	export PROTOC_BINARY="${BROOT}"/usr/bin/protoc | ||||
| 	export LIBSQLITE3_SYS_USE_PKG_CONFIG=1 | ||||
| 	export ZSTD_SYS_USE_PKG_CONFIG=1 | ||||
| 	rust_pkg_setup | ||||
| 	use gui && python-single-r1_pkg_setup | ||||
| } | ||||
|  | ||||
| python_prepare_all() { | ||||
| 	mv "${WORKDIR}"/node_modules out || die | ||||
|  | ||||
| 	# Expected files and directories | ||||
| 	mkdir .git out/env || die | ||||
| 	mkdir -p out/pyenv/bin || die | ||||
| 	ln -s "${PYTHON}" out/pyenv/bin/python || die | ||||
|  | ||||
| 	if use doc; then | ||||
| 		sed "/^REPO_ROOT/s|=.*|= \"${S}\"|" -i python/sphinx/conf.py || die | ||||
| 	fi | ||||
|  | ||||
| 	# Unpin Yarn | ||||
| 	sed -e '/"type": "module"/s/,//' \ | ||||
| 		-e '/packageManager/d' -i package.json || die | ||||
|  | ||||
| 	# Not running the black formatter on generated files saves a dependency | ||||
| 	sed '/subprocess/d' -i pylib/tools/hookslib.py || die | ||||
|  | ||||
| 	# Fix hardcoded runner location | ||||
| 	export CARGO_TARGET_DIR="${S}"/out/rust | ||||
| 	cbuild_dir="$(CHOST=${CBUILD:-${CHOST}} cargo_target_dir)" | ||||
| 	sed "s,rust/release,${cbuild_dir##*out/}," \ | ||||
| 		-i build/ninja_gen/src/render.rs || die | ||||
| 	# Separate src_configure from runner build | ||||
| 	sed '/ConfigureBuild/d' -i build/ninja_gen/src/build.rs || die | ||||
| 	distutils-r1_python_prepare_all | ||||
| } | ||||
|  | ||||
| src_prepare() { | ||||
| 	default | ||||
| 	rm -r ftl/{core,qt}-repo || die | ||||
| 	ln -s "${WORKDIR}"/anki-core-i18n-${COMMITS[ftl-core]} ftl/core-repo || die | ||||
| 	ln -s "${WORKDIR}"/anki-desktop-ftl-${COMMITS[ftl-desktop]} ftl/qt-repo || die | ||||
|  | ||||
| 	mkdir out || die | ||||
| 	echo -e "${COMMITS[anki]:0:8}" > out/buildhash || die | ||||
|  | ||||
| 	# None of our ninja implementations are n2 | ||||
| 	sed 's/which::which("n2").*/false,/' -i build/ninja_gen/src/build.rs || die | ||||
|  | ||||
| 	use gui && distutils-r1_src_prepare | ||||
| } | ||||
|  | ||||
| _cbuild_cargo_build() { | ||||
| 	CHOST=${CBUILD:-${CHOST}} cargo_src_compile "${@}" | ||||
| } | ||||
|  | ||||
| python_configure_all() { | ||||
| 	tc-env_build _cbuild_cargo_build -p configure | ||||
|  | ||||
| 	local -x NODE_BINARY="${BROOT}"/usr/bin/node \ | ||||
| 	YARN_BINARY="${BROOT}"/usr/bin/yarn \ | ||||
| 	OFFLINE_BUILD=1 | ||||
| 	if ! use debug; then | ||||
| 		if tc-is-lto; then | ||||
| 			local -x RELEASE=2 | ||||
| 		else | ||||
| 			local -x RELEASE=1 | ||||
| 		fi | ||||
| 	fi | ||||
| 	cargo_env "${cbuild_dir}"/configure || die | ||||
| 	unset cbuild_dir | ||||
| } | ||||
|  | ||||
| src_configure() { | ||||
| 	cargo_gen_config | ||||
| 	cargo_src_configure | ||||
| 	use gui && distutils-r1_src_configure | ||||
| } | ||||
|  | ||||
| python_compile() { | ||||
| 	tc-env_build _cbuild_cargo_build -p runner | ||||
| 	cargo_env eninja -f out/build.ninja wheels | ||||
| 	local w | ||||
| 	for w in out/wheels/*.whl; do | ||||
| 		distutils_wheel_install "${BUILD_DIR}"/install ${w} | ||||
| 	done | ||||
| } | ||||
|  | ||||
| src_compile() { | ||||
| 	if use gui; then | ||||
| 		distutils-r1_src_compile | ||||
| 	else | ||||
| 		cargo_src_compile -p anki-sync-server | ||||
| 	fi | ||||
| } | ||||
|  | ||||
| python_test() { | ||||
| 	epytest qt | ||||
| 	epytest pylib | ||||
| } | ||||
|  | ||||
| python_test_all() { | ||||
| 	local nextest_opts=( | ||||
| 		cargo-verbose | ||||
| 		failure-output=immediate | ||||
| 		status-level=all | ||||
| 		test-threads=$(get_makeopts_jobs) | ||||
| 	) | ||||
| 	if [[ ! ${CARGO_TERM_COLOR} ]]; then | ||||
| 		[[ "${NOCOLOR}" = true || "${NOCOLOR}" = yes ]] && nextest_opts+=( color=never ) | ||||
| 	fi | ||||
| 	nextest_opts=( ${nextest_opts[@]/#/--} ) | ||||
| 	cargo_env cargo nextest run ${nextest_opts[@]} || die | ||||
|  | ||||
| 	eninja -f out/build.ninja check_vitest | ||||
| } | ||||
|  | ||||
| src_test() { | ||||
| 	local -x ANKI_TEST_MODE=1 | ||||
| 	distutils-r1_src_test | ||||
| } | ||||
|  | ||||
| python_install_all() { | ||||
| 	pushd qt/bundle/lin > /dev/null || die | ||||
| 	doman anki.1 | ||||
| 	doicon anki.{png,xpm} | ||||
| 	domenu anki.desktop | ||||
| 	insinto /usr/share/mime/packages | ||||
| 	doins anki.xml | ||||
| 	popd || die | ||||
| 	python_newscript - anki <<-EOF | ||||
| 		#!${EPREFIX}/usr/bin/python | ||||
| 		import sys | ||||
| 		from aqt import run | ||||
| 		sys.exit(run()) | ||||
| 	EOF | ||||
| 	distutils-r1_python_install_all | ||||
| } | ||||
|  | ||||
| src_install() { | ||||
| 	greadme_stdin <<- EOF | ||||
| 	Anki's user manual is located online at https://docs.ankiweb.net/ | ||||
| 	Anki's add-on developer manual is located online at https://addon-docs.ankiweb.net/ | ||||
| 	EOF | ||||
|  | ||||
| 	if use gui; then | ||||
| 		greadme_stdin --append <<-EOF | ||||
| 		Users with add-ons that still rely on Anki's Qt5 GUI | ||||
| 		can temporarily set the environment variable ENABLE_QT5_COMPAT to 1 to have | ||||
| 		Anki install the previous compatibility code. This option has additional | ||||
| 		runtime dependencies. Please take a look at this package's optional runtime | ||||
| 		features for a complete listing. | ||||
|  | ||||
| 		ENABLE_QT5_COMPAT may be removed in the future, so this is not a | ||||
| 		long-term solution. | ||||
| 		EOF | ||||
|  | ||||
| 		distutils-r1_src_install | ||||
| 	else | ||||
| 		cargo_src_install --path rslib/sync | ||||
| 	fi | ||||
| } | ||||
|  | ||||
| pkg_preinst() { | ||||
| 	greadme_pkg_preinst | ||||
| 	use gui && xdg_pkg_preinst | ||||
| } | ||||
|  | ||||
| pkg_postinst() { | ||||
| 	greadme_pkg_postinst | ||||
| 	if use gui; then | ||||
| 		xdg_pkg_postinst | ||||
| 		optfeature "LaTeX in cards" "app-text/texlive[extra] app-text/dvipng" | ||||
| 		optfeature "sound support" media-video/mpv media-video/mplayer | ||||
| 		optfeature "recording support" "media-sound/lame[frontend] dev-python/pyqt6[multimedia]" | ||||
| 		optfeature "faster database operations" dev-python/orjson | ||||
| 		optfeature "compatibility with Qt5-dependent add-ons" dev-python/pyqt6[dbus,printsupport] | ||||
| 		optfeature "Vulkan driver" "media-libs/vulkan-loader dev-qt/qtbase:6[vulkan] | ||||
| 			dev-qt/qtdeclarative:6[vulkan] dev-qt/qtwebengine:6[vulkan]" | ||||
|  | ||||
| 		einfo "You can customize the LaTeX header for your cards to fit your needs:" | ||||
| 		einfo "Notes > Manage Note Types > [select a note type] > Options" | ||||
| 	fi | ||||
| } | ||||
| @@ -1,40 +0,0 @@ | ||||
| Fix the output path for Rust binaries in the Ninja file to match | ||||
| Cargo's target directory when CARGO_BUILD_TARGET is set.  This prevents | ||||
| file-not-found errors for some build steps. | ||||
|  | ||||
| Provide the cargo-nextest binary ourselves to prevent network access. | ||||
| Set test runner options in the ebuild. | ||||
|  | ||||
| From: Lucio Sauer <watermanpaint@posteo.net> | ||||
| --- a/build/ninja_gen/src/cargo.rs | ||||
| +++ b/build/ninja_gen/src/cargo.rs | ||||
| @@ -61,6 +61,9 @@ impl RustOutput<'_> { | ||||
|          let mut path: Utf8PathBuf = rust_base.into(); | ||||
|          if let Some(target) = target { | ||||
|              path = path.join(target); | ||||
| +        } else { | ||||
| +            let triple = std::env::var("CARGO_BUILD_TARGET").unwrap_or_default(); | ||||
| +            path = path.join(triple); | ||||
|          } | ||||
|          path = path.join(profile_output_dir(build_profile)).join(filename); | ||||
|          path.to_string() | ||||
| @@ -152,19 +155,11 @@ impl BuildAction for CargoTest { | ||||
|   | ||||
|      fn files(&mut self, build: &mut impl FilesHandle) { | ||||
|          build.add_inputs("", &self.inputs); | ||||
| -        build.add_inputs("", inputs![":cargo-nextest"]); | ||||
|          build.add_env_var("ANKI_TEST_MODE", "1"); | ||||
|          build.add_output_stamp("tests/cargo_test"); | ||||
|      } | ||||
|   | ||||
|      fn on_first_instance(&self, build: &mut Build) -> Result<()> { | ||||
| -        build.add_action( | ||||
| -            "cargo-nextest", | ||||
| -            CargoInstall { | ||||
| -                binary_name: "cargo-nextest", | ||||
| -                args: "cargo-nextest --version 0.9.57 --locked", | ||||
| -            }, | ||||
| -        )?; | ||||
|          setup_flags(build) | ||||
|      } | ||||
|  } | ||||
| @@ -1,28 +0,0 @@ | ||||
| https://github.com/nipunn1313/mypy-protobuf has not yet been packaged. | ||||
| It adds typing information to Anki and is only needed for development. | ||||
|  | ||||
| I have packaged some of its test-dependencies on ::guru. Unfortunately, | ||||
| I'm not too happy yet with the quality of the transitive test-dep | ||||
| dev-python/pytest-mypy-plugins. Any help is welcome! | ||||
|  | ||||
| From: Lucio Sauer <watermanpaint@posteo.net> | ||||
| --- a/build/configure/src/python.rs | ||||
| +++ b/build/configure/src/python.rs | ||||
| @@ -90,9 +90,7 @@ pub struct GenPythonProto { | ||||
|  impl BuildAction for GenPythonProto { | ||||
|      fn command(&self) -> &str { | ||||
|          "$protoc $ | ||||
| -        --plugin=protoc-gen-mypy=$protoc-gen-mypy $ | ||||
|          --python_out=$builddir/pylib $ | ||||
| -        --mypy_out=$builddir/pylib $ | ||||
|          -Iproto $in" | ||||
|      } | ||||
|   | ||||
| @@ -110,7 +108,6 @@ impl BuildAction for GenPythonProto { | ||||
|              .collect(); | ||||
|          build.add_inputs("in", &self.proto_files); | ||||
|          build.add_inputs("protoc", inputs![":protoc_binary"]); | ||||
| -        build.add_inputs("protoc-gen-mypy", inputs![":pyenv:protoc-gen-mypy"]); | ||||
|          build.add_outputs("", python_outputs); | ||||
|      } | ||||
|   | ||||
| @@ -1,21 +0,0 @@ | ||||
| pip_system_certs is a hack to force certifi to use the system | ||||
| certificate store.  Let's use dev-python/certifi, which is a hack of | ||||
| its own, instead of introducing an automagical dependency. | ||||
|  | ||||
| From: Lucio Sauer <watermanpaint@posteo.net> | ||||
| --- a/qt/aqt/__init__.py | ||||
| +++ b/qt/aqt/__init__.py | ||||
| @@ -6,13 +6,6 @@ from __future__ import annotations | ||||
|  import logging | ||||
|  import sys | ||||
|   | ||||
| -try: | ||||
| -    import pip_system_certs.wrapt_requests | ||||
| -except ModuleNotFoundError: | ||||
| -    print( | ||||
| -        "Python module pip_system_certs is not installed. System certificate store and custom SSL certificates may not work. See: https://github.com/ankitects/anki/issues/3016" | ||||
| -    ) | ||||
| - | ||||
|  if sys.version_info[0] < 3 or sys.version_info[1] < 9: | ||||
|      raise Exception("Anki requires Python 3.9+") | ||||
|   | ||||
| @@ -1,58 +0,0 @@ | ||||
| Pre-built node_modules allows us to run JS tests but we lose the ability to | ||||
| hack node packages' source files in YARN_CACHE_FOLDER. | ||||
|  | ||||
| From: Lucio Sauer <watermanpaint@posteo.net> | ||||
| --- a/build/ninja_gen/src/node.rs | ||||
| +++ b/build/ninja_gen/src/node.rs | ||||
| @@ -76,12 +76,11 @@ pub struct YarnInstall<'a> { | ||||
|   | ||||
|  impl BuildAction for YarnInstall<'_> { | ||||
|      fn command(&self) -> &str { | ||||
| -        "$runner yarn $yarn $out" | ||||
| +        "$runner yarn $out" | ||||
|      } | ||||
|   | ||||
|      fn files(&mut self, build: &mut impl build::FilesHandle) { | ||||
|          build.add_inputs("", &self.package_json_and_lock); | ||||
| -        build.add_inputs("yarn", inputs![":yarn:bin"]); | ||||
|          build.add_outputs("out", vec!["node_modules/.marker"]); | ||||
|          for (key, value) in &self.exports { | ||||
|              let outputs: Vec<_> = value.iter().map(|o| format!("node_modules/{o}")).collect(); | ||||
| --- a/build/runner/src/yarn.rs | ||||
| +++ b/build/runner/src/yarn.rs | ||||
| @@ -1,36 +1,18 @@ | ||||
|  // Copyright: Ankitects Pty Ltd and contributors | ||||
|  // License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html | ||||
|   | ||||
| -use std::env; | ||||
|  use std::path::Path; | ||||
| -use std::process::Command; | ||||
|   | ||||
|  use clap::Args; | ||||
|   | ||||
| -use crate::run::run_command; | ||||
| - | ||||
|  #[derive(Args)] | ||||
|  pub struct YarnArgs { | ||||
| -    yarn_bin: String, | ||||
|      stamp: String, | ||||
|  } | ||||
|   | ||||
|  pub fn setup_yarn(args: YarnArgs) { | ||||
|      link_node_modules(); | ||||
|   | ||||
| -    if env::var("OFFLINE_BUILD").is_ok() { | ||||
| -        println!("OFFLINE_BUILD is set"); | ||||
| -        println!("Running yarn with '--offline' and '--ignore-scripts'."); | ||||
| -        run_command( | ||||
| -            Command::new(&args.yarn_bin) | ||||
| -                .arg("install") | ||||
| -                .arg("--offline") | ||||
| -                .arg("--ignore-scripts"), | ||||
| -        ); | ||||
| -    } else { | ||||
| -        run_command(Command::new(&args.yarn_bin).arg("install")); | ||||
| -    } | ||||
| - | ||||
|      std::fs::write(args.stamp, b"").unwrap(); | ||||
|  } | ||||
| @@ -1,31 +0,0 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> | ||||
| <pkgmetadata> | ||||
| 	<maintainer type="person" proxied="yes"> | ||||
| 		<email>watermanpaint@posteo.net</email> | ||||
| 		<name>Lucio Sauer</name> | ||||
| 	</maintainer> | ||||
| 	<maintainer type="project" proxied="proxy"> | ||||
| 		<email>proxy-maint@gentoo.org</email> | ||||
| 		<name>Proxy Maintainers</name> | ||||
| 	</maintainer> | ||||
| 	<longdescription lang="en"> | ||||
| 		Anki is a program designed to help you remember facts | ||||
| 		(such as words and phrases in a foreign language) as | ||||
| 		quickly, easily and efficiently as possible. | ||||
| 	</longdescription> | ||||
| 	<upstream> | ||||
| 		<bugs-to>https://forums.ankiweb.net/c/anki/21</bugs-to> | ||||
| 		<changelog>https://github.com/ankitects/anki/releases</changelog> | ||||
| 		<doc>https://docs.ankiweb.net/</doc> | ||||
| 		<maintainer status="active"> | ||||
| 			<name>Damien Elmes</name> | ||||
| 		</maintainer> | ||||
| 		<remote-id type="github">ankitects/anki</remote-id> | ||||
| 	</upstream> | ||||
| 	<use> | ||||
| 		<flag name="gui"> | ||||
| 			Enable support for a graphical user interface. Disable for standalone sync server. | ||||
| 		</flag> | ||||
| 	</use> | ||||
| </pkgmetadata> | ||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
		Reference in New Issue
	
	Block a user