push sheeet
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
+108
View File
@@ -0,0 +1,108 @@
{
lib,
stdenv,
fetchurl,
buildPackages,
pkg-config,
glib,
gpm,
file,
e2fsprogs,
libICE,
perl,
zip,
unzip,
gettext,
slang,
libssh2,
openssl,
coreutils,
darwin,
x11Support ? true,
libX11,
# updater only
writeScript,
}:
stdenv.mkDerivation rec {
pname = "mc";
version = "4.8.33";
src = fetchurl {
url = "https://ftp.osuosl.org/pub/midnightcommander/${pname}-${version}.tar.xz";
hash = "sha256-yuFJ1C+ETlGF2MgdfbOROo+iFMZfhSIAqdiWtGivFkw=";
};
nativeBuildInputs = [
pkg-config
unzip
]
# The preFixup hook rewrites the binary, which invaliates the code
# signature. Add the fixup hook to sign the output.
++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [
darwin.autoSignDarwinBinariesHook
];
buildInputs = [
file
gettext
glib
libICE
libssh2
openssl
slang
zip
]
++ lib.optionals x11Support [ libX11 ]
++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
e2fsprogs
gpm
];
enableParallelBuilding = true;
configureFlags = [
# used for vfs helpers at run time:
"PERL=${perl}/bin/perl"
# used for .hlp generation at build time:
"PERL_FOR_BUILD=${buildPackages.perl}/bin/perl"
# configure arguments have a bunch of build-only dependencies.
# Avoid their retention in final closure.
"--disable-configure-args"
];
postPatch = ''
substituteInPlace src/filemanager/ext.c \
--replace /bin/rm ${coreutils}/bin/rm
'';
postFixup = lib.optionalString ((!stdenv.hostPlatform.isDarwin) && x11Support) ''
# libX11.so is loaded dynamically so autopatch doesn't detect it
patchelf \
--add-needed ${libX11}/lib/libX11.so \
$out/bin/mc
'';
passthru.updateScript = writeScript "update-mc" ''
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl pcre common-updater-scripts
set -eu -o pipefail
# Expect the text in format of "Current version is: 4.8.27; ...".
new_version="$(curl -s https://midnight-commander.org/ | pcregrep -o1 'Current version is: (([0-9]+\.?)+);')"
update-source-version mc "$new_version"
'';
meta = with lib; {
description = "File Manager and User Shell for the GNU Project, known as Midnight Commander";
downloadPage = "https://ftp.osuosl.org/pub/midnightcommander/";
homepage = "https://midnight-commander.org";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ sander ];
platforms = platforms.linux ++ platforms.darwin;
mainProgram = "mc";
};
}
+61
View File
@@ -0,0 +1,61 @@
{
lib,
stdenv,
fetchurl,
fetchpatch,
openssl,
ncurses,
pkg-config,
glib,
loudmouth,
libotr,
gpgme,
}:
stdenv.mkDerivation rec {
pname = "mcabber";
version = "1.1.2";
src = fetchurl {
url = "https://mcabber.com/files/mcabber-${version}.tar.bz2";
sha256 = "0q1i5acyghsmzas88qswvki8kkk2nfpr8zapgnxbcd3lwcxl38f4";
};
patches = [
# Pull upstream patch for ncurses-6.3.
(fetchpatch {
name = "ncurses-6.3.patch";
url = "https://github.com/McKael/mcabber/commit/5a0893d69023b77b7671731defbdca5d47731130.patch";
sha256 = "01bc23z0mva9l9jv587sq2r9w3diachgkmb9ad99hlzgj02fmq4v";
stripLen = 1;
})
];
nativeBuildInputs = [ pkg-config ];
buildInputs = [
openssl
ncurses
glib
loudmouth
libotr
gpgme
];
configureFlags = [
"--with-openssl=${openssl.dev}"
"--enable-modules"
"--enable-otr"
];
doCheck = true;
meta = with lib; {
homepage = "http://mcabber.com/";
description = "Small Jabber console client";
mainProgram = "mcabber";
license = licenses.gpl2;
maintainers = with maintainers; [ pSub ];
platforms = with platforms; linux;
downloadPage = "http://mcabber.com/files/";
};
}
+53
View File
@@ -0,0 +1,53 @@
{
lib,
stdenv,
fetchFromGitHub,
fontconfig,
libX11,
libXext,
libXft,
ncurses,
pkg-config,
nix-update-script,
}:
stdenv.mkDerivation {
pname = "mcaimi-st";
version = "0-unstable-2025-09-22";
src = fetchFromGitHub {
owner = "mcaimi";
repo = "st";
rev = "667ded8e13457b0ba9d84b98545885e5a3e9dcc7";
hash = "sha256-LbMxZhNs0sfgTm0R+BqxZpUPjs0Y3a2H40BYdMzO2CU=";
};
nativeBuildInputs = [
pkg-config
];
buildInputs = [
fontconfig
libX11
libXext
libXft
ncurses
];
installFlags = [
"TERMINFO=$(out)/share/terminfo"
"PREFIX=$(out)"
];
passthru.updateScript = nix-update-script {
extraArgs = [ "--version=branch" ];
};
meta = {
homepage = "https://github.com/mcaimi/st";
description = "Suckless Terminal fork";
mainProgram = "st";
license = lib.licenses.mit;
maintainers = [ ];
platforms = lib.platforms.linux;
};
}
+88
View File
@@ -0,0 +1,88 @@
{
stdenv,
lib,
buildGoModule,
buildPackages,
fetchFromGitHub,
installShellFiles,
nix-update-script,
}:
let
version = "0.0.55";
in
buildGoModule {
pname = "mcap-cli";
inherit version;
src = fetchFromGitHub {
repo = "mcap";
owner = "foxglove";
rev = "releases/mcap-cli/v${version}";
hash = "sha256-3HV7FNlS91J089FgtKOQEXCzQEoDR39w0kBB8H88rSw=";
};
vendorHash = "sha256-twuXJXiGhjTqlEZ3xD8G9CruSLxFC33PMs2GZadl1Ow=";
nativeBuildInputs = [
installShellFiles
];
modRoot = "go/cli/mcap";
tags = [
"sqlite_omit_load_extension"
]
++ lib.optionals stdenv.isLinux [
"netgo"
"osusergo"
];
ldflags = [ "-X github.com/foxglove/mcap/go/cli/mcap/cmd.Version=${version}" ];
env = {
CGO_ENABLED = "1";
GOWORK = "off";
};
# copy the local versions of the workspace modules
postConfigure = ''
chmod -R u+w vendor
rm -rf vendor/github.com/foxglove/mcap/go/{mcap,ros}
cp -r ../../{mcap,ros} vendor/github.com/foxglove/mcap/go
'';
checkFlags = [
# requires git-lfs and network
# https://github.com/foxglove/mcap/issues/895
"-skip=TestCat|TestInfo|TestRequiresDuplicatedSchemasForIndexedMessages|TestPassesIndexedMessagesWithRepeatedSchemas|TestSortFile"
];
postInstall = lib.optionalString (stdenv.hostPlatform.emulatorAvailable buildPackages) (
let
emulator = stdenv.hostPlatform.emulator buildPackages;
in
''
installShellCompletion --cmd mcap \
--bash <(${emulator} $out/bin/mcap completion bash) \
--fish <(${emulator} $out/bin/mcap completion fish) \
--zsh <(${emulator} $out/bin/mcap completion zsh)
''
);
passthru = {
updateScript = nix-update-script { };
};
meta = with lib; {
description = "MCAP CLI tool to inspect and fix MCAP files";
homepage = "https://github.com/foxglove/mcap";
license = with licenses; [ mit ];
maintainers = with maintainers; [
squalus
therishidesai
];
mainProgram = "mcap";
};
}
+58
View File
@@ -0,0 +1,58 @@
{
lib,
stdenvNoCC,
fetchurl,
makeWrapper,
wrapGAppsHook3,
jre,
}:
let
jre' = jre.override {
enableJavaFX = true;
};
in
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "mcaselector";
version = "2.5.3";
src = fetchurl {
url = "https://github.com/Querz/mcaselector/releases/download/${finalAttrs.version}/mcaselector-${finalAttrs.version}.jar";
hash = "sha256-PQCXwtEK+Tq1cRJDkzlQ43dhdQ3J+bd8x/ymvsfIfdA=";
};
dontUnpack = true;
dontBuild = true;
nativeBuildInputs = [
jre'
makeWrapper
wrapGAppsHook3
];
dontWrapGApps = true;
installPhase = ''
runHook preInstall
mkdir -p $out/{bin,lib/mcaselector}
cp $src $out/lib/mcaselector/mcaselector.jar
runHook postInstall
'';
preFixup = ''
makeWrapper ${jre'}/bin/java $out/bin/mcaselector \
--add-flags "-jar $out/lib/mcaselector/mcaselector.jar" \
''${gappsWrapperArgs[@]}
'';
meta = with lib; {
homepage = "https://github.com/Querz/mcaselector";
description = "Tool to select chunks from Minecraft worlds for deletion or export";
mainProgram = "mcaselector";
sourceProvenance = with sourceTypes; [ binaryBytecode ];
license = licenses.mit;
maintainers = [ maintainers.Scrumplex ];
platforms = platforms.linux;
};
})
@@ -0,0 +1,56 @@
{
lib,
rustPlatform,
fetchFromGitHub,
installShellFiles,
stdenv,
buildPackages,
nix-update-script,
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "mcat-unwrapped";
version = "0.4.4";
src = fetchFromGitHub {
owner = "Skardyy";
repo = "mcat";
tag = "v${finalAttrs.version}";
hash = "sha256-URAgoarWC+GGCF+nUGqhmDmh1PX2/Ry5U8e8HrHFGHk=";
};
cargoHash = "sha256-c3OJURz6eObjIC6AHUP6l/a5zYFV0QZ3VIxShFCcm4U=";
nativeBuildInputs = [
installShellFiles
];
postInstall =
let
mcat =
if stdenv.buildPlatform.canExecute stdenv.hostPlatform then
placeholder "out"
else
buildPackages.mcat-unwrapped;
in
''
installShellCompletion --cmd mcat \
--bash <(${mcat}/bin/mcat --generate bash) \
--fish <(${mcat}/bin/mcat --generate fish) \
--zsh <(${mcat}/bin/mcat --generate zsh)
'';
passthru = {
updateScript = nix-update-script { };
};
meta = {
description = "cat command for documents / images / videos and more";
homepage = "https://github.com/Skardyy/mcat";
changelog = "https://github.com/Skardyy/mcat/blob/v${finalAttrs.version}/CHANGELOG.md";
license = lib.licenses.mit;
mainProgram = "mcat";
maintainers = with lib.maintainers; [
louis-thevenet
];
};
})
+25
View File
@@ -0,0 +1,25 @@
{
runCommand,
mcat-unwrapped,
makeWrapper,
lib,
chromium,
ffmpeg-headless,
useChromium ? false,
useFfmpeg ? false,
}:
runCommand "mcat"
{
pname = "mcat";
inherit (mcat-unwrapped) version meta;
nativeBuildInputs = [ makeWrapper ];
}
''
mkdir -p $out/bin
ln -s "${mcat-unwrapped}/share" "$out/share"
makeWrapper ${lib.getExe mcat-unwrapped} $out/bin/mcat --prefix PATH : ${
lib.makeBinPath ((lib.optional useChromium chromium) ++ (lib.optional useFfmpeg ffmpeg-headless))
}
''
+1
View File
@@ -0,0 +1 @@
{ python3Packages }: with python3Packages; toPythonApplication mcdreforged
+51
View File
@@ -0,0 +1,51 @@
{
lib,
stdenv,
fetchFromGitHub,
bison,
flex,
}:
stdenv.mkDerivation {
pname = "mceinject";
version = "0-unstable-2013-01-19";
src = fetchFromGitHub {
owner = "andikleen";
repo = "mce-inject";
rev = "4cbe46321b4a81365ff3aafafe63967264dbfec5";
sha256 = "0gjapg2hrlxp8ssrnhvc19i3r1xpcnql7xv0zjgbv09zyha08g6z";
};
nativeBuildInputs = [
flex
bison
];
env.NIX_CFLAGS_COMPILE = "-Os -g -Wall";
NIX_LDFLAGS = [ "-lpthread" ];
makeFlags = [ "prefix=" ];
enableParallelBuilding = true;
installFlags = [
"destdir=$(out)"
"manprefix=/share"
];
meta = with lib; {
description = "Tool to inject machine checks into x86 kernel for testing";
mainProgram = "mce-inject";
longDescription = ''
mce-inject allows to inject machine check errors on the software level
into a running Linux kernel. This is intended for validation of the
kernel machine check handler.
'';
homepage = "https://github.com/andikleen/mce-inject/";
license = licenses.gpl2Only;
maintainers = with maintainers; [ arkivm ];
platforms = platforms.linux;
};
}
+33
View File
@@ -0,0 +1,33 @@
{
lib,
rustPlatform,
fetchFromGitHub,
}:
rustPlatform.buildRustPackage rec {
pname = "mcfly-fzf";
version = "0.1.3";
src = fetchFromGitHub {
owner = "bnprks";
repo = "mcfly-fzf";
rev = version;
hash = "sha256-ZdsbkN+/NLA0vor6/eEdAI7V5m5GEi+phcJQ89Jp4fk=";
};
postPatch = ''
substituteInPlace shell/mcfly-fzf.bash --replace '$(command -v mcfly-fzf)' '${placeholder "out"}/bin/mcfly-fzf'
substituteInPlace shell/mcfly-fzf.zsh --replace '$(command -v mcfly-fzf)' '${placeholder "out"}/bin/mcfly-fzf'
substituteInPlace shell/mcfly-fzf.fish --replace '(command -v mcfly-fzf)' '${placeholder "out"}/bin/mcfly-fzf'
'';
cargoHash = "sha256-xHYOhq/vDmjP7RfgRR15Isj7rg/nIV9tz9XznHBENig=";
meta = with lib; {
homepage = "https://github.com/bnprks/mcfly-fzf";
description = "Integrate Mcfly with fzf to combine a solid command history database with a widely-loved fuzzy search UI";
license = licenses.mit;
maintainers = [ maintainers.simonhammes ];
mainProgram = "mcfly-fzf";
};
}
+34
View File
@@ -0,0 +1,34 @@
{
lib,
rustPlatform,
fetchFromGitHub,
}:
rustPlatform.buildRustPackage rec {
pname = "mcfly";
version = "0.9.3";
src = fetchFromGitHub {
owner = "cantino";
repo = "mcfly";
rev = "v${version}";
hash = "sha256-eRuMsUN5zRWsM5BqYHI9iSfoHHMu5ugZDjeDc1GGQL8=";
};
postPatch = ''
substituteInPlace mcfly.bash --replace '$(command which mcfly)' '${placeholder "out"}/bin/mcfly'
substituteInPlace mcfly.zsh --replace '$(command which mcfly)' '${placeholder "out"}/bin/mcfly'
substituteInPlace mcfly.fish --replace '(command which mcfly)' '${placeholder "out"}/bin/mcfly'
'';
cargoHash = "sha256-9oNfXNQywvgTREa0G1UbId4ezLSCem4IBkqE5X234hE=";
meta = {
homepage = "https://github.com/cantino/mcfly";
description = "Upgraded ctrl-r where history results make sense for what you're working on right now";
changelog = "https://github.com/cantino/mcfly/raw/v${version}/CHANGELOG.txt";
license = lib.licenses.mit;
maintainers = [ lib.maintainers.melkor333 ];
mainProgram = "mcfly";
};
}
+42
View File
@@ -0,0 +1,42 @@
{
lib,
rustPlatform,
fetchFromGitHub,
pkg-config,
openssl,
sqlite,
zlib,
}:
rustPlatform.buildRustPackage rec {
pname = "mchprs";
version = "0.5.1";
src = fetchFromGitHub {
owner = "MCHPR";
repo = "MCHPRS";
tag = "v${version}";
hash = "sha256-Jm9ZsqCKOIxZsXQbCluYu7MgOD7hXYljcv/URaNVUW0=";
};
cargoHash = "sha256-YDfyixNfJsKigf3W5265CWl4ETQDeBHYpquBoFoj4Tw=";
nativeBuildInputs = [
pkg-config
rustPlatform.bindgenHook
];
buildInputs = [
openssl
sqlite
zlib
];
meta = with lib; {
mainProgram = "mchprs";
description = "Multithreaded Minecraft server built for redstone";
homepage = "https://github.com/MCHPR/MCHPRS";
license = licenses.mit;
maintainers = with maintainers; [ gdd ];
};
}
+84
View File
@@ -0,0 +1,84 @@
{
lib,
fetchurl,
gdk-pixbuf,
gobject-introspection,
gtk3,
mcomix,
python312, # TODO: Revert to python3 when upgrading past 3.1.0
testers,
wrapGAppsHook3,
# Recommended Dependencies:
p7zip,
unrar,
chardetSupport ? true,
pdfSupport ? true,
unrarSupport ? false, # unfree software
}:
python312.pkgs.buildPythonApplication rec {
pname = "mcomix";
version = "3.1.0";
pyproject = true;
src = fetchurl {
url = "mirror://sourceforge/mcomix/mcomix-${version}.tar.gz";
hash = "sha256-+Shuun/7w86VKBNamTmCPEJfO76fdKY5+HBvzCi0xCc=";
};
buildInputs = [
gtk3
gdk-pixbuf
];
nativeBuildInputs = [
gobject-introspection
python312.pkgs.setuptools
wrapGAppsHook3
];
propagatedBuildInputs =
with python312.pkgs;
[
pillow
pycairo
pygobject3
]
++ lib.optionals chardetSupport [ chardet ]
++ lib.optionals pdfSupport [ pymupdf ];
# No tests included in .tar.gz
doCheck = false;
# Prevent double wrapping
dontWrapGApps = true;
preFixup = ''
makeWrapperArgs+=(
"''${gappsWrapperArgs[@]}"
"--prefix" "PATH" ":" "${lib.makeBinPath ([ p7zip ] ++ lib.optional unrarSupport unrar)}"
)
'';
postInstall = ''
cp -a share $out/
'';
passthru.tests.version = testers.testVersion {
package = mcomix;
};
meta = with lib; {
description = "Comic book reader and image viewer";
mainProgram = "mcomix";
longDescription = ''
User-friendly, customizable image viewer, specifically designed to handle
comic books and manga supporting a variety of container formats
(including CBR, CBZ, CB7, CBT, LHA and PDF)
'';
homepage = "https://sourceforge.net/projects/mcomix/";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ thiagokokada ];
};
}
@@ -0,0 +1,71 @@
{
lib,
stdenv,
qt6,
makeDesktopItem,
copyDesktopItems,
fetchFromGitHub,
cmake,
kmod,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "mcontrolcenter";
version = "0.5.1";
src = fetchFromGitHub {
owner = "dmitry-s93";
repo = "MControlCenter";
rev = finalAttrs.version;
hash = "sha256-uWxEWLb2QOZlJ1d3LbORCc81kILB9N+0bzr+xzHAa7Y=";
};
postPatch = ''
substituteInPlace src/helper/helper.cpp \
--replace-fail "/usr/sbin/modprobe" "${kmod}/bin/modprobe"
substituteInPlace src/helper/mcontrolcenter.helper.service \
--replace-fail "/usr" "$out"
'';
desktopItems = [
(makeDesktopItem {
name = "MControlCenter";
exec = "mcontrolcenter";
icon = "mcontrolcenter";
comment = finalAttrs.meta.description;
desktopName = "MControlCenter";
categories = [ "System" ];
})
];
nativeBuildInputs = [
qt6.wrapQtAppsHook
qt6.qttools
copyDesktopItems
cmake
];
buildInputs = [
qt6.qtbase
kmod
];
installPhase = ''
runHook preInstall
install -Dm755 mcontrolcenter $out/bin/mcontrolcenter
install -Dm755 helper/mcontrolcenter-helper $out/libexec/mcontrolcenter-helper
install -Dm644 ../resources/mcontrolcenter.svg $out/share/icons/hicolor/scalable/apps/mcontrolcenter.svg
install -Dm644 ../src/helper/mcontrolcenter-helper.conf $out/share/dbus-1/system.d/mcontrolcenter-helper.conf
install -Dm644 ../src/helper/mcontrolcenter.helper.service $out/share/dbus-1/system-services/mcontrolcenter.helper.service
runHook postInstall
'';
meta = {
homepage = "https://github.com/dmitry-s93/MControlCenter";
description = "Tool to change the settings of MSI laptops running Linux";
license = lib.licenses.gpl3Plus;
platforms = lib.platforms.linux;
maintainers = [ lib.maintainers.Tommimon ];
mainProgram = "mcontrolcenter";
};
})
+38
View File
@@ -0,0 +1,38 @@
{
lib,
buildGoModule,
fetchFromGitHub,
}:
buildGoModule (finalAttrs: {
pname = "mcp-grafana";
version = "0.7.0";
src = fetchFromGitHub {
owner = "grafana";
repo = "mcp-grafana";
tag = "v${finalAttrs.version}";
hash = "sha256-uI8KlmgWcXYQwo2Wwx4NkZ+AyWibpi0VAjFeRLDp/cs=";
};
vendorHash = "sha256-W33myluCqCt1QHU+Fpd954Gxvum8ktQ/IZODxaFhk/k=";
ldflags = [
"-s"
"-w"
];
postInstall = ''
rm $out/bin/jsonschema
'';
__darwinAllowLocalNetworking = true;
meta = {
description = "MCP server for Grafana";
homepage = "https://github.com/grafana/mcp-grafana";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ pilz ];
mainProgram = "mcp-grafana";
};
})
+42
View File
@@ -0,0 +1,42 @@
{
lib,
buildGoModule,
fetchFromGitHub,
versionCheckHook,
}:
buildGoModule (finalAttrs: {
pname = "mcp-k8s-go";
version = "0.5.0";
src = fetchFromGitHub {
owner = "strowk";
repo = "mcp-k8s-go";
tag = "v${finalAttrs.version}";
hash = "sha256-4pS0X1G/wGemBkLC9UFLHxaRLtCDALIRPnOCzAf/6JA=";
};
vendorHash = "sha256-BPmocRaqqV7p5Yjto3UEbzc2vdlyRSGkdPye3EWXEe4=";
doCheck = false;
ldflags = [
"-s"
"-w"
"-X main.version=${finalAttrs.version}"
];
nativeInstallCheckInputs = [
versionCheckHook
];
doInstallCheck = true;
versionCheckProgramArg = "--version";
meta = {
description = "MCP server connecting to Kubernetes";
homepage = "https://github.com/strowk/mcp-k8s-go";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ pilz ];
mainProgram = "mcp-k8s-go";
};
})
+66
View File
@@ -0,0 +1,66 @@
{
lib,
fetchFromGitHub,
python3Packages,
}:
python3Packages.buildPythonApplication rec {
pname = "mcp-nixos";
version = "1.0.2";
pyproject = true;
src = fetchFromGitHub {
owner = "utensils";
repo = "mcp-nixos";
tag = "v${version}";
hash = "sha256-SbmfP5Qo7liu39tTpIm6IC2qfwChooTYaPZiJqgwTzY=";
};
patches = [
# This patch mocks nix channel listing network calls in tests
./tests-mock-nix-channels.patch
];
build-system = [ python3Packages.hatchling ];
dependencies = with python3Packages; [
beautifulsoup4
fastmcp
mcp
requests
];
pythonRelaxDeps = [ "fastmcp" ];
nativeCheckInputs = with python3Packages; [
anthropic
pytestCheckHook
pytest-asyncio
python-dotenv
];
disabledTestMarks = [
# Require network access
"integration"
];
disabledTestPaths = [
# Require network access
"tests/test_nixhub.py"
"tests/test_mcp_behavior.py"
"tests/test_options.py"
# Requires configured channels
"tests/test_channels.py"
];
pythonImportsCheck = [ "mcp_nixos" ];
meta = {
description = "MCP server for NixOS";
homepage = "https://github.com/utensils/mcp-nixos";
changelog = "https://github.com/utensils/mcp-nixos/releases/tag/${src.tag}";
license = lib.licenses.mit;
maintainers = [ lib.maintainers.amadejkastelic ];
mainProgram = "mcp-nixos";
};
}
@@ -0,0 +1,32 @@
diff --git a/tests/conftest.py b/tests/conftest.py
index baae124..2b4bf01 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -1,6 +1,27 @@
"""Minimal test configuration for refactored MCP-NixOS."""
+import pytest
+@pytest.fixture(autouse=True)
+def mock_get_channels(monkeypatch):
+ """Mock get_channels function to return fixed channels for all tests."""
+ def mock_channels():
+ return {
+ "unstable": "latest-43-nixos-unstable",
+ "25.05": "latest-43-nixos-25.05",
+ "25.11": "latest-43-nixos-25.11",
+ "24.11": "latest-43-nixos-24.11",
+ "stable": "latest-43-nixos-25.05",
+ "beta": "latest-43-nixos-25.05"
+ }
+
+ # Patch the function in the server module
+ monkeypatch.setattr('mcp_nixos.server.get_channels', mock_channels)
+
+ # Also patch any imported references in test modules
+ monkeypatch.setattr('tests.test_server.get_channels', mock_channels)
+
+
def pytest_addoption(parser):
"""Add test filtering options."""
parser.addoption("--unit", action="store_true", help="Run unit tests only")
+50
View File
@@ -0,0 +1,50 @@
{
lib,
python3Packages,
fetchFromGitHub,
}:
python3Packages.buildPythonApplication rec {
pname = "mcp-proxy";
version = "0.8.2";
src = fetchFromGitHub {
owner = "sparfenyuk";
repo = "mcp-proxy";
tag = "v${version}";
hash = "sha256-3hNpUOWbyOUjLcvfcMzj4+xHyUl7k1ZSy8muWHvSEvM=";
};
pyproject = true;
build-system = [ python3Packages.setuptools ];
dependencies = with python3Packages; [
uvicorn
mcp
];
nativeCheckInputs = with python3Packages; [
pytestCheckHook
pytest-asyncio
];
disabledTests = [
# AssertionError: expected call not found.
# Expected: mock(PromptReference(type='ref/prompt', name='name'), CompletionArgument(name='name', value='value'))
# Actual: mock(PromptReference(type='ref/prompt', name='name'), CompletionArgument(name='name', value='value'), None)
"test_call_tool[server-AsyncMock]"
"test_call_tool[proxy-AsyncMock]"
"test_complete[server-AsyncMock]"
"test_complete[proxy-AsyncMock]"
];
__darwinAllowLocalNetworking = true;
meta = {
description = "MCP server which proxies other MCP servers from stdio to SSE or from SSE to stdio";
homepage = "https://github.com/sparfenyuk/mcp-proxy";
mainProgram = "mcp-proxy";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ keyruu ];
};
}
@@ -0,0 +1,25 @@
diff --git a/ext/glfw.cmake b/ext/glfw.cmake
index 5487f32..feeb89f 100644
--- a/ext/glfw.cmake
+++ b/ext/glfw.cmake
@@ -1,18 +1,2 @@
-include(FetchContent)
-
-set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE)
-set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE)
-set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
-set(GLFW_INSTALL OFF CACHE BOOL "" FORCE)
-
-FetchContent_Declare(
- glfw3_ext
- URL "https://github.com/minecraft-linux/glfw/archive/fce9121962bc0a21c39e2d6f8e08bad30c566c72.zip"
-)
-
-FetchContent_GetProperties(glfw3_ext)
-if(NOT glfw3_ext_POPULATED)
- FetchContent_Populate(glfw3_ext)
- add_subdirectory(${glfw3_ext_SOURCE_DIR} ${glfw3_ext_BINARY_DIR})
-endif()
+find_package(glfw3 REQUIRED)
add_library(glfw3 ALIAS glfw)
\ No newline at end of file
@@ -0,0 +1,123 @@
{
lib,
clangStdenv,
stdenv,
fetchFromGitHub,
cmake,
pkg-config,
openssl,
zlib,
libpng,
libglvnd,
xorg,
libevdev,
curl,
pulseaudio,
qt6,
glfw,
withQtWebview ? true,
withQtErrorWindow ? true,
fetchzip,
zenity,
xdg-utils,
sdl3,
}:
# Bionic libc part doesn't compile with GCC
clangStdenv.mkDerivation (finalAttrs: {
pname = "mcpelauncher-client";
version = "1.4.0-qt6";
# NOTE: check mcpelauncher-ui-qt when updating
src = fetchFromGitHub {
owner = "minecraft-linux";
repo = "mcpelauncher-manifest";
tag = "v${finalAttrs.version}";
fetchSubmodules = true;
hash = "sha256-2YmsxcR4EipnBIBqoM8g6hOCCh1WKooukqXhP/1X6tU=";
};
patches = [ ./dont_download_glfw_client.patch ];
# Path hard-coded paths.
postPatch = lib.optionalString stdenv.hostPlatform.isLinux ''
substituteInPlace mcpelauncher-client/src/jni/main_activity.cpp \
--replace-fail /usr/bin/xdg-open ${xdg-utils}/bin/xdg-open \
--replace-fail /usr/bin/zenity ${lib.getExe zenity}
substituteInPlace file-picker/src/file_picker_zenity.cpp \
--replace-fail 'EXECUTABLE_NAME = "zenity"' 'EXECUTABLE_NAME = "${lib.getExe zenity}"'
'';
# FORTIFY_SOURCE breaks libc_shim and the project will fail to compile
hardeningDisable = [ "fortify" ];
nativeBuildInputs = [
cmake
pkg-config
]
++ lib.optionals (withQtWebview || withQtErrorWindow) [
qt6.wrapQtAppsHook
];
buildInputs = [
openssl
zlib
libpng
libglvnd
xorg.libX11
xorg.libXi
xorg.libXtst
libevdev
curl
pulseaudio
glfw
sdl3
]
++ lib.optionals (withQtWebview || withQtErrorWindow) [
qt6.qtbase
qt6.qttools
qt6.qtwayland
]
++ lib.optionals withQtWebview [
qt6.qtwebengine
];
cmakeFlags = [
(lib.cmakeBool "FETCHCONTENT_FULLY_DISCONNECTED" true)
(lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_NLOHMANN_JSON_EXT" (
toString (fetchzip {
url = "https://github.com/nlohmann/json/releases/download/v3.7.3/include.zip";
hash = "sha256-h8czZ4f5vZqvHkDVQawrQdUeQnWxewu4OONisqlrmmM=";
stripRoot = false;
})
))
(lib.cmakeBool "USE_OWN_CURL" false)
(lib.cmakeBool "ENABLE_DEV_PATHS" false)
(lib.cmakeFeature "GAMEWINDOW_SYSTEM" "GLFW")
(lib.cmakeBool "USE_SDL3_AUDIO" false)
(lib.cmakeBool "BUILD_WEBVIEW" withQtWebview)
(lib.cmakeBool "XAL_WEBVIEW_USE_CLI" (!withQtWebview))
(lib.cmakeBool "XAL_WEBVIEW_USE_QT" withQtWebview)
(lib.cmakeBool "ENABLE_QT_ERROR_UI" withQtErrorWindow)
];
meta = {
description = "Unofficial Minecraft Bedrock Edition launcher with CLI";
homepage = "https://minecraft-linux.github.io";
license = lib.licenses.gpl3Plus;
maintainers = with lib.maintainers; [
aleksana
morxemplum
phanirithvij
];
mainProgram = "mcpelauncher-client";
platforms = lib.platforms.unix;
# Minecraft Bedrock Edition is raising minimal OpenGL version to OpenGL ES 3.1
# which is currently not supported on macOS.
# https://github.com/minecraft-linux/mcpelauncher-manifest/issues/1042
# https://help.minecraft.net/hc/en-us/articles/30298767427597-Upcoming-OS-Sunset-Announcements-in-Minecraft
# The program is also not tested on darwin. Any help from darwin users are welcomed.
badPlatforms = lib.platforms.darwin;
};
})
@@ -0,0 +1,24 @@
diff -urB mcpelauncher-ui/mcpelauncher-ui-qt/ext/glfw.cmake mcpelauncher-ui-b/mcpelauncher-ui-qt/ext/glfw.cmake
--- mcpelauncher-ui/mcpelauncher-ui-qt/ext/glfw.cmake 2024-11-28 21:12:36.794926431 -0700
+++ mcpelauncher-ui-b/mcpelauncher-ui-qt/ext/glfw.cmake 2024-12-03 15:04:28.466197081 -0700
@@ -1,19 +1,2 @@
-include(FetchContent)
-
-set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE)
-set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE)
-set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
-set(GLFW_INSTALL OFF CACHE BOOL "" FORCE)
-set(GLFW_BUILD_WAYLAND OFF CACHE BOOL "" FORCE)
-
-FetchContent_Declare(
- glfw3_ext
- URL "https://github.com/glfw/glfw/archive/master.zip"
-)
-
-FetchContent_GetProperties(glfw3_ext)
-if(NOT glfw3_ext_POPULATED)
- FetchContent_Populate(glfw3_ext)
- add_subdirectory(${glfw3_ext_SOURCE_DIR} ${glfw3_ext_BINARY_DIR})
-endif()
+find_package(glfw3 REQUIRED)
add_library(glfw3 ALIAS glfw)
@@ -0,0 +1,62 @@
{
lib,
stdenv,
mcpelauncher-client,
fetchFromGitHub,
cmake,
pkg-config,
zlib,
libzip,
curl,
protobuf,
qt6,
glfw,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "mcpelauncher-ui-qt";
inherit (mcpelauncher-client) version;
src = fetchFromGitHub {
owner = "minecraft-linux";
repo = "mcpelauncher-ui-manifest";
tag = "v${finalAttrs.version}";
fetchSubmodules = true;
hash = "sha256-W97PIb2NTfmqLsIQgrJkOb+8n3fDzlE91sDvgJbNFwY=";
};
patches = [
./dont_download_glfw_ui.patch
];
nativeBuildInputs = [
cmake
pkg-config
qt6.wrapQtAppsHook
];
buildInputs = [
zlib
libzip
curl
protobuf
qt6.qtwebengine
qt6.qtsvg
qt6.qtwayland
glfw
];
# the program refuses to start when QT_STYLE_OVERRIDE is set
# https://github.com/minecraft-linux/mcpelauncher-ui-qt/issues/25
preFixup = ''
qtWrapperArgs+=(
--prefix PATH : ${lib.makeBinPath [ mcpelauncher-client ]}
--unset QT_STYLE_OVERRIDE
)
'';
meta = mcpelauncher-client.meta // {
description = "Unofficial Minecraft Bedrock Edition launcher with GUI";
mainProgram = "mcpelauncher-ui-qt";
};
})
+27
View File
@@ -0,0 +1,27 @@
{
lib,
buildGoModule,
fetchFromGitHub,
}:
buildGoModule (finalAttrs: {
pname = "mcphost";
version = "0.19.2";
src = fetchFromGitHub {
owner = "mark3labs";
repo = "mcphost";
tag = "v${finalAttrs.version}";
hash = "sha256-BDG4df7YG5cKjL8zsbvK4xFJMwyjSPx4jnDKwPVm+zw=";
};
vendorHash = "sha256-U/XtO4OhcioaSU2iGTNmvEilp9+Yu3TVafzNEaFcWEg=";
meta = {
description = "CLI host application that enables Large Language Models (LLMs) to interact with external tools through the Model Context Protocol (MCP)";
homepage = "https://github.com/mark3labs/mcphost";
license = lib.licenses.mit;
maintainers = [ ];
mainProgram = "mcphost";
};
})
+36
View File
@@ -0,0 +1,36 @@
{
lib,
stdenv,
fetchFromGitHub,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "mcpp";
version = "2.7.2.2";
src = fetchFromGitHub {
owner = "museoa";
repo = "mcpp";
rev = finalAttrs.version;
hash = "sha256-wz225bhBF0lFerOAhl8Rwmw8ItHd9BXQceweD9BqvEQ=";
};
env = lib.optionalAttrs stdenv.cc.isGNU {
NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types";
};
patches = [
./readlink.patch
];
configureFlags = [ "--enable-mcpplib" ];
meta = with lib; {
homepage = "https://github.com/museoa/mcpp";
description = "Matsui's C preprocessor";
mainProgram = "mcpp";
license = licenses.bsd2;
maintainers = [ ];
platforms = platforms.unix;
};
})
+24
View File
@@ -0,0 +1,24 @@
From 1c4b0f26614bff331eb8a9f2b514309af6f31fd0 Mon Sep 17 00:00:00 2001
From: Jose <pepone@users.noreply.github.com>
Date: Mon, 26 Jun 2023 16:43:43 +0200
Subject: [PATCH] Add 'unistd' header for readlink (#8)
---
src/system.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/system.c b/src/system.c
index a3501f9..646caf6 100644
--- a/src/system.c
+++ b/src/system.c
@@ -37,6 +37,11 @@
* 2. append the system-dependent routines in this file.
*/
+
+#ifndef _MSC_VER
+# include <unistd.h> // For readlink()
+#endif
+
#if PREPROCESSED
#include "mcpp.H"
#else
+41
View File
@@ -0,0 +1,41 @@
{
lib,
stdenv,
fetchFromGitHub,
}:
stdenv.mkDerivation rec {
pname = "mcrcon";
version = "0.7.2";
src = fetchFromGitHub {
owner = "Tiiffi";
repo = "mcrcon";
rev = "v${version}";
sha256 = "sha256-cedeKsZgEyu0jqN4kBSgMJzFNUfCVXCEwH3M54miSG4=";
};
buildPhase = ''
$CC mcrcon.c -o mcrcon
'';
installPhase = ''
install -Dm 755 mcrcon $out/bin/mcrcon
'';
meta = {
homepage = "https://bukkit.org/threads/admin-rcon-mcrcon-remote-connection-client-for-minecraft-servers.70910/";
description = "Minecraft console client with Bukkit coloring support";
longDescription = ''
Mcrcon is a powerful Minecraft RCON terminal client with Bukkit coloring support.
It is well suited for remote administration and to be used as part of automated server maintenance scripts.
It does not trigger "IO: Broken pipe" or "IO: Connection reset" spam bugs on the server side.
'';
maintainers = with lib.maintainers; [ dermetfan ];
license = with lib.licenses; [
zlib
libpng
];
mainProgram = "mcrcon";
};
}
+45
View File
@@ -0,0 +1,45 @@
{
lib,
stdenv,
fetchurl,
cmake,
libGLU,
libGL,
qt6,
boost,
}:
stdenv.mkDerivation rec {
version = "202407";
build_nr = "1";
pname = "mcrl2";
src = fetchurl {
url = "https://www.mcrl2.org/download/release/mcrl2-${version}.${build_nr}.tar.gz";
hash = "sha256-VhP9BFSujxYMcQVu6P6k6yiH2UUhCB3P+Pj+9Ir7x6s=";
};
nativeBuildInputs = [ cmake ];
buildInputs = [
libGLU
libGL
qt6.qtbase
boost
];
dontWrapQtApps = true;
meta = with lib; {
broken = stdenv.hostPlatform.isDarwin;
description = "Toolset for model-checking concurrent systems and protocols";
longDescription = ''
A formal specification language with an associated toolset,
that can be used for modelling, validation and verification of
concurrent systems and protocols
'';
homepage = "https://www.mcrl2.org/";
license = licenses.boost;
maintainers = with maintainers; [ moretea ];
platforms = platforms.unix;
};
}
+44
View File
@@ -0,0 +1,44 @@
{
fetchurl,
lib,
stdenv,
guile,
pkg-config,
}:
stdenv.mkDerivation rec {
pname = "mcron";
version = "1.2.1";
src = fetchurl {
url = "mirror://gnu/mcron/mcron-${version}.tar.gz";
sha256 = "0bkn235g2ia4f7ispr9d55c7bc18282r3qd8ldhh5q2kiin75zi0";
};
# don't attempt to chmod +s files in the nix store
postPatch = ''
sed -E -i '/chmod u\+s/d' Makefile.in
'';
nativeBuildInputs = [ pkg-config ];
buildInputs = [ guile ];
doCheck = true;
meta = {
description = "Flexible implementation of `cron' in Guile";
longDescription = ''
The GNU package mcron (Mellor's cron) is a 100% compatible
replacement for Vixie cron. It is written in pure Guile, and
allows configuration files to be written in scheme (as well as
Vixie's original format) for infinite flexibility in specifying
when jobs should be run. Mcron was written by Dale Mellor.
'';
homepage = "https://www.gnu.org/software/mcron/";
license = lib.licenses.gpl3Plus;
platforms = lib.platforms.unix;
};
}
@@ -0,0 +1,31 @@
--- mcrypt-2.6.8/src/errors.c
+++ mcrypt-2.6.8/src/errors.c
@@ -25,24 +25,24 @@
void err_quit(char *errmsg)
{
- fprintf(stderr, errmsg);
+ fprintf(stderr, "%s", errmsg);
exit(-1);
}
void err_warn(char *errmsg)
{
if (quiet <= 1)
- fprintf(stderr, errmsg);
+ fprintf(stderr, "%s", errmsg);
}
void err_info(char *errmsg)
{
if (quiet == 0)
- fprintf(stderr, errmsg);
+ fprintf(stderr, "%s", errmsg);
}
void err_crit(char *errmsg)
{
if (quiet <= 2)
- fprintf(stderr, errmsg);
+ fprintf(stderr, "%s", errmsg);
}
@@ -0,0 +1,26 @@
From e295844e8ef5c13487996ab700e5f12a7fadb1a6 Mon Sep 17 00:00:00 2001
From: Private <private@private.priv>
Date: Wed, 30 Dec 2020 16:06:46 -0800
Subject: [PATCH] malloc.h to stdlib.h in rfc2440.c
The malloc.h is deprecated and should not be used
---
src/rfc2440.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/rfc2440.c b/src/rfc2440.c
index 5a1f296..4d6a5db 100644
--- a/src/rfc2440.c
+++ b/src/rfc2440.c
@@ -23,7 +23,7 @@
#include <zlib.h>
#endif
#include <stdio.h>
-#include <malloc.h>
+#include <stdlib.h>
#include "xmalloc.h"
#include "keys.h"
--
2.13.5
@@ -0,0 +1,24 @@
From 3efb40e17ce4f76717ae17a1ce1e1f747ddf59fd Mon Sep 17 00:00:00 2001
From: Alon Bar-Lev <alon.barlev@gmail.com>
Date: Sat, 22 Dec 2012 22:37:06 +0200
Subject: [PATCH] cleanup: buffer overflow
---
mcrypt-2.6.8/src/extra.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/mcrypt-2.6.8/src/extra.c b/mcrypt-2.6.8/src/extra.c
index 3082f82..c7a1ac0 100644
--- a/src/extra.c
+++ b/src/extra.c
@@ -241,6 +241,8 @@ int check_file_head(FILE * fstream, char *algorithm, char *mode,
if (m_getbit(6, flags) == 1) { /* if the salt bit is set */
if (m_getbit(0, sflag) != 0) { /* if the first bit is set */
*salt_size = m_setbit(0, sflag, 0);
+ if (*salt_size > sizeof(tmp_buf))
+ err_quit(_("Salt is too long\n"));
if (*salt_size > 0) {
fread(tmp_buf, 1, *salt_size,
fstream);
--
1.7.8.6
+45
View File
@@ -0,0 +1,45 @@
{
lib,
stdenv,
fetchurl,
libmcrypt,
libmhash,
}:
stdenv.mkDerivation (finalAttrs: {
version = "2.6.8";
pname = "mcrypt";
src = fetchurl {
url = "mirror://sourceforge/mcrypt/MCrypt/${finalAttrs.version}/mcrypt-${finalAttrs.version}.tar.gz";
hash = "sha256-UUWqhE5UzKid2rb7fdnllSgR2NeHxPS/J+smHmwYIJg=";
};
patches = [
./format-string_CVE-2012-4426.patch
./overflow_CVE-2012-4409.patch
./segv.patch
./sprintf_CVE-2012-4527.patch
./malloc_to_stdlib.patch
];
buildInputs = [
libmcrypt
libmhash
];
env.NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration";
meta = {
description = "Replacement for old UNIX crypt(1)";
longDescription = ''
mcrypt, and the accompanying libmcrypt, are intended to be replacements
for the old Unix crypt, except that they are under the GPL and support an
ever-wider range of algorithms and modes.
'';
homepage = "https://mcrypt.sourceforge.net";
license = lib.licenses.gpl3Plus;
platforms = lib.platforms.all;
maintainers = [ lib.maintainers.qknight ];
};
})
+39
View File
@@ -0,0 +1,39 @@
From 5bee29fae8f0e936ad4c957aef6035d09532a57a Mon Sep 17 00:00:00 2001
From: Alon Bar-Lev <alon.barlev@gmail.com>
Date: Sat, 22 Dec 2012 22:04:27 +0200
Subject: [PATCH] cleanup: fixup segv on buffer access
use exact buffer size instead of guess.
do not copy out of source buffer.
Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
---
mcrypt-2.6.8/src/rfc2440.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/mcrypt-2.6.8/src/rfc2440.c b/mcrypt-2.6.8/src/rfc2440.c
index 5a1f296..929b9ab 100644
--- a/src/rfc2440.c
+++ b/src/rfc2440.c
@@ -497,7 +497,7 @@ plaintext_encode(const USTRING dat)
time_t t;
assert(dat->len > 0);
- result = make_ustring( NULL, 2 * dat->len); /* xxx */
+ result = make_ustring( NULL, dat->len + 12); /* xxx */
newdat = (USTRING)dat;
result->d[pos++] = (0x80 | 0x40 | PKT_PLAINTEXT);
@@ -810,7 +810,8 @@ encrypted_encode(const USTRING pt, const DEK *dek)
_mcrypt_encrypt(dek->hd, rndpref, dek->blocklen + 2, NULL, 0);
_mcrypt_sync(dek->hd, rndpref, dek->blocklen);
- ct = make_ustring( rndpref, 2 * pt->len); /* xxx */
+ ct = make_ustring( NULL, dek->blocklen + 2 + pt->len + 12); /* xxx */
+ memcpy(ct->d, rndpref, dek->blocklen + 2);
pos = dek->blocklen + 2;
_mcrypt_encrypt(dek->hd, ct->d + pos, pt->len, pt->d, pt->len);
--
1.7.8.6
@@ -0,0 +1,108 @@
Description: [CVE-2012-4527] Stack-based buffer overflow with long file names
.
A buffer overflow in mcrypt version 2.6.8 and earlier due to long filenames.
If a user were tricked into attempting to encrypt/decrypt specially crafted
long filename(s), this flaw would cause a stack-based buffer overflow that
could potentially lead to arbitrary code execution.
.
Note that this is caught by FORTIFY_SOURCE, which makes this a crash-only
bug on wheezy.
Author: Attila Bogar, Jean-Michel Vourgère <jmv_deb@nirgal.com>
Origin: https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2012-4527
Bug: CVE-2012-4527
Bug-Debian: http://bugs.debian.org/690924
Forwarded: no
Last-Update: 2012-11-01
Index: mcrypt-2.6.8/src/mcrypt.c
===================================================================
--- mcrypt-2.6.8.orig/src/mcrypt.c
+++ mcrypt-2.6.8/src/mcrypt.c
@@ -41,4 +41,6 @@
+/* Temporary error message can contain one file name and 1k of text */
+#define ERRWIDTH ((PATH_MAX)+1024)
-char tmperr[128];
+char tmperr[ERRWIDTH];
unsigned int stream_flag = FALSE;
char *keymode = NULL;
char *mode = NULL;
@@ -482,7 +485,7 @@
#ifdef HAVE_STAT
if (stream_flag == FALSE) {
if (is_normal_file(file[i]) == FALSE) {
- sprintf(tmperr,
+ snprintf(tmperr, ERRWIDTH,
_
("%s: %s is not a regular file. Skipping...\n"),
program_name, file[i]);
@@ -501,7 +504,7 @@
dinfile = file[i];
if ((isatty(fileno((FILE *) (stdin))) == 1)
&& (stream_flag == TRUE) && (force == 0)) { /* not a tty */
- sprintf(tmperr,
+ snprintf(tmperr, ERRWIDTH,
_
("%s: Encrypted data will not be read from a terminal.\n"),
program_name);
@@ -520,7 +523,7 @@
einfile = file[i];
if ((isatty(fileno((FILE *) (stdout))) == 1)
&& (stream_flag == TRUE) && (force == 0)) { /* not a tty */
- sprintf(tmperr,
+ snprintf(tmperr, ERRWIDTH,
_
("%s: Encrypted data will not be written to a terminal.\n"),
program_name);
@@ -544,7 +547,7 @@
strcpy(outfile, einfile);
/* if file has already the .nc ignore it */
if (strstr(outfile, ".nc") != NULL) {
- sprintf(tmperr,
+ snprintf(tmperr, ERRWIDTH,
_
("%s: file %s has the .nc suffix... skipping...\n"),
program_name, outfile);
@@ -590,10 +593,10 @@
if (x == 0) {
if (stream_flag == FALSE) {
- sprintf(tmperr, _("File %s was decrypted.\n"), dinfile);
+ snprintf(tmperr, ERRWIDTH, _("File %s was decrypted.\n"), dinfile);
err_warn(tmperr);
} else {
- sprintf(tmperr, _("Stdin was decrypted.\n"));
+ snprintf(tmperr, ERRWIDTH, _("Stdin was decrypted.\n"));
err_warn(tmperr);
}
#ifdef HAVE_STAT
@@ -610,7 +613,7 @@
} else {
if (stream_flag == FALSE) {
- sprintf(tmperr,
+ snprintf(tmperr, ERRWIDTH,
_
("File %s was NOT decrypted successfully.\n"),
dinfile);
@@ -636,10 +639,10 @@
if (x == 0) {
if (stream_flag == FALSE) {
- sprintf(tmperr, _("File %s was encrypted.\n"), einfile);
+ snprintf(tmperr, ERRWIDTH, _("File %s was encrypted.\n"), einfile);
err_warn(tmperr);
} else {
- sprintf(tmperr, _("Stdin was encrypted.\n"));
+ snprintf(tmperr, ERRWIDTH, _("Stdin was encrypted.\n"));
err_warn(tmperr);
}
#ifdef HAVE_STAT
@@ -655,7 +658,7 @@
} else {
if (stream_flag == FALSE) {
- sprintf(tmperr,
+ snprintf(tmperr, ERRWIDTH,
_
("File %s was NOT encrypted successfully.\n"),
einfile);
+29
View File
@@ -0,0 +1,29 @@
diff --git a/config/template.cmake b/config/template.cmake
index 2b3abcbb..59fcd728 100644
--- a/config/template.cmake
+++ b/config/template.cmake
@@ -8,9 +8,7 @@ if(NOT TARGET "@PROJECT_NAME@::@PROJECT_NAME@")
include(CMakeFindDependencyMacro)
- if(NOT TARGET "OpenMP::OpenMP_Fortran" AND "@PROJECT_NAME@_WITH_OpenMP")
- find_dependency("OpenMP")
- endif()
+ find_dependency("OpenMP")
if(NOT TARGET "toml-f::toml-f" AND "@PROJECT_NAME@_WITH_JSON")
find_dependency("toml-f")
diff --git a/config/template.pc b/config/template.pc
index 84c3498c..2da50191 100644
--- a/config/template.pc
+++ b/config/template.pc
@@ -1,6 +1,6 @@
-prefix=@CMAKE_INSTALL_PREFIX@
-libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
-includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
+prefix=@CMAKE_INSTALL_PREFIX@
+libdir=@CMAKE_INSTALL_FULL_LIBDIR@
+includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
Name: @PROJECT_NAME@
Description: @PROJECT_DESCRIPTION@
+37
View File
@@ -0,0 +1,37 @@
diff --git a/config/meson.build b/config/meson.build
index f54857ee..aaafdb03 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -56,9 +56,12 @@ jonquil_dep = dependency(
'jonquil',
required: get_option('json'),
fallback: ['jonquil','jonquil_dep'],
- default_options: [
- 'default_library=static',
- ],
- static: get_option('default_library') != 'dynamic',
)
lib_deps += jonquil_dep
+
+tomlf_dep = dependency(
+ 'toml-f',
+ required: get_option('json'),
+ fallback: ['toml-f','toml-f_dep'],
+)
+lib_deps += tomlf_dep
diff --git a/meson.build b/meson.build
index 16797c47..6e5290d9 100644
--- a/meson.build
+++ b/meson.build
@@ -25,11 +25,6 @@ project(
)
install = not (meson.is_subproject() and get_option('default_library') == 'static')
-# Check for specific unsupported meson versions
-if meson.version().version_compare('==1.8.0')
- error('Meson version 1.8.0 has a known issue — please use any other version ≥ 0.55.0')
-endif
-
# General configuration information
lib_deps = []
subdir('config')
+80
View File
@@ -0,0 +1,80 @@
{
stdenv,
lib,
fetchFromGitHub,
gfortran,
buildType ? "meson",
meson,
ninja,
cmake,
pkg-config,
python3,
jonquil,
}:
assert (
builtins.elem buildType [
"meson"
"cmake"
]
);
stdenv.mkDerivation rec {
pname = "mctc-lib";
version = "0.5.0";
src = fetchFromGitHub {
owner = "grimme-lab";
repo = "mctc-lib";
rev = "v${version}";
hash = "sha256-MWqvFxFGnFrGppiSy97oUWz7p1sD6GkTrMEZTFgSExg=";
};
patches = [
# Allow dynamically linked jonquil as dependency. That then additionally
# requires linking in toml-f
./meson.patch
# Fix wrong generation of package config include paths
./cmake.patch
];
nativeBuildInputs = [
gfortran
pkg-config
python3
]
++ lib.optionals (buildType == "meson") [
meson
ninja
]
++ lib.optional (buildType == "cmake") cmake;
buildInputs = [
jonquil
];
outputs = [
"out"
"dev"
];
doCheck = true;
preCheck = ''
export OMP_NUM_THREADS=2
'';
postPatch = ''
patchShebangs --build config/install-mod.py
'';
meta = with lib; {
description = "Modular computation tool chain library";
mainProgram = "mctc-convert";
homepage = "https://github.com/grimme-lab/mctc-lib";
license = licenses.asl20;
platforms = platforms.linux;
maintainers = [ maintainers.sheepforce ];
};
}
@@ -0,0 +1,38 @@
{
lib,
fetchPypi,
python3Packages,
nix-update-script,
}:
python3Packages.buildPythonApplication rec {
pname = "mcuboot-imgtool";
version = "2.2.0";
pyproject = true;
src = fetchPypi {
inherit version;
pname = "imgtool";
hash = "sha256-XIc6EYleNtDrmeg2akOjriJwzE9Bnja2k0KJGCVRZM8=";
};
passthru.updateScript = nix-update-script { };
nativeBuildInputs = with python3Packages; [ setuptools ];
propagatedBuildInputs = with python3Packages; [
cbor2
click
cryptography
intelhex
pyyaml
];
meta = with lib; {
description = "MCUboot's image signing and key management";
homepage = "https://github.com/mcu-tools/mcuboot/tree/main/scripts";
license = licenses.asl20;
maintainers = with maintainers; [ otavio ];
mainProgram = "imgtool";
};
}
+37
View File
@@ -0,0 +1,37 @@
{
lib,
rustPlatform,
fetchFromGitHub,
nix-update-script,
pkg-config,
udev,
stdenv,
}:
rustPlatform.buildRustPackage rec {
pname = "mcumgr-client";
version = "0.0.7";
src = fetchFromGitHub {
owner = "vouch-opensource";
repo = "mcumgr-client";
rev = "v${version}";
hash = "sha256-P5ykIVdWAxuCblMe7kzjswEca/+MsqpizCGUHIpR4qc=";
};
cargoHash = "sha256-+n+Z/o+DvP2ltos8DP8nTyKbn/Zr3ln6cLyKJ+yWm1M=";
passthru.updateScript = nix-update-script { };
nativeBuildInputs = [ pkg-config ];
buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ udev ];
meta = with lib; {
description = "Client for mcumgr commands";
homepage = "https://github.com/vouch-opensource/mcumgr-client";
license = licenses.asl20;
maintainers = with maintainers; [ otavio ];
mainProgram = "mcumgr-client";
};
}
+55
View File
@@ -0,0 +1,55 @@
{
lib,
stdenv,
fetchFromGitHub,
yosys,
python3,
}:
let
python = python3.withPackages (p: with p; [ flask ]);
in
stdenv.mkDerivation {
pname = "mcy";
version = "2020.08.03";
src = fetchFromGitHub {
owner = "YosysHQ";
repo = "mcy";
rev = "62048e69df13f8e03670424626755ae8ef4c36ff";
sha256 = "15xxgzx1zxzx5kshqyrxnfx33cz6cjzxcdcn6z98jhs9bwyvf96f";
};
buildInputs = [ python ];
patchPhase = ''
chmod +x scripts/create_mutated.sh
patchShebangs .
substituteInPlace mcy.py \
--replace yosys '${yosys}/bin/yosys' \
--replace 'os.execvp("mcy-dash"' "os.execvp(\"$out/bin/mcy-dash\""
substituteInPlace mcy-dash.py \
--replace 'app.run(debug=True)' 'app.run(host="0.0.0.0",debug=True)' \
--replace 'subprocess.Popen(["mcy"' "subprocess.Popen([\"$out/bin/mcy\""
substituteInPlace scripts/create_mutated.sh \
--replace yosys '${yosys}/bin/yosys'
'';
# the build needs a bit of work...
dontBuild = true;
installPhase = ''
mkdir -p $out/bin $out/share/mcy/{dash,scripts}
install mcy.py $out/bin/mcy && chmod +x $out/bin/mcy
install mcy-dash.py $out/bin/mcy-dash && chmod +x $out/bin/mcy-dash
cp -r dash/. $out/share/mcy/dash/.
cp -r scripts/. $out/share/mcy/scripts/.
'';
meta = {
description = "Mutation-based coverage testing for hardware designs, with Yosys";
homepage = "https://github.com/YosysHQ/mcy";
license = lib.licenses.isc;
maintainers = with lib.maintainers; [ thoughtpolice ];
platforms = lib.platforms.all;
};
}