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.
This commit is contained in:
Travis A. Everett 2024-02-12 23:54:24 -06:00
parent 4c7e59780d
commit f54875f90e
2 changed files with 9 additions and 25 deletions

View File

@ -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 ];

View File

@ -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
'';
};