[Nix-dev] lsof nix-expression

Michael Raskin 7c6f434c at mail.ru
Mon Jun 11 19:19:43 CEST 2007


Eelco Dolstra wrote:
> Michael Raskin wrote:
> 
>> source $stdenv/setup || exit 1

Every non-specific line in builder is honestly stolen from some script
checked out from NixOS SVN. Without thinking. OK, I will know it in future..


> It's a bit nicer to use the generic builder (since it does things like running
> patchelf to get rid of unnecessary dependencies, stripping libraries, etc,
> though none of that is particularly useful here).  Something like this (not tested):

I use it for preBuild or preConfigure or *Flags, but not for whole 
phases. I didn't think of using all customization resources hidden in 
this system.

> unpackPhase="tar xvjf $src; cd lsof_*; ... "

>>   src = pkgs.fetchurl {
>>     url = ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/lsof_4.78.tar.bz2;
>>     md5 = "00360ce2b62de3015fa7e0f8f92179a8";
> 
> We're slowly migrating to SHA-256 hashes (since MD5 is not very secure anymore),
Random collisions are dependent more on length, but sha-256 still wins. 
I thought checksum is more useful to discourage *-current.tar.bz2 links 
than to find malicious party who cracked an official mirror of either 
NixOS (he'll mess with hashes too) or some useful package. Really, I 
just took random package as a template, and also I usually take both 
source and MD5 from ftp server. Yes, I should migrate to nix-prefetch-url.

>>   buildInputs = [];
> 
> If buildInputs is empty you can omit it.
I write enough nix-expressions these days to have an empty template and 
fill it - and also I guess that every package in Nix should eventually 
be appropriate for being used as a template..

--

Thanks for all your comments. Now I fixed everything you noted and 
tested it. It works now.

I propose my nix-expression for inclusion as 
pkgs/development/tools/misc/lsof/default.nix (or pkgs/tools/misc/lsof, 
if anyone prefers it this way) . Is it now fit for this purpose?
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: default.nix
Url: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20070611/c5244835/attachment.pl 


More information about the nix-dev mailing list