Unverified Commit f0439165 authored by Anderson Torres's avatar Anderson Torres Committed by GitHub
Browse files

Merge pull request #211791 from athre0z/zydis-split-zycore

zydis: split zycore into separate derivation
parents 0a454a30 08fc58fc
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1330,6 +1330,12 @@
    githubId = 55833;
    name = "Troels Henriksen";
  };
  athre0z = {
    email = "joel@zyantific.com";
    github = "athre0z";
    githubId = 6553158;
    name = "Joel Höner";
  };
  atila = {
    name = "Átila Saraiva";
    email = "atilasaraiva@gmail.com";
+27 −5
Original line number Diff line number Diff line
{ lib
, stdenv
, fetchFromGitHub
, callPackage
, cmake
, python3
}:

let
  zycore = callPackage ./zycore.nix {
    inherit stdenv fetchFromGitHub cmake;
  };
in
stdenv.mkDerivation rec {
  pname = "zydis";
  version = "4.0.0";
@@ -12,19 +19,34 @@ stdenv.mkDerivation rec {
    owner = "zyantific";
    repo = "zydis";
    rev = "v${version}";
    fetchSubmodules = true;
    sha256 = "sha256-WSBi8HUVj/JR0/0pBoEaUKD0kOk41gSW5ZW74fn8b4k=";
    hash = "sha256-/no/8FNa5LlwhZMSMao4/cwZk6GlamLjqr+isbh6tEI=";
  };

  nativeBuildInputs = [
    cmake
  nativeBuildInputs = [ cmake ];
  buildInputs = [ zycore ];
  cmakeFlags = [
    "-DZYAN_SYSTEM_ZYCORE=ON"
    "-DCMAKE_INSTALL_LIBDIR=lib"
    "-DCMAKE_INSTALL_INCLUDEDIR=include"
  ];

  doCheck = true;
  checkInputs = [ python3 ];
  checkPhase = ''
    pushd ../tests
    python3 ./regression.py test ../build/ZydisInfo
    python3 ./regression_encoder.py \
      ../build/Zydis{Fuzz{ReEncoding,Encoder},TestEncoderAbsolute}
    popd
  '';

  passthru = { inherit zycore; };

  meta = with lib; {
    homepage = "https://zydis.re/";
    description = "Fast and lightweight x86/x86-64 disassembler library";
    license = licenses.mit;
    maintainers = with maintainers; [ jbcrail AndersonTorres ];
    maintainers = with maintainers; [ jbcrail AndersonTorres athre0z ];
    platforms = platforms.all;
  };
}
+25 −0
Original line number Diff line number Diff line
{ stdenv
, fetchFromGitHub
, cmake
}:

stdenv.mkDerivation rec {
  pname = "zycore";
  version = "1.4.1";

  src = fetchFromGitHub {
    owner = "zyantific";
    repo = "zycore-c";
    rev = "v${version}";
    hash = "sha256-kplUgrYecymGxz92tEU6H+NNtcN/Ao/tmmqdVo2c7HA=";
  };

  nativeBuildInputs = [ cmake ];

  # The absolute paths set by the Nix CMake build manager confuse
  # Zycore's config generation (which appends them to the package path).
  cmakeFlags = [
    "-DCMAKE_INSTALL_LIBDIR=lib"
    "-DCMAKE_INSTALL_INCLUDEDIR=include"
  ];
}