summary refs log tree commit diff
path: root/pkgs/applications/misc/dozenal
diff options
context:
space:
mode:
authorCharlesHD <charleshdespointes@gmail.com>2018-06-14 14:46:44 +0200
committerCharlesHD <charleshdespointes@gmail.com>2018-08-20 11:23:02 +0200
commit78e94456fd02259aa3192332ce0230f8c90ed2ae (patch)
tree2f1ce0ee3fa40009cada724b4ab7a5f31e318f63 /pkgs/applications/misc/dozenal
parent0e159e042e7236de364724e53071e327614b8aec (diff)
downloadnixpkgs-78e94456fd02259aa3192332ce0230f8c90ed2ae.tar
nixpkgs-78e94456fd02259aa3192332ce0230f8c90ed2ae.tar.gz
nixpkgs-78e94456fd02259aa3192332ce0230f8c90ed2ae.tar.bz2
nixpkgs-78e94456fd02259aa3192332ce0230f8c90ed2ae.tar.lz
nixpkgs-78e94456fd02259aa3192332ce0230f8c90ed2ae.tar.xz
nixpkgs-78e94456fd02259aa3192332ce0230f8c90ed2ae.tar.zst
nixpkgs-78e94456fd02259aa3192332ce0230f8c90ed2ae.zip
dozenal: init at version v12010904
Diffstat (limited to 'pkgs/applications/misc/dozenal')
-rw-r--r--pkgs/applications/misc/dozenal/default.nix61
-rw-r--r--pkgs/applications/misc/dozenal/lua-header.patch16
2 files changed, 77 insertions, 0 deletions
diff --git a/pkgs/applications/misc/dozenal/default.nix b/pkgs/applications/misc/dozenal/default.nix
new file mode 100644
index 00000000000..b5ae9fb567c
--- /dev/null
+++ b/pkgs/applications/misc/dozenal/default.nix
@@ -0,0 +1,61 @@
+{ stdenv, fetchFromGitHub, ncurses, hdate, lua5_2 }:
+
+stdenv.mkDerivation rec {
+  version = "12010904";
+  name = "dozenal-${version}";
+  src = fetchFromGitHub {
+    owner = "dgoodmaniii";
+    repo = "dozenal";
+    rev = "v${version}";
+    sha256 = "1ic63gpdda762x6ks3al71dwgmsy2isicqyr2935bd245jx8s209";
+  };
+  makeFlags = [
+              # author do not use configure and prefix directly using $prefix
+              "prefix=$(out)"
+              # graphical version of dozdc requires xforms, which is not i nixpkgs so I turned it down
+              "XFORMS_FLAGS=-UXFORMS"
+              "LUALIB=-llua"
+              "bindir=$(prefix)/bin/"
+            ];
+  # some include hardcodes the lua libraries path. This is a patch for that
+  patches = [ ./lua-header.patch ];
+  preBuild = "cd dozenal";
+  buildInputs = [ ncurses hdate lua5_2 ];
+  # I remove gdozdc, as I didn't figure all it's dependency yet.
+  postInstall = "rm $out/bin/gdozdc";
+
+  meta = {
+    description = "A complete suite of dozenal (base twelve) programs";
+    longDescription = ''
+      Programs
+
+      doz --- a converter; converts decimal numbers into dozenal. Accepts
+         input in standard or exponential notation (i.e., "1492.2" or "1.4922e3").
+      dec --- a converter; converts dozenal numbers into decimal. Accepts input
+         in standard or exponential notation (i.e., "X44;4" or "X;444e2").
+      dozword --- converts a dozenal number (integers only) into words,
+         according to the Pendlebury system.
+      dozdc --- a full-featured scientific calculator which works in the
+         dozenal base. RPN command line.
+      tgmconv --- a converter for all standard measurements; converts to and
+         from TGM, Imperial, customary, and SI metric.
+      dozpret --- a pretty-printer for dozenal numbers; inserts spacing (or
+         other characters) as desired, and can also transform transdecimal digits
+         from 'X' to 'E' into any character or sequence of characters desired.
+      dozdate --- a more-or-less drop-in replacement for GNU and BSD date, it
+         outputs the date and time in dozenal, as well as containing some TGM
+         extensions.
+      dozstring --- a simple byte converter; absorbs a string either from
+         standard input or a command line argument, leaving it identical but
+         for the numbers, which it converts into dozenal. Options for padding
+         and for not converting specific numbers.
+      doman --- a converter which takes a dozenal integer and
+         emits its equivalent in a non-place-value system, such as
+         Roman numerals.  Arbitrary ranks and symbols may be used.
+         Defaults to dozenal Roman numerals.
+    '';
+    homepage = https://github.com/dgoodmaniii/dozenal/;
+    maintainers = with stdenv.lib.maintainers; [ CharlesHD ];
+    license = stdenv.lib.licenses.gpl3;
+  };
+}
diff --git a/pkgs/applications/misc/dozenal/lua-header.patch b/pkgs/applications/misc/dozenal/lua-header.patch
new file mode 100644
index 00000000000..45b76e159a1
--- /dev/null
+++ b/pkgs/applications/misc/dozenal/lua-header.patch
@@ -0,0 +1,16 @@
+diff -ruN dozenal-12010904/dozenal/dozcal/call_lua.c dozenal-patched/dozenal/dozcal/call_lua.c
+--- dozenal-12010904/dozenal/dozcal/call_lua.c	2017-09-04 19:25:01.000000000 +0200
++++ dozenal-patched/dozenal/dozcal/call_lua.c	2018-06-13 10:19:57.821950327 +0200
+@@ -38,9 +38,9 @@
+ #include"utility.h"
+ #include"conv.h"
+ #include"proc_date.h"
+-#include<lua5.2/lua.h>
+-#include<lua5.2/lauxlib.h>
+-#include<lua5.2/lualib.h>
++#include<lua.h>
++#include<lauxlib.h>
++#include<lualib.h>
+ 
+ void bail(lua_State *L, int err_code, char *filename);
+ int file_prefix(char **s, char *t);