summaryrefslogtreecommitdiffstats
path: root/krebs/5pkgs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2016-03-05 21:41:52 +0100
committertv <tv@krebsco.de>2016-03-05 21:41:52 +0100
commited1ffc8c8326e5c1f27eae85fe8c4a28d7531a1d (patch)
treec0e28fb83a6c25f5d11ff23a0f794e7193a3e4de /krebs/5pkgs
parent64f2e2075d099bf1fe3a70b7b207de3738dae614 (diff)
cgit: init at 0.12
Diffstat (limited to 'krebs/5pkgs')
-rw-r--r--krebs/5pkgs/cgit/default.nix64
1 files changed, 64 insertions, 0 deletions
diff --git a/krebs/5pkgs/cgit/default.nix b/krebs/5pkgs/cgit/default.nix
new file mode 100644
index 000000000..3180a5bd3
--- /dev/null
+++ b/krebs/5pkgs/cgit/default.nix
@@ -0,0 +1,64 @@
+{ stdenv, fetchurl, openssl, zlib, asciidoc, libxml2, libxslt
+, docbook_xml_xslt, pkgconfig, luajit
+, gzip, bzip2, xz
+}:
+
+stdenv.mkDerivation rec {
+ name = "cgit-${version}";
+ version = "0.12";
+
+ src = fetchurl {
+ url = "http://git.zx2c4.com/cgit/snapshot/${name}.tar.xz";
+ sha256 = "1dx54hgfyabmg9nm5qp6d01f54nlbqbbdwhwl0llb9imjf237qif";
+ };
+
+ # cgit is tightly coupled with git and needs a git source tree to build.
+ # IMPORTANT: Remember to check which git version cgit needs on every version
+ # bump (look in the Makefile).
+ # NOTE: as of 0.10.1, the git version is compatible from 1.9.0 to
+ # 1.9.2 (see the repository history)
+ gitSrc = fetchurl {
+ url = "mirror://kernel/software/scm/git/git-2.7.2.tar.xz";
+ sha256 = "086ga30ksijfxad085ply83ddf955d2b8qxph5sw6c9hab77j15j";
+ };
+
+ buildInputs = [
+ openssl zlib asciidoc libxml2 libxslt docbook_xml_xslt pkgconfig luajit
+ ];
+
+ postPatch = ''
+ sed -e 's|"gzip"|"${gzip}/bin/gzip"|' \
+ -e 's|"bzip2"|"${bzip2}/bin/bzip2"|' \
+ -e 's|"xz"|"${xz}/bin/xz"|' \
+ -i ui-snapshot.c
+ '';
+
+ # Give cgit a git source tree and pass configuration parameters (as make
+ # variables).
+ preBuild = ''
+ mkdir -p git
+ tar --strip-components=1 -xf "$gitSrc" -C git
+
+ makeFlagsArray+=(prefix="$out" CGIT_SCRIPT_PATH="$out/cgit/")
+ '';
+
+ # Install manpage.
+ postInstall = ''
+ # xmllint fails:
+ #make install-man
+
+ # bypassing xmllint works:
+ a2x --no-xmllint -f manpage cgitrc.5.txt
+ mkdir -p "$out/share/man/man5"
+ cp cgitrc.5 "$out/share/man/man5"
+ '';
+
+ meta = {
+ homepage = http://git.zx2c4.com/cgit/about/;
+ repositories.git = git://git.zx2c4.com/cgit;
+ description = "Web frontend for git repositories";
+ license = stdenv.lib.licenses.gpl2;
+ platforms = stdenv.lib.platforms.linux;
+ maintainers = with stdenv.lib.maintainers; [ bjornfor ];
+ };
+}