[Nix-dev] nix pkg contribution: derivation for "quilt"

Bill Trost trost at cloud.rain.com
Fri Aug 7 19:28:52 CEST 2009


Well, after a bunch of help from several people on the mailing
list (THANK YOU!), and a lot of time spent by me not working
on this, I have finally completed what I hope is a reasonable
derivation rule for the quilt package. I've attached it below.
Hopefully, the comments explain the compromises and decisions
I've made to actually get a clean, working, pure result.

Given how much trouble I had getting to the point where I could
start working on a derivation for contribution, I think it would be
really helpful if there were a web page on nixos.org that explained
for the interested contributor what they need to do in order to
build and test the derivations they make. The manual describes a
simple use of mkDerivation, but gives no hints as to what you have
to do to actually build such a derivation once you've written it.

Anyhow, should anyone care about quilt, attached is how to build it.

Enjoy!
Bill


args: with args;
let
  version = "0.48";
in
stdenv.mkDerivation rec {
  name = "quilt";
  src = fetchurl {
    url = "http://download.savannah.gnu.org/releases-noredirect/${name}/${name}-${version}.tar.gz";
    sha256 = "73fd760d3b5cbf06417576591dc37d67380d189392db9000c21b7cbebee49ffc";
  };

  # ed is required by pod2man, and probably "make check", and who-knows-what
  buildInputs = [ed perl];
  
  # prevent configure from finding sendmail on its own
  # This would be a good place to add an optional sendmail package.
  configureFlags = "--sbindir /does/not/exist/stop/it/look/elsewhere/for/sendmail";

  # delete.test is returning a very odd "permission denied" error, so
  # skip for now
  # Remove the email test -- no reason to force the builder to have an
  # email server, and "formail" isn't a nix package (yet).
  preBuild = "rm test/delete.test test/mail.test";

  # The quilt scripts rely on $PATH for many commands, so purify it here
  # rather than trying to run through all the scripts and patch each
  # command by hand.
 postBuild = ''ed bin/quilt << %
  	1a
  	# The following line generated by quilt/default.nix
  	export PATH=${bash}/bin:${coreutils}/bin:${diffutils}/bin:${ed}/bin:${findutils}/bin:${gawk}/bin:${getopt}/bin:${gnugrep}/bin:${gnupatch}/bin:${gnused}/bin:${gnutar}/bin:${gzip}/bin:${perl}/bin
.
  	w
%
'';
  doCheck = true;

  meta = {
    homepage = http://savannah.nongnu.org/projects/quilt;
    description = "Quilt allows you to easily manage large numbers of patches by keeping track of the changes each patch makes.";
    license = "GPL2";		# ...I think. Too many variants of GPL2 to choose from!
  };
}



More information about the nix-dev mailing list