summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Dünkelmann2020-12-07 15:26:47 +0100
committerMartin Dünkelmann2020-12-07 18:17:39 +0100
commit795b3f63ca9aff9e7079f7261a5c0c981866147f (patch)
treeb4cd15e70448999417cf69397959938516624aae
parent3f2c554163e9cc9570833c513b6088250dccb1d2 (diff)
downloadaur-795b3f63ca9aff9e7079f7261a5c0c981866147f.tar.gz
Sync with https://www.archlinux.org/packages/community/x86_64/anki/
Fix build & installation
-rw-r--r--.SRCINFO35
-rw-r--r--0001-Move-aqt_data-to-sys.prefix-share.patch45
-rw-r--r--0002-Remove-bad-build-steps-from-makefiles.patch94
-rw-r--r--0003-Compile-.py-s-before-building-wheel.patch43
-rw-r--r--0004-Disable-auto-updates.patch29
-rw-r--r--0005-Make-pyenv-target-just-create-venv.patch45
-rw-r--r--PKGBUILD117
7 files changed, 380 insertions, 28 deletions
diff --git a/.SRCINFO b/.SRCINFO
index a9508eb896f9..6f363b291ffc 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,23 +1,46 @@
pkgbase = anki-git
pkgdesc = Helps you remember facts (like words/phrases in a foreign language) efficiently
- pkgver = r1940.9396d74
+ pkgver = r5491.c505894b8
pkgrel = 1
url = http://ankisrs.net/
arch = any
license = AGPL3
- depends = python-pyqt5
+ makedepends = git
+ makedepends = rsync
+ makedepends = bazel
+ makedepends = clang
+ makedepends = maturin
+ makedepends = rust
+ makedepends = python-pip
+ makedepends = python-mypy-protobuf
+ makedepends = npm
+ makedepends = typescript
depends = python-beautifulsoup4
- depends = python-httplib2
- depends = python-pyaudio
depends = python-requests
+ depends = python-wheel
+ depends = python-pysocks
+ depends = python-decorator
+ depends = python-protobuf
+ depends = python-orjson
+ depends = python-distro
depends = python-send2trash
- depends = qt5-webengine
+ depends = python-markdown
+ depends = python-jsonschema
+ depends = python-pyaudio
depends = python-pyqtwebengine
- optdepends = mplayer: sound playing
+ depends = python-flask
+ depends = python-flask-cors
+ depends = python-waitress
+ depends = python-pyqt5
+ optdepends = lame: record sound
+ optdepends = mpv: play sound. prefered over mplayer
+ optdepends = mplayer: play sound
provides = anki
conflicts = anki
conflicts = anki20
+ conflicts = anki-official-binary-bundle
source = anki-git::git+https://github.com/dae/anki.git
+ source = 0004-Disable-auto-updates.patch
sha512sums = SKIP
pkgname = anki-git
diff --git a/0001-Move-aqt_data-to-sys.prefix-share.patch b/0001-Move-aqt_data-to-sys.prefix-share.patch
new file mode 100644
index 000000000000..3c73464724fd
--- /dev/null
+++ b/0001-Move-aqt_data-to-sys.prefix-share.patch
@@ -0,0 +1,45 @@
+From 71c4f41d5408731496abe294ce202160b7f3912c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Johannes=20L=C3=B6thberg?= <johannes@kyriasis.com>
+Date: Sun, 29 Mar 2020 06:24:43 +0200
+Subject: [PATCH 1/5] Move aqt_data to sys.prefix/share
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+These files do _not_ belong right under sys.prefix.
+
+Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
+---
+ qt/aqt/utils.py | 2 +-
+ qt/setup.py | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/qt/aqt/utils.py b/qt/aqt/utils.py
+index b9a2983b..f97c5f19 100644
+--- a/qt/aqt/utils.py
++++ b/qt/aqt/utils.py
+@@ -24,7 +24,7 @@ if TYPE_CHECKING:
+
+ def aqt_data_folder() -> str:
+ # wheel install?
+- dir = os.path.join(sys.prefix, "aqt_data")
++ dir = os.path.join(sys.prefix,"share", "aqt_data")
+ if not os.path.exists(dir) or not os.listdir(dir):
+ # running in place?
+ dir = os.path.join(os.path.dirname(__file__), "..", "aqt_data")
+diff --git a/qt/setup.py b/qt/setup.py
+index 831532e0..da243f9b 100644
+--- a/qt/setup.py
++++ b/qt/setup.py
+@@ -8,7 +8,7 @@ import setuptools
+ def package_files(directory):
+ entries = []
+ for (path, directories, filenames) in os.walk(directory):
+- entries.append((path, [os.path.join(path, f) for f in filenames]))
++ entries.append((os.path.join("share", path), [os.path.join(path, f) for f in filenames]))
+ return entries
+
+
+--
+2.29.2
+
diff --git a/0002-Remove-bad-build-steps-from-makefiles.patch b/0002-Remove-bad-build-steps-from-makefiles.patch
new file mode 100644
index 000000000000..2a347e969d98
--- /dev/null
+++ b/0002-Remove-bad-build-steps-from-makefiles.patch
@@ -0,0 +1,94 @@
+From 2f3da2ef25943d468d6d992589979f1c92f3fb92 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Johannes=20L=C3=B6thberg?= <johannes@kyriasis.com>
+Date: Sun, 29 Mar 2020 05:54:00 +0200
+Subject: [PATCH 2/5] Remove bad build steps from makefiles
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
+---
+ Makefile | 2 +-
+ pylib/Makefile | 4 ++--
+ qt/Makefile | 2 +-
+ rslib/Makefile | 2 +-
+ rspy/Makefile | 2 +-
+ 5 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index d99e115a..cffa2e30 100644
+--- a/Makefile
++++ b/Makefile
+@@ -90,7 +90,7 @@ buildhash:
+ fi
+
+ .PHONY: develop
+-develop: pyenv buildhash prepare
++develop: pyenv buildhash
+ @set -eu -o pipefail ${SHELLFLAGS}; \
+ . "${ACTIVATE_SCRIPT}"; \
+ for dir in $(DEVEL); do \
+diff --git a/pylib/Makefile b/pylib/Makefile
+index 5cb14e09..8d8388c3 100644
+--- a/pylib/Makefile
++++ b/pylib/Makefile
+@@ -41,7 +41,7 @@ all: check
+
+ PROTODEPS := ../proto/backend.proto ../proto/fluent.proto
+
+-.build/py-proto: .build/dev-deps $(PROTODEPS)
++.build/py-proto: $(PROTODEPS)
+ protoc --proto_path=../proto --python_out=anki --mypy_out=anki $(PROTODEPS)
+ perl -i'' -pe 's/from fluent_pb2/from anki.fluent_pb2/' anki/backend_pb2.pyi
+ perl -i'' -pe 's/import fluent_pb2/import anki.fluent_pb2/' anki/backend_pb2.py
+@@ -54,7 +54,7 @@ PROTODEPS := ../proto/backend.proto ../proto/fluent.proto
+ python -m black -t py36 anki/hooks.py
+ @touch $@
+
+-BUILD_STEPS := .build/vernum .build/run-deps .build/dev-deps anki/buildinfo.py .build/py-proto .build/hooks
++BUILD_STEPS := .build/vernum .build/run-deps .build/dev-deps anki/buildinfo.py .build/py-proto
+
+ # Checking
+ ######################
+diff --git a/qt/Makefile b/qt/Makefile
+index 4fc6b482..b50d1868 100644
+--- a/qt/Makefile
++++ b/qt/Makefile
+@@ -64,7 +64,7 @@ TSDEPS := $(wildcard ts/src/*.ts) $(wildcard ts/scss/*.scss)
+ python -m black aqt/gui_hooks.py
+ @touch $@
+
+-BUILD_STEPS := .build/vernum .build/run-deps .build/dev-deps .build/js .build/ui aqt/buildinfo.py .build/hooks .build/i18n
++BUILD_STEPS := .build/vernum .build/js .build/ui aqt/buildinfo.py .build/i18n
+
+ # Checking
+ ######################
+diff --git a/rslib/Makefile b/rslib/Makefile
+index 7a18b53e..aa42c712 100644
+--- a/rslib/Makefile
++++ b/rslib/Makefile
+@@ -25,7 +25,7 @@ fix:
+ clean:
+ rm -rf .build target
+
+-develop: .build/vernum ftl/repo
++develop: .build/vernum
+
+ ftl/repo:
+ (cd ftl && ./scripts/fetch-latest-translations)
+diff --git a/rspy/Makefile b/rspy/Makefile
+index 5eb9ea8f..ed401be9 100644
+--- a/rspy/Makefile
++++ b/rspy/Makefile
+@@ -52,7 +52,7 @@ all: develop
+
+ develop: .build/develop
+
+-DEPS := .build/tools .build/vernum ../meta/buildhash \
++DEPS := .build/vernum ../meta/buildhash \
+ $(wildcard $(QT_FTL_TEMPLATES)/*.ftl) \
+ $(wildcard $(QT_FTL_LOCALES)/*/*.ftl) \
+ $(shell "${FIND}" ../rslib/src -name '*.rs' -or -name '*.sql') $(wildcard ../proto/*) \
+--
+2.29.2
+
diff --git a/0003-Compile-.py-s-before-building-wheel.patch b/0003-Compile-.py-s-before-building-wheel.patch
new file mode 100644
index 000000000000..98ed8720a09e
--- /dev/null
+++ b/0003-Compile-.py-s-before-building-wheel.patch
@@ -0,0 +1,43 @@
+From 251f15df8ca3419b0cc92f6196f23b1186ff12bc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Johannes=20L=C3=B6thberg?= <johannes@kyriasis.com>
+Date: Mon, 4 May 2020 18:46:38 +0200
+Subject: [PATCH 3/5] Compile .py's before building wheel
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
+---
+ pylib/Makefile | 2 ++
+ qt/Makefile | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/pylib/Makefile b/pylib/Makefile
+index 8d8388c3..78480c0c 100644
+--- a/pylib/Makefile
++++ b/pylib/Makefile
+@@ -105,6 +105,8 @@ build: .build/build
+
+ .build/build: $(BUILD_STEPS) $(CHECKDEPS)
+ rm -rf dist build
++ python setup.py build
++ python -O -m compileall .
+ python setup.py -q bdist_wheel
+ rsync -a dist/*.whl ../dist/
+ touch $@
+diff --git a/qt/Makefile b/qt/Makefile
+index b50d1868..acf50d6e 100644
+--- a/qt/Makefile
++++ b/qt/Makefile
+@@ -137,6 +137,8 @@ build: .build/build
+ .build/build: $(BUILD_STEPS) $(CHECKDEPS) $(wildcard ../ts/dist/*)
+ rm -rf dist build
+ rsync -a ../ts/dist/ aqt_data/web/
++ python setup.py build
++ python -O -m compileall .
+ python setup.py -q bdist_wheel
+ rsync -a dist/*.whl ../dist/
+ touch $@
+--
+2.29.2
+
diff --git a/0004-Disable-auto-updates.patch b/0004-Disable-auto-updates.patch
new file mode 100644
index 000000000000..d2c14c44d5ac
--- /dev/null
+++ b/0004-Disable-auto-updates.patch
@@ -0,0 +1,29 @@
+From bd0d5b6fde2ff0d3ca2fe8a6bdf59ce6e0fa1058 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Johannes=20L=C3=B6thberg?= <johannes@kyriasis.com>
+Date: Mon, 4 May 2020 17:57:29 +0200
+Subject: [PATCH 4/5] Disable auto updates
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
+---
+ qt/aqt/update.py | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/qt/aqt/update.py b/qt/aqt/update.py
+index 8b179f65..a46618b8 100644
+--- a/qt/aqt/update.py
++++ b/qt/aqt/update.py
+@@ -33,6 +33,8 @@ class LatestVersionFinder(QThread):
+ }
+
+ def run(self):
++ return
++
+ if not self.config["updates"]:
+ return
+ d = self._data()
+--
+2.29.2
+
diff --git a/0005-Make-pyenv-target-just-create-venv.patch b/0005-Make-pyenv-target-just-create-venv.patch
new file mode 100644
index 000000000000..7f10676fa98c
--- /dev/null
+++ b/0005-Make-pyenv-target-just-create-venv.patch
@@ -0,0 +1,45 @@
+From 894a3e04560ca11651016ede480fb372e8a2d45b Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Johannes=20L=C3=B6thberg?= <johannes@kyriasis.com>
+Date: Sat, 7 Nov 2020 17:01:04 +0100
+Subject: [PATCH 5/5] Make pyenv target just create venv
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
+---
+ Makefile | 18 +-----------------
+ 1 file changed, 1 insertion(+), 17 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index cffa2e30..d7233235 100644
+--- a/Makefile
++++ b/Makefile
+@@ -61,23 +61,7 @@ all: run
+ # - modern pip required for wheel
+ # - add qt if missing
+ pyenv:
+-# https://github.com/PyO3/maturin/issues/283 - Expected `python` to be a python interpreter inside a virtualenv
+- set -eu -o pipefail ${SHELLFLAGS}; \
+- "${PYTHON_BIN}" -m venv pyenv; \
+- case "$$(uname -s)" in CYGWIN*|MINGW*|MSYS*) \
+- dos2unix "${ACTIVATE_SCRIPT}"; \
+- VIRTUAL_ENV="$$(pwd)"; \
+- VIRTUAL_ENV="$$(cygpath -m "$${VIRTUAL_ENV}")"; \
+- sed -i -- "s@VIRTUAL_ENV=\".*\"@VIRTUAL_ENV=\"$$(pwd)/pyenv\"@g" "${ACTIVATE_SCRIPT}"; \
+- sed -i -- "s@export PATH@export PATH; VIRTUAL_ENV=\"$${VIRTUAL_ENV}/pyenv\";@g" "${ACTIVATE_SCRIPT}"; \
+- ;; esac; \
+- . "${ACTIVATE_SCRIPT}"; \
+- python --version; \
+- python -m pip install --upgrade pip setuptools; \
+- ${ANKI_EXTRA_PIP}; \
+- if ! python -c 'import PyQt5' 2>/dev/null; then \
+- python -m pip install -r qt/requirements.qt; \
+- fi;
++ python -m venv pyenv --system-site-packages
+
+ # update build hash
+ .PHONY: buildhash
+--
+2.29.2
+
diff --git a/PKGBUILD b/PKGBUILD
index 88054fb7885b..368000990c5b 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,4 +1,5 @@
-# Maintainer: Shaoyu Tseng<zandimna@autistici.org>
+# Maintainer: Martin Dünkelmann<nc-duenkekl3@netcologne.de>
+# Contributor: Shaoyu Tseng<zandimna@autistici.org>
# Contributor: Daniel Egeberg <daniel.egeberg@gmail.com
# Contributor: Sławomir Kowalski <suawekk+aur@gmail.com>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
@@ -7,19 +8,71 @@
# Contributor: Dave Pretty <david dot pretty at gmail dot com>
pkgname=anki-git
-pkgver=r1940.9396d74
+pkgver=r5491.c505894b8
pkgrel=1
pkgdesc="Helps you remember facts (like words/phrases in a foreign language) efficiently"
url="http://ankisrs.net/"
license=('AGPL3')
arch=('any')
provides=('anki')
-conflicts=('anki' 'anki20')
-depends=('python-pyqt5' 'python-beautifulsoup4' 'python-httplib2'
- 'python-pyaudio' 'python-requests' 'python-send2trash' 'qt5-webengine'
- 'python-pyqtwebengine')
-optdepends=('mplayer: sound playing')
-source=("${pkgname}::git+https://github.com/dae/anki.git")
+conflicts=('anki' 'anki20' 'anki-official-binary-bundle')
+depends=(
+ # anki and aqt
+ 'python-beautifulsoup4'
+ 'python-requests'
+ 'python-wheel'
+
+ # anki
+ 'python-pysocks' # requests[socks]
+ 'python-decorator'
+ 'python-protobuf'
+ 'python-orjson'
+ 'python-distro'
+
+ # aqt
+ 'python-send2trash'
+ 'python-markdown'
+ 'python-jsonschema'
+ 'python-pyaudio'
+ 'python-pyqtwebengine'
+ 'python-flask'
+ 'python-flask-cors'
+ 'python-waitress'
+ 'python-pyqt5'
+)
+makedepends=(
+ 'git'
+ 'rsync'
+
+ 'bazel'
+ 'clang'
+
+ 'maturin'
+ 'rust'
+
+ 'python-pip'
+ 'python-mypy-protobuf'
+ 'npm'
+ 'typescript'
+)
+optdepends=(
+ 'lame: record sound'
+ 'mpv: play sound. prefered over mplayer'
+ 'mplayer: play sound'
+)
+source=(
+ $pkgname::git+https://github.com/dae/anki.git
+
+ #ankitects-anki-core-i18n-master.tar.gz::https://github.com/ankitects/anki-core-i18n/tarball/master
+ #ankitects-anki-desktop-ftl-master.tar.gz::https://github.com/ankitects/anki-desktop-ftl/tarball/master
+ #ankitects-anki-desktop-i18n-master.tar.gz::https://github.com/ankitects/anki-desktop-i18n/tarball/master
+
+ #0001-Move-aqt_data-to-sys.prefix-share.patch
+ #0002-Remove-bad-build-steps-from-makefiles.patch
+ #0003-Compile-.py-s-before-building-wheel.patch
+ 0004-Disable-auto-updates.patch
+ #0005-Make-pyenv-target-just-create-venv.patch
+)
sha512sums=('SKIP')
pkgver() {
@@ -27,23 +80,43 @@ pkgver() {
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
+prepare() {
+ cd "$pkgname"
+ #patch -p1 <"$srcdir"/0001-Move-aqt_data-to-sys.prefix-share.patch
+ #patch -p1 <"$srcdir"/0002-Remove-bad-build-steps-from-makefiles.patch
+ #patch -p1 <"$srcdir"/0003-Compile-.py-s-before-building-wheel.patch
+ patch -p1 <"$srcdir"/0004-Disable-auto-updates.patch
+ #patch -p1 <"$srcdir"/0005-Make-pyenv-target-just-create-venv.patch
+
+ # Put translations in place.
+ #ln -sf "$srcdir"/ankitects-anki-core-i18n-*/ rslib/ftl/repo
+ #ln -sf "$srcdir"/ankitects-anki-desktop-ftl-*/ qt/ftl/repo
+ #ln -sf "$srcdir"/ankitects-anki-desktop-i18n-*/ qt/po/repo
+}
+
build() {
- cd "$srcdir/$pkgname"
+ cd "$pkgname"
+ # Built into the shared libraries so that the Python component can check
+ # that it has the same value.
+ #echo arch-linux-$pkgver-$pkgrel > meta/buildhash
- msg2 "Building UI"
- ./tools/build_ui.sh
+ # Installs development modules in venv, which is required by scripts used
+ # by various make targets. The dependencies between targets are completely broken.
+ #make develop
+
+ #make build
+
+ export CC=/usr/bin/clang
+ export CXX=/usr/bin/clang++
+ bazel build -c opt //pylib/anki:wheel
+ bazel build -c opt //qt/aqt:wheel
}
package() {
- cd "$srcdir/$pkgname"
-
- mkdir -p "$pkgdir"/usr/share/anki
- cp -av anki aqt web "$pkgdir"/usr/share/anki/
- sed -e 's:@PREFIX@:/usr/:' tools/runanki.system.in > tools/runanki.system
- install -m 0755 -D tools/runanki.system $pkgdir/usr/bin/anki
- install -m 0644 -D -t $pkgdir/usr/share/pixmaps anki.xpm anki.png
- install -m 0644 -D -t $pkgdir/usr/share/applications anki.desktop
- install -m 0644 -D -t $pkgdir/usr/share/man/man1 anki.1
- install -m 0644 -D -t $pkgdir/usr/share/doc/anki README.contributing README.development README.md LICENSE LICENSE.logo
- echo "Install complete."
+ cd "$pkgname"
+ PIP_CONFIG_FILE=/dev/null pip install --isolated --root="$pkgdir" --ignore-installed --no-deps dist/*.whl
+
+ install -Dm755 qt/runanki "$pkgdir"/usr/bin/anki
+ install -Dm644 qt/anki.desktop "$pkgdir"/usr/share/applications/anki.desktop
+ install -Dm644 qt/anki.png "$pkgdir"/usr/share/pixmaps/anki.png
}