Gentoo Archives: gentoo-commits

From: Horea Christian <horea.christ@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/sci:master commit in: sci-biology/fsl/, sci-biology/fsl/files/
Date: Thu, 30 Jan 2020 15:22:54
Message-Id: 1580397748.f672571c8517da492b59e914aaa25e8786a6af61.chymera@gentoo
1 commit: f672571c8517da492b59e914aaa25e8786a6af61
2 Author: Horea Christian <chr <AT> chymera <DOT> eu>
3 AuthorDate: Thu Jan 30 15:22:28 2020 +0000
4 Commit: Horea Christian <horea.christ <AT> gmail <DOT> com>
5 CommitDate: Thu Jan 30 15:22:28 2020 +0000
6 URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=f672571c
7
8 sci-biology/fsl: version bump 6.0.2
9
10 Thanks to François Bissey <frp.bissey <AT> gmail.com>
11
12 Package-Manager: Portage-2.3.84, Repoman-2.3.20
13 Signed-off-by: Horea Christian <chr <AT> chymera.eu>
14
15 sci-biology/fsl/files/fsl-6.0.2-fsldir_redux.patch | 495 +++++++++++++++++++++
16 sci-biology/fsl/files/fsl-6.0.2-no_xmlpp.patch | 58 +++
17 .../fsl/files/fsl-6.0.2-qstring_compat.patch | 63 +++
18 sci-biology/fsl/files/fsl-6.0.2-setup.patch | 198 +++++++++
19 sci-biology/fsl/fsl-6.0.2.ebuild | 164 +++++++
20 5 files changed, 978 insertions(+)
21
22 diff --git a/sci-biology/fsl/files/fsl-6.0.2-fsldir_redux.patch b/sci-biology/fsl/files/fsl-6.0.2-fsldir_redux.patch
23 new file mode 100644
24 index 000000000..dc1babd48
25 --- /dev/null
26 +++ b/sci-biology/fsl/files/fsl-6.0.2-fsldir_redux.patch
27 @@ -0,0 +1,495 @@
28 +From 2bc4be1f55b27a733e1e624b34bc570187ba95e1 Mon Sep 17 00:00:00 2001
29 +From: François Bissey <frp.bissey@×××××.com>
30 +Date: Mon, 20 Jan 2020 11:40:53 +1300
31 +Subject: [PATCH] Making sure fsl code and executable can find other executable
32 + and data in standard location.
33 +
34 +---
35 + src/fast4/fast_two.cc | 8 ++++----
36 + src/feat5/feat_model.cc | 8 +++-----
37 + src/feat5/tsplot.cc | 7 +++----
38 + src/first/first_utils.cc | 4 ++--
39 + src/fnirt/fnirtfns.cpp | 11 ++++-------
40 + src/fslsurface/fslsurface_first.cc | 6 ++----
41 + src/fslsurface/fslsurfacemaths.cpp | 12 ------------
42 + src/libvis/miscpic.h | 7 +------
43 + src/melodic/meldata.cc | 4 ++--
44 + src/melodic/meloptions.cc | 8 --------
45 + src/melodic/meloptions.h | 1 -
46 + src/melodic/melreport.cc | 12 ++++++------
47 + src/melodic/melreport.h | 20 ++++++++++----------
48 + src/mm/mixture_model.cc | 4 ++--
49 + src/siena/siena_diff.cc | 28 +++++++++++++---------------
50 + src/topup/topupfns.cpp | 3 +--
51 + 16 files changed, 53 insertions(+), 90 deletions(-)
52 +
53 +diff --git a/src/fast4/fast_two.cc b/src/fast4/fast_two.cc
54 +index 592b5df..b525444 100644
55 +--- a/src/fast4/fast_two.cc
56 ++++ b/src/fast4/fast_two.cc
57 +@@ -166,7 +166,7 @@ int prior_registration(string inname, string main_prior_vol, NEWIMAGE::volume<fl
58 + string csfPriorName, grayPriorName, whitePriorName;
59 + if(alternatePriors.unset())
60 + {
61 +- string priorRootName=string(getenv("FSLDIR")) + "/data/standard/tissuepriors/avg152T1_";
62 ++ string priorRootName="@GENTOO_PORTAGE_EPREFIX@/usr/share/fsl/data/standard/tissuepriors/avg152T1_";
63 + csfPriorName = priorRootName+"csf";
64 + grayPriorName = priorRootName+"gray";
65 + whitePriorName = priorRootName+"white";
66 +@@ -215,15 +215,15 @@ string csfPriorName, grayPriorName, whitePriorName;
67 + if(bapused>0)
68 + {
69 + char reg[1024];
70 +- sprintf(reg, "%s/bin/flirt -ref %s -in %s -out %s -applyxfm -init %s", getenv("FSLDIR"), inname.c_str(), csfPriorName.c_str(), (main_prior_vol+"_csf_stdspace").c_str(), bapriori.value().c_str());
71 ++ sprintf(reg, "flirt -ref %s -in %s -out %s -applyxfm -init %s", inname.c_str(), csfPriorName.c_str(), (main_prior_vol+"_csf_stdspace").c_str(), bapriori.value().c_str());
72 + if(verbose.value())
73 + cout<<reg<<endl;
74 + system(reg);
75 +- sprintf(reg, "%s/bin/flirt -ref %s -in %s -out %s -applyxfm -init %s", getenv("FSLDIR"), inname.c_str(), grayPriorName.c_str(), (main_prior_vol+"_gm_stdspace").c_str(), bapriori.value().c_str());
76 ++ sprintf(reg, "flirt -ref %s -in %s -out %s -applyxfm -init %s", inname.c_str(), grayPriorName.c_str(), (main_prior_vol+"_gm_stdspace").c_str(), bapriori.value().c_str());
77 + if(verbose.value())
78 + cout<<reg<<endl;
79 + system(reg);
80 +- sprintf(reg, "%s/bin/flirt -ref %s -in %s -out %s -applyxfm -init %s", getenv("FSLDIR"), inname.c_str(), whitePriorName.c_str(), (main_prior_vol+"_wm_stdspace").c_str(), bapriori.value().c_str());
81 ++ sprintf(reg, "flirt -ref %s -in %s -out %s -applyxfm -init %s", inname.c_str(), whitePriorName.c_str(), (main_prior_vol+"_wm_stdspace").c_str(), bapriori.value().c_str());
82 + if(verbose.value())
83 + cout << reg << endl;
84 + system(reg);
85 +diff --git a/src/feat5/feat_model.cc b/src/feat5/feat_model.cc
86 +index 399a13e..e15e43c 100644
87 +--- a/src/feat5/feat_model.cc
88 ++++ b/src/feat5/feat_model.cc
89 +@@ -744,7 +744,7 @@ int main(int argc, char **argv)
90 + vector<int> G;
91 + vector<string> titles;
92 + float tr, mult, trmult, nltffwhm=0, maxconvwin=0;
93 +- char fl[10000], *FSLDIR;
94 ++ char fl[10000];
95 + string fn, filename;
96 + FONT_DATA *font_data = new FONT_DATA[1];
97 +
98 +@@ -763,8 +763,6 @@ int main(int argc, char **argv)
99 + if (argc==3)
100 + motionparams=remmean(read_ascii_matrix(argv[2]));
101 +
102 +- FSLDIR=getenv("FSLDIR");
103 +-
104 + fn = string(argv[1])+".fsf";
105 +
106 + level = atoi(find_line(fn, "fmri(level)", fl));
107 +@@ -1510,7 +1508,7 @@ int main(int argc, char **argv)
108 + writeCovarianceImage(string(argv[1])+"_cov.ppm", contrasts, F, nftests, realDesign, level, evs.eigenvals, font_data, contrasts.RE);
109 + writeImagePreview(string(argv[1])+".ppm", contrasts, F, nftests, realDesign, level, evs, font_data, titles, tr, nltffwhm, nTimepoints, G);
110 +
111 +- filename=string(getenv("FSLDIR"))+"/bin/wpng -q -overwrite "+string(argv[1])+".ppm ";
112 ++ filename="wpng -q -overwrite "+string(argv[1])+".ppm ";
113 + system(filename.c_str());
114 +
115 + return(0);
116 +@@ -2161,6 +2159,6 @@ char the_string[10000];
117 +
118 + fclose(outputfile);
119 +
120 +- filename=string(getenv("FSLDIR")) + "/bin/wpng -q -overwrite " + filename;
121 ++ filename="wpng -q -overwrite " + filename;
122 + system(filename.c_str());
123 + }
124 +diff --git a/src/feat5/tsplot.cc b/src/feat5/tsplot.cc
125 +index ae191fd..3a02b55 100644
126 +--- a/src/feat5/tsplot.cc
127 ++++ b/src/feat5/tsplot.cc
128 +@@ -293,7 +293,7 @@ int main(int argc, char **argv)
129 + ofstream outputFile;
130 + int numEVs, npts, numContrasts=1, nftests=0, GRPHSIZE(600), PSSIZE(600);
131 + vector<double> normalisedContrasts, model, triggers;
132 +- string fmriFileName, fslPath, featdir, vType, indexText;
133 ++ string fmriFileName, featdir, vType, indexText;
134 + ColumnVector NewimageVoxCoord(4),NiftiVoxCoord(4);
135 + bool outputText(true), useCoordinate(false), prewhiten(false), useTriggers(false), customMask(false), modelFree(false), isHigherLevel(false), outputDataOnly(false);
136 + bool zWeightClusters(true);
137 +@@ -307,7 +307,6 @@ volume<float> immask;
138 + if (argc<2) usage("");
139 + featdir=string(argv[1]);
140 + fmriFileName=featdir+"/filtered_func_data";
141 +- fslPath=string(getenv("FSLDIR"));
142 +
143 + string outputName(featdir);
144 +
145 +@@ -753,7 +752,7 @@ volume4D<float> acs;
146 + cerr << "Can't open output report file " << outputName << endl;
147 + exit(1);
148 + }
149 +- outputFile << "<HTML>\n<TITLE>"<< statType << num2str(i) <<"</TITLE>\n<BODY BACKGROUND=\"file:"<< fslPath <<"/doc/images/fsl-bg.jpg\">\n<hr><CENTER>\n<H1>FEAT Time Series Report - "<< statType << num2str(i) <<"</H1>\n</CENTER>\n<hr><b>Full plots</b><p>\n"<< graphText;
150 ++ outputFile << "<HTML>\n<TITLE>"<< statType << num2str(i) <<"</TITLE>\n<BODY BACKGROUND=\"file:"<< "@GENTOO_PORTAGE_EPREFIX@/usr/share/fsl/doc/images/fsl-bg.jpg\">\n<hr><CENTER>\n<H1>FEAT Time Series Report - "<< statType << num2str(i) <<"</H1>\n</CENTER>\n<hr><b>Full plots</b><p>\n"<< graphText;
151 + if (useTriggers) outputFile << "\n<hr><b>Peristimulus plots</b><p>\n"<< peristimulusText <<"\n<HR></BODY></HTML>\n\n";
152 + else outputFile << "\n</BODY></HTML>\n\n";
153 + outputFile.close();
154 +@@ -768,7 +767,7 @@ volume4D<float> acs;
155 + cerr << "Can't open output report file " << outputName << endl;
156 + exit(1);
157 + }
158 +- outputFile << "<HTML>\n<TITLE>FEAT Time Series Report</TITLE>\n<BODY BACKGROUND=\"file:" << fslPath << "/doc/images/fsl-bg.jpg\">\n<hr><CENTER>\n<H1>FEAT Time Series Report</H1>\n</CENTER>\n<hr>" << indexText << "<HR></BODY></HTML>" << endl << endl;
159 ++ outputFile << "<HTML>\n<TITLE>FEAT Time Series Report</TITLE>\n<BODY BACKGROUND=\"file:" << "@GENTOO_PORTAGE_EPREFIX@/usr/share/fsl/doc/images/fsl-bg.jpg\">\n<hr><CENTER>\n<H1>FEAT Time Series Report</H1>\n</CENTER>\n<hr>" << indexText << "<HR></BODY></HTML>" << endl << endl;
160 + outputFile.close();
161 +
162 + /* now output same thing without start and end, for inclusion in feat report */
163 +diff --git a/src/first/first_utils.cc b/src/first/first_utils.cc
164 +index 68be44b..85960f4 100644
165 +--- a/src/first/first_utils.cc
166 ++++ b/src/first/first_utils.cc
167 +@@ -1954,8 +1954,8 @@ void do_work_bvars(){
168 + if (!surfaceVAout.value()) {
169 + // do not output on the surface, instead do the new default of outputting a volume with the scalar normal dot product values (for use with randomise)
170 + volume<float> refim;
171 +- if (useReconMNI.value()) { read_volume(refim,string(getenv("FSLDIR")) + "/data/standard/MNI152_T1_1mm"); }
172 +- else { read_volume(refim,string(getenv("FSLDIR")) + "/data/standard/MNI152_T1_1mm"); }
173 ++ if (useReconMNI.value()) { read_volume(refim,"@GENTOO_PORTAGE_EPREFIX@/usr/share/fsl/data/standard/MNI152_T1_1mm"); }
174 ++ else { read_volume(refim,"@GENTOO_PORTAGE_EPREFIX@/usr/share/fsl/data/standard/MNI152_T1_1mm"); }
175 + volume<float> maskvol(refim);
176 + maskvol=0.0f;
177 + volume4D<float> volnormals;
178 +diff --git a/src/fnirt/fnirtfns.cpp b/src/fnirt/fnirtfns.cpp
179 +index 24e26fd..77899e7 100644
180 +--- a/src/fnirt/fnirtfns.cpp
181 ++++ b/src/fnirt/fnirtfns.cpp
182 +@@ -1203,8 +1203,7 @@ string existing_ref_fname(const string& ref_fname)
183 + return(string(ref_fname));
184 + }
185 + else {
186 +- const char *fsldir_ptr = getenv("FSLDIR");
187 +- string eref_fname = string(fsldir_ptr) + string("/data/standard/") + ref_fname;
188 ++ string eref_fname = string("@GENTOO_PORTAGE_EPREFIX@/usr/share/fsl/data/standard/") + ref_fname;
189 + if (NEWIMAGE::FslFileExists(eref_fname)) return(eref_fname);
190 + else return(string(""));
191 + }
192 +@@ -1230,9 +1229,8 @@ string existing_ref_fname(const string& ref_fname)
193 + NEWIMAGE::read_volume_hdr_only(vref,ref_fname); // Throws if file dont exist
194 + eref_fname = ref_fname;
195 + }
196 +- catch(...) { // Didn't exist in current directory, try in ${FSLDIR}/data/standard
197 +- const char *fsldir_ptr = getenv("FSLDIR");
198 +- eref_fname = string(fsldir_ptr) + string("/data/standard/") + ref_fname;
199 ++ catch(...) { // Didn't exist in current directory, try in .../data/standard
200 ++ eref_fname = string("@GENTOO_PORTAGE_EPREFIX@/usr/share/fsl/data/standard/") + ref_fname;
201 + try {
202 + cout << "Could not find " << ref_fname << ", now checking " << eref_fname << endl;
203 + NEWIMAGE::read_volume_hdr_only(vref,eref_fname); // Throws if file dont exist
204 +@@ -1267,8 +1265,7 @@ string existing_conf_file(const string& cfname)
205 + if (check_exist(ecfname)) return(ecfname);
206 + }
207 + if (!FNIRT::path(cfname).length()) { // If no path explicitly given
208 +- const char *fsldir_ptr = getenv("FSLDIR");
209 +- ecfname = string(fsldir_ptr) + string("/etc/flirtsch/") + cfname;
210 ++ ecfname = string("@GENTOO_PORTAGE_EPREFIX@/etc/flirtsch/") + cfname;
211 + if (check_exist(ecfname)) return(ecfname);
212 + else if (!FNIRT::extension(ecfname).length()) { // If no path _and_ no extension given
213 + ecfname += string(".cnf");
214 +diff --git a/src/fslsurface/fslsurface_first.cc b/src/fslsurface/fslsurface_first.cc
215 +index faec642..b2ef794 100644
216 +--- a/src/fslsurface/fslsurface_first.cc
217 ++++ b/src/fslsurface/fslsurface_first.cc
218 +@@ -500,8 +500,7 @@ namespace fslsurface_name {
219 +
220 + volume<float>* immni = new volume<float>();
221 +
222 +- char* fsldir = getenv("FSLDIR");
223 +- read_volume_hdr_only(*immni, string(fsldir) + "/data/standard/MNI152_T1_1mm");
224 ++ read_volume_hdr_only(*immni, "@GENTOO_PORTAGE_EPREFIX@/usr/share/fsl/data/standard/MNI152_T1_1mm");
225 +
226 + //read_volume_hdr_only(*immni, template_name);
227 +
228 +@@ -699,8 +698,7 @@ namespace fslsurface_name {
229 +
230 + volume<float>* immni = new volume<float>();
231 +
232 +- char* fsldir = getenv("FSLDIR");
233 +- read_volume_hdr_only(*immni, string(fsldir) + "/data/standard/MNI152_T1_1mm");
234 ++ read_volume_hdr_only(*immni, "@GENTOO_PORTAGE_EPREFIX@/usr/share/fsl/data/standard/MNI152_T1_1mm");
235 +
236 + //read_volume_hdr_only(*immni, template_name);
237 +
238 +diff --git a/src/fslsurface/fslsurfacemaths.cpp b/src/fslsurface/fslsurfacemaths.cpp
239 +index eaf55eb..3dc184d 100644
240 +--- a/src/fslsurface/fslsurfacemaths.cpp
241 ++++ b/src/fslsurface/fslsurfacemaths.cpp
242 +@@ -598,12 +598,6 @@ int main (int argc, char * argv[])
243 +
244 + }else if (command == "-reconFromBvars"){
245 + cout<<"do recon "<<endl;
246 +- char* fsldir = getenv("FSLDIR");
247 +- if (fsldir == NULL)
248 +- {
249 +- cerr<<"FSLDIR has not been set. "<<endl;
250 +- exit(EXIT_FAILURE);
251 +- }
252 + //file.bvars,mni_template.nii.gz
253 + // string mni = string(fsldir)+"/data/standard/MNI152_T1_1mm";
254 + reconSurface_from_bvars( surf, string(argv[i_arg+1]));
255 +@@ -612,12 +606,6 @@ int main (int argc, char * argv[])
256 +
257 + }else if (command == "-reconAllFromBvarsAndSave"){
258 + cout<<"do recon+save "<<argc<<" "<<i_arg<<endl;
259 +- char* fsldir = getenv("FSLDIR");
260 +- if (fsldir == NULL)
261 +- {
262 +- cerr<<"FSLDIR has not been set. "<<endl;
263 +- exit(EXIT_FAILURE);
264 +- }
265 + //file.bvars,mni_template.nii.gz
266 + // string mni = string(fsldir)+"/data/standard/MNI152_T1_1mm";
267 + cout<<"recon "<< string(argv[i_arg+1])<<endl;
268 +diff --git a/src/libvis/miscpic.h b/src/libvis/miscpic.h
269 +index a2f3855..5f440f2 100644
270 +--- a/src/libvis/miscpic.h
271 ++++ b/src/libvis/miscpic.h
272 +@@ -90,12 +90,7 @@ namespace MISCPIC{
273 + markRight=false;
274 + trans= -10;
275 + edgethresh = 0.0;
276 +- if(getenv("FSLDIR")!=0){
277 +- lutbase = string(getenv("FSLDIR")) + "/etc/luts/";
278 +- }
279 +- else{
280 +- lutbase = string("/");
281 +- }
282 ++ lutbase = "@GENTOO_PORTAGE_EPREFIX@/etc/luts/";
283 + title = string("");
284 + cbartype = string("");
285 + cbarptr = NULL;
286 +diff --git a/src/melodic/meldata.cc b/src/melodic/meldata.cc
287 +index 1749a45..c4ad234 100644
288 +--- a/src/melodic/meldata.cc
289 ++++ b/src/melodic/meldata.cc
290 +@@ -992,7 +992,7 @@ namespace Melodic{
291 + void MelodicData::est_smoothness()
292 + {
293 + if(Resels == 0){
294 +- string SM_path = opts.binpath + "smoothest";
295 ++ string SM_path = "smoothest";
296 + string Mask_fname = logger.appendDir("mask");
297 +
298 + if(opts.segment.value().length()>0){
299 +@@ -1157,7 +1157,7 @@ namespace Melodic{
300 + // set up all strings
301 + string BET_outputfname = string(Mean_fname)+"_brain";
302 +
303 +- string BET_path = opts.binpath + "bet";
304 ++ string BET_path = "bet";
305 + string BET_optarg = "-m -f 0.4"; // see man bet
306 + string Mask_fname = BET_outputfname+"_mask";
307 +
308 +diff --git a/src/melodic/meloptions.cc b/src/melodic/meloptions.cc
309 +index 08170c7..252e72b 100644
310 +--- a/src/melodic/meloptions.cc
311 ++++ b/src/melodic/meloptions.cc
312 +@@ -93,14 +93,6 @@ MelodicOptions* MelodicOptions::gopt = NULL;
313 + explicitnums = false;
314 + logfname = string("log.txt");
315 +
316 +- // work out the path to the $FSLDIR/bin directory
317 +- if(getenv("FSLDIR")!=0){
318 +- binpath = (string) getenv("FSLDIR") + "/bin/";
319 +- } else{
320 +- binpath = argv[0];
321 +- binpath = binpath.substr(0,binpath.length()-7);
322 +- }
323 +-
324 + // parse once to establish log directory name
325 + for(int a = options.parse_command_line(argc, argv); a < argc; a++);
326 +
327 +diff --git a/src/melodic/meloptions.h b/src/melodic/meloptions.h
328 +index f546125..b964b7d 100644
329 +--- a/src/melodic/meloptions.h
330 ++++ b/src/melodic/meloptions.h
331 +@@ -93,7 +93,6 @@ class MelodicOptions {
332 + ~MelodicOptions() { delete gopt; }
333 +
334 + string version;
335 +- string binpath;
336 + string logfname;
337 + bool filtermode;
338 + bool explicitnums;
339 +diff --git a/src/melodic/melreport.cc b/src/melodic/melreport.cc
340 +index 141b6c2..2625059 100644
341 +--- a/src/melodic/melreport.cc
342 ++++ b/src/melodic/melreport.cc
343 +@@ -84,8 +84,8 @@ namespace Melodic{
344 + IChtml.setDir(report.getDir(),mmodel.get_prefix()+".html");
345 +
346 + {//start IC page
347 +- IChtml << "<HTML><HEAD><link REL=stylesheet TYPE=text/css href=file:" +
348 +- (string) getenv("FSLDIR") +"/doc/fsl.css>" << endl
349 ++ IChtml << "<HTML><HEAD><link REL=stylesheet TYPE=text/css href=file:"
350 ++ << "@GENTOO_PORTAGE_EPREFIX@/usr/share/fsl/doc/fsl.css>" << endl
351 + << "<style type=\"text/css\">OBJECT { width: 100% }</style>"
352 + << "<TITLE>FSL</TITLE></HEAD>" << endl
353 + << "<IFRAME height=" << int(melodat.get_numfiles()/30 + 1)*50
354 +@@ -486,8 +486,8 @@ namespace Melodic{
355 +
356 + {//start IC2 page
357 + IChtml2.setDir(report.getDir(),mmodel.get_prefix()+"_MM.html");
358 +- IChtml2 << "<HTML><HEAD><link REL=stylesheet TYPE=text/css href=file:" +
359 +- (string) getenv("FSLDIR") +"/doc/fsl.css>" << endl
360 ++ IChtml2 << "<HTML><HEAD><link REL=stylesheet TYPE=text/css href=file:"
361 ++ << "@GENTOO_PORTAGE_EPREFIX@/usr/share/fsl/doc/fsl.css>" << endl
362 + << "<style type=\"text/css\">OBJECT { width: 100% }</style>"
363 + << "<TITLE>FSL</TITLE></HEAD>" << endl
364 + << "<IFRAME height="<< int(melodat.get_numfiles()/30 + 1)*50
365 +@@ -665,8 +665,8 @@ namespace Melodic{
366 + IChtml << "<HTML> " << endl
367 + << "<TITLE>MELODIC Component " << num2str(cnum)
368 + << "</TITLE>" << endl
369 +- << "<BODY BACKGROUND=\"file:" << getenv("FSLDIR")
370 +- << "/doc/images/fsl-bg.jpg\">" << endl
371 ++ << "<BODY BACKGROUND=\"file:"
372 ++ << "@GENTOO_PORTAGE_EPREFIX@/usr/share/fsl/doc/images/fsl-bg.jpg\">" << endl
373 + << "<hr><CENTER><H1>MELODIC Component " << num2str(cnum)
374 + << "</H1>"<< endl;
375 +
376 +diff --git a/src/melodic/melreport.h b/src/melodic/melreport.h
377 +index 574fc4c..e444681 100644
378 +--- a/src/melodic/melreport.h
379 ++++ b/src/melodic/melreport.h
380 +@@ -104,21 +104,21 @@ namespace Melodic{
381 + const time_t tmptime = time(NULL);
382 + system(("mkdir "+ logger.appendDir("report") + " 2>/dev/null").c_str());
383 + report.setDir(logger.appendDir("report"),"00index.html",true,false,ios::out);
384 +- report << "<HTML><HEAD><link REL=stylesheet TYPE=text/css href=file:" +
385 +- (string) getenv("FSLDIR") +"/doc/fsl.css>"
386 ++ report << "<HTML><HEAD><link REL=stylesheet TYPE=text/css href=file:"
387 ++ << "@GENTOO_PORTAGE_EPREFIX@/usr/share/fsl/doc/fsl.css>"
388 + << "<TITLE>MELODIC report</TITLE></HEAD><BODY>"
389 + << endl <<endl;
390 + loghtml.setDir(report.getDir(),"log.html");
391 +- loghtml << "<HTML><HEAD><link REL=stylesheet TYPE=text/css href=file:" +
392 +- (string) getenv("FSLDIR") +"/doc/fsl.css>"
393 ++ loghtml << "<HTML><HEAD><link REL=stylesheet TYPE=text/css href=file:"
394 ++ << "@GENTOO_PORTAGE_EPREFIX@/usr/share/fsl/doc/fsl.css>"
395 + << "<TITLE>MELODIC report</TITLE></HEAD><BODY>"
396 + << endl <<endl;
397 + navigator.setDir(report.getDir(),"nav.html");
398 + head.setDir(report.getDir(),"head.html");
399 +- navigator << "<link REL=stylesheet TYPE=text/css href=file:"+
400 +- (string) getenv("FSLDIR") +"/doc/fsl.css>" << endl;
401 +- head << "<link REL=stylesheet TYPE=text/css href=file:"+
402 +- (string) getenv("FSLDIR") +"/doc/fsl.css>" << endl;
403 ++ navigator << "<link REL=stylesheet TYPE=text/css href=file:"
404 ++ << "@GENTOO_PORTAGE_EPREFIX@/usr/share/fsl/doc/fsl.css>" << endl;
405 ++ head << "<link REL=stylesheet TYPE=text/css href=file:"
406 ++ << "@GENTOO_PORTAGE_EPREFIX@/usr/share/fsl/doc/fsl.css>" << endl;
407 + head <<"<TABLE BORDER=0><TR>" << endl
408 + <<" <TD ALIGN=CENTER WIDTH=100%>"<< endl
409 + <<"<TABLE BORDER=0>"<< endl
410 +@@ -130,8 +130,8 @@ namespace Melodic{
411 + << "</tr></table>" << endl
412 + << "<TD ALIGN=RIGHT>" << endl
413 + << "<a href=http://www.fmrib.ox.ac.uk/fsl target=_top>" << endl
414 +- << "<IMG BORDER=0 SRC=file:"<< getenv("FSLDIR")
415 +- << "/doc/images/fsl-logo-big.jpg WIDTH=165></a>" << endl
416 ++ << "<IMG BORDER=0 SRC=file:"
417 ++ << "@GENTOO_PORTAGE_EPREFIX@/usr/share/fsl/doc/images/fsl-logo-big.jpg WIDTH=165></a>" << endl
418 + << "</TD>"<<endl<<"</TR></TABLE> <hr>"<<endl;
419 + if(opts.guireport.value()==""){
420 + report <<"<OBJECT data=head.html></OBJECT>" << endl;
421 +diff --git a/src/mm/mixture_model.cc b/src/mm/mixture_model.cc
422 +index b8e6167..5f00693 100644
423 +--- a/src/mm/mixture_model.cc
424 ++++ b/src/mm/mixture_model.cc
425 +@@ -2224,8 +2224,8 @@ namespace Mm {
426 +
427 + htmllog << "<HTML> " << endl
428 + << "<TITLE>Mixture Model fit for" << data_name << "</TITLE>" << endl
429 +- << "<BODY BACKGROUND=\"file:" << getenv("FSLDIR")
430 +- << "/doc/images/fsl-bg.jpg\">" << endl
431 ++ << "<BODY BACKGROUND=\"file:"
432 ++ << "@GENTOO_PORTAGE_EPREFIX@/usr/share/fsl/doc/images/fsl-bg.jpg\">" << endl
433 + << "<hr><CENTER><H1>Mixture Model fit for<br>" << data_name << " </H1>"<< endl;
434 +
435 + htmllog << "<hr><p>" << endl;
436 +diff --git a/src/siena/siena_diff.cc b/src/siena/siena_diff.cc
437 +index e19193a..17d8701 100644
438 +--- a/src/siena/siena_diff.cc
439 ++++ b/src/siena/siena_diff.cc
440 +@@ -107,7 +107,7 @@ int main(int argc,char *argv[])
441 + {
442 + // {{{ vars
443 +
444 +-char thestring[10000], segoptions[10000], fsldir[10000];
445 ++char thestring[10000], segoptions[10000];
446 + int x_size, y_size, z_size, size, x, y, z, i, count,
447 + seg2=0, ignore_z=0, ignore_top_slices=0, //erode_mask=0,
448 + ignore_bottom_slices=0, debug=0, flow_output=1, edge_masking=0;
449 +@@ -124,8 +124,6 @@ if (argc<3)
450 +
451 + string argv1(argv[1]), argv2(argv[2]);
452 +
453 +-sprintf(fsldir,"%s",getenv("FSLDIR"));
454 +-
455 + for (i = 3; i < argc; i++) {
456 + if (!strcmp(argv[i], "-i"))
457 + ignore_z=1;
458 +@@ -209,26 +207,26 @@ for (i = 3; i < argc; i++) {
459 + // }}}
460 + // {{{ transform images and masks
461 +
462 +-sprintf(thestring,"%s/bin/flirt -o %s_halfwayto_%s -applyisoxfm 1 -paddingsize 0 -init %s_halfwayto_%s.mat -ref %s -in %s",
463 +- fsldir,argv[1],argv[2],argv[1],argv[2],argv[1],argv[1]);
464 ++sprintf(thestring,"flirt -o %s_halfwayto_%s -applyisoxfm 1 -paddingsize 0 -init %s_halfwayto_%s.mat -ref %s -in %s",
465 ++ argv[1],argv[2],argv[1],argv[2],argv[1],argv[1]);
466 + printf("%s\n",thestring); system(thestring);
467 +
468 +-sprintf(thestring,"%s/bin/flirt -o %s_halfwayto_%s -applyisoxfm 1 -paddingsize 0 -init %s_halfwayto_%s.mat -ref %s -in %s",
469 +- fsldir,argv[2],argv[1],argv[2],argv[1],argv[1],argv[2]);
470 ++sprintf(thestring,"flirt -o %s_halfwayto_%s -applyisoxfm 1 -paddingsize 0 -init %s_halfwayto_%s.mat -ref %s -in %s",
471 ++ argv[2],argv[1],argv[2],argv[1],argv[1],argv[2]);
472 + printf("%s\n",thestring); system(thestring);
473 +
474 +-sprintf(thestring,"%s/bin/flirt -o %s_halfwayto_%s_mask -applyisoxfm 1 -paddingsize 0 -init %s_halfwayto_%s.mat -ref %s -in %s_brain_mask",
475 +- fsldir,argv[1],argv[2],argv[1],argv[2],argv[1],argv[1]);
476 ++sprintf(thestring,"flirt -o %s_halfwayto_%s_mask -applyisoxfm 1 -paddingsize 0 -init %s_halfwayto_%s.mat -ref %s -in %s_brain_mask",
477 ++ argv[1],argv[2],argv[1],argv[2],argv[1],argv[1]);
478 + printf("%s\n",thestring); system(thestring);
479 +
480 +-sprintf(thestring,"%s/bin/flirt -o %s_halfwayto_%s_mask -applyisoxfm 1 -paddingsize 0 -init %s_halfwayto_%s.mat -ref %s -in %s_brain_mask",
481 +- fsldir,argv[2],argv[1],argv[2],argv[1],argv[1],argv[2]);
482 ++sprintf(thestring,"flirt -o %s_halfwayto_%s_mask -applyisoxfm 1 -paddingsize 0 -init %s_halfwayto_%s.mat -ref %s -in %s_brain_mask",
483 ++ argv[2],argv[1],argv[2],argv[1],argv[1],argv[2]);
484 + printf("%s\n",thestring); system(thestring);
485 +
486 + if (edge_masking)
487 + {
488 +- sprintf(thestring,"%s/bin/flirt -o %s_halfwayto_%s_valid_mask -applyisoxfm 1 -paddingsize 0 -init %s_halfwayto_%s.mat -ref %s -in %s_valid_mask_with_%s",
489 +- fsldir,argv[1],argv[2],argv[1],argv[2],argv[1],argv[1],argv[2]);
490 ++ sprintf(thestring,"flirt -o %s_halfwayto_%s_valid_mask -applyisoxfm 1 -paddingsize 0 -init %s_halfwayto_%s.mat -ref %s -in %s_valid_mask_with_%s",
491 ++ argv[1],argv[2],argv[1],argv[2],argv[1],argv[1],argv[2]);
492 + printf("%s\n",thestring); system(thestring);
493 + }
494 +
495 +@@ -287,8 +285,8 @@ if(1) // always done unless the above uncommented and used instead of this test
496 + cout << "saving image 1 to disk prior to segmentation" << endl;
497 + save_volume(in1,argv1+"_halfwayto_"+argv2+"_brain");
498 + in1.destroy();
499 +- sprintf(thestring,"%s/bin/fast %s %s %s_halfwayto_%s_brain > %s_halfwayto_%s_brain.vol 2>&1",
500 +- fsldir,segtype,segoptions,argv[1],argv[2],argv[1],argv[2]);
501 ++ sprintf(thestring,"fast %s %s %s_halfwayto_%s_brain > %s_halfwayto_%s_brain.vol 2>&1",
502 ++ segtype,segoptions,argv[1],argv[2],argv[1],argv[2]);
503 + cout << thestring << endl;
504 + system(thestring);
505 + }
506 +diff --git a/src/topup/topupfns.cpp b/src/topup/topupfns.cpp
507 +index 6873758..9e8b956 100644
508 +--- a/src/topup/topupfns.cpp
509 ++++ b/src/topup/topupfns.cpp
510 +@@ -463,8 +463,7 @@ string existing_conf_file(const string& cfname)
511 + if (TOPUP::check_exist(ecfname)) return(ecfname);
512 + }
513 + if (!TOPUP::path(cfname).length()) { // If no path explicitly given
514 +- const char *fsldir_ptr = getenv("FSLDIR");
515 +- ecfname = string(fsldir_ptr) + string("/etc/flirtsch/") + cfname;
516 ++ ecfname = string("@GENTOO_PORTAGE_EPREFIX@/etc/flirtsch/") + cfname;
517 + if (TOPUP::check_exist(ecfname)) return(ecfname);
518 + else if (!TOPUP::extension(ecfname).length()) { // If no path _and_ no extension given
519 + ecfname += string(".cnf");
520 +--
521 +2.24.1
522 +
523
524 diff --git a/sci-biology/fsl/files/fsl-6.0.2-no_xmlpp.patch b/sci-biology/fsl/files/fsl-6.0.2-no_xmlpp.patch
525 new file mode 100644
526 index 000000000..6eccc4370
527 --- /dev/null
528 +++ b/sci-biology/fsl/files/fsl-6.0.2-no_xmlpp.patch
529 @@ -0,0 +1,58 @@
530 +From 9de29e5141afa43c06f347ca158b67168fbb0031 Mon Sep 17 00:00:00 2001
531 +From: François Bissey <frp.bissey@×××××.com>
532 +Date: Mon, 20 Jan 2020 11:46:52 +1300
533 +Subject: [PATCH] Build without xmlpp since we use an external ciftilib that
534 + doesnt require it. Replace it and other ciftilib flags with CIFTICFLAGS.
535 +
536 +---
537 + src/flameo/Makefile | 4 ++--
538 + src/melodic/Makefile | 4 ++--
539 + 2 files changed, 4 insertions(+), 4 deletions(-)
540 +
541 +diff --git a/src/flameo/Makefile b/src/flameo/Makefile
542 +index d22eb965..e967e682 100644
543 +--- a/src/flameo/Makefile
544 ++++ b/src/flameo/Makefile
545 +@@ -2,7 +2,7 @@ include ${FSLCONFDIR}/default.mk
546 +
547 + PROJNAME = flame
548 +
549 +-USRINCFLAGS = -I${INC_NEWMAT} -I${INC_PROB} -I${INC_ZLIB} -DCIFTILIB_USE_XMLPP -I${FSLEXTINC} -I${INC_XML2} -I${INC_XML++} -I${INC_XML++CONF} -I${INC_BOOST} -I${FSLDIR}/include/ciftiio
550 ++USRINCFLAGS = -fPIC -I${INC_NEWMAT} -I${INC_PROB} -I${INC_ZLIB} -I${FSLEXTINC} ${CIFTICFLAGS} -I${INC_BOOST} -I${FSLDIR}/include/ciftiio
551 + USRLDFLAGS = -L${LIB_NEWMAT} -L${LIB_PROB} -L${LIB_ZLIB}
552 +
553 + UNAME := $(shell uname)
554 +@@ -10,7 +10,7 @@ ifeq (${UNAME},Darwin)
555 + LIBS = -liconv
556 + endif
557 +
558 +-LIBS += -lutils -lnewimage -lmiscmaths -lm -lnewmat -lNewNifti -lcifti -lxml++-2.6 -lxml2 -lboost_filesystem -lboost_system -lznz -lprob -lz
559 ++LIBS += -lutils -lnewimage -lmiscmaths -lm -lnewmat -lNewNifti ${CIFTILIBS} -lboost_filesystem -lboost_system -lznz -lprob -lz
560 +
561 + XFILES = flameo
562 +
563 +diff --git a/src/melodic/Makefile b/src/melodic/Makefile
564 +index 50666517..0c356a2d 100644
565 +--- a/src/melodic/Makefile
566 ++++ b/src/melodic/Makefile
567 +@@ -7,7 +7,7 @@ OPTFLAGS_alphaev6-dec-osf5.0-gcc2.95.2 = -O3 -mieee -mfp-trap-mode=sui
568 +
569 + PROJNAME = melodic
570 +
571 +-USRINCFLAGS = -I${INC_NEWMAT} -I${INC_PROB} -I${INC_GD} -I${INC_GDC} -I${INC_PNG} -I${INC_ZLIB} -DCIFTILIB_USE_XMLPP -I${FSLEXTINC} -I${INC_XML2} -I${INC_XML++} -I${INC_XML++CONF} -I${INC_BOOST} -I${FSLDIR}/include/ciftiio
572 ++USRINCFLAGS = -fPIC -I${INC_NEWMAT} -I${INC_PROB} -I${INC_GD} -I${INC_GDC} -I${INC_PNG} -I${INC_ZLIB} -I${FSLEXTINC} ${CIFTICFLAGS} -I${INC_BOOST} -I${FSLDIR}/include/ciftiio
573 + USRLDFLAGS = -L${LIB_NEWMAT} -L${LIB_PROB} -L${LIB_GD} -L${LIB_GDC} -L${LIB_PNG} -L${LIB_ZLIB}
574 +
575 + UNAME := $(shell uname)
576 +@@ -15,7 +15,7 @@ ifeq (${UNAME},Darwin)
577 + LIBS = -liconv
578 + endif
579 +
580 +-LIBS += -lutils -lnewimage -lmiscplot -lmiscpic -lmiscmaths -lNewNifti -lcifti -lxml++-2.6 -lxml2 -lboost_filesystem -lboost_system -lznz -lnewmat -lprob -lm -lgdc -lgd -lpng -lz
581 ++LIBS += -lutils -lnewimage -lmiscplot -lmiscpic -lmiscmaths -lNewNifti ${CIFTILIBS} -lboost_filesystem -lboost_system -lznz -lnewmat -lprob -lm -lgdc -lgd -lpng -lz
582 +
583 + TEST_OBJS = test.o
584 +
585 +--
586 +2.24.1
587 +
588
589 diff --git a/sci-biology/fsl/files/fsl-6.0.2-qstring_compat.patch b/sci-biology/fsl/files/fsl-6.0.2-qstring_compat.patch
590 new file mode 100644
591 index 000000000..9e6682a48
592 --- /dev/null
593 +++ b/sci-biology/fsl/files/fsl-6.0.2-qstring_compat.patch
594 @@ -0,0 +1,63 @@
595 +From 5a5ab3c80eaaea1fe9a43659e2ea5b773b587bb0 Mon Sep 17 00:00:00 2001
596 +From: François Bissey <frp.bissey@×××××.com>
597 +Date: Mon, 20 Jan 2020 11:51:52 +1300
598 +Subject: [PATCH] Because we use qstrings in ciftilib, calls to ciftilib file
599 + function have to be made into compatible c strings.
600 +
601 +---
602 + src/flameo/gsa.cc | 4 ++--
603 + src/melodic/meldata.cc | 2 +-
604 + src/melodic/meldata.h | 2 +-
605 + 3 files changed, 4 insertions(+), 4 deletions(-)
606 +
607 +diff --git a/src/flameo/gsa.cc b/src/flameo/gsa.cc
608 +index 70f8f385..16167abe 100644
609 +--- a/src/flameo/gsa.cc
610 ++++ b/src/flameo/gsa.cc
611 +@@ -74,7 +74,7 @@ namespace GSA {
612 + sourceType=mode;
613 + if ( sourceType.compare("CIFTI") == 0 ) {
614 + cifti::CiftiFile inputCifti;
615 +- inputCifti.openFile(make_basename(filename)+".nii");
616 ++ inputCifti.openFile((make_basename(filename)+".nii").c_str());
617 + ciftiExemplar=inputCifti.getCiftiXML();
618 + cerr << "ndim " << ciftiExemplar.getNumberOfDimensions() << endl;
619 + cerr << "type1 " << ciftiExemplar.getMappingType(0) << endl;
620 +@@ -194,7 +194,7 @@ namespace GSA {
621 + scalarsMap.setLength(data.Nrows());
622 + ciftiExemplar.setMap(0, scalarsMap);
623 + CiftiFile outputFile;
624 +- outputFile.setWritingFile(make_basename(filename)+extension+".nii");//sets up on-disk writing with default writing version
625 ++ outputFile.setWritingFile((make_basename(filename)+extension+".nii").c_str());//sets up on-disk writing with default writing version
626 + outputFile.setCiftiXML(ciftiExemplar,false);
627 + vector<float> scratchRow(data.Nrows());//read/write a row at a time
628 + for (int64_t row=0;row<data.Ncols();row++) {
629 +diff --git a/src/melodic/meldata.cc b/src/melodic/meldata.cc
630 +index c4ad2349..1515e702 100644
631 +--- a/src/melodic/meldata.cc
632 ++++ b/src/melodic/meldata.cc
633 +@@ -118,7 +118,7 @@ namespace Melodic{
634 + tmpData = RawData.matrix(Mask);
635 + memmsg(" after reshape ");
636 + } else { //Read in Cifti
637 +- inputCifti.openFile(fname+".nii");
638 ++ inputCifti.openFile((fname+".nii").c_str());
639 + const vector<int64_t>& dims = inputCifti.getDimensions();
640 + tmpData.ReSize(dims[0],dims[1]); //swapped compared to cifti
641 + vector<float> scratchRow(dims[0]);//read/write a row at a time
642 +diff --git a/src/melodic/meldata.h b/src/melodic/meldata.h
643 +index 49774003..f5326bdd 100644
644 +--- a/src/melodic/meldata.h
645 ++++ b/src/melodic/meldata.h
646 +@@ -109,7 +109,7 @@ namespace Melodic{
647 + message(" " << logger.appendDir(fname) << endl);
648 + } else { //Process CIFTI save ICs as float
649 + cifti::CiftiFile outputFile;
650 +- outputFile.setWritingFile(logger.appendDir(fname)+".nii");//sets up on-disk writing with default writing version
651 ++ outputFile.setWritingFile((logger.appendDir(fname)+".nii").c_str());//sets up on-disk writing with default writing version
652 + cifti::CiftiXML xml(inputCifti.getCiftiXML());
653 + cifti::CiftiScalarsMap scalarsMap;
654 + std::vector<char> foo = xml.writeXMLToVector();
655 +--
656 +2.24.1
657 +
658
659 diff --git a/sci-biology/fsl/files/fsl-6.0.2-setup.patch b/sci-biology/fsl/files/fsl-6.0.2-setup.patch
660 new file mode 100644
661 index 000000000..39737fd85
662 --- /dev/null
663 +++ b/sci-biology/fsl/files/fsl-6.0.2-setup.patch
664 @@ -0,0 +1,198 @@
665 +From baae97cc3c8d0cadcabb7ed16559f4e4de26ddbe Mon Sep 17 00:00:00 2001
666 +From: François Bissey <frp.bissey@×××××.com>
667 +Date: Mon, 20 Jan 2020 11:54:37 +1300
668 +Subject: [PATCH] Adjust the build system so it doesnt build packages
669 + externally provided by portage. Make the compilation flags more generic and
670 + easily adjustable. Make the build system stop at the first fault.
671 +
672 +---
673 + build | 6 +++---
674 + config/buildSettings.mk | 20 ++++++++++----------
675 + config/common/buildproj | 8 +++++---
676 + config/common/vars.mk | 10 +++++-----
677 + extras/build | 8 ++++----
678 + src/mist-clean/Makefile | 2 +-
679 + 6 files changed, 28 insertions(+), 26 deletions(-)
680 +
681 +diff --git a/build b/build
682 +index 05dac06c..d90e407b 100755
683 +--- a/build
684 ++++ b/build
685 +@@ -3,7 +3,7 @@
686 + if [ $# -ge 1 ] ; then
687 + PROJECTS="$@";
688 + else
689 +- MASTERPROJECTS="CiftiLib-master utils znzlib NewNifti niftiio fslio giftiio miscmaths newimage libhfunc libvis first_lib \
690 ++ MASTERPROJECTS="utils znzlib NewNifti niftiio fslio giftiio miscmaths newimage libhfunc libvis first_lib \
691 + meshclass fslvtkio misc_tcl basisfield warpfns bint shapeModel MVdisc fslvtkconv fslsurface libmeshutils newmesh \
692 + DiscreteOpt FastPDlib MSMRegLib misc_c dpm topup \
693 + asl_mfree \
694 +@@ -80,8 +80,8 @@ xtract";
695 + done
696 + fi
697 +
698 +-echo "Building projects - see build.log file for progress..."
699 +-./config/common/buildproj $PROJECTS > ./build.log 2>&1
700 ++echo "Building projects"
701 ++./config/common/buildproj $PROJECTS
702 + finalStatus=$?
703 + if [ $finalStatus -eq 0 ]; then
704 + echo "Build completed successfully.";
705 +diff --git a/config/buildSettings.mk b/config/buildSettings.mk
706 +index b2e1f150..04532fc2 100644
707 +--- a/config/buildSettings.mk
708 ++++ b/config/buildSettings.mk
709 +@@ -18,7 +18,7 @@ MV = /bin/mv
710 + CHMOD = /bin/chmod
711 + MKDIR = /bin/mkdir
712 + INSTALL = install -p
713 +-TCLSH = ${FSLDIR}/bin/fsltclsh
714 ++TCLSH = tclsh
715 + DEPENDFLAGS = -MM
716 + MACHDBGFLAGS = -g
717 + #####################################################################
718 +@@ -124,19 +124,19 @@ endif # if Darwin
719 + #####################################################################
720 + ifeq ($(SYSTYPE), Linux)
721 + ############### System Vars #####################################
722 +-CC = gcc
723 +-CXX = c++
724 +-CXX11 = c++
725 ++CC = @@GENTOO_CC@@
726 ++CXX = @@GENTOO_CXX@@
727 ++CXX11 = @@GENTOO_CXX@@
728 + CSTATICFLAGS = -static
729 + CXXSTATICFLAGS = -static
730 +-ARCHFLAGS = -m64
731 +-ARCHLDFLAGS = -Wl,-rpath,'$$ORIGIN/../lib'
732 ++ARCHFLAGS =
733 ++ARCHLDFLAGS =
734 + PARALLELFLAGS = -fopenmp
735 +-OPTFLAGS = -g -O3 -fexpensive-optimizations ${ARCHFLAGS}
736 ++OPTFLAGS =
737 + GNU_ANSI_FLAGS = -Wall -ansi -pedantic -Wno-long-long
738 + SGI_ANSI_FLAGS = -ansi -fullwarn
739 + ANSI_FLAGS = ${GNU_ANSI_FLAGS}
740 +-RANLIB = echo
741 ++RANLIB = @@GENTOO_RANLIB@@
742 + FSLML = ${FSLDIR}/bin/fslml
743 + # CUDA development environment
744 + CUDAVER := $(or $(CUDAVER),9.1)
745 +@@ -148,8 +148,8 @@ INC_CUDA = ${CUDA_INSTALLATION}/include
746 + NVCC = ${CUDA_INSTALLATION}/bin/nvcc
747 + ############### External Libs #####################################
748 + # ZLIB library
749 +-LIB_ZLIB = /lib64
750 +-INC_ZLIB = /usr/include
751 ++#LIB_ZLIB = /lib64
752 ++#INC_ZLIB = /usr/include
753 + # QT library
754 + QTDIR = /usr/lib/qt3
755 + LIB_QT = ${QTDIR}/lib
756 +diff --git a/config/common/buildproj b/config/common/buildproj
757 +index 2f0f2b8f..48624a1f 100755
758 +--- a/config/common/buildproj
759 ++++ b/config/common/buildproj
760 +@@ -11,10 +11,10 @@ if [ X$1 = X-strict ] ; then
761 + fi
762 + PROJECTS="$@" ; export PROJECTS ;
763 +
764 +-FSLDIR=`pwd`
765 ++#FSLDIR=`pwd`
766 + FSLDEVDIR=${FSLDIR}
767 + FSLCONFDIR=${FSLDIR}/config
768 +-FSLMACHTYPE=`${FSLDIR}/etc/fslconf/fslmachtype.sh`
769 ++#FSLMACHTYPE=`${FSLDIR}/etc/fslconf/fslmachtype.sh`
770 + FSLMASTERBUILD=1
771 + export FSLDIR FSLDEVDIR FSLCONFDIR FSLMACHTYPE FSLMASTERBUILD
772 +
773 +@@ -67,7 +67,7 @@ for projname in $PROJECTS; do
774 + if [ -x ./fslconfig ] ; then
775 + . ./fslconfig ;
776 + fi
777 +- if ${MAKE} -k ${MAKEOPTIONS} ; then
778 ++ if ${MAKE} ${MAKEOPTIONS} ; then
779 + if ${MAKE} ${MAKEOPTIONS} install ; then
780 + installok=true;
781 + # Clean up after ourselves
782 +@@ -82,6 +82,7 @@ for projname in $PROJECTS; do
783 + if [ $installok = false ] ; then
784 + echo " "
785 + echo "ERROR::Could not install $projname successfully" ;
786 ++ exit 1
787 + fi
788 + else
789 + echo " "
790 +@@ -90,6 +91,7 @@ for projname in $PROJECTS; do
791 + echo " "
792 + echo " "
793 + errorprojs="$errorprojs $projname" ; export errorprojs ;
794 ++ exit 1
795 + fi
796 + fi
797 + done
798 +diff --git a/config/common/vars.mk b/config/common/vars.mk
799 +index b027b010..aeeae67c 100755
800 +--- a/config/common/vars.mk
801 ++++ b/config/common/vars.mk
802 +@@ -24,15 +24,15 @@ USRINCFLAGS =
803 + USRCFLAGS =
804 + USRCXXFLAGS =
805 +
806 +-LDFLAGS = ${ARCHLDFLAGS} ${USRLDFLAGS} -L. -L${DEVLIBDIR} -L${LIBDIR}
807 ++LDFLAGS = ${ARCHLDFLAGS} ${USRLDFLAGS} -L. -L${DEVLIBDIR} -L${LIBDIR} ${USERLDFLAGS}
808 +
809 +-AccumulatedIncFlags = -I${INC_BOOST} ${USRINCFLAGS} -I. -I${DEVINCDIR} -I${INCDIR}
810 ++AccumulatedIncFlags = ${USRINCFLAGS} -I. -I${DEVINCDIR} -I${INCDIR} ${CPPFLAGS}
811 +
812 + CFLAGS = ${ANSI_FLAGS} ${ANSI_CFLAGS} ${DBGFLAGS} ${USEDCSTATICFLAGS} ${USRCFLAGS} ${ARCHFLAGS} ${OPTFLAGS} \
813 +- ${AccumulatedIncFlags}
814 ++ ${AccumulatedIncFlags} ${USERCFLAGS}
815 +
816 +-CXXFLAGS = ${ANSI_FLAGS} ${ANSI_CXXFLAGS} ${DBGFLAGS} ${USEDCXXSTATICFLAGS} ${USRCXXFLAGS} ${ARCHFLAGS} ${OPTFLAGS} \
817 +- ${AccumulatedIncFlags}
818 ++CXXFLAGS = ${ANSI_CXXFLAGS} ${DBGFLAGS} ${USEDCXXSTATICFLAGS} ${USRCXXFLAGS} ${ARCHFLAGS} ${OPTFLAGS} \
819 ++ ${AccumulatedIncFlags} ${USERCXXFLAGS}
820 +
821 + HFILES = *.h
822 + AFILES = *.a
823 +diff --git a/extras/build b/extras/build
824 +index 59e7a2ed..0d68232e 100755
825 +--- a/extras/build
826 ++++ b/extras/build
827 +@@ -96,16 +96,16 @@ if [ X"${OS}" = "XDarwin" ]; then
828 + BUILDICONV=1
829 + fi
830 + fi
831 +-PROJECTS="tcl tk"
832 ++#PROJECTS="tcl tk"
833 + if [ ${BUILDZLIB} -eq 1 ]; then
834 + PROJECTS="${PROJECTS} zlib"
835 + fi
836 +-PROJECTS="${PROJECTS} libpng"
837 ++#PROJECTS="${PROJECTS} libpng"
838 + if [ ${BUILDICONV} -eq 1 ]; then
839 + PROJECTS="${PROJECTS} libiconv"
840 + fi
841 +-PROJECTS="${PROJECTS} libgd libgdc libprob libcprob newmat cprob newran fftw"
842 +-PROJECTS="${PROJECTS} boost libxml2-2.9.2 libxmlpp libsqlite libnlopt ../include/armawrap/dummy_newmat"
843 ++PROJECTS="${PROJECTS} libgdc libprob libcprob newmat cprob newran"
844 ++PROJECTS="${PROJECTS} ../include/armawrap/dummy_newmat"
845 + for projname in $PROJECTS; do
846 + if [ -d $FSLESRCDIR/$projname ] ; then
847 + buildIt $FSLESRCDIR $projname 1
848 +diff --git a/src/mist-clean/Makefile b/src/mist-clean/Makefile
849 +index 20402cca..6918bee4 100755
850 +--- a/src/mist-clean/Makefile
851 ++++ b/src/mist-clean/Makefile
852 +@@ -52,6 +52,6 @@ installpython:
853 + cp -r python/* ${DESTDIR}/python/mist
854 +
855 + clean:
856 +- rm -f ${OBJS} mist/mist.o mist/mist
857 ++ rm -f ${OBJS} mist/mist.o mist/mist || echo "CLEAN could not locate some files scheduled for deletion."
858 +
859 + .PHONY: all clean installdata
860 +--
861 +2.24.1
862 +
863
864 diff --git a/sci-biology/fsl/fsl-6.0.2.ebuild b/sci-biology/fsl/fsl-6.0.2.ebuild
865 new file mode 100644
866 index 000000000..cde479421
867 --- /dev/null
868 +++ b/sci-biology/fsl/fsl-6.0.2.ebuild
869 @@ -0,0 +1,164 @@
870 +# Copyright 1999-2020 Gentoo Authors
871 +# Distributed under the terms of the GNU General Public License v2
872 +
873 +EAPI=7
874 +
875 +inherit flag-o-matic toolchain-funcs prefix
876 +
877 +DESCRIPTION="Analysis of functional, structural, and diffusion MRI brain imaging data"
878 +HOMEPAGE="http://www.fmrib.ox.ac.uk/fsl"
879 +SRC_URI="https://fsl.fmrib.ox.ac.uk/fsldownloads/${P}-sources.tar.gz -> ${P}.tar.gz"
880 +
881 +LICENSE="FSL BSD-2 newmat"
882 +SLOT="0"
883 +KEYWORDS="~amd64"
884 +IUSE=""
885 +
886 +DEPEND="
887 + dev-libs/boost
888 + dev-python/fslpy
889 + media-gfx/graphviz
890 + media-libs/gd
891 + media-libs/glu
892 + media-libs/libpng:0=
893 + sci-libs/ciftilib
894 + sci-libs/nlopt
895 + sys-libs/zlib
896 + dev-lang/tcl:0=
897 + dev-lang/tk:0=
898 + >=virtual/lapack-3.8
899 + >=virtual/blas-3.8
900 + "
901 +RDEPEND="${DEPEND}"
902 +
903 +S=${WORKDIR}/${PN}
904 +UPSTREAM_FSLDIR="/usr/share/fsl"
905 +
906 +PATCHES=(
907 + "${FILESDIR}/${PN}"-6.0.2-setup.patch
908 + "${FILESDIR}/${PN}"-6.0.2-no_xmlpp.patch
909 + "${FILESDIR}/${PN}"-5.0.11-niftiio_var_fix.patch
910 + "${FILESDIR}/${PN}"-5.0.11-ifstream_use.patch
911 + "${FILESDIR}/${PN}"-5.0.11-fslsurface_parallel_make.patch
912 + "${FILESDIR}/${PN}"-6.0.2-qstring_compat.patch
913 + "${FILESDIR}/${PN}"-5.0.9-headers.patch
914 + "${FILESDIR}/${PN}"-6.0.2-fsldir_redux.patch
915 +)
916 +
917 +src_prepare(){
918 + default
919 +
920 + sed -i \
921 + -e "s:@@GENTOO_RANLIB@@:$(tc-getRANLIB):" \
922 + -e "s:@@GENTOO_CC@@:$(tc-getCC):" \
923 + -e "s:@@GENTOO_CXX@@:$(tc-getCXX):" \
924 + config/buildSettings.mk || die
925 +
926 + eprefixify $(grep -rl GENTOO_PORTAGE_EPREFIX src/*) \
927 + etc/js/label-div.html
928 +
929 + # Disable mist-clean the hard way for now.
930 + rm -rf src/mist-clean
931 +
932 + makefilelist=$(find src/ -name Makefile)
933 +
934 + sed -i \
935 + -e "s:-I\${INC_BOOST}::" \
936 + -e "s:-I\${INC_ZLIB}::" \
937 + -e "s:-I\${INC_GD}::" \
938 + -e "s:-I\${INC_PNG}::" \
939 + -e "s:-L\${LIB_GD}::" \
940 + -e "s:-L\${LIB_PNG}::" \
941 + -e "s:-L\${LIB_ZLIB}::" \
942 + ${makefilelist} || die
943 +
944 + sed -e "s:\${FSLDIR}/bin/::g" \
945 + -e "s:\$FSLDIR/bin/::g" \
946 + -i $(grep -rl "\${FSLDIR}/bin" src/*) \
947 + -i $(grep -rl "\$FSLDIR/bin" src/*) \
948 + $(grep -rl "\${FSLDIR}/bin" etc/matlab/*)\
949 + $(grep -rl "\$FSLDIR/bin" etc/matlab/*) || die
950 +
951 + sed -e "s:\$FSLDIR/data:${EPREFIX}/usr/share/fsl/data:g" \
952 + -e "s:\${FSLDIR}/data:${EPREFIX}/usr/share/fsl/data:g" \
953 + -i $(grep -rl "\$FSLDIR/data" src/*) \
954 + $(grep -rl "\${FSLDIR}/data" src/*) || die
955 +
956 + sed -e "s:\$FSLDIR/doc:${EPREFIX}/usr/share/fsl/doc:g" \
957 + -e "s:\${FSLDIR}/doc:${EPREFIX}/usr/share/fsl/doc:g" \
958 + -i $(grep -rl "\$FSLDIR/doc" src/*) \
959 + $(grep -rl "\${FSLDIR}/doc" src/*) || die
960 +
961 + sed -e "s:/usr/share/fsl/doc:${EPREFIX}/usr/share/fsl/doc:g" \
962 + -i $(grep -rl "/usr/share/fsl/doc" src/*) || die
963 +
964 + sed -e "s:\$FSLDIR/etc:${EPREFIX}/etc:g" \
965 + -e "s:\${FSLDIR}/etc:${EPREFIX}/etc:g" \
966 + -i $(grep -rlI "\$FSLDIR/etc" *) \
967 + -i $(grep -rlI "\${FSLDIR}/etc" *) || die
968 +
969 + # Use generic blas/lapack rather than openblas
970 + sed -e "s:-lopenblas:-llapack -lblas:g" \
971 + -i $(grep -rlI lopenblas *) || die
972 +
973 + # script wanting to have access to flsversion at buildtime
974 + sed -e "s:/etc/fslversion:${S}/etc/fslversion:g" \
975 + -i ${makefilelist} || die
976 +}
977 +
978 +src_compile() {
979 + export FSLDIR=${WORKDIR}/${PN}
980 + export FSLCONDIR=${WORKDIR}/${PN}/config
981 + export FSLMACHTYPE=generic
982 +
983 + export USERLDFLAGS="${LDFLAGS}"
984 + export USERCFLAGS="${CFLAGS}"
985 + export USERCXXFLAGS="${CXXFLAGS}"
986 +
987 + export CIFTICFLAGS="$($(tc-getPKG_CONFIG) --cflags CiftiLib)"
988 + export CIFTILIBS="$($(tc-getPKG_CONFIG) --libs-only-l CiftiLib)"
989 +
990 + ./build || die
991 +}
992 +
993 +src_install() {
994 + sed -i "s:\${FSLDIR}/tcl:/usr/libexec/fsl:g" \
995 + $(grep -lI "\${FSLDIR}/tcl" bin/*) \
996 + $(grep -l "\${FSLDIR}/tcl" tcl/*) || die
997 + sed -i "s:\$FSLDIR/tcl:/usr/libexec/fsl:g" \
998 + $(grep -l "\$FSLDIR/tcl" tcl/*) || die
999 +
1000 + dobin bin/*
1001 +
1002 + insinto /usr/share/${PN}
1003 + doins -r data
1004 + dodoc -r doc/. refdoc
1005 +
1006 + insinto /usr/libexec/fsl
1007 + doins -r tcl/*
1008 +
1009 + insinto /etc/fslconf
1010 + doins etc/fslconf/fsl.sh
1011 +
1012 + insinto /etc
1013 + doins etc/fslversion
1014 + doins -r etc/default_flobs.flobs etc/flirtsch etc/js etc/luts
1015 +
1016 + #the following is needed for FSL and depending programs to be able
1017 + #to find its files, since FSL uses an uncommon installation path:
1018 + #https://github.com/gentoo-science/sci/pull/612#r60289295
1019 + dosym ../../../etc ${UPSTREAM_FSLDIR}/etc
1020 + dosym ../doc/${PF} ${UPSTREAM_FSLDIR}/doc
1021 + dosym ../../bin ${UPSTREAM_FSLDIR}/bin
1022 +
1023 + doenvd "$(prefixify_ro "${FILESDIR}"/99fsl)"
1024 + mv "${ED}"/usr/bin/{,fsl_}cluster || die
1025 +}
1026 +
1027 +pkg_postinst() {
1028 + echo
1029 + einfo "Please run the following commands if you"
1030 + einfo "intend to use fsl from an existing shell:"
1031 + einfo "env-update && source /etc/profile"
1032 + echo
1033 +}