Gentoo Archives: gentoo-commits

From: David Seifert <soap@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-biology/STAR/, sci-biology/STAR/files/
Date: Sat, 19 Feb 2022 19:56:16
Message-Id: 1645300561.49b36caac2597482c792bee0884ae34bea231806.soap@gentoo
1 commit: 49b36caac2597482c792bee0884ae34bea231806
2 Author: David Seifert <soap <AT> gentoo <DOT> org>
3 AuthorDate: Sat Feb 19 19:56:01 2022 +0000
4 Commit: David Seifert <soap <AT> gentoo <DOT> org>
5 CommitDate: Sat Feb 19 19:56:01 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=49b36caa
7
8 sci-biology/STAR: unbundle htslib properly
9
10 Closes: https://bugs.gentoo.org/833770
11 Signed-off-by: David Seifert <soap <AT> gentoo.org>
12
13 sci-biology/STAR/STAR-2.7.10a.ebuild | 8 +
14 .../STAR/files/STAR-2.7.10a-fix-build-system.patch | 195 +++++++++++++++++++++
15 2 files changed, 203 insertions(+)
16
17 diff --git a/sci-biology/STAR/STAR-2.7.10a.ebuild b/sci-biology/STAR/STAR-2.7.10a.ebuild
18 index 6b1c5b15d482..7239efcfe45c 100644
19 --- a/sci-biology/STAR/STAR-2.7.10a.ebuild
20 +++ b/sci-biology/STAR/STAR-2.7.10a.ebuild
21 @@ -17,6 +17,7 @@ RDEPEND="sci-libs/htslib:="
22 DEPEND="${RDEPEND}"
23 BDEPEND="virtual/pkgconfig"
24
25 +PATCHES=( "${FILESDIR}"/${PN}-2.7.10a-fix-build-system.patch )
26 DOCS=( README.md CHANGES.md RELEASEnotes.md doc/STARmanual.pdf )
27
28 pkg_pretend() {
29 @@ -27,6 +28,13 @@ pkg_setup() {
30 [[ ${MERGE_TYPE} != binary ]] && tc-check-openmp
31 }
32
33 +src_prepare() {
34 + default
35 +
36 + # remove bundled htslib
37 + rm -r source/htslib || die
38 +}
39 +
40 src_configure() {
41 tc-export CC CXX PKG_CONFIG
42 }
43
44 diff --git a/sci-biology/STAR/files/STAR-2.7.10a-fix-build-system.patch b/sci-biology/STAR/files/STAR-2.7.10a-fix-build-system.patch
45 new file mode 100644
46 index 000000000000..0f06c94fb109
47 --- /dev/null
48 +++ b/sci-biology/STAR/files/STAR-2.7.10a-fix-build-system.patch
49 @@ -0,0 +1,195 @@
50 +--- a/source/bam_cat.c
51 ++++ b/source/bam_cat.c
52 +@@ -52,8 +52,8 @@
53 + #include <stdlib.h>
54 + #include <unistd.h>
55 +
56 +-#include "htslib/htslib/bgzf.h"
57 +-#include "htslib/htslib/sam.h"
58 ++#include <htslib/bgzf.h>
59 ++#include <htslib/sam.h>
60 + #include <cstring>
61 +
62 + #define BUF_SIZE 0x10000
63 +--- a/source/bam_cat.h
64 ++++ b/source/bam_cat.h
65 +@@ -1,7 +1,7 @@
66 + #ifndef CODE_bam_cat
67 + #define CODE_bam_cat
68 +
69 +-#include "htslib/htslib/sam.h"
70 ++#include <htslib/sam.h>
71 +
72 + int bam_cat(int nfn, char * const *fn, const bam_hdr_t *h, const char* outbam);
73 +
74 +--- a/source/BAMfunctions.cpp
75 ++++ b/source/BAMfunctions.cpp
76 +@@ -1,5 +1,5 @@
77 + #include "BAMfunctions.h"
78 +-#include "htslib/htslib/kstring.h"
79 ++#include <htslib/kstring.h>
80 +
81 +
82 + string bam_cigarString (bam1_t *b) {//output CIGAR string
83 +--- a/source/bamRemoveDuplicates.cpp
84 ++++ b/source/bamRemoveDuplicates.cpp
85 +@@ -1,7 +1,7 @@
86 + #include <unordered_map>
87 + #include "bamRemoveDuplicates.h"
88 + #include <iostream>
89 +-#include "htslib/htslib/sam.h"
90 ++#include <htslib/sam.h>
91 + #include "IncludeDefine.h"
92 + #include SAMTOOLS_BGZF_H
93 + #include "ErrorWarning.h"
94 +--- a/source/IncludeDefine.h
95 ++++ b/source/IncludeDefine.h
96 +@@ -30,8 +30,8 @@
97 + #define ERROR_OUT string ( __FILE__ ) +":"+ to_string ( (uint) __LINE__ ) +":"+ string ( __FUNCTION__ )
98 +
99 + //external libs
100 +-#define SAMTOOLS_BGZF_H "htslib/htslib/bgzf.h"
101 +-#define SAMTOOLS_SAM_H "htslib/htslib/sam.h"
102 ++#define SAMTOOLS_BGZF_H <htslib/bgzf.h>
103 ++#define SAMTOOLS_SAM_H <htslib/sam.h>
104 +
105 + using namespace std;
106 +
107 +--- a/source/Makefile
108 ++++ b/source/Makefile
109 +@@ -12,11 +12,7 @@
110 + CXX ?= g++
111 +
112 + # pre-defined flags
113 +-LDFLAGS_shared := -pthread -Lhtslib -Bstatic -lhts -Bdynamic -lz
114 +-LDFLAGS_static := -static -static-libgcc -pthread -Lhtslib -lhts -lz
115 +-LDFLAGS_Mac :=-pthread -lz htslib/libhts.a
116 +-LDFLAGS_Mac_static :=-pthread -lz -static-libgcc htslib/libhts.a
117 +-LDFLAGS_gdb := $(LDFLAGS_shared)
118 ++LIBS := -pthread -lhts -lz
119 +
120 + DATE_FMT = --iso-8601=seconds
121 + ifdef SOURCE_DATE_EPOCH
122 +@@ -27,7 +23,7 @@
123 +
124 + BUILD_PLACE ?= $(HOSTNAME):$(shell pwd)
125 +
126 +-COMPTIMEPLACE := -D'COMPILATION_TIME_PLACE="$(BUILD_DATE) $(BUILD_PLACE)"'
127 ++COMPTIMEPLACE := -D'COMPILATION_TIME_PLACE=""'
128 +
129 +
130 + GIT_CHECK := $(shell git status 1> /dev/null 2> /dev/null && echo 0)
131 +@@ -41,13 +37,13 @@
132 +
133 + # Defaults, can be overridden by make arguments or environment
134 + CXXFLAGS ?= -pipe -Wall -Wextra
135 +-CFLAGS ?= -pipe -Wall -Wextra -O3
136 ++CFLAGS ?= -pipe -Wall -Wextra
137 + CXXFLAGS_SIMD ?= -mavx2
138 +
139 + # Unconditionally set essential flags and optimization options
140 + CXXFLAGS_common := -std=c++11 -fopenmp $(COMPTIMEPLACE) $(GIT_BRANCH_COMMIT_DIFF)
141 +-CXXFLAGS_main := -O3 $(CXXFLAGS_common)
142 +-CXXFLAGS_gdb := -O0 -g3 $(CXXFLAGS_common)
143 ++CXXFLAGS_main := $(CXXFLAGS_common)
144 ++CXXFLAGS_gdb := $(CXXFLAGS_common)
145 +
146 + ##########################################################################################################
147 + OBJECTS = SoloFeature_collapseUMI_Graph.o SoloFeature_collapseUMIall_multiMappers.o ParametersClip_initialize.o ClipMate_clip.o ClipCR4.o opal/opal.o ClipMate_clipChunk.o ClipMate_initialize.o \
148 +@@ -130,7 +126,7 @@
149 + ifneq ($(MAKECMDGOALS),clean_solo)
150 + ifneq ($(MAKECMDGOALS),STARforMac)
151 + ifneq ($(MAKECMDGOALS),STARforMacGDB)
152 +-Depend.list: $(SOURCES) parametersDefault.xxd htslib
153 ++Depend.list: $(SOURCES) parametersDefault.xxd
154 + echo $(SOURCES)
155 + 'rm' -f ./Depend.list
156 + $(CXX) $(CXXFLAGS_common) -MM $^ >> Depend.list
157 +@@ -142,57 +138,43 @@
158 + endif
159 + endif
160 +
161 +-htslib : htslib/libhts.a
162 +-
163 +-htslib/libhts.a :
164 +- $(MAKE) -C htslib lib-static
165 +-
166 + parametersDefault.xxd: parametersDefault
167 + xxd -i parametersDefault > parametersDefault.xxd
168 +
169 + STAR$(SFX) : CXXFLAGS := $(CXXFLAGSextra) $(CXXFLAGS_main) $(CXXFLAGS)
170 +-STAR$(SFX) : LDFLAGS := $(LDFLAGSextra) $(LDFLAGS_shared) $(LDFLAGS)
171 + STAR$(SFX) : Depend.list parametersDefault.xxd $(OBJECTS)
172 +- $(CXX) -o STAR$(SFX) $(CXXFLAGS) $(OBJECTS) $(LDFLAGS)
173 ++ $(CXX) $(LDFLAGS) -o STAR$(SFX) $(CXXFLAGS) $(OBJECTS) $(LIBS)
174 +
175 + STARstatic$(SFX) : CXXFLAGS := $(CXXFLAGSextra) $(CXXFLAGS_main) $(CXXFLAGS)
176 +-STARstatic$(SFX) : LDFLAGS := $(LDFLAGSextra) $(LDFLAGS_static) $(LDFLAGS)
177 + STARstatic$(SFX) : Depend.list parametersDefault.xxd $(OBJECTS)
178 +- $(CXX) -o STAR$(SFX) $(CXXFLAGS) $(OBJECTS) $(LDFLAGS)
179 ++ $(CXX) $(LDFLAGS) -o STAR$(SFX) $(CXXFLAGS) $(OBJECTS) $(LIBS)
180 +
181 + STARlong$(SFX) : CXXFLAGS := $(CXXFLAGSextra) $(CXXFLAGS_main) -D'COMPILE_FOR_LONG_READS' $(CXXFLAGS)
182 +-STARlong$(SFX) : LDFLAGS := $(LDFLAGSextra) $(LDFLAGS_shared) $(LDFLAGS)
183 + STARlong$(SFX) : Depend.list parametersDefault.xxd $(OBJECTS)
184 +- $(CXX) -o STARlong$(SFX) $(CXXFLAGS) $(OBJECTS) $(LDFLAGS)
185 ++ $(CXX) $(LDFLAGS) -o STARlong$(SFX) $(CXXFLAGS) $(OBJECTS) $(LIBS)
186 +
187 + STARlongStatic$(SFX) : CXXFLAGS := $(CXXFLAGSextra) $(CXXFLAGS_main) -D'COMPILE_FOR_LONG_READS' $(CXXFLAGS)
188 +-STARlongStatic$(SFX) : LDFLAGS := $(LDFLAGSextra) $(LDFLAGS_static) $(LDFLAGS)
189 + STARlongStatic$(SFX) : Depend.list parametersDefault.xxd $(OBJECTS)
190 +- $(CXX) -o STARlong$(SFX) $(CXXFLAGS) $(OBJECTS) $(LDFLAGS)
191 ++ $(CXX) $(LDFLAGS) -o STARlong$(SFX) $(CXXFLAGS) $(OBJECTS) $(LIBS)
192 +
193 +
194 +
195 + POSIXSHARED : CXXFLAGS := $(CXXFLAGSextra) $(CXXFLAGS_main) -DPOSIX_SHARED_MEM $(CXXFLAGS)
196 +-POSIXSHARED : LDFLAGS := $(LDFLAGSextra) $(LDFLAGS_shared) $(LDFLAGS)
197 + POSIXSHARED : Depend.list parametersDefault.xxd $(OBJECTS)
198 +- $(CXX) -o STAR$(SFX) $(CXXFLAGS) $(OBJECTS) $(LDFLAGS)
199 ++ $(CXX) $(LDFLAGS) -o STAR$(SFX) $(CXXFLAGS) $(OBJECTS) $(LIBS)
200 +
201 + gdb : CXXFLAGS := $(CXXFLAGSextra) $(CXXFLAGS_gdb) $(CXXFLAGS)
202 +-gdb : LDFLAGS := $(LDFLAGSextra) $(LDFLAGS_gdb) $(LDFLAGS)
203 + gdb : Depend.list parametersDefault.xxd $(OBJECTS)
204 +- $(CXX) -o STAR $(CXXFLAGS) $(OBJECTS) $(LDFLAGS)
205 ++ $(CXX) $(LDFLAGS) -o STAR $(CXXFLAGS) $(OBJECTS) $(LIBS)
206 +
207 + gdb-long : CXXFLAGS := $(CXXFLAGSextra) $(CXXFLAGS_gdb) -D'COMPILE_FOR_LONG_READS' $(CXXFLAGS)
208 +-gdb-long : LDFLAGS := $(LDFLAGSextra) $(LDFLAGS_gdb) $(LDFLAGS)
209 + gdb-long : Depend.list parametersDefault.xxd $(OBJECTS)
210 +- $(CXX) -o STARlong $(CXXFLAGS) $(OBJECTS) $(LDFLAGS)
211 ++ $(CXX) $(LDFLAGS) -o STARlong $(CXXFLAGS) $(OBJECTS) $(LIBS)
212 +
213 + STARforMacStatic : CXXFLAGS := $(CXXFLAGSextra) $(CXXFLAGS_main) -D'COMPILE_FOR_MAC' $(CXXFLAGS)
214 +-STARforMacStatic : LDFLAGS := $(LDFLAGSextra) $(LDFLAGS_Mac_static) $(LDFLAGS)
215 + STARforMacStatic : Depend.list parametersDefault.xxd $(OBJECTS)
216 +- $(CXX) -o STAR $(CXXFLAGS) $(OBJECTS) $(LDFLAGS)
217 ++ $(CXX) $(LDFLAGS) -o STAR $(CXXFLAGS) $(OBJECTS) $(LIBS)
218 +
219 + STARlongForMacStatic : CXXFLAGS := -D'COMPILE_FOR_LONG_READS' $(CXXFLAGSextra) $(CXXFLAGS_main) -D'COMPILE_FOR_MAC' $(CXXFLAGS)
220 +-STARlongForMacStatic : LDFLAGS := $(LDFLAGSextra) $(LDFLAGS_Mac_static) $(LDFLAGS)
221 + STARlongForMacStatic : Depend.list parametersDefault.xxd $(OBJECTS)
222 +- $(CXX) -o STARlong $(CXXFLAGS) $(OBJECTS) $(LDFLAGS)
223 ++ $(CXX) $(LDFLAGS) -o STARlong $(CXXFLAGS) $(OBJECTS) $(LIBS)
224 +--- a/source/signalFromBAM.h
225 ++++ b/source/signalFromBAM.h
226 +@@ -1,6 +1,6 @@
227 + #ifndef CODE_signalFromBAM
228 + #define CODE_signalFromBAM
229 +-#include "htslib/htslib/sam.h"
230 ++#include <htslib/sam.h>
231 + #include <fstream>
232 + #include <string>
233 + #include "Stats.h"
234 +--- a/source/STAR.cpp
235 ++++ b/source/STAR.cpp
236 +@@ -29,7 +29,7 @@
237 +
238 + #include "twoPassRunPass1.h"
239 +
240 +-#include "htslib/htslib/sam.h"
241 ++#include <htslib/sam.h>
242 + #include "parametersDefault.xxd"
243 +
244 + void usage(int usageType) {