crystfel: fix symlib hard-coding

This commit is contained in:
Philipp Middendorf 2022-12-13 11:56:15 +01:00
parent 03218f0a5a
commit 051fa1056d
2 changed files with 14 additions and 4 deletions

View File

@ -54,7 +54,7 @@ let
# We hard-code this by providing a little patch and then passing the absolute path to syminfo.lib as a
# preprocessor flag.
preBuild = ''
makeFlagsArray+=(CFLAGS='-DNIX_PROVIDED_SYMOP_FILE=\"$out/share/syminfo.lib\"')
makeFlagsArray+=(CFLAGS='-DNIX_PROVIDED_SYMOP_FILE=\"${placeholder "out"}/share/syminfo.lib\"')
export NIX_LDFLAGS="-L${gfortran.cc}/lib64 -L${gfortran.cc}/lib $NIX_LDFLAGS";
'';
makeFlags = [ "CFLAGS='-DNIX_PROVIDED_SYMOP_FILE=\"${placeholder "out"}/share/syminfo.lib\"" ];

View File

@ -1,11 +1,12 @@
diff --git a/ccp4/csymlib.c b/ccp4/csymlib.c
index 76bc70b..7a0c5dc 100644
index 76bc70b..3616121 100644
--- a/ccp4/csymlib.c
+++ b/ccp4/csymlib.c
@@ -137,24 +137,7 @@ CCP4SPG *ccp4spg_load_spacegroup(const int numspg, const int ccp4numspg,
@@ -136,25 +136,7 @@ CCP4SPG *ccp4spg_load_spacegroup(const int numspg, const int ccp4numspg,
}
}
/* Open the symop file: */
- /* Open the symop file: */
- if (!(symopfile = getenv("SYMINFO"))) {
- if (debug)
- printf("Environment variable SYMINFO not set ... guessing location of symmetry file. \n");
@ -28,3 +29,12 @@ index 76bc70b..7a0c5dc 100644
filein = fopen(symopfile,"r");
if (!filein) {
@@ -162,8 +144,6 @@ CCP4SPG *ccp4spg_load_spacegroup(const int numspg, const int ccp4numspg,
return NULL;
}
- if (!(getenv("SYMINFO"))) free(symopfile);
-
parser = ccp4_parse_start(20);
if (parser == NULL)
ccp4_signal(CSYM_ERRNO(CSYMERR_ParserFail),"ccp4spg_load_spacegroup",NULL);