sane-backends: replace `systemd` with `systemdLibs` (#441285)

Changed files
+8 -21
pkgs
applications
graphics
sane
backends
+8 -21
pkgs/applications/graphics/sane/backends/default.nix
···
lib,
fetchFromGitLab,
fetchpatch,
-
runtimeShell,
buildPackages,
gettext,
pkg-config,
···
libv4l,
net-snmp,
curl,
-
systemd,
-
withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd,
+
systemdLibs,
+
withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemdLibs,
libxml2,
poppler,
gawk,
···
scanSnapDriversPackage ? sane-drivers.epjitsu,
}:
-
stdenv.mkDerivation rec {
+
stdenv.mkDerivation (finalAttrs: {
pname = "sane-backends";
version = "1.4.0";
src = fetchFromGitLab {
owner = "sane-project";
repo = "backends";
-
rev = "refs/tags/${version}";
+
tag = finalAttrs.version;
hash = "sha256-e7Wjda+CobYatblvVCGkMAO2aWrdSCp7q+qIEGnGDCY=";
};
···
# Fixes for cross compilation
# https://github.com/NixOS/nixpkgs/issues/308283
-
-
# related to the compile-sane-desc-for-build
-
substituteInPlace tools/Makefile.in \
-
--replace 'cc -I' '$(CC_FOR_BUILD) -I'
# sane-desc will be used in postInstall so compile it for build
# https://github.com/void-linux/void-packages/blob/master/srcpkgs/sane/patches/sane-desc-cross.patch
···
net-snmp
]
++ lib.optionals withSystemd [
-
systemd
+
systemdLibs
];
enableParallelBuilding = true;
···
configureFlags = [
"--with-lockdir=/var/lock/sane"
]
-
++ lib.optional (avahi != null) "--with-avahi"
-
++ lib.optional (libusb1 != null) "--with-usb";
+
++ lib.optionals (avahi != null) [ "--with-avahi" ]
+
++ lib.optionals (libusb1 != null) [ "--with-usb" ];
# autoconf check for HAVE_MMAP is never set on cross compilation.
# The pieusb backend fails compilation if HAVE_MMAP is not set.
···
postInstall =
let
-
compatFirmware =
extraFirmware
++ lib.optional (gt68xxFirmware != null) {
···
mkdir -p $out/share/sane/${f.backend}
ln -sv ${f.src} $out/share/sane/${f.backend}/${f.name}
'';
-
in
''
mkdir -p $out/etc/udev/rules.d/ $out/etc/udev/hwdb.d
./tools/sane-desc -m udev+hwdb -s doc/descriptions:doc/descriptions-external > $out/etc/udev/rules.d/49-libsane.rules
./tools/sane-desc -m udev+hwdb -s doc/descriptions:doc/descriptions-external -m hwdb > $out/etc/udev/hwdb.d/20-sane.hwdb
-
# the created 49-libsane references /bin/sh
-
substituteInPlace $out/etc/udev/rules.d/49-libsane.rules \
-
--replace "RUN+=\"/bin/sh" "RUN+=\"${runtimeShell}"
-
-
substituteInPlace $out/lib/libsane.la \
-
--replace "-ljpeg" "-L${lib.getLib libjpeg}/lib -ljpeg"
# net.conf conflicts with the file generated by the nixos module
rm $out/etc/sane.d/net.conf
···
platforms = lib.platforms.linux ++ lib.platforms.darwin;
maintainers = [ lib.maintainers.symphorien ];
};
-
}
+
})