From 220618e6a9403ec60db43346d1c9b8c8f6306020 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Wed, 9 Oct 2024 22:19:15 -0300 Subject: [PATCH 1/2] zegrapher: migrate to by-name --- .../default.nix => by-name/ze/zegrapher/package.nix} | 6 ++++-- pkgs/top-level/all-packages.nix | 2 -- 2 files changed, 4 insertions(+), 4 deletions(-) rename pkgs/{applications/science/math/zegrapher/default.nix => by-name/ze/zegrapher/package.nix} (93%) diff --git a/pkgs/applications/science/math/zegrapher/default.nix b/pkgs/by-name/ze/zegrapher/package.nix similarity index 93% rename from pkgs/applications/science/math/zegrapher/default.nix rename to pkgs/by-name/ze/zegrapher/package.nix index ffe337efd7db..88b3f0c8775e 100644 --- a/pkgs/applications/science/math/zegrapher/default.nix +++ b/pkgs/by-name/ze/zegrapher/package.nix @@ -1,9 +1,11 @@ { lib, stdenv , fetchFromGitHub -, qmake -, wrapQtAppsHook +, qt5 , boost }: +let + inherit (qt5) qmake wrapQtAppsHook; +in stdenv.mkDerivation rec { pname = "zegrapher"; version = "3.1.1"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ac40c890cd23..b8dfaea49976 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -36314,8 +36314,6 @@ with pkgs; fftw = fftwSinglePrec; }); - zegrapher = libsForQt5.callPackage ../applications/science/math/zegrapher { }; - ### SCIENCE/MEDICINE dcmtk = callPackage ../applications/science/medicine/dcmtk { }; From 60065e92c2b89e938d73270c5a973edc8c55cffd Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Wed, 9 Oct 2024 22:29:47 -0300 Subject: [PATCH 2/2] zegrapher: refactor - nixfmt-rfc-style - no nested with - finalAttrs - strictDeps --- pkgs/by-name/ze/zegrapher/package.nix | 33 ++++++++++++++++----------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/pkgs/by-name/ze/zegrapher/package.nix b/pkgs/by-name/ze/zegrapher/package.nix index 88b3f0c8775e..d4794550eddf 100644 --- a/pkgs/by-name/ze/zegrapher/package.nix +++ b/pkgs/by-name/ze/zegrapher/package.nix @@ -1,39 +1,46 @@ -{ lib, stdenv -, fetchFromGitHub -, qt5 -, boost }: +{ + lib, + boost, + fetchFromGitHub, + qt5, + stdenv, +}: let inherit (qt5) qmake wrapQtAppsHook; in -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "zegrapher"; version = "3.1.1"; src = fetchFromGitHub { owner = "AdelKS"; repo = "ZeGrapher"; - rev = "v${version}"; - sha256 = "sha256-OSQXm0gDI1zM2MBM4iiY43dthJcAZJkprklolsNMEvk="; + rev = "v${finalAttrs.version}"; + hash = "sha256-OSQXm0gDI1zM2MBM4iiY43dthJcAZJkprklolsNMEvk="; }; nativeBuildInputs = [ qmake wrapQtAppsHook ]; + buildInputs = [ boost ]; - meta = with lib; { - homepage = "https://zegrapher.com/"; + strictDeps = true; + + meta = { + homepage = "https://zegrapher.com/en/"; description = "Open source math plotter"; - mainProgram = "ZeGrapher"; longDescription = '' An open source, free and easy to use math plotter. It can plot functions, sequences, parametric equations and data on the plane. ''; - license = licenses.gpl3Plus; - maintainers = with maintainers; [ AndersonTorres ]; + license = lib.licenses.gpl3Plus; + mainProgram = "ZeGrapher"; + maintainers = with lib.maintainers; [ AndersonTorres ]; + platforms = lib.platforms.unix; }; -} +})