2021-04-10 02:13:18 +02:00
|
|
|
{ depot, lib, pkgs, ... }:
|
2020-01-12 03:48:40 +01:00
|
|
|
|
|
|
|
let
|
2021-04-10 02:13:18 +02:00
|
|
|
inherit (pkgs) stdenv gzip bzip2 xz luajit zlib autoconf openssl pkgconfig;
|
|
|
|
in stdenv.mkDerivation rec {
|
2020-01-12 03:48:40 +01:00
|
|
|
pname = "cgit";
|
|
|
|
version = "master";
|
|
|
|
src = ./.;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ autoconf pkgconfig ];
|
|
|
|
buildInputs = [ openssl zlib luajit ];
|
|
|
|
|
2021-04-02 01:09:05 +02:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2020-01-12 03:48:40 +01:00
|
|
|
postPatch = ''
|
|
|
|
sed -e 's|"gzip"|"${gzip}/bin/gzip"|' \
|
|
|
|
-e 's|"bzip2"|"${bzip2.bin}/bin/bzip2"|' \
|
|
|
|
-e 's|"xz"|"${xz.bin}/bin/xz"|' \
|
|
|
|
-i ui-snapshot.c
|
|
|
|
'';
|
|
|
|
|
2021-09-21 12:03:01 +02:00
|
|
|
# Give cgit the git source tree including depot patches. Note that
|
|
|
|
# the version expected by cgit should be kept in sync with the
|
|
|
|
# version available in nixpkgs.
|
|
|
|
#
|
|
|
|
# TODO(tazjin): Add an assert for this somewhere so we notice it on
|
|
|
|
# channel bumps.
|
2020-01-12 03:48:40 +01:00
|
|
|
preBuild = ''
|
|
|
|
rm -rf git # remove submodule dir ...
|
2021-09-21 12:03:01 +02:00
|
|
|
cp -r --no-preserve=ownership,mode ${pkgs.srcOnly depot.third_party.git} git
|
2020-01-12 03:48:40 +01:00
|
|
|
makeFlagsArray+=(prefix="$out" CGIT_SCRIPT_PATH="$out/cgit/")
|
2021-04-02 01:09:55 +02:00
|
|
|
cat tvl-extra.css >> cgit.css
|
2020-01-12 03:48:40 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = https://git.zx2c4.com/cgit/about/;
|
|
|
|
repositories.git = git://git.zx2c4.com/cgit;
|
|
|
|
description = "Web frontend for git repositories";
|
2021-04-01 17:06:16 +02:00
|
|
|
license = lib.licenses.gpl2;
|
|
|
|
platforms = lib.platforms.linux;
|
|
|
|
maintainers = with lib.maintainers; [ bjornfor ];
|
2020-01-12 03:48:40 +01:00
|
|
|
};
|
|
|
|
}
|