From 0b11f22f49e1e9b05a9ed357e55b6a892a40ad8e Mon Sep 17 00:00:00 2001
From: "Yury G. Kudryashov" <urkud.urkud@gmail.com>
Date: Sat, 1 May 2010 07:41:40 +0000
Subject: [PATCH] Trying to fix virtuoso build on freebsd

svn path=/nixpkgs/trunk/; revision=21475
---
 pkgs/servers/sql/virtuoso/default.nix | 7 +++++--
 pkgs/top-level/all-packages.nix       | 2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/pkgs/servers/sql/virtuoso/default.nix b/pkgs/servers/sql/virtuoso/default.nix
index 5c94f375d4f2..346b63bafe52 100644
--- a/pkgs/servers/sql/virtuoso/default.nix
+++ b/pkgs/servers/sql/virtuoso/default.nix
@@ -1,4 +1,6 @@
-{ stdenv, fetchurl, libxml2, openssl, readline }:
+{ stdenv, fetchurl, libxml2, openssl, readline, gawk }:
+
+assert stdenv ? gawk || gawk != null;
 
 stdenv.mkDerivation rec {
   name = "virtuoso-opensource-6.1.1";
@@ -8,7 +10,8 @@ stdenv.mkDerivation rec {
     sha256 = "1sd70j9i26ml16lig9r9lmrdf5q0kybq71r6vzzzc5v5jxjz0l7w";
   };
 
-  buildInputs = [ libxml2 openssl readline ];
+  buildInputs = [ libxml2 openssl readline ]
+    ++ stdenv.lib.optional (! stdenv ? gawk) gawk;
 
   CPP="${stdenv.gcc}/bin/gcc -E";
 
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 1b16caf967ef..17cdbd9352a6 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -5758,7 +5758,7 @@ let
   };
 
   virtuoso = makeOverridable (import ../servers/sql/virtuoso) {
-    inherit stdenv fetchurl libxml2 openssl readline;
+    inherit stdenv fetchurl libxml2 openssl readline gawk;
   };
 
   vsftpd = import ../servers/ftp/vsftpd {