summary refs log tree commit diff
path: root/pkgs/tools/X11/runningx/default.nix
blob: 31e2320e1b9fd6b3cafde984de26e0f137e6df09 (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
{ stdenv, fetchurl, pkgconfig, libX11 }:

stdenv.mkDerivation {
  pname = "runningx";
  version = "1.0";
  
  src = fetchurl {
    url = "http://www.fiction.net/blong/programs/mutt/autoview/RunningX.c";
    sha256 = "1mikkhrx6jsx716041qdy3nwjac08pxxvxyq2yablm8zg9hrip0d";
  };

  nativeBuildInputs = [ pkgconfig ];

  buildInputs = [ libX11 ];

  phases = [ "buildPhase" "installPhase" ];

  buildPhase = ''
    cc -O2 -o RunningX $(pkg-config --cflags --libs x11) $src
  '';

  installPhase = ''
    mkdir -p "$out"/bin
    cp -vai RunningX "$out/bin"
  '';

  meta = {
    homepage = http://www.fiction.net/blong/programs/mutt/;
    description = "A program for testing if X is running";
    license = stdenv.lib.licenses.free;
    platforms = stdenv.lib.platforms.unix;
    maintainers = [ stdenv.lib.maintainers.romildo ];
  };
}