From f59d3a730dbae564855e2d119d7178bfcad71863 Mon Sep 17 00:00:00 2001 From: jammerful Date: Wed, 30 Aug 2017 17:05:43 -0400 Subject: [PATCH 1/2] gerrit: init at 2.14.3 --- .../version-management/gerrit/default.nix | 24 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 26 insertions(+) create mode 100644 pkgs/applications/version-management/gerrit/default.nix diff --git a/pkgs/applications/version-management/gerrit/default.nix b/pkgs/applications/version-management/gerrit/default.nix new file mode 100644 index 000000000000..31035b2183ff --- /dev/null +++ b/pkgs/applications/version-management/gerrit/default.nix @@ -0,0 +1,24 @@ +{ stdenv, fetchurl }: + +stdenv.mkDerivation rec { + name = "gerrit-${version}"; + version = "2.14.3"; + + src = fetchurl { + url = "https://gerrit-releases.storage.googleapis.com/gerrit-${version}.war"; + sha256 = "db602d06b11bfa81f1cb016c4717a99699828eda08afb2caa504175a2ea4b9c3"; + }; + + buildCommand = '' + mkdir -p "$out"/webapps + cp "${src}" "$out"/webapps/gerrit-${version}.war + ''; + + meta = with stdenv.lib; { + homepage = https://www.gerritcodereview.com/index.md; + license = licenses.asl20; + description = "A web based code review and repository management for the git version control system"; + maintainers = with maintainers; [ jammerful ]; + platforms = platforms.unix; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d729d57d74a3..dcbf282a30aa 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2141,6 +2141,8 @@ with pkgs; genimage = callPackage ../tools/filesystems/genimage { }; + gerrit = callPackage ../applications/version-management/gerrit { }; + geteltorito = callPackage ../tools/misc/geteltorito { }; getmail = callPackage ../tools/networking/getmail { }; From 8144460e360dc9aaa438e9a618f610b392295726 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 5 Sep 2017 18:11:09 +0100 Subject: [PATCH 2/2] gerrit: fixed-output derivation to avoid rebuilds see also https://github.com/NixOS/nixpkgs/issues/27754#issue-246545036 for motivation. --- pkgs/applications/version-management/gerrit/default.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/version-management/gerrit/default.nix b/pkgs/applications/version-management/gerrit/default.nix index 31035b2183ff..d3c4709186a6 100644 --- a/pkgs/applications/version-management/gerrit/default.nix +++ b/pkgs/applications/version-management/gerrit/default.nix @@ -6,12 +6,15 @@ stdenv.mkDerivation rec { src = fetchurl { url = "https://gerrit-releases.storage.googleapis.com/gerrit-${version}.war"; - sha256 = "db602d06b11bfa81f1cb016c4717a99699828eda08afb2caa504175a2ea4b9c3"; + sha256 = "1hxrlhp5l5q4lp5b5bq8va7856cnm4blfv01rgqq3yhvn432sq6v"; }; + outputHashAlgo = "sha256"; + outputHashMode = "recursive"; + outputHash = "1wg7bbhwgi9sxn7skxb9gwaydq9jzpdhglwgq5kihj7r269fmr4k"; + buildCommand = '' - mkdir -p "$out"/webapps - cp "${src}" "$out"/webapps/gerrit-${version}.war + install -D ${src} "$out"/webapps/gerrit-${version}.war ''; meta = with stdenv.lib; {