Unverified Commit 2a59d430 authored by Nick Cao's avatar Nick Cao Committed by GitHub
Browse files

Merge pull request #241437 from dasisdormax/astc-encoder-update-4.5.0

astc-encoder: 4.4.0 -> 4.5.0
parents 74174ea5 39762cef
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -16,11 +16,9 @@ with rec {
    else if isAarch64 then [ "NEON" ]
    else [ "NONE" ];

  archFlags = lib.optionals stdenv.hostPlatform.isAarch64 [ "-DARCH=aarch64" ];

  # CMake Build flags for the selected ISAs. For a list of flags, see
  # https://github.com/ARM-software/astc-encoder/blob/main/Docs/Building.md
  isaFlags = map ( isa: "-DISA_${isa}=ON" ) isas;
  isaFlags = map ( isa: "-DASTCENC_ISA_${isa}=ON" ) isas;

  # The suffix of the binary to link as 'astcenc'
  mainBinary = builtins.replaceStrings
@@ -31,25 +29,26 @@ with rec {

stdenv.mkDerivation rec {
  pname = "astc-encoder";
  version = "4.4.0";
  version = "4.5.0";

  src = fetchFromGitHub {
    owner = "ARM-software";
    repo = "astc-encoder";
    rev = version;
    sha256 = "sha256-pJmMquORG+vN2uLPywAZY1iZTuHB4SdMP/eriAjnyUU=";
    sha256 = "sha256-pNoBOp//xa5F6/T1cwtdHsAWLZeIHgxZ7UKaB60fg4M=";
  };

  nativeBuildInputs = [ cmake ];

  cmakeFlags = isaFlags ++ archFlags ++ [
  cmakeFlags = isaFlags ++ [
    "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
    "-DASTCENC_UNIVERSAL_BUILD=OFF"
  ];

  # Set a fixed build year to display within help output (otherwise, it would be 1980)
  postPatch = ''
    substituteInPlace Source/cmake_core.cmake \
      --replace 'string(TIMESTAMP astcencoder_YEAR "%Y")' 'set(astcencoder_YEAR "2022")'
      --replace 'string(TIMESTAMP astcencoder_YEAR "%Y")' 'set(astcencoder_YEAR "2023")'
  '';

  # Provide 'astcenc' link to main executable