2014-01-19 21:46:53 +00:00
|
|
|
{ stdenv, fetchurl, openssl, zlib, asciidoc, libxml2, libxslt
|
|
|
|
, docbook_xml_xslt, pkgconfig, luajit
|
2014-01-19 21:59:51 +00:00
|
|
|
, gzip, bzip2, xz
|
2014-01-19 21:46:53 +00:00
|
|
|
}:
|
2013-04-01 16:42:51 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2014-04-13 06:47:14 +01:00
|
|
|
name = "cgit-${version}";
|
2015-03-27 00:15:29 +00:00
|
|
|
version = "0.11.2";
|
2013-04-01 16:42:51 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://git.zx2c4.com/cgit/snapshot/${name}.tar.xz";
|
2015-03-27 00:15:29 +00:00
|
|
|
sha256 = "0fryh56kyah7v9a8zzhbhwlyy2j116w87sxmgrn2kmwk0rvnw4if";
|
2013-04-01 16:42:51 +01:00
|
|
|
};
|
|
|
|
|
2014-05-17 10:01:57 +01:00
|
|
|
# cgit is tightly coupled with git and needs a git source tree to build.
|
2013-04-01 16:42:51 +01:00
|
|
|
# IMPORTANT: Remember to check which git version cgit needs on every version
|
2014-05-17 10:01:57 +01:00
|
|
|
# bump (look in the Makefile).
|
2014-04-13 06:47:14 +01:00
|
|
|
# NOTE: as of 0.10.1, the git version is compatible from 1.9.0 to
|
|
|
|
# 1.9.2 (see the repository history)
|
2013-04-01 16:42:51 +01:00
|
|
|
gitSrc = fetchurl {
|
2015-03-27 00:15:29 +00:00
|
|
|
url = "mirror://kernel/software/scm/git/git-2.3.2.tar.xz";
|
|
|
|
sha256 = "09gqijsjfnxlbsxbxzlvllg37bfs9f4jwa2plqsanmba09i89sqq";
|
2013-04-01 16:42:51 +01:00
|
|
|
};
|
|
|
|
|
2014-01-19 21:46:53 +00:00
|
|
|
buildInputs = [
|
|
|
|
openssl zlib asciidoc libxml2 libxslt docbook_xml_xslt pkgconfig luajit
|
|
|
|
];
|
2013-04-01 16:42:51 +01:00
|
|
|
|
2014-01-19 21:59:51 +00:00
|
|
|
postPatch = ''
|
|
|
|
sed -e 's|"gzip"|"${gzip}/bin/gzip"|' \
|
2016-02-01 18:45:57 +00:00
|
|
|
-e 's|"bzip2"|"${bzip2.bin}/bin/bzip2"|' \
|
2014-01-19 21:59:51 +00:00
|
|
|
-e 's|"xz"|"${xz}/bin/xz"|' \
|
|
|
|
-i ui-snapshot.c
|
|
|
|
'';
|
|
|
|
|
2013-04-01 16:42:51 +01:00
|
|
|
# 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/;
|
2014-03-08 16:22:28 +00:00
|
|
|
repositories.git = git://git.zx2c4.com/cgit;
|
2013-04-01 16:42:51 +01:00
|
|
|
description = "Web frontend for git repositories";
|
|
|
|
license = stdenv.lib.licenses.gpl2;
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
maintainers = with stdenv.lib.maintainers; [ bjornfor ];
|
|
|
|
};
|
|
|
|
}
|