From 35593f1538cd5b4e46ce2ee6836c5ce3668c9124 Mon Sep 17 00:00:00 2001 From: mencian Date: Tue, 19 Nov 2024 15:21:30 -0600 Subject: [PATCH] Build strelka on osx --- recipes/strelka/boost.cmake.patch | 24 ++++++++++++++++ recipes/strelka/build.sh | 36 +++++++++++++++++------ recipes/strelka/meta.yaml | 48 ++++++++++++++++++++++--------- 3 files changed, 85 insertions(+), 23 deletions(-) create mode 100644 recipes/strelka/boost.cmake.patch diff --git a/recipes/strelka/boost.cmake.patch b/recipes/strelka/boost.cmake.patch new file mode 100644 index 0000000000000..035893b50a683 --- /dev/null +++ b/recipes/strelka/boost.cmake.patch @@ -0,0 +1,24 @@ +diff --git a/src/cmake/boost.cmake b/src/cmake/boost.cmake +index 9b65798..9420db7 100644 +--- a/src/cmake/boost.cmake ++++ b/src/cmake/boost.cmake +@@ -44,7 +44,9 @@ macro (initBoostParams) + # for test, so we need two lists now: + set (THIS_BOOST_BUILD_COMPONENTS date_time filesystem program_options + serialization system timer chrono test) +- set (Boost_USE_STATIC_LIBS ON) ++ set( Boost_USE_STATIC_LIBS OFF ) ++ set( Boost_USE_MULTITHREADED TRUE ) ++ set( Boost_DEBUG ON ) + if (NOT WIN32) + # bjam on windows ignores this setting so skip for win32: + set (Boost_USE_MULTITHREADED OFF) +@@ -108,6 +110,8 @@ endif () + find_package(Boost ${THIS_BOOST_VERSION}) + if (Boost_FOUND) + find_package(Boost ${THIS_BOOST_VERSION} COMPONENTS ${THIS_BOOST_COMPONENTS} QUIET) ++ include_directories(${Boost_INCLUDE_DIRS}) ++ LINK_DIRECTORIES(${Boost_LIBRARY_DIRS}) + endif () + + # CMAKE_PARALLEL is only used if boost is found, but moving the setting here (outside of the if below) supresses a cmake warning: diff --git a/recipes/strelka/build.sh b/recipes/strelka/build.sh index 63d653355e610..8d691d3108834 100644 --- a/recipes/strelka/build.sh +++ b/recipes/strelka/build.sh @@ -5,12 +5,30 @@ outdir=$PREFIX/share/$PKG_NAME-$PKG_VERSION-$PKG_BUILDNUM mkdir -p $outdir mkdir -p $PREFIX/bin -cp -r bin lib libexec share $outdir -sed -i.bak \ - -e "s~scriptDir=.*~scriptDir='$outdir/bin'~" \ - -e "s~workflowDir=.*~workflowDir='$outdir/lib/python'~" \ - $outdir/bin/configure*.py -sed -i.bak \ - -e "s~scriptDir=.*~scriptDir='$outdir/bin'~" \ - $outdir/bin/run*.bash -ln -s $outdir/bin/config*.py $outdir/bin/run*.bash $PREFIX/bin +export INCLUDES="-I${PREFIX}/include" +export LIBPATH="-L${PREFIX}/lib" +export LDFLAGS="${LDFLAGS} -L${PREFIX}/lib" +export CXXFLAGS="${CXXFLAGS} -O3 -I${PREFIX}/include" + +if [[ `uname` == "Darwin" ]]; then + export CONFIG_ARGS="-DCMAKE_FIND_FRAMEWORK=NEVER -DCMAKE_FIND_APPBUNDLE=NEVER" +else + export CONFIG_ARGS="" +fi + +cmake -S . -B build -DCMAKE_INSTALL_PREFIX="${outdir}" \ + -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER="${CXX}" \ + -DCMAKE_CXX_FLAGS="${CXXFLAGS}" -DCMAKE_C_COMPILER="${CC}" \ + -DBOOST_ROOT="${PREFIX}" "${CONFIG_ARGS}" + +cmake --build build --target install -j "${CPU_COUNT}" -v + +#cp -r bin lib libexec share $outdir +#sed -i.bak \ +# -e "s~scriptDir=.*~scriptDir='$outdir/bin'~" \ +# -e "s~workflowDir=.*~workflowDir='$outdir/lib/python'~" \ +# $outdir/bin/configure*.py +#sed -i.bak \ +# -e "s~scriptDir=.*~scriptDir='$outdir/bin'~" \ +# $outdir/bin/run*.bash +ln -sf $outdir/bin/config*.py $outdir/bin/run*.bash $PREFIX/bin diff --git a/recipes/strelka/meta.yaml b/recipes/strelka/meta.yaml index 18ca2d5192d56..0583893f5a0d5 100644 --- a/recipes/strelka/meta.yaml +++ b/recipes/strelka/meta.yaml @@ -1,21 +1,34 @@ +{% set name = "strelka" %} {% set version = "2.9.10" %} -{% set sha256 = "bde30e34e06548c876ff63658efd3d7e6a2e7b465909243ab7e2ed599f83312b" %} +{% set sha256 = "45e78efec6e5272697f1d0a95851c7ae0d623dc8f93846e11fe37f15da9f1e30" %} package: - name: strelka - version: '{{ version }}' + name: {{ name }} + version: {{ version }} source: - url: https://github.com/Illumina/strelka/releases/download/v{{ version }}/strelka-{{ version }}.centos6_x86_64.tar.bz2 - sha256: '{{ sha256 }}' + url: https://github.com/Illumina/strelka/releases/download/v{{ version }}/{{ name }}-{{ version }}.release_src.tar.bz2 + sha256: {{ sha256 }} + patches: + - boost.cmake.patch build: - number: 1 - skip: true # [osx] + number: 2 + run_exports: + - {{ pin_subpackage('strelka', max_pin="x") }} requirements: + build: + - {{ compiler('cxx') }} + - cmake + - make + host: + - doxygen + - boost-cpp + - zlib run: - - python 2.7.* + - python <3 + - boost-cpp test: commands: @@ -23,13 +36,20 @@ test: - configureStrelkaSomaticWorkflow.py -h about: - home: https://github.com/Illumina/strelka - license: GPL-3.0 - license_family: GPL - summary: Strelka calls somatic and germline small variants from mapped sequencing reads + home: "https://github.com/Illumina/strelka" + license: "GPL-3.0-or-later" + license_family: GPL3 + license_file: "LICENSE.txt" + summary: "Strelka calls somatic and germline small variants from mapped sequencing reads." + dev_url: "https://github.com/Illumina/strelka" + doc_url: "https://github.com/Illumina/strelka/blob/v2.9.x/docs/userGuide/README.md" extra: identifiers: - biotools:strelka - skip-lints: - - should_be_noarch_generic + - usegalaxy-eu:strelka_germline + - usegalaxy-eu:strelka_somatic + - doi:10.1038/s41592-018-0051-x + additional-platforms: + - linux-aarch64 + - osx-arm64