1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-25 03:17:13 +00:00
nixpkgs/pkgs/applications/version-management/gogs/default.nix

56 lines
1.1 KiB
Nix
Raw Normal View History

2016-10-10 16:11:58 +01:00
{ stdenv, buildGoPackage, 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
2017-03-22 21:52:52 +00:00
with stdenv.lib;
2016-02-29 04:00:45 +00:00
buildGoPackage rec {
pname = "gogs";
version = "0.11.91";
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}";
sha256 = "1yfimgjg9n773kdml17119539w9736mi66bivpv5yp3cj2hj9mlj";
2016-10-10 16:11:58 +01:00
};
patches = [ ./static-root-path.patch ];
postPatch = ''
2017-03-22 21:52:52 +00:00
patchShebangs .
substituteInPlace pkg/setting/setting.go --subst-var data
'';
2016-02-29 04:00:45 +00:00
2020-03-18 09:26:23 +00:00
nativeBuildInputs = [ makeWrapper ];
buildInputs = optional pamSupport pam;
2016-10-10 16:11:58 +01:00
buildFlags = [ "-tags" ];
buildFlagsArray =
( optional sqliteSupport "sqlite"
++ optional pamSupport "pam");
2016-10-10 16:11:58 +01:00
outputs = [ "out" "data" ];
2016-02-29 04:00:45 +00:00
postInstall = ''
mkdir $data
cp -R $src/{public,templates} $data
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
'';
2018-08-30 13:43:49 +01:00
goPackagePath = "github.com/gogs/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";
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
}