···1+{ stdenv, fetchFromGitHub, ncurses, hdate, lua5_2 }:
2+3+stdenv.mkDerivation rec {
4+ version = "12010904";
5+ name = "dozenal-${version}";
6+ src = fetchFromGitHub {
7+ owner = "dgoodmaniii";
8+ repo = "dozenal";
9+ rev = "v${version}";
10+ sha256 = "1ic63gpdda762x6ks3al71dwgmsy2isicqyr2935bd245jx8s209";
11+ };
12+ makeFlags = [
13+ # author do not use configure and prefix directly using $prefix
14+ "prefix=$(out)"
15+ # graphical version of dozdc requires xforms, which is not i nixpkgs so I turned it down
16+ "XFORMS_FLAGS=-UXFORMS"
17+ "LUALIB=-llua"
18+ "bindir=$(prefix)/bin/"
19+ ];
20+ # some include hardcodes the lua libraries path. This is a patch for that
21+ patches = [ ./lua-header.patch ];
22+ preBuild = "cd dozenal";
23+ buildInputs = [ ncurses hdate lua5_2 ];
24+ # I remove gdozdc, as I didn't figure all it's dependency yet.
25+ postInstall = "rm $out/bin/gdozdc";
26+27+ meta = {
28+ description = "A complete suite of dozenal (base twelve) programs";
29+ longDescription = ''
30+ Programs
31+32+ doz --- a converter; converts decimal numbers into dozenal. Accepts
33+ input in standard or exponential notation (i.e., "1492.2" or "1.4922e3").
34+ dec --- a converter; converts dozenal numbers into decimal. Accepts input
35+ in standard or exponential notation (i.e., "X44;4" or "X;444e2").
36+ dozword --- converts a dozenal number (integers only) into words,
37+ according to the Pendlebury system.
38+ dozdc --- a full-featured scientific calculator which works in the
39+ dozenal base. RPN command line.
40+ tgmconv --- a converter for all standard measurements; converts to and
41+ from TGM, Imperial, customary, and SI metric.
42+ dozpret --- a pretty-printer for dozenal numbers; inserts spacing (or
43+ other characters) as desired, and can also transform transdecimal digits
44+ from 'X' to 'E' into any character or sequence of characters desired.
45+ dozdate --- a more-or-less drop-in replacement for GNU and BSD date, it
46+ outputs the date and time in dozenal, as well as containing some TGM
47+ extensions.
48+ dozstring --- a simple byte converter; absorbs a string either from
49+ standard input or a command line argument, leaving it identical but
50+ for the numbers, which it converts into dozenal. Options for padding
51+ and for not converting specific numbers.
52+ doman --- a converter which takes a dozenal integer and
53+ emits its equivalent in a non-place-value system, such as
54+ Roman numerals. Arbitrary ranks and symbols may be used.
55+ Defaults to dozenal Roman numerals.
56+ '';
57+ homepage = https://github.com/dgoodmaniii/dozenal/;
58+ maintainers = with stdenv.lib.maintainers; [ CharlesHD ];
59+ license = stdenv.lib.licenses.gpl3;
60+ };
61+}