summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorOrhun Parmaksız2022-11-05 01:06:29 +0300
committerOrhun Parmaksız2022-11-05 01:06:29 +0300
commit56f330d588d17afd2e839884c0405a62ea380c4e (patch)
tree91f1f653684b91d2252fd4611cc01edfc9831a83
parentd3e74e38638818af13335edee7ed2fa5e172c6b5 (diff)
downloadaur-miro-git.tar.gz
upgpkg: miro-git 0.2.0.r52.g85e14d1-1
-rw-r--r--.SRCINFO6
-rw-r--r--PKGBUILD22
-rw-r--r--assets-path.patch90
3 files changed, 110 insertions, 8 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 94154f8b3fb2..1a7001d29c2c 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,11 +1,11 @@
pkgbase = miro-git
pkgdesc = A GPU-accelerated terminal emulator written in Rust (git)
- pkgver = 0.2.0.r17.gce75629
+ pkgver = 0.2.0.r52.g85e14d1
pkgrel = 1
url = https://github.com/o2sh/miro
arch = x86_64
license = GPL3
- makedepends = rust
+ makedepends = cargo
makedepends = git
makedepends = python
depends = libxcb
@@ -19,6 +19,8 @@ pkgbase = miro-git
provides = miro
conflicts = miro
source = git+https://github.com/o2sh/miro
+ source = assets-path.patch
sha512sums = SKIP
+ sha512sums = 272b70c68ab89ef23b185c794c6affedfdd07170322c8ba950ec3fe79844e025e59064f67d995cfd34f1fda64de51c087719ad2aff882db5d2e5fa7da5ae9e17
pkgname = miro-git
diff --git a/PKGBUILD b/PKGBUILD
index 350474f26002..227c40cd8765 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,7 +2,7 @@
# https://github.com/orhun/pkgbuilds
pkgname=miro-git
-pkgver=0.2.0.r17.gce75629
+pkgver=0.2.0.r52.g85e14d1
pkgrel=1
pkgdesc="A GPU-accelerated terminal emulator written in Rust (git)"
arch=('x86_64')
@@ -11,29 +11,39 @@ license=('GPL3')
depends=('libxcb' 'xcb-util-keysyms' 'libxkbcommon'
'libxkbcommon-x11' 'xcb-util-wm' 'mesa'
'freetype2' 'fontconfig')
-makedepends=('rust' 'git' 'python')
+makedepends=('cargo' 'git' 'python')
conflicts=("${pkgname%-git}")
provides=("${pkgname%-git}")
-source=("git+${url}")
-sha512sums=('SKIP')
+source=("git+${url}"
+ "assets-path.patch")
+sha512sums=('SKIP'
+ '272b70c68ab89ef23b185c794c6affedfdd07170322c8ba950ec3fe79844e025e59064f67d995cfd34f1fda64de51c087719ad2aff882db5d2e5fa7da5ae9e17')
pkgver() {
cd "${pkgname%-git}"
git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}
+prepare() {
+ cd "${pkgname%-git}"
+ patch -Np1 -i "$srcdir/assets-path.patch"
+ cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
+}
+
build() {
cd "${pkgname%-git}"
- cargo build --release --locked
+ cargo build --release --frozen
}
check() {
cd "${pkgname%-git}"
- cargo test --release --locked
+ cargo test --frozen
}
package() {
cd "${pkgname%-git}"
install -Dm 755 "target/release/${pkgname%-git}" -t "${pkgdir}/usr/bin"
install -Dm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname"
+ mkdir -p "$pkgdir/opt/${pkgname%-git}"
+ cp -r "assets" "$pkgdir/opt/${pkgname%-git}/"
}
diff --git a/assets-path.patch b/assets-path.patch
new file mode 100644
index 000000000000..ad33158671ba
--- /dev/null
+++ b/assets-path.patch
@@ -0,0 +1,90 @@
+diff --git a/assets/gfx/kirby.json b/assets/gfx/kirby.json
+index 3f2de7b..fa2754e 100644
+--- a/assets/gfx/kirby.json
++++ b/assets/gfx/kirby.json
+@@ -1,6 +1,6 @@
+ {
+ "meta": {
+- "image": "assets/gfx/kirby.png",
++ "image": "/opt/miro/assets/gfx/kirby.png",
+ "size": {
+ "w": 234,
+ "h": 26
+diff --git a/assets/gfx/mario.json b/assets/gfx/mario.json
+index 0b25eae..b7cf419 100644
+--- a/assets/gfx/mario.json
++++ b/assets/gfx/mario.json
+@@ -1,6 +1,6 @@
+ {
+ "meta": {
+- "image": "assets/gfx/mario.png",
++ "image": "/opt/miro/assets/gfx/mario.png",
+ "size": {
+ "w": 96,
+ "h": 32
+diff --git a/assets/gfx/pika.json b/assets/gfx/pika.json
+index 6d59e8b..3c821bc 100644
+--- a/assets/gfx/pika.json
++++ b/assets/gfx/pika.json
+@@ -1,6 +1,6 @@
+ {
+ "meta": {
+- "image": "assets/gfx/pika.png",
++ "image": "/opt/miro/assets/gfx/pika.png",
+ "size": {
+ "w": 208,
+ "h": 28
+diff --git a/src/gui/spritesheet.rs b/src/gui/spritesheet.rs
+index aab382c..97971a2 100644
+--- a/src/gui/spritesheet.rs
++++ b/src/gui/spritesheet.rs
+@@ -32,16 +32,7 @@ impl SpriteSheet {
+
+ let sprite_width = sprites[0].size.0;
+ let sprite_height = sprites[0].size.1;
+- SpriteSheet {
+- image_path: String::from(format!(
+- "{}/{}",
+- env!("CARGO_MANIFEST_DIR"),
+- config.image_path
+- )),
+- sprites,
+- sprite_height,
+- sprite_width,
+- }
++ SpriteSheet { image_path: config.image_path.clone(), sprites, sprite_height, sprite_width }
+ }
+ }
+
+diff --git a/src/main.rs b/src/main.rs
+index f015e3a..915fe36 100644
+--- a/src/main.rs
++++ b/src/main.rs
+@@ -50,24 +50,15 @@ fn main() -> anyhow::Result<()> {
+
+ let theme = match matches.value_of("theme") {
+ Some("mario") => Theme {
+- spritesheet_path: String::from(concat!(
+- env!("CARGO_MANIFEST_DIR"),
+- "/assets/gfx/mario.json"
+- )),
++ spritesheet_path: String::from("/opt/miro/assets/gfx/mario.json"),
+ color: RgbColor { red: 99, green: 137, blue: 250 },
+ },
+ Some("pika") => Theme {
+- spritesheet_path: String::from(concat!(
+- env!("CARGO_MANIFEST_DIR"),
+- "/assets/gfx/pika.json"
+- )),
++ spritesheet_path: String::from("/opt/miro/assets/gfx/pika.json"),
+ color: RgbColor { red: 176, green: 139, blue: 24 },
+ },
+ Some("kirby") => Theme {
+- spritesheet_path: String::from(concat!(
+- env!("CARGO_MANIFEST_DIR"),
+- "/assets/gfx/kirby.json"
+- )),
++ spritesheet_path: String::from("/opt/miro/assets/gfx/kirby.json"),
+ color: RgbColor { red: 242, green: 120, blue: 141 },
+ },
+ _ => unreachable!("not possible"),