Skip to content

Commit

Permalink
cups: enable compiling with musl
Browse files Browse the repository at this point in the history
When compiling `cups` with `pkgsMusl`, `cups` can't depend on `systemd`
because `systemd` is not able to be built with musl.
  • Loading branch information
cdepillabout authored and nh2 committed Oct 28, 2019
1 parent 97a5c41 commit 664823c
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions pkgs/misc/cups/default.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
{ stdenv, fetchurl, pkgconfig, removeReferencesTo
, zlib, libjpeg, libpng, libtiff, pam, dbus, systemd, acl, gmp, darwin
, libusb ? null, gnutls ? null, avahi ? null, libpaper ? null
{ stdenv
, fetchurl
, pkgconfig
, removeReferencesTo
, zlib
, libjpeg
, libpng
, libtiff
, pam
, dbus
, enableSystemd ? stdenv.isLinux && !stdenv.hostPlatform.isMusl
, systemd ? null
, acl
, gmp
, darwin
, libusb ? null
, gnutls ? null
, avahi ? null
, libpaper ? null
, coreutils
}:

assert enableSystemd -> systemd != null;

### IMPORTANT: before updating cups, make sure the nixos/tests/printing.nix test
### works at least for your platform.

Expand Down Expand Up @@ -33,7 +51,10 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ pkgconfig removeReferencesTo ];

buildInputs = [ zlib libjpeg libpng libtiff libusb gnutls libpaper ]
++ optionals stdenv.isLinux [ avahi pam dbus systemd acl ]
++ optionals stdenv.isLinux [ avahi pam dbus ]
++ optional enableSystemd systemd
# Separate from above only to not modify order, to avoid mass rebuilds; merge this with the above at next big change.
++ optionals stdenv.isLinux [ acl ]
++ optionals stdenv.isDarwin (with darwin; [
configd apple_sdk.frameworks.ApplicationServices
]);
Expand Down

0 comments on commit 664823c

Please sign in to comment.