summary refs log blame commit diff
path: root/pkgs/tools/misc/file/default.nix
blob: cc56205243d54531354f677d0b60719c3ad5c730 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
                                                
 
                         
                 
                   
 
                  
            

                                                                      
      
                                                                    

    
                                                                                      
                        
                                                                     


                 
                                                                             
 
                    
                                            
                                                           

                              

    
{ lib, stdenv, fetchurl, file, zlib, libgnurx }:

stdenv.mkDerivation rec {
  pname = "file";
  version = "5.40";

  src = fetchurl {
    urls = [
      "ftp://ftp.astron.com/pub/file/${pname}-${version}.tar.gz"
      "https://distfiles.macports.org/file/${pname}-${version}.tar.gz"
    ];
    sha256 = "0myxlpj9gy2diqavx33vq88kpvr1k1bpzsm0d0zmb2hl7ks22wqn";
  };

  nativeBuildInputs = lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) file;
  buildInputs = [ zlib ]
              ++ lib.optional stdenv.hostPlatform.isWindows libgnurx;

  doCheck = true;

  makeFlags = lib.optional stdenv.hostPlatform.isWindows "FILE_COMPILE=file";

  meta = with lib; {
    homepage = "https://darwinsys.com/file";
    description = "A program that shows the type of files";
    license = licenses.bsd2;
    platforms = platforms.all;
  };
}