summary refs log tree commit diff
path: root/pkgs/applications/office
diff options
context:
space:
mode:
authorAnderson Torres <torres.anderson.85@protonmail.com>2021-11-27 12:23:07 -0300
committerGitHub <noreply@github.com>2021-11-27 12:23:07 -0300
commit2e867c4097dae9ddf02cae0bf93e2b25fd8e1e63 (patch)
treec745938ea37953b685d41ebefb2a474e4d6e436d /pkgs/applications/office
parentc4414bf7401fae5e8ec3df56d2b104b8ab5b281c (diff)
parentc86da07d5df5f26bfefd1fb0442b668ec46916d6 (diff)
downloadnixpkgs-2e867c4097dae9ddf02cae0bf93e2b25fd8e1e63.tar
nixpkgs-2e867c4097dae9ddf02cae0bf93e2b25fd8e1e63.tar.gz
nixpkgs-2e867c4097dae9ddf02cae0bf93e2b25fd8e1e63.tar.bz2
nixpkgs-2e867c4097dae9ddf02cae0bf93e2b25fd8e1e63.tar.lz
nixpkgs-2e867c4097dae9ddf02cae0bf93e2b25fd8e1e63.tar.xz
nixpkgs-2e867c4097dae9ddf02cae0bf93e2b25fd8e1e63.tar.zst
nixpkgs-2e867c4097dae9ddf02cae0bf93e2b25fd8e1e63.zip
Merge pull request #147440 from AndersonTorres/new-teapot
teapot: init at 2.3.0
Diffstat (limited to 'pkgs/applications/office')
-rw-r--r--pkgs/applications/office/teapot/001-fix-warning.patch11
-rw-r--r--pkgs/applications/office/teapot/002-remove-help.patch49
-rw-r--r--pkgs/applications/office/teapot/default.nix73
3 files changed, 133 insertions, 0 deletions
diff --git a/pkgs/applications/office/teapot/001-fix-warning.patch b/pkgs/applications/office/teapot/001-fix-warning.patch
new file mode 100644
index 00000000000..c9ab9da94bf
--- /dev/null
+++ b/pkgs/applications/office/teapot/001-fix-warning.patch
@@ -0,0 +1,11 @@
+diff -Naur teapot-2.3.0-old/scanner.c teapot-2.3.0-new/scanner.c
+--- teapot-2.3.0-old/scanner.c	1969-12-31 21:00:01.000000000 -0300
++++ teapot-2.3.0-new/scanner.c	2021-11-25 17:46:49.936673391 -0300
+@@ -25,6 +25,7 @@
+ #include "main.h"
+ #include "misc.h"
+ #include "scanner.h"
++#include "utf8.h"
+ /*}}}*/
+ 
+ /* identcode  -- return number of identifier */ /*{{{*/
diff --git a/pkgs/applications/office/teapot/002-remove-help.patch b/pkgs/applications/office/teapot/002-remove-help.patch
new file mode 100644
index 00000000000..5bf804255be
--- /dev/null
+++ b/pkgs/applications/office/teapot/002-remove-help.patch
@@ -0,0 +1,49 @@
+diff -Naur teapot-2.3.0-old/CMakeLists.txt teapot-2.3.0-new/CMakeLists.txt
+--- teapot-2.3.0-old/CMakeLists.txt	1969-12-31 21:00:01.000000000 -0300
++++ teapot-2.3.0-new/CMakeLists.txt	2021-11-25 18:16:06.594423660 -0300
+@@ -64,46 +64,6 @@
+ 	install(TARGETS fteapot DESTINATION bin)
+ endif ()
+ 
+-if (ENABLE_HELP)
+-	add_custom_command(
+-		OUTPUT teapot.tex teapot.lyx
+-		MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/doc/teapot.lyx
+-		VERBATIM
+-		COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/doc/teapot.lyx teapot.lyx
+-		COMMAND lyx -e pdflatex -f main teapot.lyx
+-	)
+-	add_custom_command(
+-		OUTPUT teapot.pdf teapot.aux.old teapot.log teapot.toc
+-		MAIN_DEPENDENCY teapot.tex
+-		VERBATIM
+-		COMMAND pdflatex teapot.tex; diff -q teapot.aux.old teapot.aux && cp teapot.aux teapot.aux.old
+-		COMMAND pdflatex teapot.tex; diff -q teapot.aux.old teapot.aux && cp teapot.aux teapot.aux.old
+-	)
+-	add_custom_command(OUTPUT teapot.pdf teapot.out MAIN_DEPENDENCY teapot.tex teapot.aux.old VERBATIM COMMAND pdflatex teapot.tex; diff -q teapot.aux.old teapot.aux && cp teapot.aux teapot.aux.old)
+-	add_custom_command(
+-		OUTPUT html/ html/index.html .latex2html-init
+-		MAIN_DEPENDENCY teapot.tex
+-		DEPENDS teapot.tex teapot.pdf ${CMAKE_CURRENT_SOURCE_DIR}/doc/.latex2html-init
+-		VERBATIM
+-		COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/doc/.latex2html-init .latex2html-init
+-		COMMAND ${CMAKE_COMMAND} -E make_directory html
+-		COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/doc/contents.png html/
+-		COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/doc/next.png html/
+-		COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/doc/next_g.png html/
+-		COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/doc/prev.png html/
+-		COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/doc/prev_g.png html/
+-		COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/doc/up.png html/
+-		COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/doc/up_g.png html/
+-		COMMAND latex2html teapot.tex
+-	)
+-	add_custom_target(pdf DEPENDS teapot.pdf)
+-	add_custom_target(html DEPENDS html/index.html)
+-	add_custom_target(doc ALL DEPENDS teapot.pdf html/index.html)
+-	install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION share/doc/teapot FILES_MATCHING PATTERN *.html PATTERN *.png)
+-	install(FILES ${CMAKE_CURRENT_BINARY_DIR}/teapot.pdf DESTINATION share/doc/teapot)
+-	set(HELPFILE "${CMAKE_INSTALL_PREFIX}/share/doc/teapot/index.html")
+-endif ()
+-
+ install(FILES COPYING README DESTINATION share/doc/teapot)
+ install(FILES teapot.1 DESTINATION share/man/man1)
diff --git a/pkgs/applications/office/teapot/default.nix b/pkgs/applications/office/teapot/default.nix
new file mode 100644
index 00000000000..62a48cebf19
--- /dev/null
+++ b/pkgs/applications/office/teapot/default.nix
@@ -0,0 +1,73 @@
+{ lib
+, stdenv
+, fetchzip
+, cmake
+, libtirpc
+, ncurses
+}:
+
+stdenv.mkDerivation rec {
+  pname = "teapot";
+  version = "2.3.0";
+
+  src = fetchzip {
+    name = "${pname}-${version}";
+    url = "https://www.syntax-k.de/projekte/teapot/${pname}-${version}.tar.gz";
+    sha256 = "sha256-wzAwZwOMeTsuR5LhfjspGdejT6X1V8YJ8B7v9pcbxaY=";
+  };
+
+  patches = [
+    # include a local file in order to make cc happy
+    ./001-fix-warning.patch
+    # remove the ENABLE_HELP target entirely - lyx and latex are huge!
+    ./002-remove-help.patch
+  ];
+
+  nativeBuildInputs = [
+    cmake
+  ];
+
+  buildInputs = [
+    libtirpc
+    ncurses
+  ];
+
+  # By no known reason libtirpc is not detected
+  NIX_CFLAGS_COMPILE = [ "-I${libtirpc.dev}/include/tirpc" ];
+  NIX_LDFLAGS = [ "-ltirpc" ];
+
+  cmakeConfigureFlags = [
+    "-DENABLE_HELP=OFF"
+  ];
+
+  meta = with lib; {
+    homepage = "https://www.syntax-k.de/projekte/teapot/";
+    description = "Table Editor And Planner, Or: Teapot!";
+    longDescription = ''
+      Teapot is a compact spreadsheet software originally written by Michael
+      Haardt. It features a (n)curses-based text terminal interface, and
+      recently also a FLTK-based GUI.
+
+      These days, it may seem pointless having yet another spreadsheet program
+      (and one that doesn't even know how to load Microsoft Excel files). Its
+      compact size (130k for the ncurses executable, 140k for the GUI
+      executable, 300k for the self-contained Windows EXE) and the fact that it
+      can run across serial lines and SSH sessions make it an interesting choice
+      for embedded applications and as system administration utility, even more
+      so since it has a batch processing mode and comes with example code for
+      creating graphs from data sets.
+
+      Another interesting feature is its modern approach to spread sheet theory:
+      It sports true three-dimensional tables and iterative expressions. And
+      since it breaks compatibility with the usual notions of big spreadsheet
+      packages, it can also throw old syntactic cruft over board which many
+      spreadsheets still inherit from the days of VisiCalc on ancient CP/M
+      systems.
+    '';
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ AndersonTorres ];
+    platforms = platforms.unix;
+  };
+}
+# TODO: patch/fix FLTK building
+# TODO: add documentation from