From 08a7427ee1637ace1811f7303ffb81549b79bc9b Mon Sep 17 00:00:00 2001 From: "R. RyanTM" Date: Fri, 19 Mar 2021 21:39:08 +0000 Subject: [PATCH 1/3] sc-im: 0.7.0 -> 0.8.0 --- pkgs/applications/misc/sc-im/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/misc/sc-im/default.nix b/pkgs/applications/misc/sc-im/default.nix index 0ae7a5c1ec0..833d1403d24 100644 --- a/pkgs/applications/misc/sc-im/default.nix +++ b/pkgs/applications/misc/sc-im/default.nix @@ -1,14 +1,14 @@ { lib, stdenv, fetchFromGitHub, yacc, ncurses, libxml2, libzip, libxls, pkg-config }: stdenv.mkDerivation rec { - version = "0.7.0"; + version = "0.8.0"; pname = "sc-im"; src = fetchFromGitHub { owner = "andmarti1424"; repo = "sc-im"; rev = "v${version}"; - sha256 = "0xi0n9qzby012y2j7hg4fgcwyly698sfi4i9gkvy0q682jihprbk"; + sha256 = "sha256-/eG2BdkyfEGoSzPu6jT+Bn1RZTGT1D3etGj1tYchm1M="; }; nativeBuildInputs = [ pkg-config ]; From 49f8234fb4c055bf32aeca7481a2e225647c6a52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sat, 20 Mar 2021 12:35:55 +0100 Subject: [PATCH 2/3] sc-im: modernize expression and support gnuplot --- pkgs/applications/misc/sc-im/default.nix | 53 +++++++++++++++--------- 1 file changed, 33 insertions(+), 20 deletions(-) diff --git a/pkgs/applications/misc/sc-im/default.nix b/pkgs/applications/misc/sc-im/default.nix index 833d1403d24..ad25e4f8b1c 100644 --- a/pkgs/applications/misc/sc-im/default.nix +++ b/pkgs/applications/misc/sc-im/default.nix @@ -1,8 +1,20 @@ -{ lib, stdenv, fetchFromGitHub, yacc, ncurses, libxml2, libzip, libxls, pkg-config }: +{ lib +, stdenv +, fetchFromGitHub +, makeWrapper +, pkg-config +, which +, yacc +, gnuplot +, libxls +, libxml2 +, libzip +, ncurses +}: stdenv.mkDerivation rec { - version = "0.8.0"; pname = "sc-im"; + version = "0.8.0"; src = fetchFromGitHub { owner = "andmarti1424"; @@ -11,33 +23,34 @@ stdenv.mkDerivation rec { sha256 = "sha256-/eG2BdkyfEGoSzPu6jT+Bn1RZTGT1D3etGj1tYchm1M="; }; - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ yacc ncurses libxml2 libzip libxls ]; + sourceRoot = "${src.name}/src"; - buildPhase = '' - cd src + nativeBuildInputs = [ + makeWrapper + pkg-config + which + yacc + ]; - 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; }; - } From 4e9627f8b13f00a4d219bda00d02cced3d80ff3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sat, 20 Mar 2021 13:59:02 +0100 Subject: [PATCH 3/3] sc-im: make default colors readable on dark background --- pkgs/applications/misc/sc-im/default.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pkgs/applications/misc/sc-im/default.nix b/pkgs/applications/misc/sc-im/default.nix index ad25e4f8b1c..523dc6aab83 100644 --- a/pkgs/applications/misc/sc-im/default.nix +++ b/pkgs/applications/misc/sc-im/default.nix @@ -1,6 +1,7 @@ { lib , stdenv , fetchFromGitHub +, fetchpatch , makeWrapper , pkg-config , which @@ -25,6 +26,20 @@ stdenv.mkDerivation rec { sourceRoot = "${src.name}/src"; + # make default colors readable on dark background + patches = [ + (fetchpatch { + url = "https://github.com/andmarti1424/sc-im/commit/78d2fdaaf2c578691e68fb5bd773803cb967ddba.patch"; + sha256 = "09716zsqa9qdsj2qpkji8wlzsmp9gl66ggvrg7lmrwwnvli2zn2w"; + }) + (fetchpatch { + url = "https://github.com/andmarti1424/sc-im/commit/f29d6605c8170febcec0dea7bda9613bee3b7011.patch"; + sha256 = "1zs1sb23g0k6lig4d0qdzq1wdhcdzl424ch567zyjl191lyhsjyg"; + }) + ]; + + patchFlags = [ "-p2" ]; + nativeBuildInputs = [ makeWrapper pkg-config