about summary refs log tree commit diff
path: root/pkgs/misc
diff options
context:
space:
mode:
authorJan Tojnar <jtojnar@gmail.com>2023-01-02 03:01:35 +0100
committerJan Tojnar <jtojnar@gmail.com>2023-01-02 03:04:32 +0100
commit5810109b422a3d578ab803280b594133b20576f2 (patch)
tree945523abae70d25e7e1c1987757d53e1bc7e8d17 /pkgs/misc
parentc791e28190627f19d9506683f296cc970ef655ee (diff)
parent3f1573f21671b737b24efeed714958cf0e5cc7f5 (diff)
Merge branch 'staging-next' into staging
- readline6 attribute removed from all-packages.nix in d879125d61a0be8ecb2afddaca8f2b0530db0260
- readline attribute was bumped to readline82 in 50adabdd60d590c951824974356a9ccb9bb73ffc
Diffstat (limited to 'pkgs/misc')
-rw-r--r--pkgs/misc/cups/drivers/brother/hll2375dw/default.nix104
-rw-r--r--pkgs/misc/cups/drivers/brother/hll2375dw/fix-perm.patch10
-rw-r--r--pkgs/misc/superd/default.nix4
-rw-r--r--pkgs/misc/wiki-tui/default.nix31
4 files changed, 138 insertions, 11 deletions
diff --git a/pkgs/misc/cups/drivers/brother/hll2375dw/default.nix b/pkgs/misc/cups/drivers/brother/hll2375dw/default.nix
new file mode 100644
index 0000000000000..a6c2db9f90b1c
--- /dev/null
+++ b/pkgs/misc/cups/drivers/brother/hll2375dw/default.nix
@@ -0,0 +1,104 @@
+{ lib
+, stdenv
+, fetchurl
+, dpkg
+, autoPatchelfHook
+, makeWrapper
+, perl
+, gnused
+, ghostscript
+, file
+, coreutils
+, gnugrep
+, which
+}:
+
+let
+  arches = [ "x86_64" "i686" "armv7l" ];
+
+  runtimeDeps = [
+    ghostscript
+    file
+    gnused
+    gnugrep
+    coreutils
+    which
+  ];
+in
+
+stdenv.mkDerivation rec {
+  pname = "cups-brother-hll2375dw";
+  version = "4.0.0-1";
+
+  nativeBuildInputs = [ dpkg makeWrapper autoPatchelfHook ];
+  buildInputs = [ perl ];
+
+  src = fetchurl {
+    url = "https://download.brother.com/welcome/dlf103535//hll2375dwpdrv-${version}.i386.deb";
+    hash = "sha256-N5VCBZLFrfw29QjjzlSvQ12urvyaf7ez/RJ08UwqHdk=";
+  };
+
+  unpackPhase = "dpkg-deb -x $src .";
+
+  patches = [
+    # The brother lpdwrapper uses a temporary file to convey the printer settings.
+    # The original settings file will be copied with "400" permissions and the "brprintconflsr3"
+    # binary cannot alter the temporary file later on. This fixes the permissions so the can be modified.
+    # Since this is all in briefly in the temporary directory of systemd-cups and not accessible by others,
+    # it shouldn't be a security concern.
+    ./fix-perm.patch
+  ];
+
+  installPhase = ''
+    runHook preInstall
+    mkdir -p $out
+    cp -ar opt $out/opt
+    # delete unnecessary files for the current architecture
+  '' + lib.concatMapStrings
+    (arch: ''
+      echo Deleting files for ${arch}
+      rm -r "$out/opt/brother/Printers/HLL2375DW/lpd/${arch}"
+    '')
+    (builtins.filter (arch: arch != stdenv.hostPlatform.linuxArch) arches) + ''
+    # bundled scripts don't understand the arch subdirectories for some reason
+    ln -s \
+      "$out/opt/brother/Printers/HLL2375DW/lpd/${stdenv.hostPlatform.linuxArch}/"* \
+      "$out/opt/brother/Printers/HLL2375DW/lpd/"
+
+    # Fix global references and replace auto discovery mechanism with hardcoded values
+    substituteInPlace $out/opt/brother/Printers/HLL2375DW/lpd/lpdfilter \
+      --replace "my \$BR_PRT_PATH =" "my \$BR_PRT_PATH = \"$out/opt/brother/Printers/HLL2375DW\"; #" \
+      --replace "PRINTER =~" "PRINTER = \"HLL2375DW\"; #"
+    substituteInPlace $out/opt/brother/Printers/HLL2375DW/cupswrapper/lpdwrapper \
+      --replace "my \$basedir = C" "my \$basedir = \"$out/opt/brother/Printers/HLL2375DW\" ; #" \
+      --replace "PRINTER =~" "PRINTER = \"HLL2375DW\"; #"
+
+    # Make sure all executables have the necessary runtime dependencies available
+    find "$out" -executable -and -type f | while read file; do
+      wrapProgram "$file" --prefix PATH : "${lib.makeBinPath runtimeDeps}"
+    done
+
+    # Symlink filter and ppd into a location where CUPS will discover it
+    mkdir -p $out/lib/cups/filter
+    mkdir -p $out/share/cups/model
+    mkdir -p $out/etc/opt/brother/Printers/HLL2375DW/inf
+
+    ln -s $out/opt/brother/Printers/HLL2375DW/inf/brHLL2375DWrc \
+          $out/etc/opt/brother/Printers/HLL2375DW/inf/brHLL2375DWrc
+    ln -s \
+      $out/opt/brother/Printers/HLL2375DW/cupswrapper/lpdwrapper \
+      $out/lib/cups/filter/brother_lpdwrapper_HLL2375DW
+    ln -s \
+      $out/opt/brother/Printers/HLL2375DW/cupswrapper/brother-HLL2375DW-cups-en.ppd \
+      $out/share/cups/model/
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    homepage = "http://www.brother.com/";
+    description = "Brother HLL2375DW printer driver";
+    license = licenses.unfree;
+    platforms = builtins.map (arch: "${arch}-linux") arches;
+    maintainers = [ maintainers.gador ];
+  };
+}
diff --git a/pkgs/misc/cups/drivers/brother/hll2375dw/fix-perm.patch b/pkgs/misc/cups/drivers/brother/hll2375dw/fix-perm.patch
new file mode 100644
index 0000000000000..6d85ad5bd53d8
--- /dev/null
+++ b/pkgs/misc/cups/drivers/brother/hll2375dw/fix-perm.patch
@@ -0,0 +1,10 @@
+--- a/opt/brother/Printers/HLL2375DW/cupswrapper/lpdwrapper  2022-12-07 18:32:29.950543083 +0100
++++ b/opt/brother/Printers/HLL2375DW/cupswrapper/lpdwrapper      2022-12-07 18:46:03.046989151 +0100
+@@ -379,6 +379,7 @@
+
+
+ `cp  $basedir/inf/br${PRINTER}rc  $TEMPRC`;
++`chmod 666  $TEMPRC`;
+ $ENV{BRPRINTERRCFILE} = $TEMPRC;
+
+ logprint( 0 , "TEMPRC    = $TEMPRC\n");
\ No newline at end of file
diff --git a/pkgs/misc/superd/default.nix b/pkgs/misc/superd/default.nix
index 105d7278e5bb4..be018cb24126b 100644
--- a/pkgs/misc/superd/default.nix
+++ b/pkgs/misc/superd/default.nix
@@ -7,13 +7,13 @@
 
 buildGoModule rec {
   pname = "superd";
-  version = "0.7";
+  version = "0.7.1";
 
   src = fetchFromSourcehut {
     owner = "~craftyguy";
     repo = pname;
     rev = version;
-    hash = "sha256-XSB6qgepWhus15lOP9GzbiNoOCSsy6xLij7ic3LFs1E=";
+    hash = "sha256-5g9Y1Lpxp9cUe0sNvU5CdsTGcN+j00gIKPO9pD5j8uM=";
   };
 
   vendorHash = "sha256-Oa99U3THyWLjH+kWMQAHO5QAS2mmtY7M7leej+gnEqo=";
diff --git a/pkgs/misc/wiki-tui/default.nix b/pkgs/misc/wiki-tui/default.nix
index ae249eb9292eb..9131f66491d5c 100644
--- a/pkgs/misc/wiki-tui/default.nix
+++ b/pkgs/misc/wiki-tui/default.nix
@@ -1,28 +1,41 @@
-{ lib, rustPlatform, fetchFromGitHub, ncurses, openssl, pkg-config, stdenv, Security, fetchpatch }:
+{ lib
+, stdenv
+, rustPlatform
+, fetchFromGitHub
+, ncurses
+, openssl
+, pkg-config
+, Security
+}:
 
 rustPlatform.buildRustPackage rec {
   pname = "wiki-tui";
-  version = "0.6.0";
+  version = "0.6.1";
 
   src = fetchFromGitHub {
     owner = "Builditluc";
     repo = pname;
     rev = "v${version}";
-    sha256 = "sha256-sqkVi8w4QoktC1ZLUPHzfMUxIzCadcIj3dEYigz854U=";
+    hash = "sha256-WiyRBF3rWLpOZ8mxT89ImRL++Oq9+b88oSKjr4tzCGs=";
   };
 
-  buildInputs = [ ncurses openssl ] ++ lib.optional stdenv.isDarwin Security;
+  nativeBuildInputs = [
+    pkg-config
+  ];
 
-  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [
+    ncurses
+    openssl
+  ] ++ lib.optional stdenv.isDarwin [
+    Security
+  ];
 
-  cargoSha256 = "sha256-xRj0bF5VymvFVB0tSBndWA+OHBIEY2/ovRIBdDoOHA4=";
-
-  # Tests fail with this error: `found argument --test-threads which was not expected`
-  doCheck = false;
+  cargoHash = "sha256-R9xxIDqkU7FeulpD7PUM6aHgA67PVgqxHKYtdrjdaUo=";
 
   meta = with lib; {
     description = "A simple and easy to use Wikipedia Text User Interface";
     homepage = "https://github.com/builditluc/wiki-tui";
+    changelog = "https://github.com/Builditluc/wiki-tui/releases/tag/v${version}";
     license = licenses.mit;
     maintainers = with maintainers; [ lom builditluc ];
   };