uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
29
pkgs/misc/cups/0001-TargetConditionals.patch
Normal file
29
pkgs/misc/cups/0001-TargetConditionals.patch
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
From 1204c841999808ba27267a0039777dcbccdcd6e3 Mon Sep 17 00:00:00 2001
|
||||
From: toonn <toonn@toonn.io>
|
||||
Date: Sun, 27 Jun 2021 12:30:08 +0200
|
||||
Subject: [PATCH] TargetConditionals
|
||||
|
||||
---
|
||||
test/ippserver.c | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/test/ippserver.c b/test/ippserver.c
|
||||
index 38b304f..68ccab1 100644
|
||||
--- a/test/ippserver.c
|
||||
+++ b/test/ippserver.c
|
||||
@@ -25,7 +25,11 @@
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
-#include <config.h> /* CUPS configuration header */
|
||||
+#ifdef __APPLE__
|
||||
+# include <xcode/config.h> /* CUPS configuration header macOS */
|
||||
+#else
|
||||
+# include <config.h> /* CUPS configuration header */
|
||||
+#endif /* __APPLE__ */
|
||||
#include <cups/cups.h> /* Public API */
|
||||
#include <cups/string-private.h> /* CUPS string functions */
|
||||
#include <cups/thread-private.h> /* For multithreading functions */
|
||||
--
|
||||
2.17.2 (Apple Git-113)
|
||||
|
||||
30
pkgs/misc/cups/cups-pk-helper.nix
Normal file
30
pkgs/misc/cups/cups-pk-helper.nix
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{ lib, stdenv, fetchurl, intltool, pkg-config, glib, polkit, cups, fetchpatch }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
version = "0.2.6";
|
||||
pname = "cups-pk-helper";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://www.freedesktop.org/software/cups-pk-helper/releases/cups-pk-helper-${version}.tar.xz";
|
||||
sha256 = "0a52jw6rm7lr5nbyksiia0rn7sasyb5cjqcb95z1wxm2yprgi6lm";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ pkg-config intltool ];
|
||||
buildInputs = [ glib polkit cups ];
|
||||
|
||||
patches = [
|
||||
# Don't use etc/dbus-1/system.d
|
||||
(fetchpatch {
|
||||
url = "https://gitlab.freedesktop.org/cups-pk-helper/cups-pk-helper/merge_requests/2.patch";
|
||||
sha256 = "1kamhr5kn8c1y0q8xbip0fgr7maf3dyddlvab4n0iypk7rwwikl0";
|
||||
})
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "PolicyKit helper to configure cups with fine-grained privileges";
|
||||
homepage = "http://www.freedesktop.org/wiki/Software/cups-pk-helper/";
|
||||
license = licenses.gpl2;
|
||||
platforms = platforms.linux;
|
||||
maintainers = [ maintainers.bjornfor ];
|
||||
};
|
||||
}
|
||||
161
pkgs/misc/cups/default.nix
Normal file
161
pkgs/misc/cups/default.nix
Normal file
|
|
@ -0,0 +1,161 @@
|
|||
{ lib, stdenv
|
||||
, fetchurl
|
||||
, fetchpatch
|
||||
, pkg-config
|
||||
, removeReferencesTo
|
||||
, zlib
|
||||
, libjpeg
|
||||
, libpng
|
||||
, libtiff
|
||||
, pam
|
||||
, dbus
|
||||
, enableSystemd ? stdenv.isLinux
|
||||
, systemd
|
||||
, acl
|
||||
, gmp
|
||||
, darwin
|
||||
, libusb1 ? null
|
||||
, gnutls ? null
|
||||
, avahi ? null
|
||||
, libpaper ? null
|
||||
, coreutils
|
||||
, nixosTests
|
||||
}:
|
||||
|
||||
with lib;
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "cups";
|
||||
|
||||
# After 2.2.6, CUPS requires headers only available in macOS 10.12+
|
||||
version = if stdenv.isDarwin then "2.2.6" else "2.4.2";
|
||||
|
||||
src = fetchurl (if stdenv.isDarwin then {
|
||||
url = "https://github.com/apple/cups/releases/download/v${version}/cups-${version}-source.tar.gz";
|
||||
sha256 = "16qn41b84xz6khrr2pa2wdwlqxr29rrrkjfi618gbgdkq9w5ff20";
|
||||
} else {
|
||||
url = "https://github.com/OpenPrinting/cups/releases/download/v${version}/cups-${version}-source.tar.gz";
|
||||
sha256 = "sha256-8DzLQLCH0eMJQKQOAUHcu6Jj85l0wg658lIQZsnGyQg=";
|
||||
});
|
||||
|
||||
outputs = [ "out" "lib" "dev" "man" ];
|
||||
|
||||
patches = lib.optionals (version == "2.2.6") [
|
||||
./0001-TargetConditionals.patch
|
||||
(fetchpatch {
|
||||
name = "CVE-2022-26691.patch";
|
||||
url = "https://github.com/OpenPrinting/cups/commit/de4f8c196106033e4c372dce3e91b9d42b0b9444.patch";
|
||||
sha256 = "sha256-IKOtV7bCS6PstwK6YqnYRYTeH562jWwkley86p+6Of8=";
|
||||
excludes = [ "CHANGES.md" ];
|
||||
})
|
||||
(fetchpatch {
|
||||
name = "CVE-2022-26691-fix-comment.patch";
|
||||
url = "https://github.com/OpenPrinting/cups/commit/411b6136f450a583ee08c3880fa09dbe837eb3f1.patch";
|
||||
sha256 = "sha256-dVopmr34c9N5H2ZZz52rXVnHQBuDTNo8M40x9455+jQ=";
|
||||
})
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace cups/testfile.c \
|
||||
--replace 'cupsFileFind("cat", "/bin' 'cupsFileFind("cat", "${coreutils}/bin'
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [ pkg-config removeReferencesTo ];
|
||||
|
||||
buildInputs = [ zlib libjpeg libpng libtiff libusb1 gnutls libpaper ]
|
||||
++ optionals stdenv.isLinux [ avahi pam dbus acl ]
|
||||
++ optional enableSystemd systemd
|
||||
++ optionals stdenv.isDarwin (with darwin; [
|
||||
configd apple_sdk.frameworks.ApplicationServices
|
||||
]);
|
||||
|
||||
propagatedBuildInputs = [ gmp ];
|
||||
|
||||
configureFlags = [
|
||||
"--localstatedir=/var"
|
||||
"--sysconfdir=/etc"
|
||||
"--enable-raw-printing"
|
||||
"--enable-threads"
|
||||
] ++ optionals stdenv.isLinux [
|
||||
"--enable-dbus"
|
||||
"--enable-pam"
|
||||
"--with-dbusdir=${placeholder "out"}/share/dbus-1"
|
||||
] ++ optional (libusb1 != null) "--enable-libusb"
|
||||
++ optional (gnutls != null) "--enable-ssl"
|
||||
++ optional (avahi != null) "--enable-avahi"
|
||||
++ optional (libpaper != null) "--enable-libpaper"
|
||||
++ optional stdenv.isDarwin "--disable-launchd";
|
||||
|
||||
# AR has to be an absolute path
|
||||
preConfigure = ''
|
||||
export AR="${getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ar"
|
||||
configureFlagsArray+=(
|
||||
# Put just lib/* and locale into $lib; this didn't work directly.
|
||||
# lib/cups is moved back to $out in postInstall.
|
||||
# Beware: some parts of cups probably don't fully respect these.
|
||||
"--prefix=$lib"
|
||||
"--datadir=$out/share"
|
||||
"--localedir=$lib/share/locale"
|
||||
|
||||
"--with-systemd=$out/lib/systemd/system"
|
||||
|
||||
${optionalString stdenv.isDarwin ''
|
||||
"--with-bundledir=$out"
|
||||
''}
|
||||
)
|
||||
'';
|
||||
|
||||
installFlags =
|
||||
[ # Don't try to write in /var at build time.
|
||||
"CACHEDIR=$(TMPDIR)/dummy"
|
||||
"LOGDIR=$(TMPDIR)/dummy"
|
||||
"REQUESTS=$(TMPDIR)/dummy"
|
||||
"STATEDIR=$(TMPDIR)/dummy"
|
||||
# Idem for /etc.
|
||||
"PAMDIR=$(out)/etc/pam.d"
|
||||
"XINETD=$(out)/etc/xinetd.d"
|
||||
"SERVERROOT=$(out)/etc/cups"
|
||||
# Idem for /usr.
|
||||
"MENUDIR=$(out)/share/applications"
|
||||
"ICONDIR=$(out)/share/icons"
|
||||
# Work around a Makefile bug.
|
||||
"CUPS_PRIMARY_SYSTEM_GROUP=root"
|
||||
];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
postInstall = ''
|
||||
libexec=${if stdenv.isDarwin then "libexec/cups" else "lib/cups"}
|
||||
moveToOutput $libexec "$out"
|
||||
|
||||
# $lib contains references to $out/share/cups.
|
||||
# CUPS is working without them, so they are not vital.
|
||||
find "$lib" -type f -exec grep -q "$out" {} \; \
|
||||
-printf "removing references from %p\n" \
|
||||
-exec remove-references-to -t "$out" {} +
|
||||
|
||||
# Delete obsolete stuff that conflicts with cups-filters.
|
||||
rm -rf $out/share/cups/banners $out/share/cups/data/testprint
|
||||
|
||||
moveToOutput bin/cups-config "$dev"
|
||||
sed -e "/^cups_serverbin=/s|$lib|$out|" \
|
||||
-i "$dev/bin/cups-config"
|
||||
|
||||
for f in "$out"/lib/systemd/system/*; do
|
||||
substituteInPlace "$f" --replace "$lib/$libexec" "$out/$libexec"
|
||||
done
|
||||
'' + optionalString stdenv.isLinux ''
|
||||
# Use xdg-open when on Linux
|
||||
substituteInPlace "$out"/share/applications/cups.desktop \
|
||||
--replace "Exec=htmlview" "Exec=xdg-open"
|
||||
'';
|
||||
|
||||
passthru.tests.nixos = nixosTests.printing;
|
||||
|
||||
meta = {
|
||||
homepage = "https://openprinting.github.io/cups/";
|
||||
description = "A standards-based printing system for UNIX";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ matthewbauer ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
125
pkgs/misc/cups/drivers/brgenml1cupswrapper/default.nix
Normal file
125
pkgs/misc/cups/drivers/brgenml1cupswrapper/default.nix
Normal file
|
|
@ -0,0 +1,125 @@
|
|||
{ lib, stdenv, fetchurl, makeWrapper, cups, perl, coreutils, gnused, gnugrep
|
||||
, brgenml1lpr, debugLvl ? "0"}:
|
||||
|
||||
/*
|
||||
[Setup instructions](http://support.brother.com/g/s/id/linux/en/instruction_prn1a.html).
|
||||
|
||||
URI example
|
||||
~ `lpd://BRW0080927AFBCE/binary_p1`
|
||||
|
||||
Logging
|
||||
-------
|
||||
|
||||
`/tmp/br_cupswrapper_ml1.log` when `DEBUG > 0` in `brother_lpdwrapper_BrGenML1`.
|
||||
Note that when `DEBUG > 1` the wrapper stops performing its function. Better
|
||||
keep `DEBUG == 1` unless this is desirable.
|
||||
|
||||
Now activable through this package's `debugLvl` parameter whose value is to be
|
||||
used to establish `DEBUG`.
|
||||
|
||||
Issues
|
||||
------
|
||||
|
||||
1. > Error: /tmp/brBrGenML1rc_15642 :cannot open file !!
|
||||
|
||||
Fixed.
|
||||
|
||||
2. > touch: cannot touch '/tmp/BrGenML1_latest_print_info': Permission denied
|
||||
|
||||
Fixed.
|
||||
|
||||
3. > perl: warning: Falling back to the standard locale ("C").
|
||||
|
||||
are supported and installed on your system.
|
||||
LANG = "en_US.UTF-8"
|
||||
LC_ALL = (unset),
|
||||
LANGUAGE = (unset),
|
||||
perl: warning: Please check that your locale settings:
|
||||
perl: warning: Setting locale failed.
|
||||
|
||||
TODO: Address.
|
||||
|
||||
4. Since nixos 16.03 release, in `brother_lpdwrapper_BrGenML1`:
|
||||
|
||||
> sh: grep: command not found
|
||||
sh: chmod: command not found
|
||||
sh: cp: command not found
|
||||
Error: /tmp/brBrGenML1rc_1850 :cannot open file !!
|
||||
sh: sed: command not found
|
||||
|
||||
Fixed by use of a wrapper that brings `coreutils`, `gnused`, `gnugrep`
|
||||
in `PATH`.
|
||||
*/
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "brgenml1cupswrapper";
|
||||
version = "3.1.0-1";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://download.brother.com/welcome/dlf101125/brgenml1cupswrapper-${version}.i386.deb";
|
||||
sha256 = "0kd2a2waqr10kfv1s8is3nd5dlphw4d1343srdsbrlbbndja3s6r";
|
||||
};
|
||||
|
||||
unpackPhase = ''
|
||||
ar x $src
|
||||
tar xfvz data.tar.gz
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
buildInputs = [ cups perl coreutils gnused gnugrep brgenml1lpr ];
|
||||
|
||||
dontBuild = true;
|
||||
|
||||
patchPhase = ''
|
||||
WRAPPER=opt/brother/Printers/BrGenML1/cupswrapper/brother_lpdwrapper_BrGenML1
|
||||
PAPER_CFG=opt/brother/Printers/BrGenML1/cupswrapper/paperconfigml1
|
||||
|
||||
substituteInPlace $WRAPPER \
|
||||
--replace "basedir =~" "basedir = \"${brgenml1lpr}/opt/brother/Printers/BrGenML1\"; #" \
|
||||
--replace "PRINTER =~" "PRINTER = \"BrGenML1\"; #" \
|
||||
--replace "\$DEBUG=0;" "\$DEBUG=${debugLvl};"
|
||||
|
||||
# Fixing issue #1 and #2.
|
||||
substituteInPlace $WRAPPER \
|
||||
--replace "\`cp " "\`cp -p " \
|
||||
--replace "\$TEMPRC\`" "\$TEMPRC; chmod a+rw \$TEMPRC\`" \
|
||||
--replace "\`mv " "\`cp -p "
|
||||
|
||||
# This config script make this assumption that the *.ppd are found in a global location `/etc/cups/ppd`.
|
||||
substituteInPlace $PAPER_CFG \
|
||||
--replace "/etc/cups/ppd" "$out/share/cups/model"
|
||||
'';
|
||||
|
||||
|
||||
installPhase = ''
|
||||
CUPSFILTER_DIR=$out/lib/cups/filter
|
||||
CUPSPPD_DIR=$out/share/cups/model
|
||||
CUPSWRAPPER_DIR=opt/brother/Printers/BrGenML1/cupswrapper
|
||||
|
||||
mkdir -p $out/$CUPSWRAPPER_DIR
|
||||
cp -rp $CUPSWRAPPER_DIR/* $out/$CUPSWRAPPER_DIR
|
||||
|
||||
mkdir -p $CUPSFILTER_DIR
|
||||
# Fixing issue #4.
|
||||
makeWrapper \
|
||||
$out/$CUPSWRAPPER_DIR/brother_lpdwrapper_BrGenML1 \
|
||||
$CUPSFILTER_DIR/brother_lpdwrapper_BrGenML1 \
|
||||
--prefix PATH : ${coreutils}/bin \
|
||||
--prefix PATH : ${gnused}/bin \
|
||||
--prefix PATH : ${gnugrep}/bin
|
||||
|
||||
mkdir -p $CUPSPPD_DIR
|
||||
ln -s $out/$CUPSWRAPPER_DIR/brother-BrGenML1-cups-en.ppd $CUPSPPD_DIR
|
||||
'';
|
||||
|
||||
dontPatchELF = true;
|
||||
dontStrip = true;
|
||||
|
||||
meta = {
|
||||
description = "Brother BrGenML1 CUPS wrapper driver";
|
||||
homepage = "http://www.brother.com";
|
||||
platforms = lib.platforms.linux;
|
||||
license = lib.licenses.gpl2Plus;
|
||||
maintainers = with lib.maintainers; [ jraygauthier ];
|
||||
};
|
||||
}
|
||||
94
pkgs/misc/cups/drivers/brgenml1lpr/default.nix
Normal file
94
pkgs/misc/cups/drivers/brgenml1lpr/default.nix
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
{ lib, stdenv, fetchurl, cups, perl, ghostscript, which, makeWrapper}:
|
||||
|
||||
/*
|
||||
[Setup instructions](http://support.brother.com/g/s/id/linux/en/instruction_prn1a.html).
|
||||
|
||||
URI example
|
||||
~ `lpd://BRW0080927AFBCE/binary_p1`
|
||||
|
||||
Logging
|
||||
-------
|
||||
|
||||
`/tmp/br_lpdfilter_ml1.log` when `$ENV{LPD_DEBUG} > 0` in `filter_BrGenML1`
|
||||
which is activated automatically when `DEBUG > 0` in `brother_lpdwrapper_BrGenML1`
|
||||
from the cups wrapper.
|
||||
|
||||
Issues
|
||||
------
|
||||
|
||||
- filter_BrGenML1 ln 196 `my $GHOST_SCRIPT=`which gs`;`
|
||||
|
||||
`GHOST_SCRIPT` is empty resulting in an empty `/tmp/br_lpdfilter_ml1_gsout.dat` file.
|
||||
See `/tmp/br_lpdfilter_ml1.log` for the executed command.
|
||||
|
||||
Notes
|
||||
-----
|
||||
|
||||
- The `setupPrintcap` has totally no use in our context.
|
||||
*/
|
||||
|
||||
let
|
||||
myPatchElf = file: with lib; ''
|
||||
patchelf --set-interpreter \
|
||||
${stdenv.cc.libc}/lib/ld-linux${optionalString stdenv.is64bit "-x86-64"}.so.2 \
|
||||
${file}
|
||||
'';
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "brgenml1lpr";
|
||||
version = "3.1.0-1";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://download.brother.com/welcome/dlf101123/brgenml1lpr-${version}.i386.deb";
|
||||
sha256 = "0zdvjnrjrz9sba0k525linxp55lr4cyivfhqbkq1c11br2nvy09f";
|
||||
};
|
||||
|
||||
unpackPhase = ''
|
||||
ar x $src
|
||||
tar xfvz data.tar.gz
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
buildInputs = [ cups perl stdenv.cc.libc ghostscript which ];
|
||||
|
||||
dontBuild = true;
|
||||
|
||||
patchPhase = ''
|
||||
INFDIR=opt/brother/Printers/BrGenML1/inf
|
||||
LPDDIR=opt/brother/Printers/BrGenML1/lpd
|
||||
|
||||
# Setup max debug log by default.
|
||||
substituteInPlace $LPDDIR/filter_BrGenML1 \
|
||||
--replace "BR_PRT_PATH =~" "BR_PRT_PATH = \"$out/opt/brother/Printers/BrGenML1\"; #" \
|
||||
--replace "PRINTER =~" "PRINTER = \"BrGenML1\"; #"
|
||||
|
||||
${myPatchElf "$INFDIR/braddprinter"}
|
||||
${myPatchElf "$LPDDIR/brprintconflsr3"}
|
||||
${myPatchElf "$LPDDIR/rawtobr3"}
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
INFDIR=opt/brother/Printers/BrGenML1/inf
|
||||
LPDDIR=opt/brother/Printers/BrGenML1/lpd
|
||||
|
||||
mkdir -p $out/$INFDIR
|
||||
cp -rp $INFDIR/* $out/$INFDIR
|
||||
mkdir -p $out/$LPDDIR
|
||||
cp -rp $LPDDIR/* $out/$LPDDIR
|
||||
|
||||
wrapProgram $out/$LPDDIR/filter_BrGenML1 \
|
||||
--prefix PATH ":" "${ghostscript}/bin" \
|
||||
--prefix PATH ":" "${which}/bin"
|
||||
'';
|
||||
|
||||
dontPatchELF = true;
|
||||
|
||||
|
||||
meta = {
|
||||
description = "Brother BrGenML1 LPR driver";
|
||||
homepage = "http://www.brother.com";
|
||||
platforms = lib.platforms.linux;
|
||||
license = lib.licenses.unfreeRedistributable;
|
||||
maintainers = with lib.maintainers; [ jraygauthier ];
|
||||
};
|
||||
}
|
||||
63
pkgs/misc/cups/drivers/brlaser/default.nix
Normal file
63
pkgs/misc/cups/drivers/brlaser/default.nix
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
{ lib, stdenv, fetchFromGitHub, cmake, zlib, cups }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "brlaser";
|
||||
version = "6";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "pdewacht";
|
||||
repo = "brlaser";
|
||||
rev = "v${version}";
|
||||
sha256 = "1995s69ksq1fz0vb34v0ndiqncrinbrlpmp70rkl6az7kag99s80";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ cmake ];
|
||||
buildInputs = [ zlib cups ];
|
||||
|
||||
cmakeFlags = [ "-DCUPS_SERVER_BIN=lib/cups" "-DCUPS_DATA_DIR=share/cups" ];
|
||||
|
||||
meta = with lib; {
|
||||
description = "A CUPS driver for Brother laser printers";
|
||||
longDescription =
|
||||
''
|
||||
Although most Brother printers support a standard printer language such as PCL or PostScript, not all do. If you have a monochrome Brother laser printer (or multi-function device) and the other open source drivers don't work, this one might help.
|
||||
|
||||
This driver is known to work with these printers:
|
||||
|
||||
Brother DCP-1510
|
||||
Brother DCP-1602
|
||||
Brother DCP-7030
|
||||
Brother DCP-7040
|
||||
Brother DCP-7055
|
||||
Brother DCP-7055W
|
||||
Brother DCP-7060D
|
||||
Brother DCP-7065DN
|
||||
Brother DCP-7080
|
||||
Brother DCP-L2500D
|
||||
Brother DCP-L2520D
|
||||
Brother DCP-L2540DW
|
||||
Brother HL-1110
|
||||
Brother HL-1200
|
||||
Brother HL-2030
|
||||
Brother HL-2140
|
||||
Brother HL-2220
|
||||
Brother HL-2270DW
|
||||
Brother HL-5030
|
||||
Brother HL-L2300D
|
||||
Brother HL-L2320D
|
||||
Brother HL-L2340D
|
||||
Brother HL-L2360D
|
||||
Brother MFC-1910W
|
||||
Brother MFC-7240
|
||||
Brother MFC-7360N
|
||||
Brother MFC-7365DN
|
||||
Brother MFC-7840W
|
||||
Brother MFC-L2710DW
|
||||
Lenovo M7605D
|
||||
'';
|
||||
homepage = "https://github.com/pdewacht/brlaser";
|
||||
license = licenses.gpl2;
|
||||
platforms = platforms.linux;
|
||||
maintainers = with maintainers; [ StijnDW ];
|
||||
};
|
||||
}
|
||||
99
pkgs/misc/cups/drivers/brother/dcp9020cdw/default.nix
Normal file
99
pkgs/misc/cups/drivers/brother/dcp9020cdw/default.nix
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, fetchurl
|
||||
, cups
|
||||
, dpkg
|
||||
, gnused
|
||||
, makeWrapper
|
||||
, ghostscript
|
||||
, file
|
||||
, a2ps
|
||||
, coreutils
|
||||
, gnugrep
|
||||
, which
|
||||
, gawk
|
||||
}:
|
||||
|
||||
let
|
||||
version = "1.1.2";
|
||||
model = "dcp9020cdw";
|
||||
in
|
||||
rec {
|
||||
driver = stdenv.mkDerivation {
|
||||
pname = "${model}-lpr";
|
||||
inherit version;
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://download.brother.com/welcome/dlf100441/dcp9020cdwlpr-${version}-1.i386.deb";
|
||||
sha256 = "1z6nma489s0a0b0a8wyg38yxanz4k99dg29fyjs4jlprsvmwk56y";
|
||||
};
|
||||
|
||||
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/brother_lpdwrapper_${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";
|
||||
license = licenses.unfree;
|
||||
platforms = platforms.linux;
|
||||
downloadPage = "https://support.brother.com/g/b/downloadlist.aspx?c=gb&lang=en&prod=${model}_eu&os=128";
|
||||
maintainers = with maintainers; [ pshirshov ];
|
||||
};
|
||||
};
|
||||
|
||||
cupswrapper = stdenv.mkDerivation {
|
||||
pname = "${model}-cupswrapper";
|
||||
inherit version;
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://download.brother.com/welcome/dlf100443/dcp9020cdwcupswrapper-${version}-1.i386.deb";
|
||||
sha256 = "04yqm1qv9p4hgp1p6mqq4siygl4056s6flv6kqln8mvmcr8zaq1s";
|
||||
};
|
||||
|
||||
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";
|
||||
license = licenses.unfree;
|
||||
platforms = platforms.linux;
|
||||
downloadPage = "https://support.brother.com/g/b/downloadlist.aspx?c=gb&lang=en&prod=${model}_eu&os=128";
|
||||
maintainers = with maintainers; [ pshirshov ];
|
||||
};
|
||||
};
|
||||
}
|
||||
88
pkgs/misc/cups/drivers/brother/mfcl3770cdw/default.nix
Normal file
88
pkgs/misc/cups/drivers/brother/mfcl3770cdw/default.nix
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
{ pkgsi686Linux
|
||||
, stdenv
|
||||
, fetchurl
|
||||
, dpkg
|
||||
, makeWrapper
|
||||
, coreutils
|
||||
, ghostscript
|
||||
, gnugrep
|
||||
, gnused
|
||||
, which
|
||||
, perl
|
||||
, lib
|
||||
}:
|
||||
|
||||
let
|
||||
model = "mfcl3770cdw";
|
||||
version = "1.0.2-0";
|
||||
src = fetchurl {
|
||||
url = "https://download.brother.com/welcome/dlf103935/${model}pdrv-${version}.i386.deb";
|
||||
sha256 = "09fhbzhpjymhkwxqyxzv24b06ybmajr6872yp7pri39595mhrvay";
|
||||
};
|
||||
reldir = "opt/brother/Printers/${model}/";
|
||||
|
||||
in rec {
|
||||
driver = pkgsi686Linux.stdenv.mkDerivation rec {
|
||||
inherit src version;
|
||||
name = "${model}drv-${version}";
|
||||
|
||||
nativeBuildInputs = [ dpkg makeWrapper ];
|
||||
|
||||
unpackPhase = "dpkg-deb -x $src $out";
|
||||
|
||||
installPhase = ''
|
||||
dir="$out/${reldir}"
|
||||
substituteInPlace $dir/lpd/filter_${model} \
|
||||
--replace /usr/bin/perl ${perl}/bin/perl \
|
||||
--replace "BR_PRT_PATH =~" "BR_PRT_PATH = \"$dir\"; #" \
|
||||
--replace "PRINTER =~" "PRINTER = \"${model}\"; #"
|
||||
wrapProgram $dir/lpd/filter_${model} \
|
||||
--prefix PATH : ${lib.makeBinPath [
|
||||
coreutils ghostscript gnugrep gnused which
|
||||
]}
|
||||
# need to use i686 glibc here, these are 32bit proprietary binaries
|
||||
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
||||
$dir/lpd/brmfcl3770cdwfilter
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Brother ${lib.strings.toUpper model} driver";
|
||||
homepage = "http://www.brother.com/";
|
||||
license = lib.licenses.unfree;
|
||||
platforms = [ "x86_64-linux" "i686-linux" ];
|
||||
maintainers = [ lib.maintainers.steveej ];
|
||||
};
|
||||
};
|
||||
|
||||
cupswrapper = stdenv.mkDerivation rec {
|
||||
inherit version src;
|
||||
name = "${model}cupswrapper-${version}";
|
||||
|
||||
nativeBuildInputs = [ dpkg makeWrapper ];
|
||||
|
||||
unpackPhase = "dpkg-deb -x $src $out";
|
||||
|
||||
installPhase = ''
|
||||
basedir=${driver}/${reldir}
|
||||
dir=$out/${reldir}
|
||||
substituteInPlace $dir/cupswrapper/brother_lpdwrapper_${model} \
|
||||
--replace /usr/bin/perl ${perl}/bin/perl \
|
||||
--replace "basedir =~" "basedir = \"$basedir\"; #" \
|
||||
--replace "PRINTER =~" "PRINTER = \"${model}\"; #"
|
||||
wrapProgram $dir/cupswrapper/brother_lpdwrapper_${model} \
|
||||
--prefix PATH : ${lib.makeBinPath [ coreutils gnugrep gnused ]}
|
||||
mkdir -p $out/lib/cups/filter
|
||||
mkdir -p $out/share/cups/model
|
||||
ln $dir/cupswrapper/brother_lpdwrapper_${model} $out/lib/cups/filter
|
||||
ln $dir/cupswrapper/brother_${model}_printer_en.ppd $out/share/cups/model
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Brother ${lib.strings.toUpper model} CUPS wrapper driver";
|
||||
homepage = "http://www.brother.com/";
|
||||
license = lib.licenses.gpl2;
|
||||
platforms = [ "x86_64-linux" "i686-linux" ];
|
||||
maintainers = [ lib.maintainers.steveej ];
|
||||
};
|
||||
};
|
||||
}
|
||||
217
pkgs/misc/cups/drivers/canon/default.nix
Normal file
217
pkgs/misc/cups/drivers/canon/default.nix
Normal file
|
|
@ -0,0 +1,217 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, fetchurl
|
||||
, unzip
|
||||
, autoconf
|
||||
, automake
|
||||
, libtool_1_5
|
||||
, makeWrapper
|
||||
, cups
|
||||
, jbigkit
|
||||
, glib
|
||||
, gtk3
|
||||
, gdk-pixbuf
|
||||
, pango
|
||||
, cairo
|
||||
, coreutils
|
||||
, atk
|
||||
, pkg-config
|
||||
, gnome2
|
||||
, libxml2
|
||||
, runtimeShell
|
||||
, proot
|
||||
, ghostscript
|
||||
, pkgs
|
||||
, pkgsi686Linux
|
||||
, zlib
|
||||
}:
|
||||
|
||||
let
|
||||
|
||||
i686_NIX_GCC = pkgsi686Linux.callPackage ({ gcc }: gcc) { };
|
||||
ld32 =
|
||||
if stdenv.hostPlatform.system == "x86_64-linux" then "${stdenv.cc}/nix-support/dynamic-linker-m32"
|
||||
else if stdenv.hostPlatform.system == "i686-linux" then "${stdenv.cc}/nix-support/dynamic-linker"
|
||||
else throw "Unsupported platform for Canon UFR2 Drivers: ${stdenv.hostPlatform.system}";
|
||||
ld64 = "${stdenv.cc}/nix-support/dynamic-linker";
|
||||
libs = pkgs: lib.makeLibraryPath buildInputs;
|
||||
|
||||
version = "5.40";
|
||||
dl = "6/0100009236/10";
|
||||
|
||||
versionNoDots = builtins.replaceStrings [ "." ] [ "" ] version;
|
||||
src_canon = fetchurl {
|
||||
url = "http://gdlp01.c-wss.com/gds/${dl}/linux-UFRII-drv-v${versionNoDots}-usen-20.tar.gz";
|
||||
sha256 = "sha256:069z6ijmql62mcdyxnzc9mf0dxa6z1107cd0ab4i1adk8kr3d75k";
|
||||
};
|
||||
|
||||
buildInputs = [ cups zlib jbigkit glib gtk3 pkg-config gnome2.libglade libxml2 gdk-pixbuf pango cairo atk ];
|
||||
|
||||
in
|
||||
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "canon-cups-ufr2";
|
||||
inherit version;
|
||||
src = src_canon;
|
||||
|
||||
postUnpack = ''
|
||||
(cd $sourceRoot; tar -xzf Sources/cnrdrvcups-lb-${version}-1.tar.gz)
|
||||
(cd $sourceRoot; sed -ie "s@_prefix=/usr@_prefix=$out@" cnrdrvcups-common-${version}/allgen.sh)
|
||||
(cd $sourceRoot; sed -ie "s@_libdir=/usr/lib@_libdir=$out/lib@" cnrdrvcups-common-${version}/allgen.sh)
|
||||
(cd $sourceRoot; sed -ie "s@_bindir=/usr/bin@_libdir=$out/bin@" cnrdrvcups-common-${version}/allgen.sh)
|
||||
(cd $sourceRoot; sed -ie "s@etc/cngplp@$out/etc/cngplp@" cnrdrvcups-common-${version}/cngplp/Makefile.am)
|
||||
(cd $sourceRoot; sed -ie "s@usr/share/cngplp@$out/usr/share/cngplp@" cnrdrvcups-common-${version}/cngplp/src/Makefile.am)
|
||||
(cd $sourceRoot; patchShebangs cnrdrvcups-common-${version})
|
||||
|
||||
(cd $sourceRoot; sed -ie "s@_prefix=/usr@_prefix=$out@" cnrdrvcups-lb-${version}/allgen.sh)
|
||||
(cd $sourceRoot; sed -ie "s@_libdir=/usr/lib@_libdir=$out/lib@" cnrdrvcups-lb-${version}/allgen.sh)
|
||||
(cd $sourceRoot; sed -ie "s@_bindir=/usr/bin@_libdir=$out/bin@" cnrdrvcups-lb-${version}/allgen.sh)
|
||||
(cd $sourceRoot; sed -ie '/^cd \.\.\/cngplp/,/^cd files/{/^cd files/!{d}}' cnrdrvcups-lb-${version}/allgen.sh)
|
||||
(cd $sourceRoot; sed -ie "s@cd \.\./pdftocpca@cd pdftocpca@" cnrdrvcups-lb-${version}/allgen.sh)
|
||||
(cd $sourceRoot; sed -i "/CNGPLPDIR/d" cnrdrvcups-lb-${version}/Makefile)
|
||||
(cd $sourceRoot; patchShebangs cnrdrvcups-lb-${version})
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [ makeWrapper unzip autoconf automake libtool_1_5 ];
|
||||
|
||||
inherit buildInputs;
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
(
|
||||
cd cnrdrvcups-common-${version}
|
||||
./allgen.sh
|
||||
make install
|
||||
)
|
||||
(
|
||||
cd cnrdrvcups-common-${version}/Rule
|
||||
mkdir -p $out/share/usb
|
||||
install -m 644 *.usb-quirks $out/share/usb
|
||||
)
|
||||
(
|
||||
cd cnrdrvcups-lb-${version}
|
||||
./allgen.sh
|
||||
make install
|
||||
|
||||
mkdir -p $out/share/cups/model
|
||||
install -m 644 ppd/*.ppd $out/share/cups/model/
|
||||
)
|
||||
(
|
||||
cd lib
|
||||
mkdir -p $out/lib32
|
||||
install -m 755 libs32/intel/libColorGearCufr2.so.2.0.0 $out/lib32
|
||||
install -m 755 libs32/intel/libcaepcmufr2.so.1.0 $out/lib32
|
||||
install -m 755 libs32/intel/libcaiocnpkbidir.so.1.0.0 $out/lib32
|
||||
install -m 755 libs32/intel/libcaiousb.so.1.0.0 $out/lib32
|
||||
install -m 755 libs32/intel/libcaiowrapufr2.so.1.0.0 $out/lib32
|
||||
install -m 755 libs32/intel/libcanon_slimufr2.so.1.0.0 $out/lib32
|
||||
install -m 755 libs32/intel/libcanonufr2r.so.1.0.0 $out/lib32
|
||||
install -m 755 libs32/intel/libcnaccm.so.1.0 $out/lib32
|
||||
install -m 755 libs32/intel/libcnlbcmr.so.1.0 $out/lib32
|
||||
install -m 755 libs32/intel/libcnncapcmr.so.1.0 $out/lib32
|
||||
install -m 755 libs32/intel/libufr2filterr.so.1.0.0 $out/lib32
|
||||
|
||||
mkdir -p $out/lib
|
||||
install -m 755 libs64/intel/libColorGearCufr2.so.2.0.0 $out/lib
|
||||
install -m 755 libs64/intel/libcaepcmufr2.so.1.0 $out/lib
|
||||
install -m 755 libs64/intel/libcaiocnpkbidir.so.1.0.0 $out/lib
|
||||
install -m 755 libs64/intel/libcaiousb.so.1.0.0 $out/lib
|
||||
install -m 755 libs64/intel/libcaiowrapufr2.so.1.0.0 $out/lib
|
||||
install -m 755 libs64/intel/libcanon_slimufr2.so.1.0.0 $out/lib
|
||||
install -m 755 libs64/intel/libcanonufr2r.so.1.0.0 $out/lib
|
||||
install -m 755 libs64/intel/libcnaccm.so.1.0 $out/lib
|
||||
install -m 755 libs64/intel/libcnlbcmr.so.1.0 $out/lib
|
||||
install -m 755 libs64/intel/libcnncapcmr.so.1.0 $out/lib
|
||||
install -m 755 libs64/intel/libufr2filterr.so.1.0.0 $out/lib
|
||||
|
||||
install -m 755 libs64/intel/cnpdfdrv $out/bin
|
||||
install -m 755 libs64/intel/cnpkbidir $out/bin
|
||||
install -m 755 libs64/intel/cnpkmoduleufr2r $out/bin
|
||||
install -m 755 libs64/intel/cnrsdrvufr2 $out/bin
|
||||
install -m 755 libs64/intel/cnsetuputil2 $out/bin/cnsetuputil2
|
||||
|
||||
mkdir -p $out/share/cnpkbidir
|
||||
install -m 644 libs64/intel/cnpkbidir_info* $out/share/cnpkbidir
|
||||
|
||||
mkdir -p $out/share/ufr2filter
|
||||
install -m 644 libs64/intel/ThLB* $out/share/ufr2filter
|
||||
)
|
||||
|
||||
(
|
||||
cd $out/lib32
|
||||
ln -sf libcaepcmufr2.so.1.0 libcaepcmufr2.so
|
||||
ln -sf libcaepcmufr2.so.1.0 libcaepcmufr2.so.1
|
||||
ln -sf libcaiowrapufr2.so.1.0.0 libcaiowrapufr2.so
|
||||
ln -sf libcaiowrapufr2.so.1.0.0 libcaiowrapufr2.so.1
|
||||
ln -sf libcanon_slimufr2.so.1.0.0 libcanon_slimufr2.so
|
||||
ln -sf libcanon_slimufr2.so.1.0.0 libcanon_slimufr2.so.1
|
||||
ln -sf libufr2filterr.so.1.0.0 libufr2filterr.so
|
||||
ln -sf libufr2filterr.so.1.0.0 libufr2filterr.so.1
|
||||
|
||||
patchelf --set-rpath "$(cat ${i686_NIX_GCC}/nix-support/orig-cc)/lib:${libs pkgsi686Linux}:${pkgsi686Linux.stdenv.cc.libc}/lib:${pkgsi686Linux.libxml2.out}/lib:$out/lib32" libcanonufr2r.so.1.0.0
|
||||
patchelf --set-rpath "$(cat ${i686_NIX_GCC}/nix-support/orig-cc)/lib:${libs pkgsi686Linux}:${pkgsi686Linux.stdenv.cc.libc}/lib" libcaepcmufr2.so.1.0
|
||||
patchelf --set-rpath "$(cat ${i686_NIX_GCC}/nix-support/orig-cc)/lib:${libs pkgsi686Linux}:${pkgsi686Linux.stdenv.cc.libc}/lib" libColorGearCufr2.so.2.0.0
|
||||
)
|
||||
|
||||
(
|
||||
cd $out/lib
|
||||
ln -sf libcaepcmufr2.so.1.0 libcaepcmufr2.so
|
||||
ln -sf libcaepcmufr2.so.1.0 libcaepcmufr2.so.1
|
||||
ln -sf libcaiowrapufr2.so.1.0.0 libcaiowrapufr2.so
|
||||
ln -sf libcaiowrapufr2.so.1.0.0 libcaiowrapufr2.so.1
|
||||
ln -sf libcanon_slimufr2.so.1.0.0 libcanon_slimufr2.so
|
||||
ln -sf libcanon_slimufr2.so.1.0.0 libcanon_slimufr2.so.1
|
||||
ln -sf libufr2filterr.so.1.0.0 libufr2filterr.so
|
||||
ln -sf libufr2filterr.so.1.0.0 libufr2filterr.so.1
|
||||
|
||||
patchelf --set-rpath "$(cat $NIX_CC/nix-support/orig-cc)/lib:${libs pkgs}:${stdenv.cc.cc.lib}/lib64:${stdenv.cc.libc}/lib64:$out/lib" libcanonufr2r.so.1.0.0
|
||||
patchelf --set-rpath "$(cat $NIX_CC/nix-support/orig-cc)/lib:${libs pkgs}:${stdenv.cc.cc.lib}/lib64:${stdenv.cc.libc}/lib64" libcaepcmufr2.so.1.0
|
||||
patchelf --set-rpath "$(cat $NIX_CC/nix-support/orig-cc)/lib:${libs pkgs}:${stdenv.cc.cc.lib}/lib64:${stdenv.cc.libc}/lib64" libColorGearCufr2.so.2.0.0
|
||||
)
|
||||
|
||||
(
|
||||
cd $out/bin
|
||||
patchelf --set-interpreter "$(cat ${ld64})" --set-rpath "${lib.makeLibraryPath buildInputs}:${stdenv.cc.cc.lib}/lib64:${stdenv.cc.libc}/lib64" cnsetuputil2
|
||||
patchelf --set-interpreter "$(cat ${ld64})" --set-rpath "${lib.makeLibraryPath buildInputs}:${stdenv.cc.cc.lib}/lib64:${stdenv.cc.libc}/lib64" cnpdfdrv
|
||||
patchelf --set-interpreter "$(cat ${ld64})" --set-rpath "${lib.makeLibraryPath buildInputs}:${stdenv.cc.cc.lib}/lib64:${stdenv.cc.libc}/lib64:$out/lib" cnpkbidir
|
||||
patchelf --set-interpreter "$(cat ${ld64})" --set-rpath "${lib.makeLibraryPath buildInputs}:${stdenv.cc.cc.lib}/lib64:${stdenv.cc.libc}/lib64:$out/lib" cnrsdrvufr2
|
||||
|
||||
mv cnsetuputil2 cnsetuputil2.wrapped
|
||||
echo "#!${runtimeShell} -e" > cnsetuputil2
|
||||
echo "exec ${proot}/bin/proot -b $out/usr/share/cnsetuputil2:/usr/share/cnsetuputil2 -b ${coreutils}/bin/ls:/bin/ls -b ${cups}/share:/usr/share/cups $out/bin/cnsetuputil2.wrapped" > cnsetuputil2
|
||||
chmod +x cnsetuputil2
|
||||
)
|
||||
|
||||
(
|
||||
cd lib/data/ufr2
|
||||
mkdir -p $out/share/caepcm
|
||||
install -m 644 *.ICC $out/share/caepcm
|
||||
install -m 644 *.icc $out/share/caepcm
|
||||
install -m 644 *.PRF $out/share/caepcm
|
||||
install -m 644 CnLB* $out/share/caepcm
|
||||
)
|
||||
|
||||
(
|
||||
cd cnrdrvcups-utility-${version}/data
|
||||
mkdir -p $out/usr/share/cnsetuputil2
|
||||
install -m 644 cnsetuputil* $out/usr/share/cnsetuputil2
|
||||
)
|
||||
|
||||
makeWrapper "${ghostscript}/bin/gs" "$out/bin/gs" \
|
||||
--prefix LD_LIBRARY_PATH ":" "$out/lib" \
|
||||
--prefix PATH ":" "$out/bin"
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "CUPS Linux drivers for Canon printers";
|
||||
homepage = "http://www.canon.com/";
|
||||
license = licenses.unfree;
|
||||
maintainers = with maintainers; [
|
||||
# please consider maintaining if you are updating this package
|
||||
];
|
||||
};
|
||||
}
|
||||
44
pkgs/misc/cups/drivers/carps-cups/default.nix
Normal file
44
pkgs/misc/cups/drivers/carps-cups/default.nix
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
{ stdenv
|
||||
, lib
|
||||
, fetchFromGitHub
|
||||
, cups
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "carps-cups";
|
||||
version = "unstable-2018-03-05";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "ondrej-zary";
|
||||
repo = "carps-cups";
|
||||
rev = "18d80d1d6f473dd9132e4b6d8b5c592c74982f17";
|
||||
sha256 = "0mjj9hs5lqxi0qamgb4sxfz4fvf7ggi66bxd37bkz3fl0g9xff70";
|
||||
};
|
||||
|
||||
preBuild = ''
|
||||
export CUPS_DATADIR="${cups}/share/cups"
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
CUPSDIR="$out/lib/cups"
|
||||
CUPSDATADIR="$out/share/cups"
|
||||
|
||||
mkdir -p "$CUPSDIR/filter" "$CUPSDATADIR/drv" "$CUPSDATADIR/usb"
|
||||
|
||||
install -s rastertocarps $CUPSDIR/filter
|
||||
install -m 644 carps.drv $CUPSDATADIR/drv/
|
||||
install -m 644 carps.usb-quirks $CUPSDATADIR/usb/
|
||||
'';
|
||||
|
||||
buildInputs = [ cups ];
|
||||
|
||||
meta = with lib; {
|
||||
description = "CUPS Linux drivers for Canon printers";
|
||||
homepage = "https://www.canon.com/";
|
||||
license = licenses.gpl3Plus;
|
||||
maintainers = with maintainers; [
|
||||
ewok
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
135
pkgs/misc/cups/drivers/cnijfilter2/default.nix
Normal file
135
pkgs/misc/cups/drivers/cnijfilter2/default.nix
Normal file
|
|
@ -0,0 +1,135 @@
|
|||
{ stdenv, lib, fetchzip, autoconf, automake, cups, glib, libxml2, libusb1, libtool
|
||||
, withDebug ? false }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "cnijfilter2";
|
||||
|
||||
version = "6.10";
|
||||
|
||||
src = fetchzip {
|
||||
url = "https://gdlp01.c-wss.com/gds/1/0100010921/01/cnijfilter2-source-6.10-1.tar.gz";
|
||||
sha256 = "0w121issdjxdv5i9ksa5m23if6pz1r9ql8p894f1pqn16w0kw1ix";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ automake autoconf ];
|
||||
buildInputs = [
|
||||
cups glib libxml2 libusb1 libtool
|
||||
];
|
||||
|
||||
# lgmon3's --enable-libdir flag is used soley for specifying in which
|
||||
# directory the cnnnet.ini cache file should reside.
|
||||
# NixOS uses /var/cache/cups, and given the name, it seems like a reasonable
|
||||
# place to put the cnnet.ini file, and thus we do so.
|
||||
#
|
||||
# Note that the drivers attempt to dlopen
|
||||
# $out/lib/cups/filter/libcnbpcnclapicom2.so
|
||||
buildPhase = ''
|
||||
mkdir -p $out/lib
|
||||
cp com/libs_bin64/* $out/lib
|
||||
mkdir -p $out/lib/cups/filter
|
||||
ln -s $out/lib/libcnbpcnclapicom2.so $out/lib/cups/filter
|
||||
|
||||
export NIX_LDFLAGS="$NIX_LDFLAGS -L$out/lib"
|
||||
'' + lib.optionalString withDebug ''
|
||||
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -D__DEBUG__ -DDEBUG_LOG"
|
||||
'' + ''
|
||||
|
||||
(
|
||||
cd lgmon3
|
||||
substituteInPlace src/Makefile.am \
|
||||
--replace /usr/include/libusb-1.0 \
|
||||
${libusb1.dev}/include/libusb-1.0
|
||||
./autogen.sh --prefix=$out --enable-progpath=$out/bin \
|
||||
--datadir=$out/share \
|
||||
--enable-libdir=/var/cache/cups
|
||||
make
|
||||
)
|
||||
|
||||
(
|
||||
cd cmdtocanonij2
|
||||
./autogen.sh --prefix=$out
|
||||
make
|
||||
)
|
||||
|
||||
(
|
||||
cd cnijbe2
|
||||
substituteInPlace src/Makefile.am \
|
||||
--replace "/usr/lib/cups/backend" \
|
||||
"$out/lib/cups/backend"
|
||||
./autogen.sh --prefix=$out --enable-progpath=$out/bin
|
||||
make
|
||||
)
|
||||
|
||||
(
|
||||
cd rastertocanonij
|
||||
./autogen.sh --prefix=$out --enable-progpath=$out/bin
|
||||
make
|
||||
)
|
||||
|
||||
(
|
||||
cd tocanonij
|
||||
./autogen.sh --prefix=$out --enable-progpath=$out/bin
|
||||
make
|
||||
)
|
||||
|
||||
(
|
||||
cd tocnpwg
|
||||
./autogen.sh --prefix=$out --enable-progpath=$out/bin
|
||||
make
|
||||
)
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
(
|
||||
cd lgmon3
|
||||
make install
|
||||
)
|
||||
|
||||
(
|
||||
cd cmdtocanonij2
|
||||
make install
|
||||
)
|
||||
|
||||
(
|
||||
cd cnijbe2
|
||||
make install
|
||||
)
|
||||
|
||||
(
|
||||
cd rastertocanonij
|
||||
make install
|
||||
)
|
||||
|
||||
(
|
||||
cd tocanonij
|
||||
make install
|
||||
)
|
||||
|
||||
(
|
||||
cd tocnpwg
|
||||
make install
|
||||
)
|
||||
|
||||
mkdir -p $out/share/cups/model
|
||||
cp ppd/*.ppd $out/share/cups/model
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Canon InkJet printer drivers for many Pixma series printers.";
|
||||
longDescription = ''
|
||||
Canon InjKet printer drivers for series E200, E300, E3100, E3300, E4200, E450, E470, E480,
|
||||
G3000, G3010, G4000, G4010, G5000, G5080, G6000, G6050, G6080, G7000, G7050, G7080, GM2000,
|
||||
GM2080, GM4000, GM4080, iB4000, iB4100, iP110, MB2000, MB2100, MB2300, MB2700, MB5000,
|
||||
MB5100, MB5300, MB5400, MG2900, MG3000, MG3600, MG5600, MG5700, MG6600, MG6700, MG6800,
|
||||
MG6900, MG7500, MG7700, MX490, TR4500, TR703, TR7500, TR7530, TR8500, TR8530, TR8580, TR9530,
|
||||
TS200, TS300, TS3100, TS3300, TS5000, TS5100, TS5300, TS5380, TS6000, TS6100, TS6130, TS6180,
|
||||
TS6200, TS6230, TS6280, TS6300, TS6330, TS6380, TS700, TS708, TS7330, TS8000, TS8100, TS8130,
|
||||
TS8180, TS8200, TS8230, TS8280, TS8300, TS8330, TS8380, TS9000, TS9100, TS9180, TS9500,
|
||||
TS9580, XK50, XK60, XK70, XK80.
|
||||
'';
|
||||
homepage = "https://hk.canon/en/support/0101048401/1";
|
||||
license = licenses.unfree;
|
||||
platforms = [ "i686-linux" "x86_64-linux" ];
|
||||
maintainers = with maintainers; [ cstrahan ];
|
||||
};
|
||||
}
|
||||
110
pkgs/misc/cups/drivers/cnijfilter_2_80/default.nix
Normal file
110
pkgs/misc/cups/drivers/cnijfilter_2_80/default.nix
Normal file
|
|
@ -0,0 +1,110 @@
|
|||
{ stdenv, lib, fetchzip,
|
||||
autoconf, automake, libtool,
|
||||
cups, popt, libtiff, libpng,
|
||||
ghostscript }:
|
||||
|
||||
/* this derivation is basically just a transcription of the rpm .spec
|
||||
file included in the tarball */
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "cnijfilter";
|
||||
|
||||
/* important note about versions: cnijfilter packages seem to use
|
||||
versions in a non-standard way. the version indicates which
|
||||
printers are supported in the package. so this package should
|
||||
not be "upgraded" in the usual way.
|
||||
|
||||
instead, if you want to include another version supporting your
|
||||
printer, you should try to abstract out the common things (which
|
||||
should be pretty much everything except the version and the 'pr'
|
||||
and 'pr_id' values to loop over). */
|
||||
version = "2.80";
|
||||
|
||||
src = fetchzip {
|
||||
url = "http://gdlp01.c-wss.com/gds/1/0100000841/01/cnijfilter-common-2.80-1.tar.gz";
|
||||
sha256 = "06s9nl155yxmx56056y22kz1p5b2sb5fhr3gf4ddlczjkd1xch53";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ autoconf automake ];
|
||||
buildInputs = [ libtool
|
||||
cups popt libtiff libpng
|
||||
ghostscript ];
|
||||
|
||||
patches = [ ./patches/missing-include.patch
|
||||
./patches/libpng15.patch ];
|
||||
|
||||
postPatch = ''
|
||||
sed -i "s|/usr/lib/cups/backend|$out/lib/cups/backend|" backend/src/Makefile.am;
|
||||
sed -i "s|/usr|$out|" backend/src/cnij_backend_common.c;
|
||||
sed -i "s|/usr/bin|${ghostscript}/bin|" pstocanonij/filter/pstocanonij.c;
|
||||
sed -i "s|/usr/local|$out|" libs/bjexec/bjexec.c;
|
||||
'';
|
||||
|
||||
configurePhase = ''
|
||||
cd libs
|
||||
./autogen.sh --prefix=$out;
|
||||
|
||||
cd ../cngpij
|
||||
./autogen.sh --prefix=$out --enable-progpath=$out/bin;
|
||||
|
||||
cd ../pstocanonij
|
||||
./autogen.sh --prefix=$out --enable-progpath=$out/bin;
|
||||
|
||||
cd ../backend
|
||||
./autogen.sh --prefix=$out;
|
||||
cd ..;
|
||||
'';
|
||||
|
||||
preInstall = ''
|
||||
mkdir -p $out/bin $out/lib/cups/filter $out/share/cups/model;
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
for pr in mp140 mp210 ip3500 mp520 ip4500 mp610; do
|
||||
cd ppd;
|
||||
./autogen.sh --prefix=$out --program-suffix=$pr
|
||||
make clean;
|
||||
make;
|
||||
make install;
|
||||
|
||||
cd ../cnijfilter;
|
||||
./autogen.sh --prefix=$out --program-suffix=$pr --enable-libpath=/var/lib/cups/path/lib/bjlib --enable-binpath=$out/bin;
|
||||
make clean;
|
||||
make;
|
||||
make install;
|
||||
|
||||
cd ..;
|
||||
done;
|
||||
|
||||
mkdir -p $out/lib/bjlib;
|
||||
for pr_id in 315 316 319 328 326 327; do
|
||||
install -c -m 755 $pr_id/database/* $out/lib/bjlib;
|
||||
install -c -s -m 755 $pr_id/libs_bin/*.so.* $out/lib;
|
||||
done;
|
||||
|
||||
pushd $out/lib;
|
||||
for so_file in *.so.*; do
|
||||
ln -s $so_file ''${so_file/.so.*/}.so;
|
||||
patchelf --set-rpath $out/lib $so_file;
|
||||
done;
|
||||
popd;
|
||||
'';
|
||||
|
||||
/* the tarball includes some pre-built shared libraries. we run
|
||||
'patchelf --set-rpath' on them just a few lines above, so that
|
||||
they can find each other. but that's not quite enough. some of
|
||||
those libraries load each other in non-standard ways -- they
|
||||
don't list each other in the DT_NEEDED section. so, if the
|
||||
standard 'patchelf --shrink-rpath' (from
|
||||
pkgs/development/tools/misc/patchelf/setup-hook.sh) is run on
|
||||
them, it undoes the --set-rpath. this prevents that. */
|
||||
dontPatchELF = true;
|
||||
|
||||
meta = with lib; {
|
||||
description = "Canon InkJet printer drivers for the iP5400, MP520, MP210, MP140, iP3500, and MP610 series. (MP520 drivers also work for MX700.)";
|
||||
homepage = "http://support-asia.canon-asia.com/content/EN/0100084101.html";
|
||||
license = licenses.unfree;
|
||||
platforms = platforms.linux;
|
||||
maintainers = with maintainers; [ jerith666 ];
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
diff -aur cnijfilter-source-3.20-1/cnijfilter/src/bjfimage.c cnijfilter-source-3.20-1.new/cnijfilter/src/bjfimage.c
|
||||
--- cnijfilter-source-3.20-1/cnijfilter/src/bjfimage.c 2009-03-26 06:11:05.000000000 +0100
|
||||
+++ cnijfilter-source-3.20-1.new/cnijfilter/src/bjfimage.c 2012-02-10 09:33:52.512334139 +0100
|
||||
@@ -1520,8 +1520,8 @@
|
||||
short tmpformat;
|
||||
short retbyte = 0;
|
||||
short bpp = 3;
|
||||
- long width = 0;
|
||||
- long length = 0;
|
||||
+ png_uint_32 width = 0;
|
||||
+ png_uint_32 length = 0;
|
||||
long rstep = 0;
|
||||
long RasterLength = 0;
|
||||
long i;
|
||||
@@ -1574,7 +1574,7 @@
|
||||
goto onErr;
|
||||
}
|
||||
|
||||
- if (setjmp (png_p->jmpbuf))
|
||||
+ if (setjmp (png_jmpbuf(png_p)))
|
||||
{
|
||||
png_destroy_read_struct(&png_p, &info_p, (png_infopp)NULL);
|
||||
goto onErr;
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
--- a/backend/src/cnij_backend_common.c 2008-09-01 10:05:44.000000000 +0200
|
||||
+++ b/backend/src/cnij_backend_common.c 2012-05-06 17:38:40.000000000 +0200
|
||||
@@ -39,6 +39,7 @@
|
||||
// CUPS Header
|
||||
#include <cups/cups.h>
|
||||
#include <cups/ipp.h>
|
||||
+#include <cups/ppd.h>
|
||||
|
||||
// Header file for CANON
|
||||
#include "cnij_backend_common.h"
|
||||
--- a/cngpijmon/src/bjcupsmon_cups.c 2008-09-02 12:28:24.000000000 +0200
|
||||
+++ b/cngpijmon/src/bjcupsmon_cups.c 2012-05-06 17:39:20.000000000 +0200
|
||||
@@ -21,6 +21,7 @@
|
||||
/*** Includes ***/
|
||||
#include <cups/cups.h>
|
||||
#include <cups/language.h>
|
||||
+#include <cups/ppd.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include <pwd.h>
|
||||
152
pkgs/misc/cups/drivers/cnijfilter_4_00/default.nix
Normal file
152
pkgs/misc/cups/drivers/cnijfilter_4_00/default.nix
Normal file
|
|
@ -0,0 +1,152 @@
|
|||
{ stdenv, lib, fetchzip,
|
||||
autoconf, automake, libtool,
|
||||
cups, popt, libtiff, libpng,
|
||||
ghostscript, glib, libusb1, libxml2 }:
|
||||
|
||||
/* this derivation is basically just a transcription of the rpm .spec
|
||||
file included in the tarball */
|
||||
|
||||
let arch =
|
||||
if stdenv.hostPlatform.system == "x86_64-linux" then "64"
|
||||
else if stdenv.hostPlatform.system == "i686-linux" then "32"
|
||||
else throw "Unsupported system ${stdenv.hostPlatform.system}";
|
||||
|
||||
in stdenv.mkDerivation {
|
||||
pname = "cnijfilter";
|
||||
|
||||
/* important note about versions: cnijfilter packages seem to use
|
||||
versions in a non-standard way. the version indicates which
|
||||
printers are supported in the package. so this package should
|
||||
not be "upgraded" in the usual way.
|
||||
|
||||
instead, if you want to include another version supporting your
|
||||
printer, you should try to abstract out the common things (which
|
||||
should be pretty much everything except the version and the 'pr'
|
||||
and 'pr_id' values to loop over). */
|
||||
version = "4.00";
|
||||
|
||||
src = fetchzip {
|
||||
url = "http://gdlp01.c-wss.com/gds/5/0100005515/01/cnijfilter-source-4.00-1.tar.gz";
|
||||
sha256 = "1f6vpx1z3qa88590i5m0s49j9n90vpk81xmw6pvj0nfd3qbvzkya";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ autoconf automake ];
|
||||
buildInputs = [ libtool
|
||||
cups popt libtiff libpng
|
||||
ghostscript glib libusb1 libxml2 ];
|
||||
|
||||
# patches from https://github.com/tokiclover/bar-overlay/tree/master/net-print/cnijfilter
|
||||
patches = [
|
||||
./patches/cnijfilter-3.80-1-cups-1.6.patch
|
||||
./patches/cnijfilter-3.80-6-cups-1.6.patch
|
||||
./patches/cnijfilter-4.00-4-ppd.patch
|
||||
./patches/cnijfilter-4.00-5-abi_x86_32.patch
|
||||
./patches/cnijfilter-4.00-6-headers.patch
|
||||
./patches/cnijfilter-4.00-7-sysctl.patch
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
sed -i "s|/usr/lib/cups/backend|$out/lib/cups/backend|" backend/src/Makefile.am;
|
||||
sed -i "s|/usr/lib/cups/backend|$out/lib/cups/backend|" backendnet/backend/Makefile.am;
|
||||
sed -i "s|/usr/lib/cups/backend|$out/lib/cups/backend|" cnijbe/src/Makefile.am;
|
||||
sed -i "s|/usr|$out|" backend/src/cnij_backend_common.c;
|
||||
sed -i "s|/usr/bin|${ghostscript}/bin|" pstocanonij/filter/pstocanonij.c;
|
||||
'';
|
||||
|
||||
configurePhase = ''
|
||||
cd libs
|
||||
./autogen.sh --prefix=$out
|
||||
|
||||
cd ../bscc2sts
|
||||
./autogen.sh
|
||||
|
||||
cd ../cnijnpr
|
||||
./autogen.sh --prefix=$out --enable-libpath=$out/lib/bjlib
|
||||
|
||||
cd ../cngpij
|
||||
./autogen.sh --prefix=$out --enable-progpath=$out/bin
|
||||
|
||||
cd ../cngpijmnt
|
||||
./autogen.sh --prefix=$out --enable-progpath=$out/bin
|
||||
|
||||
cd ../pstocanonij
|
||||
./autogen.sh --prefix=$out --enable-progpath=$out/bin
|
||||
|
||||
cd ../backend
|
||||
./autogen.sh --prefix=$out
|
||||
|
||||
cd ../backendnet
|
||||
./autogen.sh --prefix=$out --enable-libpath=$out/lib/bjlib --enable-progpath=$out/bin
|
||||
|
||||
cd ../cmdtocanonij
|
||||
./autogen.sh --prefix=$out --datadir=$out/share
|
||||
|
||||
cd ../cnijbe
|
||||
./autogen.sh --prefix=$out --enable-progpath=$out/bin
|
||||
|
||||
cd ../lgmon2
|
||||
substituteInPlace src/Makefile.am \
|
||||
--replace /usr/include/libusb-1.0 \
|
||||
${libusb1.dev}/include/libusb-1.0
|
||||
./autogen.sh --prefix=$out --enable-libpath=$out/lib/bjlib --enable-progpath=$out/bin
|
||||
|
||||
cd ..;
|
||||
|
||||
sed -e "s,cnijlgmon2_LDADD =,cnijlgmon2_LDADD = -L../../com/libs_bin${arch}," \
|
||||
-i lgmon2/src/Makefile.am || die
|
||||
'';
|
||||
|
||||
preInstall = ''
|
||||
mkdir -p $out/bin $out/lib/cups/filter $out/share/cups/model;
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
set -o xtrace
|
||||
for pr in mg2400 mg2500 mg3500 mg5500 mg6400 mg6500 mg7100 p200; do
|
||||
cd ppd;
|
||||
./autogen.sh --prefix=$out --program-suffix=$pr
|
||||
make clean;
|
||||
make;
|
||||
make install;
|
||||
|
||||
cd ../cnijfilter;
|
||||
./autogen.sh --prefix=$out --program-suffix=$pr --enable-libpath=/var/lib/cups/path/lib/bjlib --enable-binpath=$out/bin;
|
||||
make clean;
|
||||
make;
|
||||
make install;
|
||||
|
||||
cd ..;
|
||||
done;
|
||||
|
||||
mkdir -p $out/lib/bjlib;
|
||||
for pr_id in 423 424 425 426 427 428 429 430; do
|
||||
install -c -m 755 $pr_id/database/* $out/lib/bjlib;
|
||||
install -c -s -m 755 $pr_id/libs_bin${arch}/*.so.* $out/lib;
|
||||
done;
|
||||
|
||||
pushd $out/lib;
|
||||
for so_file in *.so.*; do
|
||||
ln -s $so_file ''${so_file/.so.*/}.so;
|
||||
patchelf --set-rpath $out/lib $so_file;
|
||||
done;
|
||||
popd;
|
||||
'';
|
||||
|
||||
/* the tarball includes some pre-built shared libraries. we run
|
||||
'patchelf --set-rpath' on them just a few lines above, so that
|
||||
they can find each other. but that's not quite enough. some of
|
||||
those libraries load each other in non-standard ways -- they
|
||||
don't list each other in the DT_NEEDED section. so, if the
|
||||
standard 'patchelf --shrink-rpath' (from
|
||||
pkgs/development/tools/misc/patchelf/setup-hook.sh) is run on
|
||||
them, it undoes the --set-rpath. this prevents that. */
|
||||
dontPatchELF = true;
|
||||
|
||||
meta = with lib; {
|
||||
description = "Canon InkJet printer drivers for the MG2400 MG2500 MG3500 MG5500 MG6400 MG6500 MG7100 and P200 series";
|
||||
homepage = "https://www.canon-europe.com/support/consumer_products/products/fax__multifunctionals/inkjet/pixma_mg_series/pixma_mg5550.aspx?type=drivers&driverdetailid=tcm:13-1094072";
|
||||
license = licenses.unfree;
|
||||
platforms = platforms.linux;
|
||||
maintainers = with maintainers; [ chpatrick ];
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
--- a/cngpij/cngpij/bjcups.c
|
||||
+++ a/cngpij/cngpij/bjcups.c
|
||||
@@ -698,8 +719,8 @@
|
||||
else {
|
||||
pRequest = ippNew();
|
||||
|
||||
- pRequest->request.op.operation_id = CUPS_GET_PRINTERS;
|
||||
- pRequest->request.op.request_id = 1;
|
||||
+ ippSetOperation(pRequest, CUPS_GET_PRINTERS);
|
||||
+ ippSetRequestId(pRequest, 1);
|
||||
|
||||
pLanguage = bjcupsLangDefault(); // cupsLangDefault() -> bjcupsLangDefault() for cups-1.1.19
|
||||
|
||||
@@ -708,29 +729,29 @@
|
||||
ippAddString(pRequest, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, NULL);
|
||||
|
||||
if ((pResponse = cupsDoRequest(pHTTP, pRequest, "/")) != NULL) {
|
||||
- if (pResponse->request.status.status_code > IPP_OK_CONFLICT) {
|
||||
+ if (ippGetStatusCode(pResponse) > IPP_OK_CONFLICT) {
|
||||
fputs("ERROR: IPP ERROR\n", stderr);
|
||||
goto onErr;
|
||||
}
|
||||
else {
|
||||
- pAttribute = pResponse->attrs;
|
||||
+ pAttribute = ippFirstAttribute(pResponse);
|
||||
|
||||
while (pAttribute != NULL) {
|
||||
- while (pAttribute != NULL && pAttribute->group_tag != IPP_TAG_PRINTER) {
|
||||
- pAttribute = pAttribute->next;
|
||||
+ while (pAttribute != NULL && ippGetGroupTag(pAttribute) != IPP_TAG_PRINTER) {
|
||||
+ pAttribute = ippNextAttribute(pResponse);
|
||||
}
|
||||
if (pAttribute == NULL) {
|
||||
break;
|
||||
}
|
||||
|
||||
- while (pAttribute != NULL && pAttribute->group_tag == IPP_TAG_PRINTER) {
|
||||
- if (strcmp(pAttribute->name, "printer-name") == 0 && pAttribute->value_tag == IPP_TAG_NAME) {
|
||||
- pPrinter = pAttribute->values[0].string.text;
|
||||
+ while (pAttribute != NULL && ippGetGroupTag(pAttribute) == IPP_TAG_PRINTER) {
|
||||
+ if (strcmp(ippGetName(pAttribute), "printer-name") == 0 && ippGetValueTag(pAttribute) == IPP_TAG_NAME) {
|
||||
+ pPrinter = ippGetString(pAttribute, 0, NULL);
|
||||
}
|
||||
- if (strcmp(pAttribute->name, "device-uri") == 0 && pAttribute->value_tag == IPP_TAG_URI) {
|
||||
- pDUri = pAttribute->values[0].string.text;
|
||||
+ if (strcmp(ippGetName(pAttribute), "device-uri") == 0 && ippGetValueTag(pAttribute) == IPP_TAG_URI) {
|
||||
+ pDUri = ippGetString(pAttribute, 0, NULL);
|
||||
}
|
||||
- pAttribute = pAttribute->next;
|
||||
+ pAttribute = ippNextAttribute(pResponse);
|
||||
}
|
||||
|
||||
if (strcasecmp(pDestName, pPrinter) == 0) {
|
||||
@@ -739,7 +760,7 @@
|
||||
}
|
||||
|
||||
if (pAttribute != NULL)
|
||||
- pAttribute = pAttribute->next;
|
||||
+ pAttribute = ippNextAttribute(pResponse);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,87 @@
|
|||
diff --git a/cngpijmnt/src/getipc.c b/cngpijmnt/src/getipc.c
|
||||
index 8688032..54c7933 100755
|
||||
--- a/cngpijmnt/src/getipc.c
|
||||
+++ b/cngpijmnt/src/getipc.c
|
||||
@@ -42,7 +42,7 @@ int GetIPCData(LPIPCU pipc, char *sname)
|
||||
int server_fd;
|
||||
int client_fd;
|
||||
char buf[128];
|
||||
- size_t len;
|
||||
+ socklen_t len;
|
||||
short ret = RET_ERROR;
|
||||
|
||||
if( (server_fd = socket(PF_UNIX, SOCK_STREAM, 0)) < 0 )
|
||||
|
||||
--- a/cngpijmnt/src/main.c 2016-11-12 23:39:03.534855723 +0100
|
||||
+++ b/cngpijmnt/src/main.c 2016-11-12 23:47:02.521847145 +0100
|
||||
@@ -308,8 +308,8 @@
|
||||
*pResponse; // Pointer to CUPS IPP response.
|
||||
ipp_attribute_t *pAttribute; // Pointer to CUPS attributes.
|
||||
cups_lang_t *pLanguage; // Pointer to language.
|
||||
- char *pPrinter = NULL; // Pointer to printer name.
|
||||
- char *pDUri = NULL; // Pointer to Device uri.
|
||||
+ const char *pPrinter = NULL; // Pointer to printer name.
|
||||
+ const char *pDUri = NULL; // Pointer to Device uri.
|
||||
short retVal = -1; // Return value.
|
||||
/*** Parameters end ***/
|
||||
|
||||
@@ -321,8 +321,8 @@
|
||||
else {
|
||||
pRequest = ippNew();
|
||||
|
||||
- pRequest->request.op.operation_id = CUPS_GET_PRINTERS;
|
||||
- pRequest->request.op.request_id = 1;
|
||||
+ ippSetOperation(pRequest, CUPS_GET_PRINTERS);
|
||||
+ ippSetRequestId(pRequest, 1);
|
||||
|
||||
pLanguage = bjcupsLangDefault(); // cupsLangDefault() -> bjcupsLangDefault() for cups-1.1.19
|
||||
|
||||
@@ -331,29 +331,29 @@
|
||||
ippAddString(pRequest, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, NULL);
|
||||
|
||||
if ((pResponse = cupsDoRequest(pHTTP, pRequest, "/")) != NULL) {
|
||||
- if (pResponse->request.status.status_code > IPP_OK_CONFLICT) {
|
||||
+ if (ippGetStatusCode(pResponse) > IPP_OK_CONFLICT) {
|
||||
fputs("ERROR: IPP ERROR\n", stderr);
|
||||
goto onErr;
|
||||
}
|
||||
else {
|
||||
- pAttribute = pResponse->attrs;
|
||||
+ pAttribute = ippFirstAttribute(pResponse);
|
||||
|
||||
while (pAttribute != NULL) {
|
||||
- while (pAttribute != NULL && pAttribute->group_tag != IPP_TAG_PRINTER) {
|
||||
- pAttribute = pAttribute->next;
|
||||
+ while (pAttribute != NULL && ippGetGroupTag(pAttribute) != IPP_TAG_PRINTER) {
|
||||
+ pAttribute = ippNextAttribute(pResponse);
|
||||
}
|
||||
if (pAttribute == NULL) {
|
||||
break;
|
||||
}
|
||||
|
||||
- while (pAttribute != NULL && pAttribute->group_tag == IPP_TAG_PRINTER) {
|
||||
- if (strcmp(pAttribute->name, "printer-name") == 0 && pAttribute->value_tag == IPP_TAG_NAME) {
|
||||
- pPrinter = pAttribute->values[0].string.text;
|
||||
+ while (pAttribute != NULL && ippGetGroupTag(pAttribute) == IPP_TAG_PRINTER) {
|
||||
+ if (strcmp(ippGetName(pAttribute), "printer-name") == 0 && ippGetValueTag(pAttribute) == IPP_TAG_NAME) {
|
||||
+ pPrinter = ippGetString(pAttribute, 0, NULL);
|
||||
}
|
||||
- if (strcmp(pAttribute->name, "device-uri") == 0 && pAttribute->value_tag == IPP_TAG_URI) {
|
||||
- pDUri = pAttribute->values[0].string.text;
|
||||
+ if (strcmp(ippGetName(pAttribute), "device-uri") == 0 && ippGetValueTag(pAttribute) == IPP_TAG_URI) {
|
||||
+ pDUri = ippGetString(pAttribute, 0, NULL);
|
||||
}
|
||||
- pAttribute = pAttribute->next;
|
||||
+ pAttribute = ippNextAttribute(pResponse);
|
||||
}
|
||||
|
||||
if (strcasecmp(pDestName, pPrinter) == 0) {
|
||||
@@ -362,7 +362,7 @@
|
||||
}
|
||||
|
||||
if (pAttribute != NULL)
|
||||
- pAttribute = pAttribute->next;
|
||||
+ pAttribute = ippNextAttribute(pResponse);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
--- a/backend/src/cnij_backend_common.c 2016-11-13 00:08:34.600824006 +0100
|
||||
+++ a/backend/src/cnij_backend_common.c 2016-11-13 00:08:52.037823694 +0100
|
||||
@@ -37,6 +37,7 @@
|
||||
// CUPS Header
|
||||
#include <cups/cups.h>
|
||||
#include <cups/ipp.h>
|
||||
+#include <cups/ppd.h>
|
||||
|
||||
// Header file for CANON
|
||||
#include "cnij_backend_common.h"
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
--- a/backendnet/configure.in 2014-08-11 08:38:46.034984462 +0200
|
||||
+++ a/backendnet/configure.in 2014-08-11 08:35:42.902985813 +0200
|
||||
@@ -19,7 +19,11 @@
|
||||
AC_DEFINE_UNQUOTED(BJLIB_PATH, "$enable_libpath")
|
||||
AC_SUBST(BJLIB_PATH)
|
||||
|
||||
-ARC=`getconf LONG_BIT`
|
||||
+case "$ABI" in
|
||||
+ x86) ARC=32;;
|
||||
+ amd64) ARC=64;;
|
||||
+ *) ARC=`getconf LONG_BIT`;;
|
||||
+esac
|
||||
AC_SUBST(ARC)
|
||||
|
||||
# Checks for programs.
|
||||
--- a/cnijfilter/configure.in 2014-08-11 08:39:44.426984031 +0200
|
||||
+++ a/cnijfilter/configure.in 2014-08-11 08:35:19.788985984 +0200
|
||||
@@ -43,7 +43,11 @@
|
||||
esac
|
||||
AC_SUBST(CNCL_LIB_ID)
|
||||
|
||||
-ARC=`getconf LONG_BIT`
|
||||
+case "$ABI" in
|
||||
+ x86) ARC=32;;
|
||||
+ amd64) ARC=64;;
|
||||
+ *) ARC=`getconf LONG_BIT`;;
|
||||
+esac
|
||||
AC_SUBST(ARC)
|
||||
|
||||
AC_PROG_CC
|
||||
--- a/cnijnpr/configure.in 2014-08-11 08:41:12.712983380 +0200
|
||||
+++ a/cnijnpr/configure.in 2014-08-11 08:40:44.354983589 +0200
|
||||
@@ -37,7 +37,11 @@
|
||||
|
||||
CFLAGS="-O2"
|
||||
|
||||
-ARC=`getconf LONG_BIT`
|
||||
+case "$ABI" in
|
||||
+ x86) ARC=32;;
|
||||
+ amd64) ARC=64;;
|
||||
+ *) ARC=`getconf LONG_BIT`;;
|
||||
+esac
|
||||
AC_SUBST(ARC)
|
||||
|
||||
AC_OUTPUT(Makefile
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
--- a/cnijnpr/src/cnijnpr.c 2016-11-13 21:51:33.844977618 +0100
|
||||
+++ a/cnijnpr/src/cnijnpr.c 2016-11-13 21:52:03.129977094 +0100
|
||||
@@ -34,6 +34,8 @@
|
||||
#include <sys/ioctl.h>
|
||||
#include <net/if.h>
|
||||
#include <sys/sysctl.h>
|
||||
+#include <sys/types.h>
|
||||
+#include <unistd.h>
|
||||
#include <config.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
--- a/cnijnpr/src/cnijnpr.c
|
||||
+++ b/cnijnpr/src/cnijnpr.c
|
||||
@@ -33,7 +33,6 @@
|
||||
#include <signal.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <net/if.h>
|
||||
-#include <sys/sysctl.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include <config.h>
|
||||
31
pkgs/misc/cups/drivers/cups-bjnp/default.nix
Normal file
31
pkgs/misc/cups/drivers/cups-bjnp/default.nix
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
{lib, stdenv, fetchurl, cups}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "cups-bjnp";
|
||||
version = "1.2.2";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://sourceforge/cups-bjnp/cups-bjnp-${version}.tar.gz";
|
||||
sha256 = "0sb0vm1sf8ismzd9ba33qswxmsirj2z1b7lnyrc9v5ixm7q0bnrm";
|
||||
};
|
||||
|
||||
preConfigure = ''configureFlags="--with-cupsbackenddir=$out/lib/cups/backend"'';
|
||||
|
||||
buildInputs = [cups];
|
||||
NIX_CFLAGS_COMPILE = [
|
||||
"-include stdio.h"
|
||||
"-Wno-error=stringop-truncation"
|
||||
"-Wno-error=deprecated-declarations"
|
||||
];
|
||||
|
||||
meta = {
|
||||
description = "CUPS back-end for Canon printers";
|
||||
longDescription = ''
|
||||
CUPS back-end for the canon printers using the proprietary USB over IP
|
||||
BJNP protocol. This back-end allows Cups to print over the network to a
|
||||
Canon printer. The design is based on reverse engineering of the protocol.
|
||||
'';
|
||||
homepage = "http://cups-bjnp.sourceforge.net";
|
||||
platforms = lib.platforms.linux;
|
||||
};
|
||||
}
|
||||
53
pkgs/misc/cups/drivers/cups-drv-rastertosag-gdi/default.nix
Normal file
53
pkgs/misc/cups/drivers/cups-drv-rastertosag-gdi/default.nix
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
{ lib
|
||||
, fetchzip
|
||||
, fetchpatch
|
||||
, cups
|
||||
, python3Packages
|
||||
}:
|
||||
|
||||
python3Packages.buildPythonApplication rec {
|
||||
pname = "rastertosag-gdi";
|
||||
version = "0.1";
|
||||
src = fetchzip {
|
||||
url = "https://www.openprinting.org/download/printing/${pname}/${pname}-${version}.tar.gz";
|
||||
sha256 = "1ldplpv497j8vhw24sksg3fiw8c5pqr0wajajh7p5xpvb6zlcmvw";
|
||||
};
|
||||
patches = [
|
||||
# port to python 3
|
||||
( fetchpatch {
|
||||
url = "https://sources.debian.org/data/main/r/${pname}/0.1-7/debian/patches/0001-${pname}-python3.patch";
|
||||
sha256 = "1l3xbrs67025595k9ba5794q3s74anizpbxwsshcfhmbrzd9h8hg";
|
||||
})
|
||||
];
|
||||
format = "other";
|
||||
nativeBuildInputs = [ (lib.getBin cups) ];
|
||||
# The source image also brings pre-built ppd files,
|
||||
# be we prefer to generate from source where possible, so
|
||||
# the following line generates ppd files from the drv file.
|
||||
postBuild = ''
|
||||
ppdc -v -d . -I "${cups}/share/cups/ppdc" rastertosag-gdi.drv
|
||||
'';
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
install -vDm 0644 -t "${placeholder "out"}/share/cups/model/rastertosag-gdi/" *.ppd
|
||||
install -vDm 0755 -t "${placeholder "out"}/bin/" rastertosag-gdi
|
||||
install -vd "${placeholder "out"}/lib/cups/filter/"
|
||||
ln -vst "${placeholder "out"}/lib/cups/filter/" "${placeholder "out"}/bin/rastertosag-gdi"
|
||||
runHook postInstall
|
||||
'';
|
||||
meta = {
|
||||
description = "CUPS driver for Ricoh Aficio SP 1000S and SP 1100S printers";
|
||||
downloadPage = "https://www.openprinting.org/download/printing/rastertosag-gdi/";
|
||||
homepage = "https://www.openprinting.org/driver/rastertosag-gdi/";
|
||||
license = lib.licenses.free; # just "GPL", according to README
|
||||
maintainers = [ lib.maintainers.yarny ];
|
||||
longDescription = ''
|
||||
This package brings CUPS raster filter
|
||||
for Ricoh Aficio SP 1000S and SP 1100S.
|
||||
In contrast to other Ricoh laser printers,
|
||||
they use the proprietary SAG-GDI raster format by
|
||||
Sagem Communication and do not understand PCL or PostScript.
|
||||
Therefore they do not work with Ricoh's PPD files.
|
||||
'';
|
||||
};
|
||||
}
|
||||
28
pkgs/misc/cups/drivers/dymo/default.nix
Normal file
28
pkgs/misc/cups/drivers/dymo/default.nix
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
{ stdenv, lib, fetchurl, cups, ... }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "cups-dymo";
|
||||
version = "1.4.0.5";
|
||||
|
||||
# exposed version and 'real' version may differ
|
||||
# in this case the download states '1.4.0' but the real version is '1.4.0.5'
|
||||
# this has the potential to break future builds
|
||||
dl-name = "dymo-cups-drivers-1.4.0";
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://download.dymo.com/dymo/Software/Download%20Drivers/Linux/Download/${dl-name}.tar.gz";
|
||||
sha256 = "0wagsrz3q7yrkzb5ws0m5faq68rqnqfap9p98sgk5jl6x7krf1y6";
|
||||
};
|
||||
|
||||
buildInputs = [ cups ];
|
||||
patches = [ ./fix-includes.patch ];
|
||||
|
||||
makeFlags = [ "cupsfilterdir=$(out)/lib/cups/filter" "cupsmodeldir=$(out)/share/cups/model" ];
|
||||
|
||||
meta = {
|
||||
description = "CUPS Linux drivers and SDK for DYMO printers";
|
||||
homepage = "https://www.dymo.com/";
|
||||
license = lib.licenses.gpl2;
|
||||
maintainers = with lib.maintainers; [ makefu ];
|
||||
};
|
||||
}
|
||||
80
pkgs/misc/cups/drivers/dymo/fix-includes.patch
Normal file
80
pkgs/misc/cups/drivers/dymo/fix-includes.patch
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
diff -rp dymo-cups-drivers-1.4.0.5/src/common/CupsFilter.h dymo-cups-drivers-1.4.0.5-fix/src/common/CupsFilter.h
|
||||
*** dymo-cups-drivers-1.4.0.5/src/common/CupsFilter.h 2012-02-07 14:22:37.000000000 +0100
|
||||
--- dymo-cups-drivers-1.4.0.5-fix/src/common/CupsFilter.h 2017-03-27 23:10:17.638976126 +0200
|
||||
***************
|
||||
*** 22,29 ****
|
||||
--- 22,31 ----
|
||||
#define hfc4bbdea_8a1b_427c_9ab5_50b84576b19e
|
||||
|
||||
#include <cups/cups.h>
|
||||
+ #include <cups/ppd.h>
|
||||
#include <cups/raster.h>
|
||||
#include <memory>
|
||||
+ #include <stdio.h>
|
||||
#include <string>
|
||||
#include "CupsPrintEnvironment.h"
|
||||
#include "ErrorDiffusionHalftoning.h"
|
||||
diff -rp dymo-cups-drivers-1.4.0.5/src/common/CupsPrintEnvironment.h dymo-cups-drivers-1.4.0.5-fix/src/common/CupsPrintEnvironment.h
|
||||
*** dymo-cups-drivers-1.4.0.5/src/common/CupsPrintEnvironment.h 2012-02-07 14:22:37.000000000 +0100
|
||||
--- dymo-cups-drivers-1.4.0.5-fix/src/common/CupsPrintEnvironment.h 2017-03-27 23:10:17.638976126 +0200
|
||||
***************
|
||||
*** 22,27 ****
|
||||
--- 22,28 ----
|
||||
#define h952b1c81_8931_433a_8479_7ae6d8e85a86
|
||||
|
||||
#include "PrinterDriver.h"
|
||||
+ #include <stdio.h>
|
||||
|
||||
namespace DymoPrinterDriver
|
||||
{
|
||||
diff -rp dymo-cups-drivers-1.4.0.5/src/lm/CupsFilterLabelManager.h dymo-cups-drivers-1.4.0.5-fix/src/lm/CupsFilterLabelManager.h
|
||||
*** dymo-cups-drivers-1.4.0.5/src/lm/CupsFilterLabelManager.h 2012-02-07 14:22:38.000000000 +0100
|
||||
--- dymo-cups-drivers-1.4.0.5-fix/src/lm/CupsFilterLabelManager.h 2017-03-27 23:10:17.635976126 +0200
|
||||
***************
|
||||
*** 22,27 ****
|
||||
--- 22,28 ----
|
||||
#define he780684b_6efc_428d_bfdb_c5422b1ed982
|
||||
|
||||
#include <cups/cups.h>
|
||||
+ #include <cups/ppd.h>
|
||||
#include <cups/raster.h>
|
||||
#include "LabelManagerDriver.h"
|
||||
#include "LabelManagerLanguageMonitor.h"
|
||||
*************** public:
|
||||
*** 50,53 ****
|
||||
|
||||
/*
|
||||
* End of "$Id: CupsFilterLabelManager.h 14880 2011-03-31 16:29:05Z aleksandr $".
|
||||
! */
|
||||
\ No newline at end of file
|
||||
--- 51,54 ----
|
||||
|
||||
/*
|
||||
* End of "$Id: CupsFilterLabelManager.h 14880 2011-03-31 16:29:05Z aleksandr $".
|
||||
! */
|
||||
diff -rp dymo-cups-drivers-1.4.0.5/src/lw/CupsFilterLabelWriter.h dymo-cups-drivers-1.4.0.5-fix/src/lw/CupsFilterLabelWriter.h
|
||||
*** dymo-cups-drivers-1.4.0.5/src/lw/CupsFilterLabelWriter.h 2012-02-07 14:22:37.000000000 +0100
|
||||
--- dymo-cups-drivers-1.4.0.5-fix/src/lw/CupsFilterLabelWriter.h 2017-03-27 23:10:17.632976126 +0200
|
||||
***************
|
||||
*** 22,27 ****
|
||||
--- 22,28 ----
|
||||
#define hd8574b83_b264_47b2_8d33_a46ae75691d2
|
||||
|
||||
#include <cups/cups.h>
|
||||
+ #include <cups/ppd.h>
|
||||
#include <cups/raster.h>
|
||||
#include "LabelWriterDriver.h"
|
||||
#include "LabelWriterLanguageMonitor.h"
|
||||
diff -rp dymo-cups-drivers-1.4.0.5/src/common/CupsPrintEnvironment.cpp dymo-cups-drivers-1.4.0.5-fix/src/common/CupsPrintEnvironment.cpp
|
||||
*** dymo-cups-drivers-1.4.0.5/src/common/CupsPrintEnvironment.cpp 2019-12-16 19:37:23.429662838 +0000
|
||||
--- dymo-cups-drivers-1.4.0.5-fix/src/common/CupsPrintEnvironment.cpp 2019-12-16 19:41:48.506991614 +0000
|
||||
***************
|
||||
*** 23,28 ****
|
||||
--- 23,29 ----
|
||||
#include "CupsPrintEnvironment.h"
|
||||
#include <errno.h>
|
||||
#include <cups/cups.h>
|
||||
+ #include <cups/sidechannel.h>
|
||||
#include <cassert>
|
||||
|
||||
namespace DymoPrinterDriver
|
||||
50
pkgs/misc/cups/drivers/estudio/default.nix
Normal file
50
pkgs/misc/cups/drivers/estudio/default.nix
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
{ lib, stdenv, fetchurl, perl }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "cups-toshiba-estudio";
|
||||
version = "7.89";
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://business.toshiba.com/downloads/KB/f1Ulds/15178/TOSHIBA_ColorMFP_CUPS.tar";
|
||||
sha256 = "0qz4r7q55i0adf4fv3aqnfqgi2pz3jb1jixkqm9x6nk4vanyjf4r";
|
||||
};
|
||||
|
||||
buildInputs = [ perl ];
|
||||
|
||||
patchPhase = ''
|
||||
patchShebangs lib/
|
||||
gunzip share/cups/model/Toshiba/TOSHIBA_ColorMFP_CUPS.gz
|
||||
sed -i "s+/usr+$out+" share/cups/model/Toshiba/TOSHIBA_ColorMFP_CUPS
|
||||
gzip share/cups/model/Toshiba/TOSHIBA_ColorMFP_CUPS
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/lib/cups/filter
|
||||
mkdir -p $out/share/cups/model/Toshiba
|
||||
cp {.,$out}/lib/cups/filter/est6550_Authentication
|
||||
chmod 755 $out/lib/cups/filter/est6550_Authentication
|
||||
cp {.,$out}/share/cups/model/Toshiba/TOSHIBA_ColorMFP_CUPS.gz
|
||||
chmod 755 $out/share/cups/model/Toshiba/TOSHIBA_ColorMFP_CUPS.gz
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Printer only driver for the Toshiba e-STUDIO class of printers";
|
||||
longDescription = ''
|
||||
This driver supports the following printers: TOSHIBA e-STUDIO2000AC,
|
||||
TOSHIBA e-STUDIO2005AC, TOSHIBA e-STUDIO2040C, TOSHIBA e-STUDIO2050C,
|
||||
TOSHIBA e-STUDIO2055C, TOSHIBA e-STUDIO2500AC, TOSHIBA e-STUDIO2505AC,
|
||||
TOSHIBA e-STUDIO2540C, TOSHIBA e-STUDIO2550C, TOSHIBA e-STUDIO2555C,
|
||||
TOSHIBA e-STUDIO287CS, TOSHIBA e-STUDIO3005AC, TOSHIBA e-STUDIO3040C,
|
||||
TOSHIBA e-STUDIO3055C, TOSHIBA e-STUDIO347CS, TOSHIBA e-STUDIO3505AC,
|
||||
TOSHIBA e-STUDIO3540C, TOSHIBA e-STUDIO3555C, TOSHIBA e-STUDIO407CS,
|
||||
TOSHIBA e-STUDIO4505AC, TOSHIBA e-STUDIO4540C, TOSHIBA e-STUDIO4555C,
|
||||
TOSHIBA e-STUDIO5005AC, TOSHIBA e-STUDIO5055C, TOSHIBA e-STUDIO5506AC,
|
||||
TOSHIBA e-STUDIO5540C, TOSHIBA e-STUDIO5560C, TOSHIBA e-STUDIO6506AC,
|
||||
TOSHIBA e-STUDIO6540C, TOSHIBA e-STUDIO6550C, TOSHIBA e-STUDIO6560C,
|
||||
TOSHIBA e-STUDIO6570C and TOSHIBA e-STUDIO7506AC.
|
||||
'';
|
||||
homepage = "https://business.toshiba.com/support/downloads/index.html";
|
||||
license = licenses.unfree;
|
||||
maintainers = [ maintainers.jpotier ];
|
||||
};
|
||||
}
|
||||
51
pkgs/misc/cups/drivers/fxlinuxprint/default.nix
Normal file
51
pkgs/misc/cups/drivers/fxlinuxprint/default.nix
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
{ stdenv, lib, fetchzip, dpkg, autoPatchelfHook, cups }:
|
||||
let
|
||||
debPlatform =
|
||||
if stdenv.hostPlatform.system == "x86_64-linux" then "amd64"
|
||||
else if stdenv.hostPlatform.system == "i686-linux" then "i386"
|
||||
else throw "Unsupported system: ${stdenv.hostPlatform.system}";
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "fxlinuxprint";
|
||||
version = "1.1.2-1";
|
||||
|
||||
src = fetchzip {
|
||||
url = "https://onlinesupport.fujixerox.com/driver_downloads/fxlinuxpdf112119031.zip";
|
||||
sha256 = "1mv07ch6ysk9bknfmjqsgxb803sj6vfin29s9knaqv17jvgyh0n3";
|
||||
curlOpts = "--user-agent Mozilla/5.0"; # HTTP 410 otherwise
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ dpkg autoPatchelfHook ];
|
||||
buildInputs = [ cups ];
|
||||
|
||||
sourceRoot = ".";
|
||||
unpackCmd = "dpkg-deb -x $curSrc/fxlinuxprint_${version}_${debPlatform}.deb .";
|
||||
|
||||
dontConfigure = true;
|
||||
dontBuild = true;
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
mv etc $out
|
||||
mv usr/lib $out
|
||||
|
||||
mkdir -p $out/share/cups/model
|
||||
mv usr/share/ppd/FujiXerox/* $out/share/cups/model
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Fuji Xerox Linux Printer Driver";
|
||||
longDescription = ''
|
||||
DocuPrint P365/368 d
|
||||
DocuPrint CM315/318 z
|
||||
DocuPrint CP315/318 dw
|
||||
ApeosPort-VI C2271/C3370/C3371/C4471/C5571/C6671/C7771
|
||||
DocuCentre-VI C2271/C3370/C3371/C4471/C5571/C6671/C7771
|
||||
DocuPrint 3205 d/3208 d/3505 d/3508 d/4405 d/4408 d
|
||||
'';
|
||||
homepage = "https://onlinesupport.fujixerox.com";
|
||||
license = licenses.unfree;
|
||||
maintainers = with maintainers; [ delan ];
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
||||
74
pkgs/misc/cups/drivers/hl1110/default.nix
Normal file
74
pkgs/misc/cups/drivers/hl1110/default.nix
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
{lib, stdenv, fetchurl, cups, dpkg, gnused, makeWrapper, ghostscript, file, a2ps, coreutils, gawk }:
|
||||
|
||||
let
|
||||
version = "3.0.1-1";
|
||||
cupsdeb = fetchurl {
|
||||
url = "http://download.brother.com/welcome/dlf100421/hl1110cupswrapper-${version}.i386.deb";
|
||||
sha256 = "a87880f4ece764a724411b5b24d15d1b912f6ffc6ecbfd9fac4cd5eda13d2eb7";
|
||||
};
|
||||
srcdir = "hl1110cupswrapper-GPL_src-${version}";
|
||||
cupssrc = fetchurl {
|
||||
url = "http://download.brother.com/welcome/dlf100422/${srcdir}.tar.gz";
|
||||
sha256 = "be1dce6a4608cb253b0b382db30bf5885da46b010e8eb595b15c435e2487761c";
|
||||
};
|
||||
lprdeb = fetchurl {
|
||||
url = "http://download.brother.com/welcome/dlf100419/hl1110lpr-${version}.i386.deb";
|
||||
sha256 = "5af241782a0d500d7f47e06ea43d61127f4019b5b1c6e68b4c1cb4521a742c22";
|
||||
};
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
pname = "cups-brother-hl1110";
|
||||
inherit version;
|
||||
|
||||
srcs = [ lprdeb cupssrc cupsdeb ];
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
buildInputs = [ cups ghostscript dpkg a2ps ];
|
||||
unpackPhase = ''
|
||||
tar -xvf ${cupssrc}
|
||||
'';
|
||||
buildPhase = ''
|
||||
gcc -Wall ${srcdir}/brcupsconfig/brcupsconfig.c -o brcupsconfig4
|
||||
'';
|
||||
installPhase = ''
|
||||
# install lpr
|
||||
dpkg-deb -x ${lprdeb} $out
|
||||
|
||||
substituteInPlace $out/opt/brother/Printers/HL1110/lpd/filter_HL1110 \
|
||||
--replace /opt "$out/opt" \
|
||||
|
||||
sed -i '/GHOST_SCRIPT=/c\GHOST_SCRIPT=gs' $out/opt/brother/Printers/HL1110/lpd/psconvert2
|
||||
|
||||
patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux.so.2 $out/opt/brother/Printers/HL1110/lpd/brprintconflsr3
|
||||
patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux.so.2 $out/opt/brother/Printers/HL1110/lpd/rawtobr3
|
||||
patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux.so.2 $out/opt/brother/Printers/HL1110/inf/braddprinter
|
||||
|
||||
wrapProgram $out/opt/brother/Printers/HL1110/lpd/psconvert2 \
|
||||
--prefix PATH ":" ${ lib.makeBinPath [ gnused coreutils gawk ] }
|
||||
|
||||
wrapProgram $out/opt/brother/Printers/HL1110/lpd/filter_HL1110 \
|
||||
--prefix PATH ":" ${ lib.makeBinPath [ ghostscript a2ps file gnused coreutils ] }
|
||||
|
||||
|
||||
dpkg-deb -x ${cupsdeb} $out
|
||||
|
||||
substituteInPlace $out/opt/brother/Printers/HL1110/cupswrapper/brother_lpdwrapper_HL1110 --replace /opt "$out/opt"
|
||||
|
||||
mkdir -p $out/lib/cups/filter
|
||||
ln -s $out/opt/brother/Printers/HL1110/cupswrapper/brother_lpdwrapper_HL1110 $out/lib/cups/filter/brother_lpdwrapper_HL1110
|
||||
ln -s $out/opt/brother/Printers/HL1110/cupswrapper/brother-HL1110-cups-en.ppd $out/lib/cups/filter/brother-HL1110-cups-en.ppd
|
||||
cp brcupsconfig4 $out/opt/brother/Printers/HL1110/cupswrapper/
|
||||
ln -s $out/opt/brother/Printers/HL1110/cupswrapper/brcupsconfig4 $out/lib/cups/filter/brcupsconfig4
|
||||
|
||||
wrapProgram $out/opt/brother/Printers/HL1110/cupswrapper/brother_lpdwrapper_HL1110 \
|
||||
--prefix PATH ":" ${ lib.makeBinPath [ gnused coreutils gawk ] }
|
||||
|
||||
'';
|
||||
|
||||
meta = {
|
||||
homepage = "http://www.brother.com/";
|
||||
description = "Brother HL1110 printer driver";
|
||||
license = lib.licenses.unfree;
|
||||
platforms = lib.platforms.linux;
|
||||
downloadPage = "http://support.brother.com/g/b/downloadlist.aspx?c=eu_ot&lang=en&prod=hl1110_us_eu_as&os=128#SelectLanguageType-561_0_1";
|
||||
};
|
||||
}
|
||||
63
pkgs/misc/cups/drivers/hl1210w/default.nix
Normal file
63
pkgs/misc/cups/drivers/hl1210w/default.nix
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
{lib, stdenv, pkgsi686Linux, fetchurl, cups, dpkg, gnused, makeWrapper, ghostscript, file, a2ps, coreutils, gawk}:
|
||||
|
||||
let
|
||||
version = "3.0.1-1";
|
||||
cupsdeb = fetchurl {
|
||||
url = "https://download.brother.com/welcome/dlf101546/hl1210wcupswrapper-${version}.i386.deb";
|
||||
sha256 = "0395mnw6c7qpjgjch9in5q9p2fjdqvz9bwfwp6q1hzhs08ryk7w0";
|
||||
};
|
||||
lprdeb = fetchurl {
|
||||
url = "https://download.brother.com/welcome/dlf101547/hl1210wlpr-${version}.i386.deb";
|
||||
sha256 = "1sl3g2cd4a2gygryrr27ax3qaa65cbirz3kzskd8afkwqpmjyv7j";
|
||||
};
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
pname = "cups-brother-hl1210W";
|
||||
inherit version;
|
||||
|
||||
srcs = [ lprdeb cupsdeb ];
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
buildInputs = [ cups ghostscript dpkg a2ps ];
|
||||
dontUnpack = true;
|
||||
|
||||
installPhase = ''
|
||||
# install lpr
|
||||
dpkg-deb -x ${lprdeb} $out
|
||||
|
||||
substituteInPlace $out/opt/brother/Printers/HL1210W/lpd/filter_HL1210W \
|
||||
--replace /opt "$out/opt"
|
||||
|
||||
sed -i '/GHOST_SCRIPT=/c\GHOST_SCRIPT=gs' $out/opt/brother/Printers/HL1210W/lpd/psconvert2
|
||||
|
||||
patchelf --set-interpreter ${pkgsi686Linux.glibc.out}/lib/ld-linux.so.2 $out/opt/brother/Printers/HL1210W/lpd/brprintconflsr3
|
||||
patchelf --set-interpreter ${pkgsi686Linux.glibc.out}/lib/ld-linux.so.2 $out/opt/brother/Printers/HL1210W/lpd/rawtobr3
|
||||
patchelf --set-interpreter ${pkgsi686Linux.glibc.out}/lib/ld-linux.so.2 $out/opt/brother/Printers/HL1210W/inf/braddprinter
|
||||
|
||||
wrapProgram $out/opt/brother/Printers/HL1210W/lpd/psconvert2 \
|
||||
--prefix PATH ":" ${ lib.makeBinPath [ gnused coreutils gawk ] }
|
||||
wrapProgram $out/opt/brother/Printers/HL1210W/lpd/filter_HL1210W \
|
||||
--prefix PATH ":" ${ lib.makeBinPath [ ghostscript a2ps file gnused coreutils ] }
|
||||
|
||||
# install cups
|
||||
dpkg-deb -x ${cupsdeb} $out
|
||||
|
||||
substituteInPlace $out/opt/brother/Printers/HL1210W/cupswrapper/brother_lpdwrapper_HL1210W --replace /opt "$out/opt"
|
||||
|
||||
mkdir -p $out/lib/cups/filter
|
||||
ln -s $out/opt/brother/Printers/HL1210W/cupswrapper/brother_lpdwrapper_HL1210W $out/lib/cups/filter/brother_lpdwrapper_HL1210W
|
||||
ln -s $out/opt/brother/Printers/HL1210W/cupswrapper/brother-HL1210W-cups-en.ppd $out/lib/cups/filter/brother-HL1210W-cups-en.ppd
|
||||
# cp brcupsconfig4 $out/opt/brother/Printers/HL1110/cupswrapper/
|
||||
ln -s $out/opt/brother/Printers/HL1210W/cupswrapper/brcupsconfig4 $out/lib/cups/filter/brcupsconfig4
|
||||
|
||||
wrapProgram $out/opt/brother/Printers/HL1210W/cupswrapper/brother_lpdwrapper_HL1210W \
|
||||
--prefix PATH ":" ${ lib.makeBinPath [ gnused coreutils gawk ] }
|
||||
'';
|
||||
|
||||
meta = {
|
||||
homepage = "http://www.brother.com/";
|
||||
description = "Brother HL1210W printer driver";
|
||||
license = lib.licenses.unfree;
|
||||
platforms = lib.platforms.linux;
|
||||
downloadPage = "https://support.brother.com/g/b/downloadlist.aspx?c=nz&lang=en&prod=hl1210w_eu_as&os=128";
|
||||
};
|
||||
}
|
||||
79
pkgs/misc/cups/drivers/hl3140cw/default.nix
Normal file
79
pkgs/misc/cups/drivers/hl3140cw/default.nix
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
{lib, stdenv, fetchurl, cups, dpkg, gnused, makeWrapper, ghostscript, file, a2ps, coreutils, gawk }:
|
||||
|
||||
let
|
||||
version = "1.1.4-0";
|
||||
cupsdeb = fetchurl {
|
||||
url = "https://download.brother.com/welcome/dlf007070/hl3140cwcupswrapper-${version}.i386.deb";
|
||||
sha256 = "a76281828ca6ee86c63034673577fadcf5f24e8ed003213bdbb6bf47a7aced6f";
|
||||
};
|
||||
srcdir = "hl3140cw_cupswrapper_GPL_source_${version}";
|
||||
cupssrc = fetchurl {
|
||||
url = "https://download.brother.com/welcome/dlf006740/${srcdir}.tar.gz";
|
||||
sha256 = "1wp85rbvbar6rqqkaffymxjpls6jx9m9230dlrpqwy5akiaxf0rl";
|
||||
};
|
||||
lprdeb = fetchurl {
|
||||
url = "https://support.brother.com/g/b/files/dlf/dlf007068/hl3140cwlpr-1.1.2-1.i386.deb";
|
||||
sha256 = "601f392b52ed7080f71b780181823bb8f6abfd0591146b452ba1f23e21f9f865";
|
||||
};
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
pname = "cups-brother-hl3140cw";
|
||||
inherit version;
|
||||
nativeBuildInputs = [ makeWrapper dpkg ];
|
||||
buildInputs = [ cups ghostscript a2ps ];
|
||||
|
||||
unpackPhase = ''
|
||||
tar -xvf ${cupssrc}
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
gcc -Wall ${srcdir}/brcupsconfig/brcupsconfig.c -o brcupsconfpt1
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
# install lpr
|
||||
dpkg-deb -x ${lprdeb} $out
|
||||
|
||||
substituteInPlace $out/opt/brother/Printers/hl3140cw/lpd/filterhl3140cw \
|
||||
--replace /opt "$out/opt"
|
||||
substituteInPlace $out/opt/brother/Printers/hl3140cw/inf/setupPrintcapij \
|
||||
--replace /opt "$out/opt"
|
||||
|
||||
sed -i '/GHOST_SCRIPT=/c\GHOST_SCRIPT=gs' $out/opt/brother/Printers/hl3140cw/lpd/psconvertij2
|
||||
|
||||
patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux.so.2 $out/opt/brother/Printers/hl3140cw/lpd/brhl3140cwfilter
|
||||
patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux.so.2 $out/usr/bin/brprintconf_hl3140cw
|
||||
|
||||
wrapProgram $out/opt/brother/Printers/hl3140cw/lpd/psconvertij2 \
|
||||
--prefix PATH ":" ${ lib.makeBinPath [ gnused coreutils gawk ] }
|
||||
|
||||
wrapProgram $out/opt/brother/Printers/hl3140cw/lpd/filterhl3140cw \
|
||||
--prefix PATH ":" ${ lib.makeBinPath [ ghostscript a2ps file gnused coreutils ] }
|
||||
|
||||
|
||||
dpkg-deb -x ${cupsdeb} $out
|
||||
|
||||
substituteInPlace $out/opt/brother/Printers/hl3140cw/cupswrapper/cupswrapperhl3140cw \
|
||||
--replace /opt "$out/opt"
|
||||
|
||||
mkdir -p $out/lib/cups/filter
|
||||
ln -s $out/opt/brother/Printers/hl3140cw/cupswrapper/cupswrapperhl3140cw $out/lib/cups/filter/cupswrapperhl3140cw
|
||||
|
||||
ln -s $out/opt/brother/Printers/hl3140cw/cupswrapper/brother_hl3140cw_printer_en.ppd $out/lib/cups/filter/brother_hl3140cw_printer_en.ppd
|
||||
|
||||
cp brcupsconfpt1 $out/opt/brother/Printers/hl3140cw/cupswrapper/
|
||||
ln -s $out/opt/brother/Printers/hl3140cw/cupswrapper/brcupsconfpt1 $out/lib/cups/filter/brcupsconfpt1
|
||||
ln -s $out/opt/brother/Printers/hl3140cw/lpd/filterhl3140cw $out/lib/cups/filter/brother_lpdwrapper_hl3140cw
|
||||
|
||||
wrapProgram $out/opt/brother/Printers/hl3140cw/cupswrapper/cupswrapperhl3140cw \
|
||||
--prefix PATH ":" ${ lib.makeBinPath [ gnused coreutils gawk ] }
|
||||
'';
|
||||
|
||||
meta = {
|
||||
homepage = "http://www.brother.com/";
|
||||
description = "Brother hl3140cw printer driver";
|
||||
license = lib.licenses.unfree;
|
||||
platforms = lib.platforms.linux;
|
||||
downloadPage = "https://support.brother.com/g/b/downloadlist.aspx?c=eu_ot&lang=en&prod=hl3140cw_us_eu&os=128";
|
||||
};
|
||||
}
|
||||
71
pkgs/misc/cups/drivers/hll2340dw/default.nix
Normal file
71
pkgs/misc/cups/drivers/hll2340dw/default.nix
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
{ lib, stdenv, fetchurl, cups, dpkg, gnused, makeWrapper, ghostscript, file
|
||||
, a2ps, coreutils, perl, gnugrep, which
|
||||
}:
|
||||
|
||||
let
|
||||
version = "3.2.0-1";
|
||||
lprdeb = fetchurl {
|
||||
url = "https://download.brother.com/welcome/dlf101912/hll2340dlpr-${version}.i386.deb";
|
||||
sha256 = "c0ae98b49b462cd8fbef445550f2177ce9d8bf627c904e182daa8cbaf8781e50";
|
||||
};
|
||||
|
||||
cupsdeb = fetchurl {
|
||||
url = "https://download.brother.com/welcome/dlf101913/hll2340dcupswrapper-${version}.i386.deb";
|
||||
sha256 = "8aa24a6a825e3a4d5b51778cb46fe63032ec5a731ace22f9ef2b0ffcc2033cc9";
|
||||
};
|
||||
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
pname = "cups-brother-hll2340dw";
|
||||
inherit version;
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
buildInputs = [ cups ghostscript dpkg a2ps ];
|
||||
|
||||
dontUnpack = true;
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
dpkg-deb -x ${cupsdeb} $out
|
||||
dpkg-deb -x ${lprdeb} $out
|
||||
|
||||
substituteInPlace $out/opt/brother/Printers/HLL2340D/lpd/filter_HLL2340D \
|
||||
--replace /opt "$out/opt" \
|
||||
--replace /usr/bin/perl ${perl}/bin/perl \
|
||||
--replace "BR_PRT_PATH =~" "BR_PRT_PATH = \"$out/opt/brother/Printers/HLL2340D/\"; #" \
|
||||
--replace "PRINTER =~" "PRINTER = \"HLL2340D\"; #"
|
||||
|
||||
patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
|
||||
$out/opt/brother/Printers/HLL2340D/lpd/brprintconflsr3
|
||||
patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
|
||||
$out/opt/brother/Printers/HLL2340D/lpd/rawtobr3
|
||||
|
||||
for f in \
|
||||
$out/opt/brother/Printers/HLL2340D/cupswrapper/brother_lpdwrapper_HLL2340D \
|
||||
$out/opt/brother/Printers/HLL2340D/cupswrapper/paperconfigml1 \
|
||||
; do
|
||||
wrapProgram $f \
|
||||
--prefix PATH : ${lib.makeBinPath [
|
||||
coreutils ghostscript gnugrep gnused
|
||||
]}
|
||||
done
|
||||
|
||||
mkdir -p $out/lib/cups/filter/
|
||||
ln -s $out/opt/brother/Printers/HLL2340D/lpd/filter_HLL2340D $out/lib/cups/filter/brother_lpdwrapper_HLL2340D
|
||||
|
||||
mkdir -p $out/share/cups/model
|
||||
ln -s $out/opt/brother/Printers/HLL2340D/cupswrapper/brother-HLL2340D-cups-en.ppd $out/share/cups/model/
|
||||
|
||||
wrapProgram $out/opt/brother/Printers/HLL2340D/lpd/filter_HLL2340D \
|
||||
--prefix PATH ":" ${ lib.makeBinPath [ ghostscript a2ps file gnused gnugrep coreutils which ] }
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "http://www.brother.com/";
|
||||
description = "Brother hl-l2340dw printer driver";
|
||||
license = licenses.unfree;
|
||||
platforms = platforms.linux;
|
||||
downloadPage = "https://support.brother.com/g/b/downloadlist.aspx?c=us&lang=es&prod=hll2340dw_us_eu_as&os=128&flang=English";
|
||||
maintainers = [ maintainers.qknight ];
|
||||
};
|
||||
}
|
||||
94
pkgs/misc/cups/drivers/hll2350dw/default.nix
Normal file
94
pkgs/misc/cups/drivers/hll2350dw/default.nix
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
{ 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-hll2350dw";
|
||||
version = "4.0.0-1";
|
||||
|
||||
nativeBuildInputs = [ dpkg makeWrapper autoPatchelfHook ];
|
||||
buildInputs = [ perl ];
|
||||
|
||||
dontUnpack = true;
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://download.brother.com/welcome/dlf103566/hll2350dwpdrv-${version}.i386.deb";
|
||||
sha256 = "0b7hhln105agc3rwpi7cjlx5nf4d2yk9iksahdv3725nnd06lg46";
|
||||
};
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out
|
||||
dpkg-deb -x $src $out
|
||||
|
||||
# delete unnecessary files for the current architecture
|
||||
'' + lib.concatMapStrings (arch: ''
|
||||
echo Deleting files for ${arch}
|
||||
rm -r "$out/opt/brother/Printers/HLL2350DW/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/HLL2350DW/lpd/${stdenv.hostPlatform.linuxArch}/"* \
|
||||
"$out/opt/brother/Printers/HLL2350DW/lpd/"
|
||||
|
||||
# Fix global references and replace auto discovery mechanism with hardcoded values
|
||||
substituteInPlace $out/opt/brother/Printers/HLL2350DW/lpd/lpdfilter \
|
||||
--replace /opt "$out/opt" \
|
||||
--replace "my \$BR_PRT_PATH =" "my \$BR_PRT_PATH = \"$out/opt/brother/Printers/HLL2350DW\"; #" \
|
||||
--replace "PRINTER =~" "PRINTER = \"HLL2350DW\"; #"
|
||||
|
||||
# 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
|
||||
|
||||
ln -s \
|
||||
$out/opt/brother/Printers/HLL2350DW/lpd/lpdfilter \
|
||||
$out/lib/cups/filter/brother_lpdwrapper_HLL2350DW
|
||||
|
||||
ln -s \
|
||||
$out/opt/brother/Printers/HLL2350DW/cupswrapper/brother-HLL2350DW-cups-en.ppd \
|
||||
$out/share/cups/model/
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "http://www.brother.com/";
|
||||
description = "Brother HL-L2350DW printer driver";
|
||||
license = licenses.unfree;
|
||||
platforms = builtins.map (arch: "${arch}-linux") arches;
|
||||
downloadPage = "https://support.brother.com/g/b/downloadlist.aspx?c=us_ot&lang=en&prod=hll2350dw_us_eu_as&os=128";
|
||||
maintainers = [ maintainers.sternenseemann ];
|
||||
};
|
||||
}
|
||||
71
pkgs/misc/cups/drivers/hll2390dw-cups/default.nix
Normal file
71
pkgs/misc/cups/drivers/hll2390dw-cups/default.nix
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
{ lib, stdenv, fetchurl, makeWrapper
|
||||
, cups
|
||||
, dpkg
|
||||
, a2ps, ghostscript, gnugrep, gnused, coreutils, file, perl, which
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "hll2390dw-cups";
|
||||
version = "4.0.0-1";
|
||||
|
||||
src = fetchurl {
|
||||
# The i386 part is a lie. There are x86, x86_64 and armv7l drivers.
|
||||
# Though this builds only supports x86_64 for now.
|
||||
url = "https://download.brother.com/welcome/dlf103579/hll2390dwpdrv-${version}.i386.deb";
|
||||
sha256 = "0w8rxh1sa5amxr87qmzs4m2p06b1b36wn2q127mg427sbkh1rwni";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
buildInputs = [ cups ghostscript dpkg a2ps ];
|
||||
|
||||
dontUnpack = true;
|
||||
|
||||
installPhase = ''
|
||||
dpkg-deb -x $src $out
|
||||
|
||||
substituteInPlace $out/opt/brother/Printers/HLL2390DW/lpd/lpdfilter \
|
||||
--replace /opt "$out/opt" \
|
||||
--replace /usr/bin/perl ${perl}/bin/perl \
|
||||
--replace "BR_PRT_PATH =~" "BR_PRT_PATH = \"$out\"; #" \
|
||||
--replace "PRINTER =~" "PRINTER = \"HLL2390DW\"; #"
|
||||
|
||||
# FIXME : Allow i686 and armv7l variations to be setup instead.
|
||||
_PLAT=x86_64
|
||||
patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
|
||||
$out/opt/brother/Printers/HLL2390DW/lpd/$_PLAT/brprintconflsr3
|
||||
patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
|
||||
$out/opt/brother/Printers/HLL2390DW/lpd/$_PLAT/rawtobr3
|
||||
ln -s $out/opt/brother/Printers/HLL2390DW/lpd/$_PLAT/brprintconflsr3 $out/opt/brother/Printers/HLL2390DW/lpd/brprintconflsr3
|
||||
ln -s $out/opt/brother/Printers/HLL2390DW/lpd/$_PLAT/rawtobr3 $out/opt/brother/Printers/HLL2390DW/lpd/rawtobr3
|
||||
|
||||
for f in \
|
||||
$out/opt/brother/Printers/HLL2390DW/cupswrapper/lpdwrapper \
|
||||
$out/opt/brother/Printers/HLL2390DW/cupswrapper/paperconfigml2 \
|
||||
; do
|
||||
#substituteInPlace $f \
|
||||
wrapProgram $f \
|
||||
--prefix PATH : ${lib.makeBinPath [
|
||||
coreutils ghostscript gnugrep gnused
|
||||
]}
|
||||
done
|
||||
|
||||
mkdir -p $out/lib/cups/filter/
|
||||
ln -s $out/opt/brother/Printers/HLL2390DW/lpd/lpdfilter $out/lib/cups/filter/brother_lpdwrapper_HLL2390DW
|
||||
|
||||
mkdir -p $out/share/cups/model
|
||||
ln -s $out/opt/brother/Printers/HLL2390DW/cupswrapper/brother-HLL2390DW-cups-en.ppd $out/share/cups/model/
|
||||
|
||||
wrapProgram $out/opt/brother/Printers/HLL2390DW/lpd/lpdfilter \
|
||||
--prefix PATH ":" ${ lib.makeBinPath [ ghostscript a2ps file gnused gnugrep coreutils which ] }
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "http://www.brother.com/";
|
||||
description = "Brother HL-L2390DW combined print driver";
|
||||
license = licenses.unfree;
|
||||
platforms = [ "x86_64-linux" ];
|
||||
downloadPage = "http://support.brother.com/g/b/downloadlist.aspx?c=us_ot&lang=en&prod=hll2390dw_us&os=128";
|
||||
maintainers = [ maintainers.samueldr ];
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
{ stdenv
|
||||
, lib
|
||||
, fetchzip
|
||||
# can either be "EU" or "Global"; it's unclear what the difference is
|
||||
, region ? "Global"
|
||||
# can be either "English", "French", "German", "Italian", "Portguese" or "Spanish"
|
||||
, language ? "English"
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "cups-kyocera-ecosys-m2x35-40-p2x35-40dnw";
|
||||
version = "8.1606";
|
||||
|
||||
src = let
|
||||
urlVersion = builtins.replaceStrings [ "." ] [ "_" ] version;
|
||||
in fetchzip {
|
||||
url = "https://www.kyoceradocumentsolutions.de/content/download-center/de/drivers/all/Linux_${urlVersion}_ECOSYS_M2x35_40_P2x35_40dnw_zip.download.zip";
|
||||
sha256 = "10crxdfj62ini70vv471445zi6q0l9fmg2jsd74sp6fr0qa0kvr7";
|
||||
};
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/share/cups/model/Kyocera
|
||||
cp ${region}/${language}/*.PPD $out/share/cups/model/Kyocera/
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "PPD files for Kyocera ECOSYS M2040dn/M2135dn/M2540dn/M2540dw/M2635dn/M2635dw/M2640idw/M2735dw/P2040dn/M2040dw/P2235dn/P2235dw";
|
||||
homepage = "https://www.kyoceradocumentsolutions.com";
|
||||
license = licenses.unfree;
|
||||
maintainers = with maintainers; [ hexa ];
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
{ stdenv
|
||||
, lib
|
||||
, fetchzip
|
||||
# can either be "EU" or "Global"; it's unclear what the difference is
|
||||
, region ? "Global"
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "cups-kyocera-ecosys-m552x-p502x";
|
||||
version = "8.1602";
|
||||
|
||||
src = fetchzip {
|
||||
url = "https://www.kyoceradocumentsolutions.de/content/download-center/de/drivers/all/Linux_8_1602_ECOSYS_M5521_5526_P5021_5026_zip.download.zip";
|
||||
sha256 = "sha256-XDH5deZmWNghfoO7JaYYvnVq++mbQ8RwLY57L2CKYaY=";
|
||||
};
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/share/cups/model/Kyocera
|
||||
cp ${region}/English/*.PPD $out/share/cups/model/Kyocera/
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "PPD files for Kyocera ECOSYS M5521cdn/M5521cdw/M5526cdn/M5526cdw/P5021cdn/P5021cdw/P5026cdn/P5026cdw";
|
||||
homepage = "https://www.kyoceradocumentsolutions.com";
|
||||
license = licenses.unfree;
|
||||
maintainers = [ maintainers.mbrgm ];
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
||||
50
pkgs/misc/cups/drivers/kyocera/default.nix
Normal file
50
pkgs/misc/cups/drivers/kyocera/default.nix
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
{ stdenv, lib, fetchzip, cups }:
|
||||
|
||||
let
|
||||
platform =
|
||||
if stdenv.hostPlatform.system == "x86_64-linux" then "64bit"
|
||||
else if stdenv.hostPlatform.system == "i686-linux" then "32bit"
|
||||
else throw "Unsupported system: ${stdenv.hostPlatform.system}";
|
||||
|
||||
libPath = lib.makeLibraryPath [ cups ];
|
||||
in
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "cups-kyocera";
|
||||
version = "1.1203";
|
||||
|
||||
dontPatchELF = true;
|
||||
dontStrip = true;
|
||||
|
||||
src = fetchzip {
|
||||
# this site does not like curl -> override useragent
|
||||
curlOpts = "-A ''";
|
||||
url = "https://cdn.kyostatics.net/dlc/ru/driver/all/linuxdrv_1_1203_fs-1x2xmfp.-downloadcenteritem-Single-File.downloadcenteritem.tmp/LinuxDrv_1.1203_FS-1x2xMFP.zip";
|
||||
sha256 = "0z1pbgidkibv4j21z0ys8cq1lafc6687syqa07qij2qd8zp15wiz";
|
||||
};
|
||||
|
||||
installPhase = ''
|
||||
tar -xvf ${platform}/Global/English.tar.gz
|
||||
install -Dm755 English/rastertokpsl $out/lib/cups/filter/rastertokpsl
|
||||
patchelf \
|
||||
--set-rpath ${libPath} \
|
||||
--set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
|
||||
$out/lib/cups/filter/rastertokpsl
|
||||
|
||||
mkdir -p $out/share/cups/model/Kyocera
|
||||
cd English
|
||||
for i in *.ppd; do
|
||||
sed -i $i -e \
|
||||
"s,/usr/lib/cups/filter/rastertokpsl,$out/lib/cups/filter/rastertokpsl,g"
|
||||
cp $i $out/share/cups/model/Kyocera
|
||||
done;
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "CUPS drivers for several Kyocera FS-{1020,1025,1040,1060,1120,1125} printers";
|
||||
homepage = "https://www.kyoceradocumentsolutions.ru/index/service_support/download_center.false.driver.FS1040._.EN.html#";
|
||||
license = licenses.unfree;
|
||||
maintainers = [ maintainers.vanzef ];
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
||||
61
pkgs/misc/cups/drivers/kyodialog3/default.nix
Normal file
61
pkgs/misc/cups/drivers/kyodialog3/default.nix
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
{ stdenv, lib, fetchzip, cups, autoPatchelfHook
|
||||
|
||||
# Can either be "EU" or "Global"; it's unclear what the difference is
|
||||
, region ? "Global", qt4
|
||||
}:
|
||||
|
||||
let
|
||||
platform =
|
||||
if stdenv.hostPlatform.system == "x86_64-linux" then "64bit"
|
||||
else if stdenv.hostPlatform.system == "i686-linux" then "32bit"
|
||||
else throw "Unsupported system: ${stdenv.hostPlatform.system}";
|
||||
debPlatform =
|
||||
if platform == "64bit" then "amd64"
|
||||
else "i386";
|
||||
debRegion = if region == "EU" then "EU." else "";
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "cups-kyodialog3";
|
||||
version = "8.1601";
|
||||
|
||||
dontStrip = true;
|
||||
|
||||
src = fetchzip {
|
||||
url = "https://www.kyoceradocumentsolutions.us/content/download-center-americas/us/drivers/drivers/Kyocera_Linux_PPD_Ver_${lib.replaceChars ["."] ["_"] version}_tar_gz.download.gz";
|
||||
sha256 = "11znnlkfssakml7w80gxlz1k59f3nvhph91fkzzadnm9i7a8yjal";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ autoPatchelfHook ];
|
||||
|
||||
buildInputs = [ cups qt4 ];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
cd $out
|
||||
|
||||
# unpack the debian archive
|
||||
ar p ${src}/KyoceraLinuxPackages/${region}/${platform}/kyodialog3.en${debRegion}_0.5-0_${debPlatform}.deb data.tar.gz | tar -xz
|
||||
rm -Rf KyoceraLinuxPackages
|
||||
|
||||
# strip $out/usr
|
||||
mv usr/* .
|
||||
rmdir usr
|
||||
|
||||
# allow cups to find the ppd files
|
||||
mkdir -p share/cups/model
|
||||
mv share/ppd/kyocera share/cups/model/Kyocera
|
||||
rmdir share/ppd
|
||||
|
||||
# prepend $out to all references in ppd and desktop files
|
||||
find -name "*.ppd" -exec sed -E -i "s:/usr/lib:$out/lib:g" {} \;
|
||||
find -name "*.desktop" -exec sed -E -i "s:/usr/lib:$out/lib:g" {} \;
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "CUPS drivers for several Kyocera printers";
|
||||
homepage = "https://www.kyoceradocumentsolutions.com";
|
||||
license = licenses.unfree;
|
||||
maintainers = [ maintainers.steveej ];
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
||||
68
pkgs/misc/cups/drivers/mfc9140cdncupswrapper/default.nix
Normal file
68
pkgs/misc/cups/drivers/mfc9140cdncupswrapper/default.nix
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, fetchurl
|
||||
, dpkg
|
||||
, makeWrapper
|
||||
, coreutils
|
||||
, gnugrep
|
||||
, gnused
|
||||
, mfc9140cdnlpr
|
||||
, pkgsi686Linux
|
||||
, psutils
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "mfc9140cdncupswrapper";
|
||||
version = "1.1.4-0";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://download.brother.com/welcome/dlf100407/${pname}-${version}.i386.deb";
|
||||
sha256 = "18aramgqgra1shdhsa75i0090hk9i267gvabildwsk52kq2b96c6";
|
||||
};
|
||||
|
||||
unpackPhase = ''
|
||||
dpkg-deb -x $src $out
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
dpkg
|
||||
makeWrapper
|
||||
];
|
||||
|
||||
dontBuild = true;
|
||||
|
||||
installPhase = ''
|
||||
lpr=${mfc9140cdnlpr}/opt/brother/Printers/mfc9140cdn
|
||||
dir=$out/opt/brother/Printers/mfc9140cdn
|
||||
|
||||
interpreter=${pkgsi686Linux.glibc.out}/lib/ld-linux.so.2
|
||||
patchelf --set-interpreter "$interpreter" "$dir/cupswrapper/brcupsconfpt1"
|
||||
|
||||
substituteInPlace $dir/cupswrapper/cupswrappermfc9140cdn \
|
||||
--replace "mkdir -p /usr" ": # mkdir -p /usr" \
|
||||
--replace '/opt/brother/''${device_model}/''${printer_model}/lpd/filter''${printer_model}' "$lpr/lpd/filtermfc9140cdn" \
|
||||
--replace '/usr/share/ppd/Brother/brother_''${printer_model}_printer_en.ppd' "$dir/cupswrapper/brother_mfc9140cdn_printer_en.ppd" \
|
||||
--replace '/usr/share/cups/model/Brother/brother_''${printer_model}_printer_en.ppd' "$dir/cupswrapper/brother_mfc9140cdn_printer_en.ppd" \
|
||||
--replace '/opt/brother/Printers/''${printer_model}/' "$lpr/" \
|
||||
--replace 'nup="psnup' "nup=\"${psutils}/bin/psnup" \
|
||||
--replace '/usr/bin/psnup' "${psutils}/bin/psnup"
|
||||
|
||||
mkdir -p $out/lib/cups/filter
|
||||
mkdir -p $out/share/cups/model
|
||||
|
||||
ln $dir/cupswrapper/cupswrappermfc9140cdn $out/lib/cups/filter
|
||||
ln $dir/cupswrapper/brother_mfc9140cdn_printer_en.ppd $out/share/cups/model
|
||||
|
||||
sed -n '/!ENDOFWFILTER!/,/!ENDOFWFILTER!/p' "$dir/cupswrapper/cupswrappermfc9140cdn" | sed '1 br; b; :r s/.*/printer_model=mfc9140cdn; cat <<!ENDOFWFILTER!/' | bash > $out/lib/cups/filter/brother_lpdwrapper_mfc9140cdn
|
||||
sed -i "/#! \/bin\/sh/a PATH=${lib.makeBinPath [ coreutils gnused gnugrep ]}:\$PATH" $out/lib/cups/filter/brother_lpdwrapper_mfc9140cdn
|
||||
chmod +x $out/lib/cups/filter/brother_lpdwrapper_mfc9140cdn
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Brother MFC-9140CDN CUPS wrapper driver";
|
||||
homepage = "http://www.brother.com/";
|
||||
license = licenses.gpl2Plus;
|
||||
platforms = platforms.linux;
|
||||
maintainers = with maintainers; [ hexa ];
|
||||
};
|
||||
}
|
||||
73
pkgs/misc/cups/drivers/mfc9140cdnlpr/default.nix
Normal file
73
pkgs/misc/cups/drivers/mfc9140cdnlpr/default.nix
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
{ stdenv
|
||||
, lib
|
||||
, fetchurl
|
||||
, dpkg
|
||||
, makeWrapper
|
||||
, coreutils
|
||||
, file
|
||||
, gawk
|
||||
, ghostscript
|
||||
, gnused
|
||||
, pkgsi686Linux
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "mfc9140cdnlpr";
|
||||
version = "1.1.2-1";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://download.brother.com/welcome/dlf100405/${pname}-${version}.i386.deb";
|
||||
sha256 = "1wqx8njrv078fc3vlq90qyrfg3cw9kr9m6f3qvfnkhq1f95fbslh";
|
||||
};
|
||||
|
||||
unpackPhase = ''
|
||||
dpkg-deb -x $src $out
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
dpkg
|
||||
makeWrapper
|
||||
];
|
||||
|
||||
dontBuild = true;
|
||||
|
||||
installPhase = ''
|
||||
dir=$out/opt/brother/Printers/mfc9140cdn
|
||||
|
||||
patchelf --set-interpreter ${pkgsi686Linux.glibc.out}/lib/ld-linux.so.2 $dir/lpd/brmfc9140cdnfilter
|
||||
|
||||
wrapProgram $dir/inf/setupPrintcapij \
|
||||
--prefix PATH : ${lib.makeBinPath [
|
||||
coreutils
|
||||
]}
|
||||
|
||||
substituteInPlace $dir/lpd/filtermfc9140cdn \
|
||||
--replace "BR_CFG_PATH=" "BR_CFG_PATH=\"$dir/\" #" \
|
||||
--replace "BR_LPD_PATH=" "BR_LPD_PATH=\"$dir/\" #"
|
||||
|
||||
wrapProgram $dir/lpd/filtermfc9140cdn \
|
||||
--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
|
||||
]}
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Brother MFC-9140CDN LPR printer driver";
|
||||
homepage = "http://www.brother.com/";
|
||||
license = licenses.unfree;
|
||||
maintainers = with maintainers; [ hexa ];
|
||||
platforms = [ "i686-linux" "x86_64-linux" ];
|
||||
};
|
||||
}
|
||||
62
pkgs/misc/cups/drivers/mfcj470dwcupswrapper/default.nix
Normal file
62
pkgs/misc/cups/drivers/mfcj470dwcupswrapper/default.nix
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
{ lib, stdenv, fetchurl, mfcj470dwlpr, makeWrapper}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "mfcj470dw-cupswrapper";
|
||||
version = "3.0.0-1";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://download.brother.com/welcome/dlf006866/mfcj470dw_cupswrapper_GPL_source_${version}.tar.gz";
|
||||
sha256 = "b88f9b592723a00c024129560367f40a560ca3cba06fd99512ab368dd6855853";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
buildInputs = [ mfcj470dwlpr ];
|
||||
|
||||
patchPhase = ''
|
||||
WRAPPER=cupswrapper/cupswrappermfcj470dw
|
||||
|
||||
substituteInPlace $WRAPPER \
|
||||
--replace /opt "${mfcj470dwlpr}/opt" \
|
||||
--replace /usr "${mfcj470dwlpr}/usr" \
|
||||
--replace /etc "$out/etc"
|
||||
|
||||
substituteInPlace $WRAPPER \
|
||||
--replace "cp " "cp -p "
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
cd brcupsconfpt1
|
||||
make all
|
||||
cd ..
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
TARGETFOLDER=$out/opt/brother/Printers/mfcj470dw/cupswrapper/
|
||||
PPDFOLDER=$out/share/cups/model/
|
||||
FILTERFOLDER=$out/lib/cups/filter/
|
||||
|
||||
mkdir -p $TARGETFOLDER
|
||||
mkdir -p $PPDFOLDER
|
||||
mkdir -p $FILTERFOLDER
|
||||
|
||||
cp brcupsconfpt1/brcupsconfpt1 $TARGETFOLDER
|
||||
cp cupswrapper/cupswrappermfcj470dw $TARGETFOLDER
|
||||
cp PPD/brother_mfcj470dw_printer_en.ppd $PPDFOLDER
|
||||
|
||||
ln -s ${mfcj470dwlpr}/lib/cups/filter/brother_lpdwrapper_mfcj470dw $FILTERFOLDER/
|
||||
'';
|
||||
|
||||
cleanPhase = ''
|
||||
cd brcupsconfpt1
|
||||
make clean
|
||||
'';
|
||||
|
||||
meta = {
|
||||
homepage = "http://www.brother.com/";
|
||||
description = "Brother MFC-J470DW CUPS wrapper driver";
|
||||
license = lib.licenses.gpl2;
|
||||
platforms = lib.platforms.linux;
|
||||
downloadPage = "http://support.brother.com/g/b/downloadlist.aspx?c=us&lang=en&prod=mfcj470dw_us_eu_as&os=128";
|
||||
maintainers = [ lib.maintainers.yochai ];
|
||||
};
|
||||
}
|
||||
45
pkgs/misc/cups/drivers/mfcj470dwlpr/default.nix
Normal file
45
pkgs/misc/cups/drivers/mfcj470dwlpr/default.nix
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
{ lib, stdenv, fetchurl, cups, dpkg, ghostscript, a2ps, coreutils, gnused, gawk, file, makeWrapper }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "mfcj470dw-cupswrapper";
|
||||
version = "3.0.0-1";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://download.brother.com/welcome/dlf006843/mfcj470dwlpr-${version}.i386.deb";
|
||||
sha256 = "7202dd895d38d50bb767080f2995ed350eed99bc2b7871452c3c915c8eefc30a";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
buildInputs = [ cups ghostscript dpkg a2ps ];
|
||||
|
||||
dontUnpack = true;
|
||||
|
||||
installPhase = ''
|
||||
dpkg-deb -x $src $out
|
||||
|
||||
substituteInPlace $out/opt/brother/Printers/mfcj470dw/lpd/filtermfcj470dw \
|
||||
--replace /opt "$out/opt" \
|
||||
|
||||
sed -i '/GHOST_SCRIPT=/c\GHOST_SCRIPT=gs' $out/opt/brother/Printers/mfcj470dw/lpd/psconvertij2
|
||||
|
||||
patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux.so.2 $out/opt/brother/Printers/mfcj470dw/lpd/brmfcj470dwfilter
|
||||
|
||||
mkdir -p $out/lib/cups/filter/
|
||||
ln -s $out/opt/brother/Printers/mfcj470dw/lpd/filtermfcj470dw $out/lib/cups/filter/brother_lpdwrapper_mfcj470dw
|
||||
|
||||
wrapProgram $out/opt/brother/Printers/mfcj470dw/lpd/psconvertij2 \
|
||||
--prefix PATH ":" ${ lib.makeBinPath [ gnused coreutils gawk ] }
|
||||
|
||||
wrapProgram $out/opt/brother/Printers/mfcj470dw/lpd/filtermfcj470dw \
|
||||
--prefix PATH ":" ${ lib.makeBinPath [ ghostscript a2ps file gnused coreutils ] }
|
||||
'';
|
||||
|
||||
meta = {
|
||||
homepage = "http://www.brother.com/";
|
||||
description = "Brother MFC-J470DW LPR driver";
|
||||
license = lib.licenses.unfree;
|
||||
platforms = lib.platforms.linux;
|
||||
downloadPage = "http://support.brother.com/g/b/downloadlist.aspx?c=us&lang=en&prod=mfcj470dw_us_eu_as&os=128";
|
||||
maintainers = [ lib.maintainers.yochai ];
|
||||
};
|
||||
}
|
||||
65
pkgs/misc/cups/drivers/mfcj6510dwcupswrapper/default.nix
Normal file
65
pkgs/misc/cups/drivers/mfcj6510dwcupswrapper/default.nix
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
{ lib, stdenv, fetchurl, mfcj6510dwlpr, makeWrapper}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "mfcj6510dw-cupswrapper";
|
||||
version = "3.0.0-1";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://download.brother.com/welcome/dlf006814/mfcj6510dw_cupswrapper_GPL_source_${version}.tar.gz";
|
||||
sha256 = "0y5iffybxjin8injrdmc9n9hl4s6b8n6ck76m1z78bzi88vwmhai";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
buildInputs = [ mfcj6510dwlpr ];
|
||||
|
||||
buildPhase = ''
|
||||
cd brcupsconfig
|
||||
make all
|
||||
cd ..
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
TARGETFOLDER=$out/opt/brother/Printers/mfcj6510dw/cupswrapper
|
||||
mkdir -p $TARGETFOLDER
|
||||
cp PPD/brother_mfcj6510dw_printer_en.ppd $TARGETFOLDER
|
||||
cp brcupsconfig/brcupsconfpt1 $TARGETFOLDER
|
||||
cp scripts/cupswrappermfcj6510dw $TARGETFOLDER
|
||||
sed -i -e '26,304d' $TARGETFOLDER/cupswrappermfcj6510dw
|
||||
substituteInPlace $TARGETFOLDER/cupswrappermfcj6510dw \
|
||||
--replace "\$ppd_file_name" "$TARGETFOLDER/brother_mfcj6510dw_printer_en.ppd"
|
||||
|
||||
CPUSFILTERFOLDER=$out/lib/cups/filter
|
||||
mkdir -p $TARGETFOLDER $CPUSFILTERFOLDER
|
||||
ln -s ${mfcj6510dwlpr}/lib/cups/filter/brother_lpdwrapper_mfcj6510dw $out/lib/cups/filter/brother_lpdwrapper_mfcj6510dw
|
||||
##TODO: Use the cups filter instead of the LPR one.
|
||||
#cp scripts/cupswrappermfcj6510dw $CPUSFILTERFOLDER/brother_lpdwrapper_mfcj6510dw
|
||||
#sed -i -e '110,258!d' $CPUSFILTERFOLDER/brother_lpdwrapper_mfcj6510dw
|
||||
#sed -i -e '33,40d' $CPUSFILTERFOLDER/brother_lpdwrapper_mfcj6510dw
|
||||
#sed -i -e '34,35d' $CPUSFILTERFOLDER/brother_lpdwrapper_mfcj6510dw
|
||||
#substituteInPlace $CPUSFILTERFOLDER/brother_lpdwrapper_mfcj6510dw \
|
||||
# --replace "/opt/brother/$``{device_model``}/$``{printer_model``}/lpd/filter$``{printer_model``}" \
|
||||
# "${mfcj6510dwlpr}/opt/brother/Printers/mfcj6510dw/lpd/filtermfcj6510dw" \
|
||||
# --replace "/opt/brother/Printers/$``{printer_model``}/inf/br$``{printer_model``}rc" \
|
||||
# "${mfcj6510dwlpr}/opt/brother/Printers/mfcj6510dw/inf/brmfcj6510dwrc" \
|
||||
# --replace "/opt/brother/$``{device_model``}/$``{printer_model``}/cupswrapper/brcupsconfpt1" \
|
||||
# "$out/opt/brother/Printers/mfcj6510dw/cupswrapper/brcupsconfpt1" \
|
||||
# --replace "/usr/share/cups/model/Brother/brother_" "$out/opt/brother/Printers/mfcj6510dw/cupswrapper/brother_"
|
||||
#substituteInPlace $CPUSFILTERFOLDER/brother_lpdwrapper_mfcj6510dw \
|
||||
# --replace "$``{printer_model``}" "mfcj6510dw" \
|
||||
# --replace "$``{printer_name``}" "MFCJ6510DW"
|
||||
'';
|
||||
|
||||
cleanPhase = ''
|
||||
cd brcupsconfpt1
|
||||
make clean
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "http://www.brother.com/";
|
||||
description = "Brother MFC-J6510DW CUPS wrapper driver";
|
||||
license = with licenses; gpl2;
|
||||
platforms = with platforms; linux;
|
||||
downloadPage = "http://support.brother.com/g/b/downloadlist.aspx?c=us&lang=en&prod=mfcj6510dw_all&os=128";
|
||||
maintainers = with maintainers; [ ramkromberg ];
|
||||
};
|
||||
}
|
||||
89
pkgs/misc/cups/drivers/mfcj6510dwlpr/default.nix
Normal file
89
pkgs/misc/cups/drivers/mfcj6510dwlpr/default.nix
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
{ lib, stdenv, fetchurl, pkgsi686Linux, dpkg, makeWrapper, coreutils, gnused, gawk, file, cups, util-linux, xxd, runtimeShell
|
||||
, ghostscript, a2ps }:
|
||||
|
||||
# Why:
|
||||
# The executable "brprintconf_mfcj6510dw" binary is looking for "/opt/brother/Printers/%s/inf/br%sfunc" and "/opt/brother/Printers/%s/inf/br%src".
|
||||
# Whereby, %s is printf(3) string substitution for stdin's arg0 (the command's own filename) from the 10th char forwards, as a runtime dependency.
|
||||
# e.g. Say the filename is "0123456789ABCDE", the runtime will be looking for /opt/brother/Printers/ABCDE/inf/brABCDEfunc.
|
||||
# Presumably, the binary was designed to be deployed under the filename "printconf_mfcj6510dw", whereby it will search for "/opt/brother/Printers/mfcj6510dw/inf/brmfcj6510dwfunc".
|
||||
# For NixOS, we want to change the string to the store path of brmfcj6510dwfunc and brmfcj6510dwrc but we're faced with two complications:
|
||||
# 1. Too little room to specify the nix store path. We can't even take advantage of %s by renaming the file to the store path hash since the variable is too short and can't contain the whole hash.
|
||||
# 2. The binary needs the directory it's running from to be r/w.
|
||||
# What:
|
||||
# As such, we strip the path and substitution altogether, leaving only "brmfcj6510dwfunc" and "brmfcj6510dwrc", while filling the leftovers with nulls.
|
||||
# Fully null terminating the cstrings is necessary to keep the array the same size and preventing overflows.
|
||||
# We then use a shell script to link and execute the binary, func and rc files in a temporary directory.
|
||||
# How:
|
||||
# In the package, we dump the raw binary as a string of search-able hex values using hexdump. We execute the substitution with sed. We then convert the hex values back to binary form using xxd.
|
||||
# We also write a shell script that invoked "mktemp -d" to produce a r/w temporary directory and link what we need in the temporary directory.
|
||||
# Result:
|
||||
# The user can run brprintconf_mfcj6510dw in the shell.
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "mfcj6510dwlpr";
|
||||
version = "3.0.0-1";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://download.brother.com/welcome/dlf006614/mfcj6510dwlpr-${version}.i386.deb";
|
||||
sha256 = "1ccvx393pqavsgzd8igrzlin5jrsf01d3acyvwqd1d0yz5jgqy6d";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
buildInputs = [ cups ghostscript dpkg a2ps ];
|
||||
|
||||
dontUnpack = true;
|
||||
|
||||
brprintconf_mfcj6510dw_script = ''
|
||||
#!${runtimeShell}
|
||||
cd $(mktemp -d)
|
||||
ln -s @out@/usr/bin/brprintconf_mfcj6510dw_patched brprintconf_mfcj6510dw_patched
|
||||
ln -s @out@/opt/brother/Printers/mfcj6510dw/inf/brmfcj6510dwfunc brmfcj6510dwfunc
|
||||
ln -s @out@/opt/brother/Printers/mfcj6510dw/inf/brmfcj6510dwrc brmfcj6510dwrc
|
||||
./brprintconf_mfcj6510dw_patched "$@"
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
dpkg-deb -x $src $out
|
||||
substituteInPlace $out/opt/brother/Printers/mfcj6510dw/lpd/filtermfcj6510dw \
|
||||
--replace /opt "$out/opt"
|
||||
substituteInPlace $out/opt/brother/Printers/mfcj6510dw/lpd/psconvertij2 \
|
||||
--replace "GHOST_SCRIPT=`which gs`" "GHOST_SCRIPT=${ghostscript}/bin/gs"
|
||||
substituteInPlace $out/opt/brother/Printers/mfcj6510dw/inf/setupPrintcapij \
|
||||
--replace "/opt/brother/Printers" "$out/opt/brother/Printers" \
|
||||
--replace "printcap.local" "printcap"
|
||||
|
||||
patchelf --set-interpreter ${pkgsi686Linux.stdenv.cc.libc.out}/lib/ld-linux.so.2 \
|
||||
--set-rpath $out/opt/brother/Printers/mfcj6510dw/inf:$out/opt/brother/Printers/mfcj6510dw/lpd \
|
||||
$out/opt/brother/Printers/mfcj6510dw/lpd/brmfcj6510dwfilter
|
||||
patchelf --set-interpreter ${pkgsi686Linux.stdenv.cc.libc.out}/lib/ld-linux.so.2 $out/usr/bin/brprintconf_mfcj6510dw
|
||||
|
||||
#stripping the hardcoded path.
|
||||
${util-linux}/bin/hexdump -ve '1/1 "%.2X"' $out/usr/bin/brprintconf_mfcj6510dw | \
|
||||
sed 's.2F6F70742F62726F746865722F5072696E746572732F25732F696E662F6272257366756E63.62726d66636a36353130647766756e63000000000000000000000000000000000000000000.' | \
|
||||
sed 's.2F6F70742F62726F746865722F5072696E746572732F25732F696E662F627225737263.62726D66636A3635313064777263000000000000000000000000000000000000000000.' | \
|
||||
${xxd}/bin/xxd -r -p > $out/usr/bin/brprintconf_mfcj6510dw_patched
|
||||
chmod +x $out/usr/bin/brprintconf_mfcj6510dw_patched
|
||||
#executing from current dir. segfaults if it's not r\w.
|
||||
mkdir -p $out/bin
|
||||
echo -n "$brprintconf_mfcj6510dw_script" > $out/bin/brprintconf_mfcj6510dw
|
||||
chmod +x $out/bin/brprintconf_mfcj6510dw
|
||||
substituteInPlace $out/bin/brprintconf_mfcj6510dw --replace @out@ $out
|
||||
|
||||
mkdir -p $out/lib/cups/filter/
|
||||
ln -s $out/opt/brother/Printers/mfcj6510dw/lpd/filtermfcj6510dw $out/lib/cups/filter/brother_lpdwrapper_mfcj6510dw
|
||||
|
||||
wrapProgram $out/opt/brother/Printers/mfcj6510dw/lpd/psconvertij2 \
|
||||
--prefix PATH ":" ${ lib.makeBinPath [ coreutils gnused gawk ] }
|
||||
wrapProgram $out/opt/brother/Printers/mfcj6510dw/lpd/filtermfcj6510dw \
|
||||
--prefix PATH ":" ${ lib.makeBinPath [ coreutils gnused file ghostscript a2ps ] }
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Brother MFC-J6510DW LPR driver";
|
||||
downloadPage = "http://support.brother.com/g/b/downloadlist.aspx?c=us&lang=en&prod=mfcj6510dw_all&os=128";
|
||||
homepage = "http://www.brother.com/";
|
||||
license = with licenses; unfree;
|
||||
maintainers = with maintainers; [ ramkromberg ];
|
||||
platforms = with platforms; linux;
|
||||
};
|
||||
}
|
||||
44
pkgs/misc/cups/drivers/mfcl2700dncupswrapper/default.nix
Normal file
44
pkgs/misc/cups/drivers/mfcl2700dncupswrapper/default.nix
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
{ coreutils, dpkg, fetchurl, gnugrep, gnused, makeWrapper, mfcl2700dnlpr, perl, lib, stdenv }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "mfcl2700dncupswrapper";
|
||||
version = "3.2.0-1";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://download.brother.com/welcome/dlf102086/mfcl2700dncupswrapper-${version}.i386.deb";
|
||||
sha256 = "07w48mah0xbv4h8vsh1qd5cd4b463bx8y6gc5x9pfgsxsy6h6da1";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ dpkg makeWrapper ];
|
||||
|
||||
dontUnpack = true;
|
||||
|
||||
installPhase = ''
|
||||
dpkg-deb -x $src $out
|
||||
|
||||
basedir=${mfcl2700dnlpr}/opt/brother/Printers/MFCL2700DN
|
||||
dir=$out/opt/brother/Printers/MFCL2700DN
|
||||
|
||||
substituteInPlace $dir/cupswrapper/brother_lpdwrapper_MFCL2700DN \
|
||||
--replace /usr/bin/perl ${perl}/bin/perl \
|
||||
--replace "basedir =~" "basedir = \"$basedir\"; #" \
|
||||
--replace "PRINTER =~" "PRINTER = \"MFCL2700DN\"; #"
|
||||
|
||||
wrapProgram $dir/cupswrapper/brother_lpdwrapper_MFCL2700DN \
|
||||
--prefix PATH : ${lib.makeBinPath [ coreutils gnugrep gnused ]}
|
||||
|
||||
mkdir -p $out/lib/cups/filter
|
||||
mkdir -p $out/share/cups/model
|
||||
|
||||
ln $dir/cupswrapper/brother_lpdwrapper_MFCL2700DN $out/lib/cups/filter
|
||||
ln $dir/cupswrapper/brother-MFCL2700DN-cups-en.ppd $out/share/cups/model
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Brother MFC-L2700DN CUPS wrapper driver";
|
||||
homepage = "http://www.brother.com/";
|
||||
license = lib.licenses.gpl2Plus;
|
||||
maintainers = [ lib.maintainers.tv ];
|
||||
platforms = lib.platforms.linux;
|
||||
};
|
||||
}
|
||||
44
pkgs/misc/cups/drivers/mfcl2700dnlpr/default.nix
Normal file
44
pkgs/misc/cups/drivers/mfcl2700dnlpr/default.nix
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
{ lib, stdenv, coreutils, dpkg, fetchurl, ghostscript, gnugrep, gnused, makeWrapper, perl, which }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "mfcl2700dnlpr";
|
||||
version = "3.2.0-1";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://download.brother.com/welcome/dlf102085/${pname}-${version}.i386.deb";
|
||||
sha256 = "170qdzxlqikzvv2wphvfb37m19mn13az4aj88md87ka3rl5knk4m";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ dpkg makeWrapper ];
|
||||
|
||||
dontUnpack = true;
|
||||
|
||||
installPhase = ''
|
||||
dpkg-deb -x $src $out
|
||||
|
||||
dir=$out/opt/brother/Printers/MFCL2700DN
|
||||
|
||||
substituteInPlace $dir/lpd/filter_MFCL2700DN \
|
||||
--replace /usr/bin/perl ${perl}/bin/perl \
|
||||
--replace "BR_PRT_PATH =~" "BR_PRT_PATH = \"$dir\"; #" \
|
||||
--replace "PRINTER =~" "PRINTER = \"MFCL2700DN\"; #"
|
||||
|
||||
wrapProgram $dir/lpd/filter_MFCL2700DN \
|
||||
--prefix PATH : ${lib.makeBinPath [
|
||||
coreutils ghostscript gnugrep gnused which
|
||||
]}
|
||||
|
||||
interpreter=$(cat $NIX_CC/nix-support/dynamic-linker)
|
||||
patchelf --set-interpreter "$interpreter" $dir/inf/braddprinter
|
||||
patchelf --set-interpreter "$interpreter" $dir/lpd/brprintconflsr3
|
||||
patchelf --set-interpreter "$interpreter" $dir/lpd/rawtobr3
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Brother MFC-L2700DN LPR driver";
|
||||
homepage = "http://www.brother.com/";
|
||||
license = lib.licenses.unfree;
|
||||
maintainers = [ lib.maintainers.tv ];
|
||||
platforms = [ "i686-linux" ];
|
||||
};
|
||||
}
|
||||
47
pkgs/misc/cups/drivers/mfcl2720dwcupswrapper/default.nix
Normal file
47
pkgs/misc/cups/drivers/mfcl2720dwcupswrapper/default.nix
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
{ lib, stdenv, fetchurl, dpkg, makeWrapper, coreutils, gnugrep, gnused, perl, mfcl2720dwlpr }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "mfcl2720dwcupswrapper";
|
||||
version = "3.2.0-1";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://download.brother.com/welcome/dlf101802/${pname}-${version}.i386.deb";
|
||||
sha256 = "6d131926ce22c51b1854d2b91e426cc7ecbf5d6dabd698ef51a417090e35c598";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ dpkg makeWrapper ];
|
||||
|
||||
dontUnpack = true;
|
||||
|
||||
installPhase = ''
|
||||
dpkg-deb -x $src $out
|
||||
|
||||
basedir=${mfcl2720dwlpr}/opt/brother/Printers/MFCL2720DW
|
||||
dir=$out/opt/brother/Printers/MFCL2720DW
|
||||
|
||||
substituteInPlace $dir/cupswrapper/brother_lpdwrapper_MFCL2720DW \
|
||||
--replace /usr/bin/perl ${perl}/bin/perl \
|
||||
--replace "basedir =~" "basedir = \"$basedir\"; #" \
|
||||
--replace "PRINTER =~" "PRINTER = \"MFCL2720DW\"; #"
|
||||
|
||||
substituteInPlace $dir/cupswrapper/paperconfigml1 \
|
||||
--replace /usr/bin/perl ${perl}/bin/perl
|
||||
|
||||
wrapProgram $dir/cupswrapper/brother_lpdwrapper_MFCL2720DW \
|
||||
--prefix PATH : ${lib.makeBinPath [ coreutils gnugrep gnused ]}
|
||||
|
||||
mkdir -p $out/lib/cups/filter
|
||||
mkdir -p $out/share/cups/model
|
||||
|
||||
ln $dir/cupswrapper/brother_lpdwrapper_MFCL2720DW $out/lib/cups/filter
|
||||
ln $dir/cupswrapper/brother-MFCL2720DW-cups-en.ppd $out/share/cups/model
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Brother MFC-L2720DW CUPS wrapper driver";
|
||||
homepage = "http://www.brother.com/";
|
||||
license = lib.licenses.gpl2;
|
||||
platforms = [ "x86_64-linux" "i686-linux" ];
|
||||
maintainers = [ lib.maintainers.xeji ];
|
||||
};
|
||||
}
|
||||
45
pkgs/misc/cups/drivers/mfcl2720dwlpr/default.nix
Normal file
45
pkgs/misc/cups/drivers/mfcl2720dwlpr/default.nix
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
{ pkgs, lib, stdenv, fetchurl, dpkg, makeWrapper, coreutils, ghostscript, gnugrep, gnused, which, perl }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "mfcl2720dwlpr";
|
||||
version = "3.2.0-1";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://download.brother.com/welcome/dlf101801/${pname}-${version}.i386.deb";
|
||||
sha256 = "088217e9ad118ec1e7f3d3f8f60f3bd839fe2c7d7c1136b249e9ac648dc742af";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ dpkg makeWrapper ];
|
||||
|
||||
dontUnpack = true;
|
||||
|
||||
installPhase = ''
|
||||
dpkg-deb -x $src $out
|
||||
|
||||
dir=$out/opt/brother/Printers/MFCL2720DW
|
||||
|
||||
substituteInPlace $dir/lpd/filter_MFCL2720DW \
|
||||
--replace /usr/bin/perl ${perl}/bin/perl \
|
||||
--replace "BR_PRT_PATH =~" "BR_PRT_PATH = \"$dir\"; #" \
|
||||
--replace "PRINTER =~" "PRINTER = \"MFCL2720DW\"; #"
|
||||
|
||||
wrapProgram $dir/lpd/filter_MFCL2720DW \
|
||||
--prefix PATH : ${lib.makeBinPath [
|
||||
coreutils ghostscript gnugrep gnused which
|
||||
]}
|
||||
|
||||
# need to use i686 glibc here, these are 32bit proprietary binaries
|
||||
interpreter=${pkgs.pkgsi686Linux.glibc}/lib/ld-linux.so.2
|
||||
patchelf --set-interpreter "$interpreter" $dir/inf/braddprinter
|
||||
patchelf --set-interpreter "$interpreter" $dir/lpd/brprintconflsr3
|
||||
patchelf --set-interpreter "$interpreter" $dir/lpd/rawtobr3
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Brother MFC-L2720DW lpr driver";
|
||||
homepage = "http://www.brother.com/";
|
||||
license = lib.licenses.unfree;
|
||||
platforms = [ "x86_64-linux" "i686-linux" ];
|
||||
maintainers = [ lib.maintainers.xeji ];
|
||||
};
|
||||
}
|
||||
45
pkgs/misc/cups/drivers/mfcl2740dwcupswrapper/default.nix
Normal file
45
pkgs/misc/cups/drivers/mfcl2740dwcupswrapper/default.nix
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
{ lib, stdenv, fetchurl, dpkg, makeWrapper, coreutils, gnugrep, gnused, perl, mfcl2740dwlpr }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "mfcl2740dwcupswrapper";
|
||||
version = "3.2.0-1";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://download.brother.com/welcome/dlf101726/${pname}-${version}.i386.deb";
|
||||
sha256 = "078453e19f20ab6c7fc4d63c3e09f162f3d1410c04c23a294b6ffbd720b35ffb";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ dpkg makeWrapper ];
|
||||
|
||||
unpackPhase = "dpkg-deb -x $src $out";
|
||||
|
||||
installPhase = ''
|
||||
basedir=${mfcl2740dwlpr}/opt/brother/Printers/MFCL2740DW
|
||||
dir=$out/opt/brother/Printers/MFCL2740DW
|
||||
|
||||
substituteInPlace $dir/cupswrapper/brother_lpdwrapper_MFCL2740DW \
|
||||
--replace /usr/bin/perl ${perl}/bin/perl \
|
||||
--replace "basedir =~" "basedir = \"$basedir\"; #" \
|
||||
--replace "PRINTER =~" "PRINTER = \"MFCL2740DW\"; #"
|
||||
|
||||
substituteInPlace $dir/cupswrapper/paperconfigml1 \
|
||||
--replace /usr/bin/perl ${perl}/bin/perl
|
||||
|
||||
wrapProgram $dir/cupswrapper/brother_lpdwrapper_MFCL2740DW \
|
||||
--prefix PATH : ${lib.makeBinPath [ coreutils gnugrep gnused ]}
|
||||
|
||||
mkdir -p $out/lib/cups/filter
|
||||
mkdir -p $out/share/cups/model
|
||||
|
||||
ln $dir/cupswrapper/brother_lpdwrapper_MFCL2740DW $out/lib/cups/filter
|
||||
ln $dir/cupswrapper/brother-MFCL2740DW-cups-en.ppd $out/share/cups/model
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Brother MFC-L2740DW CUPS wrapper driver";
|
||||
homepage = "http://www.brother.com/";
|
||||
license = lib.licenses.gpl2;
|
||||
platforms = [ "x86_64-linux" "i686-linux" ];
|
||||
maintainers = [ lib.maintainers.Enzime ];
|
||||
};
|
||||
}
|
||||
43
pkgs/misc/cups/drivers/mfcl2740dwlpr/default.nix
Normal file
43
pkgs/misc/cups/drivers/mfcl2740dwlpr/default.nix
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
{ pkgsi686Linux, lib, stdenv, fetchurl, dpkg, makeWrapper, coreutils, ghostscript, gnugrep, gnused, which, perl }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "mfcl2740dwlpr";
|
||||
version = "3.2.0-1";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://download.brother.com/welcome/dlf101727/${pname}-${version}.i386.deb";
|
||||
sha256 = "10a2bc672bd54e718b478f3afc7e47d451557f7d5513167d3ad349a3d00bffaf";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ dpkg makeWrapper ];
|
||||
|
||||
unpackPhase = "dpkg-deb -x $src $out";
|
||||
|
||||
installPhase = ''
|
||||
dir=$out/opt/brother/Printers/MFCL2740DW
|
||||
|
||||
substituteInPlace $dir/lpd/filter_MFCL2740DW \
|
||||
--replace /usr/bin/perl ${perl}/bin/perl \
|
||||
--replace "BR_PRT_PATH =~" "BR_PRT_PATH = \"$dir\"; #" \
|
||||
--replace "PRINTER =~" "PRINTER = \"MFCL2740DW\"; #"
|
||||
|
||||
wrapProgram $dir/lpd/filter_MFCL2740DW \
|
||||
--prefix PATH : ${lib.makeBinPath [
|
||||
coreutils ghostscript gnugrep gnused which
|
||||
]}
|
||||
|
||||
# need to use i686 glibc here, these are 32bit proprietary binaries
|
||||
interpreter=${pkgsi686Linux.glibc}/lib/ld-linux.so.2
|
||||
patchelf --set-interpreter "$interpreter" $dir/inf/braddprinter
|
||||
patchelf --set-interpreter "$interpreter" $dir/lpd/brprintconflsr3
|
||||
patchelf --set-interpreter "$interpreter" $dir/lpd/rawtobr3
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Brother MFC-L2740DW lpr driver";
|
||||
homepage = "http://www.brother.com/";
|
||||
license = lib.licenses.unfree;
|
||||
platforms = [ "x86_64-linux" "i686-linux" ];
|
||||
maintainers = [ lib.maintainers.Enzime ];
|
||||
};
|
||||
}
|
||||
93
pkgs/misc/cups/drivers/mfcl2750dw/default.nix
Normal file
93
pkgs/misc/cups/drivers/mfcl2750dw/default.nix
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
{ 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-mfcl2750dw";
|
||||
version = "4.0.0-1";
|
||||
|
||||
nativeBuildInputs = [ dpkg makeWrapper autoPatchelfHook ];
|
||||
buildInputs = [ perl ];
|
||||
|
||||
dontUnpack = true;
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://download.brother.com/welcome/dlf103530/mfcl2750dwpdrv-${version}.i386.deb";
|
||||
hash = "sha256-3uDwzLQTF8r1tsGZ7ChGhk4ryQmVsZYdUaj9eFaC0jc=";
|
||||
};
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out
|
||||
dpkg-deb -x $src $out
|
||||
|
||||
# delete unnecessary files for the current architecture
|
||||
'' + lib.concatMapStrings (arch: ''
|
||||
echo Deleting files for ${arch}
|
||||
rm -r "$out/opt/brother/Printers/MFCL2750DW/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/MFCL2750DW/lpd/${stdenv.hostPlatform.linuxArch}/"* \
|
||||
"$out/opt/brother/Printers/MFCL2750DW/lpd/"
|
||||
|
||||
# Fix global references and replace auto discovery mechanism with hardcoded values
|
||||
substituteInPlace $out/opt/brother/Printers/MFCL2750DW/lpd/lpdfilter \
|
||||
--replace /opt "$out/opt" \
|
||||
--replace "my \$BR_PRT_PATH =" "my \$BR_PRT_PATH = \"$out/opt/brother/Printers/MFCL2750DW\"; #" \
|
||||
--replace "PRINTER =~" "PRINTER = \"MFCL2750DW\"; #"
|
||||
|
||||
# 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
|
||||
|
||||
ln -s \
|
||||
$out/opt/brother/Printers/MFCL2750DW/lpd/lpdfilter \
|
||||
$out/lib/cups/filter/brother_lpdwrapper_MFCL2750DW
|
||||
|
||||
ln -s \
|
||||
$out/opt/brother/Printers/MFCL2750DW/cupswrapper/brother-MFCL2750DW-cups-en.ppd \
|
||||
$out/share/cups/model/
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "http://www.brother.com/";
|
||||
description = "Brother MFC-L2750DW printer driver";
|
||||
license = licenses.unfree;
|
||||
platforms = builtins.map (arch: "${arch}-linux") arches;
|
||||
maintainers = [ maintainers.lovesegfault ];
|
||||
};
|
||||
}
|
||||
45
pkgs/misc/cups/drivers/mfcl8690cdwcupswrapper/default.nix
Normal file
45
pkgs/misc/cups/drivers/mfcl8690cdwcupswrapper/default.nix
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
{ coreutils, dpkg, fetchurl, gnugrep, gnused, makeWrapper,
|
||||
mfcl8690cdwlpr, perl, lib, stdenv}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "mfcl8690cdwcupswrapper";
|
||||
version = "1.4.0-0";
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://download.brother.com/welcome/dlf103250/${pname}-${version}.i386.deb";
|
||||
sha256 = "1bl9r8mmj4vnanwpfjqgq3c9lf2v46wp5k6r2n9iqprf7ldd1kb2";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ dpkg makeWrapper ];
|
||||
|
||||
dontUnpack = true;
|
||||
|
||||
installPhase = ''
|
||||
dpkg-deb -x $src $out
|
||||
|
||||
basedir=${mfcl8690cdwlpr}/opt/brother/Printers/mfcl8690cdw
|
||||
dir=$out/opt/brother/Printers/mfcl8690cdw
|
||||
|
||||
substituteInPlace $dir/cupswrapper/brother_lpdwrapper_mfcl8690cdw \
|
||||
--replace /usr/bin/perl ${perl}/bin/perl \
|
||||
--replace "basedir =~" "basedir = \"$basedir/\"; #" \
|
||||
--replace "PRINTER =~" "PRINTER = \"mfcl8690cdw\"; #"
|
||||
|
||||
wrapProgram $dir/cupswrapper/brother_lpdwrapper_mfcl8690cdw \
|
||||
--prefix PATH : ${lib.makeBinPath [ coreutils gnugrep gnused ]}
|
||||
|
||||
mkdir -p $out/lib/cups/filter
|
||||
mkdir -p $out/share/cups/model
|
||||
|
||||
ln $dir/cupswrapper/brother_lpdwrapper_mfcl8690cdw $out/lib/cups/filter
|
||||
ln $dir/cupswrapper/brother_mfcl8690cdw_printer_en.ppd $out/share/cups/model
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Brother MFC-L8690CDW CUPS wrapper driver";
|
||||
homepage = "http://www.brother.com/";
|
||||
license = lib.licenses.unfree;
|
||||
platforms = lib.platforms.linux;
|
||||
maintainers = [ lib.maintainers.fuzzy-id ];
|
||||
};
|
||||
}
|
||||
45
pkgs/misc/cups/drivers/mfcl8690cdwlpr/default.nix
Normal file
45
pkgs/misc/cups/drivers/mfcl8690cdwlpr/default.nix
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
{ coreutils, dpkg, fetchurl, file, ghostscript, gnugrep, gnused,
|
||||
makeWrapper, perl, pkgs, lib, stdenv, which }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "mfcl8690cdwlpr";
|
||||
version = "1.3.0-0";
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://download.brother.com/welcome/dlf103241/${pname}-${version}.i386.deb";
|
||||
sha256 = "0x8zd4b1psmw1znp2ibncs37xm5mljcy9yza2rx8jm8lp0a3l85v";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ dpkg makeWrapper ];
|
||||
|
||||
dontUnpack = true;
|
||||
|
||||
installPhase = ''
|
||||
dpkg-deb -x $src $out
|
||||
|
||||
dir=$out/opt/brother/Printers/mfcl8690cdw
|
||||
filter=$dir/lpd/filter_mfcl8690cdw
|
||||
|
||||
substituteInPlace $filter \
|
||||
--replace /usr/bin/perl ${perl}/bin/perl \
|
||||
--replace "BR_PRT_PATH =~" "BR_PRT_PATH = \"$dir/\"; #" \
|
||||
--replace "PRINTER =~" "PRINTER = \"mfcl8690cdw\"; #"
|
||||
|
||||
wrapProgram $filter \
|
||||
--prefix PATH : ${lib.makeBinPath [
|
||||
coreutils file ghostscript gnugrep gnused which
|
||||
]}
|
||||
|
||||
# need to use i686 glibc here, these are 32bit proprietary binaries
|
||||
interpreter=${pkgs.pkgsi686Linux.glibc}/lib/ld-linux.so.2
|
||||
patchelf --set-interpreter "$interpreter" $dir/lpd/brmfcl8690cdwfilter
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Brother MFC-L8690CDW LPR printer driver";
|
||||
homepage = "http://www.brother.com/";
|
||||
license = lib.licenses.unfree;
|
||||
maintainers = [ lib.maintainers.fuzzy-id ];
|
||||
platforms = [ "i686-linux" ];
|
||||
};
|
||||
}
|
||||
116
pkgs/misc/cups/drivers/samsung/1.00.36/default.nix
Normal file
116
pkgs/misc/cups/drivers/samsung/1.00.36/default.nix
Normal file
|
|
@ -0,0 +1,116 @@
|
|||
{ lib, stdenv, fetchurl, cups, libusb-compat-0_1, libxml2, perl }:
|
||||
|
||||
let
|
||||
|
||||
arch = if stdenv.system == "x86_64-linux"
|
||||
then "x86_64"
|
||||
else "i386";
|
||||
|
||||
in stdenv.mkDerivation rec {
|
||||
pname = "samsung-unified-linux-driver";
|
||||
version = "1.00.36";
|
||||
|
||||
src = fetchurl {
|
||||
sha256 = "1a7ngd03x0bkdl7pszy5zqqic0plxvdxqm5w7klr6hbdskx1lir9";
|
||||
url = "http://www.bchemnet.com/suldr/driver/UnifiedLinuxDriver-${version}.tar.gz";
|
||||
};
|
||||
|
||||
buildInputs = [
|
||||
cups
|
||||
libusb-compat-0_1
|
||||
libxml2
|
||||
perl
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
|
||||
mkdir -p $out/bin
|
||||
cp -R ${arch}/{gettext,pstosecps,rastertospl,smfpnetdiscovery,usbresetter} $out/bin
|
||||
|
||||
mkdir -p $out/etc/sane.d/dll.d/
|
||||
install -m644 noarch/etc/smfp.conf $out/etc/sane.d
|
||||
echo smfp >> $out/etc/sane.d/dll.d/smfp-scanner.conf
|
||||
|
||||
mkdir -p $out/etc/smfp-common/scanner/share/
|
||||
install -m644 noarch/libsane-smfp.cfg $out/etc/smfp-common/scanner/share/
|
||||
install -m644 noarch/pagesize.xml $out/etc/smfp-common/scanner/share/
|
||||
|
||||
mkdir -p $out/etc/samsung/scanner/share/
|
||||
install -m644 noarch/oem.conf $out/etc/samsung/scanner/share/
|
||||
|
||||
mkdir -p $out/lib
|
||||
install -m755 ${arch}/libscmssc.so* $out/lib
|
||||
|
||||
mkdir -p $out/lib/cups/backend
|
||||
ln -s $out/bin/smfpnetdiscovery $out/lib/cups/backend
|
||||
|
||||
mkdir -p $out/lib/cups/filter
|
||||
ln -s $out/bin/{pstosecps,rastertospl} $out/lib/cups/filter
|
||||
ln -s $ghostscript/bin/gs $out/lib/cups/filter
|
||||
|
||||
mkdir -p $out/lib/sane
|
||||
install -m755 ${arch}/libsane-smfp.so* $out/lib/sane
|
||||
ln -s libsane-smfp.so.1.0.1 $out/lib/sane/libsane-smfp.so.1
|
||||
ln -s libsane-smfp.so.1 $out/lib/sane/libsane-smfp.so
|
||||
|
||||
perl -pi -e \
|
||||
's|/opt/smfp-common/scanner/.usedby/|/tmp/\0\0fp-common/scanner/.usedby/|g' \
|
||||
$out/lib/sane/libsane-smfp.so.1.0.1
|
||||
perl -pi -e 's|/opt|/etc|g' \
|
||||
$out/lib/sane/libsane-smfp.so.1.0.1 \
|
||||
$out/bin/rastertospl \
|
||||
noarch/package_utils \
|
||||
noarch/pre_install.sh
|
||||
|
||||
mkdir -p $out/lib/udev/rules.d
|
||||
(
|
||||
OEM_FILE=noarch/oem.conf
|
||||
INSTALL_LOG_FILE=/dev/null
|
||||
. noarch/scripting_utils
|
||||
. noarch/package_utils
|
||||
. noarch/scanner-script.pkg
|
||||
fill_full_template noarch/etc/smfp.rules.in $out/lib/udev/rules.d/60_smfp_samsung.rules
|
||||
chmod -x $out/lib/udev/rules.d/60_smfp_samsung.rules
|
||||
)
|
||||
|
||||
mkdir -p $out/share
|
||||
cp -R noarch/share/* $out/share
|
||||
gzip -9 $out/share/ppd/*.ppd
|
||||
rm -r $out/share/locale/*/*/install.mo
|
||||
|
||||
mkdir -p $out/share/cups
|
||||
cd $out/share/cups
|
||||
ln -s ../ppd .
|
||||
ln -s ppd model
|
||||
'';
|
||||
|
||||
preFixup = ''
|
||||
for bin in "$out/bin/"*; do
|
||||
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" "$bin"
|
||||
patchelf --set-rpath "$out/lib:${lib.getLib cups}/lib" "$bin"
|
||||
done
|
||||
|
||||
patchelf --set-rpath "$out/lib:${lib.getLib cups}/lib" "$out/lib/libscmssc.so"
|
||||
patchelf --set-rpath "$out/lib:${libxml2.out}/lib:${libusb-compat-0_1.out}/lib" "$out/lib/sane/libsane-smfp.so.1.0.1"
|
||||
|
||||
ln -s ${stdenv.cc.cc.lib}/lib/libstdc++.so.6 $out/lib/
|
||||
'';
|
||||
|
||||
# all binaries are already stripped
|
||||
dontStrip = true;
|
||||
|
||||
# we did this in prefixup already
|
||||
dontPatchELF = true;
|
||||
|
||||
meta = with lib; {
|
||||
description = "Unified Linux Driver for Samsung printers and scanners";
|
||||
homepage = "http://www.bchemnet.com/suldr";
|
||||
downloadPage = "http://www.bchemnet.com/suldr/driver/";
|
||||
license = licenses.unfree;
|
||||
|
||||
# Tested on linux-x86_64. Might work on linux-i386.
|
||||
# Probably won't work on anything else.
|
||||
platforms = platforms.linux;
|
||||
maintainers = with maintainers; [ tohl ];
|
||||
};
|
||||
}
|
||||
44
pkgs/misc/cups/drivers/samsung/1.00.36/module.nix
Normal file
44
pkgs/misc/cups/drivers/samsung/1.00.36/module.nix
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
# the original samsung-unified-linux-driver_1_00_36 has some paths
|
||||
# hardcoded in binary files
|
||||
#
|
||||
# nixos samsung-unified-linux-driver_1_00_36 tries to fix those paths
|
||||
# by patching the binaries
|
||||
#
|
||||
# this module is needed to put the expected files in the new paths
|
||||
#
|
||||
# printing works without problems
|
||||
#
|
||||
# scanning works, except one detail: sometimes it is possible to scan
|
||||
# more pages in sequence. most of the time though, scanning stops
|
||||
# working after one page. this problem happens both with scanimage
|
||||
# and simple-scan. errors indicate an I/O error. scanning works
|
||||
# again after turning the device off and on. atm i have no idea how
|
||||
# to fix this and no time to do more about it.
|
||||
{config, pkgs, lib ? pkgs.lib, ...}:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.services.samsung-unified-linux-driver_1_00_36;
|
||||
pkg = pkgs.samsung-unified-linux-driver_1_00_36;
|
||||
in {
|
||||
options = {
|
||||
services.samsung-unified-linux-driver_1_00_36 = {
|
||||
enable = mkEnableOption "enable samsung-unified-linux-driver_1_00_36";
|
||||
};
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
services.printing.drivers = [pkg];
|
||||
hardware.sane.extraBackends = [pkg];
|
||||
environment.etc = {
|
||||
"samsung/scanner/share/oem.conf".source
|
||||
= "${pkg}/etc/samsung/scanner/share/oem.conf";
|
||||
"smfp-common/scanner/share/libsane-smfp.cfg".source
|
||||
= "${pkg}/etc/smfp-common/scanner/share/libsane-smfp.cfg";
|
||||
"smfp-common/scanner/share/pagesize.xml".source
|
||||
= "${pkg}/etc/smfp-common/scanner/share/pagesize.xml";
|
||||
"sane.d/smfp.conf".source
|
||||
= "${pkg}/etc/sane.d/smfp.conf";
|
||||
"sane.d/dll.d/smfp-scanner.conf".source
|
||||
= "${pkg}/etc/sane.d/dll.d/smfp-scanner.conf";
|
||||
};
|
||||
};
|
||||
}
|
||||
98
pkgs/misc/cups/drivers/samsung/1.00.37.nix
Normal file
98
pkgs/misc/cups/drivers/samsung/1.00.37.nix
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
{ lib, stdenv, fetchurl, cups, libusb-compat-0_1, libxml2 }:
|
||||
|
||||
let
|
||||
|
||||
arch = if stdenv.hostPlatform.system == "x86_64-linux"
|
||||
then "x86_64"
|
||||
else "i386";
|
||||
|
||||
in stdenv.mkDerivation rec {
|
||||
pname = "samsung-unified-linux-driver";
|
||||
version = "1.00.37";
|
||||
|
||||
src = fetchurl {
|
||||
sha256 = "0r66l9zp0p1qgakh4j08hynwsr4lsgq5yrpxyr0x4ldvl0z2b1bb";
|
||||
url = "http://www.bchemnet.com/suldr/driver/UnifiedLinuxDriver-${version}.tar.gz";
|
||||
};
|
||||
|
||||
buildInputs = [
|
||||
cups
|
||||
libusb-compat-0_1
|
||||
libxml2
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
|
||||
mkdir -p $out/bin
|
||||
cp -R ${arch}/{gettext,pstosecps,rastertospl,smfpnetdiscovery,usbresetter} $out/bin
|
||||
|
||||
mkdir -p $out/etc/sane.d/dll.d/
|
||||
install -m644 noarch/etc/smfp.conf $out/etc/sane.d
|
||||
echo smfp >> $out/etc/sane.d/dll.d/smfp-scanner.conf
|
||||
|
||||
mkdir -p $out/lib
|
||||
install -m755 ${arch}/libscmssc.so* $out/lib
|
||||
|
||||
mkdir -p $out/lib/cups/backend
|
||||
ln -s $out/bin/smfpnetdiscovery $out/lib/cups/backend
|
||||
|
||||
mkdir -p $out/lib/cups/filter
|
||||
ln -s $out/bin/{pstosecps,rastertospl} $out/lib/cups/filter
|
||||
ln -s $ghostscript/bin/gs $out/lib/cups/filter
|
||||
|
||||
mkdir -p $out/lib/sane
|
||||
install -m755 ${arch}/libsane-smfp.so* $out/lib/sane
|
||||
ln -s libsane-smfp.so.1.0.1 $out/lib/sane/libsane-smfp.so.1
|
||||
ln -s libsane-smfp.so.1 $out/lib/sane/libsane-smfp.so
|
||||
|
||||
mkdir -p $out/lib/udev/rules.d
|
||||
(
|
||||
OEM_FILE=noarch/oem.conf
|
||||
INSTALL_LOG_FILE=/dev/null
|
||||
. noarch/scripting_utils
|
||||
. noarch/package_utils
|
||||
. noarch/scanner-script.pkg
|
||||
fill_full_template noarch/etc/smfp.rules.in $out/lib/udev/rules.d/60_smfp_samsung.rules
|
||||
chmod -x $out/lib/udev/rules.d/60_smfp_samsung.rules
|
||||
)
|
||||
|
||||
mkdir -p $out/share
|
||||
cp -R noarch/share/* $out/share
|
||||
gzip -9 $out/share/ppd/*.ppd
|
||||
rm -r $out/share/locale/*/*/install.mo
|
||||
|
||||
mkdir -p $out/share/cups
|
||||
cd $out/share/cups
|
||||
ln -s ../ppd .
|
||||
ln -s ppd model
|
||||
'';
|
||||
|
||||
preFixup = ''
|
||||
for bin in "$out/bin/"*; do
|
||||
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" "$bin"
|
||||
patchelf --set-rpath "$out/lib:${lib.getLib cups}/lib" "$bin"
|
||||
done
|
||||
|
||||
patchelf --set-rpath "$out/lib:${lib.getLib cups}/lib" "$out/lib/libscmssc.so"
|
||||
patchelf --set-rpath "$out/lib:${libxml2.out}/lib:${libusb-compat-0_1.out}/lib" "$out/lib/sane/libsane-smfp.so.1.0.1"
|
||||
|
||||
ln -s ${stdenv.cc.cc.lib}/lib/libstdc++.so.6 $out/lib/
|
||||
'';
|
||||
|
||||
# all binaries are already stripped
|
||||
dontStrip = true;
|
||||
|
||||
# we did this in prefixup already
|
||||
dontPatchELF = true;
|
||||
|
||||
meta = with lib; {
|
||||
description = "Unified Linux Driver for Samsung printers and scanners";
|
||||
homepage = "http://www.bchemnet.com/suldr";
|
||||
downloadPage = "http://www.bchemnet.com/suldr/driver/";
|
||||
license = licenses.unfree;
|
||||
|
||||
# Tested on linux-x86_64. Might work on linux-i386.
|
||||
# Probably won't work on anything else.
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
||||
35
pkgs/misc/cups/drivers/samsung/4.00.39/builder.sh
Normal file
35
pkgs/misc/cups/drivers/samsung/4.00.39/builder.sh
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
source $stdenv/setup
|
||||
|
||||
arch=$(uname -m)
|
||||
echo "$arch" | egrep -q '^i[3456]86$' && arch=i386
|
||||
echo "Installing for $arch"
|
||||
|
||||
unpackPhase
|
||||
patchPhase
|
||||
|
||||
set -v
|
||||
|
||||
cd cdroot/Linux
|
||||
mkdir -p $out/opt
|
||||
cp -r $arch/at_root/* $out
|
||||
cp -r $arch/at_opt/* $out/opt
|
||||
#cp -r noarch/at_root/* $out
|
||||
cp -r noarch/at_opt/* $out/opt
|
||||
|
||||
cd $out
|
||||
test -d usr/lib64 && ln -s usr/lib64 lib ||
|
||||
ln -s usr/lib lib
|
||||
mkdir -p share/cups
|
||||
cd share/cups
|
||||
ln -s ../../opt/share/* .
|
||||
ln -s ppd model
|
||||
|
||||
cd $out/lib/cups/filter
|
||||
for i in $(ls); do
|
||||
echo "Patching $i..."
|
||||
patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) $i ||
|
||||
echo "Couldn't set interpreter!"
|
||||
patchelf --set-rpath $cups/lib:$gcc/lib:$glibc/lib $i # This might not be necessary.
|
||||
done
|
||||
|
||||
ln -s $ghostscript/bin/gs $out/lib/cups/filter
|
||||
82
pkgs/misc/cups/drivers/samsung/4.01.17.nix
Normal file
82
pkgs/misc/cups/drivers/samsung/4.01.17.nix
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
# Tested on linux-x86_64. Might work on linux-i386. Probably won't work on anything else.
|
||||
|
||||
# To use this driver in NixOS, add it to printing.drivers in configuration.nix.
|
||||
# configuration.nix might look like this when you're done:
|
||||
# { pkgs, ... }: {
|
||||
# printing = {
|
||||
# enable = true;
|
||||
# drivers = [ pkgs.samsung-unified-linux-driver_4_01_17 ];
|
||||
# };
|
||||
# (more stuff)
|
||||
# }
|
||||
# (This advice was tested on the 1st November 2016.)
|
||||
|
||||
{ lib, stdenv, fetchurl, cups, libusb-compat-0_1 }:
|
||||
|
||||
# Do not bump lightly! Visit <http://www.bchemnet.com/suldr/supported.html>
|
||||
# to see what will break when upgrading. Consider a new versioned attribute.
|
||||
let
|
||||
installationPath = if stdenv.hostPlatform.system == "x86_64-linux" then "x86_64" else "i386";
|
||||
appendPath = if stdenv.hostPlatform.system == "x86_64-linux" then "64" else "";
|
||||
libPath = lib.makeLibraryPath [ cups libusb-compat-0_1 ] + ":$out/lib:${stdenv.cc.cc.lib}/lib${appendPath}";
|
||||
in stdenv.mkDerivation rec {
|
||||
pname = "samsung-UnifiedLinuxDriver";
|
||||
version = "4.01.17";
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://www.bchemnet.com/suldr/driver/UnifiedLinuxDriver-${version}.tar.gz";
|
||||
sha256 = "1vv3pzvqpg1dq3xjr8161x2yp3v7ca75vil56ranhw5pkjwq66x0";
|
||||
};
|
||||
|
||||
dontPatchELF = true;
|
||||
dontStrip = true;
|
||||
|
||||
installPhase = ''
|
||||
cd Linux/${installationPath}
|
||||
mkdir -p $out/lib/cups/{backend,filter}
|
||||
install -Dm755 mfp $out/lib/cups/backend/
|
||||
install -Dm755 pstosecps pstospl pstosplc rastertospl rastertosplc $out/lib/cups/filter/
|
||||
install -Dm755 libscmssc.so $out/lib/
|
||||
|
||||
GLOBIGNORE=*.so
|
||||
for exe in $out/lib/cups/**/*; do
|
||||
echo "Patching $exe"
|
||||
patchelf \
|
||||
--set-rpath ${libPath} \
|
||||
--set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
|
||||
$exe
|
||||
done
|
||||
unset GLOBIGNORE
|
||||
|
||||
install -v at_root/usr/lib${appendPath}/libmfp.so.1.0.1 $out/lib
|
||||
cd $out/lib
|
||||
ln -s -f libmfp.so.1.0.1 libmfp.so.1
|
||||
ln -s -f libmfp.so.1 libmfp.so
|
||||
|
||||
for lib in $out/lib/*.so; do
|
||||
echo "Patching $lib"
|
||||
patchelf \
|
||||
--set-rpath ${libPath} \
|
||||
$lib
|
||||
done
|
||||
|
||||
mkdir -p $out/share/cups/model/samsung
|
||||
cd -
|
||||
cd ../noarch/at_opt/share/ppd
|
||||
for i in *.ppd; do
|
||||
sed -i $i -e \
|
||||
"s,pstosecps,$out/lib/cups/filter/pstosecps,g; \
|
||||
s,pstospl,$out/lib/cups/filter/pstospl,g; \
|
||||
s,rastertospl,$out/lib/cups/filter/rastertospl,g"
|
||||
done;
|
||||
cp -r ./* $out/share/cups/model/samsung
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Samsung's Linux printing drivers; includes binaries without source code";
|
||||
homepage = "http://www.samsung.com/";
|
||||
license = licenses.unfree;
|
||||
platforms = platforms.linux;
|
||||
maintainers = with maintainers; [ joko ];
|
||||
};
|
||||
}
|
||||
54
pkgs/misc/cups/drivers/splix/default.nix
Normal file
54
pkgs/misc/cups/drivers/splix/default.nix
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
{ lib, stdenv, fetchsvn, fetchurl, cups, cups-filters, jbigkit, zlib }:
|
||||
|
||||
let
|
||||
|
||||
color-profiles = stdenv.mkDerivation {
|
||||
pname = "splix-color-profiles";
|
||||
version = "unstable-2007-06-25";
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://splix.ap2c.org/samsung_cms.tar.bz2";
|
||||
sha256 = "1156flics5m9m7a4hdmcc2nphbdyary6dfmbcrmsp9xb7ivsypdl";
|
||||
};
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/share/cups/profiles/samsung
|
||||
cp * $out/share/cups/profiles/samsung/
|
||||
'';
|
||||
};
|
||||
|
||||
in stdenv.mkDerivation rec {
|
||||
pname = "splix-svn";
|
||||
version = "315";
|
||||
|
||||
src = fetchsvn {
|
||||
# We build this from svn, because splix hasn't been in released in several years
|
||||
# although the community has been adding some new printer models.
|
||||
url = "svn://svn.code.sf.net/p/splix/code/splix";
|
||||
rev = version;
|
||||
sha256 = "16wbm4xnz35ca3mw2iggf5f4jaxpyna718ia190ka6y4ah932jxl";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
mv -v *.ppd ppd/
|
||||
substituteInPlace src/pstoqpdl.cpp \
|
||||
--replace "RASTERDIR \"/\" RASTERTOQPDL" "\"$out/lib/cups/filter/rastertoqpdl\"" \
|
||||
--replace "RASTERDIR" "\"${cups-filters}/lib/cups/filter\"" \
|
||||
'';
|
||||
|
||||
makeFlags = [
|
||||
"CUPSFILTER=$(out)/lib/cups/filter"
|
||||
"CUPSPPD=$(out)/share/cups/model"
|
||||
"CUPSPROFILE=${color-profiles}/share/cups/profiles"
|
||||
];
|
||||
|
||||
buildInputs = [ cups zlib jbigkit ];
|
||||
|
||||
meta = with lib; {
|
||||
description = "CUPS drivers for SPL (Samsung Printer Language) printers";
|
||||
homepage = "http://splix.ap2c.org";
|
||||
license = licenses.gpl2;
|
||||
platforms = platforms.linux;
|
||||
maintainers = with maintainers; [ jfrankenau ];
|
||||
};
|
||||
}
|
||||
28
pkgs/misc/cups/drivers/zj-58/default.nix
Normal file
28
pkgs/misc/cups/drivers/zj-58/default.nix
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
{lib, stdenv, fetchFromGitHub, cups}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "cups-zj-58";
|
||||
version = "2018-02-22";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "klirichek";
|
||||
repo = "zj-58";
|
||||
rev = "e4212cd";
|
||||
sha256 = "1w2qkspm4qqg5h8n6gmakzhiww7gag64chvy9kf89xsl3wsyp6pi";
|
||||
};
|
||||
|
||||
buildInputs = [ cups ];
|
||||
|
||||
installPhase = ''
|
||||
install -D rastertozj $out/lib/cups/filter/rastertozj
|
||||
install -D ZJ-58.ppd $out/share/cups/model/zjiang/ZJ-58.ppd
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "CUPS filter for thermal printer Zjiang ZJ-58";
|
||||
homepage = "https://github.com/klirichek/zj-58";
|
||||
platforms = platforms.linux;
|
||||
maintainers = with maintainers; [ makefu ];
|
||||
license = licenses.bsd2;
|
||||
};
|
||||
}
|
||||
108
pkgs/misc/cups/filters.nix
Normal file
108
pkgs/misc/cups/filters.nix
Normal file
|
|
@ -0,0 +1,108 @@
|
|||
{ lib
|
||||
, avahi
|
||||
, bc
|
||||
, coreutils
|
||||
, cups
|
||||
, dbus
|
||||
, dejavu_fonts
|
||||
, fetchurl
|
||||
, fontconfig
|
||||
, gawk
|
||||
, ghostscript
|
||||
, gnugrep
|
||||
, gnused
|
||||
, ijs
|
||||
, libjpeg
|
||||
, liblouis
|
||||
, libpng
|
||||
, makeWrapper
|
||||
, mupdf
|
||||
, perl
|
||||
, pkg-config
|
||||
, poppler
|
||||
, poppler_utils
|
||||
, qpdf
|
||||
, stdenv
|
||||
, which
|
||||
, withAvahi ? true
|
||||
}:
|
||||
|
||||
let
|
||||
binPath = lib.makeBinPath [ bc coreutils gawk gnused gnugrep which ];
|
||||
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "cups-filters";
|
||||
version = "1.28.12";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://openprinting.org/download/cups-filters/${pname}-${version}.tar.xz";
|
||||
sha256 = "sha256-RuLqPYhK0iK7hjzmUR5ZzzkO+Og1KVvkSoDlALKjOjo=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ pkg-config makeWrapper ];
|
||||
|
||||
buildInputs = [
|
||||
cups
|
||||
dbus
|
||||
fontconfig
|
||||
ghostscript
|
||||
ijs
|
||||
libjpeg
|
||||
liblouis # braille embosser support
|
||||
libpng
|
||||
mupdf
|
||||
perl
|
||||
poppler
|
||||
poppler_utils
|
||||
qpdf
|
||||
] ++ lib.optionals withAvahi [ avahi ];
|
||||
|
||||
configureFlags = [
|
||||
"--with-mutool-path=${mupdf}/bin/mutool"
|
||||
"--with-pdftops=pdftops"
|
||||
"--with-pdftops-path=${poppler_utils}/bin/pdftops"
|
||||
"--with-gs-path=${ghostscript}/bin/gs"
|
||||
"--with-pdftocairo-path=${poppler_utils}/bin/pdftocairo"
|
||||
"--with-ippfind-path=${cups}/bin/ippfind"
|
||||
"--enable-imagefilters"
|
||||
"--with-rcdir=no"
|
||||
"--with-shell=${stdenv.shell}"
|
||||
"--with-test-font-path=${dejavu_fonts}/share/fonts/truetype/DejaVuSans.ttf"
|
||||
"--localstatedir=/var"
|
||||
"--sysconfdir=/etc"
|
||||
] ++ lib.optionals (!withAvahi) [ "--disable-avahi" ];
|
||||
|
||||
makeFlags = [ "CUPS_SERVERBIN=$(out)/lib/cups" "CUPS_DATADIR=$(out)/share/cups" "CUPS_SERVERROOT=$(out)/etc/cups" ];
|
||||
|
||||
postConfigure =
|
||||
''
|
||||
# Ensure that bannertopdf can find the PDF templates in
|
||||
# $out. (By default, it assumes that cups and cups-filters are
|
||||
# installed in the same prefix.)
|
||||
substituteInPlace config.h --replace ${cups.out}/share/cups/data $out/share/cups/data
|
||||
|
||||
# Ensure that gstoraster can find gs in $PATH.
|
||||
substituteInPlace filter/gstoraster.c --replace execve execvpe
|
||||
|
||||
# Patch shebangs of generated build scripts
|
||||
patchShebangs filter
|
||||
'';
|
||||
|
||||
postInstall =
|
||||
''
|
||||
for i in $out/lib/cups/filter/*; do
|
||||
wrapProgram "$i" --prefix PATH ':' ${binPath}
|
||||
done
|
||||
'';
|
||||
|
||||
enableParallelBuilding = true;
|
||||
doCheck = true;
|
||||
|
||||
meta = {
|
||||
homepage = "http://www.linuxfoundation.org/collaborate/workgroups/openprinting/cups-filters";
|
||||
description = "Backends, filters, and other software that was once part of the core CUPS distribution but is no longer maintained by Apple Inc";
|
||||
license = lib.licenses.gpl2;
|
||||
platforms = lib.platforms.linux;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue