Package Details: odilia 0.1.4-1

Git Clone URL: https://aur.archlinux.org/odilia.git (read-only, click to copy)
Package Base: odilia
Description: Building a better screen reader for the Linux desktop, one step at a time.
Upstream URL: https://odilia.app/
Licenses: GPL3
Provides: odilia
Submitter: tait.tech
Maintainer: tait.tech
Last Packager: tait.tech
Votes: 1
Popularity: 0.000000
First Submitted: 2021-11-17 23:23 (UTC)
Last Updated: 2023-03-23 18:12 (UTC)

Latest Comments

xiota commented on 2025-01-18 22:53 (UTC) (edited on 2025-01-18 22:58 (UTC) by xiota)

When possible, package maintained configs should be in /usr/lib/$pkgname/. Anything in /etc can be expected to be modified by users.

This package was submitted 2021. 3-4 years is long enough to have a config that resembles stability close enough that users may not like it to be wiped out without notification. [Some project fork occurred. Principle stands. Wiping out user configs should be avoided.]

tait.tech commented on 2025-01-18 21:20 (UTC)

@xiota since Odilia is really early on, I've decided not to add the backup list of files. There's not enough stability to allow keeping configs right now.

xiota commented on 2024-09-16 23:08 (UTC)

Consider adding backup array to preserve settings on upgrades:

backup=("etc/$pkgname/config.toml")

jcaesar commented on 2023-03-23 23:06 (UTC)

Looks good.

I think the

install -vDm644 -t "$pkgdir/etc/$pkgname" "odilia/config.toml"

is unnecessary now. I didn't expect you to implement my suggestions from reddit this quickly. :D

tait.tech commented on 2023-03-23 18:17 (UTC)

The config issue was fixed with #112, and I've incorporated your changes for the MAKEPKG file. Thoughts?

I had quite a few issue using --locked, so I removed that.

jcaesar commented on 2023-03-23 08:58 (UTC)

Calling git from the build script is not the nicest thing to do. Would you mind taking some inspiration from dust, maybe? https://github.com/archlinux/svntogit-community/blob/packages/dust/trunk/PKGBUILD

Alternatively, I have a patch for you that switches to downloading source archives. (It also installs the config.toml like suggested in odilia's README - and then fixes actually using it).

diff --git a/.SRCINFO b/.SRCINFO
index 4725612..f4a5f27 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,17 +1,20 @@
 pkgbase = odilia
    pkgdesc = Building a better screen reader for the Linux desktop, one step at a time.
    pkgver = 0.1.1
-   pkgrel = 1
+   pkgrel = 2
    url = https://odilia.app/
    arch = x86_64
    arch = aarch64
    license = GPL3
    depends = clang
-   depends = libspeechd
    depends = speech-dispatcher
    depends = cargo
    depends = at-spi2-core
    depends = at-spi2-atk
    provides = odilia
+   source = odilia-0.1.1.tar.gz::https://github.com/odilia-app/odilia/archive/refs/tags/v0.1.1.tar.gz
+   source = fix-config-copy.patch
+   sha256sums = d3d0b6f99725f67a6a348b29f8efb29f4bdde74ccf03d927c8f17faa61efc069
+   sha256sums = SKIP

 pkgname = odilia
diff --git a/PKGBUILD b/PKGBUILD
index 1cbca26..0ca1121 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,7 +2,7 @@

 pkgname=odilia
 pkgver=0.1.1
-pkgrel=1
+pkgrel=2
 pkgdesc="Building a better screen reader for the Linux desktop, one step at a time. "
 url="https://odilia.app/"
 license=('GPL3')
@@ -15,21 +15,41 @@ depends=(
   at-spi2-atk # for interaction of Odilia with GTK applications
 )
 provides=( odilia )
+source=(
+  odilia-$pkgver.tar.gz::https://github.com/odilia-app/odilia/archive/refs/tags/v$pkgver.tar.gz
+  fix-config-copy.patch
+)
+sha256sums=(
+  d3d0b6f99725f67a6a348b29f8efb29f4bdde74ccf03d927c8f17faa61efc069
+  SKIP
+)

 prepare() {
-    rm -rf $srcdir/odilia || echo "No git found. Cloning..."
-    git clone https://github.com/odilia-app/odilia
+  cd "$pkgname-$pkgver"
+
+  cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
 }

+
 build() {
-    cd $srcdir/odilia
-    git checkout "v$pkgver"
-    cargo build --release
+  cd "$pkgname-$pkgver"
+
+  patch -Np1 -i "$srcdir/fix-config-copy.patch"
+  cargo build --offline --frozen --release --all-features
+}
+
+check() {
+  cd "$pkgname-$pkgver"
+
+  cargo test --offline --frozen --all-features --workspace
 }

 package() {
-    mkdir -p $pkgdir/usr/local/bin/
-    install -m 755 $srcdir/odilia/target/release/odilia $pkgdir/usr/local/bin/odilia
+  cd "$pkgname-$pkgver"
+
+  install -vDm755 -t "$pkgdir/usr/bin" "target/release/$pkgname"
+  install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
+  install -vDm644 -t "$pkgdir/etc/$pkgname" config.toml
 }

 #vim: syntax=sh
diff --git a/fix-config-copy.patch b/fix-config-copy.patch
new file mode 100644
index 0000000..283c53f
--- /dev/null
+++ b/fix-config-copy.patch
@@ -0,0 +1,12 @@
+diff '--color=auto' -Naur odilia-0.1.1-orig/odilia/src/state.rs odilia-0.1.1/odilia/src/state.rs
+--- odilia-0.1.1-orig/odilia/src/state.rs  2023-03-23 05:22:13.000000000 +0900
++++ odilia-0.1.1/odilia/src/state.rs   2023-03-23 16:15:47.625254791 +0900
+@@ -58,7 +58,7 @@
+           "unable to place configuration file. Maybe your system is readonly?",
+       );
+       if !config_path.exists() {
+-          fs::copy("config.toml", &config_path)
++          fs::copy("/etc/odilia/config.toml", &config_path)
+               .expect("Unable to copy default config file.");
+       }
+       let config_path = config_path.to_str().ok_or(ConfigError::PathNotFound)?.to_owned();