From a55e0fa92d85beabbd8203fcb81d3ee762ed1287 Mon Sep 17 00:00:00 2001 From: TomaSajt <62384384+TomaSajt@users.noreply.github.com> Date: Sun, 14 Apr 2024 18:46:09 +0200 Subject: [PATCH 1/2] simulide: factor out sources --- .../science/electronics/simulide/default.nix | 37 +++++++++++-------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/pkgs/applications/science/electronics/simulide/default.nix b/pkgs/applications/science/electronics/simulide/default.nix index 613ec21dbd96..6ba83bb65fdd 100644 --- a/pkgs/applications/science/electronics/simulide/default.nix +++ b/pkgs/applications/science/electronics/simulide/default.nix @@ -12,9 +12,8 @@ let generic = { version , release - , branch , rev - , sha256 + , src , extraPostPatch ? "" , extraBuildInputs ? [ ] , iconPath ? "resources/icons/simulide.png" @@ -26,11 +25,7 @@ let mkDerivation { pname = "simulide"; version = "${version}-${release}"; - - src = fetchbzr { - url = "https://code.launchpad.net/~arcachofo/simulide/${branch}"; - inherit rev sha256; - }; + inherit src; postPatch = '' sed -i resources/simulide.desktop \ @@ -91,12 +86,16 @@ let }; in { - simulide_0_4_15 = generic { + simulide_0_4_15 = generic rec { version = "0.4.15"; release = "SR10"; - branch = "simulide_0.4.14"; # the branch name does not mach the version for some reason rev = "291"; - sha256 = "sha256-BBoZr/S2pif0Jft5wrem8y00dXl08jq3kFiIUtOr3LM="; + src = fetchbzr { + # the branch name does not mach the version for some reason + url = "https://code.launchpad.net/~arcachofo/simulide/simulide_0.4.14"; + sha256 = "sha256-BBoZr/S2pif0Jft5wrem8y00dXl08jq3kFiIUtOr3LM="; + inherit rev; + }; extraPostPatch = '' # GCC 13 needs the header explicitly included sed -i src/gpsim/value.h -e '1i #include ' @@ -110,20 +109,26 @@ in ''; }; - simulide_1_0_0 = generic { + simulide_1_0_0 = generic rec { version = "1.0.0"; release = "SR2"; - branch = "1.0.0"; rev = "1449"; - sha256 = "sha256-rJWZvnjVzaKXU2ktbde1w8LSNvu0jWkDIk4dq2l7t5g="; + src = fetchbzr { + url = "https://code.launchpad.net/~arcachofo/simulide/1.0.0"; + sha256 = "sha256-rJWZvnjVzaKXU2ktbde1w8LSNvu0jWkDIk4dq2l7t5g="; + inherit rev; + }; extraBuildInputs = [ qtscript ]; }; - simulide_1_1_0 = generic { + simulide_1_1_0 = generic rec { version = "1.1.0"; release = "SR0"; - branch = "1.1.0"; rev = "1917"; - sha256 = "sha256-qNBaGWl89Le9uC1VFK+xYhrLzIvOIWjkQbutnrAmZ2M="; + src = fetchbzr { + url = "https://code.launchpad.net/~arcachofo/simulide/1.1.0"; + sha256 = "sha256-qNBaGWl89Le9uC1VFK+xYhrLzIvOIWjkQbutnrAmZ2M="; + inherit rev; + }; }; } From 345c3a0ace08622363b5eef4571ecd6e0f49d51d Mon Sep 17 00:00:00 2001 From: TomaSajt <62384384+TomaSajt@users.noreply.github.com> Date: Sun, 14 Apr 2024 18:55:31 +0200 Subject: [PATCH 2/2] simulide: format with nixfmt --- .../science/electronics/simulide/default.nix | 45 ++++++++++--------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/pkgs/applications/science/electronics/simulide/default.nix b/pkgs/applications/science/electronics/simulide/default.nix index 6ba83bb65fdd..9053bcfe58e5 100644 --- a/pkgs/applications/science/electronics/simulide/default.nix +++ b/pkgs/applications/science/electronics/simulide/default.nix @@ -1,26 +1,28 @@ -{ lib -, fetchbzr -, mkDerivation -, qmake -, qtserialport -, qtmultimedia -, qttools -, qtscript +{ + lib, + fetchbzr, + mkDerivation, + qmake, + qtserialport, + qtmultimedia, + qttools, + qtscript, }: let generic = - { version - , release - , rev - , src - , extraPostPatch ? "" - , extraBuildInputs ? [ ] - , iconPath ? "resources/icons/simulide.png" - , installFiles ? '' + { + version, + release, + rev, + src, + extraPostPatch ? "", + extraBuildInputs ? [ ], + iconPath ? "resources/icons/simulide.png", + installFiles ? '' cp -r data examples $out/share/simulide cp simulide $out/bin/simulide - '' + '', }: mkDerivation { pname = "simulide"; @@ -46,9 +48,7 @@ let cd build_XX ''; - nativeBuildInputs = [ - qmake - ]; + nativeBuildInputs = [ qmake ]; buildInputs = [ qtserialport @@ -80,7 +80,10 @@ let homepage = "https://simulide.com/"; license = lib.licenses.gpl3Only; mainProgram = "simulide"; - maintainers = with lib.maintainers; [ carloscraveiro tomasajt ]; + maintainers = with lib.maintainers; [ + carloscraveiro + tomasajt + ]; platforms = [ "x86_64-linux" ]; }; };