From f54875f90e7e32922e1be4599feacdd31cc8833f Mon Sep 17 00:00:00 2001 From: "Travis A. Everett" Date: Mon, 12 Feb 2024 23:54:24 -0600 Subject: [PATCH] resholve: partially fix cross-compilation oildev has been using a pinned re2c based on what oil uses upstream. That's been a conservative choice, so I'll see if it can just lean on the normal re2c package for now. --- pkgs/development/misc/resholve/oildev.nix | 27 +++++-------------- .../tools/analysis/binlore/default.nix | 7 +++-- 2 files changed, 9 insertions(+), 25 deletions(-) diff --git a/pkgs/development/misc/resholve/oildev.nix b/pkgs/development/misc/resholve/oildev.nix index 4e7cdb5e6043..b862d261b4fa 100644 --- a/pkgs/development/misc/resholve/oildev.nix +++ b/pkgs/development/misc/resholve/oildev.nix @@ -4,34 +4,17 @@ , callPackage , fetchFromGitHub , makeWrapper -, # re2c deps - autoreconfHook , # py-yajl deps git , # oil deps - file -, pkgsBuildBuild + pkgsBuildBuild +, re2c +, file , six , typing }: rec { - re2c = stdenv.mkDerivation rec { - pname = "re2c"; - version = "1.0.3"; - sourceRoot = "${src.name}/re2c"; - src = fetchFromGitHub { - owner = "skvadrik"; - repo = "re2c"; - rev = version; - sha256 = "0grx7nl9fwcn880v5ssjljhcb9c5p2a6xpwil7zxpmv0rwnr3yqi"; - }; - nativeBuildInputs = [ autoreconfHook ]; - preCheck = '' - patchShebangs run_tests.sh - ''; - }; - py-yajl = python27.pkgs.buildPythonPackage rec { pname = "oil-pyyajl-unstable"; version = "2022-09-01"; @@ -103,7 +86,9 @@ rec { "--without-readline" ]; - nativeBuildInputs = [ re2c file makeWrapper ]; + depsBuildBuild = [ re2c ]; + + nativeBuildInputs = [ file makeWrapper ]; propagatedBuildInputs = [ six typing py-yajl ]; diff --git a/pkgs/development/tools/analysis/binlore/default.nix b/pkgs/development/tools/analysis/binlore/default.nix index 54ea108b7d46..e081f43a768f 100644 --- a/pkgs/development/tools/analysis/binlore/default.nix +++ b/pkgs/development/tools/analysis/binlore/default.nix @@ -1,8 +1,7 @@ { lib , fetchFromGitHub , runCommand -, yallback -, yara +, pkgsBuildBuild }: /* TODO/CAUTION: @@ -59,7 +58,7 @@ let callback = lore: drv: overrides: '' if [[ -d "${drv}/bin" ]] || [[ -d "${drv}/lib" ]] || [[ -d "${drv}/libexec" ]]; then echo generating binlore for $drv by running: - echo "${yara}/bin/yara --scan-list --recursive ${lore.rules} <(printf '%s\n' ${drv}/{bin,lib,libexec}) | ${yallback}/bin/yallback ${lore.yallback}" + echo "${pkgsBuildBuild.yara}/bin/yara --scan-list --recursive ${lore.rules} <(printf '%s\n' ${drv}/{bin,lib,libexec}) | ${pkgsBuildBuild.yallback}/bin/yallback ${lore.yallback}" else echo "failed to generate binlore for $drv (none of ${drv}/{bin,lib,libexec} exist)" fi @@ -84,7 +83,7 @@ let ((i--)) || true # don't break build done # || true # don't break build if [[ -d "${drv}/bin" ]] || [[ -d "${drv}/lib" ]] || [[ -d "${drv}/libexec" ]]; then - ${yara}/bin/yara --scan-list --recursive ${lore.rules} <(printf '%s\n' ${drv}/{bin,lib,libexec}) | ${yallback}/bin/yallback ${lore.yallback} "$filter" + ${pkgsBuildBuild.yara}/bin/yara --scan-list --recursive ${lore.rules} <(printf '%s\n' ${drv}/{bin,lib,libexec}) | ${pkgsBuildBuild.yallback}/bin/yallback ${lore.yallback} "$filter" fi ''; };