about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/filesystems/tmsu/default.nix
blob: fd557a7ff5650ff7136fd79a0fd5096813d7df10 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{ stdenv, fetchgit, fetchFromGitHub, go, fuse }:

stdenv.mkDerivation rec {
  name = "tmsu-${version}";
  version = "0.7.4";

  go-sqlite3 = fetchgit {
    url = "git://github.com/mattn/go-sqlite3";
    rev = "c9a0db5d8951646743317f0756da0339fe144dd5";
    sha256 = "1m0q9869fis0dhg34g5wc5xi6pby491spfxi23w461h29higbrqh";
  };

  go-fuse = fetchgit {
    url = "git://github.com/hanwen/go-fuse";
    rev = "8c85ded140ac1889372a0e22d8d21e3d10a303bd";
    sha256 = "1iph2hpvby2mfwqg9pp39xjqdl9a09h4442yfdn5l67pznljh2bi";
  };

  src = fetchFromGitHub {
    owner = "oniony";
    repo = "tmsu";
    rev = "v${version}";
    sha256 = "1g9gxlll2g4qkqbrshq3888sy1lgw6p5dvcrl5qyh6w73yimi1cq";
  };

  buildInputs = [ go fuse ];

  preBuild = ''
    mkdir -p src/github.com/mattn/go-sqlite3/
    ln -s ${go-sqlite3}/* src/github.com/mattn/go-sqlite3

    mkdir -p src/github.com/hanwen/go-fuse
    ln -s ${go-fuse}/* src/github.com/hanwen/go-fuse

    mkdir -p src/github.com/oniony/tmsu
    ln -s ${src}/* src/github.com/oniony/tmsu

    patchShebangs tests/.

    export GOPATH=$PWD
    export GOCACHE=$TMPDIR/go-cache
  '';

  installPhase = ''
    mkdir -p $out/bin
    mkdir -p $out/sbin
    mkdir -p $out/share/man/man1
    mkdir -p $out/share/zsh/site-functions
    make install INSTALL_DIR=$out/bin \
                 MOUNT_INSTALL_DIR=$out/sbin \
                 MAN_INSTALL_DIR=$out/share/man/man1 \
                 ZSH_COMP_INSTALL_DIR=$out/share/zsh/site-functions
  '';

  meta = with stdenv.lib; {
    homepage    = http://www.tmsu.org;
    description = "A tool for tagging your files using a virtual filesystem";
    maintainers = with maintainers; [ pSub ];
    license     = licenses.gpl3;
    platforms   = platforms.linux;
  };
}