diff options
author | Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> | 2015-02-26 16:34:49 +0100 |
---|---|---|
committer | Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> | 2015-03-02 17:23:56 +0100 |
commit | 191c710139af3e833f32b24ce1f225c344620bb3 (patch) | |
tree | 5a6e3883c834857258a087b12e98ac4487a8f929 /gnu/packages/patches/crossmap-allow-system-pysam.patch | |
parent | 1385d37a6e8b1218d38a57d08ee654a7ec8f6b21 (diff) | |
download | guix-191c710139af3e833f32b24ce1f225c344620bb3.tar.gz |
gnu: Add crossmap.
* gnu/packages/bioinformatics.scm (crossmap): New variable. * gnu/packages/patches/crossmap-allow-system-pysam.patch: New file. * gnu-system.am (dist_patch_DATA): Add it.
Diffstat (limited to 'gnu/packages/patches/crossmap-allow-system-pysam.patch')
-rw-r--r-- | gnu/packages/patches/crossmap-allow-system-pysam.patch | 121 |
1 files changed, 121 insertions, 0 deletions
diff --git a/gnu/packages/patches/crossmap-allow-system-pysam.patch b/gnu/packages/patches/crossmap-allow-system-pysam.patch new file mode 100644 index 0000000000..611c4ff74d --- /dev/null +++ b/gnu/packages/patches/crossmap-allow-system-pysam.patch @@ -0,0 +1,121 @@ +This patch modifies the build process such that the bundled copy of pysam does +not need to be built if CROSSMAP_USE_SYSTEM_PYSAM is set and the pysam module +can be imported. + +Upstream has agreed to apply the patch in the next maintenance release of +crossmap. The patch has already been uploaded to +http://sourceforge.net/projects/crossmap/files/patch/. + +diff --git a/setup.py b/setup.py +--- a/setup.py 2015-02-26 15:28:49.771189185 +0100 ++++ b/setup.py 2015-02-26 15:55:03.440327752 +0100 +@@ -19,6 +19,15 @@ + except: + have_numpy = False + ++try: ++ import pysam ++ if os.environ['CROSSMAP_USE_SYSTEM_PYSAM']: ++ have_pysam = True ++ else: ++ have_pysam = False ++except ImportError: ++ have_pysam = False ++ + if platform.system()=='Windows': + print >> sys.stderr, "Sorry, Windows platform is not supported!" + sys.exit() +@@ -165,49 +174,50 @@ + + + #================= pysam samtools ==================== +- extensions.append(Extension( +- "pysam.csamtools", +- csamtools_sources + [ "lib/pysam/%s" % x for x in ("pysam_util.c", )] +\ +- glob.glob( os.path.join( "lib/samtools", "*.pysam.c" )) +\ +- os_c_files + \ +- glob.glob( os.path.join( "lib/samtools", "*", "*.pysam.c" ) ), +- library_dirs=[], +- include_dirs=[ "lib/samtools", "lib/pysam" ] + include_os, +- libraries=[ "z", ], +- language="c", +- define_macros = [('_FILE_OFFSET_BITS','64'),('_USE_KNETFILE','')], +- )) +- +- extensions.append(Extension( +- "pysam.ctabix", +- tabix_sources + [ "lib/pysam/%s" % x for x in ( "tabix_util.c", )] +\ +- os_c_files + \ +- glob.glob( os.path.join( "lib/tabix", "*.pysam.c" ) ), +- library_dirs=[], +- include_dirs=[ "lib/tabix", "lib/pysam" ] + include_os, +- libraries=[ "z", ], +- language="c", +- define_macros = [('_FILE_OFFSET_BITS','64'), +- ('_USE_KNETFILE','')], +- )) +- +- extensions.append(Extension( +- "pysam.TabProxies", +- tabproxies_sources + os_c_files, +- library_dirs=[], +- include_dirs= include_os, +- libraries=[ "z", ], +- language="c", +- )) +- +- extensions.append(Extension( +- "pysam.cvcf", +- cvcf_sources + os_c_files, +- library_dirs=[], +- include_dirs= ["lib/tabix",] + include_os, +- libraries=[ "z", ], +- language="c", +- )) ++ if not have_pysam: ++ extensions.append(Extension( ++ "pysam.csamtools", ++ csamtools_sources + [ "lib/pysam/%s" % x for x in ("pysam_util.c", )] +\ ++ glob.glob( os.path.join( "lib/samtools", "*.pysam.c" )) +\ ++ os_c_files + \ ++ glob.glob( os.path.join( "lib/samtools", "*", "*.pysam.c" ) ), ++ library_dirs=[], ++ include_dirs=[ "lib/samtools", "lib/pysam" ] + include_os, ++ libraries=[ "z", ], ++ language="c", ++ define_macros = [('_FILE_OFFSET_BITS','64'),('_USE_KNETFILE','')], ++ )) ++ ++ extensions.append(Extension( ++ "pysam.ctabix", ++ tabix_sources + [ "lib/pysam/%s" % x for x in ( "tabix_util.c", )] +\ ++ os_c_files + \ ++ glob.glob( os.path.join( "lib/tabix", "*.pysam.c" ) ), ++ library_dirs=[], ++ include_dirs=[ "lib/tabix", "lib/pysam" ] + include_os, ++ libraries=[ "z", ], ++ language="c", ++ define_macros = [('_FILE_OFFSET_BITS','64'), ++ ('_USE_KNETFILE','')], ++ )) ++ ++ extensions.append(Extension( ++ "pysam.TabProxies", ++ tabproxies_sources + os_c_files, ++ library_dirs=[], ++ include_dirs= include_os, ++ libraries=[ "z", ], ++ language="c", ++ )) ++ ++ extensions.append(Extension( ++ "pysam.cvcf", ++ cvcf_sources + os_c_files, ++ library_dirs=[], ++ include_dirs= ["lib/tabix",] + include_os, ++ libraries=[ "z", ], ++ language="c", ++ )) + + + return extensions |