Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 94864bbd3749
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: f612e3345baf
Choose a head ref
  • 2 commits
  • 3 files changed
  • 2 contributors

Commits on Mar 11, 2019

  1. samsung-unified-linux-driver_1_00_36: init at 1.00.36

    Tomas Hlavaty committed Mar 11, 2019
    Copy the full SHA
    728689a View commit details

Commits on Mar 23, 2019

  1. Merge pull request #57449 from tohl/master

    samsung-unified-linux-driver_1_00_36, tested on nixos x86_64 with m2070w printer/scanner, fixes #27995
    joachifm authored Mar 23, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    f612e33 View commit details
Showing with 161 additions and 0 deletions.
  1. +116 −0 pkgs/misc/cups/drivers/samsung/1.00.36/default.nix
  2. +44 −0 pkgs/misc/cups/drivers/samsung/1.00.36/module.nix
  3. +1 −0 pkgs/top-level/all-packages.nix
116 changes: 116 additions & 0 deletions pkgs/misc/cups/drivers/samsung/1.00.36/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
{ stdenv, fetchurl, glibc, cups, libusb, libxml2, ghostscript, perl }:

let

arch = if stdenv.system == "x86_64-linux"
then "x86_64"
else "i386";

in stdenv.mkDerivation rec {
name = "samsung-unified-linux-driver-${version}";
version = "1.00.36";

src = fetchurl {
sha256 = "1a7ngd03x0bkdl7pszy5zqqic0plxvdxqm5w7klr6hbdskx1lir9";
url = "http://www.bchemnet.com/suldr/driver/UnifiedLinuxDriver-${version}.tar.gz";
};

buildInputs = [
cups
libusb
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:${stdenv.lib.getLib cups}/lib" "$bin"
done
patchelf --set-rpath "$out/lib:${stdenv.lib.getLib cups}/lib" "$out/lib/libscmssc.so"
patchelf --set-rpath "$out/lib:${libxml2.out}/lib:${libusb.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 stdenv.lib; {
description = "Unified Linux Driver for Samsung printers and scanners";
homepage = http://www.bchemnet.com/suldr;
downloadPage = http://www.bchemnet.com/suldr/driver/;
license = licenses.unfree;

# Tested on linux-x86_64. Might work on linux-i386.
# Probably won't work on anything else.
platforms = platforms.linux;
maintainers = with maintainers; [ tohl ];
};
}
44 changes: 44 additions & 0 deletions pkgs/misc/cups/drivers/samsung/1.00.36/module.nix
Original file line number Diff line number Diff line change
@@ -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";
};
};
}
1 change: 1 addition & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
@@ -22964,6 +22964,7 @@ in
mfcl8690cdwcupswrapper = callPackage ../misc/cups/drivers/mfcl8690cdwcupswrapper { };
mfcl8690cdwlpr = callPackage ../misc/cups/drivers/mfcl8690cdwlpr { };

samsung-unified-linux-driver_1_00_36 = callPackage ../misc/cups/drivers/samsung/1.00.36/default.nix { };
samsung-unified-linux-driver_1_00_37 = callPackage ../misc/cups/drivers/samsung/1.00.37.nix { };
samsung-unified-linux-driver_4_00_39 = callPackage ../misc/cups/drivers/samsung/4.00.39 { };
samsung-unified-linux-driver_4_01_17 = callPackage ../misc/cups/drivers/samsung/4.01.17.nix { };