···1+uname -s is used to determine the differences between the command line
2+utilities like stat or awk in linux and darwin. However, in nix, guilt
3+will be using the nix versions of this programs, not the ones
4+installed in the system. Therefore, guilt should use the command-line
5+parameters that the linux forms of these commands expect, even if it
6+is being run on Darwin.
7+8+diff --git a/guilt b/guilt
9+index bf50343..cfc9332 100755
10+--- a/guilt
11++++ b/guilt
12+@@ -986,7 +986,7 @@ guards_file="$GUILT_DIR/$branch/guards"
13+ pager="more"
14+ [ ! -z "$PAGER" ] && pager="$PAGER"
15+16+-UNAME_S=`uname -s`
17++UNAME_S="Linux"
18+19+ if [ -r "$GUILT_PATH/os.$UNAME_S" ]; then
20+ . "$GUILT_PATH/os.$UNAME_S"
···1+{ asciidoc
2+, docbook_xml_dtd_45
3+, docbook_xsl
4+, fetchFromGitHub
5+, gawk
6+, git
7+, gnused
8+, lib
9+, makeWrapper
10+, openssl
11+, perl
12+, stdenv
13+, xmlto
14+}:
15+16+stdenv.mkDerivation rec {
17+ pname = "guilt";
18+ version = "0.37-rc1";
19+20+ src = fetchFromGitHub {
21+ owner = "jeffpc";
22+ repo = "guilt";
23+ rev = "v${version}";
24+ sha256 = "sha256-7OgRbMGYWtGvrZxKfJe0CkpmU3AUkPebF5NyTsfXeGA=";
25+ };
26+27+ doCheck = true;
28+29+ patches = [
30+ ./guilt-help-mandir.patch
31+ ./darwin-fix.patch
32+ ];
33+ nativeBuildInputs = [
34+ asciidoc
35+ docbook_xml_dtd_45
36+ docbook_xsl
37+ makeWrapper
38+ perl
39+ xmlto
40+ ];
41+ buildInputs = [
42+ gawk
43+ git
44+ gnused
45+ ] ++ lib.optionals stdenv.isDarwin [ openssl ];
46+ makeFlags = [
47+ "PREFIX=$(out)"
48+ ];
49+50+ postBuild = ''
51+ make -j $NIX_BUILD_CORES doc
52+ '';
53+54+ preCheck = ''
55+ patchShebangs regression/run-tests regression/*.sh
56+ '';
57+58+ postInstall = ''
59+ make PREFIX=$out install-doc
60+ '';
61+62+ postFixup = ''
63+ wrapProgram $out/bin/guilt --prefix PATH : ${lib.makeBinPath buildInputs}
64+ '';
65+66+ meta = with lib; {
67+ description = "Manage patches like quilt, on top of a git repository";
68+ longDescription = ''
69+ Andrew Morton originally developed a set of scripts for
70+ maintaining kernel patches outside of any SCM tool. Others
71+ extended these into a suite called quilt]. The basic idea behind
72+ quilt is to maintain patches instead of maintaining source
73+ files. Patches can be added, removed or reordered, and they can
74+ be refreshed as you fix bugs or update to a new base
75+ revision. quilt is very powerful, but it is not integrated with
76+ the underlying SCM tools. This makes it difficult to visualize
77+ your changes.
78+79+ Guilt allows one to use quilt functionality on top of a Git
80+ repository. Changes are maintained as patches which are
81+ committed into Git. Commits can be removed or reordered, and the
82+ underlying patch can be refreshed based on changes made in the
83+ working directory. The patch directory can also be placed under
84+ revision control, so you can have a separate history of changes
85+ made to your patches.
86+ '';
87+ homepage = "https://github.com/jeffpc/guilt";
88+ maintainers = with lib.maintainers; [ javimerino ];
89+ license = [ licenses.gpl2 ];
90+ platforms = platforms.all;
91+ };
92+}