nixpkgs/pkgs/by-name/fr/free42/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

99 lines
2.4 KiB
Nix
Raw Normal View History

2021-02-09 02:00:44 +00:00
{ lib
, stdenv
, fetchFromGitHub
2023-11-18 07:11:51 +00:00
, alsa-lib
, copyDesktopItems
2021-02-09 02:00:44 +00:00
, gtk3
2023-11-18 07:11:51 +00:00
, makeDesktopItem
, pkg-config
2021-02-09 02:00:44 +00:00
}:
2023-11-18 07:11:51 +00:00
stdenv.mkDerivation (finalAttrs: {
2021-02-09 02:00:44 +00:00
pname = "free42";
2024-05-01 11:54:57 +00:00
version = "3.1.8";
2021-02-09 02:00:44 +00:00
src = fetchFromGitHub {
owner = "thomasokken";
2023-11-18 07:11:51 +00:00
repo = "free42";
rev = "v${finalAttrs.version}";
2024-05-01 11:54:57 +00:00
hash = "sha256-z1HlI2e3mCRJ/sWMdsLF7IpcvTh+Zlrk77M8gaJXMzQ=";
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;
2023-11-18 07:11:51 +00:00
desktopItems = [
(makeDesktopItem {
name = "com.thomasokken.free42bin";
desktopName = "Free42Bin";
genericName = "Calculator";
exec = "free42bin";
type = "Application";
2023-12-11 15:09:59 +00:00
comment = "A software clone of HP-42S Calculator";
2023-11-18 07:11:51 +00:00
categories = [ "Utility" "Calculator" ];
})
(makeDesktopItem {
name = "com.thomasokken.free42dec";
desktopName = "Free42Dec";
genericName = "Calculator";
exec = "free42dec";
type = "Application";
2023-12-11 15:09:59 +00:00
comment = "A software clone of HP-42S Calculator";
2023-11-18 07:11:51 +00:00
categories = [ "Utility" "Calculator" ];
})
];
2021-02-09 02:00:44 +00:00
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 \
2023-11-18 07:11:51 +00:00
$out/share/doc/free42 \
$out/share/free42/skins \
2021-02-09 02:00:44 +00:00
$out/share/icons/hicolor/48x48/apps \
$out/share/icons/hicolor/128x128/apps
install -m755 gtk/free42dec gtk/free42bin $out/bin
2023-11-18 07:11:51 +00:00
install -m644 gtk/README $out/share/doc/free42/README-GTK
install -m644 README $out/share/doc/free42/README
2021-02-09 02:00:44 +00:00
install -m644 gtk/icon-48x48.xpm $out/share/icons/hicolor/48x48/apps
install -m644 gtk/icon-128x128.xpm $out/share/icons/hicolor/128x128/apps
2023-11-18 07:11:51 +00:00
install -m644 skins/* $out/share/free42/skins
2022-01-03 21:35:27 +00:00
2021-02-09 02:00:44 +00:00
runHook postInstall
'';
2023-11-18 07:11:51 +00:00
meta = {
2021-02-09 02:00:44 +00:00
homepage = "https://github.com/thomasokken/free42";
description = "A software clone of HP-42S Calculator";
2023-11-18 07:11:51 +00:00
license = with lib.licenses; [ gpl2Only ];
maintainers = with lib.maintainers; [ AndersonTorres ];
mainProgram = "free42dec";
platforms = with lib.platforms; unix;
2021-02-09 02:00:44 +00:00
};
2023-11-18 07:11:51 +00:00
})