mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-10-17 02:19:30 +03:00
Merge pull request #212319 from SuperSandro2000/cups
cups: remove with lib over entire file
This commit is contained in:
commit
fcc1699e94
@ -22,10 +22,8 @@
|
|||||||
, nixosTests
|
, nixosTests
|
||||||
}:
|
}:
|
||||||
|
|
||||||
with lib;
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "cups";
|
pname = "cups";
|
||||||
|
|
||||||
version = "2.4.2";
|
version = "2.4.2";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
@ -48,9 +46,9 @@ stdenv.mkDerivation rec {
|
|||||||
nativeBuildInputs = [ pkg-config removeReferencesTo ];
|
nativeBuildInputs = [ pkg-config removeReferencesTo ];
|
||||||
|
|
||||||
buildInputs = [ zlib libjpeg libpng libtiff libusb1 gnutls libpaper ]
|
buildInputs = [ zlib libjpeg libpng libtiff libusb1 gnutls libpaper ]
|
||||||
++ optionals stdenv.isLinux [ avahi pam dbus acl ]
|
++ lib.optionals stdenv.isLinux [ avahi pam dbus acl ]
|
||||||
++ optional enableSystemd systemd
|
++ lib.optional enableSystemd systemd
|
||||||
++ optionals stdenv.isDarwin (with darwin; [
|
++ lib.optionals stdenv.isDarwin (with darwin; [
|
||||||
configd apple_sdk.frameworks.ApplicationServices
|
configd apple_sdk.frameworks.ApplicationServices
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@ -62,18 +60,18 @@ stdenv.mkDerivation rec {
|
|||||||
"--sysconfdir=/etc"
|
"--sysconfdir=/etc"
|
||||||
"--enable-raw-printing"
|
"--enable-raw-printing"
|
||||||
"--enable-threads"
|
"--enable-threads"
|
||||||
] ++ optionals stdenv.isLinux [
|
] ++ lib.optionals stdenv.isLinux [
|
||||||
"--enable-dbus"
|
"--enable-dbus"
|
||||||
"--enable-pam"
|
"--enable-pam"
|
||||||
"--with-dbusdir=${placeholder "out"}/share/dbus-1"
|
"--with-dbusdir=${placeholder "out"}/share/dbus-1"
|
||||||
] ++ optional (libusb1 != null) "--enable-libusb"
|
] ++ lib.optional (libusb1 != null) "--enable-libusb"
|
||||||
++ optional (gnutls != null) "--enable-ssl"
|
++ lib.optional (gnutls != null) "--enable-ssl"
|
||||||
++ optional (avahi != null) "--enable-avahi"
|
++ lib.optional (avahi != null) "--enable-avahi"
|
||||||
++ optional (libpaper != null) "--enable-libpaper";
|
++ lib.optional (libpaper != null) "--enable-libpaper";
|
||||||
|
|
||||||
# AR has to be an absolute path
|
# AR has to be an absolute path
|
||||||
preConfigure = ''
|
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+=(
|
configureFlagsArray+=(
|
||||||
# Put just lib/* and locale into $lib; this didn't work directly.
|
# Put just lib/* and locale into $lib; this didn't work directly.
|
||||||
# lib/cups is moved back to $out in postInstall.
|
# lib/cups is moved back to $out in postInstall.
|
||||||
@ -84,7 +82,7 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
"--with-systemd=$out/lib/systemd/system"
|
"--with-systemd=$out/lib/systemd/system"
|
||||||
|
|
||||||
${optionalString stdenv.isDarwin ''
|
${lib.optionalString stdenv.isDarwin ''
|
||||||
"--with-bundledir=$out"
|
"--with-bundledir=$out"
|
||||||
''}
|
''}
|
||||||
)
|
)
|
||||||
@ -130,7 +128,7 @@ stdenv.mkDerivation rec {
|
|||||||
for f in "$out"/lib/systemd/system/*; do
|
for f in "$out"/lib/systemd/system/*; do
|
||||||
substituteInPlace "$f" --replace "$lib/$libexec" "$out/$libexec"
|
substituteInPlace "$f" --replace "$lib/$libexec" "$out/$libexec"
|
||||||
done
|
done
|
||||||
'' + optionalString stdenv.isLinux ''
|
'' + lib.optionalString stdenv.isLinux ''
|
||||||
# Use xdg-open when on Linux
|
# Use xdg-open when on Linux
|
||||||
substituteInPlace "$out"/share/applications/cups.desktop \
|
substituteInPlace "$out"/share/applications/cups.desktop \
|
||||||
--replace "Exec=htmlview" "Exec=xdg-open"
|
--replace "Exec=htmlview" "Exec=xdg-open"
|
||||||
@ -138,7 +136,7 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
passthru.tests.nixos = nixosTests.printing;
|
passthru.tests.nixos = nixosTests.printing;
|
||||||
|
|
||||||
meta = {
|
meta = with lib; {
|
||||||
homepage = "https://openprinting.github.io/cups/";
|
homepage = "https://openprinting.github.io/cups/";
|
||||||
description = "A standards-based printing system for UNIX";
|
description = "A standards-based printing system for UNIX";
|
||||||
license = licenses.asl20;
|
license = licenses.asl20;
|
||||||
|
Loading…
Reference in New Issue
Block a user