···
···
22
-
withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd,
21
+
withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemdLibs,
···
scanSnapDriversPackage ? sane-drivers.epjitsu,
45
-
stdenv.mkDerivation rec {
44
+
stdenv.mkDerivation (finalAttrs: {
52
-
rev = "refs/tags/${version}";
51
+
tag = finalAttrs.version;
hash = "sha256-e7Wjda+CobYatblvVCGkMAO2aWrdSCp7q+qIEGnGDCY=";
···
# Fixes for cross compilation
# https://github.com/NixOS/nixpkgs/issues/308283
81
-
# related to the compile-sane-desc-for-build
82
-
substituteInPlace tools/Makefile.in \
83
-
--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
···
++ lib.optionals withSystemd [
enableParallelBuilding = true;
···
"--with-lockdir=/var/lock/sane"
134
-
++ lib.optional (avahi != null) "--with-avahi"
135
-
++ lib.optional (libusb1 != null) "--with-usb";
129
+
++ lib.optionals (avahi != null) [ "--with-avahi" ]
130
+
++ 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.
···
++ lib.optional (gt68xxFirmware != null) {
···
mkdir -p $out/share/sane/${f.backend}
ln -sv ${f.src} $out/share/sane/${f.backend}/${f.name}
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
169
-
# the created 49-libsane references /bin/sh
170
-
substituteInPlace $out/etc/udev/rules.d/49-libsane.rules \
171
-
--replace "RUN+=\"/bin/sh" "RUN+=\"${runtimeShell}"
173
-
substituteInPlace $out/lib/libsane.la \
174
-
--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 ];