From a06a1a61a1db22bd168e90226414cc35c4bcd0d9 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Wed, 25 Sep 2024 17:55:13 -0300 Subject: [PATCH 1/2] galculator: migrate to by-name --- .../default.nix => by-name/ga/galculator/package.nix} | 8 ++++---- pkgs/top-level/all-packages.nix | 4 ---- 2 files changed, 4 insertions(+), 8 deletions(-) rename pkgs/{applications/misc/galculator/default.nix => by-name/ga/galculator/package.nix} (88%) diff --git a/pkgs/applications/misc/galculator/default.nix b/pkgs/by-name/ga/galculator/package.nix similarity index 88% rename from pkgs/applications/misc/galculator/default.nix rename to pkgs/by-name/ga/galculator/package.nix index ef45224a83ce..115a587dd320 100644 --- a/pkgs/applications/misc/galculator/default.nix +++ b/pkgs/by-name/ga/galculator/package.nix @@ -1,6 +1,6 @@ { lib, stdenv, fetchFromGitHub, fetchpatch , autoreconfHook, intltool -, gtk, pkg-config, flex }: +, gtk3, pkg-config, flex }: stdenv.mkDerivation rec { pname = "galculator"; @@ -24,12 +24,12 @@ stdenv.mkDerivation rec { ]; nativeBuildInputs = [ autoreconfHook intltool pkg-config ]; - buildInputs = [ gtk flex ]; + buildInputs = [ gtk3 flex ]; meta = with lib; { - description = "GTK 2/3 algebraic and RPN calculator"; + description = "GTK algebraic and RPN calculator"; longDescription = '' - galculator is a GTK 2 / GTK 3 based calculator. Its main features include: + galculator is a GTK-based calculator. Its main features include: - Algebraic, RPN (Reverse Polish Notation), Formula Entry and Paper modes; - Basic and Scientific Modes diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9e0dffbeec0a..75e4164a5b3b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7836,10 +7836,6 @@ with pkgs; uniscribe = callPackage ../tools/text/uniscribe { }; - galculator = callPackage ../applications/misc/galculator { - gtk = gtk3; - }; - fornalder = callPackage ../applications/version-management/fornalder { }; galen = callPackage ../development/tools/galen { }; From 0a487d274f5dfc58c8449719620a3df9da064960 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Wed, 25 Sep 2024 18:17:38 -0300 Subject: [PATCH 2/2] galculator: refactor - finalAttrs - no nested with - strictDeps set as false --- pkgs/by-name/ga/galculator/package.nix | 52 ++++++++++++++++++-------- 1 file changed, 36 insertions(+), 16 deletions(-) diff --git a/pkgs/by-name/ga/galculator/package.nix b/pkgs/by-name/ga/galculator/package.nix index 115a587dd320..b1f45a1432d9 100644 --- a/pkgs/by-name/ga/galculator/package.nix +++ b/pkgs/by-name/ga/galculator/package.nix @@ -1,32 +1,53 @@ -{ lib, stdenv, fetchFromGitHub, fetchpatch -, autoreconfHook, intltool -, gtk3, pkg-config, flex }: +{ + lib, + autoreconfHook, + fetchFromGitHub, + fetchpatch2, + flex, + gtk3, + intltool, + pkg-config, + stdenv, +}: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "galculator"; version = "2.1.4"; src = fetchFromGitHub { owner = "galculator"; repo = "galculator"; - rev = "v${version}"; - sha256 = "0q0hb62f266709ncyq96bpx4a40a1i6dc5869byvd7x285sx1c2w"; + rev = "v${finalAttrs.version}"; + hash = "sha256-XLDQdUGin7b9SgYV1kwMChBF+l0mYc9sAscY4YRZEGA="; }; patches = [ # Pul patch pending upstream inclusion for -fno-common toolchain support: # https://github.com/galculator/galculator/pull/45 - (fetchpatch { + (fetchpatch2 { name = "fno-common.patch"; url = "https://github.com/galculator/galculator/commit/501a9e3feeb2e56889c0ff98ab6d0ab20348ccd6.patch"; - sha256 = "08c9d2b49a1mizgk7v37dp8r96x389zc13mzv4dcy16x448lhp67"; + hash = "sha256-qVJHcfJTtl0hK8pzSp6MjhYAh1NbIIWr3rBDodIYBvk="; }) ]; - nativeBuildInputs = [ autoreconfHook intltool pkg-config ]; - buildInputs = [ gtk3 flex ]; + nativeBuildInputs = [ + autoreconfHook + flex + intltool + pkg-config + ]; - meta = with lib; { + buildInputs = [ + gtk3 + ]; + + # BUG: when set as true, complains with: + # configure.in:76: error: possibly undefined macro: AM_GLIB_GNU_GETTEXT + strictDeps = false; + + meta = { + homepage = "http://galculator.sourceforge.net/"; description = "GTK algebraic and RPN calculator"; longDescription = '' galculator is a GTK-based calculator. Its main features include: @@ -40,10 +61,9 @@ stdenv.mkDerivation rec { - Binary arithmetic of configurable bit length and signedness - Quad-precision floating point arithmetic, and 112-bit binary arithmetic ''; - homepage = "http://galculator.sourceforge.net/"; - license = licenses.gpl2Plus; - maintainers = [ maintainers.AndersonTorres ]; - platforms = platforms.linux; + license = lib.licenses.gpl2Plus; mainProgram = "galculator"; + maintainers = with lib.maintainers; [ AndersonTorres ]; + inherit (gtk3.meta) platforms; }; -} +})