mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-02 13:00:23 +00:00
63 lines
1.4 KiB
Nix
63 lines
1.4 KiB
Nix
{
|
|
buildGoModule,
|
|
avahi,
|
|
libusb1,
|
|
pkg-config,
|
|
lib,
|
|
fetchFromGitHub,
|
|
ronn,
|
|
}:
|
|
buildGoModule (finalAttrs: {
|
|
pname = "ipp-usb";
|
|
version = "0.9.34";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "openprinting";
|
|
repo = "ipp-usb";
|
|
rev = finalAttrs.version;
|
|
sha256 = "sha256-4xZf8Q1MfQcB13vHRdb8dQyZWrwnJzubdi+zln1lRc8=";
|
|
};
|
|
|
|
postPatch = ''
|
|
# rebuild with patched paths
|
|
rm ipp-usb.8
|
|
substituteInPlace Makefile \
|
|
--replace-fail "install: all" "install: man" \
|
|
--replace-fail "/usr/" "/" \
|
|
--replace-fail "install -s" "install" # Nix already strips binaries in $out/sbin, this also fixes cross
|
|
substituteInPlace systemd-udev/ipp-usb.service --replace-fail "/sbin" "$out/bin"
|
|
for i in paths.go ipp-usb.8.md; do
|
|
substituteInPlace $i --replace-fail "/usr" "$out"
|
|
substituteInPlace $i --replace-fail "/var/ipp-usb" "/var/lib/ipp-usb"
|
|
done
|
|
'';
|
|
|
|
nativeBuildInputs = [
|
|
pkg-config
|
|
ronn
|
|
];
|
|
buildInputs = [
|
|
libusb1
|
|
avahi
|
|
];
|
|
|
|
vendorHash = null;
|
|
|
|
doInstallCheck = true;
|
|
|
|
postInstall = ''
|
|
# to accommodate the makefile
|
|
cp $out/bin/ipp-usb .
|
|
make install DESTDIR=$out
|
|
'';
|
|
|
|
meta = {
|
|
description = "Daemon to use the IPP everywhere protocol with USB printers";
|
|
mainProgram = "ipp-usb";
|
|
homepage = "https://github.com/OpenPrinting/ipp-usb";
|
|
maintainers = [ lib.maintainers.symphorien ];
|
|
platforms = lib.platforms.linux;
|
|
license = lib.licenses.bsd2;
|
|
};
|
|
})
|