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,39 @@
{
lib,
python3,
fetchFromGitHub,
}:
python3.pkgs.buildPythonApplication rec {
pname = "cp210x-program";
version = "0.4.1";
format = "pyproject";
src = fetchFromGitHub {
owner = "VCTLabs";
repo = "cp210x-program";
tag = version;
sha256 = "sha256-IjKshP12WfFly9cPm6svD4qZW6cT8C7lOVrGenSqbfY=";
};
build-system = with python3.pkgs; [
setuptools
];
dependencies = with python3.pkgs; [
hexdump
pyusb
];
postInstall = ''
ln -s $out/bin/cp210x-program{.py,}
'';
meta = with lib; {
description = "EEPROM tool for Silabs CP210x USB-Serial adapter";
homepage = "https://github.com/VCTLabs/cp210x-program";
license = licenses.lgpl21Only; # plus/only status unclear
maintainers = [ ];
mainProgram = "cp210x-program";
};
}

View File

@@ -0,0 +1,287 @@
{
lib,
stdenv,
fetchFromGitHub,
mpiCheckPhaseHook,
cmake,
python3,
gfortran,
blas,
lapack,
dbcsr,
fftw,
libint,
libvori,
libxc,
dftd4,
simple-dftd3,
tblite,
mpi,
gsl,
scalapack,
makeWrapper,
libxsmm,
spglib,
which,
pkg-config,
plumed,
zlib,
hdf5-fortran,
sirius,
libvdwxc,
spla,
spfft,
trexio,
toml-f,
greenx,
gmp,
enableElpa ? false,
elpa,
cudaPackages,
rocmPackages,
newScope,
mctc-lib,
jonquil,
multicharge,
mstore,
test-drive,
config,
gpuBackend ? (
if config.cudaSupport then
"cuda"
else if config.rocmSupport then
"rocm"
else
"none"
),
# Change to a value suitable for your target GPU.
# see https://github.com/cp2k/cp2k/blob/master/CMakeLists.txt#L433
hipTarget ? "gfx908",
cudaTarget ? "80",
}:
assert builtins.elem gpuBackend [
"none"
"cuda"
"rocm"
];
let
grimmeCmake = lib.makeScope newScope (self: {
mctc-lib = mctc-lib.override {
buildType = "cmake";
inherit (self) jonquil;
};
toml-f = toml-f.override {
buildType = "cmake";
inherit (self) test-drive;
};
dftd4 = dftd4.override {
buildType = "cmake";
inherit (self) mstore mctc-lib multicharge;
};
jonquil = jonquil.override {
buildType = "cmake";
inherit (self) toml-f test-drive;
};
mstore = mstore.override {
buildType = "cmake";
inherit (self) mctc-lib;
};
multicharge = multicharge.override {
buildType = "cmake";
inherit (self) mctc-lib mstore;
};
test-drive = test-drive.override { buildType = "cmake"; };
simple-dftd3 = simple-dftd3.override {
buildType = "cmake";
inherit (self) mctc-lib mstore toml-f;
};
tblite = tblite.override {
buildType = "cmake";
inherit (self)
mctc-lib
mstore
toml-f
multicharge
dftd4
simple-dftd3
;
};
sirius = sirius.override {
inherit (self)
mctc-lib
toml-f
multicharge
dftd4
simple-dftd3
;
};
});
in
stdenv.mkDerivation rec {
pname = "cp2k";
version = "2025.2";
src = fetchFromGitHub {
owner = "cp2k";
repo = "cp2k";
rev = "v${version}";
hash = "sha256-vfl5rCoFeGtYuZ7LcsVsESjKxFbN5IYDvBSzOqsd64w=";
fetchSubmodules = true;
};
patches = [
# Remove the build command line from the source.
# This avoids dependencies to .dev inputs
./remove-compiler-options.patch
# Fix pkg-config path generation
./pkgconfig.patch
];
nativeBuildInputs = [
python3
cmake
which
makeWrapper
pkg-config
gfortran
]
++ lib.optional (gpuBackend == "cuda") cudaPackages.cuda_nvcc;
buildInputs = [
fftw
gsl
libint
libvori
libxc
libxsmm
mpi
spglib
scalapack
blas
lapack
dbcsr
plumed
zlib
hdf5-fortran
spla
spfft
libvdwxc
trexio
greenx
gmp
grimmeCmake.dftd4
grimmeCmake.simple-dftd3
grimmeCmake.tblite
grimmeCmake.sirius
grimmeCmake.toml-f
]
++ lib.optional enableElpa elpa
++ lib.optionals (gpuBackend == "cuda") [
cudaPackages.cuda_cudart
cudaPackages.libcublas
cudaPackages.cuda_nvrtc
]
++ lib.optionals (gpuBackend == "rocm") [
rocmPackages.clr
rocmPackages.rocm-core
rocmPackages.hipblas
rocmPackages.hipfft
rocmPackages.rocblas
];
propagatedBuildInputs = [ (lib.getBin mpi) ];
propagatedUserEnvPkgs = [ mpi ];
postPatch = ''
patchShebangs tools exts/dbcsr/tools/build_utils exts/dbcsr/.cp2k
substituteInPlace exts/build_dbcsr/Makefile \
--replace '/usr/bin/env python3' '${python3}/bin/python' \
--replace 'SHELL = /bin/sh' 'SHELL = bash'
'';
cmakeFlags = [
(lib.strings.cmakeBool "CP2K_USE_DFTD4" true)
(lib.strings.cmakeBool "CP2K_USE_TBLITE" true)
(lib.strings.cmakeBool "CP2K_USE_FFTW3" true)
(lib.strings.cmakeBool "CP2K_USE_HDF5" true)
(lib.strings.cmakeBool "CP2K_USE_LIBINT2" true)
(lib.strings.cmakeBool "CP2K_USE_LIBXC" true)
(lib.strings.cmakeBool "CP2K_USE_MPI" true)
(lib.strings.cmakeBool "CP2K_USE_VORI" true)
(lib.strings.cmakeBool "CP2K_USE_TREXIO" true)
(lib.strings.cmakeBool "CP2K_USE_SPGLIB" true)
(lib.strings.cmakeBool "CP2K_USE_SPLA" true)
(lib.strings.cmakeBool "CP2K_USE_LIBXSMM" true)
(lib.strings.cmakeBool "CP2K_USE_SIRIUS" true)
(lib.strings.cmakeBool "CP2K_USE_LIBVDWXC" true)
(lib.strings.cmakeBool "CP2K_USE_PLUMED" true)
(lib.strings.cmakeBool "CP2K_USE_GREENX" true)
(lib.strings.cmakeBool "CP2K_USE_ELPA" enableElpa)
(lib.strings.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic))
]
++ lib.optionals (gpuBackend == "rocm") [
(lib.strings.cmakeFeature "CP2K_USE_ACCEL" "HIP")
(lib.strings.cmakeFeature "CMAKE_HIP_ARCHITECTURES" hipTarget)
]
++ lib.optionals (gpuBackend == "cuda") [
(lib.strings.cmakeFeature "CP2K_USE_ACCEL" "CUDA")
(lib.strings.cmakeFeature "CMAKE_CUDA_ARCHITECTURES" cudaTarget)
];
nativeCheckInputs = [
mpiCheckPhaseHook
];
passthru = {
inherit mpi;
};
outputs = [
"out"
"dev"
];
postInstall = ''
mkdir -p $out/share/cp2k
cp -r ../data/* $out/share/cp2k
for i in $out/bin/*; do
wrapProgram $i \
--set-default CP2K_DATA_DIR $out/share/cp2k \
--set-default OMP_NUM_THREADS 1
done
'';
doInstallCheck = gpuBackend == "none";
installCheckPhase = ''
runHook preInstallCheck
for TEST in $out/bin/{dbt_tas,dbt,libcp2k,parallel_rng_types,gx_ac}_unittest.psmp; do
mpirun -n 2 $TEST
done
runHook postInstallCheck
'';
meta = {
description = "Quantum chemistry and solid state physics program";
homepage = "https://www.cp2k.org";
license = lib.licenses.gpl2Plus;
maintainers = [ lib.maintainers.sheepforce ];
platforms = [ "x86_64-linux" ];
};
}

View File

@@ -0,0 +1,14 @@
diff --git a/cmake/libcp2k.pc.in b/cmake/libcp2k.pc.in
index 618af55e28..8d08a51a0c 100644
--- a/cmake/libcp2k.pc.in
+++ b/cmake/libcp2k.pc.in
@@ -1,7 +1,7 @@
prefix="@CMAKE_INSTALL_PREFIX@"
exec_prefix="${prefix}"
-libdir="${prefix}/@CMAKE_INSTALL_LIBDIR@"
-includedir="${prefix}/@CMAKE_INSTALL_INCLUDEDIR@"
+libdir=@CMAKE_INSTALL_FULL_LIBDIR@"
+includedir="@CMAKE_INSTALL_FULL_INCLUDEDIR@"
Name: @PROJECT_NAME@
Description: @CMAKE_PROJECT_DESCRIPTION@

View File

@@ -0,0 +1,37 @@
diff --git a/src/start/cp2k.F b/src/start/cp2k.F
index f69146ea3..a195f0620 100644
--- a/src/start/cp2k.F
+++ b/src/start/cp2k.F
@@ -58,8 +58,7 @@ PROGRAM cp2k
USE input_cp2k, ONLY: create_cp2k_root_section
USE input_section_types, ONLY: section_release,&
section_type
- USE iso_fortran_env, ONLY: compiler_options,&
- compiler_version
+ USE iso_fortran_env, ONLY: compiler_version
USE kinds, ONLY: default_path_length
USE machine, ONLY: default_output_unit
#include "../base/base_uses.f90"
@@ -70,7 +69,6 @@ PROGRAM cp2k
arg_att, command
CHARACTER(LEN=default_path_length), &
DIMENSION(:, :), ALLOCATABLE :: initial_variables, initial_variables_tmp
- CHARACTER(LEN=:), ALLOCATABLE :: compiler_options_string
INTEGER :: output_unit, l, i, var_set_sep, inp_var_idx
INTEGER :: ierr, i_arg
LOGICAL :: check, usage, echo_input, command_line_error
@@ -328,14 +326,6 @@ PROGRAM cp2k
WRITE (output_unit, "(T2,A)") cp2k_version, &
"Source code revision "//TRIM(compile_revision), &
TRIM(cp2k_flags())
- compiler_options_string = compiler_options()
- WRITE (output_unit, "(T2,A,A)") "compiler: ", compiler_version()
- WRITE (output_unit, "(T2,A)") "compiler options:"
- DO i = 0, (LEN(compiler_options_string) - 1)/68
- WRITE (output_unit, "(T4,A)") &
- compiler_options_string(i*68 + 1:MIN(LEN(compiler_options_string), (i + 1)*68))
- END DO
- DEALLOCATE (compiler_options_string)
END IF
END IF

View File

@@ -0,0 +1,32 @@
{
lib,
stdenv,
fetchFromGitHub,
}:
stdenv.mkDerivation rec {
pname = "cp437";
version = "0.6";
src = fetchFromGitHub {
owner = "keaston";
repo = "cp437";
rev = "v${version}";
sha256 = "18f4mnfnyviqclbhmbhix80k823481ypkwbp26qfvhnxdgzbggcc";
};
installPhase = ''
install -Dm755 cp437 -t $out/bin
'';
meta = with lib; {
description = ''
Emulates an old-style "code page 437" / "IBM-PC" character
set terminal on a modern UTF-8 terminal emulator
'';
homepage = "https://github.com/keaston/cp437";
license = licenses.bsd3;
maintainers = with maintainers; [ jb55 ];
mainProgram = "cp437";
};
}

View File

@@ -0,0 +1,29 @@
{
lib,
fetchFromGitHub,
rustPlatform,
}:
rustPlatform.buildRustPackage rec {
pname = "cpc";
version = "3.0.0";
src = fetchFromGitHub {
owner = "probablykasper";
repo = "cpc";
tag = "v${version}";
hash = "sha256-DjJIXV5rJxQOiMH8/0yZQBvDh+jbejzADt4WSGyhozI=";
};
cargoHash = "sha256-2k+aFrP/PQmlGr3gIF1queDjuo/+3KtnrOrx1+wrqEg=";
meta = {
mainProgram = "cpc";
description = "Text calculator with support for units and conversion";
homepage = "https://github.com/probablykasper/cpc";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [
s0me1newithhand7s
];
};
}

View File

@@ -0,0 +1,57 @@
{
lib,
stdenv,
fetchFromGitHub,
makeWrapper,
ncurses,
readline,
ronn,
}:
stdenv.mkDerivation rec {
pname = "cpcfs";
version = "0.85.4";
src = fetchFromGitHub {
owner = "derikz";
repo = "cpcfs";
rev = "v${version}";
sha256 = "0rfbry0qy8mv746mzk9zdfffkdgq4w7invgb5cszjma2cp83q3i2";
};
sourceRoot = "${src.name}/src";
nativeBuildInputs = [
makeWrapper
ncurses
readline
ronn
];
env.NIX_CFLAGS_COMPILE = "-std=gnu89";
postPatch = ''
substituteInPlace Makefile \
--replace '-ltermcap' '-lncurses' \
--replace '-L /usr/lib/termcap' ' '
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
mkdir -p $out/man/man1
cp cpcfs $out/bin
ronn --roff ../template.doc --pipe > $out/man/man1/cpcfs.1
runHook postInstall
'';
meta = with lib; {
description = "Manipulating CPC dsk images and files";
mainProgram = "cpcfs";
homepage = "https://github.com/derikz/cpcfs/";
license = licenses.bsd2;
maintainers = [ ];
platforms = platforms.all;
};
}

View File

@@ -0,0 +1,51 @@
{
lib,
stdenv,
fetchFromGitHub,
libsForQt5,
pkg-config,
cmake,
ninja,
python3,
runtimeShell,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "cpeditor";
version = "7.0.1";
src = fetchFromGitHub {
owner = "cpeditor";
repo = "cpeditor";
tag = finalAttrs.version;
hash = "sha256-t7nn3sO45dOQq5OMWhaseO9XHicQ/1fjukXal5yPMgY";
fetchSubmodules = true;
};
nativeBuildInputs = [
cmake
ninja
pkg-config
libsForQt5.wrapQtAppsHook
python3
];
buildInputs = [
libsForQt5.qtbase
libsForQt5.qttools
libsForQt5.syntax-highlighting
];
postPatch = ''
substituteInPlace src/Core/Runner.cpp --replace-fail "/bin/bash" "${runtimeShell}"
substituteInPlace dist/linux/cpeditor.desktop --replace-fail 'Exec=/usr/bin/cpeditor' "Exec=cpeditor"
'';
meta = {
description = "IDE specially designed for competitive programming";
homepage = "https://cpeditor.org";
license = lib.licenses.gpl3Plus;
platforms = lib.platforms.linux;
maintainers = [ lib.maintainers.wineee ];
mainProgram = "cpeditor";
};
})

View File

@@ -0,0 +1,53 @@
{
lib,
stdenv,
fetchurl,
autoreconfHook,
# for passthru.tests
git,
libguestfs,
nixosTests,
rpm,
}:
stdenv.mkDerivation rec {
pname = "cpio";
version = "2.15";
src = fetchurl {
url = "mirror://gnu/cpio/cpio-${version}.tar.bz2";
hash = "sha256-k3YQuXwymh7JJoVT+3gAN7z/8Nz/6XJevE/ZwaqQdds=";
};
nativeBuildInputs = [ autoreconfHook ];
separateDebugInfo = true;
# The code won't compile in c23 mode.
# https://gcc.gnu.org/gcc-15/porting_to.html#c23-fn-decls-without-parameters
configureFlags = [
"CFLAGS=-std=gnu17"
];
preConfigure = lib.optionalString stdenv.hostPlatform.isCygwin ''
sed -i gnu/fpending.h -e 's,include <stdio_ext.h>,,'
'';
enableParallelBuilding = true;
passthru.tests = {
inherit libguestfs rpm;
git = git.tests.withInstallCheck;
initrd = nixosTests.systemd-initrd-simple;
};
meta = with lib; {
homepage = "https://www.gnu.org/software/cpio/";
description = "Program to create or extract from cpio archives";
license = licenses.gpl3;
platforms = platforms.all;
priority = 6; # resolves collision with gnutar's "libexec/rmt"
mainProgram = "cpio";
};
}

View File

@@ -0,0 +1,56 @@
{
lib,
python3Packages,
fetchFromGitHub,
makeWrapper,
mpv,
pulseaudio,
}:
python3Packages.buildPythonApplication rec {
pname = "cplay-ng";
version = "5.4.0";
pyproject = true;
src = fetchFromGitHub {
owner = "xi";
repo = "cplay-ng";
tag = version;
hash = "sha256-ob5wX+Q5XKB/fTYG5phLU61imonpk2A/fk5cg/dfr1Y=";
};
nativeBuildInputs = [ makeWrapper ];
build-system = [ python3Packages.setuptools ];
postInstall = ''
wrapProgram $out/bin/cplay-ng \
--prefix PATH : ${
lib.makeBinPath [
mpv
pulseaudio
]
}
'';
meta = {
homepage = "https://github.com/xi/cplay-ng";
description = "Simple curses audio player";
mainProgram = "cplay-ng";
longDescription = ''
cplay is a minimalist music player with a textual user interface written
in Python. It aims to provide a power-user-friendly interface with simple
filelist and playlist control.
Instead of building an elaborate database of your music library, cplay
allows you to quickly browse the filesystem and enqueue files,
directories, and playlists.
The original cplay was started by Ulf Betlehem in 1998 and is no longer
maintained. This is a rewrite that aims to stay true to the original
design while evolving with a shifting environment.
'';
license = lib.licenses.gpl2Plus;
maintainers = with lib.maintainers; [ fgaz ];
};
}

View File

@@ -0,0 +1,52 @@
{
lib,
stdenvNoCC,
fetchFromGitHub,
nix-update-script,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "cpm-cmake";
version = "0.42.0";
src = fetchFromGitHub {
owner = "cpm-cmake";
repo = "cpm.cmake";
rev = "v${finalAttrs.version}";
hash = "sha256-IA13qA/b+owlrqbVAkhd4rS98/XB5RNONiJaPwjDm+A=";
};
postPatch = ''
substituteInPlace cmake/CPM.cmake \
--replace-fail "set(CURRENT_CPM_VERSION 1.0.0-development-version)" "set(CURRENT_CPM_VERSION ${finalAttrs.version})"
'';
dontConfigure = true;
dontBuild = true;
installPhase = ''
runHook preInstall
mkdir -p $out/share/{,doc/}cpm
install -Dm644 cmake/CPM.cmake $out/share/cpm/CPM.cmake
install -Dm644 README.md CONTRIBUTING.md $out/share/doc/cpm/
runHook postInstall
'';
passthru.updateScript = nix-update-script { };
meta = {
homepage = "https://github.com/cpm-cmake/CPM.cmake";
description = "CMake's missing package manager";
longDescription = ''
CPM.cmake is a cross-platform CMake script that adds dependency
management capabilities to CMake. It's built as a thin wrapper around
CMake's FetchContent module that adds version control, caching, a
simple API and more.
'';
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ pandapip1 ];
platforms = lib.platforms.all;
};
})

View File

@@ -0,0 +1,44 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
boost,
curl,
leatherman,
}:
stdenv.mkDerivation rec {
pname = "cpp-hocon";
version = "0.3.0";
src = fetchFromGitHub {
sha256 = "0b24anpwkmvbsn5klnr58vxksw00ci9pjhwzx7a61kplyhsaiydw";
rev = version;
repo = "cpp-hocon";
owner = "puppetlabs";
};
postPatch = ''
sed -i -e '/add_subdirectory(tests)/d' lib/CMakeLists.txt
'';
env.NIX_CFLAGS_COMPILE = "-Wno-error";
nativeBuildInputs = [ cmake ];
buildInputs = [
boost
curl
leatherman
];
meta = with lib; {
inherit (src.meta) homepage;
description = "C++ port of the Typesafe Config library";
license = licenses.asl20;
maintainers = [ maintainers.womfoo ];
platforms = platforms.unix;
};
}

View File

@@ -0,0 +1,47 @@
{
lib,
stdenv,
fetchFromGitHub,
curl,
cmake,
nlohmann_json,
}:
stdenv.mkDerivation {
pname = "cpp-ipfs-http-client";
version = "unstable-2022-01-30";
src = fetchFromGitHub {
owner = "vasild";
repo = "cpp-ipfs-http-client";
rev = "3cdfa7fc6326e49fc81b3c7ca43ce83bdccef6d9";
sha256 = "sha256-/oyafnk4SbrvoCh90wkZXNBjknMKA6EEUoEGo/amLUo=";
};
patches = [ ./unvendor-nlohmann-json.patch ];
postPatch = ''
substituteInPlace CMakeLists.txt \
--replace '# Fetch "JSON for Modern C++"' "include_directories(${nlohmann_json}/include)"
'';
nativeBuildInputs = [ cmake ];
buildInputs = [ curl ];
propagatedBuildInputs = [ nlohmann_json ];
env.NIX_CFLAGS_COMPILE = toString [
"-Wno-error=range-loop-construct"
# Needed with GCC 12
"-Wno-error=deprecated-declarations"
];
meta = with lib; {
description = "IPFS C++ API client library";
homepage = "https://github.com/vasild/cpp-ipfs-http-client";
license = licenses.mit;
platforms = [
"x86_64-linux"
"x86_64-darwin"
];
};
}

View File

@@ -0,0 +1,27 @@
--- source/CMakeLists.txt
+++ source/CMakeLists.txt
@@ -56,11 +56,6 @@ target_include_directories(${IPFS_API_LIBNAME}
)
# Fetch "JSON for Modern C++"
-include(FetchContent)
-message(STATUS "Fetching nlohmann/JSON")
-# Retrieve Nlohmann JSON
-FetchContent_Declare(json URL https://github.com/nlohmann/json/releases/download/v3.10.5/json.tar.xz)
-FetchContent_MakeAvailable(json)
# libcurl requires additional libs only for static Windows builds
if(WIN32)
@@ -71,12 +66,11 @@ set_target_properties(${IPFS_API_LIBNAME} PROPERTIES
SOVERSION ${PROJECT_VERSION_MAJOR}
VERSION ${PROJECT_VERSION}
)
-target_link_libraries(${IPFS_API_LIBNAME} ${CURL_LIBRARIES} ${WINDOWS_CURL_LIBS} nlohmann_json::nlohmann_json)
+target_link_libraries(${IPFS_API_LIBNAME} ${CURL_LIBRARIES} ${WINDOWS_CURL_LIBS})
if(NOT DISABLE_INSTALL)
install(TARGETS ${IPFS_API_LIBNAME} DESTINATION lib)
install(FILES include/ipfs/client.h DESTINATION include/ipfs)
install(FILES include/ipfs/http/transport.h DESTINATION include/ipfs/http)
- install(FILES ${json_SOURCE_DIR}/include/nlohmann/json.hpp DESTINATION include/nlohmann)
endif()
# Tests, use "CTEST_OUTPUT_ON_FAILURE=1 make test" to see output from failed tests

View File

@@ -0,0 +1,45 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
openssl,
gtest,
nlohmann_json,
}:
stdenv.mkDerivation rec {
pname = "cpp-jwt";
version = "1.5.1";
src = fetchFromGitHub {
owner = "arun11299";
repo = "cpp-jwt";
rev = "v${version}";
sha256 = "sha256-TyLYTk7vlpNmYJxaH9zhGwFvv1BEcShTDr7JYfgu6f0=";
};
cmakeFlags = [
"-DCPP_JWT_USE_VENDORED_NLOHMANN_JSON=OFF"
"-DCPP_JWT_BUILD_EXAMPLES=OFF"
];
nativeBuildInputs = [ cmake ];
buildInputs = [
gtest
openssl
nlohmann_json
];
doCheck = true;
strictDeps = true;
meta = {
description = "JSON Web Token library for C++";
homepage = "https://github.com/arun11299/cpp-jwt";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ fpletz ];
};
}

View File

@@ -0,0 +1,33 @@
From 8be99f5972826c25378bccb9fbd7291623c7b2a7 Mon Sep 17 00:00:00 2001
From: Moraxyc <i@qaq.li>
Date: Fri, 9 May 2025 13:39:17 +0800
Subject: [PATCH] Compatibility with boost 1.83
---
boost/network/protocol/http/server/impl/parsers.ipp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/boost/network/protocol/http/server/impl/parsers.ipp b/boost/network/protocol/http/server/impl/parsers.ipp
index c31e60e..3272c2f 100755
--- a/boost/network/protocol/http/server/impl/parsers.ipp
+++ b/boost/network/protocol/http/server/impl/parsers.ipp
@@ -13,6 +13,7 @@
#include <tuple>
#include <boost/fusion/include/std_tuple.hpp>
#include <boost/network/protocol/http/message/header.hpp>
+#include <boost/regex/pending/unicode_iterator.hpp>
#ifdef BOOST_NETWORK_NO_LIB
#ifndef BOOST_NETWORK_INLINE
@@ -32,7 +33,7 @@ typedef std::basic_string<uint32_t> u32_string;
template <> // <typename Attrib, typename T, typename Enable>
struct assign_to_container_from_value<std::string, u32_string, void> {
static void call(u32_string const& val, std::string& attr) {
- u32_to_u8_iterator<u32_string::const_iterator> begin = val.begin(),
+ boost::u32_to_u8_iterator<u32_string::const_iterator> begin = val.begin(),
end = val.end();
for (; begin != end; ++begin) attr += *begin;
}
--
2.48.1

View File

@@ -0,0 +1,54 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
boost186,
openssl,
llvmPackages_18,
}:
let
# std::char_traits has been removed
stdenvForCppNetlib = if stdenv.hostPlatform.isDarwin then llvmPackages_18.stdenv else stdenv;
in
stdenvForCppNetlib.mkDerivation rec {
pname = "cpp-netlib";
version = "0.13.0-final";
src = fetchFromGitHub {
owner = "cpp-netlib";
repo = "cpp-netlib";
tag = "cpp-netlib-${version}";
sha256 = "18782sz7aggsl66b4mmi1i0ijwa76iww337fi9sygnplz2hs03a3";
fetchSubmodules = true;
};
patches = [
# 'u32_to_u8_iterator' was not declared
./0001-Compatibility-with-boost-1.83.patch
];
nativeBuildInputs = [ cmake ];
buildInputs = [
# io_service.hpp has been removed in boost 1.87+
boost186
openssl
];
cmakeFlags = [
"-DCPP-NETLIB_BUILD_SHARED_LIBS=ON"
# fatal error: 'boost/asio/stream_socket_service.hpp' file not found
"-DCPP-NETLIB_BUILD_EXAMPLES=OFF"
"-DCPP-NETLIB_BUILD_TESTS=OFF"
];
# Most tests make network GET requests to various websites
doCheck = false;
meta = with lib; {
description = "Collection of open-source libraries for high level network programming";
homepage = "https://cpp-netlib.org";
license = licenses.boost;
platforms = platforms.all;
};
}

View File

@@ -0,0 +1,12 @@
diff --git a/sources/core/client.cpp b/sources/core/client.cpp
index 7ea20e2..c5d2c40 100644
--- a/sources/core/client.cpp
+++ b/sources/core/client.cpp
@@ -23,6 +23,7 @@
#include <cpp_redis/core/client.hpp>
#include <cpp_redis/misc/error.hpp>
#include <cpp_redis/misc/macro.hpp>
+#include <thread>
namespace cpp_redis {

View File

@@ -0,0 +1,38 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
pkg-config,
}:
stdenv.mkDerivation rec {
pname = "cpp-redis";
version = "4.3.1";
src = fetchFromGitHub {
owner = "cpp-redis";
repo = "cpp_redis";
tag = version;
hash = "sha256-dLAnxgldylWWKO3WIyx+F7ylOpRH+0nD7NZjWSOxuwQ=";
fetchSubmodules = true;
};
nativeBuildInputs = [
cmake
pkg-config
];
CFLAGS = "-D_GLIBCXX_USE_NANOSLEEP";
patches = [
./01-fix-sleep_for.patch
];
meta = with lib; {
description = "C++11 Lightweight Redis client: async, thread-safe, no dependency, pipelining, multi-platform";
homepage = "https://github.com/cpp-redis/cpp_redis";
changelog = "https://github.com/cpp-redis/cpp_redis/blob/${src.rev}/CHANGELOG.md";
license = licenses.mit;
maintainers = with maintainers; [ poelzi ];
platforms = platforms.all;
};
}

View File

@@ -0,0 +1,45 @@
{
stdenv,
lib,
fetchFromGitHub,
cmake,
cppunit,
libiconv,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "cpp-utilities";
version = "5.31.0";
src = fetchFromGitHub {
owner = "Martchus";
repo = "cpp-utilities";
rev = "v${finalAttrs.version}";
sha256 = "sha256-UjF1b1LCPwrUzqVZNbtX+5eFAzc6NgLyBzTcNHNlkvs=";
};
nativeBuildInputs = [ cmake ];
nativeCheckInputs = [ cppunit ];
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
libiconv # needed on Darwin, see https://github.com/Martchus/cpp-utilities/issues/4
];
cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" ];
# Otherwise, tests fail since the resulting shared object libc++utilities.so is only available in PWD of the make files
preCheck = ''
checkFlagsArray+=(
"LD_LIBRARY_PATH=$PWD"
)
'';
# tests fail on Darwin
doCheck = !stdenv.hostPlatform.isDarwin;
meta = with lib; {
homepage = "https://github.com/Martchus/cpp-utilities";
description = "Common C++ classes and routines used by @Martchus' applications featuring argument parser, IO and conversion utilities";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ doronbehar ];
platforms = platforms.linux ++ platforms.darwin;
};
})

View File

@@ -0,0 +1,33 @@
{
lib,
stdenv,
fetchFromGitHub,
pkg-config,
cmake,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "cppad";
version = "20250000.2";
src = fetchFromGitHub {
owner = "coin-or";
repo = "CppAD";
tag = finalAttrs.version;
hash = "sha256-rAKD/PAjepDchvrJp7iLYw5doNq8Af1oVh61gfMcNYI=";
};
nativeBuildInputs = [
cmake
pkg-config
];
meta = {
description = "C++ Algorithmic Differentiation Package";
homepage = "https://github.com/coin-or/CppAD";
license = lib.licenses.gpl2Plus;
maintainers = with lib.maintainers; [
athas
];
};
})

View File

@@ -0,0 +1,122 @@
{
lib,
stdenv,
fetchFromGitHub,
# nativeBuildInputs
docbook_xml_dtd_45,
docbook_xsl,
installShellFiles,
libxslt,
pkg-config,
python3,
which,
# buildInputs
pcre,
versionCheckHook,
gitUpdater,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "cppcheck";
version = "2.18.3";
outputs = [
"out"
"man"
];
src = fetchFromGitHub {
owner = "danmar";
repo = "cppcheck";
tag = finalAttrs.version;
hash = "sha256-c32dNM1tNN+Nqv5GmKHnAhWx8r9RTcv3FQ/+ROGurkw=";
};
nativeBuildInputs = [
docbook_xml_dtd_45
docbook_xsl
installShellFiles
libxslt
pkg-config
python3
which
];
buildInputs = [
pcre
(python3.withPackages (ps: [ ps.pygments ]))
];
makeFlags = [
"PREFIX=$(out)"
"MATCHCOMPILER=yes"
"FILESDIR=$(out)/share/cppcheck"
"HAVE_RULES=yes"
];
enableParallelBuilding = true;
strictDeps = true;
# test/testcondition.cpp:4949(TestCondition::alwaysTrueContainer): Assertion failed.
doCheck = !(stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64);
doInstallCheck = true;
postPatch = ''
substituteInPlace Makefile \
--replace-fail 'PCRE_CONFIG = $(shell which pcre-config)' 'PCRE_CONFIG = $(PKG_CONFIG) libpcre'
''
# Expected:
# Internal Error. MathLib::toDoubleNumber: conversion failed: 1invalid
#
# Actual:
# Internal Error. MathLib::toDoubleNumber: input was not completely consumed: 1invalid
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
substituteInPlace test/testmathlib.cpp \
--replace-fail \
'ASSERT_THROW_INTERNAL_EQUALS(MathLib::toDoubleNumber("1invalid"), INTERNAL, "Internal Error. MathLib::toDoubleNumber: conversion failed: 1invalid");' \
"" \
--replace-fail \
'ASSERT_THROW_INTERNAL_EQUALS(MathLib::toDoubleNumber("1.1invalid"), INTERNAL, "Internal Error. MathLib::toDoubleNumber: conversion failed: 1.1invalid");' \
""
'';
postBuild = ''
make DB2MAN=${docbook_xsl}/xml/xsl/docbook/manpages/docbook.xsl man
'';
postInstall = ''
installManPage cppcheck.1
'';
nativeInstallCheckInputs = [
versionCheckHook
];
versionCheckProgramArg = "--version";
installCheckPhase = ''
runHook preInstallCheck
echo 'int main() {}' > ./installcheck.cpp
$out/bin/cppcheck ./installcheck.cpp > /dev/null
runHook postInstallCheck
'';
passthru = {
updateScript = gitUpdater { };
};
meta = {
description = "Static analysis tool for C/C++ code";
longDescription = ''
Check C/C++ code for memory leaks, mismatching allocation-deallocation,
buffer overruns and more.
'';
homepage = "http://cppcheck.sourceforge.net";
license = lib.licenses.gpl3Plus;
maintainers = with lib.maintainers; [ joachifm ];
platforms = lib.platforms.unix;
};
})

View File

@@ -0,0 +1,39 @@
{
lib,
fetchFromGitHub,
python3Packages,
}:
python3Packages.buildPythonApplication rec {
pname = "cppclean";
version = "0.13";
format = "pyproject";
src = fetchFromGitHub {
owner = "myint";
repo = "cppclean";
rev = "v${version}";
sha256 = "081bw7kkl7mh3vwyrmdfrk3fgq8k5laacx7hz8fjpchrvdrkqph0";
};
postUnpack = ''
patchShebangs .
'';
build-system = with python3Packages; [
setuptools
];
checkPhase = ''
./test.bash
'';
meta = with lib; {
description = "Finds problems in C++ source that slow development of large code bases";
mainProgram = "cppclean";
homepage = "https://github.com/myint/cppclean";
license = licenses.asl20;
maintainers = with maintainers; [ nthorne ];
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,44 @@
{
lib,
stdenv,
fetchurl,
cmake,
pcre,
zlib,
python3,
openssl,
}:
stdenv.mkDerivation rec {
pname = "cppcms";
version = "2.0.0.beta2";
src = fetchurl {
url = "mirror://sourceforge/cppcms/${pname}-${version}.tar.bz2";
sha256 = "sha256-aXAxx9FB/dIVxr5QkLZuIQamO7PlLwnugSDo78bAiiE=";
};
nativeBuildInputs = [
cmake
python3
];
buildInputs = [
pcre
zlib
openssl
];
strictDeps = true;
cmakeFlags = [
"--no-warn-unused-cli"
];
meta = with lib; {
homepage = "http://cppcms.com";
description = "High Performance C++ Web Framework";
platforms = platforms.linux;
license = licenses.mit;
maintainers = [ maintainers.juliendehos ];
};
}

View File

@@ -0,0 +1,35 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "cppcodec";
version = "0.2";
src = fetchFromGitHub {
owner = "tplgy";
repo = "cppcodec";
rev = "v${finalAttrs.version}";
hash = "sha256-k4EACtDOSkTXezTeFtVdM1EVJjvGga/IQSrvDzhyaXw=";
};
nativeBuildInputs = [ cmake ];
meta = with lib; {
description = "Header-only C++11 library for encode/decode functions as in RFC 4648";
longDescription = ''
Header-only C++11 library to encode/decode base64, base64url, base32,
base32hex and hex (a.k.a. base16) as specified in RFC 4648, plus
Crockford's base32.
'';
homepage = "https://github.com/tplgy/cppcodec";
license = licenses.mit;
maintainers = with maintainers; [
panicgh
raitobezarius
];
};
})

View File

@@ -0,0 +1,39 @@
{
lib,
stdenv,
fetchurl,
cmake,
sqlite,
libmysqlclient,
libpq,
unixODBC,
}:
stdenv.mkDerivation rec {
pname = "cppdb";
version = "0.3.1";
src = fetchurl {
url = "mirror://sourceforge/cppcms/${pname}-${version}.tar.bz2";
sha256 = "0blr1casmxickic84dxzfmn3lm7wrsl4aa2abvpq93rdfddfy3nn";
};
nativeBuildInputs = [ cmake ];
buildInputs = [
sqlite
libmysqlclient
libpq
unixODBC
];
cmakeFlags = [ "--no-warn-unused-cli" ];
env.NIX_CFLAGS_COMPILE = "-I${libmysqlclient}/include/mysql -L${libmysqlclient}/lib/mysql";
meta = with lib; {
homepage = "http://cppcms.com/sql/cppdb/";
description = "C++ Connectivity library that supports MySQL, PostgreSQL, Sqlite3 databases and generic ODBC drivers";
platforms = platforms.linux;
license = licenses.boost;
maintainers = [ maintainers.juliendehos ];
};
}

View File

@@ -0,0 +1,31 @@
{
stdenv,
lib,
fetchFromGitHub,
cmake,
llvmPackages,
}:
stdenv.mkDerivation rec {
pname = "cppe";
version = "0.3.1";
src = fetchFromGitHub {
owner = "maxscheurer";
repo = "cppe";
rev = "v${version}";
sha256 = "sha256-guM7+ZWDJLcAUJtPkKLvC4LYSA2eBvER7cgwPZ7FxHw=";
};
nativeBuildInputs = [ cmake ] ++ lib.optionals stdenv.cc.isClang [ llvmPackages.openmp ];
cmakeFlags = [ "-DCMAKE_INSTALL_LIBDIR=lib" ];
meta = with lib; {
description = "C++ and Python library for Polarizable Embedding";
homepage = "https://github.com/maxscheurer/cppe";
license = licenses.lgpl3Only;
platforms = platforms.unix;
maintainers = [ maintainers.sheepforce ];
};
}

View File

@@ -0,0 +1,105 @@
{
stdenv,
lib,
fetchFromGitHub,
installShellFiles,
nix-update-script,
versionCheckHook,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "cppfront";
version = "0.8.1";
src = fetchFromGitHub {
owner = "hsutter";
repo = "cppfront";
tag = "v${finalAttrs.version}";
hash = "sha256-QYjon2EpNexYa2fl09AePkpq0LkRVBOQM++eldcVMvI=";
};
nativeBuildInputs = [
installShellFiles
];
# Remove with next release
postPatch = ''
substituteInPlace source/version.info \
--replace-fail "0.8.0" "0.8.1"
'';
dontConfigure = true;
buildPhase = ''
runHook preBuild
$CXX source/cppfront.cpp -std=c++20 -o cppfront
runHook postBuild
'';
installPhase = ''
runHook preInstall
installBin cppfront
cp -r include $out/include
runHook postInstall
'';
nativeInstallCheckInputs = [
versionCheckHook
];
versionCheckProgramArg = "-version";
doInstallCheck = true;
passthru = {
updateScript = nix-update-script { };
tests.hello-world = stdenv.mkDerivation (finalAttrs': {
pname = "${finalAttrs.pname}-hello-world-test";
inherit (finalAttrs) version src;
sourceRoot = "${finalAttrs'.src.name}/regression-tests";
nativeBuildInputs = [
finalAttrs.finalPackage
installShellFiles
];
postBuild = ''
cppfront pure2-hello.cpp2
$CXX -std=c++20 -o pure2-hello{,.cpp}
'';
postInstall = ''
installBin pure2-hello
'';
doInstallCheck = true;
postInstallCheck = ''
$out/bin/pure2-hello | grep '^Hello \[world\]$' > /dev/null
'';
meta = {
inherit (finalAttrs.meta) maintainers platforms;
mainProgram = "pure2-hello";
};
});
};
meta = {
description = "Experimental compiler from a potential C++ 'syntax 2' (Cpp2) to today's 'syntax 1' (Cpp1)";
homepage = "https://hsutter.github.io/cppfront/";
changelog = "https://github.com/hsutter/cppfront/releases/tag/${finalAttrs.src.tag}";
mainProgram = "cppfront";
license = with lib.licenses; [
asl20
llvm-exception
];
maintainers = with lib.maintainers; [
marcin-serwin
];
platforms = lib.platforms.all;
};
})

View File

@@ -0,0 +1,37 @@
{
fetchurl,
lib,
stdenv,
}:
stdenv.mkDerivation rec {
pname = "cppi";
version = "1.18";
src = fetchurl {
url = "mirror://gnu/${pname}/${pname}-${version}.tar.xz";
sha256 = "1jk42cjaggk71rimjnx3qpmb6hivps0917vl3z7wbxk3i2whb98j";
};
doCheck = true;
meta = {
homepage = "https://savannah.gnu.org/projects/cppi/";
description = "C preprocessor directive indenter";
mainProgram = "cppi";
longDescription = ''
GNU cppi indents C preprocessor directives to reflect their nesting
and ensure that there is exactly one space character between each #if,
#elif, #define directive and the following token. The number of
spaces between the `#' and the following directive must correspond
to the level of nesting of that directive.
'';
license = lib.licenses.gpl3Plus;
maintainers = with lib.maintainers; [ sigmanificient ];
platforms = lib.platforms.all;
};
}

View File

@@ -0,0 +1,98 @@
{
lib,
stdenv,
cmake,
boost,
catch2,
fetchFromGitHub,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "cppitertools";
version = "2.1";
src = fetchFromGitHub {
owner = "ryanhaining";
repo = "cppitertools";
tag = "v${finalAttrs.version}";
hash = "sha256-mii4xjxF1YC3H/TuO/o4cEz8bx2ko6U0eufqNVw5LNA=";
};
__structuredAttrs = true;
# cppitertools has support files for three buildsystems in its repo:
# Scons, Bazel, and CMake. The first two only have definitions for running
# tests. The CMake system defines tests and install targets, including a
# cppitertools-config.cmake, which is really helpful for downstream consumers
# to detect this package since it has no pkg-config.
# However the CMake system also specifies the entire source repo as an install
# target, including support files, the build directory, etc.
# We can't simply take cppitertools-config.cmake for ourselves because before
# install it's placed in non-specific private CMake subdirectory of the build
# directory.
# Therefore, we instead simply patch CMakeLists.txt to make the target that
# installs the entire directory non-default, and then install the headers manually.
strictDeps = true;
doCheck = true;
nativeBuildInputs = [ cmake ];
buildInputs = [ boost ];
nativeCheckInputs = [ catch2 ];
# Required on case-sensitive filesystems to not conflict with the Bazel BUILD
# files that are also in that repo.
cmakeBuildDir = "cmake-build";
includeInstallDir = "${placeholder "out"}/include/cppitertools";
cmakeInstallDir = "${placeholder "out"}/share/cmake";
# This version of cppitertools considers itself as having used the default value,
# and issues warning, unless -Dcppitertools_INSTALL_CMAKE_DIR is present as an
# *environment* variable. It doesn't actually use the value from this environment
# variable at all though, so we still need to pass it in cmakeFlags.
env.cppitertools_INSTALL_CMAKE_DIR = finalAttrs.cmakeInstallDir;
cmakeFlags = [ "-Dcppitertools_INSTALL_CMAKE_DIR=${finalAttrs.cmakeInstallDir}" ];
prePatch = ''
# Mark the `.` install target as non-default.
substituteInPlace CMakeLists.txt \
--replace-fail " DIRECTORY ." " DIRECTORY . EXCLUDE_FROM_ALL"
''
+ lib.optionalString finalAttrs.finalPackage.doCheck ''
# Required for tests.
cp ${lib.getDev catch2}/include/catch2/catch.hpp test/
'';
checkPhase = ''
runHook preCheck
cmake -B build-test -S ../test
cmake --build build-test -j$NIX_BUILD_CORES
runHook postCheck
'';
installPhase = ''
runHook preInstall
# Install the -config.cmake files.
cmake --install . "--prefix=$out"
# Install the headers.
mkdir -p "$includeInstallDir"
cp -r ../*.hpp ../internal "$includeInstallDir"
runHook postInstall
'';
meta = {
description = "Implementation of Python itertools and builtin iteration functions for C++17";
longDescription = ''
Range-based for loop add-ons inspired by the Python builtins and itertools library
for C++17, using lazy evaluation wherever possible.
'';
homepage = "https://github.com/ryanhaining/cppitertools";
maintainers = with lib.maintainers; [ qyriad ];
license = with lib.licenses; bsd2;
};
})

View File

@@ -0,0 +1,48 @@
{
lib,
python3Packages,
fetchFromGitHub,
versionCheckHook,
}:
python3Packages.buildPythonApplication rec {
pname = "cpplint";
version = "2.0.2";
pyproject = true;
src = fetchFromGitHub {
owner = "cpplint";
repo = "cpplint";
tag = version;
hash = "sha256-4crTuqynQt8Nyjqea6DpREtLy7ydRF0hNVnc7tUnO1k=";
};
# We use pytest-cov-stub instead
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail '"pytest-cov",' ""
'';
build-system = with python3Packages; [
setuptools
];
nativeCheckInputs = with python3Packages; [
parameterized
pytest-cov-stub
pytest-timeout
pytestCheckHook
testfixtures
versionCheckHook
];
versionCheckProgramArg = "--version";
meta = {
homepage = "https://github.com/cpplint/cpplint";
description = "Static code checker for C++";
changelog = "https://github.com/cpplint/cpplint/releases/tag/${version}";
mainProgram = "cpplint";
maintainers = [ lib.maintainers.bhipple ];
license = [ lib.licenses.bsd3 ];
};
}

View File

@@ -0,0 +1,70 @@
{
lib,
python3Packages,
fetchFromGitHub,
groff,
nix-update-script,
versionCheckHook,
writableTmpDirAsHomeHook,
}:
python3Packages.buildPythonApplication rec {
pname = "cppman";
version = "0.5.9";
pyproject = true;
src = fetchFromGitHub {
owner = "aitjcize";
repo = "cppman";
tag = version;
hash = "sha256-iPJR4XAjNrBhFHZVOATPi3WwTC1/Y6HK3qmKLqbaK98=";
};
build-system = with python3Packages; [
setuptools
distutils
];
dependencies = [
python3Packages.beautifulsoup4
python3Packages.html5lib
python3Packages.lxml
python3Packages.six
python3Packages.soupsieve
python3Packages.typing-extensions
python3Packages.webencodings
groff
];
# cppman pins all dependency versions via requirements.txt as install_requires
pythonRelaxDeps = true;
# bs4 is merely a dummy package and can be safely removed
# Ideally, its version would also stay fixed.
postPatch = ''
substituteInPlace requirements.txt \
--replace-fail "bs4==0.0.2" ""
'';
pythonImportsCheck = [
"cppman"
];
nativeCheckInputs = [
versionCheckHook
writableTmpDirAsHomeHook
];
# Writable $HOME is required for `cppman --version` to work
versionCheckKeepEnvironment = "HOME";
versionCheckProgramArg = "--version";
passthru.updateScript = nix-update-script { };
meta = {
description = "Terminal viewer for C++ 98/11/14 manual pages";
homepage = "https://github.com/aitjcize/cppman";
changelog = "https://github.com/aitjcize/cppman/blob/${src.tag}/ChangeLog";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [ ryan4yin ];
mainProgram = "cppman";
};
}

View File

@@ -0,0 +1,36 @@
{
lib,
stdenvNoCC,
fetchurl,
}:
stdenvNoCC.mkDerivation rec {
pname = "cppreference-doc";
version = "20250209";
src = fetchurl {
url = "https://github.com/PeterFeicht/${pname}/releases/download/v${version}/html-book-${version}.tar.xz";
hash = "sha256-rFBnGh9S1/CrCRHRRFDrNejC+BLt0OQmss0ePZ25HW8=";
};
sourceRoot = ".";
installPhase = ''
runHook preInstall
mkdir -p $out/share/cppreference/doc
mv reference $out/share/cppreference/doc/html
runHook postInstall
'';
passthru = { inherit pname version; };
meta = with lib; {
description = "C++ standard library reference";
homepage = "https://en.cppreference.com";
license = licenses.cc-by-sa-30;
maintainers = with maintainers; [ panicgh ];
platforms = platforms.all;
};
}

View File

@@ -0,0 +1,23 @@
{
lib,
stdenv,
fetchurl,
}:
stdenv.mkDerivation rec {
pname = "cpptest";
version = "2.0.0";
src = fetchurl {
url = "mirror://sourceforge/project/cpptest/cpptest/cpptest-${version}/cpptest-${version}.tar.gz";
sha256 = "0lpy3f2fjx1srh02myanlp6zfi497whlldcrnij39ghfhm0arcnm";
};
meta = with lib; {
homepage = "http://cpptest.sourceforge.net/";
description = "Simple C++ unit testing framework";
maintainers = with maintainers; [ bosu ];
license = lib.licenses.lgpl3;
platforms = platforms.all;
};
}

View File

@@ -0,0 +1,21 @@
From c55a516e90133d89d67285429c6474241346d27a Mon Sep 17 00:00:00 2001
From: Dirk Eddelbuettel <edd@debian.org>
Date: Mon, 30 Nov 2020 09:41:49 -0600
Subject: [PATCH] g++-11 requires limits header
---
include/cpptoml.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/cpptoml.h b/include/cpptoml.h
index 5a00da3..1dc9fd1 100644
--- a/include/cpptoml.h
+++ b/include/cpptoml.h
@@ -14,6 +14,7 @@
#include <cstring>
#include <fstream>
#include <iomanip>
+#include <limits>
#include <map>
#include <memory>
#include <sstream>

View File

@@ -0,0 +1,57 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
libcxxCmakeModule ? false,
}:
stdenv.mkDerivation {
pname = "cpptoml";
version = "0.4.0";
src = fetchFromGitHub {
owner = "skystrife";
repo = "cpptoml";
rev = "fededad7169e538ca47e11a9ee9251bc361a9a65";
sha256 = "0zlgdlk9nsskmr8xc2ajm6mn1x5wz82ssx9w88s02icz71mcihrx";
};
patches = [
# Fix compilation with GCC 11.
# <https://github.com/skystrife/cpptoml/pull/123>
./add-limits-include.patch
];
nativeBuildInputs = [ cmake ];
cmakeFlags = [
# If this package is built with clang it will attempt to
# use libcxx via the Cmake find_package interface.
# The default libcxx stdenv in llvmPackages doesn't provide
# this and so will fail.
"-DENABLE_LIBCXX=${if libcxxCmakeModule then "ON" else "OFF"}"
"-DCPPTOML_BUILD_EXAMPLES=OFF"
];
# Fix the build with CMake 4.
#
# See:
#
# * <https://github.com/skystrife/cpptoml/pull/132>
# * <https://github.com/facebook/watchman/issues/1286>
postPatch = ''
substituteInPlace CMakeLists.txt \
--replace-fail \
'cmake_minimum_required(VERSION 3.1.0)' \
'cmake_minimum_required(VERSION 3.10)'
'';
meta = with lib; {
description = "C++ TOML configuration library";
homepage = "https://github.com/skystrife/cpptoml";
license = licenses.mit;
maintainers = with maintainers; [ photex ];
platforms = platforms.all;
};
}

View File

@@ -0,0 +1,51 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Philip Taron <philip.taron@gmail.com>
Date: Thu, 19 Jun 2025 09:24:32 -0700
Subject: [PATCH] Use libdwarf-2 as the base include path
Signed-off-by: Philip Taron <philip.taron@gmail.com>
---
CMakeLists.txt | 6 +++---
src/symbols/dwarf/dwarf.hpp | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1c607bd44e528a41ccd637f5293b4f56049f5770..53e1aedf463c5eb95dcfd77fa40de66f51381b47 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -419,7 +419,7 @@ if(CPPTRACE_GET_SYMBOLS_WITH_LIBDWARF)
target_link_libraries(${target_name} PRIVATE ${LIBDWARF_LIBRARIES})
endif()
# There seems to be no consistency at all about where libdwarf decides to place its headers........ Figure out if
- # it's libdwarf/libdwarf.h and libdwarf/dwarf.h or just libdwarf.h and dwarf.h
+ # it's libdwarf-2/libdwarf.h and libdwarf-2/dwarf.h or just libdwarf.h and dwarf.h
include(CheckIncludeFileCXX)
# libdwarf's cmake doesn't properly set variables to indicate where its libraries live
if(NOT CPPTRACE_FIND_LIBDWARF_WITH_PKGCONFIG)
@@ -428,9 +428,9 @@ if(CPPTRACE_GET_SYMBOLS_WITH_LIBDWARF)
target_include_directories(${target_name} PRIVATE ${LIBDWARF_INCLUDE_DIRS})
endif()
set(CMAKE_REQUIRED_INCLUDES ${LIBDWARF_INCLUDE_DIRS})
- CHECK_INCLUDE_FILE_CXX("libdwarf/libdwarf.h" LIBDWARF_IS_NESTED)
+ CHECK_INCLUDE_FILE_CXX("libdwarf-2/libdwarf.h" LIBDWARF_IS_NESTED)
CHECK_INCLUDE_FILE_CXX("libdwarf.h" LIBDWARF_IS_NOT_NESTED)
- # check_include_file("libdwarf/libdwarf.h" LIBDWARF_IS_NESTED)
+ # check_include_file("libdwarf-2/libdwarf.h" LIBDWARF_IS_NESTED)
# check_support(LIBDWARF_IS_NESTED nested_libdwarf_include.cpp "" "" "")
if(${LIBDWARF_IS_NESTED})
target_compile_definitions(${target_name} PRIVATE CPPTRACE_USE_NESTED_LIBDWARF_HEADER_PATH)
diff --git a/src/symbols/dwarf/dwarf.hpp b/src/symbols/dwarf/dwarf.hpp
index 50b2696148584b7a16da602017793797ba98cb58..53fe275492f4fd7e8e905064696e86f837a55f72 100644
--- a/src/symbols/dwarf/dwarf.hpp
+++ b/src/symbols/dwarf/dwarf.hpp
@@ -10,8 +10,8 @@
#include <type_traits>
#ifdef CPPTRACE_USE_NESTED_LIBDWARF_HEADER_PATH
- #include <libdwarf/libdwarf.h>
- #include <libdwarf/dwarf.h>
+ #include <libdwarf-2/libdwarf.h>
+ #include <libdwarf-2/dwarf.h>
#else
#include <libdwarf.h>
#include <dwarf.h>

View File

@@ -0,0 +1,42 @@
{
stdenv,
lib,
cmake,
cpptrace,
src,
checkOutput,
static,
}:
stdenv.mkDerivation (finalAttrs: {
name = "cpptrace-findpackage-integration-test";
inherit src;
nativeBuildInputs = [ cmake ];
buildInputs = [
(cpptrace.override { inherit static; })
];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
install main $out/bin
runHook postInstall
'';
doInstallCheck = true;
installCheckPhase = lib.strings.concatLines (
[ "$out/bin/main" ]
# Check that the backtrace contains the path to the executable.
++ lib.optionals checkOutput [
''
if [[ !(`$out/bin/main 2>&1` =~ "${finalAttrs.name}") ]]; then
echo "ERROR: $out/bin/main does not output '${finalAttrs.name}'"
exit 1
fi
''
]
);
})

View File

@@ -0,0 +1,77 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
pkg-config,
libdwarf,
gtest,
callPackage,
zstd,
nix-update-script,
static ? stdenv.hostPlatform.isStatic,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "cpptrace";
version = "1.0.4";
src = fetchFromGitHub {
owner = "jeremy-rifkin";
repo = "cpptrace";
tag = "v${finalAttrs.version}";
hash = "sha256-KmAJEEU1aTKwleGBllSxlrsO4jVSTKnSTQQZyJ50loY=";
};
patches = [
./0001-Use-libdwarf-2-as-the-base-include-path.patch
];
nativeBuildInputs = [
cmake
pkg-config
];
buildInputs = [ (lib.getDev libdwarf) ];
propagatedBuildInputs = [ zstd ] ++ (lib.optionals static [ libdwarf ]);
cmakeFlags = [
(lib.cmakeBool "CPPTRACE_USE_EXTERNAL_LIBDWARF" true)
(lib.cmakeBool "CPPTRACE_FIND_LIBDWARF_WITH_PKGCONFIG" true)
(lib.cmakeBool "BUILD_SHARED_LIBS" (!static))
(lib.cmakeBool "BUILD_TESTING" finalAttrs.finalPackage.doCheck)
(lib.cmakeBool "CPPTRACE_USE_EXTERNAL_GTEST" true)
];
checkInputs = [ gtest ];
doCheck = true;
passthru = {
updateScript = nix-update-script { };
tests =
let
mkIntegrationTest =
{ static }:
callPackage ./findpackage-integration.nix {
src = "${finalAttrs.src}/test/findpackage-integration";
checkOutput = finalAttrs.finalPackage.doCheck;
inherit static;
};
in
{
findpackage-integration-shared = mkIntegrationTest { static = false; };
findpackage-integration-static = mkIntegrationTest { static = true; };
};
};
meta = {
changelog = "https://github.com/jeremy-rifkin/cpptrace/releases/tag/v${finalAttrs.version}";
description = "Simple, portable, and self-contained stacktrace library for C++11 and newer";
homepage = "https://github.com/jeremy-rifkin/cpptrace";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ xokdvium ];
platforms = lib.platforms.all;
};
})

View File

@@ -0,0 +1,27 @@
{
lib,
stdenv,
fetchurl,
}:
stdenv.mkDerivation rec {
pname = "cppunit";
version = "1.15.1";
src = fetchurl {
url = "https://dev-www.libreoffice.org/src/${pname}-${version}.tar.gz";
sha256 = "19qpqzy66bq76wcyadmi3zahk5v1ll2kig1nvg96zx9padkcdic9";
};
# Avoid blanket -Werror to evade build failures on less
# tested compilers.
configureFlags = [ "--disable-werror" ];
meta = with lib; {
homepage = "https://freedesktop.org/wiki/Software/cppunit/";
description = "C++ unit testing framework";
mainProgram = "DllPlugInTester";
license = licenses.lgpl21;
platforms = platforms.linux ++ platforms.darwin;
};
}

View File

@@ -0,0 +1,23 @@
{
lib,
stdenv,
fetchurl,
}:
stdenv.mkDerivation rec {
pname = "cpputest";
version = "4.0";
src = fetchurl {
url = "https://github.com/cpputest/cpputest/releases/download/v${version}/${pname}-${version}.tar.gz";
sha256 = "1xslavlb1974y5xvs8n1j9zkk05dlw8imy4saasrjlmibl895ii1";
};
meta = with lib; {
homepage = "https://cpputest.github.io/";
description = "Unit testing and mocking framework for C/C++";
platforms = platforms.all;
license = licenses.bsd3;
maintainers = [ maintainers.juliendehos ];
};
}

View File

@@ -0,0 +1,36 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
zeromq,
}:
stdenv.mkDerivation rec {
pname = "cppzmq";
version = "4.11.0";
src = fetchFromGitHub {
owner = "zeromq";
repo = "cppzmq";
rev = "v${version}";
sha256 = "sha256-c6IZ5PnuB96NLYHDHdNclYSF4LpqAfFWxVzeP8BzhCE=";
};
nativeBuildInputs = [ cmake ];
propagatedBuildInputs = [ zeromq ];
cmakeFlags = [
# Tests try to download googletest at compile time; there is no option
# to use a system one and no simple way to download it beforehand.
"-DCPPZMQ_BUILD_TESTS=OFF"
];
meta = with lib; {
homepage = "https://github.com/zeromq/cppzmq";
license = licenses.bsd2;
description = "C++ binding for 0MQ";
maintainers = [ ];
platforms = platforms.unix;
};
}

View File

@@ -0,0 +1,61 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
pkg-config,
openssl,
curl,
zlib,
gtest,
cppcheck,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "cpr";
version = "1.12.0";
src = fetchFromGitHub {
owner = "libcpr";
repo = "cpr";
tag = finalAttrs.version;
hash = "sha256-OkOyh2ibt/jX/Dc+TB1uSlWtzEhdSQwHVN96oCOh2yM=";
};
nativeBuildInputs = [
cmake
pkg-config
gtest
cppcheck
];
buildInputs = [
openssl
zlib
curl
];
cmakeFlags = [
# NOTE: Does not build with CPPCHECK
# (lib.cmakeBool "CPR_ENABLE_CPPCHECK" true)
(lib.cmakeBool "CPR_BUILD_TEST" true)
(lib.cmakeBool "CURL_ZLIB" false)
(lib.cmakeBool "BUILD_SHARED_LIBS" true)
(lib.cmakeBool "CPR_USE_SYSTEM_CURL" true)
(lib.cmakeFeature "CMAKE_BUILD_TYPE" "Release")
];
# Install headers
postInstall = ''
mkdir -p $out/include
cp -r $src/include/* $out/include/
'';
meta = {
description = "C++ Requests: Curl for People, a spiritual port of Python Requests";
homepage = "https://github.com/libcpr/cpr";
license = lib.licenses.mit;
platforms = lib.platforms.all;
maintainers = with lib.maintainers; [ phodina ];
};
})

View File

@@ -0,0 +1,11 @@
diff -Naur cproto-4.6-old/cproto.h cproto-4.6/cproto.h
--- cproto-4.6-old/cproto.h 1998-01-18 19:49:16.000000000 -0500
+++ cproto-4.6/cproto.h 2004-03-14 00:02:32.148070032 -0500
@@ -117,6 +117,7 @@
Declarator *declarator;
DeclaratorList decl_list;
} YYSTYPE;
+#define YYSTYPE_IS_DECLARED 1
/* Prototype styles */
#if OPT_LINTLIBRARY

View File

@@ -0,0 +1,44 @@
{
lib,
stdenv,
fetchurl,
flex,
bison,
}:
stdenv.mkDerivation rec {
pname = "cproto";
version = "4.7y";
src = fetchurl {
urls = [
"mirror://debian/pool/main/c/cproto/cproto_${version}.orig.tar.gz"
# No version listings and apparently no versioned tarball over http(s).
"ftp://ftp.invisible-island.net/cproto/cproto-${version}.tgz"
];
sha256 = "sha256-C9HYvo/wpMpD+Uf5V1DTT2TtqTyeLKeRAP1gFAt8YzE=";
};
# patch made by Joe Khoobyar copied from gentoo bugs
patches = [ ./cproto.patch ];
nativeBuildInputs = [
flex
bison
];
doCheck = true;
doInstallCheck = true;
installCheckPhase = ''
[ "$("$out/bin/cproto" -V 2>&1)" = '${version}' ]
'';
meta = with lib; {
description = "Tool to generate C function prototypes from C source code";
mainProgram = "cproto";
homepage = "https://invisible-island.net/cproto/";
license = licenses.publicDomain;
platforms = platforms.all;
};
}

View File

@@ -0,0 +1,47 @@
{
lib,
stdenv,
fetchFromGitHub,
libcap,
udevCheckHook,
}:
stdenv.mkDerivation rec {
pname = "cpu-energy-meter";
version = "1.2";
src = fetchFromGitHub {
owner = "sosy-lab";
repo = "cpu-energy-meter";
rev = version;
hash = "sha256-QW65Z8mRYLHcyLeOtNAHjwPNWAUP214wqIYclK+whFw=";
};
postPatch = ''
substituteInPlace Makefile \
--replace "DESTDIR :=" "DESTDIR := $out" \
--replace "PREFIX := /usr/local" "PREFIX :="
'';
buildInputs = [ libcap ];
nativeBuildInputs = [
udevCheckHook
];
doInstallCheck = true;
env.NIX_CFLAGS_COMPILE = "-fcommon";
postInstall = ''
install -Dm444 -t $out/etc/udev/rules.d $src/debian/additional_files/59-msr.rules
'';
meta = with lib; {
description = "Tool for measuring energy consumption of Intel CPUs";
homepage = "https://github.com/sosy-lab/cpu-energy-meter";
changelog = "https://github.com/sosy-lab/cpu-energy-meter/blob/main/CHANGELOG.md";
maintainers = with maintainers; [ lorenzleutgeb ];
license = licenses.bsd3;
platforms = [ "x86_64-linux" ];
mainProgram = "cpu-energy-meter";
};
}

View File

@@ -0,0 +1,105 @@
{
lib,
testers,
stdenv,
fetchFromGitHub,
cmake,
pkg-config,
gtk3,
ncurses,
libcpuid,
pciutils,
procps,
wrapGAppsHook3,
nasm,
opencl-headers,
ocl-icd,
vulkan-headers,
vulkan-loader,
glfw,
libXdmcp,
pcre,
util-linux,
libselinux,
libsepol,
libthai,
libdatrie,
libxkbcommon,
libepoxy,
dbus,
at-spi2-core,
libXtst,
gtkmm3,
}:
# Known issues:
# - The daemon can't be started from the GUI, because pkexec requires a shell
# registered in /etc/shells. The nix's bash is not in there when running
# cpu-x from nixpkgs.
stdenv.mkDerivation (finalAttrs: {
pname = "cpu-x";
version = "5.4.0";
src = fetchFromGitHub {
owner = "TheTumultuousUnicornOfDarkness";
repo = "CPU-X";
tag = "v${finalAttrs.version}";
hash = "sha256-db7NxoVZgnYb1MZKfiFINx00JqDnf/TvwumBp6qDooQ=";
};
nativeBuildInputs = [
cmake
pkg-config
wrapGAppsHook3
nasm
];
buildInputs = [
gtk3
gtkmm3
ncurses
libcpuid
pciutils
procps
vulkan-headers
vulkan-loader
glfw
opencl-headers
ocl-icd
libXdmcp
pcre
util-linux
libselinux
libsepol
libthai
libdatrie
libxkbcommon
libepoxy
dbus
at-spi2-core
libXtst
];
preFixup = ''
gappsWrapperArgs+=(
--prefix PATH : ${lib.makeBinPath [ stdenv.cc ]}
--prefix LD_LIBRARY_PATH : ${vulkan-loader}/lib
)
'';
passthru = {
tests = {
version = testers.testVersion { package = finalAttrs.finalPackage; };
};
};
meta = {
description = "Free software that gathers information on CPU, motherboard and more";
mainProgram = "cpu-x";
homepage = "https://thetumultuousunicornofdarkness.github.io/CPU-X";
license = lib.licenses.gpl3Plus;
platforms = [ "x86_64-linux" ];
maintainers = with lib.maintainers; [ viraptor ];
};
})

View File

@@ -0,0 +1,36 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
static ? stdenv.hostPlatform.isStatic,
}:
stdenv.mkDerivation rec {
pname = "cpu_features";
version = "0.10.1";
outputs = [
"out"
"dev"
];
src = fetchFromGitHub {
owner = "google";
repo = "cpu_features";
rev = "v${version}";
hash = "sha256-IBJc1sHHh4G3oTzQm1RAHHahsEECC+BDl14DHJ8M1Ys=";
};
nativeBuildInputs = [ cmake ];
cmakeFlags = [ "-DBUILD_SHARED_LIBS=${if static then "OFF" else "ON"}" ];
meta = with lib; {
description = "Cross platform C99 library to get cpu features at runtime";
homepage = "https://github.com/google/cpu_features";
license = licenses.asl20;
platforms = platforms.all;
maintainers = with maintainers; [ renesat ];
};
}

View File

@@ -0,0 +1,42 @@
{
lib,
stdenv,
fetchFromGitHub,
installShellFiles,
}:
stdenv.mkDerivation rec {
pname = "cpufetch";
version = "1.06";
src = fetchFromGitHub {
owner = "Dr-Noob";
repo = "cpufetch";
rev = "v${version}";
sha256 = "sha256-sE3i2rw8W362BExFEImjw/t17qX8D4/0Ty8jG63bjbk=";
};
nativeBuildInputs = [
installShellFiles
];
installPhase = ''
runHook preInstall
mkdir $out
install -Dm755 cpufetch $out/bin/cpufetch
install -Dm644 LICENSE $out/share/licenses/cpufetch/LICENSE
installManPage cpufetch.1
runHook postInstall
'';
meta = {
description = "Simplistic yet fancy CPU architecture fetching tool";
license = lib.licenses.gpl2Only;
homepage = "https://github.com/Dr-Noob/cpufetch";
changelog = "https://github.com/Dr-Noob/cpufetch/releases/tag/v${version}";
maintainers = with lib.maintainers; [ devhell ];
mainProgram = "cpufetch";
};
}

View File

@@ -0,0 +1,42 @@
{
lib,
stdenv,
fetchurl,
libtool,
gettext,
}:
stdenv.mkDerivation rec {
pname = "cpufrequtils";
version = "008";
src = fetchurl {
url = "http://ftp.be.debian.org/pub/linux/utils/kernel/cpufreq/cpufrequtils-${version}.tar.gz";
hash = "sha256-AFOgcYPQaUg70GJhS8YcuAgMV32mHN9+ExsGThoa8Yg=";
};
patches = [
# I am not 100% sure that this is ok, but it breaks repeatable builds.
./remove-pot-creation-date.patch
];
patchPhase = ''
sed -e "s@= /usr/bin/@= @g" \
-e "s@/usr/@$out/@" \
-i Makefile
'';
buildInputs = [
stdenv.cc.libc.linuxHeaders
libtool
gettext
];
meta = with lib; {
description = "Tools to display or change the CPU governor settings";
homepage = "http://ftp.be.debian.org/pub/linux/utils/kernel/cpufreq/cpufrequtils.html";
license = licenses.gpl2Only;
platforms = [ "x86_64-linux" ];
mainProgram = "cpufreq-set";
};
}

View File

@@ -0,0 +1,24 @@
diff -u cpufrequtils-008/Makefile cpufrequtils-008.new/Makefile
--- cpufrequtils-008/Makefile 2012-05-06 01:17:18.000000000 +0200
+++ cpufrequtils-008.new/Makefile 2013-08-16 20:52:29.961086536 +0200
@@ -205,7 +205,8 @@
@xgettext --default-domain=$(PACKAGE) --add-comments \
--keyword=_ --keyword=N_ $(UTIL_SRC) && \
test -f $(PACKAGE).po && \
- mv -f $(PACKAGE).po po/$(PACKAGE).pot
+ mv -f $(PACKAGE).po po/$(PACKAGE).pot && \
+ sed -i -e'/POT-Creation/d' po/*.pot
update-gmo: po/$(PACKAGE).pot
@for HLANG in $(LANGUAGES); do \
@@ -217,6 +218,7 @@
echo "msgmerge for $$HLANG failed!"; \
rm -f po/$$HLANG.new.po; \
fi; \
+ sed -i -e'/POT-Creation/d' po/*.po; \
msgfmt --statistics -o po/$$HLANG.gmo po/$$HLANG.po; \
done;
Common subdirectories: cpufrequtils-008/man and cpufrequtils-008.new/man
Common subdirectories: cpufrequtils-008/po and cpufrequtils-008.new/po
Common subdirectories: cpufrequtils-008/utils and cpufrequtils-008.new/utils

View File

@@ -0,0 +1,55 @@
{
lib,
stdenv,
fetchurl,
perl,
}:
stdenv.mkDerivation rec {
pname = "cpuid";
version = "20250513";
src = fetchurl {
url = "http://etallen.com/cpuid/${pname}-${version}.src.tar.gz";
sha256 = "sha256-b0dKIrWEhIjkVLAaMduA65WNVWdLUzlTP8DmrreTYms=";
};
# For pod2man during the build process.
nativeBuildInputs = [ perl ];
# As runtime dependency for cpuinfo2cpuid.
buildInputs = [ perl ];
# The Makefile hardcodes $(BUILDROOT)/usr as installation
# destination. Just nuke all mentions of /usr to get the right
# installation location.
patchPhase = ''
sed -i -e 's,/usr/,/,' Makefile
'';
installPhase = ''
make install BUILDROOT=$out
if [ ! -x $out/bin/cpuid ]; then
echo Failed to properly patch Makefile.
exit 1
fi
'';
meta = with lib; {
description = "Linux tool to dump x86 CPUID information about the CPU";
longDescription = ''
cpuid dumps detailed information about the CPU(s) gathered from the CPUID
instruction, and also determines the exact model of CPU(s). It supports
Intel, AMD, VIA, Hygon, and Zhaoxin CPUs, as well as older Transmeta,
Cyrix, UMC, NexGen, Rise, and SiS CPUs.
'';
homepage = "http://etallen.com/cpuid.html";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ blitz ];
platforms = [
"i686-linux"
"x86_64-linux"
];
};
}

View File

@@ -0,0 +1,56 @@
{
lib,
fetchFromGitHub,
cmake,
pkg-config,
stdenv,
gtest,
nix-update-script,
testers,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "cpuinfo";
version = "0-unstable-2025-07-24";
src = fetchFromGitHub {
owner = "pytorch";
repo = "cpuinfo";
rev = "33ed0be77d7767d0e2010e2c3cf972ef36c7c307";
hash = "sha256-0rZzbZkOo6DAt1YnH4rtx0FvmCuYH8M6X3DNJ0gURpU=";
};
passthru.updateScript = nix-update-script { extraArgs = [ "--version=branch" ]; };
passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
nativeBuildInputs = [
cmake
pkg-config
];
checkInputs = [ gtest ];
cmakeFlags = [
(lib.cmakeBool "CPUINFO_BUILD_UNIT_TESTS" finalAttrs.finalPackage.doCheck)
(lib.cmakeBool "CPUINFO_BUILD_MOCK_TESTS" finalAttrs.finalPackage.doCheck)
(lib.cmakeBool "CPUINFO_BUILD_BENCHMARKS" false)
(lib.cmakeBool "USE_SYSTEM_LIBS" true)
];
# The tests check what CPU the host has and makes sure it can query information.
# not all build environments may have this information available. And, cpuinfo may
# not understand all CPUs (causing test failures such as https://github.com/pytorch/cpuinfo/issues/132)
# Instead, allow building in any environment.
doCheck = false;
meta = {
description = "Tools and library to detect essential for performance optimization information about host CPU";
homepage = "https://github.com/pytorch/cpuinfo";
license = lib.licenses.bsd2;
mainProgram = "cpu-info";
maintainers = with lib.maintainers; [ pawelchcki ];
pkgConfigModules = [ "libcpuinfo" ];
# https://github.com/pytorch/cpuinfo/blob/877328f188a3c7d1fa855871a278eb48d530c4c0/CMakeLists.txt#L98
platforms = lib.platforms.x86 ++ lib.platforms.aarch ++ lib.platforms.riscv;
};
})

View File

@@ -0,0 +1,12 @@
diff --git a/src/process_group.c b/src/process_group.c
index 06d73a6..3ca66b0 100644
--- a/src/process_group.c
+++ b/src/process_group.c
@@ -20,6 +20,7 @@
*/
#include <string.h>
+#include <libgen.h>
#include <stdlib.h>
#include <limits.h>
#include <sys/time.h>

View File

@@ -0,0 +1,36 @@
{
lib,
stdenv,
fetchFromGitHub,
}:
stdenv.mkDerivation rec {
pname = "cpulimit";
version = "0.2";
src = fetchFromGitHub {
owner = "opsengine";
repo = "cpulimit";
rev = "v${version}";
sha256 = "1dz045yhcsw1rdamzpz4bk8mw888in7fyqk1q1b3m1yk4pd1ahkh";
};
patches = [
./remove-sys-sysctl.h.patch
./get-missing-basename.patch
];
installPhase = ''
mkdir -p $out/bin
cp src/cpulimit $out/bin
'';
meta = with lib; {
homepage = "https://github.com/opsengine/cpulimit";
description = "CPU usage limiter";
platforms = platforms.unix;
license = licenses.gpl2Plus;
mainProgram = "cpulimit";
maintainers = [ maintainers.jsoo1 ];
};
}

View File

@@ -0,0 +1,21 @@
Remove references to sys/sysctl.h which were deprecated long ago.
diff --git a/src/cpulimit.c b/src/cpulimit.c
index 50eabea..eba4615 100644
--- a/src/cpulimit.c
+++ b/src/cpulimit.c
@@ -38,7 +38,9 @@
#include <string.h>
#include <sys/stat.h>
#include <sys/time.h>
+#ifdef __APPLE__
#include <sys/sysctl.h>
+#endif
#include <sys/resource.h>
#include <sys/types.h>
#include <sys/wait.h>
-#ifdef __APPLE__ || __FREEBSD__
+#if defined(__APPLE__) || defined(__FREEBSD__)
#include <libgen.h>
#endif

View File

@@ -0,0 +1,49 @@
{
lib,
stdenv,
fetchFromGitHub,
fetchpatch,
curl,
jansson,
perl,
autoreconfHook,
}:
stdenv.mkDerivation rec {
pname = "cpuminer";
version = "2.5.1";
src = fetchFromGitHub {
owner = "pooler";
repo = "cpuminer";
rev = "v${version}";
sha256 = "0f44i0z8rid20c2hiyp92xq0q0mjj537r05sa6vdbc0nl0a5q40i";
};
patches = [
(fetchpatch {
name = "fix-build-on-aarch64.patch";
url = "https://github.com/pooler/cpuminer/commit/5f02105940edb61144c09a7eb960bba04a10d5b7.patch";
hash = "sha256-lGAcwDcXgcJBFhasSEdQIEIY7pp6x/PEXHBsVwAOqhc=";
})
];
postPatch = if stdenv.cc.isClang then "${perl}/bin/perl ./nomacro.pl" else null;
nativeBuildInputs = [ autoreconfHook ];
buildInputs = [
curl
jansson
];
configureFlags = [ "CFLAGS=-O3" ];
meta = with lib; {
homepage = "https://github.com/pooler/cpuminer";
description = "CPU miner for Litecoin and Bitcoin";
license = licenses.gpl2Plus;
platforms = platforms.all;
maintainers = with maintainers; [ pSub ];
mainProgram = "minerd";
};
}

View File

@@ -0,0 +1,41 @@
{
lib,
fetchFromGitHub,
python3,
}:
python3.pkgs.buildPythonApplication rec {
pname = "cpuset";
version = "1.6.2";
format = "pyproject";
src = fetchFromGitHub {
owner = "lpechacek";
repo = "cpuset";
rev = "v${version}";
hash = "sha256-fW0SXNI10pb6FTn/2TOqxP9qlys0KL/H9m//NjslUaY=";
};
build-system = with python3.pkgs; [
setuptools
];
makeFlags = [ "prefix=$(out)" ];
checkPhase = ''
runHook preCheck
make -C t
runHook postCheck
'';
meta = with lib; {
description = "Python application that forms a wrapper around the standard Linux filesystem calls, to make using the cpusets facilities in the Linux kernel easier";
homepage = "https://github.com/SUSE/cpuset";
license = licenses.gpl2;
mainProgram = "cset";
maintainers = with maintainers; [ wykurz ];
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,37 @@
{
lib,
stdenv,
fetchFromGitHub,
ncurses,
}:
stdenv.mkDerivation rec {
pname = "cpustat";
version = "0.03.00";
src = fetchFromGitHub {
owner = "ColinIanKing";
repo = "cpustat";
tag = "V${version}";
hash = "sha256-wvCaMmWKEzanwgDBL2+8qAIIIKfGNi0O2J+SUXOx508=";
};
buildInputs = [
ncurses
];
installFlags = [
"BINDIR=${placeholder "out"}/bin"
"MANDIR=${placeholder "out"}/share/man/man8"
"BASHDIR=${placeholder "out"}/share/bash-completion/completions"
];
meta = with lib; {
description = "CPU usage monitoring tool";
homepage = "https://github.com/ColinIanKing/cpustat";
license = licenses.gpl2Plus;
platforms = platforms.linux;
maintainers = [ ];
mainProgram = "cpustat";
};
}