[med-svn] [Git][med-team/libbigwig][master] 7 commits: New upstream version 0.4.6+dfsg
Steffen Möller (@moeller)
gitlab at salsa.debian.org
Tue Sep 7 16:34:00 BST 2021
Steffen Möller pushed to branch master at Debian Med / libbigwig
Commits:
cfeb025e by Steffen Moeller at 2021-09-07T16:56:47+02:00
New upstream version 0.4.6+dfsg
- - - - -
b5ecf71e by Steffen Moeller at 2021-09-07T16:56:47+02:00
routine-update: New upstream version
- - - - -
7eab7395 by Steffen Moeller at 2021-09-07T16:56:48+02:00
Update upstream source from tag 'upstream/0.4.6+dfsg'
Update to upstream version '0.4.6+dfsg'
with Debian dir 1fe859f1b0d0e411c9f87bd85dddc80b53617993
- - - - -
3a751a16 by Steffen Moeller at 2021-09-07T16:56:49+02:00
routine-update: Standards-Version: 4.6.0
- - - - -
1bb0b53f by Steffen Moeller at 2021-09-07T16:56:49+02:00
routine-update: debhelper-compat 13
- - - - -
7f74468f by Steffen Moeller at 2021-09-07T17:00:05+02:00
d/u/metadata: Checked bio.tools
- - - - -
62373516 by Steffen Moeller at 2021-09-07T17:33:31+02:00
Updates for new upstream version.
- - - - -
17 changed files:
- + .environmentLinux.yaml
- + .github/workflows/build.yml
- .travis.yml
- Makefile
- bigWig.h
- bigWigIO.h
- bwRead.c
- bwValues.c
- bwValues.h
- bwWrite.c
- debian/changelog
- debian/control
- debian/libbigwig-dev.install
- debian/patches/Makefile.patch
- debian/rules
- debian/upstream/metadata
- test/test.py
Changes:
=====================================
.environmentLinux.yaml
=====================================
@@ -0,0 +1,10 @@
+name: foo
+channels:
+ - conda-forge
+ - bioconda
+ - default
+dependencies:
+ - gcc_linux-64
+ - curl
+ - zlib
+ - python 3.8
=====================================
.github/workflows/build.yml
=====================================
@@ -0,0 +1,20 @@
+on: pull_request
+jobs:
+ testLinux:
+ name: TestLinux
+ runs-on: "ubuntu-latest"
+ defaults:
+ run:
+ shell: bash -l {0}
+ steps:
+ - uses: actions/checkout at v2
+ - uses: conda-incubator/setup-miniconda at v2
+ with:
+ activate-environment: foo
+ environment-file: .environmentLinux.yaml
+ python-version: 3.8
+ auto-activate-base: false
+ - run: |
+ CFLAGS="$CFLAGS -g -Wall -O3 -Wsign-compare"
+ LIBS="$LDFLAGS -lcurl -lm -lz"
+ make test CC=$CC CFLAGS="$CFLAGS" LIBS="$LIBS"
=====================================
.travis.yml
=====================================
@@ -2,7 +2,10 @@ sudo: false
language: c
os:
- linux
- - osx
+# - osx
+arch:
+ - amd64
+ - ppc64le
script: make && make test
compiler:
- clang
=====================================
Makefile
=====================================
@@ -2,12 +2,28 @@ CC ?= gcc
AR ?= ar
RANLIB ?= ranlib
CFLAGS ?= -g -Wall -O3 -Wsign-compare
-LIBS = -lcurl -lm -lz
+LIBS = -lm -lz
EXTRA_CFLAGS_PIC = -fpic
LDFLAGS =
LDLIBS =
INCLUDES =
+# Create a simple test-program to check if gcc can compile with curl
+tmpfile:=$(shell mktemp --suffix=.c)
+$(file >$(tmpfile),#include <curl/curl.h>)
+$(file >>$(tmpfile),int main() { return 0; })
+HAVE_CURL:=$(shell $(CC) $(CFLAGS) $(EXTRA_CFLAGS_PIC) $(LIBS) -lcurl $(tmpfile) -o /dev/null >/dev/null 2>&1 && echo "YES")
+$(shell rm $(tmpfile))
+
+ifeq ($(HAVE_CURL),YES)
+ # If yes, add the library
+ LIBS += -lcurl
+else
+ # and if not, disable CURL specific code compilation
+ CFLAGS += -DNOCURL
+endif
+
+
prefix = /usr/local
includedir = $(prefix)/include
libdir = $(exec_prefix)/lib
=====================================
bigWig.h
=====================================
@@ -1,3 +1,6 @@
+#ifndef LIBBIGWIG_H
+#define LIBBIGWIG_H
+
#include "bigWigIO.h"
#include "bwValues.h"
#include <inttypes.h>
@@ -53,15 +56,18 @@ extern "C" {
/*!
* The library version number
*/
-#define LIBBIGWIG_VERSION 0.4.4
+#define LIBBIGWIG_VERSION 0.4.6
/*!
* If 1, then this library was compiled with remote file support.
*/
#ifdef NOCURL
#define LIBBIGWIG_CURL 0
+#ifndef CURLTYPE_DEFINED
+#define CURLTYPE_DEFINED
typedef int CURLcode;
typedef void CURL;
+#endif
#else
#define LIBBIGWIG_CURL 1
#endif
@@ -596,3 +602,5 @@ int bwAppendIntervalSpanSteps(bigWigFile_t *fp, float *values, uint32_t n);
#ifdef __cplusplus
}
#endif
+
+#endif // LIBBIGWIG_H
=====================================
bigWigIO.h
=====================================
@@ -1,9 +1,15 @@
+#ifndef LIBBIGWIG_IO_H
+#define LIBBIGWIG_IO_H
+
#ifndef NOCURL
#include <curl/curl.h>
#else
#include <stdio.h>
+#ifndef CURLTYPE_DEFINED
+#define CURLTYPE_DEFINED
typedef int CURLcode;
typedef void CURL;
+#endif
#define CURLE_OK 0
#define CURLE_FAILED_INIT 1
#endif
@@ -100,3 +106,5 @@ URL_t *urlOpen(char *fname, CURLcode (*callBack)(CURL*), const char* mode);
* @warning URL will no longer point to a valid location in memory!
*/
void urlClose(URL_t *URL);
+
+#endif // LIBBIGWIG_IO_H
=====================================
bwRead.c
=====================================
@@ -371,7 +371,7 @@ bigWigFile_t *bwOpen(char *fname, CURLcode (*callBack) (CURL*), const char *mode
}
//Read in the index
- if(bwg->hdr->nBasesCovered) {
+ if(bwg->hdr->indexOffset) {
bwg->idx = bwReadIndex(bwg, 0);
if(!bwg->idx) {
fprintf(stderr, "[bwOpen] bwg->idx is NULL bwg->hdr->dataOffset 0x%"PRIx64"!\n", bwg->hdr->dataOffset);
=====================================
bwValues.c
=====================================
@@ -1,6 +1,7 @@
#include "bigWig.h"
#include "bwCommon.h"
#include <stdlib.h>
+#include <math.h>
#include <string.h>
#include <zlib.h>
#include <errno.h>
@@ -719,9 +720,9 @@ bwOverlappingIntervals_t *bwGetValues(bigWigFile_t *fp, char *chrom, uint32_t st
if(!output) goto error;
if(includeNA) {
output->l = end-start;
- output->value = malloc((end-start)*sizeof(float));
+ output->value = malloc(output->l*sizeof(float));
if(!output->value) goto error;
- for(i=0; i<end-start; i++) output->value[i] = strtod("NaN", NULL);
+ for(i=0; i<output->l; i++) output->value[i] = NAN;
for(i=0; i<intermediate->l; i++) {
for(j=intermediate->start[i]; j<intermediate->end[i]; j++) {
if(j < start || j >= end) continue;
=====================================
bwValues.h
=====================================
@@ -1,3 +1,6 @@
+#ifndef LIBBIGWIG_VALUES_H
+#define LIBBIGWIG_VALUES_H
+
#include <inttypes.h>
/*! \file bwValues.h
*
@@ -70,3 +73,5 @@ typedef struct {
uint8_t type; /**<The block type: 1, bedGraph; 2, variable step; 3, fixed step.*/
uint16_t nItems; /**<The number of values in a given block.*/
} bwDataHeader_t;
+
+#endif // LIBBIGWIG_VALUES_H
=====================================
bwWrite.c
=====================================
@@ -1019,7 +1019,7 @@ error:
//Get all of the intervals and add them to the appropriate zoomBuffer
int constructZoomLevels(bigWigFile_t *fp) {
- bwOverlappingIntervals_t *intervals = NULL;
+ bwOverlapIterator_t *it = NULL;
double *sum = NULL, *sumsq = NULL;
uint32_t i, j, k;
@@ -1028,15 +1028,19 @@ int constructZoomLevels(bigWigFile_t *fp) {
if(!sum || !sumsq) goto error;
for(i=0; i<fp->cl->nKeys; i++) {
- intervals = bwGetOverlappingIntervals(fp, fp->cl->chrom[i], 0, fp->cl->len[i]);
- if(!intervals) goto error;
- for(j=0; j<intervals->l; j++) {
- for(k=0; k<fp->hdr->nLevels; k++) {
- if(addIntervalValue(fp, &(fp->writeBuffer->nNodes[k]), sum+k, sumsq+k, fp->writeBuffer->lastZoomBuffer[k], fp->hdr->bufSize/32, fp->hdr->zoomHdrs->level[k], i, intervals->start[j], intervals->end[j], intervals->value[j])) goto error;
- while(fp->writeBuffer->lastZoomBuffer[k]->next) fp->writeBuffer->lastZoomBuffer[k] = fp->writeBuffer->lastZoomBuffer[k]->next;
- }
- }
- bwDestroyOverlappingIntervals(intervals);
+ it = bwOverlappingIntervalsIterator(fp, fp->cl->chrom[i], 0, fp->cl->len[i], 100000);
+ if(!it) goto error;
+ while(it->data != NULL){
+ for(j=0;j<it->intervals->l;j++){
+ for(k=0;k<fp->hdr->nLevels;k++){
+ if(addIntervalValue(fp, &(fp->writeBuffer->nNodes[k]), sum+k, sumsq+k, fp->writeBuffer->lastZoomBuffer[k], fp->hdr->bufSize/32, fp->hdr->zoomHdrs->level[k], i, it->intervals->start[j], it->intervals->end[j], it->intervals->value[j])) goto error;
+ while(fp->writeBuffer->lastZoomBuffer[k]->next) fp->writeBuffer->lastZoomBuffer[k] = fp->writeBuffer->lastZoomBuffer[k]->next;
+ }
+ }
+ it = bwIteratorNext(it);
+ }
+ bwIteratorDestroy(it);
+
}
//Make an index for each zoom level
@@ -1046,13 +1050,14 @@ int constructZoomLevels(bigWigFile_t *fp) {
fp->hdr->zoomHdrs->idx[i]->blockSize = fp->writeBuffer->blockSize;
}
+
free(sum);
free(sumsq);
return 0;
error:
- if(intervals) bwDestroyOverlappingIntervals(intervals);
+ if(it) bwIteratorDestroy(it);
if(sum) free(sum);
if(sumsq) free(sumsq);
return 1;
=====================================
debian/changelog
=====================================
@@ -1,3 +1,11 @@
+libbigwig (0.4.6+dfsg-1) UNRELEASED; urgency=medium
+
+ * New upstream version
+ * Standards-Version: 4.6.0 (routine-update)
+ * debhelper-compat 13 (routine-update)
+
+ -- Steffen Moeller <moeller at debian.org> Tue, 07 Sep 2021 16:56:47 +0200
+
libbigwig (0.4.4+dfsg-2) unstable; urgency=medium
* Team upload.
=====================================
debian/control
=====================================
@@ -3,11 +3,11 @@ Maintainer: Debian Med Packaging Team <debian-med-packaging at lists.alioth.debian.
Uploaders: Steffen Moeller <moeller at debian.org>
Section: libs
Priority: optional
-Build-Depends: debhelper-compat (= 12),
+Build-Depends: debhelper-compat (= 13),
libcurl4-gnutls-dev|libcurl-dev,
zlib1g-dev
Build-Depends-Indep: doxygen
-Standards-Version: 4.5.0
+Standards-Version: 4.6.0
Vcs-Browser: https://salsa.debian.org/med-team/libbigwig
Vcs-Git: https://salsa.debian.org/med-team/libbigwig.git
Homepage: https://github.com/dpryan79/libBigWig/
=====================================
debian/libbigwig-dev.install
=====================================
@@ -1,5 +1,6 @@
usr/include/*
usr/lib/*/lib*.so
+usr/lib/*/libBigWig.a
#usr/lib/lib*.so
#usr/lib/*/pkgconfig/*
#usr/share/pkgconfig/*
=====================================
debian/patches/Makefile.patch
=====================================
@@ -1,30 +1,35 @@
-Index: libbigwig-0.4.2+dfsg/Makefile
+Index: libbigwig/Makefile
===================================================================
---- libbigwig-0.4.2+dfsg.orig/Makefile
-+++ libbigwig-0.4.2+dfsg/Makefile
-@@ -1,14 +1,18 @@
- CC ?= gcc
+--- libbigwig.orig/Makefile
++++ libbigwig/Makefile
+@@ -2,11 +2,16 @@ CC ?= gcc
AR ?= ar
RANLIB ?= ranlib
--CFLAGS ?= -g -Wall -O3 -Wsign-compare
-+CFLAGS ?= -g -Wall -O3 -Wsign-compare -flto
- LIBS = -lcurl -lm -lz
- EXTRA_CFLAGS_PIC = -fpic
--LDFLAGS =
+ CFLAGS ?= -g -Wall -O3 -Wsign-compare
++CFLAG += -flto
+VERSION=0.4.2
+MAJOR=$(shell echo $(VERSION)| cut -f1 -d.)
+LDFLAGS = -Wl,-soname,libBigWig.so.$(MAJOR) -Wl,-flto
+ LIBS = -lm -lz
+ EXTRA_CFLAGS_PIC = -fpic
+-LDFLAGS =
LDLIBS =
INCLUDES =
+DESTDIR =
+PREFIX ?= /usr
+ # Create a simple test-program to check if gcc can compile with curl
+ tmpfile:=$(shell mktemp --suffix=.c)
+@@ -24,7 +29,7 @@ else
+ endif
+
+
-prefix = /usr/local
+prefix = $(PREFIX)
includedir = $(prefix)/include
libdir = $(exec_prefix)/lib
-@@ -40,7 +44,13 @@ libBigWig.a: $(OBJS)
+@@ -56,7 +61,13 @@ libBigWig.a: $(OBJS)
$(AR) -rcs $@ $(OBJS)
$(RANLIB) $@
@@ -39,7 +44,7 @@ Index: libbigwig-0.4.2+dfsg/Makefile
$(CC) -shared $(LDFLAGS) -o $@ $(OBJS:.o=.pico) $(LDLIBS) $(LIBS)
test/testLocal: libBigWig.a
-@@ -56,7 +66,7 @@ test/testWrite: libBigWig.a
+@@ -72,7 +83,7 @@ test/testWrite: libBigWig.a
$(CC) -o $@ -I. $(CFLAGS) test/testWrite.c libBigWig.a $(LIBS)
test/exampleWrite: libBigWig.so
@@ -48,7 +53,7 @@ Index: libbigwig-0.4.2+dfsg/Makefile
test/testBigBed: libBigWig.a
$(CC) -o $@ -I. $(CFLAGS) test/testBigBed.c libBigWig.a $(LIBS)
-@@ -71,7 +81,7 @@ clean:
+@@ -87,7 +98,7 @@ clean:
rm -f *.o libBigWig.a libBigWig.so *.pico test/testLocal test/testRemote test/testWrite test/exampleWrite test/testRemoteManyContigs test/testBigBed test/testIterator example_output.bw
install: libBigWig.a libBigWig.so
=====================================
debian/rules
=====================================
@@ -27,6 +27,11 @@ override_dh_auto_install:
mv *.so.* $(CURDIR)/debian/tmp/usr/lib/$(shell dpkg-architecture -qDEB_TARGET_MULTIARCH)
# This is a symbolic link, not a copy
mv *.so $(CURDIR)/debian/tmp/usr/lib/$(shell dpkg-architecture -qDEB_TARGET_MULTIARCH)
+ mv $(CURDIR)/debian/tmp/usr/lib/*.a $(CURDIR)/debian/tmp/usr/lib/$(shell dpkg-architecture -qDEB_TARGET_MULTIARCH)/
+
+override_dh_missing:
+ rm -f debian/tmp/usr/lib/libBigWig.so
+ dh_missing
override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
=====================================
debian/upstream/metadata
=====================================
@@ -1,7 +1,10 @@
Bug-Database: https://github.com/dpryan79/libBigWig/issues
Bug-Submit: https://github.com/dpryan79/libBigWig/issues/new
+Repository: https://github.com/dpryan79/libBigWig.git
+Repository-Browse: https://github.com/dpryan79/libBigWig
Registry:
- Name: conda:bioconda
Entry: libbigwig
-Repository: https://github.com/dpryan79/libBigWig.git
-Repository-Browse: https://github.com/dpryan79/libBigWig
+ - Name: bio.tools
+ Entry: NA
+ Checked: 2021-09-07
=====================================
test/test.py
=====================================
@@ -72,3 +72,4 @@ except:
p2 = Popen(["md5"], stdin=p1.stdout, stdout=PIPE)
md5sum = p2.communicate()[0].strip().split()[0]
assert(md5sum == "33ef99571bdaa8c9130149e99332b17b")
+print("success")
View it on GitLab: https://salsa.debian.org/med-team/libbigwig/-/compare/304432cc234de1b51423e4ba286500f5c5d99647...62373516d6c65051fd7c14dd7ae7d2b59161fd4a
--
View it on GitLab: https://salsa.debian.org/med-team/libbigwig/-/compare/304432cc234de1b51423e4ba286500f5c5d99647...62373516d6c65051fd7c14dd7ae7d2b59161fd4a
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20210907/7d95bee4/attachment-0001.htm>
More information about the debian-med-commit
mailing list