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:
Anton Arapov 2021-04-03 12:58:10 +02:00 committed by Alan Daniels
commit 56de2bcd43
30691 changed files with 3076956 additions and 0 deletions

View file

@ -0,0 +1,34 @@
{ lib, stdenv, fetchgit, python3, coreutils }:
stdenv.mkDerivation rec {
pname = "acpilight";
version = "1.2";
src = fetchgit {
url = "https://gitlab.com/wavexx/acpilight.git";
rev = "v${version}";
sha256 = "1r0r3nx6x6vkpal6vci0zaa1n9dfacypldf6k8fxg7919vzxdn1w";
};
pyenv = python3.withPackages (pythonPackages: with pythonPackages; [
configargparse
]);
postConfigure = ''
substituteInPlace 90-backlight.rules --replace /bin ${coreutils}/bin
substituteInPlace Makefile --replace udevadm true
'';
buildInputs = [ pyenv ];
makeFlags = [ "DESTDIR=$(out) prefix=" ];
meta = with lib; {
homepage = "https://gitlab.com/wavexx/acpilight";
description = "ACPI backlight control";
license = licenses.gpl3;
maintainers = with maintainers; [ smakarov ];
platforms = platforms.linux;
mainProgram = "xbacklight";
};
}

View file

@ -0,0 +1,46 @@
{ lib
, gcc11Stdenv
, fetchFromGitLab
, makeWrapper
, cmake
, spdlog
, nlohmann_json
, systemd
}:
gcc11Stdenv.mkDerivation rec {
pname = "ananicy-cpp";
version = "unstable-2021-10-13";
src = fetchFromGitLab {
owner = "ananicy-cpp";
repo = "ananicy-cpp";
rev = "6a14fe7353221c89347eddbbcafb35cf5fee4758";
sha256 = "sha256-V0QPXC17ZD2c4MK3DAkzoPgKOU5V5BjfQKUk7I6f8WM=";
};
nativeBuildInputs = [
makeWrapper
cmake
];
buildInputs = [
spdlog
nlohmann_json
systemd
];
cmakeFlags = [
"-DUSE_EXTERNAL_JSON=yON"
"-DUSE_EXTERNAL_SPDLOG=ON"
"-DUSE_EXTERNAL_FMTLIB=ON"
];
meta = with lib; {
homepage = "https://gitlab.com/ananicy-cpp/ananicy-cpp";
description = "Rewrite of ananicy in c++ for lower cpu and memory usage";
license = licenses.gpl3Only;
platforms = platforms.linux;
maintainers = with maintainers; [ artturin ];
};
}

View file

@ -0,0 +1,58 @@
{ lib, stdenv, python3, fetchFromGitHub, makeWrapper, schedtool, sysctl, util-linux, fetchpatch }:
stdenv.mkDerivation rec {
pname = "ananicy";
version = "unstable-2021-11-05";
src = fetchFromGitHub {
owner = "nefelim4ag";
repo = "ananicy";
rev = "b8968e9b32b0e4e6a01dc2314e43de8fee9da691";
sha256 = "sha256-tlPY81xdUpZrDYdApXooZ0Mst0n7ARVHyUrmymqg0rk=";
};
patches = [
# https://github.com/Nefelim4ag/Ananicy/pull/437
# fix makefile destinations
(fetchpatch {
url = "https://github.com/Nefelim4ag/Ananicy/commit/dbda0f50670de3f249991706ef1cc107c5197a2f.patch";
sha256 = "sha256-vMcJxekg2QUbm253CLAv3tmo5kedSlw+/PI/LamNWwc=";
# only used for debian packaging. lets exclude it so the patch applies even when that file is changed
excludes = [ "package.sh" ];
})
# https://github.com/Nefelim4ag/Ananicy/pull/439
# fix syntax error
(fetchpatch {
url = "https://github.com/Nefelim4ag/Ananicy/commit/0f8b809298ccfd88d0e2ab952d6e4131865246da.patch";
sha256 = "sha256-PWE4F0G97gecgc9HnG7ScA78+QVc8u8aF9u74qVChX0=";
})
];
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ python3 ];
makeFlags = [
"PREFIX=$(out)"
"SYSCONFDIR=${placeholder "out"}/etc"
];
dontConfigure = true;
dontBuild = true;
postInstall = ''
wrapProgram $out/bin/ananicy \
--prefix PATH : ${lib.makeBinPath [ schedtool util-linux ]}
substituteInPlace $out/lib/systemd/system/ananicy.service \
--replace "/sbin/sysctl" "${sysctl}/bin/sysctl" \
--replace "/usr/bin/ananicy" "$out/bin/ananicy"
'';
meta = with lib; {
homepage = "https://github.com/Nefelim4ag/Ananicy";
description = "Another auto nice daemon, with community rules support";
license = licenses.gpl3Only;
platforms = platforms.linux;
maintainers = with maintainers; [ artturin ];
};
}

View file

@ -0,0 +1,33 @@
{ lib, stdenv, fetchFromGitHub, alsa-lib, cmake, pkg-config, glib
, tracingSupport ? true, logToStderr ? true }:
let oz = x: if x then "1" else "0"; in
stdenv.mkDerivation rec {
pname = "apulse";
version = "0.1.13";
src = fetchFromGitHub {
owner = "i-rinat";
repo = pname;
rev = "v${version}";
sha256 = "1p6fh6ah5v3qz7dxhcsixx38bxg44ypbim4m03bxk3ls5i9xslmn";
};
nativeBuildInputs = [ cmake pkg-config ];
buildInputs = [ alsa-lib glib ];
cmakeFlags = [
"-DWITH_TRACE=${oz tracingSupport}"
"-DLOG_TO_STDERR=${oz logToStderr}"
];
meta = with lib; {
description = "PulseAudio emulation for ALSA";
homepage = "https://github.com/i-rinat/apulse";
license = licenses.mit;
platforms = platforms.linux;
maintainers = [ maintainers.jagajaga ];
};
}

View file

@ -0,0 +1,82 @@
{ stdenv, apulse, libpulseaudio, pkg-config, intltool }:
stdenv.mkDerivation {
pname = "libpressureaudio";
version = apulse.version;
src = libpulseaudio.src;
nativeBuildInputs = [ pkg-config intltool ];
dontConfigure = true;
dontBuild = true;
installPhase = ''
echo "Copying libraries from apulse."
mkdir -p $out/lib
ls ${apulse}/lib/apulse $out/lib
cp -a ${apulse}/lib/apulse/* $out/lib/
echo "Copying headers from pulseaudio."
mkdir -p $out/include/pulse
cp -a src/pulse/*.h $out/include/pulse
echo "Generating custom pkgconfig definitions."
mkdir -p $out/lib/pkgconfig
for a in libpulse.pc libpulse-simple.pc libpulse-mainloop-glib.pc ; do
cat > $out/lib/pkgconfig/$a << EOF
prefix=$out
libdir=$out/lib
includedir=$out/include
EOF
done
cat >> $out/lib/pkgconfig/libpulse.pc << EOF
Name: libpulse
Description: PulseAudio Client Interface
Version: ${libpulseaudio.version}-rebootstrapped
Libs: -L$out/lib -lpulse
Cflags: -I$out/include -D_REENTRANT
EOF
cat >> $out/lib/pkgconfig/libpulse-simple.pc << EOF
Name: libpulse-simple
Description: PulseAudio Simplified Synchronous Client Interface
Version: ${libpulseaudio.version}-rebootstrapped
Libs: -L$out/lib -lpulse-simple
Cflags: -I$out/include -D_REENTRANT
Requires: libpulse
EOF
cat >> $out/lib/pkgconfig/libpulse-mainloop-glib.pc << EOF
Name: libpulse-mainloop-glib
Description: PulseAudio GLib 2.0 Main Loop Wrapper
Version: ${libpulseaudio.version}-rebootstrapped
Libs: -L$out/lib -lpulse-mainloop-glib
Cflags: -I$out/include -D_REENTRANT
Requires: libpulse glib-2.0
EOF
'';
meta = apulse.meta // {
description = "libpulse without any sound daemons over pure ALSA";
longDescription = ''
apulse (${apulse.meta.homepage}) implements most of libpulse
API over pure ALSA in 5% LOC of the original PulseAudio.
But apulse is made to be used as a wrapper that substitutes its
replacement libs into LD_LIBRARY_PATH. The problem with that is
that you still have to link against the original libpulse.
pressureaudio (http://git.r-36.net/pressureaudio/) wraps apulse
with everything you need to replace libpulse completely.
This derivation is a reimplementation of pressureaudio in pure
nix.
You can simply override libpulse with this and most
packages would just work.
'';
};
}

View file

@ -0,0 +1,146 @@
{ lib, stdenv, fetchFromGitHub, openssl, pkgsCross, buildPackages
# Warning: this blob (hdcp.bin) runs on the main CPU (not the GPU) at
# privilege level EL3, which is above both the kernel and the
# hypervisor.
#
# This parameter applies only to platforms which are believed to use
# hdcp.bin. On all other platforms, or if unfreeIncludeHDCPBlob=false,
# hdcp.bin will be deleted before building.
, unfreeIncludeHDCPBlob ? true
}:
let
buildArmTrustedFirmware = { filesToInstall
, installDir ? "$out"
, platform ? null
, platformCanUseHDCPBlob ? false # set this to true if the platform is able to use hdcp.bin
, extraMakeFlags ? []
, extraMeta ? {}
, version ? "2.6"
, ... } @ args:
# delete hdcp.bin if either: the platform is thought to
# not need it or unfreeIncludeHDCPBlob is false
let deleteHDCPBlobBeforeBuild = !platformCanUseHDCPBlob || !unfreeIncludeHDCPBlob; in
stdenv.mkDerivation ({
pname = "arm-trusted-firmware${lib.optionalString (platform != null) "-${platform}"}";
inherit version;
src = fetchFromGitHub {
owner = "ARM-software";
repo = "arm-trusted-firmware";
rev = "v${version}";
sha256 = "sha256-qT9DdTvMcUrvRzgmVf2qmKB+Rb1WOB4p1rM+fsewGcg=";
};
patches = lib.optionals deleteHDCPBlobBeforeBuild [
# this is a rebased version of https://gitlab.com/vicencb/kevinboot/-/blob/master/atf.patch
./remove-hdcp-blob.patch
];
postPatch = lib.optionalString deleteHDCPBlobBeforeBuild ''
rm plat/rockchip/rk3399/drivers/dp/hdcp.bin
'';
depsBuildBuild = [ buildPackages.stdenv.cc ];
# For Cortex-M0 firmware in RK3399
nativeBuildInputs = [ pkgsCross.arm-embedded.stdenv.cc ];
buildInputs = [ openssl ];
makeFlags = [
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
] ++ (lib.optional (platform != null) "PLAT=${platform}")
++ extraMakeFlags;
installPhase = ''
runHook preInstall
mkdir -p ${installDir}
cp ${lib.concatStringsSep " " filesToInstall} ${installDir}
runHook postInstall
'';
hardeningDisable = [ "all" ];
dontStrip = true;
# Fatal error: can't create build/sun50iw1p1/release/bl31/sunxi_clocks.o: No such file or directory
enableParallelBuilding = false;
meta = with lib; {
homepage = "https://github.com/ARM-software/arm-trusted-firmware";
description = "A reference implementation of secure world software for ARMv8-A";
license = [ licenses.bsd3 ] ++ lib.optionals (!deleteHDCPBlobBeforeBuild) [ licenses.unfreeRedistributable ];
maintainers = with maintainers; [ lopsided98 ];
} // extraMeta;
} // builtins.removeAttrs args [ "extraMeta" ]);
in {
inherit buildArmTrustedFirmware;
armTrustedFirmwareTools = buildArmTrustedFirmware rec {
extraMakeFlags = [
"HOSTCC=${stdenv.cc.targetPrefix}gcc"
"fiptool" "certtool" "sptool"
];
filesToInstall = [
"tools/fiptool/fiptool"
"tools/cert_create/cert_create"
"tools/sptool/sptool"
];
postInstall = ''
mkdir -p "$out/bin"
find "$out" -type f -executable -exec mv -t "$out/bin" {} +
'';
};
armTrustedFirmwareAllwinner = buildArmTrustedFirmware rec {
platform = "sun50i_a64";
extraMeta.platforms = ["aarch64-linux"];
filesToInstall = ["build/${platform}/release/bl31.bin"];
};
armTrustedFirmwareAllwinnerH616 = buildArmTrustedFirmware rec {
platform = "sun50i_h616";
extraMeta.platforms = ["aarch64-linux"];
filesToInstall = ["build/${platform}/release/bl31.bin"];
};
armTrustedFirmwareQemu = buildArmTrustedFirmware rec {
platform = "qemu";
extraMeta.platforms = ["aarch64-linux"];
filesToInstall = [
"build/${platform}/release/bl1.bin"
"build/${platform}/release/bl2.bin"
"build/${platform}/release/bl31.bin"
];
};
armTrustedFirmwareRK3328 = buildArmTrustedFirmware rec {
extraMakeFlags = [ "bl31" ];
platform = "rk3328";
extraMeta.platforms = ["aarch64-linux"];
filesToInstall = [ "build/${platform}/release/bl31/bl31.elf"];
platformCanUseHDCPBlob = true;
};
armTrustedFirmwareRK3399 = buildArmTrustedFirmware rec {
extraMakeFlags = [ "bl31" ];
platform = "rk3399";
extraMeta.platforms = ["aarch64-linux"];
filesToInstall = [ "build/${platform}/release/bl31/bl31.elf"];
platformCanUseHDCPBlob = true;
};
armTrustedFirmwareS905 = buildArmTrustedFirmware rec {
extraMakeFlags = [ "bl31" ];
platform = "gxbb";
extraMeta.platforms = ["aarch64-linux"];
filesToInstall = [ "build/${platform}/release/bl31.bin"];
};
}

View file

@ -0,0 +1,47 @@
diff --git a/plat/rockchip/rk3399/drivers/dp/cdn_dp.c b/plat/rockchip/rk3399/drivers/dp/cdn_dp.c
index a8773f4f6..8e28c4830 100644
--- a/plat/rockchip/rk3399/drivers/dp/cdn_dp.c
+++ b/plat/rockchip/rk3399/drivers/dp/cdn_dp.c
@@ -13,17 +13,6 @@
#include <cdn_dp.h>
-__asm__(
- ".pushsection .text.hdcp_handler, \"ax\", %progbits\n"
- ".global hdcp_handler\n"
- ".balign 4\n"
- "hdcp_handler:\n"
- ".incbin \"" HDCPFW "\"\n"
- ".type hdcp_handler, %function\n"
- ".size hdcp_handler, .- hdcp_handler\n"
- ".popsection\n"
-);
-
static uint64_t *hdcp_key_pdata;
static struct cdn_dp_hdcp_key_1x key;
@@ -38,7 +27,7 @@ uint64_t dp_hdcp_ctrl(uint64_t type)
return 0;
case HDCP_KEY_DATA_START_DECRYPT:
if (hdcp_key_pdata == (uint64_t *)(&key + 1))
- return hdcp_handler(&key);
+ return PSCI_E_DISABLED;
else
return PSCI_E_INVALID_PARAMS;
assert(0); /* Unreachable */
diff --git a/plat/rockchip/rk3399/platform.mk b/plat/rockchip/rk3399/platform.mk
index a658fb286..5edb6a25b 100644
--- a/plat/rockchip/rk3399/platform.mk
+++ b/plat/rockchip/rk3399/platform.mk
@@ -88,11 +88,6 @@ $(eval $(call add_define_val,RK3399M0PMUFW,\"$(RK3399M0PMUFW)\"))
ifdef PLAT_RK_DP_HDCP
BL31_SOURCES += ${RK_PLAT_SOC}/drivers/dp/cdn_dp.c
-HDCPFW=${RK_PLAT_SOC}/drivers/dp/hdcp.bin
-$(eval $(call add_define_val,HDCPFW,\"$(HDCPFW)\"))
-
-${BUILD_PLAT}/bl31/cdn_dp.o: CCACHE_EXTRAFILES=$(HDCPFW)
-${RK_PLAT_SOC}/drivers/dp/cdn_dp.c: $(HDCPFW)
endif
# CCACHE_EXTRAFILES is needed because ccache doesn't handle .incbin

View file

@ -0,0 +1,22 @@
{ lib, rustPlatform, fetchFromGitHub }:
rustPlatform.buildRustPackage rec {
pname = "autoadb";
version = "unstable-2020-06-01";
src = fetchFromGitHub {
owner = "rom1v";
repo = pname;
rev = "7f8402983603a9854bf618a384f679a17cd85e2d";
sha256 = "sha256-9Sv38dCtvbqvxSnRpq+HsIwF/rfLUVZbi0J+mltLres=";
};
cargoSha256 = "1gzg1lhq8gp790mrc8fw8dg146k8lg20pnk45m2ssnmdka0826f7";
meta = with lib; {
description = "Execute a command whenever a device is adb-connected";
homepage = "https://github.com/rom1v/autoadb";
license = licenses.asl20;
maintainers = with maintainers; [ shawn8901 ];
};
}

View file

@ -0,0 +1,25 @@
{ lib, buildPythonApplication, fetchFromGitHub, i3ipc, importlib-metadata }:
buildPythonApplication rec {
pname = "autotiling";
version = "1.6";
src = fetchFromGitHub {
owner = "nwg-piotr";
repo = pname;
rev = "v${version}";
sha256 = "1hjlvg7095s322gb43r9g7mqlsy3pj13l827jpnbn5x0918rq9rr";
};
propagatedBuildInputs = [ i3ipc importlib-metadata ];
doCheck = false;
meta = with lib; {
homepage = "https://github.com/nwg-piotr/autotiling";
description = "Script for sway and i3 to automatically switch the horizontal / vertical window split orientation";
license = licenses.gpl3Plus;
platforms = platforms.linux;
maintainers = with maintainers; [ artturin ];
};
}

View file

@ -0,0 +1,96 @@
{ stdenv
, lib
, fetchurl
, bison
, dtc
, flex
, libusb1
, lzop
, openssl
, pkg-config
, buildPackages
}:
let
buildBarebox = {
filesToInstall
, installDir ? "$out"
, defconfig
, extraMeta ? {}
, ... } @ args: stdenv.mkDerivation rec {
pname = "barebox-${defconfig}";
version = "2020.12.0";
src = fetchurl {
url = "https://www.barebox.org/download/barebox-${version}.tar.bz2";
sha256 = "06vsd95ihaa2nywpqy6k0c7xwk2pzws4yvbp328yd2pfiigachrv";
};
postPatch = ''
patchShebangs scripts
'';
nativeBuildInputs = [
bison
dtc
flex
openssl
libusb1
lzop
pkg-config
];
depsBuildBuild = [ buildPackages.stdenv.cc ];
hardeningDisable = [ "all" ];
makeFlags = [
"DTC=dtc"
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
];
configurePhase = ''
runHook preConfigure
make ${defconfig}
runHook postConfigure
'';
installPhase = ''
runHook preInstall
mkdir -p ${installDir}
cp ${lib.concatStringsSep " " filesToInstall} ${installDir}
runHook postInstall
'';
enableParallelBuilding = true;
dontStrip = true;
meta = with lib; {
homepage = "https://www.barebox.org";
description = "The Swiss Army Knive for bare metal";
license = licenses.gpl2;
maintainers = with maintainers; [ emantor ];
} // extraMeta;
} // removeAttrs args [ "extraMeta" ];
in {
inherit buildBarebox;
bareboxTools = buildBarebox {
defconfig = "hosttools_defconfig";
installDir = "$out/bin";
extraMeta.platforms = lib.platforms.linux;
filesToInstall = [
"scripts/bareboximd"
"scripts/imx/imx-usb-loader"
"scripts/omap4_usbboot"
"scripts/omap3-usb-loader"
"scripts/kwboot"
];
};
}

View file

@ -0,0 +1,8 @@
{ stdenv, pkgs }:
let
nodePackages = import ./node-packages.nix {
inherit pkgs;
inherit (stdenv.hostPlatform) system;
};
in nodePackages.base16-builder

View file

@ -0,0 +1,8 @@
#!/usr/bin/env nix-shell
#! nix-shell -i bash -p nodePackages.node2nix
exec node2nix --nodejs-10 \
--input node-packages.json \
--output node-packages-generated.nix \
--supplement-input supplement.json \
--composition node-packages.nix \
--node-env ./../../development/node-packages/node-env.nix \

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,3 @@
[
"base16-builder"
]

View file

@ -0,0 +1,21 @@
# This file has been generated by node2nix 1.9.0. Do not edit!
{pkgs ? import <nixpkgs> {
inherit system;
}, system ? builtins.currentSystem, nodejs ? pkgs."nodejs-10_x"}:
let
globalBuildInputs = pkgs.lib.attrValues (import ./supplement.nix {
inherit nodeEnv;
inherit (pkgs) stdenv lib nix-gitignore fetchurl fetchgit;
});
nodeEnv = import ../../development/node-packages/node-env.nix {
inherit (pkgs) stdenv lib python2 runCommand writeTextFile writeShellScript;
inherit pkgs nodejs;
libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null;
};
in
import ./node-packages-generated.nix {
inherit (pkgs) fetchurl nix-gitignore stdenv lib fetchgit;
inherit nodeEnv globalBuildInputs;
}

View file

@ -0,0 +1,3 @@
[
"node-pre-gyp"
]

View file

@ -0,0 +1,680 @@
# This file has been generated by node2nix 1.9.0. Do not edit!
{nodeEnv, fetchurl, fetchgit, nix-gitignore, stdenv, lib, globalBuildInputs ? []}:
let
sources = {
"abbrev-1.1.1" = {
name = "abbrev";
packageName = "abbrev";
version = "1.1.1";
src = fetchurl {
url = "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz";
sha512 = "nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==";
};
};
"ansi-regex-2.1.1" = {
name = "ansi-regex";
packageName = "ansi-regex";
version = "2.1.1";
src = fetchurl {
url = "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz";
sha1 = "c3b33ab5ee360d86e0e628f0468ae7ef27d654df";
};
};
"aproba-1.2.0" = {
name = "aproba";
packageName = "aproba";
version = "1.2.0";
src = fetchurl {
url = "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz";
sha512 = "Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==";
};
};
"are-we-there-yet-1.1.5" = {
name = "are-we-there-yet";
packageName = "are-we-there-yet";
version = "1.1.5";
src = fetchurl {
url = "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz";
sha512 = "5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==";
};
};
"balanced-match-1.0.0" = {
name = "balanced-match";
packageName = "balanced-match";
version = "1.0.0";
src = fetchurl {
url = "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz";
sha1 = "89b4d199ab2bee49de164ea02b89ce462d71b767";
};
};
"brace-expansion-1.1.11" = {
name = "brace-expansion";
packageName = "brace-expansion";
version = "1.1.11";
src = fetchurl {
url = "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz";
sha512 = "iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==";
};
};
"chownr-1.1.4" = {
name = "chownr";
packageName = "chownr";
version = "1.1.4";
src = fetchurl {
url = "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz";
sha512 = "jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==";
};
};
"code-point-at-1.1.0" = {
name = "code-point-at";
packageName = "code-point-at";
version = "1.1.0";
src = fetchurl {
url = "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz";
sha1 = "0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77";
};
};
"concat-map-0.0.1" = {
name = "concat-map";
packageName = "concat-map";
version = "0.0.1";
src = fetchurl {
url = "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz";
sha1 = "d8a96bd77fd68df7793a73036a3ba0d5405d477b";
};
};
"console-control-strings-1.1.0" = {
name = "console-control-strings";
packageName = "console-control-strings";
version = "1.1.0";
src = fetchurl {
url = "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz";
sha1 = "3d7cf4464db6446ea644bf4b39507f9851008e8e";
};
};
"core-util-is-1.0.2" = {
name = "core-util-is";
packageName = "core-util-is";
version = "1.0.2";
src = fetchurl {
url = "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz";
sha1 = "b5fd54220aa2bc5ab57aab7140c940754503c1a7";
};
};
"debug-3.2.7" = {
name = "debug";
packageName = "debug";
version = "3.2.7";
src = fetchurl {
url = "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz";
sha512 = "CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==";
};
};
"deep-extend-0.6.0" = {
name = "deep-extend";
packageName = "deep-extend";
version = "0.6.0";
src = fetchurl {
url = "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz";
sha512 = "LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==";
};
};
"delegates-1.0.0" = {
name = "delegates";
packageName = "delegates";
version = "1.0.0";
src = fetchurl {
url = "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz";
sha1 = "84c6e159b81904fdca59a0ef44cd870d31250f9a";
};
};
"detect-libc-1.0.3" = {
name = "detect-libc";
packageName = "detect-libc";
version = "1.0.3";
src = fetchurl {
url = "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz";
sha1 = "fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b";
};
};
"fs-minipass-1.2.7" = {
name = "fs-minipass";
packageName = "fs-minipass";
version = "1.2.7";
src = fetchurl {
url = "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz";
sha512 = "GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==";
};
};
"fs.realpath-1.0.0" = {
name = "fs.realpath";
packageName = "fs.realpath";
version = "1.0.0";
src = fetchurl {
url = "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz";
sha1 = "1504ad2523158caa40db4a2787cb01411994ea4f";
};
};
"gauge-2.7.4" = {
name = "gauge";
packageName = "gauge";
version = "2.7.4";
src = fetchurl {
url = "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz";
sha1 = "2c03405c7538c39d7eb37b317022e325fb018bf7";
};
};
"glob-7.1.6" = {
name = "glob";
packageName = "glob";
version = "7.1.6";
src = fetchurl {
url = "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz";
sha512 = "LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==";
};
};
"has-unicode-2.0.1" = {
name = "has-unicode";
packageName = "has-unicode";
version = "2.0.1";
src = fetchurl {
url = "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz";
sha1 = "e0e6fe6a28cf51138855e086d1691e771de2a8b9";
};
};
"iconv-lite-0.4.24" = {
name = "iconv-lite";
packageName = "iconv-lite";
version = "0.4.24";
src = fetchurl {
url = "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz";
sha512 = "v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==";
};
};
"ignore-walk-3.0.3" = {
name = "ignore-walk";
packageName = "ignore-walk";
version = "3.0.3";
src = fetchurl {
url = "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.3.tgz";
sha512 = "m7o6xuOaT1aqheYHKf8W6J5pYH85ZI9w077erOzLje3JsB1gkafkAhHHY19dqjulgIZHFm32Cp5uNZgcQqdJKw==";
};
};
"inflight-1.0.6" = {
name = "inflight";
packageName = "inflight";
version = "1.0.6";
src = fetchurl {
url = "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz";
sha1 = "49bd6331d7d02d0c09bc910a1075ba8165b56df9";
};
};
"inherits-2.0.4" = {
name = "inherits";
packageName = "inherits";
version = "2.0.4";
src = fetchurl {
url = "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz";
sha512 = "k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==";
};
};
"ini-1.3.8" = {
name = "ini";
packageName = "ini";
version = "1.3.8";
src = fetchurl {
url = "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz";
sha512 = "JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==";
};
};
"is-fullwidth-code-point-1.0.0" = {
name = "is-fullwidth-code-point";
packageName = "is-fullwidth-code-point";
version = "1.0.0";
src = fetchurl {
url = "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz";
sha1 = "ef9e31386f031a7f0d643af82fde50c457ef00cb";
};
};
"isarray-1.0.0" = {
name = "isarray";
packageName = "isarray";
version = "1.0.0";
src = fetchurl {
url = "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz";
sha1 = "bb935d48582cba168c06834957a54a3e07124f11";
};
};
"minimatch-3.0.4" = {
name = "minimatch";
packageName = "minimatch";
version = "3.0.4";
src = fetchurl {
url = "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz";
sha512 = "yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==";
};
};
"minimist-1.2.5" = {
name = "minimist";
packageName = "minimist";
version = "1.2.5";
src = fetchurl {
url = "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz";
sha512 = "FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==";
};
};
"minipass-2.9.0" = {
name = "minipass";
packageName = "minipass";
version = "2.9.0";
src = fetchurl {
url = "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz";
sha512 = "wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==";
};
};
"minizlib-1.3.3" = {
name = "minizlib";
packageName = "minizlib";
version = "1.3.3";
src = fetchurl {
url = "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz";
sha512 = "6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==";
};
};
"mkdirp-0.5.5" = {
name = "mkdirp";
packageName = "mkdirp";
version = "0.5.5";
src = fetchurl {
url = "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz";
sha512 = "NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==";
};
};
"ms-2.1.3" = {
name = "ms";
packageName = "ms";
version = "2.1.3";
src = fetchurl {
url = "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz";
sha512 = "6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==";
};
};
"needle-2.6.0" = {
name = "needle";
packageName = "needle";
version = "2.6.0";
src = fetchurl {
url = "https://registry.npmjs.org/needle/-/needle-2.6.0.tgz";
sha512 = "KKYdza4heMsEfSWD7VPUIz3zX2XDwOyX2d+geb4vrERZMT5RMU6ujjaD+I5Yr54uZxQ2w6XRTAhHBbSCyovZBg==";
};
};
"nopt-4.0.3" = {
name = "nopt";
packageName = "nopt";
version = "4.0.3";
src = fetchurl {
url = "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz";
sha512 = "CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==";
};
};
"npm-bundled-1.1.1" = {
name = "npm-bundled";
packageName = "npm-bundled";
version = "1.1.1";
src = fetchurl {
url = "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.1.tgz";
sha512 = "gqkfgGePhTpAEgUsGEgcq1rqPXA+tv/aVBlgEzfXwA1yiUJF7xtEt3CtVwOjNYQOVknDk0F20w58Fnm3EtG0fA==";
};
};
"npm-normalize-package-bin-1.0.1" = {
name = "npm-normalize-package-bin";
packageName = "npm-normalize-package-bin";
version = "1.0.1";
src = fetchurl {
url = "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz";
sha512 = "EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==";
};
};
"npm-packlist-1.4.8" = {
name = "npm-packlist";
packageName = "npm-packlist";
version = "1.4.8";
src = fetchurl {
url = "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.8.tgz";
sha512 = "5+AZgwru5IevF5ZdnFglB5wNlHG1AOOuw28WhUq8/8emhBmLv6jX5by4WJCh7lW0uSYZYS6DXqIsyZVIXRZU9A==";
};
};
"npmlog-4.1.2" = {
name = "npmlog";
packageName = "npmlog";
version = "4.1.2";
src = fetchurl {
url = "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz";
sha512 = "2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==";
};
};
"number-is-nan-1.0.1" = {
name = "number-is-nan";
packageName = "number-is-nan";
version = "1.0.1";
src = fetchurl {
url = "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz";
sha1 = "097b602b53422a522c1afb8790318336941a011d";
};
};
"object-assign-4.1.1" = {
name = "object-assign";
packageName = "object-assign";
version = "4.1.1";
src = fetchurl {
url = "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz";
sha1 = "2109adc7965887cfc05cbbd442cac8bfbb360863";
};
};
"once-1.4.0" = {
name = "once";
packageName = "once";
version = "1.4.0";
src = fetchurl {
url = "https://registry.npmjs.org/once/-/once-1.4.0.tgz";
sha1 = "583b1aa775961d4b113ac17d9c50baef9dd76bd1";
};
};
"os-homedir-1.0.2" = {
name = "os-homedir";
packageName = "os-homedir";
version = "1.0.2";
src = fetchurl {
url = "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz";
sha1 = "ffbc4988336e0e833de0c168c7ef152121aa7fb3";
};
};
"os-tmpdir-1.0.2" = {
name = "os-tmpdir";
packageName = "os-tmpdir";
version = "1.0.2";
src = fetchurl {
url = "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz";
sha1 = "bbe67406c79aa85c5cfec766fe5734555dfa1274";
};
};
"osenv-0.1.5" = {
name = "osenv";
packageName = "osenv";
version = "0.1.5";
src = fetchurl {
url = "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz";
sha512 = "0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==";
};
};
"path-is-absolute-1.0.1" = {
name = "path-is-absolute";
packageName = "path-is-absolute";
version = "1.0.1";
src = fetchurl {
url = "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz";
sha1 = "174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f";
};
};
"process-nextick-args-2.0.1" = {
name = "process-nextick-args";
packageName = "process-nextick-args";
version = "2.0.1";
src = fetchurl {
url = "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz";
sha512 = "3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==";
};
};
"rc-1.2.8" = {
name = "rc";
packageName = "rc";
version = "1.2.8";
src = fetchurl {
url = "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz";
sha512 = "y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==";
};
};
"readable-stream-2.3.7" = {
name = "readable-stream";
packageName = "readable-stream";
version = "2.3.7";
src = fetchurl {
url = "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz";
sha512 = "Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==";
};
};
"rimraf-2.7.1" = {
name = "rimraf";
packageName = "rimraf";
version = "2.7.1";
src = fetchurl {
url = "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz";
sha512 = "uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==";
};
};
"safe-buffer-5.1.2" = {
name = "safe-buffer";
packageName = "safe-buffer";
version = "5.1.2";
src = fetchurl {
url = "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz";
sha512 = "Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==";
};
};
"safer-buffer-2.1.2" = {
name = "safer-buffer";
packageName = "safer-buffer";
version = "2.1.2";
src = fetchurl {
url = "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz";
sha512 = "YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==";
};
};
"sax-1.2.4" = {
name = "sax";
packageName = "sax";
version = "1.2.4";
src = fetchurl {
url = "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz";
sha512 = "NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==";
};
};
"semver-5.7.1" = {
name = "semver";
packageName = "semver";
version = "5.7.1";
src = fetchurl {
url = "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz";
sha512 = "sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==";
};
};
"set-blocking-2.0.0" = {
name = "set-blocking";
packageName = "set-blocking";
version = "2.0.0";
src = fetchurl {
url = "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz";
sha1 = "045f9782d011ae9a6803ddd382b24392b3d890f7";
};
};
"signal-exit-3.0.3" = {
name = "signal-exit";
packageName = "signal-exit";
version = "3.0.3";
src = fetchurl {
url = "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz";
sha512 = "VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==";
};
};
"string-width-1.0.2" = {
name = "string-width";
packageName = "string-width";
version = "1.0.2";
src = fetchurl {
url = "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz";
sha1 = "118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3";
};
};
"string_decoder-1.1.1" = {
name = "string_decoder";
packageName = "string_decoder";
version = "1.1.1";
src = fetchurl {
url = "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz";
sha512 = "n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==";
};
};
"strip-ansi-3.0.1" = {
name = "strip-ansi";
packageName = "strip-ansi";
version = "3.0.1";
src = fetchurl {
url = "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz";
sha1 = "6a385fb8853d952d5ff05d0e8aaf94278dc63dcf";
};
};
"strip-json-comments-2.0.1" = {
name = "strip-json-comments";
packageName = "strip-json-comments";
version = "2.0.1";
src = fetchurl {
url = "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz";
sha1 = "3c531942e908c2697c0ec344858c286c7ca0a60a";
};
};
"tar-4.4.13" = {
name = "tar";
packageName = "tar";
version = "4.4.13";
src = fetchurl {
url = "https://registry.npmjs.org/tar/-/tar-4.4.13.tgz";
sha512 = "w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==";
};
};
"util-deprecate-1.0.2" = {
name = "util-deprecate";
packageName = "util-deprecate";
version = "1.0.2";
src = fetchurl {
url = "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz";
sha1 = "450d4dc9fa70de732762fbd2d4a28981419a0ccf";
};
};
"wide-align-1.1.3" = {
name = "wide-align";
packageName = "wide-align";
version = "1.1.3";
src = fetchurl {
url = "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz";
sha512 = "QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==";
};
};
"wrappy-1.0.2" = {
name = "wrappy";
packageName = "wrappy";
version = "1.0.2";
src = fetchurl {
url = "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz";
sha1 = "b5243d8f3ec1aa35f1364605bc0d1036e30ab69f";
};
};
"yallist-3.1.1" = {
name = "yallist";
packageName = "yallist";
version = "3.1.1";
src = fetchurl {
url = "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz";
sha512 = "a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==";
};
};
};
in
{
node-pre-gyp = nodeEnv.buildNodePackage {
name = "node-pre-gyp";
packageName = "node-pre-gyp";
version = "0.17.0";
src = fetchurl {
url = "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.17.0.tgz";
sha512 = "abzZt1hmOjkZez29ppg+5gGqdPLUuJeAEwVPtHYEJgx0qzttCbcKFpxrCQn2HYbwCv2c+7JwH4BgEzFkUGpn4A==";
};
dependencies = [
sources."abbrev-1.1.1"
sources."ansi-regex-2.1.1"
sources."aproba-1.2.0"
sources."are-we-there-yet-1.1.5"
sources."balanced-match-1.0.0"
sources."brace-expansion-1.1.11"
sources."chownr-1.1.4"
sources."code-point-at-1.1.0"
sources."concat-map-0.0.1"
sources."console-control-strings-1.1.0"
sources."core-util-is-1.0.2"
sources."debug-3.2.7"
sources."deep-extend-0.6.0"
sources."delegates-1.0.0"
sources."detect-libc-1.0.3"
sources."fs-minipass-1.2.7"
sources."fs.realpath-1.0.0"
sources."gauge-2.7.4"
sources."glob-7.1.6"
sources."has-unicode-2.0.1"
sources."iconv-lite-0.4.24"
sources."ignore-walk-3.0.3"
sources."inflight-1.0.6"
sources."inherits-2.0.4"
sources."ini-1.3.8"
sources."is-fullwidth-code-point-1.0.0"
sources."isarray-1.0.0"
sources."minimatch-3.0.4"
sources."minimist-1.2.5"
sources."minipass-2.9.0"
sources."minizlib-1.3.3"
sources."mkdirp-0.5.5"
sources."ms-2.1.3"
sources."needle-2.6.0"
sources."nopt-4.0.3"
sources."npm-bundled-1.1.1"
sources."npm-normalize-package-bin-1.0.1"
sources."npm-packlist-1.4.8"
sources."npmlog-4.1.2"
sources."number-is-nan-1.0.1"
sources."object-assign-4.1.1"
sources."once-1.4.0"
sources."os-homedir-1.0.2"
sources."os-tmpdir-1.0.2"
sources."osenv-0.1.5"
sources."path-is-absolute-1.0.1"
sources."process-nextick-args-2.0.1"
sources."rc-1.2.8"
sources."readable-stream-2.3.7"
sources."rimraf-2.7.1"
sources."safe-buffer-5.1.2"
sources."safer-buffer-2.1.2"
sources."sax-1.2.4"
sources."semver-5.7.1"
sources."set-blocking-2.0.0"
sources."signal-exit-3.0.3"
sources."string-width-1.0.2"
sources."string_decoder-1.1.1"
sources."strip-ansi-3.0.1"
sources."strip-json-comments-2.0.1"
sources."tar-4.4.13"
sources."util-deprecate-1.0.2"
sources."wide-align-1.1.3"
sources."wrappy-1.0.2"
sources."yallist-3.1.1"
];
buildInputs = globalBuildInputs;
meta = {
description = "Node.js native addon binary install tool";
homepage = "https://github.com/mapbox/node-pre-gyp#readme";
license = "BSD-3-Clause";
};
production = true;
bypassCache = true;
reconstructLock = true;
};
}

View file

@ -0,0 +1,23 @@
{ lib, python3Packages }:
python3Packages.buildPythonApplication rec {
pname = "base16-shell-preview";
version = "1.0.0";
src = python3Packages.fetchPypi {
inherit version;
pname = "base16_shell_preview";
sha256 = "098f3z81g3acgcrisipz0nh17n9kx7ld6h8dg26qz3nx31pngsxd";
};
# No tests
# If enabled, will attempt to run '__init__.py, and will fail with "/homeless-shelter" as HOME
doCheck = false;
meta = with lib; {
description = "Browse and preview Base16 Shell themes in your terminal";
homepage = "https://github.com/nvllsvm/base16-shell-preview";
license = licenses.mit;
maintainers = [ maintainers.rencire ];
};
}

View file

@ -0,0 +1,25 @@
{ lib, stdenv, fetchFromGitHub }:
# this package is working only as root
# in order to work as a non privileged user you would need to suid the bin
stdenv.mkDerivation rec {
pname = "beep";
version = "1.4.12";
src = fetchFromGitHub {
owner = "spkr-beep";
repo = "beep";
rev = "v${version}";
sha256 = "sha256-gDgGI9F+wW2cN89IwP93PkMv6vixJA2JckF78nxZ+TU=";
};
makeFlags = [ "prefix=${placeholder "out"}"];
meta = with lib; {
description = "The advanced PC speaker beeper";
homepage = "https://github.com/spkr-beep/beep";
license = licenses.gpl2Only;
platforms = platforms.linux;
};
}

View file

@ -0,0 +1,27 @@
{ lib, stdenv, fetchFromGitHub, pkg-config, systemd }:
stdenv.mkDerivation rec {
pname = "brightnessctl";
version = "0.5.1";
src = fetchFromGitHub {
owner = "Hummer12007";
repo = "brightnessctl";
rev = version;
sha256 = "0immxc7almmpg80n3bdn834p3nrrz7bspl2syhb04s3lawa5y2lq";
};
makeFlags = [ "PREFIX=" "DESTDIR=$(out)" "ENABLE_SYSTEMD=1" ];
nativeBuildInputs = [ pkg-config ];
buildInputs = [ systemd ];
meta = with lib; {
homepage = "https://github.com/Hummer12007/brightnessctl";
description = "This program allows you read and control device brightness";
license = licenses.mit;
maintainers = with maintainers; [ megheaiulian ];
platforms = platforms.linux;
};
}

View file

@ -0,0 +1,34 @@
{ mkDerivation, lib, stdenv, fetchFromGitHub, qmake, qttools, qtbase }:
mkDerivation rec {
pname = "calaos_installer";
version = "3.5";
src = fetchFromGitHub {
owner = "calaos";
repo = "calaos_installer";
rev = "v${version}";
sha256 = "hx7XVF2iueKFR67U0EvSK1vYZnJBnuOpUOkSjx7h1XY=";
};
nativeBuildInputs = [ qmake qttools ];
buildInputs = [ qtbase ];
qmakeFlags = [ "REVISION=${version}" ];
installPhase = if stdenv.isDarwin then ''
mkdir -p $out/Applications
cp -a calaos_installer.app $out/Applications
'' else ''
mkdir -p $out/bin
cp -a calaos_installer $out/bin
'';
meta = with lib; {
description = "Calaos Installer, a tool to create calaos configuration";
homepage = "https://www.calaos.fr/";
license = licenses.gpl3Plus;
platforms = platforms.all;
maintainers = with maintainers; [ tiramiseb ];
};
}

View file

@ -0,0 +1,21 @@
{ lib, buildPythonApplication, fetchPypi, isPy3k, blessings, docopt }:
buildPythonApplication rec {
pname = "cbeams";
version = "1.0.3";
disabled = !isPy3k;
src = fetchPypi {
inherit pname version;
sha256 = "1agcjg6kmcyvk834xd2j60mi349qi9iw3dc2vwpd7pqwq1daq3gi";
};
propagatedBuildInputs = [ blessings docopt ];
meta = with lib; {
homepage = "https://github.com/tartley/cbeams";
description = "Command-line program to draw animated colored circles in the terminal";
license = licenses.bsd3;
maintainers = with maintainers; [ oxzi ];
};
}

View file

@ -0,0 +1,27 @@
{ lib, stdenv, rustPlatform, openssl, pkg-config, fetchFromGitHub, Security }:
rustPlatform.buildRustPackage rec {
pname = "cliscord";
version = "unstable-2020-12-08";
src = fetchFromGitHub {
owner = "somebody1234";
repo = pname;
rev = "b02fbe5516fd7f153d0b0e3c7d5d11e2ab651b43";
sha256 = "sha256-hzZozgOkw8kFppuHiX9TQxHhxKRv8utWWbhEOIzKDLo=";
};
buildInputs = [ openssl ] ++ lib.optional stdenv.isDarwin Security;
nativeBuildInputs = [ pkg-config ];
cargoSha256 = "12zfwdssyv0j83bff6s4376d99pv7z8ya8q8adwmf5ayvgmj4xz4";
meta = with lib; {
description = "Simple command-line tool to send text and files to discord";
homepage = "https://github.com/somebody1234/cliscord";
license = licenses.mit;
maintainers = with maintainers; [ lom ];
mainProgram = "cliscord";
};
}

View 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)

View 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
View 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;
};
}

View 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 ];
};
}

View 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 ];
};
}

View 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 ];
};
}

View 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 ];
};
};
}

View 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 ];
};
};
}

View 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
];
};
}

View 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
];
};
}

View 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 ];
};
}

View 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 ];
};
}

View file

@ -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;

View file

@ -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>

View 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 ];
};
}

View file

@ -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);
}
}

View file

@ -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);
}
}

View file

@ -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"

View file

@ -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

View file

@ -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>

View file

@ -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>

View 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;
};
}

View 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.
'';
};
}

View 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 ];
};
}

View 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

View 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 ];
};
}

View 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;
};
}

View 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";
};
}

View 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";
};
}

View 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";
};
}

View 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 ];
};
}

View 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 ];
};
}

View 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 ];
};
}

View file

@ -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;
};
}

View file

@ -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;
};
}

View 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;
};
}

View 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;
};
}

View 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 ];
};
}

View 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" ];
};
}

View 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 ];
};
}

View 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 ];
};
}

View 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 ];
};
}

View 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;
};
}

View 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;
};
}

View 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" ];
};
}

View 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 ];
};
}

View 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 ];
};
}

View 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 ];
};
}

View 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 ];
};
}

View 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 ];
};
}

View 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 ];
};
}

View 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" ];
};
}

View 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 ];
};
}

View 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";
};
};
}

View 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;
};
}

View 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

View 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 ];
};
}

View 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 ];
};
}

View 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
View 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;
};
}

View file

@ -0,0 +1,24 @@
Copyright (c) 2006, Ivan Sagalaev
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of highlight.js nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View file

@ -0,0 +1,152 @@
This file was generated with pkgs/misc/documentation-highlighter/update.sh
# Highlight.js
[![Build Status](https://travis-ci.org/isagalaev/highlight.js.svg?branch=master)](https://travis-ci.org/isagalaev/highlight.js)
Highlight.js is a syntax highlighter written in JavaScript. It works in
the browser as well as on the server. It works with pretty much any
markup, doesnt depend on any framework and has automatic language
detection.
## Getting Started
The bare minimum for using highlight.js on a web page is linking to the
library along with one of the styles and calling
[`initHighlightingOnLoad`][1]:
```html
<link rel="stylesheet" href="/path/to/styles/default.css">
<script src="/path/to/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
```
This will find and highlight code inside of `<pre><code>` tags; it tries
to detect the language automatically. If automatic detection doesnt
work for you, you can specify the language in the `class` attribute:
```html
<pre><code class="html">...</code></pre>
```
The list of supported language classes is available in the [class
reference][2]. Classes can also be prefixed with either `language-` or
`lang-`.
To disable highlighting altogether use the `nohighlight` class:
```html
<pre><code class="nohighlight">...</code></pre>
```
## Custom Initialization
When you need a bit more control over the initialization of
highlight.js, you can use the [`highlightBlock`][3] and [`configure`][4]
functions. This allows you to control *what* to highlight and *when*.
Heres an equivalent way to calling [`initHighlightingOnLoad`][1] using
jQuery:
```javascript
$(document).ready(function() {
$('pre code').each(function(i, block) {
hljs.highlightBlock(block);
});
});
```
You can use any tags instead of `<pre><code>` to mark up your code. If
you don't use a container that preserve line breaks you will need to
configure highlight.js to use the `<br>` tag:
```javascript
hljs.configure({useBR: true});
$('div.code').each(function(i, block) {
hljs.highlightBlock(block);
});
```
For other options refer to the documentation for [`configure`][4].
## Web Workers
You can run highlighting inside a web worker to avoid freezing the browser
window while dealing with very big chunks of code.
In your main script:
```javascript
addEventListener('load', function() {
var code = document.querySelector('#code');
var worker = new Worker('worker.js');
worker.onmessage = function(event) { code.innerHTML = event.data; }
worker.postMessage(code.textContent);
})
```
In worker.js:
```javascript
onmessage = function(event) {
importScripts('<path>/highlight.pack.js');
var result = self.hljs.highlightAuto(event.data);
postMessage(result.value);
}
```
## Getting the Library
You can get highlight.js as a hosted, or custom-build, browser script or
as a server module. Right out of the box the browser script supports
both AMD and CommonJS, so if you wish you can use RequireJS or
Browserify without having to build from source. The server module also
works perfectly fine with Browserify, but there is the option to use a
build specific to browsers rather than something meant for a server.
Head over to the [download page][5] for all the options.
**Don't link to GitHub directly.** The library is not supposed to work straight
from the source, it requires building. If none of the pre-packaged options
work for you refer to the [building documentation][6].
**The CDN-hosted package doesn't have all the languages.** Otherwise it'd be
too big. If you don't see the language you need in the ["Common" section][5],
it can be added manually:
```html
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.4.0/languages/go.min.js"></script>
```
**On Almond.** You need to use the optimizer to give the module a name. For
example:
```
r.js -o name=hljs paths.hljs=/path/to/highlight out=highlight.js
```
## License
Highlight.js is released under the BSD License. See [LICENSE][7] file
for details.
## Links
The official site for the library is at <https://highlightjs.org/>.
Further in-depth documentation for the API and other topics is at
<http://highlightjs.readthedocs.io/>.
Authors and contributors are listed in the [AUTHORS.en.txt][8] file.
[1]: http://highlightjs.readthedocs.io/en/latest/api.html#inithighlightingonload
[2]: http://highlightjs.readthedocs.io/en/latest/css-classes-reference.html
[3]: http://highlightjs.readthedocs.io/en/latest/api.html#highlightblock-block
[4]: http://highlightjs.readthedocs.io/en/latest/api.html#configure-options
[5]: https://highlightjs.org/download/
[6]: http://highlightjs.readthedocs.io/en/latest/building-testing.html
[7]: https://github.com/isagalaev/highlight.js/blob/master/LICENSE
[8]: https://github.com/isagalaev/highlight.js/blob/master/AUTHORS.en.txt

View file

@ -0,0 +1,12 @@
{ lib, runCommand }:
runCommand "documentation-highlighter" {
meta = {
description = "Highlight.js sources for the Nix Ecosystem's documentation";
homepage = "https://highlightjs.org";
license = lib.licenses.bsd3;
platforms = lib.platforms.all;
maintainers = [ lib.maintainers.grahamc ];
};
} ''
cp -r ${./.} $out
''

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,7 @@
/* This file is NOT part of highlight.js */
document.onreadystatechange = function () {
var listings = document.querySelectorAll('.programlisting, .screen');
for (i = 0; i < listings.length; ++i) {
hljs.highlightBlock(listings[i]);
}
}

View file

@ -0,0 +1,59 @@
/*
Five-color theme from a single blue hue.
*/
.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
background: #eaeef3;
}
.hljs {
color: #00193a;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-title,
.hljs-section,
.hljs-doctag,
.hljs-name,
.hljs-strong {
font-weight: bold;
}
.hljs-comment {
color: #738191;
}
.hljs-string,
.hljs-title,
.hljs-section,
.hljs-built_in,
.hljs-literal,
.hljs-type,
.hljs-addition,
.hljs-tag,
.hljs-quote,
.hljs-name,
.hljs-selector-id,
.hljs-selector-class {
color: #0048ab;
}
.hljs-meta,
.hljs-subst,
.hljs-symbol,
.hljs-regexp,
.hljs-attribute,
.hljs-deletion,
.hljs-variable,
.hljs-template-variable,
.hljs-link,
.hljs-bullet {
color: #4c81c9;
}
.hljs-emphasis {
font-style: italic;
}

View file

@ -0,0 +1,42 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl -p unzip
set -eu
set -o pipefail
root=$(pwd)
if [ ! -f "./update.sh" ]; then
echo "Please run this script from within pkgs/misc/documentation-highlighter/!"
exit 1
fi
scratch=$(mktemp -d -t tmp.XXXXXXXXXX)
function finish {
rm -rf "$scratch"
}
trap finish EXIT
mkdir $scratch/src
cd $scratch/src
token=$(curl https://highlightjs.org/download/ -c "$scratch/jar" \
| grep csrf \
| cut -d"'" -f6)
curl --header "Referer: https://highlightjs.org/download/"\
-b "$scratch/jar" \
--data "csrfmiddlewaretoken=$token&nix.js=on&bash.js=on" \
https://highlightjs.org/download/ > $scratch/out.zip
unzip "$scratch/out.zip"
out="$root/"
mkdir -p "$out"
cp ./{highlight.pack.js,LICENSE,styles/mono-blue.css} "$out"
(
echo "This file was generated with pkgs/misc/documentation-highlighter/update.sh"
echo ""
cat README.md
) > "$out/README.md"

View file

@ -0,0 +1,18 @@
{ lib, python3Packages }:
python3Packages.buildPythonPackage rec {
pname = "doge";
version = "3.5.0";
src = python3Packages.fetchPypi {
inherit pname version;
sha256 = "0lwdl06lbpnaqqjk8ap9dsags3bzma30z17v0zc7spng1gz8m6xj";
};
meta = with lib; {
homepage = "https://github.com/thiderman/doge";
description = "wow very terminal doge";
license = licenses.mit;
maintainers = with maintainers; [ Gonzih ];
};
}

View file

@ -0,0 +1,48 @@
{ lib, stdenv, fetchFromGitLab, dtc, installShellFiles }:
stdenv.mkDerivation rec {
pname = "argononed";
version = "unstable-2022-03-26";
src = fetchFromGitLab {
owner = "DarkElvenAngel";
repo = pname;
rev = "97c4fa07fc2c09ffc3bd86e0f6319d50fa639578";
sha256 = "sha256-5/xUYbprRiwD+FN8V2cUpHxnTbBkEsFG2wfsEXrCrgQ=";
};
patches = [ ./fix-hardcoded-reboot-poweroff-paths.patch ];
postPatch = ''
patchShebangs configure
'';
nativeBuildInputs = [ installShellFiles ];
buildInputs = [ dtc ];
installPhase = ''
runHook preInstall
install -Dm755 build/argononed $out/bin/argononed
install -Dm755 build/argonone-cli $out/bin/argonone-cli
install -Dm755 build/argonone-shutdown $out/lib/systemd/system-shutdown/argonone-shutdown
install -Dm644 build/argonone.dtbo $out/boot/overlays/argonone.dtbo
install -Dm644 OS/_common/argononed.service $out/lib/systemd/system/argononed.service
install -Dm644 OS/_common/argononed.logrotate $out/etc/logrotate.d/argononed
install -Dm644 LICENSE $out/share/argononed/LICENSE
installShellCompletion --bash --name argonone-cli OS/_common/argonone-cli-complete.bash
runHook postInstall
'';
meta = with lib; {
homepage = "https://gitlab.com/DarkElvenAngel/argononed";
description = "A replacement daemon for the Argon One Raspberry Pi case";
license = licenses.mit;
platforms = platforms.linux;
maintainers = [ maintainers.misterio77 ];
};
}

View file

@ -0,0 +1,18 @@
--- a/src/argononed.c
+++ b/src/argononed.c
@@ -783,13 +783,13 @@
{
log_message(LOG_DEBUG, "EXEC REBOOT");
sync();
- system("/sbin/reboot");
+ system("/run/current-system/sw/bin/reboot");
}
if (count >= 39 && count <= 41)
{
log_message(LOG_DEBUG, "EXEC SHUTDOWN");
sync();
- system("/sbin/poweroff");
+ system("/run/current-system/sw/bin/poweroff");
}
#else
log_message(LOG_INFO,"Daemon Ready");

View file

@ -0,0 +1,13 @@
{ runCommand, fetchurl, rpm, cpio }: let
version = "1.3-1";
src = fetchurl {
url = "http://downloads.dell.com/printer/Dell-5130cdn-Color-Laser-${version}.noarch.rpm";
sha256 = "0pj32sj6jcdnpa5v75af0hnvx4z0ky0m1k2522cfdx4cb1r2lna9";
};
in runCommand "Dell-5130cdn-Color-Laser-1.3-1" {} ''
mkdir -p usr/share/cups/model
${rpm}/bin/rpm2cpio ${src} | ${cpio}/bin/cpio -i
mkdir -p $out/share/ppd
mv usr/share/cups/model/Dell $out/share/ppd
''

View file

@ -0,0 +1,384 @@
{ lib, stdenv
, fetchurl
, fetchpatch
, makeWrapper
, symlinkJoin
, pkg-config
, libtool
, gtk2
, libxml2
, libxslt
, libusb-compat-0_1
, sane-backends
, rpm
, cpio
, getopt
, autoPatchelfHook
, gcc
}:
let common_meta = {
homepage = "http://download.ebz.epson.net/dsc/search/01/search/?OSC=LX";
license = with lib.licenses; epson;
platforms = with lib.platforms; linux;
};
in
############################
#
# PLUGINS
#
############################
# adding a plugin for another printer shouldn't be too difficult, but you need the firmware to test...
let plugins = {
v330 = stdenv.mkDerivation rec {
name = "iscan-v330-bundle";
version = "2.30.4";
src = fetchurl {
# To find new versions, visit
# http://download.ebz.epson.net/dsc/search/01/search/?OSC=LX and search for
# some printer like for instance "WF-7210" to get to the most recent
# version.
# NOTE: Don't forget to update the webarchive link too!
urls = [
"https://download2.ebz.epson.net/iscan/plugin/perfection-v330/rpm/x64/iscan-perfection-v330-bundle-${version}.x64.rpm.tar.gz"
"https://web.archive.org/web/https://download2.ebz.epson.net/iscan/plugin/perfection-v330/rpm/x64/iscan-perfection-v330-bundle-${version}.x64.rpm.tar.gz"
];
sha256 = "056c04pfsf98nnknphg28l489isqb6y4l2c8g7wqhclwgj7m338i";
};
nativeBuildInputs = [ autoPatchelfHook rpm ];
installPhase = ''
${rpm}/bin/rpm2cpio plugins/esci-interpreter-perfection-v330-*.x86_64.rpm | ${cpio}/bin/cpio -idmv
mkdir $out{,/share,/lib}
cp -r ./usr/share/{iscan-data,esci}/ $out/share/
cp -r ./usr/lib64/esci $out/lib
'';
passthru = {
registrationCommand = ''
$registry --add interpreter usb 0x04b8 0x0142 "$plugin/lib/esci/libesci-interpreter-perfection-v330 $plugin/share/esci/esfwad.bin"
'';
hw = "Perfection V330 Photo";
};
meta = common_meta // { description = "Plugin to support " + passthru.hw + " scanner in sane"; };
};
v370 = stdenv.mkDerivation rec {
name = "iscan-v370-bundle";
version = "2.30.4";
src = fetchurl {
urls = [
"https://download2.ebz.epson.net/iscan/plugin/perfection-v370/rpm/x64/iscan-perfection-v370-bundle-${version}.x64.rpm.tar.gz"
"https://web.archive.org/web/https://download2.ebz.epson.net/iscan/plugin/perfection-v370/rpm/x64/iscan-perfection-v370-bundle-${version}.x64.rpm.tar.gz"
];
sha256 = "1ff7adp9mha1i2ibllz540xkagpy8r757h4s3h60bgxbyzv2yggr";
};
nativeBuildInputs = [ autoPatchelfHook rpm ];
installPhase = ''
cd plugins
${rpm}/bin/rpm2cpio iscan-plugin-perfection-v370-*.x86_64.rpm | ${cpio}/bin/cpio -idmv
mkdir -p $out/share $out/lib
cp -r usr/share/{iscan-data,iscan}/ $out/share
cp -r usr/lib64/iscan $out/lib
mv $out/share/iscan $out/share/esci
mv $out/lib/iscan $out/lib/esci
'';
passthru = {
registrationCommand = ''
$registry --add interpreter usb 0x04b8 0x014a "$plugin/lib/esci/libiscan-plugin-perfection-v370 $plugin/share/esci/esfwdd.bin"
'';
hw = "Perfection V37/V370";
};
meta = common_meta // { description = "Plugin to support " + passthru.hw + " scanner in sane"; };
};
v600 = stdenv.mkDerivation rec {
pname = "iscan-gt-x820-bundle";
version = "2.30.4";
nativeBuildInputs = [ autoPatchelfHook rpm ];
src = fetchurl {
urls = [
"https://download2.ebz.epson.net/iscan/plugin/gt-x820/rpm/x64/iscan-gt-x820-bundle-${version}.x64.rpm.tar.gz"
"https://web.archive.org/web/https://download2.ebz.epson.net/iscan/plugin/gt-x820/rpm/x64/iscan-gt-x820-bundle-${version}.x64.rpm.tar.gz"
];
sha256 = "1vlba7dsgpk35nn3n7is8nwds3yzlk38q43mppjzwsz2d2n7sr33";
};
installPhase = ''
cd plugins
${rpm}/bin/rpm2cpio iscan-plugin-gt-x820-*.x86_64.rpm | ${cpio}/bin/cpio -idmv
mkdir $out
cp -r usr/share $out
cp -r usr/lib64 $out/lib
mv $out/share/iscan $out/share/esci
mv $out/lib/iscan $out/lib/esci
'';
passthru = {
registrationCommand = ''
$registry --add interpreter usb 0x04b8 0x013a "$plugin/lib/esci/libesintA1 $plugin/share/esci/esfwA1.bin"
'';
hw = "Perfection V600 Photo";
};
meta = common_meta // { description = "iscan esci x820 plugin for " + passthru.hw; };
};
x770 = stdenv.mkDerivation rec {
pname = "iscan-gt-x770-bundle";
version = "2.30.4";
nativeBuildInputs = [ autoPatchelfHook rpm ];
src = fetchurl {
urls = [
"https://download2.ebz.epson.net/iscan/plugin/gt-x770/rpm/x64/iscan-gt-x770-bundle-${version}.x64.rpm.tar.gz"
"https://web.archive.org/web/https://download2.ebz.epson.net/iscan/plugin/gt-x770/rpm/x64/iscan-gt-x770-bundle-${version}.x64.rpm.tar.gz"
];
sha256 = "1chxdm6smv2d14pn2jl9xyd0vr42diy7vpskd3b9a61gf5h3gj03";
};
installPhase = ''
cd plugins
${rpm}/bin/rpm2cpio iscan-plugin-gt-x770-*.x86_64.rpm | ${cpio}/bin/cpio -idmv
mkdir $out
cp -r usr/share $out
cp -r usr/lib64 $out/lib
mv $out/share/iscan $out/share/esci
mv $out/lib/iscan $out/lib/esci
'';
passthru = {
registrationCommand = ''
$registry --add interpreter usb 0x04b8 0x0130 "$plugin/lib/esci/libesint7C $plugin/share/esci/esfw7C.bin"
'';
hw = "Perfection V500 Photo";
};
meta = common_meta // { description = "iscan esci x770 plugin for " + passthru.hw; };
};
f720 = stdenv.mkDerivation rec {
pname = "iscan-gt-f720-bundle";
version = "2.30.4";
nativeBuildInputs = [ autoPatchelfHook ];
buildInputs = [ gcc.cc.lib ];
src = fetchurl {
urls = [
"https://download2.ebz.epson.net/iscan/plugin/gt-f720/rpm/x64/iscan-gt-f720-bundle-${version}.x64.rpm.tar.gz"
"https://web.archive.org/web/https://download2.ebz.epson.net/iscan/plugin/gt-f720/rpm/x64/iscan-gt-f720-bundle-${version}.x64.rpm.tar.gz"
];
sha256 = "1xnbmb2rn610kqpg1x6k1cc13zlmx2f3l2xnj6809rnhg96qqn20";
};
installPhase = ''
cd plugins
${rpm}/bin/rpm2cpio esci-interpreter-gt-f720-*.x86_64.rpm | ${cpio}/bin/cpio -idmv
mkdir $out
cp -r usr/share $out
cp -r usr/lib64 $out/lib
'';
passthru = {
registrationCommand = ''
$registry --add interpreter usb 0x04b8 0x0131 "$plugin/lib/esci/libesci-interpreter-gt-f720 $plugin/share/esci/esfw8b.bin"
'';
hw = "GT-F720, GT-S620, Perfection V30, Perfection V300 Photo";
};
meta = common_meta // { description = "iscan esci f720 plugin for " + passthru.hw; };
};
s80 = stdenv.mkDerivation rec {
pname = "iscan-gt-s80-bundle";
version = "2.30.4";
nativeBuildInputs = [ autoPatchelfHook ];
buildInputs = [ gcc.cc.lib libtool ];
src = fetchurl {
urls = [
"https://download2.ebz.epson.net/iscan/plugin/gt-s80/rpm/x64/iscan-gt-s80-bundle-${version}.x64.rpm.tar.gz"
"https://web.archive.org/web/https://download2.ebz.epson.net/iscan/plugin/gt-s80/rpm/x64/iscan-gt-s80-bundle-${version}.x64.rpm.tar.gz"
];
sha256 = "00qfdgs03k7bbs67zjrk8hbxvlyinsmk890amp9cmpfjfzdxgg58";
};
installPhase = ''
cd plugins
${rpm}/bin/rpm2cpio esci-interpreter-gt-s80-*.x86_64.rpm | ${cpio}/bin/cpio -idmv
${rpm}/bin/rpm2cpio iscan-plugin-esdip-*.x86_64.rpm | ${cpio}/bin/cpio -idmv
mkdir $out
cp -r usr/share $out
cp -r usr/lib64 $out/lib
mkdir $out/share/esci
'';
passthru = {
registrationCommand = ''
$registry --add interpreter usb 0x04b8 0x0136 "$plugin/lib/esci/libesci-interpreter-gt-s80.so"
$registry --add interpreter usb 0x04b8 0x0137 "$plugin/lib/esci/libesci-interpreter-gt-s50.so"
$registry --add interpreter usb 0x04b8 0x0143 "$plugin/lib/esci/libesci-interpreter-gt-s50.so"
$registry --add interpreter usb 0x04b8 0x0144 "$plugin/lib/esci/libesci-interpreter-gt-s80.so"
'';
hw = "ES-D200, ED-D350, ES-D400, GT-S50, GT-S55, GT-S80, GT-S85";
};
meta = common_meta // { description = "iscan esci s80 plugin for " + passthru.hw; };
};
s650 = stdenv.mkDerivation rec {
name = "iscan-gt-s650-bundle";
version = "2.30.4";
src = fetchurl {
urls = [
"https://download2.ebz.epson.net/iscan/plugin/gt-s650/rpm/x64/iscan-gt-s650-bundle-${version}.x64.rpm.tar.gz"
"https://web.archive.org/web/https://download2.ebz.epson.net/iscan/plugin/gt-s650/rpm/x64/iscan-gt-s650-bundle-${version}.x64.rpm.tar.gz"
];
sha256 = "0fn4lz4g0a8l301v6yv7fwl37wgwhz5y90nf681f655xxc91hqh7";
};
nativeBuildInputs = [ autoPatchelfHook rpm ];
installPhase = ''
cd plugins
${rpm}/bin/rpm2cpio iscan-plugin-gt-s650-*.x86_64.rpm | ${cpio}/bin/cpio -idmv
mkdir $out
cp -r usr/share $out
cp -r usr/lib64 $out/lib
mv $out/share/iscan $out/share/esci
mv $out/lib/iscan $out/lib/esci
'';
passthru = {
registrationCommand = ''
$registry --add interpreter usb 0x04b8 0x013c "$plugin/lib/esci/libiscan-plugin-gt-s650 $plugin/share/esci/esfw010c.bin"
$registry --add interpreter usb 0x04b8 0x013d "$plugin/lib/esci/libiscan-plugin-gt-s650 $plugin/share/esci/esfw010c.bin"
'';
hw = "GT-S650, Perfection V19, Perfection V39";
};
meta = common_meta // { description = "iscan GT-S650 for " + passthru.hw; };
};
network = stdenv.mkDerivation rec {
pname = "iscan-nt-bundle";
# for the version, look for the driver of XP-750 in the search page
version = "2.30.4";
buildInputs = [ stdenv.cc.cc.lib ];
nativeBuildInputs = [ autoPatchelfHook ];
src = fetchurl {
urls = [
"https://download2.ebz.epson.net/iscan/general/rpm/x64/iscan-bundle-${version}.x64.rpm.tar.gz"
"https://web.archive.org/web/https://download2.ebz.epson.net/iscan/general/rpm/x64/iscan-bundle-${version}.x64.rpm.tar.gz"
];
sha256 = "0jssigsgkxb9i7qa7db291a1gbvwl795i4ahvb7bnqp33czkj85k";
};
installPhase = ''
cd plugins
${rpm}/bin/rpm2cpio iscan-network-nt-*.x86_64.rpm | ${cpio}/bin/cpio -idmv
mkdir $out
cp -r usr/share $out
cp -r usr/lib64 $out/lib
mkdir $out/share/esci
'';
passthru = {
registrationCommand = "";
hw = "network";
};
meta = common_meta // { description = "iscan network plugin"; };
};
};
in
let fwdir = symlinkJoin {
name = "esci-firmware-dir";
paths = lib.mapAttrsToList (name: value: value + /share/esci) plugins;
};
in
let iscan-data = stdenv.mkDerivation rec {
pname = "iscan-data";
version = "1.39.2-1";
src = fetchurl {
urls = [
"http://support.epson.net/linux/src/scanner/iscan/iscan-data_${version}.tar.gz"
"https://web.archive.org/web/http://support.epson.net/linux/src/scanner/iscan/iscan-data_${version}.tar.gz"
];
sha256 = "092qhlnjjgz11ifx6mng7mz20i44gc0nlccrbmw18xr5hipbqqka";
};
buildInputs = [
libxslt
];
meta = common_meta;
};
in
stdenv.mkDerivation rec {
pname = "iscan";
version = "2.30.4-2";
src = fetchurl {
urls = [
"http://support.epson.net/linux/src/scanner/iscan/iscan_${version}.tar.gz"
"https://web.archive.org/web/http://support.epson.net/linux/src/scanner/iscan/iscan_${version}.tar.gz"
];
sha256 = "1ma76jj0k3bz0fy06fiyl4di4y77rcryb0mwjmzs5ms2vq9rjysr";
};
nativeBuildInputs = [ pkg-config libtool makeWrapper ];
buildInputs = [
gtk2
libxml2
libusb-compat-0_1
sane-backends
];
patches = [
# Patch for compatibility with libpng versions greater than 10499
(fetchpatch {
urls = [
"https://gitweb.gentoo.org/repo/gentoo.git/plain/media-gfx/iscan/files/iscan-2.28.1.3+libpng-1.5.patch?h=b6e4c805d53b49da79a0f64ef16bb82d6d800fcf"
"https://web.archive.org/web/https://gitweb.gentoo.org/repo/gentoo.git/plain/media-gfx/iscan/files/iscan-2.28.1.3+libpng-1.5.patch?h=b6e4c805d53b49da79a0f64ef16bb82d6d800fcf"
];
sha256 = "04y70qjd220dpyh771fiq50lha16pms98mfigwjczdfmx6kpj1jd";
})
# Patch iscan to search appropriate folders for firmware files
./firmware_location.patch
# Patch deprecated use of sscanf code to use a more modern C99 compatible version
./sscanf.patch
];
patchFlags = [ "-p0" ];
configureFlags = [ "--enable-dependency-reduction" "--disable-frontend" ];
postConfigure = ''
echo '#define NIX_ESCI_PREFIX "'${fwdir}'"' >> config.h
'';
postInstall = ''
mkdir -p $out/etc/sane.d
cp backend/epkowa.conf $out/etc/sane.d
echo "epkowa" > $out/etc/sane.d/dll.conf
ln -s ${iscan-data}/share/iscan-data $out/share/iscan-data
mkdir -p $out/lib/iscan
ln -s ${plugins.network}/lib/iscan/network $out/lib/iscan/network
'';
postFixup = ''
# iscan-registry is a shell script requiring getopt
wrapProgram $out/bin/iscan-registry --prefix PATH : ${getopt}/bin
registry=$out/bin/iscan-registry;
'' +
lib.concatStrings (lib.mapAttrsToList
(name: value: ''
plugin=${value};
${value.passthru.registrationCommand}
'')
plugins);
meta = common_meta // {
description = "sane-epkowa backend for some epson scanners";
longDescription = ''
Includes gui-less iscan (aka. Image Scan! for Linux).
Supported hardware: at least :
'' +
lib.concatStringsSep ", " (lib.mapAttrsToList (name: value: value.passthru.hw) plugins);
maintainers = with lib.maintainers; [ symphorien dominikh ];
};
}

View file

@ -0,0 +1,21 @@
Explanation:
in libesci-interpreter-gt-f720.so in
libesci_interpreter_gt_f720_342::libesci_interpreter_gt_f720_348 at 0xdf74: the
binary blob esfw8b.bin is searched either in /usr/share/esci/ or in
$ESCI_FIRMWARE_DIR. But since this library is to be used wia libsane.so in
every binary in the system, we can't wrapProgram the relevant executables to
set this environment variable. Instead, we patch iscan to set this variable
before loading libesci-interpreter-gt-f720.so.
--- backend/channel-usb.c.orig 2017-08-14 11:24:27.669582456 +0200
+++ backend/channel-usb.c 2017-08-14 11:31:40.509010897 +0200
@@ -169,6 +169,10 @@
{
SANE_Status s;
+ setenv("ESCI_FIRMWARE_DIR", NIX_ESCI_PREFIX, 1);
+ setenv("ISCAN_FW_DIR", NIX_ESCI_PREFIX, 1);
+ setenv("ISCAN_FIRMWARE_DIR", NIX_ESCI_PREFIX, 1);
+
s = sanei_usb_open (self->name, &self->fd);
if (SANE_STATUS_GOOD == s)

View file

@ -0,0 +1,29 @@
The "%as" verb requests sscanf to allocate a buffer for us. However,
this use of 'a' has been long deprecated, and gcc doesn't support it
in this manner when using -std=c99. The modern replacement is "%ms".
Without this change, iscan couldn't read the interpreter file, in turn
breaking all scanners that require plugins.
--- backend/cfg-obj.c.orig 2020-03-19 01:27:17.254762077 +0100
+++ backend/cfg-obj.c 2020-03-19 02:01:52.293329873 +0100
@@ -1026,7 +1026,7 @@
char *vendor = NULL;
char *model = NULL;
- sscanf (string, "%*s %as %as", &vendor, &model);
+ sscanf (string, "%*s %ms %ms", &vendor, &model);
if (list_append (_cfg->seen[CFG_KEY_SCSI], info))
{
@@ -1108,10 +1112,10 @@
char *library = NULL;
char *firmware = NULL;
- sscanf (string, "%*s %*s %x %x %as %as",
+ sscanf (string, "%*s %*s %x %x %ms %ms",
&vendor, &product, &library, &firmware);
if (library && _cfg_have_interpreter (library, firmware)
&& list_append (_cfg->seen[CFG_KEY_INTERPRETER], info))
{

View file

@ -0,0 +1,77 @@
{ lib, stdenv, fetchurl, rpmextract, autoreconfHook, file, libjpeg, cups }:
let
version = "1.0.1";
filterVersion = "1.0.0";
in
stdenv.mkDerivation {
pname = "epson-201106w";
inherit version;
src = fetchurl {
# NOTE: Don't forget to update the webarchive link too!
urls = [
"https://download.ebz.epson.net/dsc/op/stable/SRPMS/epson-inkjet-printer-201106w-${version}-1lsb3.2.src.rpm"
"https://web.archive.org/web/https://download.ebz.epson.net/dsc/op/stable/SRPMS/epson-inkjet-printer-201106w-${version}-1lsb3.2.src.rpm"
];
sha256 = "1yig1xrh1ikblbp7sx706n5nnc237wy4mbch23ymy6akbgqg4aig";
};
nativeBuildInputs = [ rpmextract autoreconfHook file ];
buildInputs = [ libjpeg cups ];
unpackPhase = ''
rpmextract $src
tar -zxf epson-inkjet-printer-201106w-${version}.tar.gz
tar -zxf epson-inkjet-printer-filter-${filterVersion}.tar.gz
for ppd in epson-inkjet-printer-201106w-${version}/ppds/*; do
substituteInPlace $ppd --replace "/opt/epson-inkjet-printer-201106w" "$out"
substituteInPlace $ppd --replace "/cups/lib" "/lib/cups"
done
cd epson-inkjet-printer-filter-${filterVersion}
'';
preConfigure = ''
chmod +x configure
export LDFLAGS="$LDFLAGS -Wl,--no-as-needed"
'';
postInstall = ''
cd ../epson-inkjet-printer-201106w-${version}
cp -a lib64 resource watermark $out
mkdir -p $out/share/cups/model/epson-inkjet-printer-201106w
cp -a ppds $out/share/cups/model/epson-inkjet-printer-201106w/
cp -a Manual.txt $out/doc/
cp -a README $out/doc/README.driver
'';
meta = with lib; {
homepage = "https://www.openprinting.org/driver/epson-201106w";
description = "Epson printer driver (BX535WD, BX630FW, BX635FWD, ME940FW, NX530, NX635, NX635, SX535WD, WorkForce 545, WorkForce 645";
longDescription = ''
This software is a filter program used with the Common UNIX Printing
System (CUPS) under Linux. It supplies high quality printing with
Seiko Epson Color Ink Jet Printers.
List of printers supported by this package:
Epson BX535WD Series
Epson BX630FW Series
Epson BX635FWD Series
Epson ME940FW Series
Epson NX530 Series
Epson SX535WD Series
Epson WorkForce 545 Series
Epson WorkForce 645 Series
To use the driver adjust your configuration.nix file:
services.printing = {
enable = true;
drivers = [ pkgs.epson-201106w ];
};
'';
license = with licenses; [ lgpl21 epson ];
platforms = platforms.linux;
maintainers = [ maintainers.nphilou ];
};
}

View file

@ -0,0 +1,67 @@
{ lib, stdenv, fetchurl, rpmextract, autoreconfHook, file, libjpeg, cups }:
let
version = "1.0.0";
filterVersion = "1.0.0";
in stdenv.mkDerivation {
pname = "epson-201401w";
inherit version;
src = fetchurl {
# NOTE: Don't forget to update the webarchive link too!
urls = [
"https://download3.ebz.epson.net/dsc/f/03/00/03/45/41/92e9c9254f0ee4230a069545ba27ec2858a2c457/epson-inkjet-printer-201401w-1.0.0-1lsb3.2.src.rpm"
"https://web.archive.org/web/20200725175832/https://download3.ebz.epson.net/dsc/f/03/00/03/45/41/92e9c9254f0ee4230a069545ba27ec2858a2c457/epson-inkjet-printer-201401w-1.0.0-1lsb3.2.src.rpm"
];
sha256 = "0c60m1sd59s4sda38dc5nniwa7dh1b0kv1maajr0x9d38gqlyk3x";
};
patches = [ ./fixbuild.patch ];
nativeBuildInputs = [ rpmextract autoreconfHook file ];
buildInputs = [ libjpeg cups ];
unpackPhase = ''
rpmextract $src
tar -zxf epson-inkjet-printer-201401w-${version}.tar.gz
tar -zxf epson-inkjet-printer-filter-${filterVersion}.tar.gz
for ppd in epson-inkjet-printer-201401w-${version}/ppds/*; do
substituteInPlace $ppd --replace "/opt/epson-inkjet-printer-201401w" "$out"
substituteInPlace $ppd --replace "/cups/lib" "/lib/cups"
done
cd epson-inkjet-printer-filter-${filterVersion}
'';
preConfigure = ''
chmod +x configure
'';
postInstall = ''
cd ../epson-inkjet-printer-201401w-${version}
cp -a lib64 resource watermark $out
mkdir -p $out/share/cups/model/epson-inkjet-printer-201401w
cp -a ppds $out/share/cups/model/epson-inkjet-printer-201401w/
cp -a Manual.txt $out/doc/
cp -a README $out/doc/README.driver
'';
meta = with lib; {
homepage = "https://www.openprinting.org/driver/epson-201401w";
description =
"Epson printer driver (L456, L455, L366, L365, L362, L360, L312, L310, L222, L220, L132, L130)";
longDescription = ''
This software is a filter program used with the Common UNIX Printing
System (CUPS) under Linux. It supplies high quality printing with
Seiko Epson Color Ink Jet Printers.
To use the driver adjust your configuration.nix file:
services.printing = {
enable = true;
drivers = [ pkgs.epson-201401w ];
};
'';
license = with licenses; [ lgpl21 epson ];
platforms = platforms.linux;
maintainers = [ maintainers.lunarequest ];
};
}

View file

@ -0,0 +1,101 @@
diff --git a/src/pagemanager/pagemanager.c b/src/pagemanager/pagemanager.c
index 029e6d3..3c1f450 100644
--- a/src/pagemanager/pagemanager.c
+++ b/src/pagemanager/pagemanager.c
@@ -22,7 +22,7 @@
#include "epcgdef.h"
#include "debuglog.h"
#include "memory.h"
-#include "raster.h"
+#include "raster-helper.h"
#include "pagemanager.h"
extern int JobCanceled;
@@ -45,7 +45,7 @@ fetchRaster(EpsPageManager *pageManager)
int error = 0;
int did_fetch = 0;
int read_bytes = 0;
- int nraster;
+ size_t nraster;
while (error == 0 && did_fetch == 0 && JobCanceled == 0) {
eps_raster_fetch(privateData->raster_h, NULL, 0, 0, &status);
@@ -212,7 +212,7 @@ int pageManagerGetPageRegion(EpsPageManager *pageManager, EpsPageRegion *pageReg
return EPS_OK;
}
-int pageManagerGetRaster(EpsPageManager *pageManager, char *buf, int bufSize)
+size_t pageManagerGetRaster(EpsPageManager *pageManager, char *buf, int bufSize)
{
PageManagerPrivateData *privateData = NULL;
int error = EPS_OK;
diff --git a/src/pagemanager/pagemanager.h b/src/pagemanager/pagemanager.h
index 87fbbd5..c9743fb 100644
--- a/src/pagemanager/pagemanager.h
+++ b/src/pagemanager/pagemanager.h
@@ -31,7 +31,7 @@ extern "C"
#define EPS_ERROR -1
#define EPS_OK 0
-typedef int (*EpsRasterSource)(char *buf, int bufSize);
+typedef size_t (*EpsRasterSource)(char *buf, int bufSize);
typedef struct {
EpsRasterSource rasterSource;
@@ -47,7 +47,7 @@ typedef struct {
EpsPageManager* pageManagerCreate(EpsPageRegion pageRegion, EpsFilterPrintOption filterPrintOption, EpsRasterSource rasterSource);
void pageManagerDestroy(EpsPageManager *pageManager);
int pageManagerGetPageRegion(EpsPageManager *pageManager, EpsPageRegion *pageRegion);
-int pageManagerGetRaster(EpsPageManager *pageManager, char *buf, int bufSize);
+size_t pageManagerGetRaster(EpsPageManager *pageManager, char *buf, int bufSize);
int pageManagerIsNextPage(EpsPageManager *pageManager);
#ifdef __cplusplus
diff --git a/src/raster/raster.c b/src/raster/raster.c
index 7e4946b..dd5aef6 100644
--- a/src/raster/raster.c
+++ b/src/raster/raster.c
@@ -218,7 +218,7 @@ eps_raster_init (RASTER * handle, EpsRasterOpt * data, EpsRasterPipeline * pipel
/* if raster_p equals NULL means that it is need to flush a page. */
int
-eps_raster_print (RASTER handle, char * raster_p, int raster_bytes, int pixel_num, int * outraster)
+eps_raster_print (RASTER handle, char * raster_p, int raster_bytes, int pixel_num, size_t * outraster)
{
EpsRaster * raster = (EpsRaster *) handle;
EpsRasterPipeline * pipeline = NULL;
diff --git a/src/raster/raster.h b/src/raster/raster.h
index 9be0977..cc5054d 100644
--- a/src/raster/raster.h
+++ b/src/raster/raster.h
@@ -143,7 +143,7 @@ typedef enum {
} EpsRasterFetchStatus;
int eps_raster_init (RASTER *, EpsRasterOpt *, EpsRasterPipeline *);
-int eps_raster_print (RASTER, char *, int, int, int *);
+int eps_raster_print (RASTER, char *, int, int, size_t *);
int eps_raster_fetch (RASTER, char *, int, int, EpsRasterFetchStatus *);
int eps_raster_free (RASTER);
diff --git a/src/raster_to_epson.c b/src/raster_to_epson.c
index 6e621c8..a0811d6 100644
--- a/src/raster_to_epson.c
+++ b/src/raster_to_epson.c
@@ -33,7 +33,7 @@
#include <cups/ppd.h>
#include <cups/raster.h>
-#include "raster.h"
+#include "raster-helper.h"
#include "memory.h"
#include "raster_to_epson.h"
#include "pagemanager.h"
@@ -75,7 +75,7 @@ static int page_no = 0;
static int pageHeight = 0;
#endif
-int rasterSource(char *buf, int bufSize)
+size_t rasterSource(char *buf, int bufSize)
{
int readBytes = 0;
if (JobCanceled == 0) {

Some files were not shown because too many files have changed in this diff Show more