From 65e4d135543d07c78db1a4a7f7ecdfe70b0785bc Mon Sep 17 00:00:00 2001
From: Adam Joseph <adam@westernsemico.com>
Date: Wed, 3 Aug 2022 04:27:36 -0700
Subject: [PATCH] arm-trusted-firmware: remove version parameter

The arm-trusted-firmware/default.nix expression exposes
`buildArmTrustedFirmware` and its `version?"2.7"` field to
`top-level/all-packages.nix`.  Unfortunately it doesn't work.
Changing the version field doesn't change what version of the ATF
source code is used.  Attempting to "lock" an installation to a
specific version by overriding this field (e.g. version="2.7") won't
work either; when nixpkgs bumps the version to 2.8 the user will end
up building the 2.8 source code but the resulting expression will be
labeled misleadingly in the store:

```
  /nix/store/eeee...-arm-trusted-firmware-2.7/
```

**using the 2.8 source code**.  So not only does `version` not lock
the version, it will actually *conceal* the fact that the underlying
source code has been upgraded!

Let's just remove the `version` field.  It doesn't work and never did.

https://github.com/NixOS/nixpkgs/pull/185004#discussion_r939526830

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
---
 pkgs/misc/arm-trusted-firmware/default.nix | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/pkgs/misc/arm-trusted-firmware/default.nix b/pkgs/misc/arm-trusted-firmware/default.nix
index f523727d0211..9531324b14a9 100644
--- a/pkgs/misc/arm-trusted-firmware/default.nix
+++ b/pkgs/misc/arm-trusted-firmware/default.nix
@@ -17,17 +17,16 @@ let
             , platformCanUseHDCPBlob ? false  # set this to true if the platform is able to use hdcp.bin
             , extraMakeFlags ? []
             , extraMeta ? {}
-            , version ? "2.7"
             , ... } @ args:
 
            # delete hdcp.bin if either: the platform is thought to
            # not need it or unfreeIncludeHDCPBlob is false
            let deleteHDCPBlobBeforeBuild = !platformCanUseHDCPBlob || !unfreeIncludeHDCPBlob; in
 
-           stdenv.mkDerivation ({
+           stdenv.mkDerivation (rec {
 
     pname = "arm-trusted-firmware${lib.optionalString (platform != null) "-${platform}"}";
-    inherit version;
+    version = "2.7";
 
     src = fetchFromGitHub {
       owner = "ARM-software";