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

52 lines
1.1 KiB
Nix
Raw Normal View History

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