2016-10-10 15:11:58 +00:00
|
|
|
{ stdenv, buildGoPackage, fetchFromGitHub, makeWrapper
|
2018-12-23 00:52:39 +00:00
|
|
|
, git, bash, gzip, openssh, pam
|
2016-10-10 15:11:58 +00:00
|
|
|
, sqliteSupport ? true
|
2018-12-23 00:52:39 +00:00
|
|
|
, pamSupport ? true
|
2016-10-10 15:11:58 +00:00
|
|
|
}:
|
2016-02-29 04:00:45 +00:00
|
|
|
|
2017-03-22 21:52:52 +00:00
|
|
|
with stdenv.lib;
|
|
|
|
|
2016-02-29 04:00:45 +00:00
|
|
|
buildGoPackage rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "gogs";
|
2019-03-04 14:19:04 +00:00
|
|
|
version = "0.11.86";
|
2016-10-10 15:11:58 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2018-08-30 12:43:49 +00:00
|
|
|
owner = "gogs";
|
2016-10-10 15:11:58 +00:00
|
|
|
repo = "gogs";
|
|
|
|
rev = "v${version}";
|
2019-03-04 14:19:04 +00:00
|
|
|
sha256 = "0l8mwy0cyy3cdxqinf8ydb35kf7c8pj09xrhpr7rr7lldnvczabw";
|
2016-10-10 15:11:58 +00:00
|
|
|
};
|
|
|
|
|
2017-10-02 21:15:13 +00:00
|
|
|
patches = [ ./static-root-path.patch ];
|
|
|
|
|
|
|
|
postPatch = ''
|
2017-03-22 21:52:52 +00:00
|
|
|
patchShebangs .
|
2017-10-02 21:15:13 +00:00
|
|
|
substituteInPlace pkg/setting/setting.go --subst-var data
|
|
|
|
'';
|
2016-02-29 04:00:45 +00:00
|
|
|
|
2018-12-23 00:52:39 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ]
|
|
|
|
++ optional pamSupport pam;
|
2016-10-10 15:11:58 +00: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 15:11:58 +00:00
|
|
|
|
|
|
|
outputs = [ "bin" "out" "data" ];
|
2016-02-29 04:00:45 +00:00
|
|
|
|
2017-10-06 05:26:19 +00:00
|
|
|
postInstall = ''
|
2016-07-29 16:32:13 +00:00
|
|
|
mkdir $data
|
|
|
|
cp -R $src/{public,templates} $data
|
|
|
|
|
2016-02-29 04:00:45 +00:00
|
|
|
wrapProgram $bin/bin/gogs \
|
2017-10-02 19:04:32 +00:00
|
|
|
--prefix PATH : ${makeBinPath [ bash git gzip openssh ]}
|
2016-02-29 04:00:45 +00:00
|
|
|
'';
|
|
|
|
|
2018-08-30 12:43:49 +00:00
|
|
|
goPackagePath = "github.com/gogs/gogs";
|
2016-02-29 04:00:45 +00:00
|
|
|
|
2016-10-10 15:11:58 +00:00
|
|
|
meta = {
|
|
|
|
description = "A painless self-hosted Git service";
|
2017-08-01 20:03:30 +00:00
|
|
|
homepage = https://gogs.io;
|
2017-03-22 21:52:52 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = [ maintainers.schneefux ];
|
2016-10-10 15:11:58 +00:00
|
|
|
};
|
2016-02-29 04:00:45 +00:00
|
|
|
}
|