Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

hap-py: init 0.3.15 #283881

Merged
merged 2 commits into from Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
50 changes: 50 additions & 0 deletions pkgs/by-name/ha/hap-py/boost-library-flags.patch
@@ -0,0 +1,50 @@
--- a/CMakeLists.txt 2023-02-01 23:55:18.171758209 +0100
+++ b/CMakeLists.txt 2023-02-02 19:32:16.574426531 +0100
@@ -23,25 +23,11 @@
set (VCFEVAL_AVAILABLE 0)
endif()

-execute_process(
- COMMAND ${CMAKE_SOURCE_DIR}/external/make_dependencies.sh
- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
- RESULT_VARIABLE EXTERNAL_SUCCESS)

-if(NOT "${EXTERNAL_SUCCESS}" STREQUAL "0")
- message(FATAL_ERROR "Building external dependencies has failed")
-endif()
-
-set(Boost_USE_STATIC_LIBS ON) # only find static libs
set(Boost_USE_MULTITHREADED ON)
-set(Boost_USE_STATIC_RUNTIME ON)

# un-break library finding
-set(Boost_NO_BOOST_CMAKE ON)
-set(Boost_NO_SYSTEM_PATHS ON)

-set(BOOST_ROOT ${CMAKE_BINARY_DIR})
-message("Using our own Boost, which was built at ${HAPLOTYPES_SOURCE_DIR}/external/boost_install")

find_package(Boost 1.55.0 COMPONENTS thread iostreams regex unit_test_framework filesystem system program_options REQUIRED)
include_directories(${Boost_INCLUDE_DIRS})
@@ -51,7 +51,8 @@
link_directories (${CMAKE_BINARY_DIR}/lib)

# make sure we use the bundled zlib version
-set(ZLIB_LIBRARIES ${CMAKE_BINARY_DIR}/lib/libz.a)
+# Additional flags for nix, found by trial and error
+set(ZLIB_LIBRARIES -lz -lbz2 -lcurl -lcrypto -llzma)

include_directories (${HAPLOTYPES_SOURCE_DIR}/external/klib)
include_directories (${HAPLOTYPES_SOURCE_DIR}/external/intervaltree)
@@ -84,11 +86,6 @@
${CMAKE_THREAD_LIBS_INIT})


-execute_process(COMMAND git describe --tags --always
- OUTPUT_VARIABLE HAPLOTYPES_VERSION
- WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
- OUTPUT_STRIP_TRAILING_WHITESPACE
-)

configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/c++/include/Version.hh.in"
"${CMAKE_BINARY_DIR}/include/Version.hh")
92 changes: 92 additions & 0 deletions pkgs/by-name/ha/hap-py/package.nix
@@ -0,0 +1,92 @@
{
autoconf,
bcftools,
boost,
bzip2,
cmake,
curl,
fetchFromGitHub,
htslib,
lib,
makeWrapper,
perl,
python3,
rtg-tools,
samtools,
stdenv,
xz,
zlib,
}:

let
# Bcftools needs perl
runtime = [
bcftools
htslib
my-python
perl
samtools
];
my-python-packages =
p: with p; [
bx-python
pysam
pandas
psutil
scipy
];
my-python = python3.withPackages my-python-packages;
in
stdenv.mkDerivation rec {
pname = "hap.py";
version = "0.3.15";

src = fetchFromGitHub {
owner = "Illumina";
repo = pname;
rev = "v${version}";
sha256 = "sha256-K8XXhioMGMHw56MKvp0Eo8S6R36JczBzGRaBz035zRQ=";
};
# For illumina script
BOOST_ROOT = "${boost.out}";
ZLIBSTATIC = "${zlib.static}";
# For cmake : boost lib and includedir are in differernt location
BOOST_LIBRARYDIR = "${boost.out}/lib";
BOOST_INCLUDEDIR = "${boost.dev}/include";

patches = [
# Compatibility with nix for boost and library flags : zlib, bzip2, curl, crypto, lzma
./boost-library-flags.patch
# Update to python3
./python3.patch
];
nativeBuildInputs = [
autoconf
cmake
makeWrapper
];
buildInputs = [
boost
bzip2
curl
htslib
my-python
rtg-tools
xz
zlib
];

postFixup = ''
wrapProgram $out/bin/hap.py \
--set PATH ${lib.makeBinPath runtime} \
--add-flags "--engine-vcfeval-path=${rtg-tools}/bin/rtg"
'';

meta = with lib; {
description = "Compare genetics variants against a gold dataset";
homepage = "https://github.com/Illumina/hap.py";
license = licenses.bsd2;
maintainers = with maintainers; [ apraga ];
mainProgram = "hap.py";
};
}