2016-10-10 16:11:58 +01:00
|
|
|
{ stdenv, buildGoPackage, fetchFromGitHub, makeWrapper
|
2018-07-21 01:44:44 +01:00
|
|
|
, git, bash, gzip, openssh
|
2016-10-10 16:11:58 +01:00
|
|
|
, sqliteSupport ? true
|
|
|
|
}:
|
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 {
|
|
|
|
name = "gogs-${version}";
|
2018-03-25 15:13:37 +01:00
|
|
|
version = "0.11.34";
|
2016-10-10 16:11:58 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "gogits";
|
|
|
|
repo = "gogs";
|
|
|
|
rev = "v${version}";
|
2018-03-25 15:13:37 +01:00
|
|
|
sha256 = "15xwcw3k7wbahdgp796gly79qkka21p7kvm84zfjgcsjjri0kdnz";
|
2016-10-10 16:11:58 +01:00
|
|
|
};
|
|
|
|
|
2017-10-02 22:15:13 +01:00
|
|
|
patches = [ ./static-root-path.patch ];
|
|
|
|
|
|
|
|
postPatch = ''
|
2017-03-22 21:52:52 +00:00
|
|
|
patchShebangs .
|
2017-10-02 22:15:13 +01:00
|
|
|
substituteInPlace pkg/setting/setting.go --subst-var data
|
|
|
|
'';
|
2016-02-29 04:00:45 +00:00
|
|
|
|
2017-03-22 21:52:52 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2016-10-10 16:11:58 +01:00
|
|
|
|
2017-03-22 21:52:52 +00:00
|
|
|
buildFlags = optionalString sqliteSupport "-tags sqlite";
|
2016-10-10 16:11:58 +01:00
|
|
|
|
|
|
|
outputs = [ "bin" "out" "data" ];
|
2016-02-29 04:00:45 +00:00
|
|
|
|
2017-10-06 06:26:19 +01:00
|
|
|
postInstall = ''
|
2016-07-29 17:32:13 +01:00
|
|
|
mkdir $data
|
|
|
|
cp -R $src/{public,templates} $data
|
|
|
|
|
2016-02-29 04:00:45 +00:00
|
|
|
wrapProgram $bin/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
|
|
|
goPackagePath = "github.com/gogits/gogs";
|
2016-02-29 04:00:45 +00:00
|
|
|
|
2016-10-10 16:11:58 +01:00
|
|
|
meta = {
|
|
|
|
description = "A painless self-hosted Git service";
|
2017-08-01 21:03:30 +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
|
|
|
}
|