Merge master into staging-next

This commit is contained in:
github-actions[bot] 2024-08-09 06:01:00 +00:00 committed by GitHub
commit 3f01b50c68
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
35 changed files with 279 additions and 165 deletions

View File

@ -15009,6 +15009,7 @@
github = "nyadiia"; github = "nyadiia";
githubId = 43252360; githubId = 43252360;
name = "Nadia"; name = "Nadia";
keys = [ { fingerprint = "6B51 E324 238A F455 2381 313A 9254 1B0C D2A9 3AD8"; } ];
}; };
nyanbinary = { nyanbinary = {
email = "nyanbinary@keemail.me"; email = "nyanbinary@keemail.me";

View File

@ -79,7 +79,7 @@ let
nativeBuildInputs = [ cmake pkg-config ]; nativeBuildInputs = [ cmake pkg-config ];
buildInputs = [ glib xorg.libX11 libdbusmenu ]; buildInputs = [ glib xorg.libX11 libdbusmenu ];
inherit src; inherit src;
sourceRoot = "source/native/LinuxGlobalMenu"; sourceRoot = "${src.name}/native/LinuxGlobalMenu";
patches = [ ../patches/libdbm-headers.patch ]; patches = [ ../patches/libdbm-headers.patch ];
postPatch = "cp ${libdbusmenu-jb}/lib/libdbusmenu-glib.a libdbusmenu-glib.a"; postPatch = "cp ${libdbusmenu-jb}/lib/libdbusmenu-glib.a libdbusmenu-glib.a";
passthru.patched-libdbusmenu = libdbusmenu-jb; passthru.patched-libdbusmenu = libdbusmenu-jb;
@ -97,7 +97,7 @@ let
pname = "fsnotifier"; pname = "fsnotifier";
version = buildVer; version = buildVer;
inherit src; inherit src;
sourceRoot = "source/native/fsNotifier/linux"; sourceRoot = "${src.name}/native/fsNotifier/linux";
buildPhase = '' buildPhase = ''
runHook preBuild runHook preBuild
$CC -O2 -Wall -Wextra -Wpedantic -D "VERSION=\"${buildVer}\"" -std=c11 main.c inotify.c util.c -o fsnotifier $CC -O2 -Wall -Wextra -Wpedantic -D "VERSION=\"${buildVer}\"" -std=c11 main.c inotify.c util.c -o fsnotifier
@ -115,7 +115,7 @@ let
pname = "restarter"; pname = "restarter";
version = buildVer; version = buildVer;
inherit src; inherit src;
sourceRoot = "source/native/restarter"; sourceRoot = "${src.name}/native/restarter";
cargoHash = restarterHash; cargoHash = restarterHash;
}; };
@ -138,7 +138,7 @@ let
pname = "jps-bootstrap"; pname = "jps-bootstrap";
version = buildVer; version = buildVer;
inherit src; inherit src;
sourceRoot = "source/platform/jps-bootstrap"; sourceRoot = "${src.name}/platform/jps-bootstrap";
nativeBuildInputs = [ ant makeWrapper jbr ]; nativeBuildInputs = [ ant makeWrapper jbr ];
patches = [ ../patches/kotlinc-path.patch ]; patches = [ ../patches/kotlinc-path.patch ];
postPatch = "sed -i 's|KOTLIN_PATH_HERE|${kotlin}|' src/main/java/org/jetbrains/jpsBootstrap/KotlinCompiler.kt"; postPatch = "sed -i 's|KOTLIN_PATH_HERE|${kotlin}|' src/main/java/org/jetbrains/jpsBootstrap/KotlinCompiler.kt";

View File

@ -1,5 +1,6 @@
{ {
lib, lib,
stdenv,
python3, python3,
fetchFromGitHub, fetchFromGitHub,
qt6, qt6,
@ -15,11 +16,13 @@ python3.pkgs.buildPythonApplication rec {
sha256 = "sha256-fAVsjknhLhsrGdHu2Q6JWLoFoxZoc+wDCNja+ySCsR4="; sha256 = "sha256-fAVsjknhLhsrGdHu2Q6JWLoFoxZoc+wDCNja+ySCsR4=";
}; };
nativeBuildInputs = [ nativeBuildInputs = [
qt6.wrapQtAppsHook qt6.wrapQtAppsHook
qt6.qtbase qt6.qtbase
]; ];
buildInputs = lib.optional stdenv.isLinux qt6.qtwayland;
propagatedBuildInputs = with python3.pkgs; [ propagatedBuildInputs = with python3.pkgs; [
cython cython
scipy scipy

View File

@ -89,7 +89,7 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-ZQqi1RFb4Ey0A0UVCThuIxM7DoFfkLwaeRAc2z8u9so="; hash = "sha256-ZQqi1RFb4Ey0A0UVCThuIxM7DoFfkLwaeRAc2z8u9so=";
}; };
sourceRoot = "source/cpp"; sourceRoot = "${finalAttrs.src.name}/cpp";
# versions are all taken from # versions are all taken from
# https://github.com/apache/arrow/blob/apache-arrow-${version}/cpp/thirdparty/versions.txt # https://github.com/apache/arrow/blob/apache-arrow-${version}/cpp/thirdparty/versions.txt

View File

@ -13,7 +13,7 @@
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "arrow-glib"; pname = "arrow-glib";
inherit (arrow-cpp) src version; inherit (arrow-cpp) src version;
sourceRoot = "source/c_glib"; sourceRoot = "${arrow-cpp.src.name}/c_glib";
strictDeps = true; strictDeps = true;

View File

@ -13,7 +13,7 @@
adaptor ? "sql", adaptor ? "sql",
}: }:
rustPlatform.buildRustPackage { rustPlatform.buildRustPackage rec {
pname = "crabfit-api"; pname = "crabfit-api";
version = "0-unstable-2023-08-02"; version = "0-unstable-2023-08-02";
@ -24,7 +24,7 @@ rustPlatform.buildRustPackage {
hash = "sha256-jy8BrJSHukRenPbZHw4nPx3cSi7E2GSg//WOXDh90mY="; hash = "sha256-jy8BrJSHukRenPbZHw4nPx3cSi7E2GSg//WOXDh90mY=";
}; };
sourceRoot = "source/api"; sourceRoot = "${src.name}/api";
patches = [ patches = [
(fetchpatch { (fetchpatch {

View File

@ -24,7 +24,7 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-jy8BrJSHukRenPbZHw4nPx3cSi7E2GSg//WOXDh90mY="; hash = "sha256-jy8BrJSHukRenPbZHw4nPx3cSi7E2GSg//WOXDh90mY=";
}; };
sourceRoot = "source/frontend"; sourceRoot = "${finalAttrs.src.name}/frontend";
patches = [ patches = [
./01-localfont.patch ./01-localfont.patch

View File

@ -33,7 +33,7 @@ rustPlatform.buildRustPackage rec {
''; '';
}; };
sourceRoot = "source/src-tauri"; sourceRoot = "${src.name}/src-tauri";
cargoLock = { cargoLock = {
lockFile = ./Cargo.lock; lockFile = ./Cargo.lock;
@ -86,4 +86,3 @@ rustPlatform.buildRustPackage rec {
maintainers = with lib.maintainers; [ tomasajt ]; maintainers = with lib.maintainers; [ tomasajt ];
}; };
} }

View File

@ -15,7 +15,7 @@ buildGoModule rec {
hash = "sha256-ANo9OkdNVCjV5uEqr9lNNbStquNb/3oxuTfMqE2nUzo="; hash = "sha256-ANo9OkdNVCjV5uEqr9lNNbStquNb/3oxuTfMqE2nUzo=";
}; };
sourceRoot = "source/cmd/jv"; sourceRoot = "${src.name}/cmd/jv";
passthru.updateScript = nix-update-script { }; passthru.updateScript = nix-update-script { };
vendorHash = "sha256-FuUkC7iwn/jO3fHjT9nGUXc2X1QuuxPc8DAzVpzhANk="; vendorHash = "sha256-FuUkC7iwn/jO3fHjT9nGUXc2X1QuuxPc8DAzVpzhANk=";

View File

@ -19,7 +19,7 @@ rustPlatform.buildRustPackage rec {
hash = "sha256-nk5oJRTBRj0LE2URJqno8AoZ+/342C2tEt8d6k2MAc8="; hash = "sha256-nk5oJRTBRj0LE2URJqno8AoZ+/342C2tEt8d6k2MAc8=";
}; };
sourceRoot = "source/kclvm"; sourceRoot = "${src.name}/kclvm";
cargoLock = { cargoLock = {
lockFile = ./Cargo.lock; lockFile = ./Cargo.lock;
outputHashes = { outputHashes = {

View File

@ -18,7 +18,7 @@ rustPlatform.buildRustPackage rec {
hash = "sha256-nk5oJRTBRj0LE2URJqno8AoZ+/342C2tEt8d6k2MAc8="; hash = "sha256-nk5oJRTBRj0LE2URJqno8AoZ+/342C2tEt8d6k2MAc8=";
}; };
sourceRoot = "source/cli"; sourceRoot = "${src.name}/cli";
cargoHash = "sha256-LZUE2J/UYepl5BGf4T4eWKIZfN3mVJtMDLtm0uUmvI8="; cargoHash = "sha256-LZUE2J/UYepl5BGf4T4eWKIZfN3mVJtMDLtm0uUmvI8=";
cargoPatches = [ ./cargo_lock.patch ]; cargoPatches = [ ./cargo_lock.patch ];

View File

@ -174,7 +174,7 @@ let
espeak-ng' = espeak-ng.overrideAttrs (self: { espeak-ng' = espeak-ng.overrideAttrs (self: {
name = "espeak-ng'"; name = "espeak-ng'";
inherit (go-piper) src; inherit (go-piper) src;
sourceRoot = "source/espeak"; sourceRoot = "${go-piper.src.name}/espeak";
patches = [ ]; patches = [ ];
nativeBuildInputs = [ cmake ]; nativeBuildInputs = [ cmake ];
cmakeFlags = (self.cmakeFlags or [ ]) ++ [ cmakeFlags = (self.cmakeFlags or [ ]) ++ [
@ -194,7 +194,7 @@ let
piper-phonemize = stdenv.mkDerivation { piper-phonemize = stdenv.mkDerivation {
name = "piper-phonemize"; name = "piper-phonemize";
inherit (go-piper) src; inherit (go-piper) src;
sourceRoot = "source/piper-phonemize"; sourceRoot = "${go-piper.src.name}/piper-phonemize";
buildInputs = [ espeak-ng' onnxruntime ]; buildInputs = [ espeak-ng' onnxruntime ];
nativeBuildInputs = [ cmake pkg-config ]; nativeBuildInputs = [ cmake pkg-config ];
cmakeFlags = [ cmakeFlags = [
@ -207,7 +207,7 @@ let
piper-tts' = (piper-tts.override { inherit piper-phonemize; }).overrideAttrs (self: { piper-tts' = (piper-tts.override { inherit piper-phonemize; }).overrideAttrs (self: {
name = "piper-tts'"; name = "piper-tts'";
inherit (go-piper) src; inherit (go-piper) src;
sourceRoot = "source/piper"; sourceRoot = "${go-piper.src.name}/piper";
installPhase = null; installPhase = null;
postInstall = '' postInstall = ''
cp CMakeFiles/piper.dir/src/cpp/piper.cpp.o $out/piper.o cp CMakeFiles/piper.dir/src/cpp/piper.cpp.o $out/piper.o
@ -339,7 +339,7 @@ let
go-tiny-dream-ncnn = ncnn.overrideAttrs (self: { go-tiny-dream-ncnn = ncnn.overrideAttrs (self: {
name = "go-tiny-dream-ncnn"; name = "go-tiny-dream-ncnn";
inherit (go-tiny-dream) src; inherit (go-tiny-dream) src;
sourceRoot = "source/ncnn"; sourceRoot = "${go-tiny-dream.src.name}/ncnn";
cmakeFlags = self.cmakeFlags ++ [ cmakeFlags = self.cmakeFlags ++ [
(lib.cmakeBool "NCNN_SHARED_LIB" false) (lib.cmakeBool "NCNN_SHARED_LIB" false)
(lib.cmakeBool "NCNN_OPENMP" false) (lib.cmakeBool "NCNN_OPENMP" false)

View File

@ -1,5 +1,5 @@
{ lib, rustPlatform, fetchFromGitHub }: { lib, rustPlatform, fetchFromGitHub }:
rustPlatform.buildRustPackage { rustPlatform.buildRustPackage rec {
pname = "loco-cli"; pname = "loco-cli";
version = "0.2.6"; version = "0.2.6";
@ -17,7 +17,7 @@ rustPlatform.buildRustPackage {
ln -s ${./Cargo.lock} Cargo.lock ln -s ${./Cargo.lock} Cargo.lock
''; '';
sourceRoot = "source/loco-cli"; sourceRoot = "${src.name}/loco-cli";
meta = with lib; { meta = with lib; {
mainProgram = "loco"; mainProgram = "loco";

View File

@ -10,7 +10,7 @@ rustPlatform.buildRustPackage rec {
pname = "mycelium"; pname = "mycelium";
version = "0.5.3"; version = "0.5.3";
sourceRoot = "source/myceliumd"; sourceRoot = "${src.name}/myceliumd";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "threefoldtech"; owner = "threefoldtech";

View File

@ -22,7 +22,7 @@
pname = "nix-inspect-worker"; pname = "nix-inspect-worker";
version = "0.1.2"; version = "0.1.2";
sourceRoot = "source/worker"; sourceRoot = "${src.name}/worker";
nativeBuildInputs = [meson ninja pkg-config]; nativeBuildInputs = [meson ninja pkg-config];

View File

@ -21,7 +21,7 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-k2+ddJIgGE41KGZODovU9VdurbWerEtdqNrFDwyuFjo="; hash = "sha256-k2+ddJIgGE41KGZODovU9VdurbWerEtdqNrFDwyuFjo=";
}; };
sourceRoot = "source/src"; sourceRoot = "${finalAttrs.src.name}/src";
patches = [ patches = [
# https://github.com/ablab/spades/pull/1314 # https://github.com/ablab/spades/pull/1314

View File

@ -12,7 +12,7 @@ let
rev = "v${version}"; rev = "v${version}";
hash = "sha256-Z2J17YMzQNZqABIa5eyJDT7BWfXveymzs+DWsrklPIs="; hash = "sha256-Z2J17YMzQNZqABIa5eyJDT7BWfXveymzs+DWsrklPIs=";
}; };
sourceRoot = "source/Box2D"; sourceRoot = "${src.name}/Box2D";
cmakeFlags = old.cmakeFlags or [ ] ++ [ cmakeFlags = old.cmakeFlags or [ ] ++ [
(cmakeBool "BOX2D_INSTALL" true) (cmakeBool "BOX2D_INSTALL" true)
(cmakeBool "BOX2D_BUILD_SHARED" true) (cmakeBool "BOX2D_BUILD_SHARED" true)

View File

@ -11,7 +11,7 @@ buildPythonPackage {
pname = "capstone"; pname = "capstone";
inherit (capstone_4) version src; inherit (capstone_4) version src;
sourceRoot = "source/bindings/python"; sourceRoot = "${capstone_4.src.name}/bindings/python";
patches = [ patches = [
# Drop distutils in python binding (PR 2271) # Drop distutils in python binding (PR 2271)
(fetchpatch { (fetchpatch {

View File

@ -4,6 +4,7 @@
fetchFromGitHub, fetchFromGitHub,
setuptools-scm, setuptools-scm,
pytestCheckHook, pytestCheckHook,
stdenv,
}: }:
buildPythonPackage rec { buildPythonPackage rec {
@ -30,5 +31,6 @@ buildPythonPackage rec {
homepage = "https://github.com/jaraco/jaraco.path"; homepage = "https://github.com/jaraco/jaraco.path";
license = lib.licenses.mit; license = lib.licenses.mit;
maintainers = with lib.maintainers; [ dotlambda ]; maintainers = with lib.maintainers; [ dotlambda ];
broken = stdenv.isDarwin; # pyobjc is missing
}; };
} }

View File

@ -45,7 +45,7 @@ buildPythonPackage rec {
cargoRoot = "rust"; cargoRoot = "rust";
cargoDeps = rustPlatform.fetchCargoTarball { cargoDeps = rustPlatform.fetchCargoTarball {
inherit src; inherit src;
sourceRoot = "source/rust"; sourceRoot = "${src.name}/rust";
name = "${pname}-${version}"; name = "${pname}-${version}";
hash = "sha256-6fw0KgnPIMfdseWcunsGjvjVB+lJNoG3pLDqkORPJ0I="; hash = "sha256-6fw0KgnPIMfdseWcunsGjvjVB+lJNoG3pLDqkORPJ0I=";
postPatch = '' postPatch = ''

View File

@ -9,7 +9,7 @@
buildPythonPackage rec { buildPythonPackage rec {
pname = "puremagic"; pname = "puremagic";
version = "1.26"; version = "1.27";
pyproject = true; pyproject = true;
disabled = pythonOlder "3.7"; disabled = pythonOlder "3.7";
@ -18,7 +18,7 @@ buildPythonPackage rec {
owner = "cdgriffith"; owner = "cdgriffith";
repo = "puremagic"; repo = "puremagic";
rev = "refs/tags/${version}"; rev = "refs/tags/${version}";
hash = "sha256-0lnMLlW/cwP0tOM0oZEl5M5k5ZDssnZejGt3+ctW1qg="; hash = "sha256-93akHgfkNbYGDJxXXJTk9yobvpiycqdroVBEeOzDiFQ=";
}; };
build-system = [ setuptools ]; build-system = [ setuptools ];

View File

@ -33,7 +33,7 @@ buildPythonPackage rec {
disabled = pythonOlder "3.7"; disabled = pythonOlder "3.7";
sourceRoot = "source/python"; sourceRoot = "${src.name}/python";
nativeBuildInputs = [ nativeBuildInputs = [
cmake cmake

View File

@ -6,7 +6,7 @@
pytestCheckHook, pytestCheckHook,
}: }:
buildPythonPackage { buildPythonPackage rec {
pname = "yapsy"; pname = "yapsy";
version = "1.12.2-unstable-2023-03-29"; version = "1.12.2-unstable-2023-03-29";
pyproject = true; pyproject = true;
@ -18,7 +18,7 @@ buildPythonPackage {
hash = "sha256-QKZlUAhYMCCsT/jbEHb39ESZ2+2FZYnhJnc1PgsozBA="; hash = "sha256-QKZlUAhYMCCsT/jbEHb39ESZ2+2FZYnhJnc1PgsozBA=";
}; };
sourceRoot = "source/package"; sourceRoot = "${src.name}/package";
build-system = [ setuptools ]; build-system = [ setuptools ];

View File

@ -5,7 +5,7 @@
kernel, kernel,
}: }:
stdenv.mkDerivation { stdenv.mkDerivation rec {
pname = "hid-t150"; pname = "hid-t150";
#https://github.com/scarburato/t150_driver/blob/165d0601e11576186c9416c40144927549ef804d/install.sh#L3 #https://github.com/scarburato/t150_driver/blob/165d0601e11576186c9416c40144927549ef804d/install.sh#L3
version = "0.8a"; version = "0.8a";
@ -19,7 +19,7 @@ stdenv.mkDerivation {
nativeBuildInputs = kernel.moduleBuildDependencies; nativeBuildInputs = kernel.moduleBuildDependencies;
sourceRoot = "source/hid-t150"; sourceRoot = "${src.name}/hid-t150";
makeFlags = kernel.makeFlags ++ [ makeFlags = kernel.makeFlags ++ [
"KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" "KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"

View File

@ -97,7 +97,7 @@ let
pname = "title-wrap"; pname = "title-wrap";
version = official_extensions_version; version = official_extensions_version;
src = official_extensions_src; src = official_extensions_src;
sourceRoot = "source/xExtension-TitleWrap"; sourceRoot = "${official_extensions_src.name}/xExtension-TitleWrap";
meta = { meta = {
description = "FreshRSS extension instead of truncating the title is wrapped."; description = "FreshRSS extension instead of truncating the title is wrapped.";
homepage = "https://github.com/FreshRSS/Extensions/tree/master/xExtension-TitleWrap"; homepage = "https://github.com/FreshRSS/Extensions/tree/master/xExtension-TitleWrap";
@ -111,7 +111,7 @@ let
pname = "youtube"; pname = "youtube";
version = official_extensions_version; version = official_extensions_version;
src = official_extensions_src; src = official_extensions_src;
sourceRoot = "source/xExtension-YouTube"; sourceRoot = "${official_extensions_src.name}/xExtension-YouTube";
meta = { meta = {
description = "FreshRSS extension allows you to directly watch YouTube/PeerTube videos from within subscribed channel feeds."; description = "FreshRSS extension allows you to directly watch YouTube/PeerTube videos from within subscribed channel feeds.";
homepage = "https://github.com/FreshRSS/Extensions/tree/master/xExtension-YouTube"; homepage = "https://github.com/FreshRSS/Extensions/tree/master/xExtension-YouTube";

View File

@ -1,72 +1,98 @@
{ lib {
, stdenv lib,
, unzip stdenv,
, jdk unzip,
, gradle jdk,
, ghidra gradle,
ghidra,
}: }:
let let
metaCommon = oldMeta: metaCommon =
oldMeta // (with lib; { oldMeta:
maintainers = (oldMeta.maintainers or []) ++ (with maintainers; [ vringar ]); oldMeta
// (with lib; {
maintainers = (oldMeta.maintainers or [ ]) ++ (with maintainers; [ vringar ]);
platforms = oldMeta.platforms or ghidra.meta.platforms; platforms = oldMeta.platforms or ghidra.meta.platforms;
}); });
buildGhidraExtension = { buildGhidraExtension =
pname, nativeBuildInputs ? [], meta ? { }, ... {
}@args: pname,
stdenv.mkDerivation (args // { nativeBuildInputs ? [ ],
nativeBuildInputs = nativeBuildInputs ++ [ meta ? { },
unzip ...
jdk }@args:
gradle stdenv.mkDerivation (
]; args
// {
nativeBuildInputs = nativeBuildInputs ++ [
unzip
jdk
gradle
];
preBuild = '' preBuild = ''
# Set project name, otherwise defaults to directory name # Set project name, otherwise defaults to directory name
echo -e '\nrootProject.name = "${pname}"' >> settings.gradle echo -e '\nrootProject.name = "${pname}"' >> settings.gradle
${args.preBuild or ""} # A config directory needs to exist when ghidra's GHelpBuilder is run
''; export XDG_CONFIG_HOME="''${XDG_CONFIG_HOME:-$(mktemp -d)}"
${args.preBuild or ""}
'';
gradleBuildTask = args.gradleBuildTask or "buildExtension"; # Needed to run gradle on darwin
gradleFlags = args.gradleFlags or [] ++ [ "-PGHIDRA_INSTALL_DIR=${ghidra}/lib/ghidra" ]; __darwinAllowLocalNetworking = true;
installPhase = args.installPhase or '' gradleBuildTask = args.gradleBuildTask or "buildExtension";
runHook preInstall gradleFlags = args.gradleFlags or [ ] ++ [ "-PGHIDRA_INSTALL_DIR=${ghidra}/lib/ghidra" ];
mkdir -p $out/lib/ghidra/Ghidra/Extensions installPhase =
unzip -d $out/lib/ghidra/Ghidra/Extensions dist/*.zip args.installPhase or ''
runHook preInstall
runHook postInstall mkdir -p $out/lib/ghidra/Ghidra/Extensions
''; unzip -d $out/lib/ghidra/Ghidra/Extensions dist/*.zip
meta = metaCommon meta; runHook postInstall
}); '';
buildGhidraScripts = { pname, meta ? { }, ... }@args: meta = metaCommon meta;
stdenv.mkDerivation (args // { }
installPhase = '' );
runHook preInstall
GHIDRA_HOME=$out/lib/ghidra/Ghidra/Extensions/${pname} buildGhidraScripts =
mkdir -p $GHIDRA_HOME {
cp -r . $GHIDRA_HOME/ghidra_scripts pname,
meta ? { },
...
}@args:
stdenv.mkDerivation (
args
// {
installPhase = ''
runHook preInstall
touch $GHIDRA_HOME/Module.manifest GHIDRA_HOME=$out/lib/ghidra/Ghidra/Extensions/${pname}
cat <<'EOF' > extension.properties mkdir -p $GHIDRA_HOME
name=${pname} cp -r . $GHIDRA_HOME/ghidra_scripts
description=${meta.description or ""}
author=
createdOn=
version=${lib.getVersion ghidra}
EOF touch $GHIDRA_HOME/Module.manifest
cat <<'EOF' > extension.properties
name=${pname}
description=${meta.description or ""}
author=
createdOn=
version=${lib.getVersion ghidra}
runHook postInstall EOF
'';
meta = metaCommon meta; runHook postInstall
}); '';
meta = metaCommon meta;
}
);
in in
{ inherit buildGhidraExtension buildGhidraScripts; } {
inherit buildGhidraExtension buildGhidraScripts;
}

View File

@ -1,12 +1,13 @@
{ stdenv {
, fetchzip stdenv,
, lib fetchzip,
, makeWrapper lib,
, autoPatchelfHook makeWrapper,
, openjdk17 autoPatchelfHook,
, pam openjdk17,
, makeDesktopItem pam,
, icoutils makeDesktopItem,
icoutils,
}: }:
let let
@ -24,7 +25,8 @@ let
startupWMClass = "ghidra-Ghidra"; startupWMClass = "ghidra-Ghidra";
}; };
in stdenv.mkDerivation rec { in
stdenv.mkDerivation rec {
pname = "ghidra"; pname = "ghidra";
version = "10.4"; version = "10.4";
versiondate = "20230928"; versiondate = "20230928";
@ -37,8 +39,7 @@ in stdenv.mkDerivation rec {
nativeBuildInputs = [ nativeBuildInputs = [
makeWrapper makeWrapper
icoutils icoutils
] ] ++ lib.optionals stdenv.isLinux [ autoPatchelfHook ];
++ lib.optionals stdenv.isLinux [ autoPatchelfHook ];
buildInputs = [ buildInputs = [
stdenv.cc.cc.lib stdenv.cc.cc.lib
@ -74,10 +75,17 @@ in stdenv.mkDerivation rec {
description = "Software reverse engineering (SRE) suite of tools developed by NSA's Research Directorate in support of the Cybersecurity mission"; description = "Software reverse engineering (SRE) suite of tools developed by NSA's Research Directorate in support of the Cybersecurity mission";
mainProgram = "ghidra"; mainProgram = "ghidra";
homepage = "https://github.com/NationalSecurityAgency/ghidra"; homepage = "https://github.com/NationalSecurityAgency/ghidra";
platforms = [ "x86_64-linux" "x86_64-darwin" ]; platforms = [
"x86_64-linux"
"x86_64-darwin"
];
sourceProvenance = with sourceTypes; [ binaryBytecode ]; sourceProvenance = with sourceTypes; [ binaryBytecode ];
license = licenses.asl20; license = licenses.asl20;
maintainers = with maintainers; [ ck3d govanify mic92 ]; maintainers = with maintainers; [
ck3d
govanify
mic92
];
}; };
} }

View File

@ -1,14 +1,26 @@
{ lib, newScope, callPackage, ghidra }: {
lib,
newScope,
callPackage,
ghidra,
}:
lib.makeScope newScope (self: { lib.makeScope newScope (self: {
inherit (callPackage ./build-extension.nix { inherit ghidra; }) buildGhidraExtension buildGhidraScripts; inherit (callPackage ./build-extension.nix { inherit ghidra; })
buildGhidraExtension
buildGhidraScripts
;
ghidraninja-ghidra-scripts = self.callPackage ./extensions/ghidraninja-ghidra-scripts { }; ghidraninja-ghidra-scripts = self.callPackage ./extensions/ghidraninja-ghidra-scripts { };
gnudisassembler = self.callPackage ./extensions/gnudisassembler { inherit ghidra; }; gnudisassembler = self.callPackage ./extensions/gnudisassembler { inherit ghidra; };
lightkeeper = self.callPackage ./extensions/lightkeeper { };
machinelearning = self.callPackage ./extensions/machinelearning { inherit ghidra; }; machinelearning = self.callPackage ./extensions/machinelearning { inherit ghidra; };
ret-sync = self.callPackage ./extensions/ret-sync { };
sleighdevtools = self.callPackage ./extensions/sleighdevtools { inherit ghidra; }; sleighdevtools = self.callPackage ./extensions/sleighdevtools { inherit ghidra; };
}) })

View File

@ -1,9 +1,10 @@
{ lib {
, fetchFromGitHub lib,
, buildGhidraScripts fetchFromGitHub,
, binwalk buildGhidraScripts,
, swift binwalk,
, yara swift,
yara,
}: }:
buildGhidraScripts { buildGhidraScripts {

View File

@ -1,14 +1,15 @@
{ lib {
, stdenv lib,
, fetchurl stdenv,
, buildGhidraExtension fetchurl,
, ghidra buildGhidraExtension,
, flex ghidra,
, bison flex,
, texinfo bison,
, perl texinfo,
, zlib perl,
, xcbuild zlib,
xcbuild,
}: }:
let let
@ -41,13 +42,9 @@ buildGhidraExtension {
bison bison
texinfo texinfo
perl perl
] ++ lib.optionals stdenv.hostPlatform.isDarwin [ ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ xcbuild ];
xcbuild
];
buildInputs = [ buildInputs = [ zlib ];
zlib
];
gradleBuildTask = "assemble"; gradleBuildTask = "assemble";
installPhase = '' installPhase = ''

View File

@ -0,0 +1,24 @@
{
lib,
fetchFromGitHub,
buildGhidraExtension,
}:
buildGhidraExtension rec {
pname = "lightkeeper";
version = "1.1.0";
src = fetchFromGitHub {
owner = "WorksButNotTested";
repo = "lightkeeper";
rev = version;
hash = "sha256-S8yNn56A2CvrIBsq0RoBx0qOjrYDZSv1IVTxGmlL4Js=";
};
preConfigure = ''
cd lightkeeper
'';
meta = {
description = "A port of the Lighthouse plugin to GHIDRA.";
homepage = "https://github.com/WorksButNotTested/lightkeeper";
license = lib.licenses.asl20;
};
}

View File

@ -1,6 +1,7 @@
{ lib {
, buildGhidraExtension lib,
, ghidra buildGhidraExtension,
ghidra,
}: }:
buildGhidraExtension { buildGhidraExtension {
@ -28,7 +29,7 @@ buildGhidraExtension {
downloadPage = "https://github.com/NationalSecurityAgency/ghidra/tree/master/Ghidra/Extensions/MachineLearning"; downloadPage = "https://github.com/NationalSecurityAgency/ghidra/tree/master/Ghidra/Extensions/MachineLearning";
sourceProvenance = with sourceTypes; [ sourceProvenance = with sourceTypes; [
fromSource fromSource
binaryBytecode # deps binaryBytecode # deps
]; ];
}; };
} }

View File

@ -0,0 +1,32 @@
{
lib,
fetchFromGitHub,
buildGhidraExtension,
ghidra,
}:
buildGhidraExtension {
pname = "ret-sync-ghidra";
version = "0-unstable-2024-05-29";
src = fetchFromGitHub {
owner = "bootleg";
repo = "ret-sync";
rev = "0617c75746ddde7fe2bdbbf880175af8ad27553e";
hash = "sha256-+G5ccdHnFL0sHpueuIYwLRU9FhzN658CYqQCHCBwxV4=";
};
preConfigure = ''
cd ext_ghidra
'';
preInstall = ''
correct_version=$(ls dist | grep ${ghidra.version})
mv dist/$correct_version dist/safe.zip
rm dist/ghidra*
mv dist/safe.zip dist/$correct_version
'';
meta = with lib; {
description = "Reverse-Engineering Tools SYNChronization. Allows syncing between a debugging session and Ghidra";
homepage = "https://github.com/bootleg/ret-sync";
license = licenses.gpl3Only;
};
}

View File

@ -1,7 +1,8 @@
{ lib {
, buildGhidraExtension lib,
, ghidra buildGhidraExtension,
, python3 ghidra,
python3,
}: }:
buildGhidraExtension { buildGhidraExtension {
@ -34,7 +35,7 @@ buildGhidraExtension {
downloadPage = "https://github.com/NationalSecurityAgency/ghidra/tree/master/Ghidra/Extensions/SleighDevTools"; downloadPage = "https://github.com/NationalSecurityAgency/ghidra/tree/master/Ghidra/Extensions/SleighDevTools";
sourceProvenance = with sourceTypes; [ sourceProvenance = with sourceTypes; [
fromSource fromSource
binaryBytecode # deps binaryBytecode # deps
]; ];
}; };
} }

View File

@ -1,36 +1,43 @@
{ lib {
, stdenv lib,
, callPackage stdenv,
, symlinkJoin callPackage,
, makeBinaryWrapper symlinkJoin,
, desktopToDarwinBundle makeBinaryWrapper,
, ghidra desktopToDarwinBundle,
ghidra,
}: }:
let let
ghidra-extensions = callPackage ./extensions.nix { inherit ghidra; }; ghidra-extensions = callPackage ./extensions.nix { inherit ghidra; };
allExtensions = lib.filterAttrs (n: pkg: lib.isDerivation pkg) ghidra-extensions; allExtensions = lib.filterAttrs (n: pkg: lib.isDerivation pkg) ghidra-extensions;
/* Make Ghidra with additional extensions /*
Example: Make Ghidra with additional extensions
pkgs.ghidra.withExtensions (p: with p; [ Example:
ghostrings pkgs.ghidra.withExtensions (p: with p; [
]); ghostrings
=> /nix/store/3yn0rbnz5mbrxf0x70jbjq73wgkszr5c-ghidra-with-extensions-10.2.2 ]);
=> /nix/store/3yn0rbnz5mbrxf0x70jbjq73wgkszr5c-ghidra-with-extensions-10.2.2
*/ */
withExtensions = f: (symlinkJoin { withExtensions =
name = "${ghidra.pname}-with-extensions-${lib.getVersion ghidra}"; f:
paths = (f allExtensions); (symlinkJoin {
nativeBuildInputs = [ makeBinaryWrapper ] name = "${ghidra.pname}-with-extensions-${lib.getVersion ghidra}";
++ lib.optional stdenv.hostPlatform.isDarwin desktopToDarwinBundle; paths = (f allExtensions);
postBuild = '' nativeBuildInputs = [
makeWrapper '${ghidra}/bin/ghidra' "$out/bin/ghidra" \ makeBinaryWrapper
--set NIX_GHIDRAHOME "$out/lib/ghidra/Ghidra" ] ++ lib.optional stdenv.hostPlatform.isDarwin desktopToDarwinBundle;
ln -s ${ghidra}/share $out/share postBuild =
'' + lib.optionalString stdenv.hostPlatform.isDarwin '' ''
convertDesktopFiles $prefix makeWrapper '${ghidra}/bin/ghidra' "$out/bin/ghidra" \
''; --set NIX_GHIDRAHOME "$out/lib/ghidra/Ghidra"
inherit (ghidra) meta; ln -s ${ghidra}/share $out/share
}); ''
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
convertDesktopFiles $prefix
'';
inherit (ghidra) meta;
});
in in
withExtensions withExtensions