mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2025-12-08 00:05:33 +03:00
app-misc/anki: drop 25.09
Signed-off-by: Lucio Sauer <watermanpaint@posteo.net> Part-of: https://github.com/gentoo/gentoo/pull/43914 Closes: https://github.com/gentoo/gentoo/pull/43914 Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
parent
d6ed58bbe9
commit
f6e5e020c3
@ -1,11 +1,7 @@
|
||||
DIST anki-25.09-crates.tar.xz 61467196 BLAKE2B e6fc583b140ae8c83cdaf4faff734b0b21ccff3b19e7f79331ce31d1fa14764df88e9fa772897bfee37d645bb04b31ac56b6a4b636a7b6645ca6568a3ed3221b SHA512 b72c7bb666c6a4a1c460f49d3f1d09e9ec6cf2e677751f145bc8679c229202433f3de59a0e5faf4b774ef15e4d68ad3cb67a93ef9241a08382f829e7e2d55fe7
|
||||
DIST anki-25.09-node_modules.tar.xz 189664744 BLAKE2B eb04828909dd52712679439cca5557a7dd7d015e27bb8423aa2286f0004fa07320976222374e5a732817d7af7227efbffccfe11f8c3a42ca50af13640bc97fdf SHA512 9695fbce75bc6da741f012b961f7de2972cda49c088e8803d8276f5eb2b3963ac94667bd6ab4b5a40d96ca5d3c107305c5c47f8b62fc232f6bfc71be808d1fe6
|
||||
DIST anki-25.09.2-node_modules.tar.xz 190657312 BLAKE2B bdffa2a5c3d9145e64c283c3a7894feba91ccca8d449453f8dbcaa8a2c4a01562a970293e6fcba54d3e7836bba0e53441349c3a4d940f3390efdf3307999a865 SHA512 79b181f213cf81aac54f6177f879bf0b49ebcbdea3d533799ee55c8498509f9a56ca636902c48aad791ec7290522c2029bd514855b2f81bdbdee273d54ed2cbe
|
||||
DIST anki-25.09.2.gh.tar.gz 2518022 BLAKE2B 882cd4e6ec6b046e4f0ed7d872fbb44247cb56eb9ef94cf87c116c4b354d786d8944710bd7c96d2b07e698fd75fb986c66733247662a5398570bca8b22e86e6e SHA512 45429bbbd00af35ea7886ec50cdd55ae95e85b5f459802fc0301d223882e1b485d279d5d0ecf7cfe9fa8826281cc9bcc62cdcce869c164447f7bbfa6955a32cc
|
||||
DIST anki-25.09.gh.tar.gz 2518339 BLAKE2B b3d3bd70382c889077f9c9ffe471372adc56e7fed8d9362c95571722196fd96d14db5719e2c5d562d7b0888f402e00007bac7b02be00b1ed3ff6a133becbd971 SHA512 ad56479c7aa6d57e3f96529aa5ba93560d5cb31b774152af19af8f6418d6e91b947a62127c7a04c49f8eb7e83955e85c57ee4f5f6a75f682df67abd847b53dc6
|
||||
DIST anki-core-i18n-480ef0da728c7ea3485c58529ae7ee02be3e5dba.gh.tar.gz 1734976 BLAKE2B 42e47f1e41fb5f61ebd0ac0b272802de802ac6d4a6c3e6513ef01453daf9488bb8c2e1b34f0fe8494e2d31d9dd1b982c890bdd3671e435c2e1a77a740a10d2ea SHA512 bd3d08b09a4a459927dfacce5f7f263fd879501759949887f9b9cccec6b6fa0ec4ba025b9053b1224631e21cee9a693d995c7f0c663aa66348f4e0d6b547c1dc
|
||||
DIST anki-core-i18n-6552c95a81d162422b2a50126547cc7f1b50c2fd.gh.tar.gz 1731528 BLAKE2B 2ec2f7ab687eb7d8848fff021704c9f689a5f81b2693edf6c40bdd3eaf793f71da3da0d1ec6ad23ee9e23dbae15bb68c84f53c1d8ced6ed0d055aacd6aab8dd4 SHA512 fc65966f77ea00c61c013fa646e7c9d9e276ddc1126f7a754ff468078ec0b10c0376e21f07a8add299846150985651bd1879ef7fe18b5dbdcf025a337bb53550
|
||||
DIST anki-desktop-ftl-dad4e2736a2b53dcdb52d79b5703dd464c05d666.gh.tar.gz 256169 BLAKE2B 6307910c26ca9408c343423828844359ad249d08eddbdcfdd1832f7fe5c6417c594afbcd08096dc60869db278599394e101b2039710cc4cf0233cdc7ebd0a05d SHA512 4ea7ce3f02c35ed7e04729d2ccdef102a2f87a2361716bb8e2df7a960884923119fe21b079d09e1a64565620623281616acd5f5bf72bbe98a6bd1d2f167c4b53
|
||||
DIST anki-desktop-ftl-fd5f984785ad07a0d3dbd893ee3d7e3671eaebd6.gh.tar.gz 256177 BLAKE2B 5054275134239cf7a4de7748f7701384a4c962931153db95c19551dd25a8c51f8f54e91ae5de1dea0e3a6f565fda11fae4dbba7232ecdd30d01f6c4fe3c2ea2b SHA512 32fb236e56459e04bc8dc1611f4e8736c97f591e1e454c9576a64ee057dd76b5efff3b9ae05e949653b6e7959644baa28057e3ff3729f79a8d868c415ed58cb9
|
||||
DIST linkcheck-184b2ca50ed39ca43da13f0b830a463861adb9ca.gh.tar.gz 19408 BLAKE2B c5e4f155f2d79d6d4340eaf3caaab8cbc0a558bc351d06b6c77ac4b61afa4172f5e3497106d5535b79911c7697a74ef8765f3fdcb7b602edb7524d6b5169a6fc SHA512 2cff7ad872c9ce3b29a8c74f9ce1ca365f6c381e1d9bc5da46bb34d0687708164ad86fb78baecdb596de37f79f891d1326b994348e51f4e74ec2731da23034d4
|
||||
DIST rust-url-bb930b8d089f4d30d7d19c12e54e66191de47b88.gh.tar.gz 394844 BLAKE2B e3c0cabca18a77cc71bb9982bbd7d49c540f5a597c993f66fb9cf52b0a4ecce2ef909cfe9b466767c0021c3adf8a0b9733d40e90d341bd2a97b5e9cbcc8e8037 SHA512 bad4ba7801168bed869ef3b9510566ed625fe345b3209f08d781ad07a03df61c28b52d1cb3992d614ffdf5af198c33bb725f612f5010b6965d8bbb519d818e2e
|
||||
|
||||
@ -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=hatchling
|
||||
PYTHON_COMPAT=( python3_{11..14} )
|
||||
|
||||
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.88.0"
|
||||
|
||||
inherit cargo desktop distutils-r1 edo greadme multiprocessing ninja-utils \
|
||||
optfeature toolchain-funcs xdg-utils
|
||||
|
||||
DESCRIPTION="Smart spaced repetition flashcard program"
|
||||
HOMEPAGE="https://apps.ankiweb.net/"
|
||||
|
||||
declare -A COMMITS=(
|
||||
[anki]="539054c34dccf8b89ca7ea9c9c40ecaf172de759"
|
||||
[ftl-core]="6552c95a81d162422b2a50126547cc7f1b50c2fd"
|
||||
[ftl-desktop]="dad4e2736a2b53dcdb52d79b5703dd464c05d666"
|
||||
)
|
||||
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/${PV}/${P}-crates.tar.xz
|
||||
gui? (
|
||||
https://home.cit.tum.de/~salu/distfiles/${P}-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? ( CC0-1.0 CC-BY-4.0 )
|
||||
"
|
||||
# Dependent crate licenses
|
||||
LICENSE+="
|
||||
Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD-2 CC0-1.0
|
||||
CDLA-Permissive-2.0 ISC MIT MPL-2.0 Unicode-3.0 Unlicense ZLIB
|
||||
"
|
||||
# ring crate
|
||||
LICENSE+=" openssl"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64"
|
||||
|
||||
IUSE="+gui"
|
||||
REQUIRED_USE="
|
||||
doc? ( gui )
|
||||
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} )
|
||||
"
|
||||
IDEPEND="
|
||||
gui? (
|
||||
dev-util/desktop-file-utils
|
||||
x11-misc/shared-mime-info
|
||||
)
|
||||
"
|
||||
BDEPEND="
|
||||
>=app-arch/zstd-1.5.5:=
|
||||
dev-libs/protobuf[protoc(+)]
|
||||
virtual/pkgconfig
|
||||
gui? (
|
||||
${DISTUTILS_DEPS}
|
||||
${PYTHON_DEPS}
|
||||
app-alternatives/ninja
|
||||
>=net-libs/nodejs-20.12.1
|
||||
sys-apps/yarn
|
||||
$(python_gen_cond_dep 'dev-python/pyqt6[${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
|
||||
|
||||
EPYTEST_PLUGINS=()
|
||||
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
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
python_prepare() {
|
||||
ln -s "${PYTHON}" out/pyenv/bin/python || die
|
||||
}
|
||||
|
||||
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 \
|
||||
UV_BINARY="${BROOT}"/bin/true \
|
||||
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 edo "${cbuild_dir}"/configure
|
||||
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 pylib qt
|
||||
declare -A wheel_tags=(
|
||||
[pylib]="cp39-abi3-manylinux_2_36_x86_64"
|
||||
[qt]="py3-none-any"
|
||||
)
|
||||
local dir
|
||||
for dir in ${!wheel_tags[@]}; do
|
||||
pushd ${dir} > /dev/null || die
|
||||
local -x ANKI_WHEEL_TAG=${wheel_tags[${dir}]}
|
||||
distutils-r1_python_compile
|
||||
popd || die
|
||||
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 -x NEXTEST_TEST_THREADS="$(makeopts_jobs)"
|
||||
edo cargo nextest run $(usev !debug '--release') \
|
||||
--color always \
|
||||
--all-features \
|
||||
--tests \
|
||||
--no-fail-fast
|
||||
eninja -f out/build.ninja check_vitest
|
||||
}
|
||||
|
||||
src_test() {
|
||||
local -x ANKI_TEST_MODE=1
|
||||
distutils-r1_src_test
|
||||
}
|
||||
|
||||
python_install_all() {
|
||||
pushd qt/launcher/lin > /dev/null || die
|
||||
doman anki.1
|
||||
doicon anki.{png,xpm}
|
||||
domenu anki.desktop
|
||||
insinto /usr/share/mime/packages
|
||||
doins anki.xml
|
||||
popd || die
|
||||
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
|
||||
distutils-r1_src_install
|
||||
else
|
||||
cargo_src_install --path rslib/sync
|
||||
fi
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
greadme_pkg_postinst
|
||||
if use gui; then
|
||||
xdg_desktop_database_update
|
||||
xdg_mimeinfo_database_update
|
||||
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 "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
|
||||
}
|
||||
|
||||
pkg_postrm() {
|
||||
if use gui; then
|
||||
xdg_desktop_database_update
|
||||
xdg_mimeinfo_database_update
|
||||
fi
|
||||
}
|
||||
@ -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();
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user