2021-02-09 02:00:44 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
2021-04-04 16:22:20 +01:00
|
|
|
, makeDesktopItem
|
|
|
|
, copyDesktopItems
|
2021-02-09 02:00:44 +00:00
|
|
|
, pkg-config
|
|
|
|
, gtk3
|
2021-06-10 03:57:09 +01:00
|
|
|
, alsa-lib
|
2021-02-09 02:00:44 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "free42";
|
2022-01-03 21:35:27 +00:00
|
|
|
version = "3.0.9";
|
2021-02-09 02:00:44 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "thomasokken";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-01-03 21:35:27 +00:00
|
|
|
hash = "sha256-ZSwqgHsfe9apyYZ1fkvDMnQxdNb9E8U1l9jvC9t693w=";
|
2021-02-09 02:00:44 +00:00
|
|
|
};
|
|
|
|
|
2022-01-03 21:35:27 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
copyDesktopItems
|
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
alsa-lib
|
|
|
|
gtk3
|
|
|
|
];
|
2021-02-09 02:00:44 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
sed -i -e "s|/bin/ls|ls|" gtk/Makefile
|
|
|
|
'';
|
|
|
|
|
|
|
|
dontConfigure = true;
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild
|
2022-01-03 21:35:27 +00:00
|
|
|
|
2021-02-09 02:00:44 +00:00
|
|
|
make -C gtk cleaner
|
|
|
|
make --jobs=$NIX_BUILD_CORES -C gtk
|
|
|
|
make -C gtk clean
|
|
|
|
make --jobs=$NIX_BUILD_CORES -C gtk BCD_MATH=1
|
2022-01-03 21:35:27 +00:00
|
|
|
|
2021-02-09 02:00:44 +00:00
|
|
|
runHook postBuild
|
|
|
|
'';
|
|
|
|
|
2022-01-03 21:35:27 +00:00
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
2021-02-09 02:00:44 +00:00
|
|
|
install --directory $out/bin \
|
|
|
|
$out/share/doc/${pname} \
|
|
|
|
$out/share/${pname}/skins \
|
|
|
|
$out/share/icons/hicolor/48x48/apps \
|
|
|
|
$out/share/icons/hicolor/128x128/apps
|
|
|
|
|
|
|
|
install -m755 gtk/free42dec gtk/free42bin $out/bin
|
|
|
|
install -m644 gtk/README $out/share/doc/${pname}/README-GTK
|
|
|
|
install -m644 README $out/share/doc/${pname}/README
|
|
|
|
|
|
|
|
install -m644 gtk/icon-48x48.xpm $out/share/icons/hicolor/48x48/apps
|
|
|
|
install -m644 gtk/icon-128x128.xpm $out/share/icons/hicolor/128x128/apps
|
|
|
|
install -m644 skins/* $out/share/${pname}/skins
|
2022-01-03 21:35:27 +00:00
|
|
|
|
2021-02-09 02:00:44 +00:00
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2021-04-04 16:22:20 +01:00
|
|
|
desktopItems = [
|
|
|
|
(makeDesktopItem {
|
|
|
|
name = "com.thomasokken.free42bin";
|
|
|
|
desktopName = "Free42Bin";
|
|
|
|
genericName = "Calculator";
|
|
|
|
exec = "free42bin";
|
|
|
|
type = "Application";
|
|
|
|
comment = meta.description;
|
|
|
|
categories = "Utility;Calculator;";
|
|
|
|
terminal = "false";
|
|
|
|
})
|
|
|
|
(makeDesktopItem {
|
|
|
|
name = "com.thomasokken.free42dec";
|
|
|
|
desktopName = "Free42Dec";
|
|
|
|
genericName = "Calculator";
|
|
|
|
exec = "free42dec";
|
|
|
|
type = "Application";
|
|
|
|
comment = meta.description;
|
|
|
|
categories = "Utility;Calculator;";
|
|
|
|
terminal = "false";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-02-09 02:00:44 +00:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/thomasokken/free42";
|
|
|
|
description = "A software clone of HP-42S Calculator";
|
|
|
|
license = licenses.gpl2Only;
|
2021-04-08 23:10:12 +01:00
|
|
|
maintainers = with maintainers; [ AndersonTorres plabadens ];
|
2021-02-09 02:00:44 +00:00
|
|
|
platforms = with platforms; unix;
|
|
|
|
};
|
|
|
|
}
|