2013-03-16 00:58:35 +01:00
|
|
|
{ stdenv, fetchurl, fetchhg, go, sqlite}:
|
|
|
|
|
|
|
|
assert stdenv.isLinux && (stdenv.isi686 || stdenv.isx86_64);
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2013-03-16 15:15:20 +01:00
|
|
|
name = "storebrowse-20130316140138";
|
2013-03-16 00:58:35 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2013-03-16 15:15:20 +01:00
|
|
|
url = "http://viric.name/cgi-bin/storebrowse/tarball/storebrowse-881990147c.tar.gz?uuid=881990147c";
|
2013-03-16 00:58:35 +01:00
|
|
|
name = "${name}.tar.gz";
|
2013-03-16 15:15:20 +01:00
|
|
|
sha256 = "183b6gz7xv88c94i9mgmjslsdn75v5vsbchl19kjv7mbrxfx5mvl";
|
2013-03-16 00:58:35 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
srcGoSqlite = fetchhg {
|
|
|
|
url = "https://code.google.com/p/gosqlite/";
|
|
|
|
tag = "5baefb109e18";
|
|
|
|
sha256 = "0mqfnx06jj15cs8pq9msny2z18x99hgk6mchnaxpg343nzdiz4zk";
|
|
|
|
};
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
PATH=${go}/bin:$PATH
|
|
|
|
mkdir $TMPDIR/go
|
|
|
|
export GOPATH=$TMPDIR/go
|
|
|
|
|
|
|
|
GOSQLITE=$GOPATH/src/code.google.com/p/gosqlite
|
|
|
|
mkdir -p $GOSQLITE
|
|
|
|
cp -R $srcGoSqlite/* $GOSQLITE/
|
|
|
|
export CGO_CFLAGS=-I${sqlite}/include
|
|
|
|
export CGO_LDFLAGS=-L${sqlite}/lib
|
|
|
|
go build -ldflags "-r ${sqlite}/lib" -o storebrowse
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
ensureDir $out/bin
|
|
|
|
cp storebrowse $out/bin
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = http://viric.name/cgi-bin/storebrowse;
|
|
|
|
license = "AGPLv3+";
|
|
|
|
};
|
|
|
|
}
|