Unverified Commit f1f9a540 authored by Arnout Engelen's avatar Arnout Engelen
Browse files

cups-filters: 1.28.17 -> 2.0.1

parent 23e89b7d
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@ with lib;

let

  inherit (pkgs) cups-pk-helper cups-filters xdg-utils;
  inherit (pkgs) cups-pk-helper libcupsfilters cups-filters xdg-utils;

  cfg = config.services.printing;
  cups = cfg.package;
@@ -35,7 +35,7 @@ let
  bindir = pkgs.buildEnv {
    name = "cups-progs";
    paths =
      [ cups.out additionalBackends cups-filters pkgs.ghostscript ]
      [ cups.out additionalBackends libcupsfilters cups-filters pkgs.ghostscript ]
      ++ cfg.drivers;
    pathsToLink = [ "/lib" "/share/cups" "/bin" ];
    postBuild = cfg.bindirCmds;
@@ -278,6 +278,8 @@ in
        '';
      };

      browsed.package = lib.mkPackageOption pkgs "cups-browsed" {};

      browsedConf = mkOption {
        type = types.lines;
        default = "";
@@ -438,7 +440,7 @@ in

        path = [ cups ];

        serviceConfig.ExecStart = "${cups-filters}/bin/cups-browsed";
        serviceConfig.ExecStart = "${cfg.browsed.package}/bin/cups-browsed";

        restartTriggers = [ browsedFile ];
      };
+47 −0
Original line number Diff line number Diff line
{
  autoreconfHook,
  avahi,
  cups,
  fetchFromGitHub,
  glib,
  lib,
  libcupsfilters,
  libppd,
  pkg-config,
  stdenv,
}:

stdenv.mkDerivation rec {
  pname = "cups-browsed";
  version = "2.1.0";

  src = fetchFromGitHub {
    owner = "OpenPrinting";
    repo = "cups-browsed";
    rev = version;
    hash = "sha256-UkPJqVWG6obIW0jGXsnnYB2lmIm/uiMuPYSGY3+M4Gw=";
  };

  nativeBuildInputs = [
    autoreconfHook
    pkg-config
    cups
  ];

  buildInputs = [
    avahi
    libcupsfilters
    libppd
    glib
  ];

  configureFlags = [
    "--with-rcdir=no"
  ];

  makeFlags = [
    "CUPS_SERVERBIN=$(out)/lib/cups"
    "CUPS_DATADIR=$(out)/share/cups"
    "CUPS_SERVERROOT=$(out)/etc/cups"
  ];
}
+64 −0
Original line number Diff line number Diff line
{
  autoreconfHook,
  cups,
  dbus,
  dejavu_fonts,
  fetchFromGitHub,
  fontconfig,
  ghostscript,
  lcms2,
  libexif,
  libjpeg,
  libpng,
  libtiff,
  mupdf,
  pkg-config,
  poppler,
  poppler_utils,
  qpdf,
  stdenv,
}:

stdenv.mkDerivation rec {
  pname = "libcupsfilters";
  version = "2.1.0";

  src = fetchFromGitHub {
    owner = "OpenPrinting";
    repo = "libcupsfilters";
    rev = "2.1.0";
    hash = "sha256-tnQqM4stUJseDO9BG+PRUSFafjgpQQklTDsDsB9zQ4Y=";
  };

  nativeBuildInputs = [
    autoreconfHook
    pkg-config
    cups
  ];
  buildInputs = [
    dbus
    fontconfig
    ghostscript
    lcms2
    libexif
    libjpeg
    libpng
    libtiff
    mupdf
    poppler
    poppler_utils
    qpdf
  ];
  configureFlags = [
    "--with-mutool-path=${mupdf}/bin/mutool"
    "--with-gs-path=${ghostscript}/bin/gs"
    "--with-ippfind-path=${cups}/bin/ippfind"
    "--enable-imagefilters"
    "--with-test-font-path=${dejavu_fonts}/share/fonts/truetype/DejaVuSans.ttf"
  ];
  makeFlags = [
    "CUPS_SERVERBIN=$(out)/lib/cups"
    "CUPS_DATADIR=$(out)/share/cups"
    "CUPS_SERVERROOT=$(out)/etc/cups"
  ];
}
+48 −0
Original line number Diff line number Diff line
{
  autoreconfHook,
  cups,
  fetchFromGitHub,
  ghostscript,
  libcupsfilters,
  libz,
  mupdf,
  pkg-config,
  poppler_utils,
  stdenv,
}:

stdenv.mkDerivation rec {
  pname = "libppd";
  version = "2.1.0";

  src = fetchFromGitHub {
    owner = "OpenPrinting";
    repo = "libppd";
    rev = version;
    hash = "sha256-vT4h3dnMu4yHNk0ExGZjuChdu0kAcxsla7vJupZpLaY=";
  };

  nativeBuildInputs = [
    autoreconfHook
    pkg-config
    cups
  ];
  buildInputs = [
    ghostscript
    libcupsfilters
    mupdf
    libz
  ];
  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"
  ];
  makeFlags = [
    "CUPS_SERVERBIN=$(out)/lib/cups"
    "CUPS_DATADIR=$(out)/share/cups"
    "CUPS_SERVERROOT=$(out)/etc/cups"
  ];
}
+17 −46
Original line number Diff line number Diff line
{ lib
, avahi
, bc
, coreutils
, cups
, dbus
, dejavu_fonts
, fetchurl
, fetchpatch
, fetchFromGitHub
, fontconfig
, gawk
, ghostscript
, gnugrep
, gnused
, ijs
, libcupsfilters
, libppd
, libexif
, libjpeg
, liblouis
@@ -30,70 +30,41 @@
, withAvahi ? true
}:

let
(if !withAvahi then lib.warn "the 'withAvahi' parameter to 'cups-filters' is deprecated, as the cups-browsed component (which does not make sense without avahi) has been split out of the cups-filters package (which no longer needs avahi)" else lib.id)

(let
  binPath = lib.makeBinPath [ bc coreutils gawk gnused gnugrep which ];

in
stdenv.mkDerivation rec {
  pname = "cups-filters";
  version = "1.28.17";
  version = "2.0.1";

  src = fetchurl {
    url = "https://github.com/OpenPrinting/cups-filters/releases/download/${version}/${pname}-${version}.tar.xz";
    hash = "sha256-Jwo3UqlgNoqpnUMftdNPQDmyrJQ8V22EBhLR2Bhcm7k=";
  src = fetchFromGitHub {
    owner = "OpenPrinting";
    repo = "cups-filters";
    rev = version;
    hash = "sha256-bLOl64bdeZ10JLcQ7GbU+VffJu3Lzo0ves7O7GQIOWY=";
  };

  patches = [
    (fetchpatch {
      name = "CVE-2023-24805.patch";
      url = "https://github.com/OpenPrinting/cups-filters/commit/93e60d3df358c0ae6f3dba79e1c9684657683d89.patch";
      hash = "sha256-KgWTYFr2uShL040azzE+KaNyBPy7Gs/hCnEgQmmPCys=";
    })
    (fetchpatch {
      name = "CVE-2024-47076.patch";
      url = "https://github.com/OpenPrinting/libcupsfilters/commit/95576ec3d20c109332d14672a807353cdc551018.patch";
      hash = "sha256-MXWllrdWt8n7zqvumQNg34dBgWMwMTwf9lrD+ZZP8Wk=";
    })
    (fetchpatch {
      name = "remove-cups-ldap-browse-protocols_CVE-2024-47176_CVE-2024-47850.patch";
      url = "https://github.com/OpenPrinting/cups-filters/commit/6fd2bdfbdce76149af531ce9fca9062304238451.patch";
      hash = "sha256-XS1ODy7i7ilgEjsKuEvOUiRN9pqsj+bOktKoshKcg8Q=";
    })
  ];

  nativeBuildInputs = [ pkg-config makeWrapper autoreconfHook ];

  buildInputs = [
    cups
    dbus
    fontconfig
    ghostscript
    ijs
    libexif
    libjpeg
    liblouis # braille embosser support
    libpng
    libcupsfilters
    libppd
    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" ];

@@ -130,4 +101,4 @@ stdenv.mkDerivation rec {
    license = lib.licenses.gpl2Plus;
    platforms = lib.platforms.linux;
  };
}
})
Loading