about summary refs log tree commit diff
path: root/pkgs/applications/networking/p2p/gnunet
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2010-01-05 11:16:42 +0000
committerLudovic Courtès <ludo@gnu.org>2010-01-05 11:16:42 +0000
commitbfb476c7d622d4d86142524974b4afb3c15bcc04 (patch)
tree2b7b5b7ccff6803794a3e205ecdc72a9a353fe31 /pkgs/applications/networking/p2p/gnunet
parenteaf1e51ab7d4895c852e3433ade4fb5c62008256 (diff)
downloadnixlib-bfb476c7d622d4d86142524974b4afb3c15bcc04.tar
nixlib-bfb476c7d622d4d86142524974b4afb3c15bcc04.tar.gz
nixlib-bfb476c7d622d4d86142524974b4afb3c15bcc04.tar.bz2
nixlib-bfb476c7d622d4d86142524974b4afb3c15bcc04.tar.lz
nixlib-bfb476c7d622d4d86142524974b4afb3c15bcc04.tar.xz
nixlib-bfb476c7d622d4d86142524974b4afb3c15bcc04.tar.zst
nixlib-bfb476c7d622d4d86142524974b4afb3c15bcc04.zip
GNUnet 0.8.1.
svn path=/nixpkgs/trunk/; revision=19219
Diffstat (limited to 'pkgs/applications/networking/p2p/gnunet')
-rw-r--r--pkgs/applications/networking/p2p/gnunet/default.nix44
-rw-r--r--pkgs/applications/networking/p2p/gnunet/disable-http-tests.patch88
-rw-r--r--pkgs/applications/networking/p2p/gnunet/tmpdir.patch93
3 files changed, 23 insertions, 202 deletions
diff --git a/pkgs/applications/networking/p2p/gnunet/default.nix b/pkgs/applications/networking/p2p/gnunet/default.nix
index 1abf982f9a3a..6f69b8c7ca1d 100644
--- a/pkgs/applications/networking/p2p/gnunet/default.nix
+++ b/pkgs/applications/networking/p2p/gnunet/default.nix
@@ -6,20 +6,16 @@
 
 assert gtkSupport -> (gtk != null) && (libglade != null);
 
-let version = "0.8.0b";
+let version = "0.8.1";
 in
   stdenv.mkDerivation {
     name = "gnunet-${version}";
 
     src = fetchurl {
-      url = "http://gnunet.org/download/GNUnet-${version}.tar.bz2";
-      sha256 = "1d1abnfqbd1f8pjzq9p0za7jyy2lay7k8l09xadk83k8d96abwcs";
+      url = "mirror://gnu/gnunet/GNUnet-${version}.tar.gz";
+      sha256 = "0makh52fsrsxg2qgfi1n68sh2hllqxj453g335m05wk05d7minl4";
     };
 
-    configureFlags = ''
-      --without-included-ltdl --disable-ltdl-install --with-ltdl-include=${libtool}/include --with-ltdl-lib=${libtool}/lib
-    '';
-
     buildInputs = [
       libextractor libmicrohttpd libgcrypt gmp curl libtool
       zlib guile adns sqlite libxml2 ncurses
@@ -27,14 +23,19 @@ in
       makeWrapper
     ] ++ (if gtkSupport then [ gtk libglade ] else []);
 
-    patches = [
-      ./tmpdir.patch
-      ./disable-http-tests.patch
-    ];
-
     preConfigure = ''
-      # Brute force: make sure the tests don't rely on `/tmp', for
-      # the sake of chroot builds.
+      # Brute force: since nix-worker chroots don't provide
+      # /etc/{resolv.conf,hosts}, replace all references to `localhost'
+      # by their IPv4 equivalent.
+      for i in $(find . \( -name \*.c -or -name \*.conf \) \
+                      -exec grep -l localhost {} \;)
+      do
+        echo "$i: substituting \`127.0.0.1' to \`localhost'..."
+        substituteInPlace "$i" --replace "localhost" "127.0.0.1"
+      done
+
+      # Make sure the tests don't rely on `/tmp', for the sake of chroot
+      # builds.
       for i in $(find . \( -iname \*test\*.c -or -name \*.conf \) \
                       -exec grep -l /tmp {} \;)
       do
@@ -43,16 +44,15 @@ in
       done
     '';
 
-    # Tests have to be run xonce it's installed.
-    # FIXME: Re-enable tests when they are less broken.
-    #postInstall = ''
-    #  GNUNET_PREFIX="$out" make check
-    #'';
-
     doCheck = false;
 
-    # Help programs find the numerous modules that sit under `$out/lib/GNUnet'.
+    # 1. Run tests have once GNUnet is installed.
+    # 2. Help programs find the numerous modules that sit under
+    #    `$out/lib/GNUnet'.
+
+    # FIXME: `src/transports/test_udp' hangs forever.
     postInstall = ''
+      #GNUNET_PREFIX="$out" make check
       wrapProgram "$out/bin/gnunetd" \
         --prefix LTDL_LIBRARY_PATH ":" "$out/lib/GNUnet"
     '';
@@ -78,5 +78,7 @@ in
       homepage = http://gnunet.org/;
 
       license = "GPLv2+";
+
+      maintainers = [ stdenv.lib.maintainers.ludo ];
     };
   }
diff --git a/pkgs/applications/networking/p2p/gnunet/disable-http-tests.patch b/pkgs/applications/networking/p2p/gnunet/disable-http-tests.patch
deleted file mode 100644
index 919a1fca63c4..000000000000
--- a/pkgs/applications/networking/p2p/gnunet/disable-http-tests.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-Disable HTTP tests as they seem to deadlock when building in a chroot on NixOS.
-
-diff --git a/src/transports/Makefile.in b/src/transports/Makefile.in
-index b0b76a2..30a0bb5 100644
---- a/src/transports/Makefile.in
-+++ b/src/transports/Makefile.in
-@@ -38,8 +38,8 @@ PRE_UNINSTALL = :
- POST_UNINSTALL = :
- host_triplet = @host@
- check_PROGRAMS = test_udp$(EXEEXT) test_tcp$(EXEEXT) \
--	test_http$(EXEEXT) testrepeat_udp$(EXEEXT) \
--	testrepeat_tcp$(EXEEXT) testrepeat_http$(EXEEXT)
-+	testrepeat_udp$(EXEEXT) \
-+	testrepeat_tcp$(EXEEXT)
- subdir = src/transports
- DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
- ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-
-diff --git a/src/applications/session/Makefile.in b/src/applications/session/Makefile.in
-index b2717f9..a048d21 100644
---- a/src/applications/session/Makefile.in
-+++ b/src/applications/session/Makefile.in
-@@ -38,7 +38,7 @@ PRE_UNINSTALL = :
- POST_UNINSTALL = :
- host_triplet = @host@
- check_PROGRAMS = sessiontest_tcp$(EXEEXT) sessiontest_udp$(EXEEXT) \
--	sessiontest_nat$(EXEEXT) $(am__EXEEXT_1)
-+	sessiontest_nat$(EXEEXT)
- subdir = src/applications/session
- DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
- ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-
-diff --git a/src/applications/tbench/Makefile.in b/src/applications/tbench/Makefile.in
-index ea061bc..c6ee8f8 100644
---- a/src/applications/tbench/Makefile.in
-+++ b/src/applications/tbench/Makefile.in
-@@ -39,8 +39,7 @@ PRE_UNINSTALL = :
- POST_UNINSTALL = :
- host_triplet = @host@
- bin_PROGRAMS = gnunet-tbench$(EXEEXT)
--check_PROGRAMS = tbenchtest_tcp$(EXEEXT) tbenchtest_udp$(EXEEXT) \
--	$(am__EXEEXT_1)
-+check_PROGRAMS = tbenchtest_tcp$(EXEEXT) tbenchtest_udp$(EXEEXT)
- subdir = src/applications/tbench
- DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
- ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-
-diff --git a/src/applications/advertising/Makefile.in b/src/applications/advertising/Makefile.in
-index 454fa63..af7aefb 100644
---- a/src/applications/advertising/Makefile.in
-+++ b/src/applications/advertising/Makefile.in
-@@ -38,7 +38,7 @@ PRE_UNINSTALL = :
- POST_UNINSTALL = :
- host_triplet = @host@
- check_PROGRAMS = advertisingtest_tcp$(EXEEXT) \
--	advertisingtest_udp$(EXEEXT) $(am__EXEEXT_1)
-+	advertisingtest_udp$(EXEEXT)
- subdir = src/applications/advertising
- DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
- ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-
-diff --git a/src/applications/bootstrap_http/Makefile.in b/src/applications/bootstrap_http/Makefile.in
-index 29800af..ad5c6a1 100644
---- a/src/applications/bootstrap_http/Makefile.in
-+++ b/src/applications/bootstrap_http/Makefile.in
-@@ -37,7 +37,7 @@ NORMAL_UNINSTALL = :
- PRE_UNINSTALL = :
- POST_UNINSTALL = :
- host_triplet = @host@
--check_PROGRAMS = httptest$(EXEEXT)
-+check_PROGRAMS =
- subdir = src/applications/bootstrap_http
- DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
- ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-
-diff --git a/src/applications/hostlist/Makefile.in b/src/applications/hostlist/Makefile.in
-index 126df5e..2317c60 100644
---- a/src/applications/hostlist/Makefile.in
-+++ b/src/applications/hostlist/Makefile.in
-@@ -37,7 +37,7 @@ NORMAL_UNINSTALL = :
- PRE_UNINSTALL = :
- POST_UNINSTALL = :
- host_triplet = @host@
--check_PROGRAMS = hostlisttest$(EXEEXT)
-+check_PROGRAMS =
- subdir = src/applications/hostlist
- DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
- ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
diff --git a/pkgs/applications/networking/p2p/gnunet/tmpdir.patch b/pkgs/applications/networking/p2p/gnunet/tmpdir.patch
deleted file mode 100644
index e47a253e0f0f..000000000000
--- a/pkgs/applications/networking/p2p/gnunet/tmpdir.patch
+++ /dev/null
@@ -1,93 +0,0 @@
-Make sure the core libraries used by the tests honor $TMPDIR.
-
-diff --git a/src/applications/dstore_sqlite/dstore.c b/src/applications/dstore_sqlite/dstore.c
-index cdcae81..4bb45a3 100644
---- a/src/applications/dstore_sqlite/dstore.c
-+++ b/src/applications/dstore_sqlite/dstore.c
-@@ -129,6 +129,7 @@ db_reset ()
-   int fd;
-   sqlite3 *dbh;
-   char *tmpl;
-+  const char *tmpdir;
- 
-   if (fn != NULL)
-     {
-@@ -136,7 +137,15 @@ db_reset ()
-       GNUNET_free (fn);
-     }
-   payload = 0;
--  tmpl = "/tmp/dstoreXXXXXX";
-+
-+  tmpdir = getenv ("TMPDIR");
-+  tmpdir = tmpdir ? tmpdir : "/tmp";
-+
-+#define TEMPLATE "/gnunet-dstoreXXXXXX"
-+  tmpl = alloca (strlen (tmpdir) + sizeof (TEMPLATE) + 1);
-+  strcpy (tmpl, tmpdir);
-+  strcat (tmpl, TEMPLATE);
-+#undef TEMPLATE
- 
- #ifdef MINGW
-   fn = (char *) GNUNET_malloc (MAX_PATH + 1);
-diff --git a/src/applications/fs/collection/collection.c b/src/applications/fs/collection/collection.c
-index 5671cb3..da2b605 100644
---- a/src/applications/fs/collection/collection.c
-+++ b/src/applications/fs/collection/collection.c
-@@ -487,6 +487,7 @@ GNUNET_CO_collection_publish_now ()
-   char *dirData;
-   char this_revision_string[128];
-   char next_revision_string[128];
-+  const char *tmpdir;
- 
-   GNUNET_mutex_lock (lock);
-   if ((collectionData == NULL) ||
-@@ -495,7 +496,17 @@ GNUNET_CO_collection_publish_now ()
-       GNUNET_mutex_unlock (lock);
-       return;
-     }
--  tmpName = GNUNET_strdup ("/tmp/gnunet-collectionXXXXXX");
-+
-+  tmpdir = getenv ("TMPDIR");
-+  tmpdir = tmpdir ? tmpdir : "/tmp";
-+
-+#define TEMPLATE "/gnunet-collectionXXXXXX"
-+  tmpName = alloca (strlen (tmpdir) + sizeof (TEMPLATE) + 1);
-+  strcpy (tmpName, tmpdir);
-+  strcat (tmpName, TEMPLATE);
-+#undef TEMPLATE
-+
-+  tmpName = GNUNET_strdup (tmpName);
-   fd = mkstemp (tmpName);
-   if (fd == -1)
-     {
-diff --git a/src/applications/fs/fsui/upload.c b/src/applications/fs/fsui/upload.c
-index dc683a5..46a04af 100644
---- a/src/applications/fs/fsui/upload.c
-+++ b/src/applications/fs/fsui/upload.c
-@@ -159,6 +159,7 @@ createDirectoryHelper (struct GNUNET_GE_Context *ectx,
-   int handle;
-   struct GNUNET_GE_Memory *mem;
-   struct GNUNET_GE_Context *ee;
-+  const char *tmpdir;
- 
-   fis = NULL;
-   size = 0;
-@@ -208,7 +209,17 @@ createDirectoryHelper (struct GNUNET_GE_Context *ectx,
-       pos = pos->next;
-     }
-   GNUNET_GE_memory_reset (mem);
--  tempName = GNUNET_strdup ("/tmp/gnunet-upload-dir.XXXXXX");
-+
-+  tmpdir = getenv ("TMPDIR");
-+  tmpdir = tmpdir ? tmpdir : "/tmp";
-+
-+#define TEMPLATE "/gnunet-upload-dirXXXXXX"
-+  tempName = alloca (strlen (tmpdir) + sizeof (TEMPLATE) + 1);
-+  strcpy (tempName, tmpdir);
-+  strcat (tempName, TEMPLATE);
-+#undef TEMPLATE
-+
-+  tempName = GNUNET_strdup (tempName);
-   handle = mkstemp (tempName);
-   if (handle == -1)
-     {