From 03385ca71264a4c5051aafdc9a5912c2843fa45a Mon Sep 17 00:00:00 2001 From: Pablo Date: Mon, 17 Jul 2023 12:37:50 +0200 Subject: [PATCH 1/2] add recipes needed for samtools Signed-off-by: Pablo --- recipes/htslib/1.1/meta.yaml | 2 +- recipes/htslib/1.3.1/meta.yaml | 2 +- recipes/htslib/fix_hwcapasimd.patch | 22 +++++++++++++++ recipes/htslib/meta.yaml | 8 +++--- recipes/samtools/1.17/build.sh | 9 +++++++ recipes/samtools/1.17/meta.yaml | 42 +++++++++++++++++++++++++++++ 6 files changed, 80 insertions(+), 5 deletions(-) create mode 100644 recipes/htslib/fix_hwcapasimd.patch create mode 100644 recipes/samtools/1.17/build.sh create mode 100644 recipes/samtools/1.17/meta.yaml diff --git a/recipes/htslib/1.1/meta.yaml b/recipes/htslib/1.1/meta.yaml index c178435..445cb04 100644 --- a/recipes/htslib/1.1/meta.yaml +++ b/recipes/htslib/1.1/meta.yaml @@ -3,7 +3,7 @@ package: version: "1.1" build: - number: 3 + number: 5 source: url: https://github.com/samtools/htslib/archive/1.1.tar.gz diff --git a/recipes/htslib/1.3.1/meta.yaml b/recipes/htslib/1.3.1/meta.yaml index cc82567..095ed52 100644 --- a/recipes/htslib/1.3.1/meta.yaml +++ b/recipes/htslib/1.3.1/meta.yaml @@ -3,7 +3,7 @@ package: version: "1.3.1" build: - number: 5 + number: 7 source: url: https://github.com/samtools/htslib/releases/download/1.3.1/htslib-1.3.1.tar.bz2 diff --git a/recipes/htslib/fix_hwcapasimd.patch b/recipes/htslib/fix_hwcapasimd.patch new file mode 100644 index 0000000..2a5202c --- /dev/null +++ b/recipes/htslib/fix_hwcapasimd.patch @@ -0,0 +1,22 @@ +diff --git a/htscodecs/htscodecs/rANS_static4x16pr.c b/htscodecs/htscodecs/rANS_static4x16pr.c +index b6d5580..43c7792 100644 +--- a/htscodecs/htscodecs/rANS_static4x16pr.c ++++ b/htscodecs/htscodecs/rANS_static4x16pr.c +@@ -1018,7 +1018,7 @@ static inline int have_neon() { + #if defined(__linux__) && defined(__arm__) + return (getauxval(AT_HWCAP) & HWCAP_NEON) != 0; + #elif defined(__linux__) && defined(__aarch64__) +- return (getauxval(AT_HWCAP) & HWCAP_ASIMD) != 0; ++ return (getauxval(AT_HWCAP) & 2) != 0; + #elif defined(__APPLE__) + return 1; + #elif defined(__FreeBSD__) && defined(__arm__) +@@ -1028,7 +1028,7 @@ static inline int have_neon() { + #elif defined(__FreeBSD__) && defined(__aarch64__) + u_long cap; + if (elf_aux_info(AT_HWCAP, &cap, sizeof cap) != 0) return 0; +- return (cap & HWCAP_ASIMD) != 0; ++ return (cap & 2) != 0; + #elif defined(_WIN32) + return IsProcessorFeaturePresent(PF_ARM_V8_INSTRUCTIONS_AVAILABLE) != 0; + #else diff --git a/recipes/htslib/meta.yaml b/recipes/htslib/meta.yaml index e4878d4..a3fa55b 100644 --- a/recipes/htslib/meta.yaml +++ b/recipes/htslib/meta.yaml @@ -1,17 +1,19 @@ -{% set version = "1.16" %} +{% set version = "1.17" %} package: name: htslib version: {{ version }} build: - number: 0 + number: 2 run_exports: - {{ pin_subpackage('htslib', max_pin='x.x') }} source: url: https://github.com/samtools/htslib/releases/download/{{ version }}/htslib-{{ version }}.tar.bz2 - sha256: 606b7c7aff73734cf033ecd156f40529fa5792f54524952a28938ca0890d7924 + sha256: 763779288c40f07646ec7ad98b96c378c739171d162ad98398868783b721839f + patches: + - fix_hwcapasimd.patch requirements: build: diff --git a/recipes/samtools/1.17/build.sh b/recipes/samtools/1.17/build.sh new file mode 100644 index 0000000..f460625 --- /dev/null +++ b/recipes/samtools/1.17/build.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +# Ensure we run successfully using either conda-forge or defaults ncurses +# (unlike other platforms, the latter does not automatically pull in libtinfo) +CURSES_LIB="-ltinfow -lncursesw" + +./configure --prefix=$PREFIX --with-htslib=system CURSES_LIB="$CURSES_LIB" +make all +make install diff --git a/recipes/samtools/1.17/meta.yaml b/recipes/samtools/1.17/meta.yaml new file mode 100644 index 0000000..8170e44 --- /dev/null +++ b/recipes/samtools/1.17/meta.yaml @@ -0,0 +1,42 @@ +{% set version = "1.17" %} + +package: + name: samtools + version: {{ version }} + +build: + number: 1 + +source: + url: https://github.com/samtools/samtools/releases/download/{{ version }}/samtools-{{ version }}.tar.bz2 + sha256: 3adf390b628219fd6408f14602a4c4aa90e63e18b395dad722ab519438a2a729 + +requirements: + build: + - make + - {{ compiler('c') }} + host: + - htslib + - ncurses + - zlib + run: + - htslib + - ncurses + - zlib + +about: + home: https://github.com/samtools/samtools + license: MIT + license_file: LICENSE + summary: Tools for dealing with SAM, BAM and CRAM files + +test: + commands: + - samtools --help + # test if https protocol works, if it doesnt samtools will fail with "Protocol not supported" + - samtools view 'https://example.com' 2>&1 | grep 'fail to read the header' -q + +extra: + identifiers: + - biotools:samtools + - usegalaxy-eu:samtools_flagstat From 3d3d06f2bfde7099ef58cc762d06ccb6e8eb82db Mon Sep 17 00:00:00 2001 From: Pablo Date: Mon, 17 Jul 2023 12:39:11 +0200 Subject: [PATCH 2/2] build samtools [ci build] Signed-off-by: Pablo --- recipes/samtools/meta.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/samtools/meta.yaml b/recipes/samtools/meta.yaml index 75b47f9..64ba152 100644 --- a/recipes/samtools/meta.yaml +++ b/recipes/samtools/meta.yaml @@ -40,3 +40,4 @@ extra: identifiers: - biotools:samtools - usegalaxy-eu:samtools_flagstat +