summary refs log tree commit diff
path: root/pkgs/misc
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/misc')
-rw-r--r--pkgs/misc/cups/default.nix2
-rw-r--r--pkgs/misc/cups/drivers/brother/dcp375cw/default.nix97
-rw-r--r--pkgs/misc/cups/drivers/brother/mfc465cncupswrapper/default.nix82
-rw-r--r--pkgs/misc/cups/drivers/brother/mfc465cnlpr/default.nix67
-rw-r--r--pkgs/misc/cups/drivers/canon/default.nix6
-rw-r--r--pkgs/misc/cups/drivers/samsung/4.00.39/builder.sh2
-rw-r--r--pkgs/misc/fastly/default.nix6
-rw-r--r--pkgs/misc/i3a/default.nix2
-rw-r--r--pkgs/misc/mnemonicode/default.nix18
-rw-r--r--pkgs/misc/openrussian-cli/default.nix59
10 files changed, 265 insertions, 76 deletions
diff --git a/pkgs/misc/cups/default.nix b/pkgs/misc/cups/default.nix
index ba414d7aec5..c8df29776db 100644
--- a/pkgs/misc/cups/default.nix
+++ b/pkgs/misc/cups/default.nix
@@ -40,7 +40,7 @@ stdenv.mkDerivation rec {
       # service would stop the socket and break subsequent socket activations.
       # See https://github.com/apple/cups/issues/6005
       sed -i '/PartOf=cups.service/d' scheduler/cups.socket.in
-  '' + lib.optionalString (stdenv.isDarwin && lib.versionOlder stdenv.targetPlatform.darwinSdkVersion "12") ''
+  '' + lib.optionalString (stdenv.hostPlatform.isDarwin && lib.versionOlder stdenv.hostPlatform.darwinSdkVersion "12") ''
     substituteInPlace backend/usb-darwin.c \
       --replace "kIOMainPortDefault" "kIOMasterPortDefault"
   '';
diff --git a/pkgs/misc/cups/drivers/brother/dcp375cw/default.nix b/pkgs/misc/cups/drivers/brother/dcp375cw/default.nix
new file mode 100644
index 00000000000..c9e92e839a0
--- /dev/null
+++ b/pkgs/misc/cups/drivers/brother/dcp375cw/default.nix
@@ -0,0 +1,97 @@
+{ lib, stdenv, fetchurl, cups, dpkg, gnused, makeWrapper, ghostscript, file
+, a2ps, coreutils, gnugrep, which, gawk }:
+
+let
+  version = "1.1.3";
+  model = "dcp375cw";
+in rec {
+  driver = stdenv.mkDerivation {
+    pname = "${model}-lpr";
+    inherit version;
+
+    src = fetchurl {
+      url =
+        "https://download.brother.com/welcome/dlf005427/dcp375cwlpr-${version}-1.i386.deb";
+      sha256 =
+        "6daf0144b5802ea8da394ca14db0e6f0200d4049545649283791f899b7f7bd26";
+    };
+
+    nativeBuildInputs = [ dpkg makeWrapper ];
+    buildInputs = [ cups ghostscript a2ps gawk ];
+    unpackPhase = "dpkg-deb -x $src $out";
+
+    installPhase = ''
+      substituteInPlace $out/opt/brother/Printers/${model}/lpd/filter${model} \
+      --replace /opt "$out/opt"
+
+      patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
+      $out/opt/brother/Printers/${model}/lpd/br${model}filter
+
+      mkdir -p $out/lib/cups/filter/
+      ln -s $out/opt/brother/Printers/${model}/lpd/filter${model} $out/lib/cups/filter/brlpdwrapper${model}
+
+      wrapProgram $out/opt/brother/Printers/${model}/lpd/filter${model} \
+        --prefix PATH ":" ${
+          lib.makeBinPath [
+            gawk
+            ghostscript
+            a2ps
+            file
+            gnused
+            gnugrep
+            coreutils
+            which
+          ]
+        }
+    '';
+
+    meta = with lib; {
+      homepage = "http://www.brother.com/";
+      description = "Brother ${model} printer driver";
+      sourceProvenance = with sourceTypes; [ binaryNativeCode ];
+      license = licenses.unfree;
+      platforms = platforms.linux;
+      downloadPage =
+        "https://support.brother.com/g/b/downloadlist.aspx?c=gb&lang=en&prod=${model}_all&os=128";
+      maintainers = with maintainers; [ marcovergueira ];
+    };
+  };
+
+  cupswrapper = stdenv.mkDerivation {
+    pname = "${model}-cupswrapper";
+    inherit version;
+
+    src = fetchurl {
+      url =
+        "https://download.brother.com/welcome/dlf005429/dcp375cwcupswrapper-${version}-1.i386.deb";
+      sha256 =
+        "9a255728b595d2667b2caf9d0d332b677e1a6829a3ec1ed6d4e900a44069cf2d";
+    };
+
+    nativeBuildInputs = [ dpkg makeWrapper ];
+    buildInputs = [ cups ghostscript a2ps gawk ];
+    unpackPhase = "dpkg-deb -x $src $out";
+
+    installPhase = ''
+      for f in $out/opt/brother/Printers/${model}/cupswrapper/cupswrapper${model}; do
+        wrapProgram $f --prefix PATH : ${
+          lib.makeBinPath [ coreutils ghostscript gnugrep gnused ]
+        }
+      done
+
+      mkdir -p $out/share/cups/model
+      ln -s $out/opt/brother/Printers/${model}/cupswrapper/brother_${model}_printer_en.ppd $out/share/cups/model/
+    '';
+
+    meta = with lib; {
+      homepage = "http://www.brother.com/";
+      description = "Brother ${model} printer CUPS wrapper driver";
+      sourceProvenance = with sourceTypes; [ binaryNativeCode ];
+      license = licenses.unfree;
+      platforms = platforms.linux;
+      downloadPage =
+        "https://support.brother.com/g/b/downloadlist.aspx?c=gb&lang=en&prod=${model}_all&os=128";
+      maintainers = with maintainers; [ marcovergueira ];
+    };
+  };
+}
diff --git a/pkgs/misc/cups/drivers/brother/mfc465cncupswrapper/default.nix b/pkgs/misc/cups/drivers/brother/mfc465cncupswrapper/default.nix
new file mode 100644
index 00000000000..c64e48a86ce
--- /dev/null
+++ b/pkgs/misc/cups/drivers/brother/mfc465cncupswrapper/default.nix
@@ -0,0 +1,82 @@
+{ lib
+, stdenv
+, fetchurl
+, dpkg
+, makeWrapper
+, coreutils
+, gnugrep
+, gnused
+, mfc465cnlpr
+, pkgsi686Linux
+, psutils
+}:
+
+stdenv.mkDerivation rec {
+  pname = "mfc465cncupswrapper";
+  version = "1.0.1-1";
+
+  src = fetchurl {
+    url = "https://download.brother.com/welcome/dlf006134/${pname}-${version}.i386.deb";
+    sha256 = "59a62ed3cf10f1565c08ace55832bd48bd5034f7067662870edf7ff3bf0cb76a";
+  };
+
+  unpackPhase = ''
+    dpkg-deb -x $src $out
+  '';
+
+  nativeBuildInputs = [
+    dpkg
+    makeWrapper
+  ];
+
+  dontBuild = true;
+
+  installPhase = ''
+    lpr=${mfc465cnlpr}/usr/local/Brother/Printer/mfc465cn
+    dir=$out/usr/local/Brother/Printer/mfc465cn
+    interpreter=${pkgsi686Linux.glibc.out}/lib/ld-linux.so.2
+    patchelf --set-interpreter "$interpreter" "$dir/cupswrapper/brcupsconfpt1"
+    substituteInPlace $dir/cupswrapper/cupswrappermfc465cn \
+      --replace "mkdir -p /usr" ": # mkdir -p /usr" \
+      --replace '/''${printer_model}' "/mfc465cn" \
+      --replace 'br''${printer_model}' "brmfc465cn" \
+      --replace 'brlpdwrapper''${printer_model}' "brlpdwrappermfc465cn" \
+      --replace 'filter''${printer_model}' "filtermfc465cn" \
+      --replace ' ''${printer_name}' " MFC465CN" \
+      --replace ' ''${device_name}' " MFC-465CN" \
+      --replace '(''${device_name}' "(MFC-465CN" \
+      --replace ':''${device_name}' ":MFC-465CN" \
+      --replace '/''${device_name}' "/MFC-465CN" \
+      --replace 'BR''${pcfilename}' "BR465" \
+      --replace '/''${device_model}' "/Printer" \
+      --replace '/usr/lib64/cups/filter/brlpdwrappermfc465cn' "$out/lib/cups/filter/brlpdwrappermfc465cn" \
+      --replace '/usr/local/Brother/Printer/mfc465cn/lpd/filtermfc465cn' "$lpr/lpd/filtermfc465cn" \
+      --replace '/usr/share/ppd/brmfc465cn.ppd' "$dir/cupswrapper/brmfc465.ppd" \
+      --replace '/usr/share/cups/model/brmfc465cn.ppd' "$dir/cupswrapper/brmfc465.ppd" \
+      --replace '/usr/lib/cups/filter/brlpdwrappermfc465cn' "$out/usr/lib/cups/filter/brlpdwrappermfc465cn" \
+      --replace 'nup="psnup' "nup=\"${psutils}/bin/psnup" \
+      --replace '/usr/bin/psnup' "${psutils}/bin/psnup" \
+      --replace '/usr/local/Brother/Printer/mfc465cn/cupswrapper/brcupsconfpt1' "$dir/cupswrapper/brcupsconfpt1" \
+      --replace '/usr/local/Brother/Printer/mfc465cn/inf' "$lpr/inf"
+    # Create the PPD file from the cupswrapper file
+    sed -n '/ENDOFPPDFILE1/,/ENDOFPPDFILE1/p' "$dir/cupswrapper/cupswrappermfc465cn" | head -n -1 | tail -n +2 > $dir/cupswrapper/brmfc465.ppd
+    sed -n '/ENDOFPPDFILE_END/,/ENDOFPPDFILE_END/p' "$dir/cupswrapper/cupswrappermfc465cn" | head -n -1 | tail -n +2 >> $dir/cupswrapper/brmfc465.ppd
+    chmod 644 $dir/cupswrapper/brmfc465.ppd
+    mkdir -p $out/lib/cups/filter
+    mkdir -p $out/share/cups/model
+    ln $dir/cupswrapper/cupswrappermfc465cn $out/lib/cups/filter
+    ln $dir/cupswrapper/brmfc465.ppd $out/share/cups/model
+    sed -n '/!ENDOFWFILTER!/,/!ENDOFWFILTER!/p' "$dir/cupswrapper/cupswrappermfc465cn" | sed '1 br; b; :r s/.*/printer_model=mfc465cn; cat <<!ENDOFWFILTER!/'  | bash > $out/lib/cups/filter/brlpdwrappermfc465cn
+    sed -i "/#! \/bin\/sh/a PATH=${lib.makeBinPath [ coreutils gnused gnugrep ]}:\$PATH" $out/lib/cups/filter/brlpdwrappermfc465cn
+    chmod 755 $out/lib/cups/filter/brlpdwrappermfc465cn
+    '';
+
+  meta = with lib; {
+    description = "Brother MFC-465CN CUPS wrapper driver";
+    homepage = "http://www.brother.com/";
+    sourceProvenance = with sourceTypes; [ binaryNativeCode ];
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ phrogg ];
+  };
+}
diff --git a/pkgs/misc/cups/drivers/brother/mfc465cnlpr/default.nix b/pkgs/misc/cups/drivers/brother/mfc465cnlpr/default.nix
new file mode 100644
index 00000000000..dc0be00a693
--- /dev/null
+++ b/pkgs/misc/cups/drivers/brother/mfc465cnlpr/default.nix
@@ -0,0 +1,67 @@
+{ stdenv
+, lib
+, fetchurl
+, dpkg
+, makeWrapper
+, coreutils
+, file
+, gawk
+, ghostscript
+, gnused
+, pkgsi686Linux
+}:
+
+stdenv.mkDerivation rec {
+  pname = "mfc465cnlpr";
+  version = "1.0.1-1";
+
+  src = fetchurl {
+    url = "https://download.brother.com/welcome/dlf006132/${pname}-${version}.i386.deb";
+    sha256 = "cfe0289510bf36bee6014286ea78b1ebc6bbb948dbfd3aee02f0664a7743f99b";
+  };
+
+  unpackPhase = ''
+    dpkg-deb -x $src $out
+  '';
+
+  nativeBuildInputs = [
+    dpkg
+    makeWrapper
+  ];
+
+  dontBuild = true;
+
+  installPhase = ''
+    dir=$out/usr/local/Brother/Printer/mfc465cn
+    patchelf --set-interpreter ${pkgsi686Linux.glibc.out}/lib/ld-linux.so.2 $dir/lpd/brmfc465cnfilter
+    wrapProgram $dir/inf/setupPrintcapij \
+      --prefix PATH : ${lib.makeBinPath [
+        coreutils
+      ]}
+    substituteInPlace $dir/lpd/filtermfc465cn \
+      --replace "BR_PRT_PATH=" "BR_PRT_PATH=\"$dir/\" #"
+    wrapProgram $dir/lpd/filtermfc465cn \
+      --prefix PATH : ${lib.makeBinPath [
+        coreutils
+        file
+        ghostscript
+        gnused
+      ]}
+    substituteInPlace $dir/lpd/psconvertij2 \
+      --replace '`which gs`' "${ghostscript}/bin/gs"
+    wrapProgram $dir/lpd/psconvertij2 \
+      --prefix PATH : ${lib.makeBinPath [
+        gnused
+        gawk
+      ]}
+    chmod -R a+w $dir/inf/
+  '';
+
+  meta = with lib; {
+    description = "Brother MFC-465CN LPR printer driver";
+    homepage = "http://www.brother.com/";
+    license = licenses.unfree;
+    maintainers = with maintainers; [ phrogg ];
+    platforms = [ "i686-linux" "x86_64-linux" ];
+  };
+}
diff --git a/pkgs/misc/cups/drivers/canon/default.nix b/pkgs/misc/cups/drivers/canon/default.nix
index 40438d333cf..8614bdda2ab 100644
--- a/pkgs/misc/cups/drivers/canon/default.nix
+++ b/pkgs/misc/cups/drivers/canon/default.nix
@@ -26,9 +26,9 @@
 
 let
   system =
-    if stdenv.targetPlatform.system == "x86_64-linux" then "intel"
-    else if stdenv.targetPlatform.system == "aarch64-linux" then "arm"
-    else throw "Unsupported platform for Canon UFR2 Drivers: ${stdenv.targetPlatform.system}";
+    if stdenv.hostPlatform.system == "x86_64-linux" then "intel"
+    else if stdenv.hostPlatform.system == "aarch64-linux" then "arm"
+    else throw "Unsupported platform for Canon UFR2 Drivers: ${stdenv.hostPlatform.system}";
   ld64 = "${stdenv.cc}/nix-support/dynamic-linker";
   libs = pkgs: lib.makeLibraryPath buildInputs;
 
diff --git a/pkgs/misc/cups/drivers/samsung/4.00.39/builder.sh b/pkgs/misc/cups/drivers/samsung/4.00.39/builder.sh
index bdb52274418..829bc6509e0 100644
--- a/pkgs/misc/cups/drivers/samsung/4.00.39/builder.sh
+++ b/pkgs/misc/cups/drivers/samsung/4.00.39/builder.sh
@@ -1,4 +1,4 @@
-if [ -e .attrs.sh ]; then source .attrs.sh; fi
+if [ -e "$NIX_ATTRS_SH_FILE" ]; then . "$NIX_ATTRS_SH_FILE"; elif [ -f .attrs.sh ]; then . .attrs.sh; fi
 source $stdenv/setup
 
 arch=$(uname -m)
diff --git a/pkgs/misc/fastly/default.nix b/pkgs/misc/fastly/default.nix
index fe6c5a21ceb..ca191319243 100644
--- a/pkgs/misc/fastly/default.nix
+++ b/pkgs/misc/fastly/default.nix
@@ -10,13 +10,13 @@
 
 buildGoModule rec {
   pname = "fastly";
-  version = "10.6.2";
+  version = "10.6.4";
 
   src = fetchFromGitHub {
     owner = "fastly";
     repo = "cli";
     rev = "refs/tags/v${version}";
-    hash = "sha256-j4dqLV1Q17RQczkTqGTh8S8Y6ELqXjWuJRr+xB/x2yE=";
+    hash = "sha256-+qBeE7t+d1Es63hUBO9Bcqyc0vtatcJGoYw2GE0JPxQ=";
     # The git commit is part of the `fastly version` original output;
     # leave that output the same in nixpkgs. Use the `.git` directory
     # to retrieve the commit SHA, and remove the directory afterwards,
@@ -33,7 +33,7 @@ buildGoModule rec {
     "cmd/fastly"
   ];
 
-  vendorHash = "sha256-aCekNpf6C5fGIEk0pLkz4hJ6mQfBIzeCsIL6Fxf2QGk=";
+  vendorHash = "sha256-Mh737emdQkIoNOAkaTafCoMQnLqXIGMKX6X5ClsmMzc=";
 
   nativeBuildInputs = [
     installShellFiles
diff --git a/pkgs/misc/i3a/default.nix b/pkgs/misc/i3a/default.nix
index 5bfc2c5c4a3..42d8c11915c 100644
--- a/pkgs/misc/i3a/default.nix
+++ b/pkgs/misc/i3a/default.nix
@@ -24,6 +24,6 @@ python3Packages.buildPythonApplication rec {
     homepage = "https://git.goral.net.pl/mgoral/i3a";
     description = "A set of scripts used for automation of i3 and sway window manager layouts";
     license = licenses.gpl3Plus;
-    maintainers = with maintainers; [ fortuneteller2k ];
+    maintainers = with maintainers; [ moni ];
   };
 }
diff --git a/pkgs/misc/mnemonicode/default.nix b/pkgs/misc/mnemonicode/default.nix
index 4ecacaf418a..1cd78fdce09 100644
--- a/pkgs/misc/mnemonicode/default.nix
+++ b/pkgs/misc/mnemonicode/default.nix
@@ -1,20 +1,21 @@
 { stdenv, lib, fetchFromGitHub }:
 
-stdenv.mkDerivation {
+stdenv.mkDerivation (finalAttrs: {
   pname = "mnemonicode";
-  version = "2015-11-30";
+  version = "1.0.0";
   src = fetchFromGitHub {
     owner = "singpolyma";
     repo = "mnemonicode";
-    rev = "1687fabdf48acf68d4186f219bc20bffe02e8ee0";
-    sha256 = "0kp1jhhqfwfiqg9kx0mbyr4qh4yc4zg4szqk5fbf809nx2pvprm5";
+    rev = finalAttrs.version;
+    hash = "sha256-bGipPvLj6ig+lMLsl/Yve8PmuA93ETvhNKoMPh0JMBM=";
   };
   installPhase = ''
     mkdir -p $out/bin
-    cp mnencode $out/bin
-    cp mndecode $out/bin
+    mv mnencode $out/bin
+    mv mndecode $out/bin
   '';
   meta = with lib; {
+    homepage = "https://github.com/singpolyma/mnemonicode";
     description = ''
       Routines which implement a method for encoding binary data into a sequence
       of words which can be spoken over the phone, for example, and converted
@@ -22,6 +23,7 @@ stdenv.mkDerivation {
     '';
     license = licenses.mit;
     platforms = platforms.all;
-    maintainers = [ ];
+    maintainers = with maintainers; [ kirillrdy ];
+    mainProgram = "mnencode";
   };
-}
+})
diff --git a/pkgs/misc/openrussian-cli/default.nix b/pkgs/misc/openrussian-cli/default.nix
deleted file mode 100644
index 038bdd5a73f..00000000000
--- a/pkgs/misc/openrussian-cli/default.nix
+++ /dev/null
@@ -1,59 +0,0 @@
-{ stdenv, lib, fetchFromGitHub, pkg-config, wget, unzip
-, sqlite, which, lua, installShellFiles, makeWrapper
-}:
-let
-  luaEnv = lua.withPackages(p: with p; [ luasql-sqlite3 luautf8 ]);
-in
-stdenv.mkDerivation rec {
-  pname   = "openrussian-cli";
-  version = "1.0.0";
-
-  src = fetchFromGitHub {
-    owner   = "rhaberkorn";
-    repo    = "openrussian-cli";
-    rev     = version;
-    sha256  = "1ria7s7dpqip2wdwn35wmkry84g8ghdqnxc9cbxzzq63vl6pgvcn";
-  };
-
-  nativeBuildInputs = [
-    pkg-config wget unzip sqlite which installShellFiles makeWrapper
-  ];
-
-  buildInputs = [ luaEnv ];
-
-  makeFlags = [
-    "LUA=${luaEnv}/bin/lua"
-    "LUAC=${luaEnv}/bin/luac"
-  ];
-
-  dontConfigure = true;
-
-  # Can't use "make install" here
-  installPhase = ''
-    runHook preInstall
-
-    mkdir -p $out/bin $out/share/openrussian
-    cp openrussian-sqlite3.db $out/share/openrussian
-    cp openrussian $out/bin
-
-    wrapProgram $out/bin/openrussian \
-      --prefix LUA_PATH ';' '${lua.pkgs.luaLib.genLuaPathAbsStr luaEnv}' \
-      --prefix LUA_CPATH ';' '${lua.pkgs.luaLib.genLuaCPathAbsStr luaEnv}'
-
-    runHook postInstall
-  '';
-
-  postInstall = ''
-    installShellCompletion --cmd openrussian --bash ./openrussian-completion.bash
-    installManPage ./openrussian.1
-  '';
-
-  meta = with lib; {
-    description = "Offline Console Russian Dictionary (based on openrussian.org)";
-    homepage    = "https://github.com/rhaberkorn/openrussian-cli";
-    license     = with licenses; [ gpl3Only mit cc-by-sa-40 ];
-    maintainers = with maintainers; [ zane ];
-    mainProgram = "openrussian";
-    platforms   = platforms.unix;
-  };
-}