about summary refs log tree commit diff
path: root/pkgs/tools/archivers
diff options
context:
space:
mode:
authorThiago Kenji Okada <thiagokokada@gmail.com>2022-04-19 00:39:09 +0100
committerThiago Kenji Okada <thiagokokada@gmail.com>2022-04-19 01:01:32 +0100
commit21a40059dd8dd97d90941150854432b39f0445c0 (patch)
treefdf3d874039f688d9d000b1ca92cb2238b39cb8e /pkgs/tools/archivers
parente277cf18e20f40b69a8a54af183b8218a7daa74a (diff)
_7zz: useUasm only in x86 platforms
`uasm` is x86 only.

It seems that in `aarch64-linux` at least, the optimizing build is done
without using any third-party tool (maybe using GCC's own assembly?).
Diffstat (limited to 'pkgs/tools/archivers')
-rw-r--r--pkgs/tools/archivers/7zz/default.nix38
1 files changed, 19 insertions, 19 deletions
diff --git a/pkgs/tools/archivers/7zz/default.nix b/pkgs/tools/archivers/7zz/default.nix
index 79fe9a07c63a9..03c95378a0ae9 100644
--- a/pkgs/tools/archivers/7zz/default.nix
+++ b/pkgs/tools/archivers/7zz/default.nix
@@ -2,23 +2,27 @@
 , lib
 , fetchurl
 
+  # Only used for x86/x86_64
 , uasm
-, useUasm ? stdenv.isLinux
+, useUasm ? stdenv.hostPlatform.isx86
 
   # RAR code is under non-free unRAR license
   # see the meta.license section below for more details
 , enableUnfree ? false
+
+  # For tests
+, _7zz
+, testVersion
 }:
 
 let
   inherit (stdenv.hostPlatform) system;
-  platformSuffix =
-    lib.optionalString useUasm {
-      aarch64-linux = "_arm64";
-      i686-linux = "_x86";
-      x86_64-linux = "_x64";
-    }.${system} or
-      (builtins.trace "7zz's ASM optimizations not available for `${system}`. Building without optimizations." "");
+  platformSuffix = {
+    aarch64-linux = "_arm64";
+    i686-linux = "_x86";
+    x86_64-linux = "_x64";
+  }.${system} or
+    (builtins.trace "`platformSuffix` not available for `${system}.` Making a generic `7zz` build." "");
 in
 stdenv.mkDerivation rec {
   pname = "7zz";
@@ -73,17 +77,13 @@ stdenv.mkDerivation rec {
     runHook postInstall
   '';
 
-  doInstallCheck = true;
-
-  installCheckPhase = ''
-    runHook preInstallCheck
-
-    $out/bin/7zz --help | grep ${version}
-
-    runHook postInstallCheck
-  '';
-
-  passthru.updateScript = ./update.sh;
+  passthru = {
+    updateScript = ./update.sh;
+    tests.version = testVersion {
+      package = _7zz;
+      command = "7zz --help";
+    };
+  };
 
   meta = with lib; {
     description = "Command line archiver utility";