From 681f4fa861d66b67a2be836e2b2b3930c7042f71 Mon Sep 17 00:00:00 2001 From: Henner Zeller Date: Wed, 24 Jul 2024 18:38:39 -0700 Subject: [PATCH] z88dk: run nixfmt and apply finalAttrs pattern. No other change. --- pkgs/development/compilers/z88dk/default.nix | 45 +++++++++++++++----- 1 file changed, 35 insertions(+), 10 deletions(-) diff --git a/pkgs/development/compilers/z88dk/default.nix b/pkgs/development/compilers/z88dk/default.nix index cd95406c84d8..dbc23f6b2649 100644 --- a/pkgs/development/compilers/z88dk/default.nix +++ b/pkgs/development/compilers/z88dk/default.nix @@ -1,13 +1,25 @@ -{ fetchFromGitHub, lib, stdenv, makeWrapper, unzip, libxml2, gmp, m4, uthash, which, pkg-config }: +{ + fetchFromGitHub, + lib, + stdenv, + makeWrapper, + unzip, + libxml2, + gmp, + m4, + uthash, + which, + pkg-config, +}: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "z88dk"; version = "2.3"; src = fetchFromGitHub { owner = "z88dk"; repo = "z88dk"; - rev = "v${version}"; + rev = "v${finalAttrs.version}"; hash = "sha256-CHTORgK6FYIO6n+cvTUX4huY2Ek5FuHrs40QN5NZX44="; fetchSubmodules = true; }; @@ -32,22 +44,35 @@ stdenv.mkDerivation rec { #_FORTIFY_SOURCE requires compiling with optimization (-O) env.NIX_CFLAGS_COMPILE = "-O"; - short_rev = builtins.substring 0 7 src.rev; + short_rev = builtins.substring 0 7 finalAttrs.src.rev; makeFlags = [ - "git_rev=${short_rev}" - "version=${version}" + "git_rev=${finalAttrs.short_rev}" + "version=${finalAttrs.version}" "DESTDIR=$(out)" "git_count=0" ]; - nativeBuildInputs = [ which makeWrapper unzip pkg-config ]; - buildInputs = [ libxml2 m4 uthash gmp ]; + nativeBuildInputs = [ + which + makeWrapper + unzip + pkg-config + ]; + buildInputs = [ + libxml2 + m4 + uthash + gmp + ]; preInstall = '' mkdir -p $out/{bin,share} ''; - installTargets = [ "libs" "install" ]; + installTargets = [ + "libs" + "install" + ]; meta = with lib; { homepage = "https://www.z88dk.org"; @@ -56,4 +81,4 @@ stdenv.mkDerivation rec { maintainers = [ maintainers.siraben ]; platforms = platforms.unix; }; -} +})