about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/zydis
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-06-16 06:56:35 +0000
committerAlyssa Ross <hi@alyssa.is>2023-06-16 06:56:35 +0000
commit99fcaeccb89621dd492203ce1f2d551c06f228ed (patch)
tree41cb730ae07383004789779b0f6e11cb3f4642a3 /nixpkgs/pkgs/development/libraries/zydis
parent59c5f5ac8682acc13bb22bc29c7cf02f7d75f01f (diff)
parent75a5ebf473cd60148ba9aec0d219f72e5cf52519 (diff)
downloadnixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar
nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.gz
nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.bz2
nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.lz
nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.xz
nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.zst
nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.zip
Merge branch 'nixos-unstable' of https://github.com/NixOS/nixpkgs
Conflicts:
	nixpkgs/nixos/modules/config/console.nix
	nixpkgs/nixos/modules/services/mail/mailman.nix
	nixpkgs/nixos/modules/services/mail/public-inbox.nix
	nixpkgs/nixos/modules/services/mail/rss2email.nix
	nixpkgs/nixos/modules/services/networking/ssh/sshd.nix
	nixpkgs/pkgs/applications/networking/instant-messengers/dino/default.nix
	nixpkgs/pkgs/applications/networking/irc/weechat/default.nix
	nixpkgs/pkgs/applications/window-managers/sway/default.nix
	nixpkgs/pkgs/build-support/go/module.nix
	nixpkgs/pkgs/build-support/rust/build-rust-package/default.nix
	nixpkgs/pkgs/development/interpreters/python/default.nix
	nixpkgs/pkgs/development/node-packages/overrides.nix
	nixpkgs/pkgs/development/tools/b4/default.nix
	nixpkgs/pkgs/servers/dict/dictd-db.nix
	nixpkgs/pkgs/servers/mail/public-inbox/default.nix
	nixpkgs/pkgs/tools/security/pinentry/default.nix
	nixpkgs/pkgs/tools/text/unoconv/default.nix
	nixpkgs/pkgs/top-level/all-packages.nix
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/zydis')
-rw-r--r--nixpkgs/pkgs/development/libraries/zydis/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/zydis/zycore.nix25
2 files changed, 53 insertions, 6 deletions
diff --git a/nixpkgs/pkgs/development/libraries/zydis/default.nix b/nixpkgs/pkgs/development/libraries/zydis/default.nix
index 7009123a4528..e889d92273ef 100644
--- a/nixpkgs/pkgs/development/libraries/zydis/default.nix
+++ b/nixpkgs/pkgs/development/libraries/zydis/default.nix
@@ -1,30 +1,52 @@
 { lib
 , stdenv
 , fetchFromGitHub
+, callPackage
 , cmake
+, python3
 }:
 
+let
+  zycore = callPackage ./zycore.nix {
+    inherit stdenv fetchFromGitHub cmake;
+  };
+in
 stdenv.mkDerivation rec {
   pname = "zydis";
-  version = "3.2.1";
+  version = "4.0.0";
 
   src = fetchFromGitHub {
     owner = "zyantific";
     repo = "zydis";
     rev = "v${version}";
-    fetchSubmodules = true;
-    sha256 = "sha256-FB7hGQ9vI3ZE376iROEpdtZm91IiccBhtAFa94JgnUY=";
+    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;
+  nativeCheckInputs = [ 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;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/zydis/zycore.nix b/nixpkgs/pkgs/development/libraries/zydis/zycore.nix
new file mode 100644
index 000000000000..c0ad668d1227
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/zydis/zycore.nix
@@ -0,0 +1,25 @@
+{ 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"
+  ];
+}