mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 14:54:29 +01:00
Merge pull request #324590 from natsukium/truvari/update
truvari: 4.1.0 -> 4.2.2; abpoa: init at 1.5.1
This commit is contained in:
commit
72966ff6cf
4 changed files with 139 additions and 4 deletions
|
@ -15,14 +15,14 @@ let
|
|||
};
|
||||
in python3Packages.buildPythonApplication rec {
|
||||
pname = "truvari";
|
||||
version = "4.1.0";
|
||||
version = "4.2.2";
|
||||
pyproject = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "ACEnglish";
|
||||
repo = "truvari";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-HFVAv1TTL/nMjr62tQKhMdwh25P/y4nBGzSbxoJxMmo=";
|
||||
hash = "sha256-SFBVatcVavBfQtFbBcXifBX3YnKsxJS669vCcyjsBA4=";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
|
@ -31,11 +31,11 @@ in python3Packages.buildPythonApplication rec {
|
|||
patchShebangs repo_utils/test_files
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
build-system = [
|
||||
python3Packages.setuptools
|
||||
];
|
||||
|
||||
propagatedBuildInputs = with python3Packages; [
|
||||
dependencies = with python3Packages; [
|
||||
pywfa
|
||||
rich
|
||||
edlib
|
||||
|
@ -46,6 +46,7 @@ in python3Packages.buildPythonApplication rec {
|
|||
pytabix
|
||||
bwapy
|
||||
pandas
|
||||
pyabpoa
|
||||
];
|
||||
|
||||
makeWrapperArgs = [
|
||||
|
|
102
pkgs/by-name/ab/abpoa/package.nix
Normal file
102
pkgs/by-name/ab/abpoa/package.nix
Normal file
|
@ -0,0 +1,102 @@
|
|||
{
|
||||
lib,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
simde,
|
||||
zlib,
|
||||
enableSse4_1 ? stdenv.hostPlatform.sse4_1Support,
|
||||
enableAvx ? stdenv.hostPlatform.avxSupport,
|
||||
enablePython ? false,
|
||||
python3Packages,
|
||||
runCommand,
|
||||
abpoa,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "${lib.optionalString enablePython "py"}abpoa";
|
||||
version = "1.5.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "yangao07";
|
||||
repo = "abPOA";
|
||||
rev = "refs/tags/v${finalAttrs.version}";
|
||||
hash = "sha256-nPMzkWkjUI+vZExNEvJa24KrR0pWGk89Mvp7TCyka/w=";
|
||||
};
|
||||
|
||||
patches = [ ./simd-arch.patch ];
|
||||
|
||||
postPatch = ''
|
||||
cp -r ${simde.src}/* include/simde
|
||||
substituteInPlace Makefile \
|
||||
--replace-fail "-march=native" ""
|
||||
'';
|
||||
|
||||
nativeBuildInputs = lib.optionals enablePython (
|
||||
with python3Packages;
|
||||
[
|
||||
cython
|
||||
pypaBuildHook
|
||||
pypaInstallHook
|
||||
pythonImportsCheckHook
|
||||
setuptools
|
||||
]
|
||||
);
|
||||
|
||||
buildFlags = lib.optionals stdenv.hostPlatform.isx86_64 [
|
||||
(
|
||||
if enableAvx then
|
||||
"avx2=1"
|
||||
else if enableSse4_1 then
|
||||
"sse41=1"
|
||||
else
|
||||
"sse2=1"
|
||||
)
|
||||
];
|
||||
|
||||
env = lib.optionalAttrs enablePython (
|
||||
if enableAvx then
|
||||
{ "AVX2" = 1; }
|
||||
else if enableSse4_1 then
|
||||
{ "SSE41" = 1; }
|
||||
else
|
||||
{ "SSE2" = 1; }
|
||||
);
|
||||
|
||||
buildInputs = [ zlib ];
|
||||
|
||||
installPhase = lib.optionalString (!enablePython) ''
|
||||
runHook preInstall
|
||||
|
||||
install -Dm755 ./bin/abpoa -t $out/bin
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
pythonImportsCheck = [ "pyabpoa" ];
|
||||
|
||||
doInstallCheck = enablePython;
|
||||
|
||||
installCheckPhase = ''
|
||||
runHook preInstallCheck
|
||||
|
||||
python python/example.py
|
||||
|
||||
runHook postInstallCheck
|
||||
'';
|
||||
|
||||
passthru.tests = {
|
||||
simple = runCommand "${finalAttrs.pname}-test" { } ''
|
||||
${lib.getExe abpoa} ${abpoa.src}/test_data/seq.fa > $out
|
||||
'';
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "SIMD-based C library for fast partial order alignment using adaptive band";
|
||||
homepage = "https://github.com/yangao07/abPOA";
|
||||
changelog = "https://github.com/yangao07/abPOA/releases/tag/${finalAttrs.src.rev}";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ natsukium ];
|
||||
mainProgram = "abpoa";
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
})
|
27
pkgs/by-name/ab/abpoa/simd-arch.patch
Normal file
27
pkgs/by-name/ab/abpoa/simd-arch.patch
Normal file
|
@ -0,0 +1,27 @@
|
|||
diff --git a/setup.py b/setup.py
|
||||
index 52c0e7e..f88ec08 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -11,11 +11,12 @@ simde = ['-DUSE_SIMDE', '-DSIMDE_ENABLE_NATIVE_ALIASES']
|
||||
|
||||
if platform.system() == "Darwin":
|
||||
# note: see https://github.com/pypa/wheel/issues/406
|
||||
- simd_flag = ['-march=native', '-D__AVX2__', '-mmacosx-version-min=10.9']
|
||||
if platform.machine() in ["aarch64", "arm64"]:
|
||||
+ simd_flag = ['-march=armv8-a+simd', '-D__AVX2__', '-mmacosx-version-min=10.9']
|
||||
os.environ['_PYTHON_HOST_PLATFORM'] = "macosx-10.9-arm64"
|
||||
os.environ['ARCHFLAGS'] = "-arch arm64"
|
||||
else:
|
||||
+ simd_flag = ['-msse2', '-mmacosx-version-min=10.9']
|
||||
os.environ['_PYTHON_HOST_PLATFORM'] = "macosx-10.9-x86_64"
|
||||
os.environ['ARCHFLAGS'] = "-arch x86_64"
|
||||
else:
|
||||
@@ -24,7 +25,7 @@ else:
|
||||
elif platform.machine() in ["aarch32"]:
|
||||
simd_flag = ['-march=armv8-a+simd', '-mfpu=auto -D__AVX2__']
|
||||
else:
|
||||
- simd_flag=['-march=native']
|
||||
+ simd_flag=[]
|
||||
if os.getenv('SSE4', False):
|
||||
simd_flag=['-msse4.1']
|
||||
elif os.getenv('SSE2', False):
|
|
@ -10089,6 +10089,11 @@ self: super: with self; {
|
|||
|
||||
py65 = callPackage ../development/python-modules/py65 { };
|
||||
|
||||
pyabpoa = toPythonModule (pkgs.abpoa.override {
|
||||
enablePython = true;
|
||||
python3Packages = self;
|
||||
});
|
||||
|
||||
pyaehw4a1 = callPackage ../development/python-modules/pyaehw4a1 { };
|
||||
|
||||
pyatag = callPackage ../development/python-modules/pyatag { };
|
||||
|
|
Loading…
Reference in a new issue