iyzs...@member.fsf.org (宋文武) skribis: > From 1d0dce6f0c40fa35162ecb441b53b32f77dd5b8d Mon Sep 17 00:00:00 2001 > From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= <iyzs...@gmail.com> > Date: Thu, 8 Sep 2016 23:25:23 +0800 > Subject: [PATCH] gnu: icedtea-8: Hardcode dynamically loaded libraries. > > Fixes <https://bugs.gnu.org/24327>. > > * gnu/packages/java.scm (icedtea-8)[arguments]: Add 'patch-jni-libs' phase.
I’m a bit late, but thanks for fixing it! > + (lambda (file) > + (catch 'encoding-error > + (lambda () > + (substitute* file > + (("VERSIONED_JNI_LIB_NAME\\(\"(.*)\", > \"(.*)\"\\)" > + _ name version) > + (format #f "\"~a\"" (find-library name))) > + (("JNI_LIB_NAME\\(\"(.*)\"\\)" _ name) > + (format #f "\"~a\"" (find-library name))))) > + (lambda _ > + ;; Those are safe to skip. > + (format (current-error-port) > + "warning: failed to substitute: ~a~%" > + file)))) What often works in such cases is to force ISO-8859-1 encoding (“Latin-1”), which is a “catch-all” encoding (it’s an 8-bit encoding that covers the 256 values): (with-fluids ((%default-port-encoding "ISO-8859-1")) (substitute* file-in-arbitrary-ascii-compatible-encoding …)) Ludo’.