summary refs log tree commit diff
path: root/pkgs/applications/graphics/simple-scan/default.nix
diff options
context:
space:
mode:
authorRaymond Gauthier <jraygauthier@gmail.com>2016-05-17 00:49:28 -0400
committerRaymond Gauthier <jraygauthier@gmail.com>2016-05-17 00:49:28 -0400
commite7cc2de7dda5ccb04e6d169158225072e4ff23b9 (patch)
treee5121213d352cbf36c490f4b9274190178c3b7e6 /pkgs/applications/graphics/simple-scan/default.nix
parent551296a1cec0b9751ab96c420a7481e322ea127d (diff)
downloadnixpkgs-e7cc2de7dda5ccb04e6d169158225072e4ff23b9.tar
nixpkgs-e7cc2de7dda5ccb04e6d169158225072e4ff23b9.tar.gz
nixpkgs-e7cc2de7dda5ccb04e6d169158225072e4ff23b9.tar.bz2
nixpkgs-e7cc2de7dda5ccb04e6d169158225072e4ff23b9.tar.lz
nixpkgs-e7cc2de7dda5ccb04e6d169158225072e4ff23b9.tar.xz
nixpkgs-e7cc2de7dda5ccb04e6d169158225072e4ff23b9.tar.zst
nixpkgs-e7cc2de7dda5ccb04e6d169158225072e4ff23b9.zip
simple-scan: improvements
Fix missing icon. It was looking for a "scanner" device
icon that can be only found as part of gnome3 default theme.

Copied this device icon and renamed it as *the* simple-scan
application icon.
Diffstat (limited to 'pkgs/applications/graphics/simple-scan/default.nix')
-rw-r--r--pkgs/applications/graphics/simple-scan/default.nix22
1 files changed, 21 insertions, 1 deletions
diff --git a/pkgs/applications/graphics/simple-scan/default.nix b/pkgs/applications/graphics/simple-scan/default.nix
index 417d117d688..40322a98e17 100644
--- a/pkgs/applications/graphics/simple-scan/default.nix
+++ b/pkgs/applications/graphics/simple-scan/default.nix
@@ -1,5 +1,6 @@
 { stdenv, fetchurl, cairo, colord, glib, gtk3, gusb, intltool, itstool
-, libusb1, libxml2, pkgconfig, sane-backends, vala, wrapGAppsHook }:
+, libusb1, libxml2, pkgconfig, sane-backends, vala, wrapGAppsHook   
+, gnome3 }:
 
 stdenv.mkDerivation rec {
   name = "simple-scan-${version}";
@@ -16,11 +17,30 @@ stdenv.mkDerivation rec {
 
   configureFlags = [ "--disable-packagekit" ];
 
+  patchPhase = ''
+    sed -i -e 's#Icon=scanner#Icon=simple-scan#g' ./data/simple-scan.desktop.in
+  '';
+
   preBuild = ''
     # Clean up stale .c files referencing packagekit headers as of 3.20.0:
     make clean
   '';
 
+  postInstall = ''
+    (
+    cd ${gnome3.defaultIconTheme}/share/icons/Adwaita
+
+    for f in `find . | grep 'scanner\.'` 
+    do
+      local outFile="`echo "$out/share/icons/hicolor/$f" | sed \
+        -e 's#/devices/#/apps/#g' \
+        -e 's#scanner\.#simple-scan\.#g'`"
+      mkdir -p "`realpath -m "$outFile/.."`"
+      cp "$f" "$outFile"
+    done
+    )
+  '';
+
   enableParallelBuilding = true;
 
   doCheck = true;