From 09e07a3ad354bdad161880b8a33dbfe4b6088cf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Mon, 23 Jan 2023 22:45:25 +0100 Subject: [PATCH] cups: remove with lib over entire file --- pkgs/misc/cups/default.nix | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/pkgs/misc/cups/default.nix b/pkgs/misc/cups/default.nix index 06fdb4d65e72..d9f136f81389 100644 --- a/pkgs/misc/cups/default.nix +++ b/pkgs/misc/cups/default.nix @@ -22,10 +22,8 @@ , nixosTests }: -with lib; stdenv.mkDerivation rec { pname = "cups"; - version = "2.4.2"; src = fetchurl { @@ -48,9 +46,9 @@ stdenv.mkDerivation rec { 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; [ + ++ lib.optionals stdenv.isLinux [ avahi pam dbus acl ] + ++ lib.optional enableSystemd systemd + ++ lib.optionals stdenv.isDarwin (with darwin; [ configd apple_sdk.frameworks.ApplicationServices ]); @@ -62,18 +60,18 @@ stdenv.mkDerivation rec { "--sysconfdir=/etc" "--enable-raw-printing" "--enable-threads" - ] ++ optionals stdenv.isLinux [ + ] ++ lib.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"; + ] ++ lib.optional (libusb1 != null) "--enable-libusb" + ++ lib.optional (gnutls != null) "--enable-ssl" + ++ lib.optional (avahi != null) "--enable-avahi" + ++ lib.optional (libpaper != null) "--enable-libpaper"; # AR has to be an absolute path preConfigure = '' - export AR="${getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ar" + export AR="${lib.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. @@ -84,7 +82,7 @@ stdenv.mkDerivation rec { "--with-systemd=$out/lib/systemd/system" - ${optionalString stdenv.isDarwin '' + ${lib.optionalString stdenv.isDarwin '' "--with-bundledir=$out" ''} ) @@ -130,7 +128,7 @@ stdenv.mkDerivation rec { for f in "$out"/lib/systemd/system/*; do substituteInPlace "$f" --replace "$lib/$libexec" "$out/$libexec" done - '' + optionalString stdenv.isLinux '' + '' + lib.optionalString stdenv.isLinux '' # Use xdg-open when on Linux substituteInPlace "$out"/share/applications/cups.desktop \ --replace "Exec=htmlview" "Exec=xdg-open" @@ -138,7 +136,7 @@ stdenv.mkDerivation rec { passthru.tests.nixos = nixosTests.printing; - meta = { + meta = with lib; { homepage = "https://openprinting.github.io/cups/"; description = "A standards-based printing system for UNIX"; license = licenses.asl20;