anchor.diff:    propagatedBuildInputs = [ gmp ];
   
     configureFlags = [
  -    # 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"
  -
       "--localstatedir=/var"
       "--sysconfdir=/etc"
       "--with-rundir=/run"
  -    "--with-systemd=\${out}/lib/systemd/system"
       "--enable-raw-printing"
       "--enable-threads"
     ] ++ optionals stdenv.isLinux [
  
positive.code:   enableParallelBuilding = true;
  
    postInstall = ''
        moveToOutput lib/cups "$out"
  
        # Delete obsolete stuff that conflicts with cups-filters.
        rm -rf $out/share/cups/banners $out/share/cups/data/testprint
  
        # Some outputs in cups-config were unexpanded and some even wrong.
        moveToOutput bin/cups-config "$dev"
        sed -e "/^cups_serverbin=/s|\$(lib)|$out|" \
            -e "s|\$(out)|$out|" \
            -e "s|\$(lib)|$lib|" \
            -i "$dev/bin/cups-config"
  
        # Rename systemd files provided by CUPS
        for f in "$out"/lib/systemd/system/*; do
          substituteInPlace "$f" \
            --replace "org.cups.cupsd" "cups" \
            --replace "org.cups." ""
  
  
negative.code:     ++ optional (gnutls != null) "--enable-ssl"
      ++ optional (avahi != null) "--enable-avahi"
      ++ optional (libpaper != null) "--enable-libpaper"
      ++ optional stdenv.isDarwin "--disable-launchd";
  
    preConfigure = ''
      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.
  