summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorWesley Moore2019-03-31 09:49:35 +1100
committerWesley Moore2019-03-31 09:49:35 +1100
commit5c105db72af348867a2cf0e4fc926ffde96770db (patch)
tree960b2c56cd930ae2e65531f1ae6483ee355c4191
parent10716f5cb9217d7d3b267e6ab150afa9a4e360dd (diff)
downloadaur-5c105db72af348867a2cf0e4fc926ffde96770db.tar.gz
Enable LTO to drop another 300k from the binary
https://doc.rust-lang.org/cargo/reference/manifest.html#the-profile-sections
-rw-r--r--.SRCINFO4
-rw-r--r--Cargo.toml.patch9
-rw-r--r--PKGBUILD16
3 files changed, 25 insertions, 4 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 75043f453b3e..1bc9a6a8359b 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = mdcat
pkgdesc = Show CommonMark (a standardized Markdown dialect) documents on text terminals.
pkgver = 0.13.0
- pkgrel = 1
+ pkgrel = 2
url = https://github.com/lunaryorn/mdcat
arch = i686
arch = x86_64
@@ -12,7 +12,9 @@ pkgbase = mdcat
depends = oniguruma
conflicts = mdcat-git
source = mdcat-0.13.0.tar.gz::https://github.com/lunaryorn/mdcat/archive/mdcat-0.13.0.tar.gz
+ source = Cargo.toml.patch
sha256sums = 9528a0dedcb9db559c9973001787f474f87559366a2c7a2ff01148c5ab31eac1
+ sha256sums = 7860347baf642380ce26366c94ecff6e31a6b9ee4521740d130e87350dac148d
pkgname = mdcat
diff --git a/Cargo.toml.patch b/Cargo.toml.patch
new file mode 100644
index 000000000000..20a2a6e2d744
--- /dev/null
+++ b/Cargo.toml.patch
@@ -0,0 +1,9 @@
+--- mdcat-mdcat-0.13.0.orig/Cargo.toml 2019-03-31 05:38:16.000000000 +1100
++++ mdcat-mdcat-0.13.0/Cargo.toml 2019-03-31 09:38:17.614741379 +1100
+@@ -76,3 +76,6 @@
+ tag-message = "mdcat {{version}}"
+ tag-prefix = "mdcat-"
+ pre-release-hook = "./scripts/prerelease-hook.py"
++
++[profile.release]
++lto = true
diff --git a/PKGBUILD b/PKGBUILD
index 981182d3e716..0ff0d9b27acc 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,7 +1,7 @@
# Maintainer: Wesley Moore <wes@wezm.net>
pkgname=mdcat
pkgver=0.13.0
-pkgrel=1
+pkgrel=2
pkgdesc='Show CommonMark (a standardized Markdown dialect) documents on text terminals.'
arch=('i686' 'x86_64')
url="https://github.com/lunaryorn/mdcat"
@@ -9,11 +9,21 @@ license=('Apache')
depends=('oniguruma')
conflicts=('mdcat-git')
makedepends=('rust' 'cargo' 'git')
-source=("$pkgname-$pkgver.tar.gz::$url/archive/$pkgname-$pkgver.tar.gz")
-sha256sums=('9528a0dedcb9db559c9973001787f474f87559366a2c7a2ff01148c5ab31eac1')
+source=("$pkgname-$pkgver.tar.gz::$url/archive/$pkgname-$pkgver.tar.gz"
+ Cargo.toml.patch)
+sha256sums=('9528a0dedcb9db559c9973001787f474f87559366a2c7a2ff01148c5ab31eac1'
+ '7860347baf642380ce26366c94ecff6e31a6b9ee4521740d130e87350dac148d')
+
+prepare() {
+ # Enable LTO
+ cd "$pkgname-$pkgname-$pkgver"
+ pwd
+ patch -p1 < ../../Cargo.toml.patch
+}
build() {
cd "$pkgname-$pkgname-$pkgver"
+
# Default features are iterm2 terminology and remote_resources. iterm2 is
# unecessary on Arch, remote_resources brings in a chain of depenedencies
# reqwest->native-tls->openssl. The version of the openssl crate that is