From 0a5e80ec74495d0dcbaf5cc4fe9b930b5cddb3c3 Mon Sep 17 00:00:00 2001 From: lukts30 Date: Wed, 9 Oct 2024 13:28:41 +0200 Subject: [PATCH] nbdkit: init at 1.40.4 --- pkgs/by-name/nb/nbdkit/package.nix | 100 +++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 pkgs/by-name/nb/nbdkit/package.nix diff --git a/pkgs/by-name/nb/nbdkit/package.nix b/pkgs/by-name/nb/nbdkit/package.nix new file mode 100644 index 000000000000..8d1ab5b3c89d --- /dev/null +++ b/pkgs/by-name/nb/nbdkit/package.nix @@ -0,0 +1,100 @@ +{ + stdenv, + testers, + fetchurl, + autoreconfHook, + makeWrapper, + pkg-config, + bash-completion, + gnutls, + libtool, + curl, + xz, + zlib-ng, + libssh, + libnbd, + lib, + cdrkit, + e2fsprogs, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "nbdkit"; + version = "1.40.4"; + + src = fetchurl { + url = "https://download.libguestfs.org/nbdkit/${lib.versions.majorMinor finalAttrs.version}-stable/nbdkit-${finalAttrs.version}.tar.gz"; + hash = "sha256-hGoc34F7eAvHjdQHxcquNJhpwpL5CLfv2DBZKVmpcpw="; + }; + + prePatch = '' + patchShebangs . + ''; + + strictDeps = true; + + nativeBuildInputs = [ + bash-completion + autoreconfHook + makeWrapper + pkg-config + e2fsprogs # for Autoconf: xorriso, mkisofs + cdrkit # for Autoconf: mke2fs + ]; + + buildInputs = [ + bash-completion + gnutls + libtool + curl + xz + zlib-ng + libssh + libnbd + e2fsprogs + ]; + + configureFlags = [ + "--enable-linuxdisk" + "--enable-floppy" + "--with-ext2" + "--with-curl" + "--with-iso" + "--with-ssh" + "--with-zlib" + "--with-libnbd" + "--disable-rust" + "--disable-golang" + "--disable-perl" + "--disable-ocaml" + "--disable-tcl" + "--disable-lua" + "--without-libguestfs" + "--disable-example4" + ]; + + installFlags = [ "bashcompdir=$(out)/share/bash-completion/completions" ]; + + postInstall = '' + for bin in $out/bin/*; do + wrapProgram "$bin" \ + --prefix PATH : "$out/bin:${ + lib.makeBinPath [ + e2fsprogs + cdrkit + ] + }" + done + ''; + + passthru.tests.version = testers.testVersion { package = finalAttrs.finalPackage; }; + + meta = { + homepage = "https://gitlab.com/nbdkit/nbdkit"; + description = "NBD server with stable plugin ABI and permissive license"; + license = with lib.licenses; bsd3; + maintainers = with lib.maintainers; [ lukts30 ]; + platforms = lib.platforms.unix; + mainProgram = "nbdkit"; + }; +})