Unverified Commit 2b5b3460 authored by Christina Sørensen's avatar Christina Sørensen Committed by GitHub
Browse files

Merge pull request #323501 from eclairevoyant/imhex-fix

imhex: 1.33.2 -> 1.35.3; fix RUNPATH and formatting
parents 8b41a1a2 3728d33b
Loading
Loading
Loading
Loading
+53 −29
Original line number Diff line number Diff line
{ lib
, stdenv
, cmake
, llvm
, fetchFromGitHub
, mbedtls
, gtk3
, pkg-config
, capstone
, dbus
, libGLU
, glfw3
, file
, perl
, python3
, jansson
, curl
, fmt_8
, nlohmann_json
, yara
, rsync
{
  lib,
  stdenv,
  cmake,
  llvm,
  fetchFromGitHub,
  mbedtls,
  gtk3,
  pkg-config,
  capstone,
  dbus,
  libGLU,
  libGL,
  glfw3,
  file,
  perl,
  python3,
  jansson,
  curl,
  fmt_8,
  nlohmann_json,
  yara,
  rsync,
  autoPatchelfHook,
}:

let
  version = "1.33.2";
  patterns_version = "1.33.2";
  version = "1.35.3";
  patterns_version = "1.35.3";

  patterns_src = fetchFromGitHub {
    name = "ImHex-Patterns-source-${patterns_version}";
    owner = "WerWolv";
    repo = "ImHex-Patterns";
    rev = "ImHex-v${patterns_version}";
    hash = "sha256-5a6aFT8R8vMzPS+Y+fcDV5+olhioEpLjdMqa7qOyGsw=";
    hash = "sha256-h86qoFMSP9ehsXJXOccUK9Mfqe+DVObfSRT4TCtK0rY=";
  };

in
@@ -38,14 +42,23 @@ stdenv.mkDerivation rec {
  inherit version;

  src = fetchFromGitHub {
    name = "ImHex-source-${version}";
    fetchSubmodules = true;
    owner = "WerWolv";
    repo = pname;
    rev = "v${version}";
    hash = "sha256-8Ehpk0TjE4itQ7D9Nx74plYwABVufuYmxfxyuSqak1c=";
    repo = "ImHex";
    rev = "refs/tags/v${version}";
    hash = "sha256-8vhOOHfg4D9B9yYgnGZBpcjAjuL4M4oHHax9ad5PJtA=";
  };

  nativeBuildInputs = [ cmake llvm python3 perl pkg-config rsync ];
  nativeBuildInputs = [
    autoPatchelfHook
    cmake
    llvm
    python3
    perl
    pkg-config
    rsync
  ];

  buildInputs = [
    capstone
@@ -62,6 +75,14 @@ stdenv.mkDerivation rec {
    yara
  ];

  # autoPatchelfHook only searches for *.so and *.so.*, and won't find *.hexpluglib
  # however, we will append to RUNPATH ourselves
  autoPatchelfIgnoreMissingDeps = [ "*.hexpluglib" ];
  appendRunpaths = [
    (lib.makeLibraryPath [ libGL ])
    "${placeholder "out"}/lib/imhex/plugins"
  ];

  cmakeFlags = [
    "-DIMHEX_OFFLINE_BUILD=ON"
    "-DUSE_SYSTEM_CAPSTONE=ON"
@@ -82,7 +103,10 @@ stdenv.mkDerivation rec {
    description = "Hex Editor for Reverse Engineers, Programmers and people who value their retinas when working at 3 AM";
    homepage = "https://github.com/WerWolv/ImHex";
    license = with licenses; [ gpl2Only ];
    maintainers = with maintainers; [ kashw2 cafkafk ];
    maintainers = with maintainers; [
      kashw2
      cafkafk
    ];
    platforms = platforms.linux;
  };
}