Unverified Commit e6f9181e authored by Pol Dellaiera's avatar Pol Dellaiera Committed by GitHub
Browse files

xed: 2024.02.22 -> 2025.03.02 (#414637)

parents 72caf3ac 10606ff1
Loading
Loading
Loading
Loading
+52 −16
Original line number Diff line number Diff line
@@ -4,56 +4,92 @@
  fetchFromGitHub,
  python3Packages,
  llvmPackages,
  installShellFiles,
  nix-update-script,
}:

let
  # mbuild is a custom build system used only to build xed
  mbuild = python3Packages.buildPythonPackage rec {
    pname = "mbuild";
    version = "2022.07.28";
    version = "2024.11.04";

    src = fetchFromGitHub {
      owner = "intelxed";
      repo = "mbuild";
      rev = "v${version}";
      sha256 = "sha256-nVHHiaPbf+b+RntjUGjLLGS53e6c+seXIBx7AcTtiWU=";
      tag = "v${version}";
      hash = "sha256-iQVykBG3tEPxI1HmqBkvO1q+K8vi64qBfVC63/rcTOk=";
    };

    meta = {
      description = "Python-based build system used for building XED";
      homepage = "https://github.com/intelxed/mbuild";
      license = lib.licenses.asl20;
    };
  };

in
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
  pname = "xed";
  version = "2024.02.22";
  version = "2025.03.02";

  src = fetchFromGitHub {
    owner = "intelxed";
    repo = "xed";
    rev = "v${version}";
    sha256 = "sha256-LF4iJ1/Z3OifCiir/kU3ufZqtiRLeaJeAwuBqP2BCF4=";
    tag = "v${finalAttrs.version}";
    hash = "sha256-shQYgbUC06+x+3TNdOJA6y6Wea/8lqexkgBWk3AOOMA=";
  };

  postPatch = ''
    patchShebangs mfile.py
  '';

  nativeBuildInputs = [
    mbuild
    installShellFiles
  ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ llvmPackages.bintools ];

  buildPhase = ''
    patchShebangs mfile.py
    runHook preBuild

    # this will build, test and install
    ./mfile.py test --prefix $out

    runHook postBuild
  '';

  checkPhase = ''
    runHook preCheck

    ./mfile.py examples
    mkdir -p $out/bin
    cp ./obj/wkit/examples/obj/xed $out/bin/

    runHook postCheck
  '';

  installPhase = ''
    runHook preInstall

    installBin obj/wkit/examples/obj/xed

    runHook postInstall
  '';

  dontInstall = true; # already installed during buildPhase
  passthru = {
    inherit mbuild;
    updateScript = nix-update-script {
      extraArgs = [
        "--subpackage"
        "mbuild"
      ];
    };
  };

  meta = with lib; {
  meta = {
    broken = stdenv.hostPlatform.isAarch64;
    description = "Intel X86 Encoder Decoder (Intel XED)";
    homepage = "https://intelxed.github.io/";
    license = licenses.asl20;
    platforms = platforms.unix;
    maintainers = with maintainers; [ arturcygan ];
    license = lib.licenses.asl20;
    platforms = lib.platforms.unix;
    maintainers = with lib.maintainers; [ arturcygan ];
  };
}
})