summary refs log tree commit diff
path: root/pkgs/tools
diff options
context:
space:
mode:
authorLluís Batlle i Rossell <viric@viric.name>2013-03-16 00:58:35 +0100
committerLluís Batlle i Rossell <viric@viric.name>2013-03-16 00:59:25 +0100
commit4dbdbda37f3570c33feeff36ce2078c73ed00fbf (patch)
treea5a639a965d730948cb2eda73f2cdcd8c6f62d9d /pkgs/tools
parent893c684e994eb6d6723e675d35a6256397b0783f (diff)
downloadnixlib-4dbdbda37f3570c33feeff36ce2078c73ed00fbf.tar
nixlib-4dbdbda37f3570c33feeff36ce2078c73ed00fbf.tar.gz
nixlib-4dbdbda37f3570c33feeff36ce2078c73ed00fbf.tar.bz2
nixlib-4dbdbda37f3570c33feeff36ce2078c73ed00fbf.tar.lz
nixlib-4dbdbda37f3570c33feeff36ce2078c73ed00fbf.tar.xz
nixlib-4dbdbda37f3570c33feeff36ce2078c73ed00fbf.tar.zst
nixlib-4dbdbda37f3570c33feeff36ce2078c73ed00fbf.zip
Adding storebrowse, a tool to browse the nix store with a web browser.
The build script is a bit long due to the upstream go style of things.
Diffstat (limited to 'pkgs/tools')
-rw-r--r--pkgs/tools/system/storebrowse/default.nix42
1 files changed, 42 insertions, 0 deletions
diff --git a/pkgs/tools/system/storebrowse/default.nix b/pkgs/tools/system/storebrowse/default.nix
new file mode 100644
index 000000000000..622afaee9884
--- /dev/null
+++ b/pkgs/tools/system/storebrowse/default.nix
@@ -0,0 +1,42 @@
+{ stdenv, fetchurl, fetchhg, go, sqlite}:
+
+assert stdenv.isLinux && (stdenv.isi686 || stdenv.isx86_64);
+
+stdenv.mkDerivation rec {
+  name = "storebrowser-20130315233902";
+
+  src = fetchurl {
+    url = "http://viric.name/cgi-bin/storebrowse/tarball/storebrowse-f87547f083bfb75b.tar.gz?uuid=f87546f083bfb75b";
+    name = "${name}.tar.gz";
+    sha256 = "1c9al500wril7bq25smi9m7byfdf33arzyb8px5w8a2dv2cyl20w";
+  };
+
+  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+";
+  };
+}