diff options
author | AlexBocken | 2023-05-21 16:49:00 +0200 |
---|---|---|
committer | AlexBocken | 2023-05-21 16:49:00 +0200 |
commit | 5897cce2eeffeb99c7c217958d5f5edfbaf07cde (patch) | |
tree | ccc5056a0f8d9879b8690eb43e40c724abf7bbf1 | |
parent | a358bbdca54204a510eccbdf63375f5e85e99e6a (diff) | |
download | aur-5897cce2eeffeb99c7c217958d5f5edfbaf07cde.tar.gz |
opt-level = 3 for rust packages, use mold as linker for LTO, use local yarn and node
-rw-r--r-- | .SRCINFO | 7 | ||||
-rw-r--r-- | PKGBUILD | 20 | ||||
-rw-r--r-- | optimize_more.patch | 11 |
3 files changed, 29 insertions, 9 deletions
@@ -1,7 +1,7 @@ pkgbase = anki-qt5 pkgdesc = Helps you remember facts (like words/phrases in a foreign language) - Qt5 Build pkgver = 2.1.63 - pkgrel = 1 + pkgrel = 2 url = https://apps.ankiweb.net/ arch = x86_64 license = AGPL3 @@ -12,6 +12,8 @@ pkgbase = anki-qt5 makedepends = python-installer makedepends = libxcrypt-compat makedepends = nodejs + makedepends = yarn + makedepends = mold depends = python>=3.9 depends = python-beautifulsoup4 depends = python-waitress>=2.0.0 @@ -37,13 +39,14 @@ pkgbase = anki-qt5 conflicts = anki-bin conflicts = anki-git conflicts = anki-official-binary-bundle - options = !lto source = anki-qt5::git+https://github.com/ankitects/anki#tag=064ea0ee08715edae868b84e48b29bd7e15d7b49?signed source = no-update.patch + source = optimize_more.patch source = force_qt5.patch validpgpkeys = 814EA4E90C34AF39A712DE703F5566A2D16899FB sha256sums = SKIP sha256sums = f934553a5ce9e046a0b8253e10da16e661b27375e2b54d6bb915267f32aff807 + sha256sums = 213a7c6ab75dc332e79f089364f10bc7fe0c0bb6860a549a42b7e3d75970bc7d sha256sums = c5e6e1b2ed7999e9ef7f855aed4c97c4ace846237421507f408a64a8258a09fd pkgname = anki-qt5 @@ -9,14 +9,13 @@ pkgname=anki-qt5 pkgver=2.1.63 _tag=064ea0ee08715edae868b84e48b29bd7e15d7b49 #git rev-parse $pkgver -pkgrel=1 +pkgrel=2 pkgdesc="Helps you remember facts (like words/phrases in a foreign language) - Qt5 Build" url="https://apps.ankiweb.net/" license=('AGPL3') arch=('x86_64') provides=('anki') conflicts=('anki' 'anki-bin' 'anki-git' 'anki-official-binary-bundle') -options=('!lto') depends=( # anki & aqt 'python>=3.9' @@ -49,6 +48,8 @@ makedepends=( 'python-installer' 'libxcrypt-compat' 'nodejs' + 'yarn' + 'mold' ) optdepends=( 'lame: record sound' @@ -61,10 +62,12 @@ optdepends=( # the '.git' folder is not included in those but is required for a sucessful build source=("$pkgname::git+https://github.com/ankitects/anki#tag=${_tag}?signed" "no-update.patch" +"optimize_more.patch" "force_qt5.patch" ) sha256sums=('SKIP' 'f934553a5ce9e046a0b8253e10da16e661b27375e2b54d6bb915267f32aff807' +'213a7c6ab75dc332e79f089364f10bc7fe0c0bb6860a549a42b7e3d75970bc7d' 'c5e6e1b2ed7999e9ef7f855aed4c97c4ace846237421507f408a64a8258a09fd' ) @@ -76,19 +79,22 @@ prepare(){ cd "$pkgname" # pro-actively prevent "module not found" error [ -d ts/node_modules ] && rm -r ts/node_modules - patch -p1 < "$srcdir/no-update.patch" patch -p1 < "$srcdir/force_qt5.patch" + patch -p1 < "$srcdir/no-update.patch" + patch -p1 < "$srcdir/optimize_more.patch" + cargo fetch --locked --target "$CARCH-unknown-linux-gnu" } build() { cd "$pkgname" - - #use local binaries instead of downloading them as well for python and protoc + #use local binaries instead of downloading them export PYTHON_BINARY=$(which python) export PROTOC_BINARY=$(which protoc) - #export NODE_BINARY=$(which node) # does not yet compile + export NODE_BINARY=$(which node) + export YARN_BINARY=$(which yarn) - ./tools/build + export RELEASE=1 + mold -run ./ninja wheels # use mold as linker to allow for LTO } pkgver(){ diff --git a/optimize_more.patch b/optimize_more.patch new file mode 100644 index 000000000000..bf5cd0105e8e --- /dev/null +++ b/optimize_more.patch @@ -0,0 +1,11 @@ +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -37,7 +37,7 @@ + debug = 0 + + [profile.dev.package.runner] +-opt-level = 1 ++opt-level = 3 + + # Debug info off by default, which speeds up incremental builds and produces a considerably + # smaller library. |