From 0396be8262c4507b83eb9dbc1b101621ca4fa7b7 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 22 Sep 2024 20:14:51 -0300 Subject: [PATCH] ophis: refactor - get rid of python3Packages.callPackage - get rid of rec - fix version format --- pkgs/development/compilers/ophis/default.nix | 66 ++++++++++++-------- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 40 insertions(+), 28 deletions(-) diff --git a/pkgs/development/compilers/ophis/default.nix b/pkgs/development/compilers/ophis/default.nix index e1945c9b2802..43febd6002bf 100644 --- a/pkgs/development/compilers/ophis/default.nix +++ b/pkgs/development/compilers/ophis/default.nix @@ -1,30 +1,42 @@ -{ lib, buildPythonApplication, fetchFromGitHub }: +{ + lib, + fetchFromGitHub, + python3Packages, + unstableGitUpdater, +}: -buildPythonApplication rec { - pname = "ophis"; - version = "unstable-2019-04-13"; +let + self = python3Packages.buildPythonApplication { + pname = "ophis"; + version = "0-unstable-2019-04-13"; - src = fetchFromGitHub { - owner = "michaelcmartin"; - repo = "Ophis"; - rev = "99f074da278d4ec80689c0e22e20c5552ea12512"; - sha256 = "2x8vwLTSngqQqmVrVh/mM4peATgaRqOSwrfm5XCkg/g="; + src = fetchFromGitHub { + owner = "michaelcmartin"; + repo = "Ophis"; + rev = "99f074da278d4ec80689c0e22e20c5552ea12512"; + hash = "sha256-2x8vwLTSngqQqmVrVh/mM4peATgaRqOSwrfm5XCkg/g="; + }; + + sourceRoot = "${self.src.name}/src"; + + passthru = { + updateScript = unstableGitUpdater { }; + }; + + meta = { + homepage = "http://michaelcmartin.github.io/Ophis/"; + description = "Cross-assembler for the 6502 series of microprocessors"; + longDescription = '' + Ophis is an assembler for the 6502 microprocessor - the famous chip used + in the vast majority of the classic 8-bit computers and consoles. Its + primary design goals are code readability and output flexibility - Ophis + has successfully been used to create programs for the Nintendo + Entertainment System, the Atari 2600, and the Commodore 64. + ''; + license = lib.licenses.mit; + mainProgram = "ophis"; + maintainers = with lib.maintainers; [ AndersonTorres ]; + }; }; - - sourceRoot = "${src.name}/src"; - - meta = with lib; { - homepage = "http://michaelcmartin.github.io/Ophis/"; - description = "Cross-assembler for the 6502 series of microprocessors"; - mainProgram = "ophis"; - longDescription = '' - Ophis is an assembler for the 6502 microprocessor - the famous chip used - in the vast majority of the classic 8-bit computers and consoles. Its - primary design goals are code readability and output flexibility - Ophis - has successfully been used to create programs for the Nintendo - Entertainment System, the Atari 2600, and the Commodore 64. - ''; - license = licenses.mit; - maintainers = with maintainers; [ AndersonTorres ]; - }; -} +in +self diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 7e806f98b32b..bd0998b9b288 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4647,7 +4647,7 @@ with pkgs; ophcrack-cli = ophcrack.override { enableGui = false; }; - ophis = python3Packages.callPackage ../development/compilers/ophis { }; + ophis = callPackage ../development/compilers/ophis { }; open-interpreter = with python3Packages; toPythonApplication open-interpreter;