summary refs log tree commit diff
path: root/pkgs/applications/graphics/sane
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2021-02-08 16:31:35 +0100
committerFlorian Klink <flokli@flokli.de>2021-02-08 16:32:36 +0100
commitc6ce4e1e6fb9a733a63c648879f860e315f08aaa (patch)
treea0583ba2b610fc1b3094b486af014a67a3846bf8 /pkgs/applications/graphics/sane
parent7467ba0b1d7aa64dcb98b3c6235a33e1b4892a8a (diff)
downloadnixpkgs-c6ce4e1e6fb9a733a63c648879f860e315f08aaa.tar
nixpkgs-c6ce4e1e6fb9a733a63c648879f860e315f08aaa.tar.gz
nixpkgs-c6ce4e1e6fb9a733a63c648879f860e315f08aaa.tar.bz2
nixpkgs-c6ce4e1e6fb9a733a63c648879f860e315f08aaa.tar.lz
nixpkgs-c6ce4e1e6fb9a733a63c648879f860e315f08aaa.tar.xz
nixpkgs-c6ce4e1e6fb9a733a63c648879f860e315f08aaa.tar.zst
nixpkgs-c6ce4e1e6fb9a733a63c648879f860e315f08aaa.zip
brscan4: 0.4.8-1 -> 0.4.9-1
Brother removed their old .deb files from the server.

Also, properly set meta.platforms, and switch to pname + version
(#103997)
Diffstat (limited to 'pkgs/applications/graphics/sane')
-rw-r--r--pkgs/applications/graphics/sane/backends/brscan4/default.nix36
1 files changed, 18 insertions, 18 deletions
diff --git a/pkgs/applications/graphics/sane/backends/brscan4/default.nix b/pkgs/applications/graphics/sane/backends/brscan4/default.nix
index 0e768afdde1..9713618d79a 100644
--- a/pkgs/applications/graphics/sane/backends/brscan4/default.nix
+++ b/pkgs/applications/graphics/sane/backends/brscan4/default.nix
@@ -1,5 +1,4 @@
-{ lib, stdenv, fetchurl, callPackage, patchelf, makeWrapper, coreutils, libusb-compat-0_1 }:
-
+{ stdenv, lib, fetchurl, callPackage, patchelf, makeWrapper, coreutils, libusb-compat-0_1 }:
 let
   myPatchElf = file: with lib; ''
     patchelf --set-interpreter \
@@ -7,22 +6,23 @@ let
       ${file}
   '';
 
-  udevRules = callPackage ./udev_rules_type1.nix {};
+  udevRules = callPackage ./udev_rules_type1.nix { };
+
+in
+stdenv.mkDerivation rec {
+  pname = "brscan4";
+  version = "0.4.9-1";
+  src = {
+    "i686-linux" = fetchurl {
+      url = "http://download.brother.com/welcome/dlf006646/${pname}-${version}.i386.deb";
+      sha256 = "0pkg9aqvnkpjnb9cgzf7lxw2g4jqrf2w98irkv22r0gfsfs3nwma";
+    };
+    "x86_64-linux" = fetchurl {
 
-in stdenv.mkDerivation rec {
-  name = "brscan4-0.4.8-1";
-  src =
-    if stdenv.hostPlatform.system == "i686-linux" then
-      fetchurl {
-        url = "http://download.brother.com/welcome/dlf006646/${name}.i386.deb";
-        sha256 = "15hrf1gpm36lniqi6yf47dvdqjinm644xb752c6rcv8n06wb79ag";
-      }
-    else if stdenv.hostPlatform.system == "x86_64-linux" then
-      fetchurl {
-        url = "https://download.brother.com/welcome/dlf006645/${name}.amd64.deb";
-        sha256 = "0pyprjl0capg403yp6pp07gd6msx9kn7bzjcdswdbn28fyxrk5l4";
-      }
-    else throw "${name} is not supported on ${stdenv.hostPlatform.system} (only i686-linux and x86_64 linux are supported)";
+      url = "https://download.brother.com/welcome/dlf006645/${pname}-${version}.amd64.deb";
+      sha256 = "0kakkl8rmsi2yr3f8vd1kk8vsl9g2ijhqil1cvvbwrhwgi0b7ai7";
+    };
+  }."${stdenv.hostPlatform.system}";
 
   unpackPhase = ''
     ar x $src
@@ -87,7 +87,7 @@ in stdenv.mkDerivation rec {
   meta = {
     description = "Brother brscan4 sane backend driver";
     homepage = "http://www.brother.com";
-    platforms = lib.platforms.linux;
+    platforms = [ "i686-linux" "x86_64-linux" ];
     license = lib.licenses.unfree;
     maintainers = with lib.maintainers; [ jraygauthier ];
   };