2016-09-18 22:43:44 +02:00
|
|
|
{ stdenv, fetchurl, makeWrapper, glibc, readline, ncurses, utillinux }:
|
2016-02-24 22:47:21 +01:00
|
|
|
|
|
|
|
with stdenv.lib;
|
|
|
|
let
|
|
|
|
makeFlags = ''
|
2016-08-30 02:11:09 +02:00
|
|
|
INCDIR=${glibc.dev}/include \
|
2016-02-24 22:47:21 +01:00
|
|
|
BINDIR=$out/bin LIBDIR=$out/lib CALC_INCDIR=$out/include/calc CALC_SHAREDIR=$out/share/calc MANDIR=$out/share/man/man1 \
|
|
|
|
USE_READLINE=-DUSE_READLINE READLINE_LIB=-lreadline READLINE_EXTRAS='-lhistory -lncurses' \
|
|
|
|
TERMCONTROL=-DUSE_TERMIOS \
|
|
|
|
'';
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
|
|
|
|
name = "calc-${version}";
|
|
|
|
version = "2.12.5.3";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://sourceforge/calc/${name}.tar.bz2";
|
|
|
|
sha256 = "14mnz6smhi3a0rgmwvddk9w3vdisi8khq67i8nqsl47vgs8n1kqg";
|
|
|
|
};
|
|
|
|
|
2016-09-18 22:43:44 +02:00
|
|
|
buildInputs = [ makeWrapper readline ncurses utillinux ];
|
2016-02-24 22:47:21 +01:00
|
|
|
|
|
|
|
configurePhase = ''
|
|
|
|
sed -i 's/all: check_include/all:/' Makefile
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
make ${makeFlags}
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
make install ${makeFlags}
|
|
|
|
wrapProgram $out/bin/calc --prefix LD_LIBRARY_PATH : $out/lib
|
|
|
|
'';
|
|
|
|
|
2017-05-16 16:35:52 +02:00
|
|
|
# Hack to avoid TMPDIR in RPATHs.
|
|
|
|
preFixup = ''rm -rf "$(pwd)" '';
|
|
|
|
|
2016-02-24 22:47:21 +01:00
|
|
|
meta = {
|
|
|
|
description = "C-style arbitrary precision calculator";
|
|
|
|
homepage = http://www.isthe.com/chongo/tech/comp/calc/;
|
|
|
|
license = licenses.lgpl21;
|
|
|
|
maintainers = [ ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|