diff --git a/pkgs/development/libraries/science/biology/edlib/default.nix b/pkgs/development/libraries/science/biology/edlib/default.nix new file mode 100644 index 000000000000..b8ea4a55291a --- /dev/null +++ b/pkgs/development/libraries/science/biology/edlib/default.nix @@ -0,0 +1,30 @@ +{ lib, stdenv, fetchFromGitHub, cmake }: + +stdenv.mkDerivation rec { + pname = "edlib"; + version = "unstable-2021-08-20"; + + src = fetchFromGitHub { + owner = "Martinsos"; + repo = pname; + rev = "f8afceb49ab0095c852e0b8b488ae2c88e566afd"; + hash = "sha256-P/tFbvPBtA0MYCNDabW+Ypo3ltwP4S+6lRDxwAZ1JFo="; + }; + + nativeBuildInputs = [ cmake ]; + + doCheck = true; + checkPhase = '' + runHook preCheck + bin/runTests + runHook postCheck + ''; + + meta = with lib; { + homepage = "https://martinsos.github.io/edlib"; + description = "Lightweight, fast C/C++ library for sequence alignment using edit distance"; + maintainers = with maintainers; [ bcdarwin ]; + license = licenses.mit; + platforms = platforms.unix; + }; +} diff --git a/pkgs/development/python-modules/edlib/default.nix b/pkgs/development/python-modules/edlib/default.nix new file mode 100644 index 000000000000..30c3f8fb3b42 --- /dev/null +++ b/pkgs/development/python-modules/edlib/default.nix @@ -0,0 +1,36 @@ +{ lib +, buildPythonPackage +, pythonOlder +, fetchFromGitHub +, edlib +, cython +, python +}: + +buildPythonPackage { + inherit (edlib) pname src meta; + version = "1.3.9"; + + disabled = pythonOlder "3.6"; + + sourceRoot = "source/bindings/python"; + + preBuild = '' + ln -s ${edlib.src}/edlib . + ''; + + EDLIB_OMIT_README_RST = 1; + EDLIB_USE_CYTHON = 1; + + nativeBuildInputs = [ cython ]; + buildInputs = [ edlib ]; + + checkPhase = '' + runHook preCheck + ${python.interpreter} test.py + runHook postCheck + ''; + + pythonImportsCheck = [ "edlib" ]; + +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 3f2791b24f72..1f221a2ea605 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6675,6 +6675,8 @@ with pkgs; edk2-uefi-shell = callPackage ../tools/misc/edk2-uefi-shell { }; + edlib = callPackage ../development/libraries/science/biology/edlib { }; + eff = callPackage ../development/interpreters/eff { }; eflite = callPackage ../applications/audio/eflite {}; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 14ce70401c78..6fddaebdaf06 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2937,6 +2937,10 @@ self: super: with self; { editorconfig = callPackage ../development/python-modules/editorconfig { }; + edlib = callPackage ../development/python-modules/edlib { + inherit (pkgs) edlib; + }; + edward = callPackage ../development/python-modules/edward { }; effect = callPackage ../development/python-modules/effect { };