From 051fa1056dfb833166768f11bd74885b4c343162 Mon Sep 17 00:00:00 2001 From: Philipp Middendorf Date: Tue, 13 Dec 2022 11:56:15 +0100 Subject: crystfel: fix symlib hard-coding --- pkgs/applications/science/physics/crystfel/default.nix | 2 +- .../crystfel/libccp4-use-hardcoded-syminfo-lib.patch | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'pkgs/applications/science/physics') diff --git a/pkgs/applications/science/physics/crystfel/default.nix b/pkgs/applications/science/physics/crystfel/default.nix index 81c1fdd6b054..74cc677963e3 100644 --- a/pkgs/applications/science/physics/crystfel/default.nix +++ b/pkgs/applications/science/physics/crystfel/default.nix @@ -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\"" ]; diff --git a/pkgs/applications/science/physics/crystfel/libccp4-use-hardcoded-syminfo-lib.patch b/pkgs/applications/science/physics/crystfel/libccp4-use-hardcoded-syminfo-lib.patch index 9c5e1365492b..1806d9b2b9da 100644 --- a/pkgs/applications/science/physics/crystfel/libccp4-use-hardcoded-syminfo-lib.patch +++ b/pkgs/applications/science/physics/crystfel/libccp4-use-hardcoded-syminfo-lib.patch @@ -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); -- cgit 1.4.1