~ruther/guix-local

4a1b3830a8ff6b05ad9a2b27c8a2cdbd00a45787 — Nguyễn Gia Phong 2 years ago 211c66d
gnu: dante: Enable preloading support.

Fixes <https://issues.guix.gnu.org/63250>.

Dante uses dlopen which doesn't work with libc.so but libc.so.6.
This fixes socksify, which is patched to skip invoking uname needlessly.

* gnu/packages/networking.scm (dante): Enable preloading support.
* gnu/packages/patches/dante-non-darwin.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.

References: https://github.com/NixOS/nixpkgs/pull/68418#discussion_r343625853
Change-Id: I03a5b6b6e11cf6a0453a4968ff00c6dd627249a8
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
3 files changed, 19 insertions(+), 6 deletions(-)

M gnu/local.mk
M gnu/packages/networking.scm
A gnu/packages/patches/dante-non-darwin.patch
M gnu/local.mk => gnu/local.mk +1 -0
@@ 1066,6 1066,7 @@ dist_patch_DATA =						\
  %D%/packages/patches/cursynth-wave-rand.patch			\
  %D%/packages/patches/cvs-CVE-2017-12836.patch		\
  %D%/packages/patches/d-feet-drop-unused-meson-argument.patch	\
  %D%/packages/patches/dante-non-darwin.patch			\
  %D%/packages/patches/date-output-pkg-config-files.patch	\
  %D%/packages/patches/datefudge-gettimeofday.patch		\
  %D%/packages/patches/dbacl-include-locale.h.patch		\

M gnu/packages/networking.scm => gnu/packages/networking.scm +3 -6
@@ 3640,13 3640,10 @@ and check if the WLAN key or the master key was transmitted unencrypted.")
       (uri (string-append "https://www.inet.no/dante/files/dante-"
                           version ".tar.gz"))
       (sha256
        (base32 "0pbahkj43rx7rmv2x40mf5p3g3x9d6i2sz7pzglarf54w5ghd2j1"))))
         (base32 "0pbahkj43rx7rmv2x40mf5p3g3x9d6i2sz7pzglarf54w5ghd2j1"))
       (patches (search-patches "dante-non-darwin.patch"))))
    (build-system gnu-build-system)
    (arguments
     ;; XXX: The dynamic socks library doesn't work with 'libc.so' (GNU ld
     ;; script).  When preloading is enabled, 'sockd' failed with:
     ;;    … Failed to open library "libc.so": …: invalid ELF header
     '(#:configure-flags '("--disable-preload")))
    (arguments '(#:configure-flags '("--with-libc=libc.so.6")))
    (home-page "https://www.inet.no/dante/")
    (synopsis "SOCKS server and client")
    (description "Dante is a SOCKS client and server implementation.  It can

A gnu/packages/patches/dante-non-darwin.patch => gnu/packages/patches/dante-non-darwin.patch +15 -0
@@ 0,0 1,15 @@
Disable runtime check for Darwin so we don't have to substitute uname.
--- a/bin/socksify.in
+++ b/bin/socksify.in
@@ -65,11 +65,6 @@
     unset FULLPATH
 fi
 
-#use "FLAT_NAMESPACE" on Darwin in attempt to match LD_PRELOAD behavior
-if test x`uname` = xDarwin; then
-    export DYLD_FORCE_FLAT_NAMESPACE=t
-fi
-
 #dlib/Makefile.am libtool flags should produce a predictable library name
 #(ending in SOLIB_POSTFIX).
 LIBRARY="${SOCKS_LIBRARY:-${FULLPATH}libdsocks.@SOLIB_POSTFIX@}"