[crux-commits] ports/contrib (3.6): handlr: added a wrapper to /usr/local/bin to override xdg-open from xdg-utils

crux at crux.nu crux at crux.nu
Sun Jul 25 15:12:47 UTC 2021


commit c3abec6f34cb0dfa2cda2dcd61b399e132fb204b
Author: Tim Biermann <tbier at posteo.de>
Date:   Sun Jul 25 17:12:39 2021 +0200

    handlr: added a wrapper to /usr/local/bin to override xdg-open from xdg-utils

diff --git a/handlr/.footprint b/handlr/.footprint
index 4d9b727ae..5704e91db 100644
--- a/handlr/.footprint
+++ b/handlr/.footprint
@@ -1,3 +1,6 @@
 drwxr-xr-x	root/root	usr/
 drwxr-xr-x	root/root	usr/bin/
 -rwxr-xr-x	root/root	usr/bin/handlr
+drwxr-xr-x	root/root	usr/local/
+drwxr-xr-x	root/root	usr/local/bin/
+-rwxr-xr-x	root/root	usr/local/bin/xdg-open
diff --git a/handlr/.signature b/handlr/.signature
index 571c57bb7..eda9b54b1 100644
--- a/handlr/.signature
+++ b/handlr/.signature
@@ -1,5 +1,6 @@
 untrusted comment: verify with /etc/ports/contrib.pub
-RWSagIOpLGJF34iSnN3etxgcaUuCSiv/rHZrjnv8WtiYqEoy54O2vCiSjt8i6bWB7hcAg61EMoH+tTn38DQVSYnBto/h+sdv1wE=
-SHA256 (Pkgfile) = 6b11376a6cdfd6b7c90b14defcacac47128d867ac99b9d334b8c4092a55905fc
-SHA256 (.footprint) = 6b3abe8c8e8c450b3a5ae1ceda4c4f15a6faf0567db1d4a840fe38d8060702bd
+RWSagIOpLGJF36hNMokspiDpuS5oH5/kBi7Flq4+pnUM32nQcWuYebJ8Oqvr9YMUOLFnNwmaDdU3NyTZfKBQQaJ/Sy9fSu4mnwU=
+SHA256 (Pkgfile) = 3007101f044b704f9b2d7ba4be5d74d2ebe3025b80b750395e51bf42b0fe54fb
+SHA256 (.footprint) = dc2db921b47a3d580f3fb58345bac4c9b0267c93ee81f23d7a827df71fead35e
 SHA256 (handlr-0.6.4.tar.gz) = 7aae79775a08fdeb822eb0dafe90fdedffb97063649c9a950e9a8b8e6bf8e5ba
+SHA256 (xdg-open.sh) = 21fae4188078463026d6d30bda53483c3e27a1915b1f4a8cb1ae0437d4aca87e
diff --git a/handlr/Pkgfile b/handlr/Pkgfile
index ca097574e..6c114aa7a 100644
--- a/handlr/Pkgfile
+++ b/handlr/Pkgfile
@@ -1,22 +1,22 @@
 # Description: xdg-utils replacement written in rust
 # URL: https://github.com/chmln/handlr
 # Maintainer: Tim Biermann, tbier at posteo dot de
-# Depends on: rust
+# Depends on: rust xdg-utils
 
 name=handlr
 version=0.6.4
-release=1
-source=(https://github.com/chmln/handlr/archive/v$version/$name-$version.tar.gz)
+release=2
+source=(https://github.com/chmln/handlr/archive/v$version/$name-$version.tar.gz
+  xdg-open.sh)
 
 build() {
-  cd $name-$version
-
+  prt-get isinst zsh && install -Dm644 $SRC/$name-$version/completions/_handlr \
+    $PKG/usr/share/zsh/site-functions/_handlr
   prt-get isinst sccache && export RUSTC_WRAPPER=/usr/bin/sccache
   mkdir "$PKGMK_SOURCE_DIR/rust" || true
   export CARGO_HOME="$PKGMK_SOURCE_DIR/rust"
-
-  cargo update
-  cargo fetch
-  cargo build --release --locked
-  install -Dt $PKG/usr/bin target/release/handlr
+  cargo update --manifest-path $name-$version/Cargo.toml
+  cargo build --release --locked --manifest-path $name-$version/Cargo.toml
+  install -Dt $PKG/usr/bin $name-$version/target/release/$name
+  install -Dm755 $SRC/xdg-open.sh $PKG/usr/local/bin/xdg-open
 }
diff --git a/handlr/README.md b/handlr/README.md
new file mode 100644
index 000000000..15220a19a
--- /dev/null
+++ b/handlr/README.md
@@ -0,0 +1,11 @@
+handlr README.md
+================
+
+This package replaces `xdg-open` from `contrib/xdg-utils`
+
+To not overwrite files, it requires you to put `/usr/local/bin` in your `PATH`
+__before__ `/usr/bin`, for example:
+
+```
+export PATH="/usr/local/bin:/bin:/usr/bin"
+```
diff --git a/handlr/xdg-open.sh b/handlr/xdg-open.sh
new file mode 100644
index 000000000..11c1a3766
--- /dev/null
+++ b/handlr/xdg-open.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+handlr open "$@"


More information about the crux-commits mailing list