about summary refs log tree commit diff
path: root/pkgs/applications
diff options
context:
space:
mode:
authorMaximilian Bosch <maximilian@mbosch.me>2019-09-09 01:54:41 +0200
committerMaximilian Bosch <maximilian@mbosch.me>2019-09-09 01:54:41 +0200
commit8cd9b85bb3b48f607d68029955d051c55ee176e9 (patch)
treecfafde4738d2e49d0f5bd6e73e5388da41fb3e81 /pkgs/applications
parent1a1a7ed26652545dc6a2e2bd02f7812e1b37d196 (diff)
downloadnixlib-8cd9b85bb3b48f607d68029955d051c55ee176e9.tar
nixlib-8cd9b85bb3b48f607d68029955d051c55ee176e9.tar.gz
nixlib-8cd9b85bb3b48f607d68029955d051c55ee176e9.tar.bz2
nixlib-8cd9b85bb3b48f607d68029955d051c55ee176e9.tar.lz
nixlib-8cd9b85bb3b48f607d68029955d051c55ee176e9.tar.xz
nixlib-8cd9b85bb3b48f607d68029955d051c55ee176e9.tar.zst
nixlib-8cd9b85bb3b48f607d68029955d051c55ee176e9.zip
urlview: fix path to url_handler.sh
By default, `/etc/urlview/url_handler.sh` is used which breaks by
default with the following error:

```
sh: /etc/urlview/url_handler.sh: No such file or directory
```

With this change, the script will be copied to `$out` and `urlview` will
be patched accordingly.
Diffstat (limited to 'pkgs/applications')
-rw-r--r--pkgs/applications/misc/urlview/default.nix17
1 files changed, 14 insertions, 3 deletions
diff --git a/pkgs/applications/misc/urlview/default.nix b/pkgs/applications/misc/urlview/default.nix
index 8764c41c8a4c..ad29c8f94d8b 100644
--- a/pkgs/applications/misc/urlview/default.nix
+++ b/pkgs/applications/misc/urlview/default.nix
@@ -31,10 +31,21 @@ stdenv.mkDerivation rec {
 
   patches = debianPatches;
 
-  meta = {
+  postPatch = ''
+    substituteInPlace urlview.c \
+      --replace '/etc/urlview/url_handler.sh' "$out/etc/urlview/url_handler.sh"
+  '';
+
+  postInstall = ''
+    install -Dm755 url_handler.sh $out/etc/urlview/url_handler.sh
+    patchShebangs $out/etc/urlview
+  '';
+
+  meta = with stdenv.lib; {
     description = "Extract URLs from text";
     homepage = https://packages.qa.debian.org/u/urlview.html;
-    license = stdenv.lib.licenses.gpl2;
-    platforms = with stdenv.lib.platforms; linux ++ darwin;
+    license = licenses.gpl2;
+    platforms = with platforms; linux ++ darwin;
+    maintainers = with maintainers; [ ma27 ];
   };
 }