2021-01-11 08:54:33 +01:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, ninja, pkgconfig, python3Packages
|
2020-01-04 17:56:05 +01:00
|
|
|
, boost, rapidjson, qtbase, qtsvg, igraph, spdlog, wrapQtAppsHook
|
2020-12-11 23:02:45 +01:00
|
|
|
, fmt, graphviz, llvmPackages ? null
|
2020-01-04 17:56:05 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2020-12-11 23:02:45 +01:00
|
|
|
version = "3.1.9";
|
2020-01-04 17:56:05 +01:00
|
|
|
pname = "hal-hardware-analyzer";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "emsec";
|
|
|
|
repo = "hal";
|
|
|
|
rev = "v${version}";
|
2020-12-11 23:02:45 +01:00
|
|
|
sha256 = "0yvvlx0hq73x20va4csa8kyx3x4z648s6l6qqirzjpmxa1w91xc6";
|
2020-01-04 17:56:05 +01:00
|
|
|
};
|
|
|
|
# make sure bundled dependencies don't get in the way - install also otherwise
|
|
|
|
# copies them in full to the output, bloating the package
|
|
|
|
postPatch = ''
|
2020-12-11 23:02:45 +01:00
|
|
|
shopt -s extglob
|
|
|
|
rm -rf deps/!(sanitizers-cmake)/*
|
|
|
|
shopt -u extglob
|
2020-01-04 17:56:05 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ninja pkgconfig ];
|
2020-12-11 23:02:45 +01:00
|
|
|
buildInputs = [ qtbase qtsvg boost rapidjson igraph spdlog fmt graphviz wrapQtAppsHook ]
|
2020-01-04 17:56:05 +01:00
|
|
|
++ (with python3Packages; [ python pybind11 ])
|
|
|
|
++ stdenv.lib.optional stdenv.cc.isClang llvmPackages.openmp;
|
|
|
|
|
|
|
|
cmakeFlags = with stdenv.lib.versions; [
|
|
|
|
"-DHAL_VERSION_RETURN=${version}"
|
|
|
|
"-DHAL_VERSION_MAJOR=${major version}"
|
|
|
|
"-DHAL_VERSION_MINOR=${minor version}"
|
|
|
|
"-DHAL_VERSION_PATCH=${patch version}"
|
|
|
|
"-DHAL_VERSION_TWEAK=0"
|
|
|
|
"-DHAL_VERSION_ADDITIONAL_COMMITS=0"
|
|
|
|
"-DHAL_VERSION_DIRTY=false"
|
|
|
|
"-DHAL_VERSION_BROKEN=false"
|
|
|
|
"-DENABLE_INSTALL_LDCONFIG=off"
|
|
|
|
"-DBUILD_ALL_PLUGINS=on"
|
|
|
|
];
|
|
|
|
# needed for macos build - this is why we use wrapQtAppsHook instead of
|
|
|
|
# the qt mkDerivation - the latter forcibly overrides this.
|
|
|
|
cmakeBuildType = "MinSizeRel";
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2020-01-04 17:56:05 +01:00
|
|
|
description = "A comprehensive reverse engineering and manipulation framework for gate-level netlists";
|
|
|
|
homepage = "https://github.com/emsec/hal";
|
2020-12-09 20:53:17 +01:00
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ ris shamilton ];
|
2020-01-04 17:56:05 +01:00
|
|
|
};
|
|
|
|
}
|