···11+{ stdenv, fetchFromGitHub, ncurses, hdate, lua5_2 }:
22+33+stdenv.mkDerivation rec {
44+ version = "12010904";
55+ name = "dozenal-${version}";
66+ src = fetchFromGitHub {
77+ owner = "dgoodmaniii";
88+ repo = "dozenal";
99+ rev = "v${version}";
1010+ sha256 = "1ic63gpdda762x6ks3al71dwgmsy2isicqyr2935bd245jx8s209";
1111+ };
1212+ makeFlags = [
1313+ # author do not use configure and prefix directly using $prefix
1414+ "prefix=$(out)"
1515+ # graphical version of dozdc requires xforms, which is not i nixpkgs so I turned it down
1616+ "XFORMS_FLAGS=-UXFORMS"
1717+ "LUALIB=-llua"
1818+ "bindir=$(prefix)/bin/"
1919+ ];
2020+ # some include hardcodes the lua libraries path. This is a patch for that
2121+ patches = [ ./lua-header.patch ];
2222+ preBuild = "cd dozenal";
2323+ buildInputs = [ ncurses hdate lua5_2 ];
2424+ # I remove gdozdc, as I didn't figure all it's dependency yet.
2525+ postInstall = "rm $out/bin/gdozdc";
2626+2727+ meta = {
2828+ description = "A complete suite of dozenal (base twelve) programs";
2929+ longDescription = ''
3030+ Programs
3131+3232+ doz --- a converter; converts decimal numbers into dozenal. Accepts
3333+ input in standard or exponential notation (i.e., "1492.2" or "1.4922e3").
3434+ dec --- a converter; converts dozenal numbers into decimal. Accepts input
3535+ in standard or exponential notation (i.e., "X44;4" or "X;444e2").
3636+ dozword --- converts a dozenal number (integers only) into words,
3737+ according to the Pendlebury system.
3838+ dozdc --- a full-featured scientific calculator which works in the
3939+ dozenal base. RPN command line.
4040+ tgmconv --- a converter for all standard measurements; converts to and
4141+ from TGM, Imperial, customary, and SI metric.
4242+ dozpret --- a pretty-printer for dozenal numbers; inserts spacing (or
4343+ other characters) as desired, and can also transform transdecimal digits
4444+ from 'X' to 'E' into any character or sequence of characters desired.
4545+ dozdate --- a more-or-less drop-in replacement for GNU and BSD date, it
4646+ outputs the date and time in dozenal, as well as containing some TGM
4747+ extensions.
4848+ dozstring --- a simple byte converter; absorbs a string either from
4949+ standard input or a command line argument, leaving it identical but
5050+ for the numbers, which it converts into dozenal. Options for padding
5151+ and for not converting specific numbers.
5252+ doman --- a converter which takes a dozenal integer and
5353+ emits its equivalent in a non-place-value system, such as
5454+ Roman numerals. Arbitrary ranks and symbols may be used.
5555+ Defaults to dozenal Roman numerals.
5656+ '';
5757+ homepage = https://github.com/dgoodmaniii/dozenal/;
5858+ maintainers = with stdenv.lib.maintainers; [ CharlesHD ];
5959+ license = stdenv.lib.licenses.gpl3;
6060+ };
6161+}