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";
|
2016-07-29 17:32:13 +01:00
|
|
|
outputs = [ "out" "bin" "data" ];
|
2016-02-29 04:00:45 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
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 \
|
|
|
|
--prefix PATH : ${git}/bin \
|
|
|
|
--run 'export GOGS_WORK_DIR=''${GOGS_WORK_DIR:-$PWD}' \
|
|
|
|
--run '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
|
|
|
'';
|
|
|
|
|
|
|
|
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
|
|
|
}
|