[Nix-dev] new package: crack-attack

Marc Weber marco-oweber at gmx.de
Tue Sep 21 16:57:10 CEST 2010


Hi Piotr,

> I've created my first nix package by editing the *current* /etc/nixos/nixpkgs/.
which revision?
callPackage is used now. callPackage abstracts away passsing that many

parameters. Thus 
>   crack_attack = callPackage ../games/crack-attack {
>     inherit stdenv fetchurl pkgconfig freeglut SDL mesa;
>   [...]

becomes
   crack_attack = callPackage ../games/crack-attack { };

>     src = fetchurl {
>       url = http://savannah.nongnu.org/download/crack-attack/crack-attack-1.1.14.tar.gz;
>       md5 = "262445024b0fca44508355242ea29d71";
>     };

1) nixpkgs contains a mirror list (pkgs/build-support/fetchurl/mirrors.nix):
  Thus your url could be written as
  mirror://savannah/crack-attack/crack-attack-1.1.14.tar.gz

2) It may be more convenient for you using nix-prefetch-url. It outputs
  a sha256 hash. Thus when prefetching md5 becomes sha256 = "the hash";

  It supports the mirror:// syntax, so you can use it to test your
  mirror url

>       license = "GPL";
should be GPLv2 (at least my gentoo ebuild says its version 2)
I didn't read the source.

> Does this look OK so far? The above builds on my x86_64 platform. I
Yes.

> was not sure what to put in the 'platform' attribute. The crack-attack
> supports more then one platform(linux, os x), but I tested only on
> one.
In nixpkgs not all packages are tested regularly. Only the core ones
(whatever that means). I want to say: Some seldomly used packages are likely to
break when a core library (glibc, gtk, python, ..) are updated. Sometimes such
breakage is not noticed. 

Thus I personally don't think this package will be used enough to take
care about linux/ mac/ .. If it fails to build on Mac the person trying
to run will fix it. (IMHO) Well, I'm lazy :)
 
> Could this be included in the nix packages collection?
Fix the license. Maybe add the mirror and your patch is likely to be
comitted by someone.

If you don't know already and if you want to learn how to prepare
patches using git I can help you getting started.

Marc Weber



More information about the nix-dev mailing list