[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] gnu: icedtea-8: Hardcode dynamically loaded libraries.
From: |
Ludovic Courtès |
Subject: |
Re: [PATCH] gnu: icedtea-8: Hardcode dynamically loaded libraries. |
Date: |
Tue, 13 Sep 2016 13:25:31 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
address@hidden (宋文武) skribis:
> From 1d0dce6f0c40fa35162ecb441b53b32f77dd5b8d Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= <address@hidden>
> 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’.