2016-10-10 16:11:58 +01:00
|
|
|
{ stdenv, buildGoPackage, fetchFromGitHub, makeWrapper
|
|
|
|
, git, coreutils, bash, gzip, openssh
|
|
|
|
, sqliteSupport ? true
|
|
|
|
}:
|
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 {
|
|
|
|
name = "gogs-${version}";
|
2017-06-27 12:41:19 +01:00
|
|
|
version = "0.11.19";
|
2016-10-10 16:11:58 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "gogits";
|
|
|
|
repo = "gogs";
|
|
|
|
rev = "v${version}";
|
2017-06-27 12:41:19 +01:00
|
|
|
sha256 = "0smzklhpfv3smqgzd0cnjdif3zi5q7b02grrnb5zssmdi1b2dlsd";
|
2016-10-10 16:11:58 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
patchPhase = ''
|
2017-03-22 21:52:52 +00:00
|
|
|
patchShebangs .
|
|
|
|
'';
|
2016-02-29 04:00:45 +00:00
|
|
|
|
2017-03-22 21:52:52 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2016-10-10 16:11:58 +01:00
|
|
|
|
2017-03-22 21:52:52 +00:00
|
|
|
buildFlags = optionalString sqliteSupport "-tags sqlite";
|
2016-10-10 16:11:58 +01:00
|
|
|
|
|
|
|
outputs = [ "bin" "out" "data" ];
|
2016-02-29 04:00:45 +00:00
|
|
|
|
2017-07-03 22:16:36 +01:00
|
|
|
postInstall = stdenv.lib.optionalString stdenv.isDarwin ''
|
|
|
|
install_name_tool -delete_rpath $out/lib $bin/bin/gogs
|
|
|
|
'' + ''
|
2016-07-29 17:32:13 +01:00
|
|
|
mkdir $data
|
|
|
|
cp -R $src/{public,templates} $data
|
|
|
|
|
2016-02-29 04:00:45 +00:00
|
|
|
wrapProgram $bin/bin/gogs \
|
2017-03-22 21:52:52 +00:00
|
|
|
--prefix PATH : ${makeBinPath [ bash git gzip openssh ]} \
|
2016-02-29 04:00:45 +00:00
|
|
|
--run 'export GOGS_WORK_DIR=''${GOGS_WORK_DIR:-$PWD}' \
|
2016-10-10 16:11:58 +01:00
|
|
|
--run 'mkdir -p "$GOGS_WORK_DIR" && cd "$GOGS_WORK_DIR"' \
|
2016-07-29 17:32:13 +01:00
|
|
|
--run "ln -fs $data/{public,templates} ."
|
2016-02-29 04:00:45 +00:00
|
|
|
'';
|
|
|
|
|
2016-10-10 16:11:58 +01:00
|
|
|
goPackagePath = "github.com/gogits/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
|
|
|
}
|