about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/misc/sc-im/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/misc/sc-im/default.nix')
-rw-r--r--nixpkgs/pkgs/applications/misc/sc-im/default.nix55
1 files changed, 34 insertions, 21 deletions
diff --git a/nixpkgs/pkgs/applications/misc/sc-im/default.nix b/nixpkgs/pkgs/applications/misc/sc-im/default.nix
index 0ae7a5c1ec09..9a05ac22afb8 100644
--- a/nixpkgs/pkgs/applications/misc/sc-im/default.nix
+++ b/nixpkgs/pkgs/applications/misc/sc-im/default.nix
@@ -1,43 +1,56 @@
-{ lib, stdenv, fetchFromGitHub, yacc, ncurses, libxml2, libzip, libxls, pkg-config }:
+{ lib
+, stdenv
+, fetchFromGitHub
+, makeWrapper
+, pkg-config
+, which
+, bison
+, gnuplot
+, libxls
+, libxml2
+, libzip
+, ncurses
+}:
 
 stdenv.mkDerivation rec {
-  version = "0.7.0";
   pname = "sc-im";
+  version = "0.8.1";
 
   src = fetchFromGitHub {
     owner = "andmarti1424";
     repo = "sc-im";
     rev = "v${version}";
-    sha256 = "0xi0n9qzby012y2j7hg4fgcwyly698sfi4i9gkvy0q682jihprbk";
+    sha256 = "sha256-AIYa3d1ml1f5GNLKijeFPX+UabgEqzdXiP60BGvBPsQ=";
   };
 
-  nativeBuildInputs = [ pkg-config ];
-  buildInputs = [ yacc ncurses libxml2 libzip libxls ];
+  sourceRoot = "${src.name}/src";
 
-  buildPhase = ''
-    cd src
+  nativeBuildInputs = [
+    makeWrapper
+    pkg-config
+    which
+    bison
+  ];
 
-    sed 's/LDLIBS += -lm/& -lncurses/' -i Makefile
+  buildInputs = [
+    gnuplot
+    libxls
+    libxml2
+    libzip
+    ncurses
+  ];
 
-    sed -e "\|^prefix  = /usr/local|   s|/usr/local|$out|" \
-        -e "\|^#LDLIBS += -lxlsreader| s|^#||            " \
-        -e "\|^#CFLAGS += -DXLS|       s|^#||            " \
-        -i Makefile
+  makeFlags = [ "prefix=${placeholder "out"}" ];
 
-    make
-    export DESTDIR=$out
-  '';
-
-  installPhase = ''
-    make install prefix=
+  postInstall = ''
+    wrapProgram "$out/bin/sc-im" --prefix PATH : "${lib.makeBinPath [ gnuplot ]}"
   '';
 
   meta = with lib; {
     homepage = "https://github.com/andmarti1424/sc-im";
-    description = "SC-IM - Spreadsheet Calculator Improvised - SC fork";
+    description = "An ncurses spreadsheet program for terminal";
     license = licenses.bsdOriginal;
-    maintainers = [ ];
+    maintainers = with maintainers; [ dotlambda ];
     platforms = platforms.unix;
   };
-
 }