edit How to write a patch ?quick & dirty: copy paste existing code and make it fit your needs. Additionally you should read various docs: (TODO complete this list and put in proper urls to the final document rather than the xml sources) Source:
Eg doc/coding-conventions.xml edit I have a patchThanks. Send it to the mailinglist so that we can discuss and apply it. edit Howto get access to SVN ?DRAFT: Run for an SVN account by writing to the mailinglist. Eelco Dolstra (irc nick: niksnut) is responsible. In the past everyone got access who proofed that he / she has been interested in the project for some time. Proofing this can be done by
edit PATCHESDRAFT: If you break things don't scream if someone reverts it. This happened some times in the past. The best thing to do then is fixing your patch. If it causes a lot of rebuilds commit it to the stdenv-updates branch If you break things ask on the mailinglist and or contact the author of the code you break before comitting. Eg you can use svn annotate to get to know who comitted a line. Sander: Suggestion: maybe someone should verify what the impact is of a change by checking the build job status on [1] edit HOW to verify that you didn't break evaluation by accident ?Run a script like this: (TODO: improve it and add more documentation)
#!/bin/sh
set -e -x
export NIXOS=${NIXOS:-/etc/nixos/nixos}
export NIXPKGS_ALL=${NIXPKGS_ALL:-/etc/nixos/nixpkgs}
# evaluate all derivations found in all-packages.nix:
nix-env -qa '*' --show-trace -P --out-path -f $NIXPKGS_ALL/pkgs/top-level/all-packages.nix
# evaluate all derivations found in release.nix before starting the build:
# nix-env -qa '*' $NIXPKGS_ALL/pkgs/top-level/release.nix
# nix-instantiate --readonly-mode $NIXPKGS_ALL/pkgs/top-level/release.nix --show-trace
# build a release tarball which contains the most important packages (?)
nix-build -A tarball $NIXOS/release.nix --show-trace
TODO: explain what is done exactly The nixpkgs-dev-utilities referenced on Nix(OS) related repositories and work tries to implement this for your convinience edit Upgrade the version of a package already in nixpkgs_unstable manuallyIf you are running NixOS the svn checkout will already be in /etc/nixos/nixpkgs/pkgs, otherwise: svn co https://svn.nixos.org/repos/nix/nixpkgs/trunk ./nixpkgs_svn Find the package you want to upgrade: nixpkgs_svn/pkgs/servers/http/couchdb/src-for-default.nix
rec {
version="0.11.0";
name="couchdb-0.11.0";
hash="0jdh9h6kzay02fpcjvhpwgvpwy9s8yl0hjc5j67lyw504wn2d441";
url="mirror://apache/couchdb/0.11.0/apache-couchdb-${version}.tar.gz";
advertisedUrl="http://www.apache.org/dist/couchdb/0.11.0/apache-couchdb-0.11.0.tar.gz";
}
Get the correct hash: $ nix-prefetch-url http://www.apache.org/dist/couchdb/1.0.0/apache-couchdb-1.0.0.tar.gz Update nixpkgs_svn/pkgs/servers/http/couchdb/src-for-default.nix with the new details:
rec {
version="1.0.0";
name="couchdb-1.0.0";
hash="0mrg7jw29bg1y6m0gj3qbr0amwsz7dl8jl7n46jvy7d54dldwf6a";
url="mirror://apache/couchdb/1.0.0/apache-couchdb-${version}.tar.gz";
advertisedUrl="http://www.apache.org/dist/couchdb/1.0.0/apache-couchdb-1.0.0.tar.gz";
}
To test that it works, copy it into your current channel (~/.nix-defexpr) and install it $ cp nixpkgs_svn/pkgs/servers/http/couchdb/src-for-default.nix /nix/var/nix/gcroots/per-user/root/channels/nixpkgs_unstable/pkgs/servers/http/couchdb/src-for-default.nix $ nix-env -i couchdb Test that the new version of the application is working correctly. If it looks good you can submit the patch by sending it to the mailing list. First create the patch file: $ cd nixpkgs_svn $ svn diff > couchdb-1.0.0.patch Which will look something like this:
Index: pkgs/servers/http/couchdb/src-for-default.nix
===================================================================
--- pkgs/servers/http/couchdb/src-for-default.nix (revision 22713)
+++ pkgs/servers/http/couchdb/src-for-default.nix (working copy)
@@ -1,9 +1,8 @@
rec {
- version="0.11.0";
- name="couchdb-0.11.0";
- hash="0jdh9h6kzay02fpcjvhpwgvpwy9s8yl0hjc5j67lyw504wn2d441";
- url="mirror://apache/couchdb/0.11.0/apache-couchdb-${version}.tar.gz";
- advertisedUrl="http://www.apache.org/dist/couchdb/0.11.0/apache-couchdb-0.11.0.tar.gz";
-
-
+ version="1.0.0";
+ name="couchdb-1.0.0";
+ hash="0mrg7jw29bg1y6m0gj3qbr0amwsz7dl8jl7n46jvy7d54dldwf6a";
+ url="mirror://apache/couchdb/1.0.0/apache-couchdb-${version}.tar.gz";
+ advertisedUrl="http://www.apache.org/dist/couchdb/1.0.0/apache-couchdb-1.0.0.tar.gz";
+
}
Then you can send your patch to the mailing list, where someone can review it, give you feedback or simply add it to nixpkgs. |