diff --git a/pkgs/by-name/li/libstaden-read/libstaden-install-config-header.patch b/pkgs/by-name/li/libstaden-read/libstaden-install-config-header.patch new file mode 100644 index 000000000000..39df97a508a3 --- /dev/null +++ b/pkgs/by-name/li/libstaden-read/libstaden-install-config-header.patch @@ -0,0 +1,12 @@ +diff --git a/Makefile.am b/Makefile.am +index 31286d1..2631af1 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -61,6 +61,7 @@ man_MANS = \ + man/man4/Read.4 + + pkginclude_HEADERS = \ ++ io_lib_config.h \ + io_lib/Read.h \ + io_lib/scf_extras.h \ + io_lib/translate.h \ diff --git a/pkgs/by-name/li/libstaden-read/package.nix b/pkgs/by-name/li/libstaden-read/package.nix new file mode 100644 index 000000000000..dd2d93ae30a3 --- /dev/null +++ b/pkgs/by-name/li/libstaden-read/package.nix @@ -0,0 +1,47 @@ +{ lib +, stdenv +, autoreconfHook +, fetchFromGitHub +, bzip2 +, xz +, zlib +}: + +stdenv.mkDerivation (finalAttrs: { + # Same name as the Debian library + pname = "libstaden-read"; + version = "1.15.0"; + + src = fetchFromGitHub { + owner = "jkbonfield"; + repo = "io_lib"; + rev = "io_lib-" + builtins.replaceStrings ["."] ["-"] finalAttrs.version; + fetchSubmodules = true; + hash = "sha256-2Dlx+MXmqar81/Xmf0oE+6lWX461EDYijiZsZf/VD28="; + }; + + patches = [ + # Needed so that the lib can be detected + ./libstaden-install-config-header.patch + ]; + + buildInputs = [ bzip2 xz zlib ]; + nativeBuildInputs = [ autoreconfHook ]; + + # autoreconfHook does not descend into htscodecs folder + preAutoreconf = '' + pushd ./htscodecs + autoreconf --install --force --verbose + pushd + ''; + + meta = { + description = "C library for reading/writing various DNA sequence formats"; + homepage = "https://staden.sourceforge.net"; + downloadPage = "https://github.com/jkbonfield/io_lib/releases"; + changelog = "https://github.com/jkbonfield/io_lib/blob/${finalAttrs.src.rev}/CHANGES"; + license = with lib.licenses; [ bsd3 free ]; + platforms = lib.platforms.all; + maintainers = [ lib.maintainers.kupac ]; + }; +})