nixpkgs-suyu/pkgs/applications/version-management/gogs/default.nix

49 lines
1 KiB
Nix
Raw Normal View History

2016-10-10 17:11:58 +02:00
{ stdenv, buildGoPackage, fetchFromGitHub, makeWrapper
, git, coreutils, bash, gzip, openssh
, sqliteSupport ? true
}:
2016-02-29 05:00:45 +01:00
2017-03-22 22:52:52 +01:00
with stdenv.lib;
2016-02-29 05:00:45 +01:00
buildGoPackage rec {
name = "gogs-${version}";
2017-10-01 23:14:13 +02:00
version = "0.11.29";
2016-10-10 17:11:58 +02:00
src = fetchFromGitHub {
owner = "gogits";
repo = "gogs";
rev = "v${version}";
2017-10-01 23:14:13 +02:00
sha256 = "1xn1b4dxf7r8kagps3yvp31zskfxn50k1gfic9abl4kjwpwk78c0";
2016-10-10 17:11:58 +02:00
};
patches = [ ./static-root-path.patch ];
postPatch = ''
2017-03-22 22:52:52 +01:00
patchShebangs .
substituteInPlace pkg/setting/setting.go --subst-var data
'';
2016-02-29 05:00:45 +01:00
2017-03-22 22:52:52 +01:00
nativeBuildInputs = [ makeWrapper ];
2016-10-10 17:11:58 +02:00
2017-03-22 22:52:52 +01:00
buildFlags = optionalString sqliteSupport "-tags sqlite";
2016-10-10 17:11:58 +02:00
outputs = [ "bin" "out" "data" ];
2016-02-29 05:00:45 +01:00
postInstall = ''
mkdir $data
cp -R $src/{public,templates} $data
2016-02-29 05:00:45 +01:00
wrapProgram $bin/bin/gogs \
2017-10-02 21:04:32 +02:00
--prefix PATH : ${makeBinPath [ bash git gzip openssh ]}
2016-02-29 05:00:45 +01:00
'';
2016-10-10 17:11:58 +02:00
goPackagePath = "github.com/gogits/gogs";
2016-02-29 05:00:45 +01:00
2016-10-10 17:11:58 +02:00
meta = {
description = "A painless self-hosted Git service";
homepage = https://gogs.io;
2017-03-22 22:52:52 +01:00
license = licenses.mit;
maintainers = [ maintainers.schneefux ];
2016-10-10 17:11:58 +02:00
};
2016-02-29 05:00:45 +01:00
}