Created
March 25, 2019 21:30
-
-
Save srhb/657e070a1aa4e43b88c9b6c6350ded91 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ stdenv, buildGoPackage, fetchFromGitHub, makeWrapper | |
, git, bash, gzip, openssh, pam | |
, sqliteSupport ? true | |
, pamSupport ? true | |
}: | |
with stdenv.lib; | |
buildGoPackage rec { | |
name = "gogs-${version}"; | |
version = "0.11.86"; | |
src = fetchFromGitHub { | |
owner = "gogs"; | |
repo = "gogs"; | |
rev = "v${version}"; | |
sha256 = "0l8mwy0cyy3cdxqinf8ydb35kf7c8pj09xrhpr7rr7lldnvczabw"; | |
}; | |
patches = [ ./static-root-path.patch ]; | |
postPatch = '' | |
patchShebangs . | |
substituteInPlace pkg/setting/setting.go --subst-var data | |
''; | |
nativeBuildInputs = [ makeWrapper ] | |
++ optional pamSupport pam; | |
preBuild = let | |
tags = optional pamSupport "pam" | |
++ optional sqliteSupport "sqlite"; | |
in '' | |
buildFlagsArray=("-tags" "${concatStringsSep " " tags}") | |
''; | |
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 ]; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment