Ludovic Courtès writes: >> + (define (dynamic-link-substitute file lib input) >> + (substitute* file >> + (((string-append "dynamic-link \"" lib "\"")) >> + (string-append "dynamic-link \"" >> + (assoc-ref inputs input) >> + "/lib/" lib "\"")))) > > Patterns in ‘substitute*’ are supposed to be literals. > > Wouldn’t it work to do something like: > > (substitute* file > (("dynamic-link \"lib[a-zA-Z]+\" _ libname) > (string-append ...))) > > ? > Yes, that's better. Updated patch attached.