summary refs log tree commit diff
path: root/pkgs/by-name
diff options
context:
space:
mode:
authorAnderson Torres <torres.anderson.85@protonmail.com>2023-11-18 04:01:28 -0300
committerAnderson Torres <torres.anderson.85@protonmail.com>2023-11-18 05:02:05 -0300
commit9ed777673ca1eee6a1b9ec63fffd045d8593a5e4 (patch)
tree22f5f1a79bc21debfa7aa88c854976488b2c80c4 /pkgs/by-name
parent3d2b6c58ab5168b547f20a1165ac8a6da1a57003 (diff)
downloadnixpkgs-9ed777673ca1eee6a1b9ec63fffd045d8593a5e4.tar
nixpkgs-9ed777673ca1eee6a1b9ec63fffd045d8593a5e4.tar.gz
nixpkgs-9ed777673ca1eee6a1b9ec63fffd045d8593a5e4.tar.bz2
nixpkgs-9ed777673ca1eee6a1b9ec63fffd045d8593a5e4.tar.lz
nixpkgs-9ed777673ca1eee6a1b9ec63fffd045d8593a5e4.tar.xz
nixpkgs-9ed777673ca1eee6a1b9ec63fffd045d8593a5e4.tar.zst
nixpkgs-9ed777673ca1eee6a1b9ec63fffd045d8593a5e4.zip
free42: migrate to by-name
Diffstat (limited to 'pkgs/by-name')
-rw-r--r--pkgs/by-name/fr/free42/package.nix97
1 files changed, 97 insertions, 0 deletions
diff --git a/pkgs/by-name/fr/free42/package.nix b/pkgs/by-name/fr/free42/package.nix
new file mode 100644
index 00000000000..dd8405772ca
--- /dev/null
+++ b/pkgs/by-name/fr/free42/package.nix
@@ -0,0 +1,97 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, makeDesktopItem
+, copyDesktopItems
+, pkg-config
+, gtk3
+, alsa-lib
+}:
+
+stdenv.mkDerivation rec {
+  pname = "free42";
+  version = "3.0.21";
+
+  src = fetchFromGitHub {
+    owner = "thomasokken";
+    repo = pname;
+    rev = "v${version}";
+    hash = "sha256-zRO0buYfKtybUisWZJRkvLJVLJYZwLcDnT04rnQWy+s=";
+  };
+
+  nativeBuildInputs = [
+    copyDesktopItems
+    pkg-config
+  ];
+
+  buildInputs = [
+    alsa-lib
+    gtk3
+  ];
+
+  postPatch = ''
+    sed -i -e "s|/bin/ls|ls|" gtk/Makefile
+  '';
+
+  dontConfigure = true;
+
+  buildPhase = ''
+    runHook preBuild
+
+    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
+
+    runHook postBuild
+  '';
+
+  installPhase = ''
+    runHook preInstall
+
+    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
+
+    runHook postInstall
+  '';
+
+  desktopItems = [
+    (makeDesktopItem {
+      name = "com.thomasokken.free42bin";
+      desktopName = "Free42Bin";
+      genericName = "Calculator";
+      exec = "free42bin";
+      type = "Application";
+      comment = meta.description;
+      categories = [ "Utility" "Calculator" ];
+    })
+    (makeDesktopItem {
+      name = "com.thomasokken.free42dec";
+      desktopName = "Free42Dec";
+      genericName = "Calculator";
+      exec = "free42dec";
+      type = "Application";
+      comment = meta.description;
+      categories = [ "Utility" "Calculator" ];
+    })
+  ];
+
+  meta = with lib; {
+    homepage = "https://github.com/thomasokken/free42";
+    description = "A software clone of HP-42S Calculator";
+    license = licenses.gpl2Only;
+    maintainers = with maintainers; [ AndersonTorres plabadens ];
+    platforms = with platforms; unix;
+  };
+}