6 , enableCurrenciesUpdater ? true
10 pythonEnv = python3.withPackages(p: [
13 in stdenv.mkDerivation (finalAttrs: {
18 url = "mirror://gnu/units/units-${finalAttrs.version}.tar.gz";
19 hash = "sha256-2Ve0USRZJcnmFMRRM5dEljDq+SvWK4SVugm741Ghc3A=";
22 outputs = [ "out" "info" "man" ];
26 ] ++ lib.optionals enableCurrenciesUpdater [
30 prePatch = lib.optionalString enableCurrenciesUpdater ''
31 substituteInPlace units_cur \
32 --replace "#!/usr/bin/env python" ${pythonEnv}/bin/python
35 postInstall = lib.optionalString enableCurrenciesUpdater ''
36 cp units_cur ${placeholder "out"}/bin/
42 homepage = "https://www.gnu.org/software/units/";
43 description = "Unit conversion tool";
45 GNU Units converts quantities expressed in various systems of measurement
46 to their equivalents in other systems of measurement. Like many similar
47 programs, it can handle multiplicative scale changes. It can also handle
48 nonlinear conversions such as Fahrenheit to Celsius or wire gauge, and it
49 can convert from and to sums of units, such as converting between meters
52 Beyond simple unit conversions, GNU Units can be used as a general-purpose
53 scientific calculator that keeps track of units in its calculations. You
54 can form arbitrary complex mathematical expressions of dimensions
55 including sums, products, quotients, powers, and even roots of
56 dimensions. Thus you can ensure accuracy and dimensional consistency when
57 working with long expressions that involve many different units that may
58 combine in complex ways.
60 The units are defined in an external data file. You can use the extensive
61 data file that comes with this program, or you can provide your own data
62 file to suit your needs. You can also use your own data file to supplement
63 the standard data file.
65 license = with lib.licenses; [ gpl3Plus ];
66 mainProgram = "units";
67 maintainers = with lib.maintainers; [ AndersonTorres ];
68 platforms = lib.platforms.all;