push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,104 @@
{
lib,
fetchFromGitHub,
fetchpatch,
stdenv,
# for passthru.plugins
pkgs,
# nativeBuildInputs
cmake,
pkg-config,
wrapQtAppsHook,
# Qt
qt5compat,
qtbase,
qtwayland,
qtsvg,
qttools,
qtwebengine,
# buildInputs
graphviz,
python3,
rizin,
}:
let
cutter = stdenv.mkDerivation rec {
pname = "cutter";
version = "2.4.1";
src = fetchFromGitHub {
owner = "rizinorg";
repo = "cutter";
rev = "v${version}";
hash = "sha256-fNOznaFzWJ4Dve9U1+E4xPaznnyxae2jHNaBCdJzDyQ=";
fetchSubmodules = true;
};
nativeBuildInputs = [
cmake
pkg-config
python3
wrapQtAppsHook
];
propagatedBuildInputs = [
python3.pkgs.pyside6
];
buildInputs = [
graphviz
python3
qt5compat
qtbase
qtsvg
qttools
qtwebengine
rizin
]
++ lib.optionals stdenv.hostPlatform.isLinux [
qtwayland
];
cmakeFlags = [
"-DCUTTER_USE_BUNDLED_RIZIN=OFF"
"-DCUTTER_ENABLE_PYTHON=ON"
"-DCUTTER_ENABLE_PYTHON_BINDINGS=ON"
"-DCUTTER_ENABLE_GRAPHVIZ=ON"
"-DCUTTER_QT6=ON"
];
preBuild = ''
qtWrapperArgs+=(--prefix PYTHONPATH : "$PYTHONPATH")
'';
passthru = rec {
plugins = rizin.plugins // {
rz-ghidra = rizin.plugins.rz-ghidra.override {
inherit cutter qtbase qtsvg;
enableCutterPlugin = true;
};
};
withPlugins =
filter:
pkgs.callPackage ./wrapper.nix {
inherit rizin cutter;
isCutter = true;
plugins = filter plugins;
};
};
meta = with lib; {
description = "Free and Open Source Reverse Engineering Platform powered by rizin";
homepage = src.meta.homepage;
license = licenses.gpl3;
mainProgram = "cutter";
maintainers = with maintainers; [
mic92
dtzWill
];
inherit (rizin.meta) platforms;
};
};
in
cutter

View File

@@ -0,0 +1,155 @@
{
lib,
pkgs, # for passthru.plugins
stdenv,
fetchurl,
pkg-config,
libusb-compat-0_1,
readline,
libewf,
perl,
pcre2,
zlib,
openssl,
file,
libmspack,
libzip,
lz4,
xxHash,
xz,
meson,
python3,
cmake,
ninja,
capstone,
tree-sitter,
zstd,
}:
let
rizin = stdenv.mkDerivation rec {
pname = "rizin";
version = "0.8.1";
src = fetchurl {
url = "https://github.com/rizinorg/rizin/releases/download/v${version}/rizin-src-v${version}.tar.xz";
hash = "sha256-7yseZSXX3DasQ1JblWdJwcyge/F8H+2LZkAtggEKTsI=";
};
mesonFlags = [
"-Duse_sys_capstone=enabled"
"-Duse_sys_magic=enabled"
"-Duse_sys_libzip=enabled"
"-Duse_sys_zlib=enabled"
"-Duse_sys_lz4=enabled"
"-Duse_sys_libzstd=enabled"
"-Duse_sys_lzma=enabled"
"-Duse_sys_xxhash=enabled"
"-Duse_sys_openssl=enabled"
"-Duse_sys_libmspack=enabled"
"-Duse_sys_tree_sitter=enabled"
"-Duse_sys_pcre2=enabled"
# this is needed for wrapping (adding plugins) to work
"-Dportable=true"
];
patches = [
# Normally, Rizin only looks for files in the install prefix. With
# portable=true, it instead looks for files in relation to the parent
# of the directory of the binary file specified in /proc/self/exe,
# caching it. This patch replaces the entire logic to only look at
# the env var NIX_RZ_PREFIX
./librz-wrapper-support.patch
];
nativeBuildInputs = [
pkg-config
meson
(python3.withPackages (
pp: with pp; [
pyyaml
]
))
ninja
cmake
];
# meson's find_library seems to not use our compiler wrapper if static parameter
# is either true/false... We work around by also providing LIBRARY_PATH
preConfigure = ''
LIBRARY_PATH=""
for b in ${toString (map lib.getLib buildInputs)}; do
if [[ -d "$b/lib" ]]; then
LIBRARY_PATH="$b/lib''${LIBRARY_PATH:+:}$LIBRARY_PATH"
fi
done
export LIBRARY_PATH
''
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
substituteInPlace binrz/rizin/macos_sign.sh \
--replace 'codesign' '# codesign'
'';
buildInputs = [
file
libzip
capstone
readline
libusb-compat-0_1
libewf
pcre2
perl
zlib
lz4
openssl
libmspack
tree-sitter
xxHash
xz
zstd
];
postPatch = ''
# find_installation without arguments uses Mesons Python interpreter,
# which does not have any extra modules.
# https://github.com/mesonbuild/meson/pull/9904
substituteInPlace meson.build \
--replace "import('python').find_installation()" "find_program('python3')"
'';
passthru = rec {
plugins = {
jsdec = pkgs.callPackage ./jsdec.nix {
inherit rizin openssl;
};
rz-ghidra = pkgs.qt6.callPackage ./rz-ghidra.nix {
inherit rizin openssl;
enableCutterPlugin = false;
};
# sigdb isn't a real plugin, but it's separated from the main rizin
# derivation so that only those who need it will download it
sigdb = pkgs.callPackage ./sigdb.nix { };
};
withPlugins =
filter:
pkgs.callPackage ./wrapper.nix {
inherit rizin;
plugins = filter plugins;
};
};
meta = {
description = "UNIX-like reverse engineering framework and command-line toolset";
homepage = "https://rizin.re/";
license = lib.licenses.gpl3Plus;
mainProgram = "rizin";
maintainers = with lib.maintainers; [
raskin
makefu
mic92
];
platforms = with lib.platforms; unix;
};
};
in
rizin

View File

@@ -0,0 +1,62 @@
{
lib,
stdenv,
fetchFromGitHub,
meson,
pkg-config,
ninja,
rizin,
openssl,
}:
let
version = "0.8.0";
libquickjs = fetchFromGitHub {
owner = "quickjs-ng";
repo = "quickjs";
tag = "v${version}";
hash = "sha256-o0Cpy+20EqNdNENaYlasJcKIGU7W4RYBcTMsQwFTUNc=";
};
in
stdenv.mkDerivation (finalAttrs: {
pname = "jsdec";
version = version;
src = fetchFromGitHub {
owner = "rizinorg";
repo = "jsdec";
rev = "v${version}";
hash = "sha256-Xc8FMKSGdjrp288u49R6YC0xiynwHeoZe2P/UqnfsFU=";
};
postUnpack = ''
cp -r --no-preserve=mode ${libquickjs} $sourceRoot/subprojects/libquickjs
'';
postPatch = ''
cp subprojects/packagefiles/libquickjs/* subprojects/libquickjs
'';
nativeBuildInputs = [
meson
ninja
pkg-config
];
buildInputs = [
openssl
rizin
];
meta = with lib; {
description = "Simple decompiler for Rizin";
homepage = finalAttrs.src.meta.homepage;
changelog = "${finalAttrs.src.meta.homepage}/releases/tag/${finalAttrs.src.rev}";
license = with licenses; [
asl20
bsd3
mit
];
maintainers = with maintainers; [ chayleaf ];
};
})

View File

@@ -0,0 +1,13 @@
diff --git a/librz/util/path.c b/librz/util/path.c
index 8ea3d67..f4a8918 100644
--- a/librz/util/path.c
+++ b/librz/util/path.c
@@ -35,6 +35,8 @@ static void fini_portable_prefix(void) {
}
static char *set_portable_prefix(void) {
+ return rz_sys_getenv("NIX_RZ_PREFIX");
+
char *pid_to_path = rz_sys_pid_to_path(rz_sys_getpid());
if (!pid_to_path) {
return NULL;

View File

@@ -0,0 +1,63 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
# buildInputs
rizin,
openssl,
pugixml,
# optional buildInputs
enableCutterPlugin ? true,
cutter,
qt5compat,
qtbase,
qtsvg,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "rz-ghidra";
version = "0.8.0";
src = fetchFromGitHub {
owner = "rizinorg";
repo = "rz-ghidra";
rev = "v${finalAttrs.version}";
hash = "sha256-uI0EnuHAuyrXYKDijh5Tg/WcQ/5yyZnW3d5MMHZxnqA=";
fetchSubmodules = true;
};
nativeBuildInputs = [ cmake ];
buildInputs = [
openssl
pugixml
rizin
]
++ lib.optionals enableCutterPlugin [
cutter
qt5compat
qtbase
qtsvg
];
dontWrapQtApps = true;
cmakeFlags = [
"-DUSE_SYSTEM_PUGIXML=ON"
]
++ lib.optionals enableCutterPlugin [
"-DBUILD_CUTTER_PLUGIN=ON"
"-DCUTTER_INSTALL_PLUGDIR=share/rizin/cutter/plugins/native"
];
meta = with lib; {
# errors out with undefined symbols from Cutter
broken = enableCutterPlugin && stdenv.hostPlatform.isDarwin;
description = "Deep ghidra decompiler and sleigh disassembler integration for rizin";
homepage = finalAttrs.src.meta.homepage;
changelog = "${finalAttrs.src.meta.homepage}/releases/tag/${finalAttrs.src.rev}";
license = licenses.lgpl3;
maintainers = with maintainers; [ chayleaf ];
inherit (rizin.meta) platforms;
};
})

View File

@@ -0,0 +1,37 @@
{
lib,
fetchFromGitHub,
stdenvNoCC,
}:
stdenvNoCC.mkDerivation rec {
pname = "rizin-sigdb";
version = "unstable-2023-08-23";
src = fetchFromGitHub {
owner = "rizinorg";
# sigdb-source: source files (.pat and etc), around 2.5gb total
# sigdb: built and deflated .sig files, around 50mb total
repo = "sigdb";
rev = "4addbed50cd3b50eeef5a41d72533d079ebbfbf8";
hash = "sha256-Fy92MTuLswEgQ/XEUExqdU1Z4a5MP2Ahzi/gGxd5BtA=";
};
buildPhase = ''
mkdir installdir
cp -r elf pe installdir
.scripts/verify-sigs-install.sh
'';
installPhase = ''
mkdir -p $out/share/rizin
mv installdir $out/share/rizin/sigdb
'';
meta = with lib; {
description = "Rizin FLIRT Signature Database";
homepage = src.meta.homepage;
license = licenses.lgpl3;
maintainers = with lib.maintainers; [ chayleaf ];
};
}

View File

@@ -0,0 +1,43 @@
{
lib,
makeWrapper,
symlinkJoin,
plugins,
rizin,
isCutter ? false,
cutter,
}:
let
unwrapped = if isCutter then cutter else rizin;
in
symlinkJoin {
name = "${unwrapped.pname}-with-plugins-${unwrapped.version}";
# NIX_RZ_PREFIX only changes where *Rizin* locates files (plugins,
# themes, etc). But we must change it even for wrapping Cutter, because
# Cutter plugins often have associated Rizin plugins. This means that
# $out (which NIX_RZ_PREFIX will be set to) must always contain Rizin
# files, even if we only wrap Cutter - so for Cutter, include Rizin to
# symlinkJoin paths.
paths = [ unwrapped ] ++ lib.optional isCutter rizin ++ plugins;
nativeBuildInputs = [ makeWrapper ];
passthru = {
inherit unwrapped;
};
postBuild = ''
rm $out/bin/*
wrapperArgs=(--set NIX_RZ_PREFIX $out${lib.optionalString isCutter " --prefix XDG_DATA_DIRS : $out/share"})
for binary in $(ls ${unwrapped}/bin); do
makeWrapper ${unwrapped}/bin/$binary $out/bin/$binary "''${wrapperArgs[@]}"
done
'';
meta = unwrapped.meta // {
# prefer wrapped over unwrapped
priority = (unwrapped.meta.priority or lib.meta.defaultPriority) - 1;
};
}