diff options
author | AlexBocken | 2023-05-21 13:32:20 +0200 |
---|---|---|
committer | AlexBocken | 2023-05-21 13:32:20 +0200 |
commit | 7ab84c7359f9a757b09423e56137a994460815e1 (patch) | |
tree | 8db98c0d5d1e5c7c41df2095942d72526c5bf11d | |
parent | cbadc1eab31d050f29f175bb47b056b13b45dce2 (diff) | |
download | aur-7ab84c7359f9a757b09423e56137a994460815e1.tar.gz |
opt-level = 3 for rust packages, use mold as linker for LTO
-rw-r--r-- | .SRCINFO | 4 | ||||
-rw-r--r-- | PKGBUILD | 9 | ||||
-rw-r--r-- | optimize_more.patch | 11 |
3 files changed, 21 insertions, 3 deletions
@@ -13,6 +13,7 @@ pkgbase = anki makedepends = libxcrypt-compat makedepends = nodejs makedepends = yarn + makedepends = mold depends = python>=3.9 depends = python-beautifulsoup4 depends = python-waitress>=2.0.0 @@ -38,11 +39,12 @@ pkgbase = anki conflicts = anki-git conflicts = anki-official-binary-bundle conflicts = anki-qt5 - options = !lto source = anki::git+https://github.com/ankitects/anki#tag=064ea0ee08715edae868b84e48b29bd7e15d7b49?signed source = no-update.patch + source = optimize_more.patch validpgpkeys = 814EA4E90C34AF39A712DE703F5566A2D16899FB sha256sums = SKIP sha256sums = f934553a5ce9e046a0b8253e10da16e661b27375e2b54d6bb915267f32aff807 + sha256sums = 213a7c6ab75dc332e79f089364f10bc7fe0c0bb6860a549a42b7e3d75970bc7d pkgname = anki @@ -15,7 +15,6 @@ url="https://apps.ankiweb.net/" license=('AGPL3') arch=('x86_64') conflicts=('anki-bin' 'anki-git' 'anki-official-binary-bundle' 'anki-qt5') -options=('!lto') depends=( # anki & aqt 'python>=3.9' @@ -49,6 +48,7 @@ makedepends=( 'libxcrypt-compat' 'nodejs' 'yarn' + 'mold' ) optdepends=( 'lame: record sound' @@ -60,9 +60,11 @@ 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" ) sha256sums=('SKIP' 'f934553a5ce9e046a0b8253e10da16e661b27375e2b54d6bb915267f32aff807' +'213a7c6ab75dc332e79f089364f10bc7fe0c0bb6860a549a42b7e3d75970bc7d' ) validpgpkeys=( @@ -73,7 +75,9 @@ prepare(){ cd "$pkgname" # pro-actively prevent "module not found" error (TODO: verify whether still required) [ -d ts/node_modules ] && rm -r ts/node_modules + patch -p1 < "$srcdir/no-update.patch" + patch -p1 < "$srcdir/optimize_more.patch" cargo fetch --locked --target "$CARCH-unknown-linux-gnu" } @@ -85,7 +89,8 @@ build() { 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. |