2016-07-28 16:22:53 +01:00
|
|
|
{ stdenv, buildGoPackage, fetchgit, makeWrapper, git, sqliteSupport ? true }:
|
2016-02-29 04:00:45 +00:00
|
|
|
|
|
|
|
buildGoPackage rec {
|
|
|
|
name = "gogs-${version}";
|
2016-07-28 16:22:53 +01:00
|
|
|
version = "20160728-${stdenv.lib.strings.substring 0 7 rev}";
|
|
|
|
rev = "ad7ea88923e371df7558835d8f3e0236cfdf69ba";
|
2016-02-29 04:00:45 +00:00
|
|
|
|
2016-07-28 16:22:53 +01:00
|
|
|
buildInputs = [ makeWrapper ];
|
|
|
|
buildFlags = stdenv.lib.optional (sqliteSupport) "-tags sqlite";
|
2016-02-29 04:00:45 +00:00
|
|
|
goPackagePath = "github.com/gogits/gogs";
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $bin/bin/gogs \
|
|
|
|
--prefix PATH : ${git}/bin \
|
|
|
|
--run 'export GOGS_WORK_DIR=''${GOGS_WORK_DIR:-$PWD}' \
|
|
|
|
--run 'cd "$GOGS_WORK_DIR"' \
|
|
|
|
--run "ln -fs $out/share/go/src/${goPackagePath}/{public,templates} ."
|
|
|
|
'';
|
|
|
|
|
|
|
|
src = fetchgit {
|
|
|
|
inherit rev;
|
2016-07-28 16:22:53 +01:00
|
|
|
url = "https://github.com/gogits/gogs";
|
|
|
|
sha256 = "0vgkhpwvj79shpi3bq2sr1nza53fidmnbmh814ic09jnb2dilnrm";
|
2016-02-29 04:00:45 +00:00
|
|
|
};
|
|
|
|
|
2016-07-28 16:22:53 +01:00
|
|
|
goDeps = ./deps.json;
|
2016-02-29 04:00:45 +00:00
|
|
|
}
|