about summary refs log tree commit diff
path: root/pkgs/applications/networking/p2p/gnunet
diff options
context:
space:
mode:
authorRahul Gopinath <rahul@gopinath.org>2016-07-04 17:10:19 -0700
committerRahul Gopinath <rahul@gopinath.org>2016-07-04 17:10:22 -0700
commitaf074c0972861f8db07aa200f476c790dc862b32 (patch)
tree2828985d59e0d13a8974eec737ffad8fdf749dc4 /pkgs/applications/networking/p2p/gnunet
parentb31ab67a819ba4ba8298057c2eda40a4f9df1094 (diff)
downloadnixlib-af074c0972861f8db07aa200f476c790dc862b32.tar
nixlib-af074c0972861f8db07aa200f476c790dc862b32.tar.gz
nixlib-af074c0972861f8db07aa200f476c790dc862b32.tar.bz2
nixlib-af074c0972861f8db07aa200f476c790dc862b32.tar.lz
nixlib-af074c0972861f8db07aa200f476c790dc862b32.tar.xz
nixlib-af074c0972861f8db07aa200f476c790dc862b32.tar.zst
nixlib-af074c0972861f8db07aa200f476c790dc862b32.zip
gnunet: cleanup patching
Do not use loop and sed since sed can take a list of files.
Diffstat (limited to 'pkgs/applications/networking/p2p/gnunet')
-rw-r--r--pkgs/applications/networking/p2p/gnunet/default.nix24
1 files changed, 8 insertions, 16 deletions
diff --git a/pkgs/applications/networking/p2p/gnunet/default.nix b/pkgs/applications/networking/p2p/gnunet/default.nix
index c1fd4a4c2132..54c232674bf6 100644
--- a/pkgs/applications/networking/p2p/gnunet/default.nix
+++ b/pkgs/applications/networking/p2p/gnunet/default.nix
@@ -20,21 +20,13 @@ stdenv.mkDerivation rec {
     # 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'..."
-      sed -i "$i" -e's/\<localhost\>/127.0.0.1/g'
-    done
+    find . \( -name \*.c -or -name \*.conf \) | \
+      xargs sed -ie 's|\<localhost\>|127.0.0.1|g'
 
     # 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
-      echo "$i: replacing references to \`/tmp' by \`$TMPDIR'..."
-      substituteInPlace "$i" --replace "/tmp" "$TMPDIR"
-    done
+    find . \( -iname \*test\*.c -or -name \*.conf \) | \
+      xargs sed -ie "s|/tmp|$TMPDIR|g"
 
     # Ensure NSS installation works fine
     configureFlags="$configureFlags --with-nssdir=$out/lib"
@@ -57,7 +49,7 @@ stdenv.mkDerivation rec {
     '';
   */
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "GNU's decentralized anonymous and censorship-resistant P2P framework";
 
     longDescription = ''
@@ -77,9 +69,9 @@ stdenv.mkDerivation rec {
 
     homepage = http://gnunet.org/;
 
-    license = stdenv.lib.licenses.gpl2Plus;
+    license = licenses.gpl2Plus;
 
-    maintainers = with stdenv.lib.maintainers; [ viric vrthra ];
-    platforms = stdenv.lib.platforms.gnu;
+    maintainers = with maintainers; [ viric vrthra ];
+    platforms = platforms.gnu;
   };
 }