···11+uname -s is used to determine the differences between the command line
22+utilities like stat or awk in linux and darwin. However, in nix, guilt
33+will be using the nix versions of this programs, not the ones
44+installed in the system. Therefore, guilt should use the command-line
55+parameters that the linux forms of these commands expect, even if it
66+is being run on Darwin.
77+88+diff --git a/guilt b/guilt
99+index bf50343..cfc9332 100755
1010+--- a/guilt
1111++++ b/guilt
1212+@@ -986,7 +986,7 @@ guards_file="$GUILT_DIR/$branch/guards"
1313+ pager="more"
1414+ [ ! -z "$PAGER" ] && pager="$PAGER"
1515+1616+-UNAME_S=`uname -s`
1717++UNAME_S="Linux"
1818+1919+ if [ -r "$GUILT_PATH/os.$UNAME_S" ]; then
2020+ . "$GUILT_PATH/os.$UNAME_S"
···11+{ asciidoc
22+, docbook_xml_dtd_45
33+, docbook_xsl
44+, fetchFromGitHub
55+, gawk
66+, git
77+, gnused
88+, lib
99+, makeWrapper
1010+, openssl
1111+, perl
1212+, stdenv
1313+, xmlto
1414+}:
1515+1616+stdenv.mkDerivation rec {
1717+ pname = "guilt";
1818+ version = "0.37-rc1";
1919+2020+ src = fetchFromGitHub {
2121+ owner = "jeffpc";
2222+ repo = "guilt";
2323+ rev = "v${version}";
2424+ sha256 = "sha256-7OgRbMGYWtGvrZxKfJe0CkpmU3AUkPebF5NyTsfXeGA=";
2525+ };
2626+2727+ doCheck = true;
2828+2929+ patches = [
3030+ ./guilt-help-mandir.patch
3131+ ./darwin-fix.patch
3232+ ];
3333+ nativeBuildInputs = [
3434+ asciidoc
3535+ docbook_xml_dtd_45
3636+ docbook_xsl
3737+ makeWrapper
3838+ perl
3939+ xmlto
4040+ ];
4141+ buildInputs = [
4242+ gawk
4343+ git
4444+ gnused
4545+ ] ++ lib.optionals stdenv.isDarwin [ openssl ];
4646+ makeFlags = [
4747+ "PREFIX=$(out)"
4848+ ];
4949+5050+ postBuild = ''
5151+ make -j $NIX_BUILD_CORES doc
5252+ '';
5353+5454+ preCheck = ''
5555+ patchShebangs regression/run-tests regression/*.sh
5656+ '';
5757+5858+ postInstall = ''
5959+ make PREFIX=$out install-doc
6060+ '';
6161+6262+ postFixup = ''
6363+ wrapProgram $out/bin/guilt --prefix PATH : ${lib.makeBinPath buildInputs}
6464+ '';
6565+6666+ meta = with lib; {
6767+ description = "Manage patches like quilt, on top of a git repository";
6868+ longDescription = ''
6969+ Andrew Morton originally developed a set of scripts for
7070+ maintaining kernel patches outside of any SCM tool. Others
7171+ extended these into a suite called quilt]. The basic idea behind
7272+ quilt is to maintain patches instead of maintaining source
7373+ files. Patches can be added, removed or reordered, and they can
7474+ be refreshed as you fix bugs or update to a new base
7575+ revision. quilt is very powerful, but it is not integrated with
7676+ the underlying SCM tools. This makes it difficult to visualize
7777+ your changes.
7878+7979+ Guilt allows one to use quilt functionality on top of a Git
8080+ repository. Changes are maintained as patches which are
8181+ committed into Git. Commits can be removed or reordered, and the
8282+ underlying patch can be refreshed based on changes made in the
8383+ working directory. The patch directory can also be placed under
8484+ revision control, so you can have a separate history of changes
8585+ made to your patches.
8686+ '';
8787+ homepage = "https://github.com/jeffpc/guilt";
8888+ maintainers = with lib.maintainers; [ javimerino ];
8989+ license = [ licenses.gpl2 ];
9090+ platforms = platforms.all;
9191+ };
9292+}