summary refs log tree commit diff
path: root/pkgs/applications/misc/sc-im/default.nix
blob: c093a75160315c9ad2e0639f347314f16214ea7a (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
{ stdenv, fetchFromGitHub, yacc, ncurses, libxml2, libzip, libxls, pkgconfig }:

stdenv.mkDerivation rec {
  version = "0.6.0";
  name = "sc-im-${version}";

  src = fetchFromGitHub {
    owner = "andmarti1424";
    repo = "sc-im";
    rev = "v${version}";
    sha256 = "02ak3b0vv72mv38cwvy7qp0y6hgrzcgahkv1apgks3drpnz5w1sj";
  };

  nativeBuildInputs = [ pkgconfig ];
  buildInputs = [ yacc ncurses libxml2 libzip libxls ];

  buildPhase = ''
    cd src

    sed -e "\|^prefix  = /usr/local|   s|/usr/local|$out|" \
        -e "\|^#LDLIBS += -lxlsreader| s|^#||            " \
        -e "\|^#CFLAGS += -DXLS|       s|^#||            " \
        -i Makefile

    make
    export DESTDIR=$out
  '';

  installPhase = ''
    make install prefix=
  '';

  meta = with stdenv.lib; {
    homepage = https://github.com/andmarti1424/sc-im;
    description = "SC-IM - Spreadsheet Calculator Improvised - SC fork";
    license = licenses.bsdOriginal;
    maintainers = [ maintainers.matthiasbeyer ];
    platforms = platforms.linux; # Cannot test others
  };

}