Unverified Commit 16d96845 authored by nixpkgs-ci[bot]'s avatar nixpkgs-ci[bot] Committed by GitHub
Browse files

Merge master into staging-nixos

parents ef01295e 2f1947e1
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ symlinkJoin {
  };

  meta = wayfire.meta // {
    outputsToInstall = [ "out" ];
    # To prevent builds on hydra
    hydraPlatforms = [ ];
    # prefer wrapper over the package
+3 −3
Original line number Diff line number Diff line
@@ -5,15 +5,15 @@
}:
let
  pname = "ankama-launcher";
  version = "3.13.16";
  version = "3.13.18";

  # The original URL for the launcher is:
  # https://launcher.cdn.ankama.com/installers/production/Ankama%20Launcher-Setup-x86_64.AppImage
  # As it does not encode the version, we use the wayback machine (web.archive.org) to get a fixed URL.
  # To update the client, head to web.archive.org and create a new snapshot of the download page.
  src = fetchurl {
    url = "https://web.archive.org/web/20250906013556/https://launcher.cdn.ankama.com/installers/production/Ankama%20Launcher-Setup-x86_64.AppImage";
    hash = "sha256-wG7xg6uQJsdJR9Xu2T9PCVQb+LSyO10BveGftOrc2Uo=";
    url = "https://web.archive.org/web/20251121131316/https://launcher.cdn.ankama.com/installers/production/Ankama%20Launcher-Setup-x86_64.AppImage";
    hash = "sha256-0GI3qBt/hwRqmfvg817C5IiD8s9AYzTX6w2UAmyR02I=";
  };

  appimageContents = appimageTools.extract { inherit pname version src; };
+101 −0
Original line number Diff line number Diff line
diff --git a/tests/test_support/audio_support.cc b/tests/test_support/audio_support.cc
index c26022e9..5f50d035 100644
--- a/tests/test_support/audio_support.cc
+++ b/tests/test_support/audio_support.cc
@@ -16,6 +16,7 @@
 // along with arc_unpacker. If not, see <http://www.gnu.org/licenses/>.
 
 #include "test_support/audio_support.h"
+#include <cstdlib>
 #include "algo/format.h"
 #include "algo/range.h"
 #include "dec/microsoft/wav_audio_decoder.h"
@@ -44,13 +45,42 @@ res::Audio tests::get_test_audio()
 void tests::compare_audio(
     const res::Audio &actual, const res::Audio &expected)
 {
+    // Allow for minor variances in audio samples within the specified
+    // threshold. Floating point calculations in some audio decoders yields
+    // slightly differing results across different CPU architectures.
+    //
+    // Affected tests:
+    //   * tests/dec/cri/hca_audio_decoder_test.cc
+    //   * tests/dec/entis/mio_audio_decoder_test.cc
+    static constexpr int tolerance = 1;
+
     REQUIRE(actual.codec == expected.codec);
     REQUIRE(actual.channel_count == expected.channel_count);
     REQUIRE(actual.sample_rate == expected.sample_rate);
     REQUIRE(actual.bits_per_sample == expected.bits_per_sample);
     REQUIRE(actual.extra_codec_headers == expected.extra_codec_headers);
     REQUIRE(actual.samples.size() == expected.samples.size());
+
+#ifdef __x86_64__
     tests::compare_binary(actual.samples, expected.samples);
+#else
+    tests::compare_binary(
+      actual.samples,
+      expected.samples,
+      [](const bstr& bytes1, const bstr& bytes2) -> bool {
+        const auto samples1 = reinterpret_cast<const s16*>(bytes1.c_str());
+        const auto samples2 = reinterpret_cast<const s16*>(bytes2.c_str());
+        const auto n_samples = bytes1.size() / sizeof(*samples1);
+        // algo::range is a bit incomplete to work with std::all_of
+        for (const int i : algo::range(n_samples)) {
+          if (std::abs(samples1[i] - samples2[i]) > tolerance) {
+            return false;
+          }
+        }
+        return true;
+      }
+    );
+#endif
 
     REQUIRE(actual.loops.size() == expected.loops.size());
     for (const auto i : algo::range(expected.loops.size()))
diff --git a/tests/test_support/common.cc b/tests/test_support/common.cc
index b63ffa89..265ef7b1 100644
--- a/tests/test_support/common.cc
+++ b/tests/test_support/common.cc
@@ -40,3 +40,19 @@ void au::tests::compare_binary(const bstr &actual, const bstr &expected)
     INFO(actual_dump << " != " << expected_dump);
     REQUIRE(actual == expected);
 }
+
+void au::tests::compare_binary(
+    const bstr &actual,
+    const bstr &expected,
+    std::function<bool(const bstr &, const bstr &)> compare)
+{
+    const auto max_size = 10000;
+    auto actual_dump = algo::hex(actual);
+    auto expected_dump = algo::hex(expected);
+    if (actual_dump.size() > max_size)
+        actual_dump = actual_dump.substr(0, max_size) + "(...)";
+    if (expected_dump.size() > max_size)
+        expected_dump = expected_dump.substr(0, max_size) + "(...)";
+    INFO(actual_dump << " != " << expected_dump);
+    REQUIRE(compare(actual, expected));
+}
diff --git a/tests/test_support/common.h b/tests/test_support/common.h
index 7d8be579..ecd5dcf8 100644
--- a/tests/test_support/common.h
+++ b/tests/test_support/common.h
@@ -17,6 +17,7 @@
 
 #pragma once
 
+#include <functional>
 #include "io/path.h"
 #include "types.h"
 
@@ -27,4 +28,9 @@ namespace tests {
 
     void compare_binary(const bstr &actual, const bstr &expected);
 
+    void compare_binary(
+        const bstr &actual,
+        const bstr &expected,
+        std::function<bool(const bstr &, const bstr &)> compare);
+
 } }
+29 −24
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@
  fetchpatch,
  cmake,
  makeWrapper,
  ninja,
  boost,
  libpng,
  libiconv,
@@ -26,22 +27,14 @@ stdenv.mkDerivation {
    hash = "sha256-STbdWH7Mr3gpOrZvujblYrIIKEWBHzy1/BaNuh4teI8=";
  };

  patches = [
    (fetchpatch {
      name = "failing_tests.patch";
      url = "https://aur.archlinux.org/cgit/aur.git/plain/failing_tests.patch?h=arc_unpacker-git&id=bda1ad9f69e6802e703b2e6913d71a36d76cfef9";
      hash = "sha256-bClACsf/+SktyLAPtt7EcSqprkw8JVIi1ZLpcJcv9IE=";
    })
    (fetchpatch {
      name = "include_cstdint.patch";
      url = "https://aur.archlinux.org/cgit/aur.git/plain/include_cstdint.patch?h=arc_unpacker-git&id=8c5c5121b23813c7650db19cb617b409d8fdcc9f";
      hash = "sha256-3BQ1v7s9enUK/js7Jqrqo2RdSRvGVd7hMcY4iL51SiE=";
    })
  ];
  patches = [ ./fix-test-float-variance.patch ];

  postPatch = ''
    cp ${catch2}/include/catch2/catch.hpp tests/test_support/catch.h

    # missing includes
    sed '1i#include <limits>' -i src/dec/eagls/pak_archive_decoder.cc # gcc12
    sed '1i#include <cstdint>' -i src/types.h # gcc13
    sed '1i#include <vector>' -i src/flow/cli_facade.h # gcc14

    # cmake-4 support
@@ -53,6 +46,7 @@ stdenv.mkDerivation {
  nativeBuildInputs = [
    cmake
    makeWrapper
    ninja
    catch2
  ];

@@ -66,11 +60,26 @@ stdenv.mkDerivation {
    zlib
  ];

  checkPhase = ''
  checkPhase =
    let
      checkTarget = [
        "~CatSystem INT archives"
      ]
      ++ lib.optionals (stdenv.hostPlatform.system == "aarch64-linux") [ "~Ivory WADY audio" ];
    in
    ''
      # Specify test targets
      # https://catch2-temp.readthedocs.io/en/latest/command-line.html#specifying-which-tests-to-run
      checkTarget=(${lib.escapeShellArgs checkTarget})

      runHook preCheck

      local flagsArray=()
      concatTo flagsArray checkFlags checkFlagsArray checkTarget

      pushd ..
    ./build/run_tests
      echoCmd 'check flags' "''${flagsArray[@]}"
      ./build/run_tests "''${flagsArray[@]}"
      popd

      runHook postCheck
@@ -88,8 +97,7 @@ stdenv.mkDerivation {
    runHook postInstall
  '';

  # A few tests fail on aarch64-linux
  doCheck = !(stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64);
  doCheck = true;

  meta = with lib; {
    description = "Tool to extract files from visual novel archives";
@@ -98,8 +106,5 @@ stdenv.mkDerivation {
    maintainers = with maintainers; [ midchildan ];
    platforms = platforms.all;
    mainProgram = "arc_unpacker";

    # unit test failures
    broken = stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64;
  };
}
+2 −0
Original line number Diff line number Diff line
@@ -35,6 +35,8 @@ stdenv.mkDerivation rec {

  postPatch = ''
    substituteInPlace CMakeLists.txt \
      --replace-fail "cmake_minimum_required(VERSION 3.3.0 FATAL_ERROR)" \
                     "cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)" \
      --replace-fail "find_program ( SED NAMES gsed" "find_program ( SED NAMES sed"
  '';

Loading