about summary refs log tree commit diff
path: root/pkgs/applications/networking/browsers/elinks
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2011-04-28 21:22:24 +0000
committerLudovic Courtès <ludo@gnu.org>2011-04-28 21:22:24 +0000
commit270ea3beec0d484fde10e667c069ff308b1fcbe1 (patch)
tree69b252c8d4b9e7de6804bf57f390db3d9c72353f /pkgs/applications/networking/browsers/elinks
parent163c51f29932d89e205f85be230bd483f6d11b11 (diff)
Elinks: Fix libgc initialization.
svn path=/nixpkgs/trunk/; revision=27046
Diffstat (limited to 'pkgs/applications/networking/browsers/elinks')
-rw-r--r--pkgs/applications/networking/browsers/elinks/default.nix4
-rw-r--r--pkgs/applications/networking/browsers/elinks/gc-init.patch17
2 files changed, 20 insertions, 1 deletions
diff --git a/pkgs/applications/networking/browsers/elinks/default.nix b/pkgs/applications/networking/browsers/elinks/default.nix
index e06bfe538c007..1587a2e349538 100644
--- a/pkgs/applications/networking/browsers/elinks/default.nix
+++ b/pkgs/applications/networking/browsers/elinks/default.nix
@@ -9,8 +9,10 @@ stdenv.mkDerivation rec {
     sha256 = "1li4vlbq8wvnigxlkzb15490y90jg6y9yzzrqpqcz2h965w5869d";
   };
 
+  patches = [ ./gc-init.patch ];
+
   buildInputs = [ python perl ncurses x11 bzip2 zlib openssl spidermonkey guile gpm ];
-  
+
   configureFlags =
     ''
       --enable-finger --enable-html-highlight --with-guile
diff --git a/pkgs/applications/networking/browsers/elinks/gc-init.patch b/pkgs/applications/networking/browsers/elinks/gc-init.patch
new file mode 100644
index 0000000000000..de06f563d6e6a
--- /dev/null
+++ b/pkgs/applications/networking/browsers/elinks/gc-init.patch
@@ -0,0 +1,17 @@
+Fix libgc initialization in the presence of Guile 2.0.
+
+--- elinks-0.12pre5/src/main/main.c	2009-07-07 14:23:17.000000000 +0200
++++ elinks-0.12pre5/src/main/main.c	2011-04-28 23:20:15.000000000 +0200
+@@ -339,6 +339,11 @@ int
+ main(int argc, char *argv[])
+ {
+ #ifdef CONFIG_GC
++	/* Guile 2.x uses libgc too and it initializes it this way, so we
++	 * must make sure to initialize it the same way, or it will just
++	 * segfault.  */
++	GC_all_interior_pointers = 0;
++
+ 	GC_INIT();
+ 	GC_set_warn_proc(gc_warning);
+ #endif
+