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,47 @@
{
lib,
stdenv,
fetchFromGitHub,
fetchpatch,
cmake,
boost,
}:
stdenv.mkDerivation rec {
pname = "cm256cc";
version = "1.1.0";
src = fetchFromGitHub {
owner = "f4exb";
repo = "cm256cc";
rev = "v${version}";
sha256 = "sha256-T7ZUVVYGdzAialse//MoqWCVNBpbZvzWMAKc0cw7O9k=";
};
patches = [
# Pull fix pending upstream inclusion for gcc-13 support:
# https://github.com/f4exb/cm256cc/pull/18
(fetchpatch {
name = "gcc-13.patch";
url = "https://github.com/f4exb/cm256cc/commit/a7f142bcdae8be1c646d67176ba0ba0f7e8dcd68.patch";
hash = "sha256-J7bm44sqnGsdPhJxQrE8LDxZ6tkTzLslHQnnKmtgrtM=";
})
];
nativeBuildInputs = [ cmake ];
buildInputs = [ boost ];
# https://github.com/f4exb/cm256cc/issues/16
postPatch = ''
substituteInPlace libcm256cc.pc.in \
--replace '$'{exec_prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@
'';
meta = with lib; {
description = "Fast GF(256) Cauchy MDS Block Erasure Codec in C++";
homepage = "https://github.com/f4exb/cm256cc";
platforms = platforms.unix;
maintainers = with maintainers; [ alkeryn ];
license = licenses.gpl3;
};
}

View File

@@ -0,0 +1,35 @@
{
lib,
stdenvNoCC,
fetchurl,
}:
stdenvNoCC.mkDerivation rec {
pname = "cm-unicode";
version = "0.7.0";
src = fetchurl {
url = "mirror://sourceforge/cm-unicode/cm-unicode/${version}/${pname}-${version}-otf.tar.xz";
hash = "sha256-VIp+vk1IYbEHW15wMrfGVOPqg1zBZDpgFx+jlypOHCg=";
};
installPhase = ''
runHook preInstall
install -m444 -Dt $out/share/fonts/opentype *.otf
install -m444 -Dt $out/share/doc/${pname}-${version} README FontLog.txt
runHook postInstall
'';
meta = with lib; {
homepage = "https://cm-unicode.sourceforge.io/";
description = "Computer Modern Unicode fonts";
maintainers = with maintainers; [
raskin
rycee
];
license = licenses.ofl;
platforms = platforms.all;
};
}

View File

@@ -0,0 +1,81 @@
{
lib,
python3Packages,
fetchFromGitHub,
# dependencies
cmake-format,
# tests
cmake,
versionCheckHook,
}:
python3Packages.buildPythonApplication rec {
pname = "cmake-language-server";
version = "0.1.11";
pyproject = true;
src = fetchFromGitHub {
owner = "regen100";
repo = "cmake-language-server";
tag = "v${version}";
hash = "sha256-QxknG5NFYky6ZSjiIugLfHT4gXsyTBVbMMeULhQsmdk=";
};
# Test timeouts occasionally cause the build to fail
postPatch = ''
substituteInPlace tests/test_server.py \
--replace-fail \
"CALL_TIMEOUT = 2" \
"CALL_TIMEOUT = 10"
'';
build-system = with python3Packages; [
pdm-backend
];
dontUseCmakeConfigure = true;
dependencies = with python3Packages; [
pygls
];
pythonImportsCheck = [ "cmake_language_server" ];
nativeCheckInputs = [
cmake
cmake-format
versionCheckHook
]
++ (with python3Packages; [
pytest-datadir
pytestCheckHook
]);
versionCheckProgramArg = "--version";
# version.py generated by pdm, no idea why it's not present in test phase
# https://github.com/regen100/cmake-language-server/blob/v0.1.11/pyproject.toml#L35-L36
preCheck = ''
echo "__version__ = \"$PDM_BUILD_SCM_VERSION\"" > cmake_language_server/version.py
'';
disabledTests = [
# AssertionError: CTEST_SCP_COMMAND not found
"test_parse_variables"
# AssertionError: AddFileDependencies not found
"test_parse_modules"
# AssertionError: assert 'Boost' in [...
"test_completions_triggercharacter"
];
meta = {
description = "CMake LSP Implementation";
homepage = "https://github.com/regen100/cmake-language-server";
changelog = "https://github.com/regen100/cmake-language-server/releases/tag/${src.tag}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ kira-bruneau ];
mainProgram = "cmake-language-server";
};
}

View File

@@ -0,0 +1,42 @@
{
lib,
fetchFromGitHub,
python3Packages,
testers,
cmake-lint,
}:
python3Packages.buildPythonApplication rec {
pname = "cmake-lint";
version = "1.4.3";
pyproject = true;
src = fetchFromGitHub {
owner = "cmake-lint";
repo = "cmake-lint";
tag = version;
hash = "sha256-/OuWwerBlJynEibaYo+jkLpHt4x9GZrqMRJNxgrDBlM=";
};
build-system = [ python3Packages.setuptools ];
pythonImportsCheck = [ "cmakelint" ];
nativeCheckInputs = [
python3Packages.pytestCheckHook
python3Packages.pytest-cov-stub
];
passthru.tests = {
version = testers.testVersion { package = cmake-lint; };
};
meta = {
description = "Static code checker for CMake files";
homepage = "https://github.com/cmake-lint/cmake-lint";
changelog = "https://github.com/cmake-lint/cmake-lint/releases/tag/${version}";
license = lib.licenses.asl20;
maintainers = [ lib.maintainers.luftmensch-luftmensch ];
mainProgram = "cmakelint";
};
}

View File

@@ -0,0 +1,50 @@
diff --git a/Modules/Platform/UnixPaths.cmake b/Modules/Platform/UnixPaths.cmake
index e95da44ea4..bdf4155232 100644
--- a/Modules/Platform/UnixPaths.cmake
+++ b/Modules/Platform/UnixPaths.cmake
@@ -71,28 +71,38 @@
/lib /lib32 /lib64 /usr/lib /usr/lib32 /usr/lib64
)
-if(CMAKE_SYSROOT_COMPILE)
- set(_cmake_sysroot_compile "${CMAKE_SYSROOT_COMPILE}")
+# Add the Nix C library paths.
+if(DEFINED ENV{NIX_CC}
+ AND IS_DIRECTORY "$ENV{NIX_CC}"
+ AND EXISTS "$ENV{NIX_CC}/nix-support/orig-libc"
+ AND EXISTS "$ENV{NIX_CC}/nix-support/orig-libc-dev")
+ file(STRINGS "$ENV{NIX_CC}/nix-support/orig-libc" _nix_cmake_libc)
+ file(STRINGS "$ENV{NIX_CC}/nix-support/orig-libc-dev" _nix_cmake_libc_dev)
else()
- set(_cmake_sysroot_compile "${CMAKE_SYSROOT}")
+ set(_nix_cmake_libc @libc_lib@)
+ set(_nix_cmake_libc_dev @libc_dev@)
endif()
+list(APPEND CMAKE_SYSTEM_INCLUDE_PATH "${_nix_cmake_libc_dev}/include")
+list(APPEND CMAKE_SYSTEM_LIBRARY_PATH "${_nix_cmake_libc}/lib")
+list(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${_nix_cmake_libc}/lib")
# Default per-language values. These may be later replaced after
# parsing the implicit directory information from compiler output.
set(_CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES_INIT
${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES}
- "${_cmake_sysroot_compile}/usr/include"
+ "${_nix_cmake_libc_dev}/include"
)
set(_CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES_INIT
${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES}
- "${_cmake_sysroot_compile}/usr/include"
+ "${_nix_cmake_libc_dev}/include"
)
set(_CMAKE_CUDA_IMPLICIT_INCLUDE_DIRECTORIES_INIT
${CMAKE_CUDA_IMPLICIT_INCLUDE_DIRECTORIES}
- "${_cmake_sysroot_compile}/usr/include"
+ "${_nix_cmake_libc_dev}/include"
)
-unset(_cmake_sysroot_compile)
+unset(_nix_cmake_libc)
+unset(_nix_cmake_libc_dev)
# Reminder when adding new locations computed from environment variables
# please make sure to keep Help/variable/CMAKE_SYSTEM_PREFIX_PATH.rst

View File

@@ -0,0 +1,18 @@
cmakePcfileCheckPhase() {
while IFS= read -rd $'\0' file; do
grepout=$(grep --line-number '}//nix/store' "$file" || true)
if [ -n "$grepout" ]; then
{
echo "Broken paths found in a .pc file! $file"
echo "The following lines have issues (specifically '//' in paths)."
echo "$grepout"
echo "It is very likely that paths are being joined improperly."
echo 'ex: "${prefix}/@CMAKE_INSTALL_LIBDIR@" should be "@CMAKE_INSTALL_FULL_LIBDIR@"'
echo "Please see https://github.com/NixOS/nixpkgs/issues/144170 for more details."
exit 1
} 1>&2
fi
done < <(find "${!outputDev}" -iname "*.pc" -print0)
}
postFixupHooks+=(cmakePcfileCheckPhase)

View File

@@ -0,0 +1,61 @@
diff --git a/Modules/Platform/Darwin-Initialize.cmake b/Modules/Platform/Darwin-Initialize.cmake
index 196ab18b0b..31dd4346b1 100644
--- a/Modules/Platform/Darwin-Initialize.cmake
+++ b/Modules/Platform/Darwin-Initialize.cmake
@@ -16,7 +16,7 @@
endif()
if(NOT CMAKE_CROSSCOMPILING)
- execute_process(COMMAND sw_vers -productVersion
+ execute_process(COMMAND @sw_vers@ -productVersion
OUTPUT_VARIABLE _CMAKE_HOST_OSX_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx
index c65587edbe..0a7cc380c3 100644
--- a/Source/kwsys/SystemInformation.cxx
+++ b/Source/kwsys/SystemInformation.cxx
@@ -3833,7 +3833,7 @@
}
char const* names[3] = { "Pages wired down:", "Pages active:", nullptr };
long long values[2] = { 0 };
- int ierr = GetFieldsFromCommand("vm_stat", names, values);
+ int ierr = GetFieldsFromCommand("@vm_stat@", names, values);
if (ierr) {
return -1;
}
@@ -5586,7 +5586,7 @@
{
#ifdef __APPLE__
std::vector<char const*> args;
- args.push_back("sw_vers");
+ args.push_back("@sw_vers@");
args.push_back(arg);
args.push_back(nullptr);
ver = this->RunProcess(args);
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 15a1e2c0c3..33bb304cf7 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1958,7 +1958,7 @@
if(CMake_TEST_XCODE_VERSION AND NOT CMake_TEST_XCODE_VERSION VERSION_LESS 5)
if(NOT CMake_TEST_XCTest_DEPLOYMENT_TARGET)
execute_process(
- COMMAND sw_vers -productVersion
+ COMMAND @sw_vers@ -productVersion
OUTPUT_VARIABLE OSX_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
diff --git a/Utilities/cmcurl/CMakeLists.txt b/Utilities/cmcurl/CMakeLists.txt
index ddc975c202..8ff651fd90 100644
--- a/Utilities/cmcurl/CMakeLists.txt
+++ b/Utilities/cmcurl/CMakeLists.txt
@@ -127,7 +127,7 @@
set(OSX_VERSION ${CMAKE_OSX_DEPLOYMENT_TARGET})
else()
execute_process(
- COMMAND sw_vers -productVersion
+ COMMAND @sw_vers@ -productVersion
OUTPUT_VARIABLE OSX_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
)

View File

@@ -0,0 +1,79 @@
diff --git a/Modules/CMakeDetermineSystem.cmake b/Modules/CMakeDetermineSystem.cmake
index dc26258eac..dd8d30e3d9 100644
--- a/Modules/CMakeDetermineSystem.cmake
+++ b/Modules/CMakeDetermineSystem.cmake
@@ -68,7 +68,7 @@
endif()
if(_CMAKE_APPLE_SILICON_PROCESSOR)
if(";${_CMAKE_APPLE_SILICON_PROCESSOR};" MATCHES "^;(arm64|x86_64);$")
- execute_process(COMMAND sysctl -q hw.optional.arm64
+ execute_process(COMMAND @sysctl@ -q hw.optional.arm64
OUTPUT_VARIABLE _sysctl_stdout
ERROR_VARIABLE _sysctl_stderr
RESULT_VARIABLE _sysctl_result
diff --git a/Modules/Platform/Darwin-Initialize.cmake b/Modules/Platform/Darwin-Initialize.cmake
index 31dd4346b1..7c4f123a1d 100644
--- a/Modules/Platform/Darwin-Initialize.cmake
+++ b/Modules/Platform/Darwin-Initialize.cmake
@@ -28,7 +28,7 @@
if(NOT CMAKE_CROSSCOMPILING AND
CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND
CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "^(arm64|x86_64)$")
- execute_process(COMMAND sysctl -q hw.optional.arm64
+ execute_process(COMMAND @sysctl@ -q hw.optional.arm64
OUTPUT_VARIABLE _sysctl_stdout
ERROR_VARIABLE _sysctl_stderr
RESULT_VARIABLE _sysctl_result
diff --git a/Modules/ProcessorCount.cmake b/Modules/ProcessorCount.cmake
index 260b6631c0..ffb8fcd8d2 100644
--- a/Modules/ProcessorCount.cmake
+++ b/Modules/ProcessorCount.cmake
@@ -87,8 +87,7 @@
if(NOT count)
# Mac, FreeBSD, OpenBSD (systems with sysctl):
- find_program(ProcessorCount_cmd_sysctl sysctl
- PATHS /usr/sbin /sbin)
+ set(ProcessorCount_cmd_sysctl @sysctl@)
mark_as_advanced(ProcessorCount_cmd_sysctl)
if(ProcessorCount_cmd_sysctl)
execute_process(COMMAND ${ProcessorCount_cmd_sysctl} -n hw.ncpu
diff --git a/Source/kwsys/ProcessUNIX.c b/Source/kwsys/ProcessUNIX.c
index a918b8d9a7..36145707e1 100644
--- a/Source/kwsys/ProcessUNIX.c
+++ b/Source/kwsys/ProcessUNIX.c
@@ -2503,7 +2503,7 @@
have two integers to store: the pid and then the ppid. */
#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \
defined(__OpenBSD__) || defined(__GLIBC__) || defined(__GNU__)
-# define KWSYSPE_PS_COMMAND "ps axo pid,ppid"
+# define KWSYSPE_PS_COMMAND "@ps@ axo pid,ppid"
# define KWSYSPE_PS_FORMAT "%d %d\n"
#elif defined(__sun) && (defined(__SVR4) || defined(__svr4__)) /* Solaris */
# define KWSYSPE_PS_COMMAND "ps -e -o pid,ppid"
diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx
index 0a7cc380c3..9923dc4ab9 100644
--- a/Source/kwsys/SystemInformation.cxx
+++ b/Source/kwsys/SystemInformation.cxx
@@ -3876,7 +3876,7 @@
long long memUsed = 0;
pid_t pid = getpid();
std::ostringstream oss;
- oss << "ps -o rss= -p " << pid;
+ oss << "@ps@ -o rss= -p " << pid;
FILE* file = popen(oss.str().c_str(), "r");
if (!file) {
return -1;
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 33bb304cf7..7dbda40a81 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -216,7 +216,7 @@
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND NOT DEFINED CMake_TEST_APPLE_SILICON)
- execute_process(COMMAND sysctl -q hw.optional.arm64
+ execute_process(COMMAND @sysctl@ -q hw.optional.arm64
OUTPUT_VARIABLE _sysctl_stdout
ERROR_VARIABLE _sysctl_stderr
RESULT_VARIABLE _sysctl_result

View File

@@ -0,0 +1,13 @@
diff --git a/Source/CTest/cmCTestCurl.h b/Source/CTest/cmCTestCurl.h
index 7836f4b9c78a1d103eee515d618856a6712b4480..9113890b5a12cb157b691b66d96e25d0fd4b50ef 100644
--- a/Source/CTest/cmCTestCurl.h
+++ b/Source/CTest/cmCTestCurl.h
@@ -52,7 +52,7 @@ private:
std::vector<std::string> HttpHeaders;
std::string HTTPProxyAuth;
std::string HTTPProxy;
- curl_proxytype HTTPProxyType;
+ long HTTPProxyType;
bool UseHttp10 = false;
bool Quiet = false;
int TimeOutSeconds = 0;

View File

@@ -0,0 +1,28 @@
diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx
index b8d4765692..902c1e5290 100644
--- a/Source/cmFindBase.cxx
+++ b/Source/cmFindBase.cxx
@@ -312,6 +312,11 @@ void cmFindBase::FillCMakeEnvironmentPath()
// Add CMAKE_*_PATH environment variables
std::string var = cmStrCat("CMAKE_", this->CMakePathName, "_PATH");
paths.AddEnvPrefixPath("CMAKE_PREFIX_PATH");
+ if (this->CMakePathName != "PROGRAM") {
+ // Like CMAKE_PREFIX_PATH except when searching for programs. Programs need
+ // to be located via PATH
+ paths.AddEnvPrefixPath("NIXPKGS_CMAKE_PREFIX_PATH");
+ }
paths.AddEnvPath(var);
if (this->CMakePathName == "PROGRAM") {
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index 6201894fd1..9533862a2b 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -2467,6 +2467,7 @@ void cmFindPackageCommand::FillPrefixesCMakeEnvironment()
// And now the general CMake environment variables
paths.AddEnvPath("CMAKE_PREFIX_PATH");
+ paths.AddEnvPath("NIXPKGS_CMAKE_PREFIX_PATH");
if (this->DebugModeEnabled()) {
debugBuffer = cmStrCat(debugBuffer,
"CMAKE_PREFIX_PATH env variable "

View File

@@ -0,0 +1,219 @@
{
lib,
stdenv,
fetchurl,
replaceVars,
buildPackages,
bzip2,
curlMinimal,
expat,
libarchive,
libuv,
ncurses,
openssl,
pkg-config,
ps,
sysctl,
rhash,
sphinx,
texinfo,
xz,
zlib,
darwin,
isBootstrap ? null,
isMinimalBuild ? (
if isBootstrap != null then
lib.warn "isBootstrap argument is deprecated and will be removed; use isMinimalBuild instead" isBootstrap
else
false
),
useOpenSSL ? !isMinimalBuild,
useSharedLibraries ? (!isMinimalBuild && !stdenv.hostPlatform.isCygwin),
uiToolkits ? [ ], # can contain "ncurses" and/or "qt5"
buildDocs ? !(isMinimalBuild || (uiToolkits == [ ])),
libsForQt5,
gitUpdater,
}:
let
inherit (libsForQt5) qtbase wrapQtAppsHook;
cursesUI = lib.elem "ncurses" uiToolkits;
qt5UI = lib.elem "qt5" uiToolkits;
in
# Accepts only "ncurses" and "qt5" as possible uiToolkits
assert lib.subtractLists [ "ncurses" "qt5" ] uiToolkits == [ ];
# Minimal, bootstrap cmake does not have toolkits
assert isMinimalBuild -> (uiToolkits == [ ]);
stdenv.mkDerivation (finalAttrs: {
pname =
"cmake"
+ lib.optionalString isMinimalBuild "-minimal"
+ lib.optionalString cursesUI "-cursesUI"
+ lib.optionalString qt5UI "-qt5UI";
version = "4.1.1";
src = fetchurl {
url = "https://cmake.org/files/v${lib.versions.majorMinor finalAttrs.version}/cmake-${finalAttrs.version}.tar.gz";
hash = "sha256-sp9vGXM6oiS3djUHoQikJ+1Ixojh+vIrKcROHDBUkoI=";
};
patches = [
# Add NIXPKGS_CMAKE_PREFIX_PATH to cmake which is like CMAKE_PREFIX_PATH
# except it is not searched for programs
./nixpkgs-cmake-prefix-path.patch
# Add the libc paths from the compiler wrapper.
./add-nixpkgs-libc-paths.patch
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
(replaceVars ./darwin-binary-paths.patch {
sw_vers = lib.getExe' darwin.DarwinTools "sw_vers";
vm_stat = lib.getExe' darwin.system_cmds "vm_stat";
})
]
++ lib.optionals (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isFreeBSD) [
(replaceVars ./darwin-bsd-binary-paths.patch {
# `ps(1)` is theoretically used on Linux too, but only when
# `/proc` is inaccessible, so we can skip the dependency.
ps = lib.getExe ps;
sysctl = lib.getExe sysctl;
})
]
++ [
# Backport of https://gitlab.kitware.com/cmake/cmake/-/merge_requests/11134
./fix-curl-8.16.patch
# Remove references to nonNix search paths.
./remove-impure-search-paths.patch
];
outputs = [
"out"
]
++ lib.optionals buildDocs [
"man"
"info"
];
separateDebugInfo = true;
setOutputFlags = false;
setupHooks = [
./setup-hook.sh
./check-pc-files-hook.sh
];
depsBuildBuild = [ buildPackages.stdenv.cc ];
nativeBuildInputs =
finalAttrs.setupHooks
++ [
pkg-config
]
++ lib.optionals buildDocs [ texinfo ]
++ lib.optionals qt5UI [ wrapQtAppsHook ];
buildInputs =
lib.optionals useSharedLibraries [
bzip2
curlMinimal
expat
libarchive
xz
zlib
libuv
rhash
]
++ lib.optional useOpenSSL openssl
++ lib.optional cursesUI ncurses
++ lib.optional qt5UI qtbase;
preConfigure = ''
substituteInPlace Modules/Platform/UnixPaths.cmake \
--subst-var-by libc_bin ${lib.getBin stdenv.cc.libc} \
--subst-var-by libc_dev ${lib.getDev stdenv.cc.libc} \
--subst-var-by libc_lib ${lib.getLib stdenv.cc.libc}
# CC_FOR_BUILD and CXX_FOR_BUILD are used to bootstrap cmake
configureFlags="--parallel=''${NIX_BUILD_CORES:-1} CC=$CC_FOR_BUILD CXX=$CXX_FOR_BUILD $configureFlags $cmakeFlags"
'';
# The configuration script is not autoconf-based, although being similar;
# triples and other interesting info are passed via CMAKE_* environment
# variables and commandline switches
configurePlatforms = [ ];
configureFlags = [
"--docdir=share/doc/${finalAttrs.pname}-${finalAttrs.version}"
]
++ (
if useSharedLibraries then
[
"--no-system-cppdap"
"--no-system-jsoncpp"
"--system-libs"
]
else
[
"--no-system-libs"
]
) # FIXME: cleanup
++ lib.optional qt5UI "--qt-gui"
++ lib.optionals buildDocs [
"--sphinx-build=${sphinx}/bin/sphinx-build"
"--sphinx-info"
"--sphinx-man"
]
++ [
"--"
# We should set the proper `CMAKE_SYSTEM_NAME`.
# http://www.cmake.org/Wiki/CMake_Cross_Compiling
#
# Unfortunately cmake seems to expect absolute paths for ar, ranlib, and
# strip. Otherwise they are taken to be relative to the source root of the
# package being built.
(lib.cmakeFeature "CMAKE_CXX_COMPILER" "${stdenv.cc.targetPrefix}c++")
(lib.cmakeFeature "CMAKE_C_COMPILER" "${stdenv.cc.targetPrefix}cc")
(lib.cmakeFeature "CMAKE_AR" "${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ar")
(lib.cmakeFeature "CMAKE_RANLIB" "${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ranlib")
(lib.cmakeFeature "CMAKE_STRIP" "${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}strip")
(lib.cmakeBool "CMAKE_USE_OPENSSL" useOpenSSL)
(lib.cmakeBool "BUILD_CursesDialog" cursesUI)
];
# make install attempts to use the just-built cmake
preInstall = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
sed -i 's|bin/cmake|${buildPackages.cmakeMinimal}/bin/cmake|g' Makefile
'';
dontUseCmakeConfigure = true;
enableParallelBuilding = true;
doCheck = false; # fails
passthru.updateScript = gitUpdater {
url = "https://gitlab.kitware.com/cmake/cmake.git";
rev-prefix = "v";
ignoredVersions = "-"; # -rc1 and friends
};
meta = {
homepage = "https://cmake.org/";
description = "Cross-platform, open-source build system generator";
longDescription = ''
CMake is an open-source, cross-platform family of tools designed to build,
test and package software. CMake is used to control the software
compilation process using simple platform and compiler independent
configuration files, and generate native makefiles and workspaces that can
be used in the compiler environment of your choice.
'';
changelog = "https://cmake.org/cmake/help/v${lib.versions.majorMinor finalAttrs.version}/release/${lib.versions.majorMinor finalAttrs.version}.html";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [
ttuegel
lnl7
];
platforms = lib.platforms.all;
mainProgram = "cmake";
broken = (qt5UI && stdenv.hostPlatform.isDarwin);
};
})

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,174 @@
addCMakeParams() {
# NIXPKGS_CMAKE_PREFIX_PATH is like CMAKE_PREFIX_PATH except cmake
# will not search it for programs
addToSearchPath NIXPKGS_CMAKE_PREFIX_PATH $1
}
cmakeConfigurePhase() {
runHook preConfigure
# default to CMake defaults if unset
: ${cmakeBuildDir:=build}
export CTEST_OUTPUT_ON_FAILURE=1
if [ -n "${enableParallelChecking-1}" ]; then
export CTEST_PARALLEL_LEVEL=$NIX_BUILD_CORES
fi
if [ -z "${dontUseCmakeBuildDir-}" ]; then
mkdir -p "$cmakeBuildDir"
cd "$cmakeBuildDir"
: ${cmakeDir:=..}
else
: ${cmakeDir:=.}
fi
if [ -z "${dontAddPrefix-}" ]; then
prependToVar cmakeFlags "-DCMAKE_INSTALL_PREFIX=$prefix"
fi
# We should set the proper `CMAKE_SYSTEM_NAME`.
# http://www.cmake.org/Wiki/CMake_Cross_Compiling
#
# Unfortunately cmake seems to expect absolute paths for ar, ranlib, and
# strip. Otherwise they are taken to be relative to the source root of the
# package being built.
prependToVar cmakeFlags "-DCMAKE_CXX_COMPILER=$CXX"
prependToVar cmakeFlags "-DCMAKE_C_COMPILER=$CC"
prependToVar cmakeFlags "-DCMAKE_AR=$(command -v $AR)"
prependToVar cmakeFlags "-DCMAKE_RANLIB=$(command -v $RANLIB)"
prependToVar cmakeFlags "-DCMAKE_STRIP=$(command -v $STRIP)"
# on macOS we want to prefer Unix-style headers to Frameworks
# because we usually do not package the framework
prependToVar cmakeFlags "-DCMAKE_FIND_FRAMEWORK=LAST"
# correctly detect our clang compiler
prependToVar cmakeFlags "-DCMAKE_POLICY_DEFAULT_CMP0025=NEW"
# This installs shared libraries with a fully-specified install
# name. By default, cmake installs shared libraries with just the
# basename as the install name, which means that, on Darwin, they
# can only be found by an executable at runtime if the shared
# libraries are in a system path or in the same directory as the
# executable. This flag makes the shared library accessible from its
# nix/store directory.
prependToVar cmakeFlags "-DCMAKE_INSTALL_NAME_DIR=${!outputLib}/lib"
# The docdir flag needs to include PROJECT_NAME as per GNU guidelines,
# try to extract it from CMakeLists.txt.
if [[ -z "$shareDocName" ]]; then
local cmakeLists="${cmakeDir}/CMakeLists.txt"
if [[ -f "$cmakeLists" ]]; then
local shareDocName="$(grep --only-matching --perl-regexp --ignore-case '\bproject\s*\(\s*"?\K([^[:space:]")]+)' < "$cmakeLists" | head -n1)"
fi
# The argument sometimes contains garbage or variable interpolation.
# When that is the case, lets fall back to the derivation name.
if [[ -z "$shareDocName" ]] || echo "$shareDocName" | grep -q '[^a-zA-Z0-9_+-]'; then
if [[ -n "${pname-}" ]]; then
shareDocName="$pname"
else
shareDocName="$(echo "$name" | sed 's/-[^a-zA-Z].*//')"
fi
fi
fi
# This ensures correct paths with multiple output derivations
# It requires the project to use variables from GNUInstallDirs module
# https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html
prependToVar cmakeFlags "-DCMAKE_INSTALL_BINDIR=${!outputBin}/bin"
prependToVar cmakeFlags "-DCMAKE_INSTALL_SBINDIR=${!outputBin}/sbin"
prependToVar cmakeFlags "-DCMAKE_INSTALL_INCLUDEDIR=${!outputInclude}/include"
prependToVar cmakeFlags "-DCMAKE_INSTALL_MANDIR=${!outputMan}/share/man"
prependToVar cmakeFlags "-DCMAKE_INSTALL_INFODIR=${!outputInfo}/share/info"
prependToVar cmakeFlags "-DCMAKE_INSTALL_DOCDIR=${!outputDoc}/share/doc/${shareDocName}"
prependToVar cmakeFlags "-DCMAKE_INSTALL_LIBDIR=${!outputLib}/lib"
prependToVar cmakeFlags "-DCMAKE_INSTALL_LIBEXECDIR=${!outputLib}/libexec"
prependToVar cmakeFlags "-DCMAKE_INSTALL_LOCALEDIR=${!outputLib}/share/locale"
# Dont build tests when doCheck = false
if [ -z "${doCheck-}" ]; then
prependToVar cmakeFlags "-DBUILD_TESTING=OFF"
fi
# Always build Release, to ensure optimisation flags
prependToVar cmakeFlags "-DCMAKE_BUILD_TYPE=${cmakeBuildType:-Release}"
# Disable user package registry to avoid potential side effects
# and unecessary attempts to access non-existent home folder
# https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html#disabling-the-package-registry
prependToVar cmakeFlags "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON"
prependToVar cmakeFlags "-DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF"
prependToVar cmakeFlags "-DCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY=OFF"
if [ "${buildPhase-}" = ninjaBuildPhase ]; then
prependToVar cmakeFlags "-GNinja"
fi
local flagsArray=()
concatTo flagsArray cmakeFlags cmakeFlagsArray
echoCmd 'cmake flags' "${flagsArray[@]}"
cmake "$cmakeDir" "${flagsArray[@]}"
if ! [[ -v enableParallelBuilding ]]; then
enableParallelBuilding=1
echo "cmake: enabled parallel building"
fi
if [[ "$enableParallelBuilding" -ne 0 ]]; then
export CMAKE_BUILD_PARALLEL_LEVEL=$NIX_BUILD_CORES
fi
if ! [[ -v enableParallelInstalling ]]; then
enableParallelInstalling=1
echo "cmake: enabled parallel installing"
fi
runHook postConfigure
}
if [ -z "${dontUseCmakeConfigure-}" -a -z "${configurePhase-}" ]; then
setOutputFlags=
configurePhase=cmakeConfigurePhase
fi
addEnvHooks "$targetOffset" addCMakeParams
makeCmakeFindLibs() {
isystem_seen=
iframework_seen=
for flag in ${NIX_CFLAGS_COMPILE-} ${NIX_LDFLAGS-}; do
if test -n "$isystem_seen" && test -d "$flag"; then
isystem_seen=
addToSearchPath CMAKE_INCLUDE_PATH "${flag}"
elif test -n "$iframework_seen" && test -d "$flag"; then
iframework_seen=
addToSearchPath CMAKE_FRAMEWORK_PATH "${flag}"
else
isystem_seen=
iframework_seen=
case $flag in
-I*)
addToSearchPath CMAKE_INCLUDE_PATH "${flag:2}"
;;
-L*)
addToSearchPath CMAKE_LIBRARY_PATH "${flag:2}"
;;
-F*)
addToSearchPath CMAKE_FRAMEWORK_PATH "${flag:2}"
;;
-isystem)
isystem_seen=1
;;
-iframework)
iframework_seen=1
;;
esac
fi
done
}
# not using setupHook, because it could be a setupHook adding additional
# include flags to NIX_CFLAGS_COMPILE
postHooks+=(makeCmakeFindLibs)

View File

@@ -0,0 +1,33 @@
{
lib,
stdenvNoCC,
fetchFromGitHub,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "cmrc";
version = "2.0.1";
src = fetchFromGitHub {
owner = "vector-of-bool";
repo = "cmrc";
rev = finalAttrs.version;
hash = "sha256-++16WAs2K9BKk8384yaSI/YD1CdtdyXVBIjGhqi4JIk=";
};
installPhase = ''
runHook preInstall
install CMakeRC.cmake -DT $out/share/cmakerc/cmakerc-config.cmake
runHook postInstall
'';
meta = {
description = "Resource Compiler in a Single CMake Script";
homepage = "https://github.com/vector-of-bool/cmrc";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ guekka ];
platforms = lib.platforms.all;
};
})

View File

@@ -0,0 +1,38 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
}:
stdenv.mkDerivation rec {
pname = "cmark-gfm";
version = "0.29.0.gfm.13";
src = fetchFromGitHub {
owner = "github";
repo = "cmark-gfm";
rev = version;
sha256 = "sha256-HiSGtRsSbW03R6aKoMVVFOLrwP5aXtpeXUC/bE5M/qo=";
};
# Fix the build with CMake 4.
postPatch = ''
substituteInPlace CMakeLists.txt --replace-fail \
"cmake_minimum_required(VERSION 3.0)" \
"cmake_minimum_required(VERSION 3.13)"
'';
nativeBuildInputs = [ cmake ];
doCheck = true;
meta = {
description = "GitHub's fork of cmark, a CommonMark parsing and rendering library and program in C";
mainProgram = "cmark-gfm";
homepage = "https://github.com/github/cmark-gfm";
changelog = "https://github.com/github/cmark-gfm/raw/${version}/changelog.txt";
maintainers = with lib.maintainers; [ cyplo ];
platforms = lib.platforms.unix;
license = lib.licenses.bsd2;
};
}

View File

@@ -0,0 +1,46 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
}:
stdenv.mkDerivation rec {
pname = "cmark";
version = "0.31.1";
src = fetchFromGitHub {
owner = "commonmark";
repo = "cmark";
rev = version;
sha256 = "sha256-+JLw7zCjjozjq1RhRQGFqHj/MTUTq3t7A0V3T2U2PQk=";
};
nativeBuildInputs = [ cmake ];
cmakeFlags =
# Link the executable with the shared library on system with shared libraries.
lib.optional (!stdenv.hostPlatform.isStatic) "-DCMARK_STATIC=OFF"
# Do not attempt to build .so library on static platform.
++ lib.optional stdenv.hostPlatform.isStatic "-DCMARK_SHARED=OFF";
doCheck = true;
preCheck =
let
lib_path = if stdenv.hostPlatform.isDarwin then "DYLD_FALLBACK_LIBRARY_PATH" else "LD_LIBRARY_PATH";
in
''
export ${lib_path}=$(readlink -f ./src)
'';
meta = {
description = "CommonMark parsing and rendering library and program in C";
mainProgram = "cmark";
homepage = "https://github.com/commonmark/cmark";
changelog = "https://github.com/commonmark/cmark/raw/${version}/changelog.txt";
maintainers = [ lib.maintainers.michelk ];
platforms = lib.platforms.all;
license = lib.licenses.bsd2;
};
}

View File

@@ -0,0 +1,41 @@
{
lib,
stdenv,
fetchFromGitHub,
autoreconfHook,
ncurses,
versionCheckHook,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "cmatrix";
version = "2.0";
src = fetchFromGitHub {
owner = "abishekvashok";
repo = "cmatrix";
tag = "v${finalAttrs.version}";
hash = "sha256-dWlVWSRIE1fPa6R2N3ONL9QJlDQEqxfdYIgWTSr5MsE=";
};
nativeBuildInputs = [ autoreconfHook ];
buildInputs = [ ncurses ];
nativeInstallCheckInputs = [ versionCheckHook ];
versionCheckProgramArg = "-V";
doInstallCheck = true;
meta = {
description = "Simulates the falling characters theme from The Matrix movie";
longDescription = ''
CMatrix simulates the display from "The Matrix" and is based
on the screensaver from the movie's website.
'';
homepage = "https://github.com/abishekvashok/cmatrix";
changelog = "https://github.com/abishekvashok/cmatrix/releases/tag/v${finalAttrs.version}";
platforms = ncurses.meta.platforms;
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [ Tert0 ];
mainProgram = "cmatrix";
};
})

View File

@@ -0,0 +1,73 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
nix-update-script,
}:
buildGoModule (finalAttrs: {
pname = "cmctl";
version = "2.3.0";
src = fetchFromGitHub {
owner = "cert-manager";
repo = "cmctl";
tag = "v${finalAttrs.version}";
hash = "sha256-yX3A63MU1PaFQmAemp62F5sHlgWpkInhbIIZx7HfdEc=";
};
vendorHash = "sha256-LDmhlSWa6/Z4KyXnF9OFVkgTksV7TL+m1os0NW89ZpY=";
ldflags = [
"-s"
"-w"
"-X github.com/cert-manager/cert-manager/pkg/util.AppVersion=v${finalAttrs.version}"
"-X github.com/cert-manager/cert-manager/pkg/util.AppGitCommit=${finalAttrs.src.rev}"
];
# integration tests require running etcd, kubernetes
postPatch = ''
rm -r test/integration
'';
nativeBuildInputs = [
installShellFiles
];
# Trusted by this computer: no: x509: “cert-manager” certificate is not
# trusted
doCheck = !stdenv.hostPlatform.isDarwin;
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd cmctl \
--bash <($out/bin/cmctl completion bash) \
--fish <($out/bin/cmctl completion fish) \
--zsh <($out/bin/cmctl completion zsh)
'';
passthru.updateScript = nix-update-script { };
meta = {
description = "Command line utility to interact with a cert-manager instalation on Kubernetes";
mainProgram = "cmctl";
longDescription = ''
cert-manager adds certificates and certificate issuers as resource types
in Kubernetes clusters, and simplifies the process of obtaining, renewing
and using those certificates.
It can issue certificates from a variety of supported sources, including
Let's Encrypt, HashiCorp Vault, and Venafi as well as private PKI, and it
ensures certificates remain valid and up to date, attempting to renew
certificates at an appropriate time before expiry.
cmctl is a command line tool to help you manage cert-manager and its
resources inside your Kubernetes cluster.
'';
downloadPage = "https://github.com/cert-manager/cmctl";
license = lib.licenses.asl20;
homepage = "https://cert-manager.io/";
maintainers = with lib.maintainers; [ joshvanl ];
};
})

View File

@@ -0,0 +1,49 @@
{
lib,
stdenv,
fetchFromGitHub,
meson,
ninja,
glib,
cmake,
json-glib,
polkit,
gtk3,
pkg-config,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "cmd-polkit";
version = "0.3.0";
src = fetchFromGitHub {
owner = "OmarCastro";
repo = "cmd-polkit";
rev = "v${finalAttrs.version}";
hash = "sha256-oQaGV/ROP9YFyL8owduKOZLjqyx9D35xH67gNKECduQ=";
};
nativeBuildInputs = [
meson
cmake
pkg-config
ninja
];
buildInputs = [
json-glib
glib
polkit
gtk3
];
meta = with lib; {
description = "Easily create polkit authentication agents by using commands";
homepage = "https://github.com/OmarCastro/cmd-polkit";
changelog = "https://github.com/OmarCastro/cmd-polkit/blob/${finalAttrs.src.rev}/CHANGELOG";
license = licenses.lgpl21Only;
maintainers = with maintainers; [ daru-san ];
mainProgram = "cmd-polkit-agent";
platforms = platforms.linux;
};
})

View File

@@ -0,0 +1,27 @@
{
lib,
rustPlatform,
fetchFromGitHub,
}:
rustPlatform.buildRustPackage rec {
pname = "cmd-wrapped";
version = "0.4.1";
src = fetchFromGitHub {
owner = "YiNNx";
repo = "cmd-wrapped";
rev = "v${version}";
hash = "sha256-tIvwJo33Jz9cPq6o4Ytc3VqkxEaxt0W9Fd8CNp+7vAE=";
};
cargoHash = "sha256-Pv+LTHMLJh4LxKmvF6aJLZlDf97ZHI8gzn7vP+quNhc=";
meta = with lib; {
description = "Find out what the past year looks like in commandline";
homepage = "https://github.com/YiNNx/cmd-wrapped";
license = licenses.mit;
maintainers = with maintainers; [ Cryolitia ];
mainProgram = "cmd-wrapped";
};
}

View File

@@ -0,0 +1,97 @@
{
lib,
stdenv,
fetchFromGitHub,
python3,
stanc,
buildPackages,
runtimeShell,
runCommandCC,
cmdstan,
}:
stdenv.mkDerivation rec {
pname = "cmdstan";
version = "2.36.0";
src = fetchFromGitHub {
owner = "stan-dev";
repo = "cmdstan";
tag = "v${version}";
fetchSubmodules = true;
hash = "sha256-9Dan86C0nxxxkIXaOSKExY0hngAgWTpL4RlI3rTnBZo=";
};
postPatch = ''
substituteInPlace stan/lib/stan_math/make/libraries \
--replace "/usr/bin/env bash" "bash"
'';
nativeBuildInputs = [
python3
stanc
];
preConfigure = ''
patchShebangs test-all.sh runCmdStanTests.py stan/
''
# Fix inclusion of hardcoded paths in PCH files, by building in the store.
+ ''
mkdir -p $out/opt
cp -R . $out/opt/cmdstan
cd $out/opt/cmdstan
mkdir -p bin
ln -s ${buildPackages.stanc}/bin/stanc bin/stanc
'';
makeFlags = [
"build"
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
"arch=${stdenv.hostPlatform.darwinArch}"
];
# Disable inclusion of timestamps in PCH files when using Clang.
env.CXXFLAGS = lib.optionalString stdenv.cc.isClang "-Xclang -fno-pch-timestamp";
enableParallelBuilding = true;
installPhase = ''
runHook preInstall
mkdir -p $out/bin
ln -s $out/opt/cmdstan/bin/stanc $out/bin/stanc
ln -s $out/opt/cmdstan/bin/stansummary $out/bin/stansummary
cat > $out/bin/stan <<EOF
#!${runtimeShell}
make -C $out/opt/cmdstan "\$(realpath "\$1")"
EOF
chmod a+x $out/bin/stan
runHook postInstall
'';
passthru.tests = {
test = runCommandCC "cmdstan-test" { } ''
cp -R ${cmdstan}/opt/cmdstan cmdstan
chmod -R +w cmdstan
cd cmdstan
./runCmdStanTests.py -j$NIX_BUILD_CORES src/test/interface
touch $out
'';
};
meta = with lib; {
description = "Command-line interface to Stan";
longDescription = ''
Stan is a probabilistic programming language implementing full Bayesian
statistical inference with MCMC sampling (NUTS, HMC), approximate Bayesian
inference with Variational inference (ADVI) and penalized maximum
likelihood estimation with Optimization (L-BFGS).
'';
homepage = "https://mc-stan.org/interfaces/cmdstan.html";
license = licenses.bsd3;
maintainers = with maintainers; [ wegank ];
platforms = platforms.unix;
};
}

View File

@@ -0,0 +1,23 @@
diff --git a/configure b/configure
index 4480261..2fb9b34 100755
--- a/configure
+++ b/configure
@@ -28,18 +28,6 @@ do
esac
done
-# Check HTTP access tool
-if CHECK_COMMAND curl ; then
- PROGRAM_HTTP="curl -O"
-elif CHECK_COMMAND wget ; then
- PROGRAM_HTTP="wget"
-elif CHECK_COMMAND fetch ; then
- PROGRAM_HTTP="fetch"
-else
- echo "ERROR: Require one of HTTP access tools (curl, wget or fetch)."
- exit 1
-fi
-
# Check encoding filter
if CHECK_COMMAND qkc ; then
PROGRAM_ENCODEFILTER="qkc -q -u"

View File

@@ -0,0 +1,50 @@
{
lib,
stdenv,
fetchFromGitHub,
iconv,
nkf,
perl,
which,
skkDictionaries,
}:
stdenv.mkDerivation {
pname = "cmigemo";
version = "1.3e";
src = fetchFromGitHub {
owner = "koron";
repo = "cmigemo";
rev = "e0f6145f61e0b7058c3006f344e58571d9fdd83a";
sha256 = "00a6kdmxp16b8x0p04ws050y39qspd1bqlfq74bkirc55b77a2m1";
};
nativeBuildInputs = [
iconv
nkf
perl
which
];
postUnpack = ''
cp ${skkDictionaries.l}/share/skk/SKK-JISYO.L source/dict/
'';
patches = [ ./no-http-tool-check.patch ];
makeFlags = [ "INSTALL=install" ];
buildFlags = [ (if stdenv.hostPlatform.isDarwin then "osx-all" else "gcc-all") ];
installTargets = [ (if stdenv.hostPlatform.isDarwin then "osx-install" else "gcc-install") ];
meta = with lib; {
description = "Tool that supports Japanese incremental search with Romaji";
mainProgram = "cmigemo";
homepage = "https://www.kaoriya.net/software/cmigemo";
license = licenses.mit;
maintainers = [ maintainers.cohei ];
platforms = platforms.all;
};
}

View File

@@ -0,0 +1,54 @@
{
lib,
stdenv,
cmake,
fetchFromGitHub,
withBlas ? false,
blas,
nix-update-script,
}:
stdenv.mkDerivation rec {
pname = "cminpack";
version = "1.3.11";
src = fetchFromGitHub {
owner = "devernay";
repo = "cminpack";
rev = "v${version}";
hash = "sha256-GF9HiITX/XV8hXrp5lJw2XM0Zyb/CBkMZkRFBbQj03A=";
};
postPatch = ''
substituteInPlace cmake/cminpack.pc.in \
--replace-fail ''\'''${prefix}/' ""
'';
strictDeps = true;
nativeBuildInputs = [
cmake
];
buildInputs = lib.optionals withBlas [
blas
];
cmakeFlags = [
"-DUSE_BLAS=${if withBlas then "ON" else "OFF"}"
"-DBUILD_SHARED_LIBS=${if stdenv.hostPlatform.isStatic then "OFF" else "ON"}"
];
passthru = {
updateScript = nix-update-script { };
};
meta = {
description = "Software for solving nonlinear equations and nonlinear least squares problems";
homepage = "http://devernay.free.fr/hacks/cminpack/";
changelog = "https://github.com/devernay/cminpack/blob/v${version}/README.md#history";
license = lib.licenses.bsd3;
platforms = lib.platforms.all;
maintainers = [ ];
};
}

View File

@@ -0,0 +1,64 @@
{
fetchurl,
lib,
stdenv,
cmake,
}:
stdenv.mkDerivation rec {
pname = "cmocka";
version = "1.1.8";
src = fetchurl {
url = "https://cmocka.org/files/${lib.versions.majorMinor version}/cmocka-${version}.tar.xz";
hash = "sha256-WENbVYdm1/THKboWO9867Di+07x2batoTjUm7Qqnx4A=";
};
patches = [
./uintptr_t.patch
];
nativeBuildInputs = [ cmake ];
cmakeFlags =
lib.optional doCheck "-DUNIT_TESTING=ON"
++ lib.optional stdenv.hostPlatform.isStatic "-DBUILD_SHARED_LIBS=OFF";
doCheck = true;
meta = with lib; {
description = "Lightweight library to simplify and generalize unit tests for C";
longDescription = ''
There are a variety of C unit testing frameworks available however
many of them are fairly complex and require the latest compiler
technology. Some development requires the use of old compilers which
makes it difficult to use some unit testing frameworks. In addition
many unit testing frameworks assume the code being tested is an
application or module that is targeted to the same platform that will
ultimately execute the test. Because of this assumption many
frameworks require the inclusion of standard C library headers in the
code module being tested which may collide with the custom or
incomplete implementation of the C library utilized by the code under
test.
Cmocka only requires a test application is linked with the standard C
library which minimizes conflicts with standard C library headers.
Also, CMocka tries to avoid the use of some of the newer features of
C compilers.
This results in CMocka being a relatively small library that can be
used to test a variety of exotic code. If a developer wishes to
simply test an application with the latest compiler then other unit
testing frameworks may be preferable.
This is the successor of Google's Cmockery.
'';
homepage = "https://cmocka.org/";
license = licenses.asl20;
platforms = platforms.all;
maintainers = with maintainers; [
kragniz
rasendubi
];
};
}

View File

@@ -0,0 +1,16 @@
Resolve messy situation with uintptr_t and stdint.h
Platforms common in nixpkgs will have stdint.h - thereby we avoid problems
that seem complicated to avoid. References:
https://gitlab.com/cmocka/cmocka/-/issues/38#note_1286565655
https://git.alpinelinux.org/aports/plain/main/cmocka/musl_uintptr.patch?id=6a15dd0d0ba9cc354a621fb359ca5e315ff2eabd
It isn't easy, as 1.1.6 codebase is missing stdint.h includes on many places,
and HAVE_UINTPTR_T from cmake also wouldn't get on all places it needs to.
--- a/include/cmocka.h
+++ b/include/cmocka.h
@@ -18,2 +18,4 @@
#define CMOCKA_H_
+#include <stdint.h>
+#define HAVE_UINTPTR_T 1

View File

@@ -0,0 +1,41 @@
{
lib,
fetchurl,
stdenv,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "cmospwd";
version = "5.1";
src = fetchurl {
url = "https://www.cgsecurity.org/cmospwd-${finalAttrs.version}.tar.bz2";
hash = "sha256-8pbSl5eUsKa3JrgK/JLk0FnGXcJhKksJN3wWiDPYYvQ=";
};
makeFlags = [ "CC:=$(CC)" ];
preConfigure = ''
cd src
# It already contains compiled executable (that doesn't work), so make
# will refuse to build if it's still there
rm cmospwd
'';
# There is no install make target
installPhase = ''
runHook preInstall
install -Dm0755 cmospwd -t "$out/bin"
runHook postInstall
'';
meta = with lib; {
description = "Decrypt password stored in cmos used to access BIOS SETUP";
mainProgram = "cmospwd";
homepage = "https://www.cgsecurity.org/wiki/CmosPwd";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ t4ccer ];
platforms = [ "x86_64-linux" ];
};
})

View File

@@ -0,0 +1,27 @@
{
lib,
stdenv,
fetchurl,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "cmph";
version = "2.0.2";
src = fetchurl {
url = "https://deac-ams.dl.sourceforge.net/project/cmph/v${finalAttrs.version}/cmph-${finalAttrs.version}.tar.gz";
hash = "sha256-Nl8egFZADUYPHue/r9vzfV7mx46PRyO/SzwIHIlzPx4=";
};
meta = {
description = "Free minimal perfect hash C library, providing several algorithms in the literature in a consistent, ease to use, API";
homepage = "https://sourceforge.net/projects/cmph/";
license = with lib.licenses; [
gpl2
mpl11
];
mainProgram = "cmph";
maintainers = [ ];
platforms = lib.platforms.linux ++ lib.platforms.darwin;
};
})

View File

@@ -0,0 +1,41 @@
{
lib,
stdenv,
fetchFromGitHub,
autoreconfHook,
pkg-config,
libdrm,
libva,
}:
stdenv.mkDerivation rec {
pname = "cmrt";
version = "1.0.6";
src = fetchFromGitHub {
owner = "intel";
repo = "cmrt";
rev = version;
sha256 = "sha256-W6MQI41J9CKeM1eILCkvmW34cbCC8YeEF2mE+Ci8o7s=";
};
nativeBuildInputs = [
autoreconfHook
pkg-config
];
buildInputs = [
libdrm
libva
];
meta = with lib; {
broken = (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64);
homepage = "https://01.org/linuxmedia";
description = "Intel C for Media Runtime";
longDescription = "Media GPU kernel manager for Intel G45 & HD Graphics family";
license = licenses.mit;
maintainers = with maintainers; [ tadfisher ];
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,35 @@
{
lib,
stdenv,
fetchurl,
ladspaH,
}:
stdenv.mkDerivation rec {
pname = "cmt";
version = "1.18";
src = fetchurl {
url = "http://www.ladspa.org/download/cmt_${version}.tgz";
sha256 = "sha256-qC+GNt4fSto4ahmaAXqc13Wkm0nnFrEejdP3I8k99so=";
};
buildInputs = [ ladspaH ];
preBuild = ''
cd src
'';
installFlags = [ "INSTALL_PLUGINS_DIR=${placeholder "out"}/lib/ladspa" ];
preInstall = ''
mkdir -p $out/lib/ladspa
'';
meta = with lib; {
description = "Computer Music Toolkit";
homepage = "https://www.ladspa.org/cmt";
license = licenses.gpl2;
platforms = platforms.linux;
maintainers = with maintainers; [ sjfloat ];
};
}

View File

@@ -0,0 +1,59 @@
{
lib,
stdenv,
bzip2,
cmake,
fetchurl,
fftw,
llvmPackages,
zlib,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "cmtk";
version = "3.3.2";
src = fetchurl {
name = "cmtk-source.tar.gz";
url = "https://www.nitrc.org/frs/download.php/13188/CMTK-${finalAttrs.version}-Source.tar.gz//?i_agree=1&download_now=1";
hash = "sha256-iE164NCOSOypZLLZfZy9RTyrS+YnY9ECqfb4QhlsMS4=";
};
postPatch = ''
substituteInPlace apps/vtkxform.cxx --replace-fail \
"float xyzFloat[3] = { xyz[0], xyz[1], xyz[2] };" \
"float xyzFloat[3] = { (float)xyz[0], (float)xyz[1], (float)xyz[2] };"
'';
nativeBuildInputs = [ cmake ];
buildInputs = [
bzip2
fftw
zlib
]
++ lib.optionals stdenv.cc.isClang [
llvmPackages.openmp
];
cmakeFlags = [
(lib.cmakeFeature "CMAKE_CXX_STANDARD" "14")
]
++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [
(lib.cmakeFeature "CMAKE_CXX_FLAGS" "-Dfinite=isfinite")
];
meta = with lib; {
description = "Computational Morphometry Toolkit";
mainProgram = "cmtk";
longDescription = ''
A software toolkit for computational morphometry of
biomedical images, CMTK comprises a set of command line tools and a
back-end general-purpose library for processing and I/O
'';
maintainers = with maintainers; [ tbenst ];
platforms = platforms.all;
license = licenses.gpl3Plus;
homepage = "https://www.nitrc.org/projects/cmtk/";
};
})

View File

@@ -0,0 +1,62 @@
{
lib,
stdenv,
fetchFromGitHub,
autoreconfHook,
pkg-config,
curl,
libnotify,
gdk-pixbuf,
libnotifySupport ? stdenv.hostPlatform.isLinux,
debug ? false,
}:
stdenv.mkDerivation rec {
pname = "cmusfm";
version = "0.5.0";
src = fetchFromGitHub {
owner = "Arkq";
repo = "cmusfm";
rev = "v${version}";
sha256 = "sha256-CA585ZpkxMMLgzv81QB2kKMFg5R5CwKS9xAYrU+pAxs=";
};
configureFlags =
lib.optional libnotifySupport "--enable-libnotify" ++ lib.optional debug "--enable-debug";
nativeBuildInputs = [
autoreconfHook
pkg-config
];
buildInputs = [
curl
gdk-pixbuf
]
++ lib.optional libnotifySupport libnotify;
meta = with lib; {
description = "Last.fm and Libre.fm standalone scrobbler for the cmus music player";
longDescription = ''
Features:
+ Listening now notification support
+ Off-line played track cache for later submission
+ POSIX ERE-based file name parser
+ Desktop notification support (optionally)
+ Customizable scrobbling service
+ Small memory footprint
Configuration:
+ run `cmusfm init` to generate configuration file under ~/.config/cmus/cmusfm.conf
+ Inside cmus run `:set status_display_program=cmusfm` to set up cmusfm
'';
homepage = "https://github.com/Arkq/cmusfm/";
maintainers = with lib.maintainers; [
CharlesHD
mudri
];
license = licenses.gpl3Plus;
platforms = platforms.linux ++ platforms.darwin;
mainProgram = "cmusfm";
};
}