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,69 @@
{ lib, stdenv, fetchurl, rpm, cpio, zlib }:
/* usage: (sorry, its still impure but works!)
impure directory:
mkdir /opt/gutenprint; sudo cp -r $(nix-build -A gutenprintBin -f $NIXPGS_ALL) /opt/gutenprint
add the following lines to bindirCmds property of printing/cupsd.nix:
ln -s ${pkgs.gutenprintBin}/lib/cups/backend/* $out/lib/cups/backend/
ln -s ${pkgs.gutenprintBin}/lib/cups/filter/* $out/lib/cups/filter/
mkdir -p $out/lib/cups/model
cat ${pkgs.gutenprintBin}/ppds/Canon/Canon-PIXMA_iP4000-gutenprint.5.0.sim-en.ppd.gz |gunzip > $out/lib/cups/model/Canon-PIXMA_iP4000-gutenprint.5.0.sim-en.ppd
sed -i 's@/opt/gutenprint/cups@${pkgs.gutenprintBin}/cups@' $out/lib/cups/model/Canon-PIXMA_iP4000-gutenprint.5.0.sim-en.ppd
Then rebuild your system and add your printer using the the localhost:603 cups web interface
select the extracted .ppd file which can be found in the model directory of
sed -n 's/^ServerBin //p' $(sed -n 's/respawn.*-c \(.*''\) -F.*''/\1/p' /etc/event.d/cupsd)
(sorry, cups still doesn't see it. You could copy it into /nix/store/
*-cups/lib/cups/model/ and you would be able to select canon -> PIXMA 4000
then. I've tried that.
TODO tidy this all up. Find source instead of binary. Fix paths ... Find out how to check ink levels etc
*/
stdenv.mkDerivation {
pname = "cups-gutenprint-binary";
version = "5.0.1";
src = if stdenv.hostPlatform.system == "x86_64-linux" then fetchurl {
url = "https://www.openprinting.org/download/printdriver/debian/dists/lsb3.1/main/binary-amd64/gutenprint_5.0.1-1lsb3.1_amd64.deb";
sha256 = "0an5gba6r6v54r53s2gj2fjk8fzpl4lrksjas2333528b0k8gbbc";
} else throw "TODO"; # get from openprint.com -> drivers -> gutenprint
buildInputs = [ rpm cpio ];
dontUnpack = true;
dontInstall = true;
dontFixup = true;
libPath = lib.makeLibraryPath [ stdenv.cc.cc zlib ];
buildPhase = ''
ar -x $src data.tar.gz
tar xfz data.tar.gz
cp -r opt/gutenprint $out
for p in \
$out/cups/lib/driver/gutenprint.5.0 \
$out/bin/{escputil,cups-calibrate} \
$out/cups/lib/driver/gutenprint.5.0 \
$out/cups/lib/filter/{rastertogutenprint.5.0,commandtocanon,commandtoepson} \
$out/cups/lib/backend/{canon,epson} \
$out/sbin/cups-genppd.5.0 \
; do
patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
--set-rpath $libPath $p
done
mkdir $out/lib
ln -s $out/cups/lib $out/lib/cups
'';
meta = {
description = "Some additional CUPS drivers including Canon drivers";
platforms = [ "x86_64-linux" ];
};
}

View file

@ -0,0 +1,53 @@
# this package was called gimp-print in the past
{ stdenv, lib, fetchurl, makeWrapper, pkg-config
, ijs, zlib
, gimp2Support ? false, gimp
, cupsSupport ? true, cups, libusb-compat-0_1, perl
}:
stdenv.mkDerivation rec {
pname = "gutenprint";
version = "5.3.4";
src = fetchurl {
url = "mirror://sourceforge/gimp-print/gutenprint-${version}.tar.bz2";
sha256 = "0s0b14hjwvbxksq7af5v8z9g2rfqv9jdmxd9d81m57f5mh6rad0p";
};
nativeBuildInputs = [ makeWrapper pkg-config ];
buildInputs =
[ ijs zlib ]
++ lib.optionals gimp2Support [ gimp.gtk gimp ]
++ lib.optionals cupsSupport [ cups libusb-compat-0_1 perl ];
configureFlags = lib.optionals cupsSupport [
"--disable-static-genppd" # should be harmless on NixOS
];
# FIXME: hacky because we modify generated configure, but I haven't found a better way.
# makeFlags doesn't change this everywhere (e.g. in cups-genppdupdate).
preConfigure = lib.optionalString cupsSupport ''
sed -i \
-e "s,cups_conf_datadir=.*,cups_conf_datadir=\"$out/share/cups\",g" \
-e "s,cups_conf_serverbin=.*,cups_conf_serverbin=\"$out/lib/cups\",g" \
-e "s,cups_conf_serverroot=.*,cups_conf_serverroot=\"$out/etc/cups\",g" \
configure
'' + lib.optionalString gimp2Support ''
sed -i \
-e "s,gimp2_plug_indir=.*,gimp2_plug_indir=\"$out/lib/gimp/${gimp.majorVersion}\",g" \
configure
'';
enableParallelBuilding = true;
# Testing is very, very long.
# doCheck = true;
meta = with lib; {
description = "Ghostscript and cups printer drivers";
homepage = "https://sourceforge.net/projects/gimp-print/";
license = licenses.gpl2;
platforms = platforms.linux;
isGutenprint = true;
};
}