···133133 in stdenv.mkDerivation (rec {
134134 inherit pname version nativeLibs javaLibs lispLibs lisp systems asds;
135135136136- src = if builtins.length patches > 0
137137- then apply-patches args
138138- else args.src;
139139-140136 # When src is null, we are building a lispWithPackages and only
141137 # want to make use of the dependency environment variables
142138 # generated by build-asdf-system
···201197 #
202198 # NOTE: It's important to read files from `src` instead of
203199 # from pwd to get go-to-definition working with SLIME
204204- export CL_SOURCE_REGISTRY=$CL_SOURCE_REGISTRY:${src}//
200200+ export CL_SOURCE_REGISTRY=$CL_SOURCE_REGISTRY:$src//
205201206202 # Similiarily for native deps
207203 export LD_LIBRARY_PATH=${makeLibraryPath nativeLibs}:$LD_LIBRARY_PATH
···209205210206 # Make asdf compile from `src` to pwd and load `lispLibs`
211207 # from storeDir. Otherwise it could try to recompile lisp deps.
212212- export ASDF_OUTPUT_TRANSLATIONS="${src}:$(pwd):${storeDir}:${storeDir}"
208208+ export ASDF_OUTPUT_TRANSLATIONS="$src:$(pwd):${storeDir}:${storeDir}"
213209214210 # track lisp dependencies for graph generation
215211 # TODO: Do the propagation like for lisp, native and java like this:
···248244 dontStrip = true;
249245 dontFixup = true;
250246251251- } // args));
252252-253253- # Need to do that because we always want to compile straight from
254254- # `src` for go-to-definition to work in SLIME.
255255- apply-patches = { patches, src, ... }:
256256- stdenv.mkDerivation {
257257- inherit patches src;
258258- pname = "source";
259259- version = "patched";
260260- dontConfigure = true;
261261- dontBuild = true;
262262- dontStrip = true;
263263- dontFixup = true;
264264- installPhase = ''
265265- mkdir -pv $out
266266- cp -r * $out
267267- '';
268268- };
247247+ } // (args // {
248248+ src = if builtins.length (args.patches or []) > 0
249249+ then pkgs.applyPatches { inherit (args) src patches; }
250250+ else args.src;
251251+ patches = [];
252252+ })));
269253270254 # Build the set of lisp packages using `lisp`
271255 # These packages are defined manually for one reason or another: