Merge pull request #205900 from pmiddend/crystfel-fix-patch

crystfel: fix symlib hard-coding

authored by

Sandro and committed by
GitHub
2af5bbd2 650469a6

+14 -4
+1 -1
pkgs/applications/science/physics/crystfel/default.nix
··· 54 54 # We hard-code this by providing a little patch and then passing the absolute path to syminfo.lib as a 55 55 # preprocessor flag. 56 56 preBuild = '' 57 - makeFlagsArray+=(CFLAGS='-DNIX_PROVIDED_SYMOP_FILE=\"$out/share/syminfo.lib\"') 57 + makeFlagsArray+=(CFLAGS='-DNIX_PROVIDED_SYMOP_FILE=\"${placeholder "out"}/share/syminfo.lib\"') 58 58 export NIX_LDFLAGS="-L${gfortran.cc}/lib64 -L${gfortran.cc}/lib $NIX_LDFLAGS"; 59 59 ''; 60 60 makeFlags = [ "CFLAGS='-DNIX_PROVIDED_SYMOP_FILE=\"${placeholder "out"}/share/syminfo.lib\"" ];
+13 -3
pkgs/applications/science/physics/crystfel/libccp4-use-hardcoded-syminfo-lib.patch
··· 1 1 diff --git a/ccp4/csymlib.c b/ccp4/csymlib.c 2 - index 76bc70b..7a0c5dc 100644 2 + index 76bc70b..3616121 100644 3 3 --- a/ccp4/csymlib.c 4 4 +++ b/ccp4/csymlib.c 5 - @@ -137,24 +137,7 @@ CCP4SPG *ccp4spg_load_spacegroup(const int numspg, const int ccp4numspg, 5 + @@ -136,25 +136,7 @@ CCP4SPG *ccp4spg_load_spacegroup(const int numspg, const int ccp4numspg, 6 + } 6 7 } 7 8 8 - /* Open the symop file: */ 9 + - /* Open the symop file: */ 9 10 - if (!(symopfile = getenv("SYMINFO"))) { 10 11 - if (debug) 11 12 - printf("Environment variable SYMINFO not set ... guessing location of symmetry file. \n"); ··· 28 29 29 30 filein = fopen(symopfile,"r"); 30 31 if (!filein) { 32 + @@ -162,8 +144,6 @@ CCP4SPG *ccp4spg_load_spacegroup(const int numspg, const int ccp4numspg, 33 + return NULL; 34 + } 35 + 36 + - if (!(getenv("SYMINFO"))) free(symopfile); 37 + - 38 + parser = ccp4_parse_start(20); 39 + if (parser == NULL) 40 + ccp4_signal(CSYM_ERRNO(CSYMERR_ParserFail),"ccp4spg_load_spacegroup",NULL);