2021-01-15 13:21:58 +00:00
|
|
|
{ lib, stdenv, buildGoModule, fetchFromGitHub, makeWrapper
|
2018-12-23 00:52:39 +00:00
|
|
|
, git, bash, gzip, openssh, pam
|
2016-10-10 16:11:58 +01:00
|
|
|
, sqliteSupport ? true
|
2018-12-23 00:52:39 +00:00
|
|
|
, pamSupport ? true
|
2016-10-10 16:11:58 +01:00
|
|
|
}:
|
2016-02-29 04:00:45 +00:00
|
|
|
|
2021-01-15 13:21:58 +00:00
|
|
|
with lib;
|
2017-03-22 21:52:52 +00:00
|
|
|
|
2020-10-29 14:30:57 +00:00
|
|
|
buildGoModule rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "gogs";
|
2020-10-29 14:30:57 +00:00
|
|
|
version = "0.12.3";
|
2016-10-10 16:11:58 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2018-08-30 13:43:49 +01:00
|
|
|
owner = "gogs";
|
2016-10-10 16:11:58 +01:00
|
|
|
repo = "gogs";
|
|
|
|
rev = "v${version}";
|
2020-10-29 14:30:57 +00:00
|
|
|
sha256 = "0ix3mxy8cpqbx24qffbzyf5z88x7605icm7rk5n54r8bdsr7cckd";
|
2016-10-10 16:11:58 +01:00
|
|
|
};
|
|
|
|
|
2020-10-29 14:30:57 +00:00
|
|
|
vendorSha256 = "0m0g4dsiq8p2ngsbjxfi3wff7x4xpm67qlhgcgf8b48mqai4d2gc";
|
|
|
|
|
|
|
|
subPackages = [ "." ];
|
2017-10-02 22:15:13 +01:00
|
|
|
|
|
|
|
postPatch = ''
|
2017-03-22 21:52:52 +00:00
|
|
|
patchShebangs .
|
2017-10-02 22:15:13 +01:00
|
|
|
'';
|
2016-02-29 04:00:45 +00:00
|
|
|
|
2020-10-29 14:30:57 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper openssh ];
|
2020-03-18 09:26:23 +00:00
|
|
|
|
|
|
|
buildInputs = optional pamSupport pam;
|
2016-10-10 16:11:58 +01:00
|
|
|
|
2019-10-27 13:03:25 +00:00
|
|
|
buildFlags = [ "-tags" ];
|
2019-03-25 20:41:51 +00:00
|
|
|
|
|
|
|
buildFlagsArray =
|
|
|
|
( optional sqliteSupport "sqlite"
|
|
|
|
++ optional pamSupport "pam");
|
2016-10-10 16:11:58 +01:00
|
|
|
|
2017-10-06 06:26:19 +01:00
|
|
|
postInstall = ''
|
2016-07-29 17:32:13 +01:00
|
|
|
|
2020-04-28 02:50:57 +01:00
|
|
|
wrapProgram $out/bin/gogs \
|
2017-10-02 20:04:32 +01:00
|
|
|
--prefix PATH : ${makeBinPath [ bash git gzip openssh ]}
|
2016-02-29 04:00:45 +00:00
|
|
|
'';
|
|
|
|
|
2016-10-10 16:11:58 +01:00
|
|
|
meta = {
|
|
|
|
description = "A painless self-hosted Git service";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://gogs.io";
|
2017-03-22 21:52:52 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = [ maintainers.schneefux ];
|
2016-10-10 16:11:58 +01:00
|
|
|
};
|
2016-02-29 04:00:45 +00:00
|
|
|
}
|