From 09fed91ec8e084c4cdfd9e2363d65e8bb7c48091 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Fri, 20 Jul 2018 22:02:00 -0400 Subject: [PATCH] file: build on windows --- pkgs/tools/misc/file/default.nix | 7 +++++-- pkgs/top-level/all-packages.nix | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/misc/file/default.nix b/pkgs/tools/misc/file/default.nix index aeb43d7c1151..485f46d03144 100644 --- a/pkgs/tools/misc/file/default.nix +++ b/pkgs/tools/misc/file/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, file, zlib }: +{ stdenv, fetchurl, file, zlib, libgnurx }: stdenv.mkDerivation rec { name = "file-${version}"; @@ -13,10 +13,13 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) file; - buildInputs = [ zlib ]; + buildInputs = [ zlib ] + ++ stdenv.lib.optional stdenv.hostPlatform.isWindows libgnurx; doCheck = true; + makeFlags = if stdenv.hostPlatform.isWindows then "FILE_COMPILE=file" + else null; meta = with stdenv.lib; { homepage = http://darwinsys.com/file; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index de255678ca29..5c0e1ddb26e8 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2387,7 +2387,9 @@ with pkgs; figlet = callPackage ../tools/misc/figlet { }; - file = callPackage ../tools/misc/file { }; + file = callPackage ../tools/misc/file { + inherit (windows) libgnurx; + }; filegive = callPackage ../tools/networking/filegive { };