Date: Friday, May 1, 2020 @ 19:09:47
  Author: demize
Revision: 624195

db-move: moved anki from [community-testing] to [community] (x86_64)

Added:
  anki/repos/community-x86_64/
  anki/repos/community-x86_64/0001-Move-aqt_data-to-sys.prefix-share.patch
    (from rev 624194, 
anki/repos/community-testing-x86_64/0001-Move-aqt_data-to-sys.prefix-share.patch)
  anki/repos/community-x86_64/0001-Unfuck-make-build-targets.patch
    (from rev 624194, 
anki/repos/community-testing-x86_64/0001-Unfuck-make-build-targets.patch)
  anki/repos/community-x86_64/PKGBUILD
    (from rev 624194, anki/repos/community-testing-x86_64/PKGBUILD)
Deleted:
  anki/repos/community-testing-x86_64/

----------------------------------------------+
 0001-Move-aqt_data-to-sys.prefix-share.patch |   45 ++++++++++
 0001-Unfuck-make-build-targets.patch         |   93 +++++++++++++++++++++
 PKGBUILD                                     |  106 +++++++++++++++++++++++++
 3 files changed, 244 insertions(+)

Copied: 
anki/repos/community-x86_64/0001-Move-aqt_data-to-sys.prefix-share.patch (from 
rev 624194, 
anki/repos/community-testing-x86_64/0001-Move-aqt_data-to-sys.prefix-share.patch)
===================================================================
--- community-x86_64/0001-Move-aqt_data-to-sys.prefix-share.patch               
                (rev 0)
+++ community-x86_64/0001-Move-aqt_data-to-sys.prefix-share.patch       
2020-05-01 19:09:47 UTC (rev 624195)
@@ -0,0 +1,45 @@
+From d7ecae49a8a46e5ad5f25726044a25006fd1f006 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Johannes=20L=C3=B6thberg?= <[email protected]>
+Date: Sun, 29 Mar 2020 06:24:43 +0200
+Subject: [PATCH] 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 <[email protected]>
+---
+ 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 a0e12362..4d8c8c34 100644
+--- a/qt/aqt/utils.py
++++ b/qt/aqt/utils.py
+@@ -21,7 +21,7 @@ from aqt.theme import theme_manager
+ 
+ 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 6d498994..d67a8791 100644
+--- a/qt/setup.py
++++ b/qt/setup.py
+@@ -9,7 +9,7 @@ with open("../meta/version") as fh:
+ 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.26.0
+

Copied: anki/repos/community-x86_64/0001-Unfuck-make-build-targets.patch (from 
rev 624194, 
anki/repos/community-testing-x86_64/0001-Unfuck-make-build-targets.patch)
===================================================================
--- community-x86_64/0001-Unfuck-make-build-targets.patch                       
        (rev 0)
+++ community-x86_64/0001-Unfuck-make-build-targets.patch       2020-05-01 
19:09:47 UTC (rev 624195)
@@ -0,0 +1,93 @@
+From 3dc54977a9cc86175bf47b3586178c3d86ad53d5 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Johannes=20L=C3=B6thberg?= <[email protected]>
+Date: Sun, 29 Mar 2020 05:54:00 +0200
+Subject: [PATCH] Unfuck make build targets
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Johannes Löthberg <[email protected]>
+---
+ pylib/Makefile | 12 ++----------
+ qt/Makefile    | 10 +---------
+ rspy/Makefile  |  4 ----
+ 3 files changed, 3 insertions(+), 23 deletions(-)
+
+diff --git a/pylib/Makefile b/pylib/Makefile
+index 9727fc92..1d86144e 100644
+--- a/pylib/Makefile
++++ b/pylib/Makefile
+@@ -31,17 +31,9 @@ $(shell mkdir -p .build ../dist)
+ PHONY: all
+ all: check
+ 
+-.build/run-deps: setup.py
+-      python -m pip install -e .
+-      @touch $@
+-
+-.build/dev-deps: requirements.dev
+-      python -m pip install -r requirements.dev
+-      @touch $@
+-
+ PROTODEPS := $(wildcard ../proto/*.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
+@@ -52,7 +44,7 @@ PROTODEPS := $(wildcard ../proto/*.proto)
+       python -m black anki/hooks.py
+       @touch $@
+ 
+-BUILD_STEPS := .build/run-deps .build/dev-deps .build/py-proto 
anki/buildinfo.py .build/hooks
++BUILD_STEPS := .build/py-proto anki/buildinfo.py
+ 
+ # Checking
+ ######################
+diff --git a/qt/Makefile b/qt/Makefile
+index 4fef3e92..562a18a2 100644
+--- a/qt/Makefile
++++ b/qt/Makefile
+@@ -34,14 +34,6 @@ $(shell mkdir -p .build ../dist)
+ PHONY: all
+ all: check
+ 
+-.build/run-deps: setup.py
+-      python -m pip install -e .
+-      @touch $@
+-
+-.build/dev-deps: requirements.dev
+-      python -m pip install -r requirements.dev
+-      @touch $@
+-
+ .build/ui: $(shell ${FIND} designer -type f)
+       ./tools/build_ui.sh
+       @touch $@
+@@ -64,7 +56,7 @@ TSDEPS := $(wildcard ts/src/*.ts) $(wildcard ts/scss/*.scss)
+       python -m black aqt/gui_hooks.py
+       @touch $@
+ 
+-BUILD_STEPS := .build/run-deps .build/dev-deps .build/js .build/ui 
aqt/buildinfo.py .build/hooks .build/i18n
++BUILD_STEPS := .build/js .build/ui aqt/buildinfo.py .build/i18n
+ 
+ # Checking
+ ######################
+diff --git a/rspy/Makefile b/rspy/Makefile
+index 20362e17..c31636ea 100644
+--- a/rspy/Makefile
++++ b/rspy/Makefile
+@@ -78,10 +78,6 @@ clean:
+ RUST_TOOLCHAIN := $(shell cat rust-toolchain)
+ 
+ .build/tools: requirements.txt rust-toolchain
+-      python -m pip install -r requirements.txt
+-      rustup toolchain install $(RUST_TOOLCHAIN)
+-      rustup component add rustfmt-preview --toolchain $(RUST_TOOLCHAIN)
+-      rustup component add clippy-preview --toolchain $(RUST_TOOLCHAIN)
+       @touch $@
+ 
+ .build/check: build
+-- 
+2.26.0
+

Copied: anki/repos/community-x86_64/PKGBUILD (from rev 624194, 
anki/repos/community-testing-x86_64/PKGBUILD)
===================================================================
--- community-x86_64/PKGBUILD                           (rev 0)
+++ community-x86_64/PKGBUILD   2020-05-01 19:09:47 UTC (rev 624195)
@@ -0,0 +1,106 @@
+# Maintainer: Johannes Löthberg <[email protected]>
+# Contributor: Sergej Pupykin <[email protected]>
+# Contributor: Timm Preetz <[email protected]>
+# Contributor: Michael 'manveru' Fellinger <[email protected]>
+# Contributor: Dave Pretty <david dot pretty at gmail dot com>
+
+pkgname=anki
+pkgver=2.1.23
+pkgrel=1
+
+pkgdesc="Helps you remember facts (like words/phrases in a foreign language) 
efficiently"
+url="https://ankisrs.net/";
+arch=('x86_64')
+license=('AGPL3')
+
+depends=(
+       # anki and aqt
+       'python-beautifulsoup4'
+       'python-requests'
+       'python-wheel'
+
+       # anki
+       'python-decorator'
+       'python-distro'
+       # Currently not packaged.  Falls back to stdlib json module.
+       # 'python-orjson'
+       'python-protobuf'
+
+       # aqt
+       'python-jsonschema'
+       'python-markdown'
+       'python-pyaudio'
+       'python-pyqt5'
+       'python-pyqtwebengine'
+       'python-send2trash'
+)
+makedepends=(
+       'git'
+       'rsync'
+
+       'maturin'
+       'rustup'
+
+       'python-pip'
+       'python-mypy-protobuf'
+       'npm'
+       'typescript'
+)
+optdepends=(
+       'lame: record sound'
+       'mpv: play sound. prefered over mplayer'
+       'mplayer: play sound'
+)
+
+source=(
+       
anki-$pkgver.tar.gz::https://github.com/ankitects/anki/archive/$pkgver.tar.gz
+       
git+https://github.com/ankitects/anki-desktop-ftl#commit=255a12eadf5c6afc22705ac9ab7c9e2982c7d2b1
+       
git+https://github.com/ankitects/anki-core-i18n#commit=23c4dc5bf5c88c782536ec48934ef6a379b10e72
+       0001-Unfuck-make-build-targets.patch
+       0001-Move-aqt_data-to-sys.prefix-share.patch
+)
+sha256sums=(
+       '682efd4cf044a89a0dbd83e30d4545683c6574d847642cc64cc0e0ca4a94f4ae'
+       'SKIP'
+       'SKIP'
+       'SKIP'
+       'SKIP'
+)
+
+prepare() {
+       cd anki-$pkgver
+       patch -p1 <"$srcdir"/0001-Unfuck-make-build-targets.patch
+       patch -p1 <"$srcdir"/0001-Move-aqt_data-to-sys.prefix-share.patch
+}
+
+build() {
+       # Put translations in place.
+       git clone anki-desktop-ftl anki-$pkgver/qt/ftl/repo
+       git clone anki-core-i18n anki-$pkgver/rslib/ftl/repo
+
+       # Built into the shared libraries so that the Python component can check
+       # that it has the same value.
+       cd anki-$pkgver/meta
+       echo anki-$pkgver > buildhash
+
+       # rust ankirspy module
+       cd ../rspy
+       make build
+
+       # python anki module
+       cd ../pylib
+       make build
+
+       # python aqt module
+       cd ../qt
+       make build
+}
+
+package() {
+       cd anki-$pkgver
+
+       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
+}

Reply via email to