mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-25 03:17:13 +00:00
d3f1679d4e
cc @schneefux
49 lines
1 KiB
Nix
49 lines
1 KiB
Nix
{ stdenv, buildGoPackage, fetchFromGitHub, makeWrapper
|
|
, git, bash, gzip, openssh
|
|
, sqliteSupport ? true
|
|
}:
|
|
|
|
with stdenv.lib;
|
|
|
|
buildGoPackage rec {
|
|
name = "gogs-${version}";
|
|
version = "0.11.53";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "gogs";
|
|
repo = "gogs";
|
|
rev = "v${version}";
|
|
sha256 = "1icm4bawyic4ivzyspqc6qjv882gil8j923zrbylw3i4ifhlcdhd";
|
|
};
|
|
|
|
patches = [ ./static-root-path.patch ];
|
|
|
|
postPatch = ''
|
|
patchShebangs .
|
|
substituteInPlace pkg/setting/setting.go --subst-var data
|
|
'';
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildFlags = optionalString sqliteSupport "-tags sqlite";
|
|
|
|
outputs = [ "bin" "out" "data" ];
|
|
|
|
postInstall = ''
|
|
mkdir $data
|
|
cp -R $src/{public,templates} $data
|
|
|
|
wrapProgram $bin/bin/gogs \
|
|
--prefix PATH : ${makeBinPath [ bash git gzip openssh ]}
|
|
'';
|
|
|
|
goPackagePath = "github.com/gogs/gogs";
|
|
|
|
meta = {
|
|
description = "A painless self-hosted Git service";
|
|
homepage = https://gogs.io;
|
|
license = licenses.mit;
|
|
maintainers = [ maintainers.schneefux ];
|
|
};
|
|
}
|