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,46 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "mkalias";
version = "1.1.0";
src = fetchFromGitHub {
owner = "vs49688";
repo = "mkalias";
rev = "v${finalAttrs.version}";
hash = "sha256-kIVCtYGlWKS0d/Potwo6X8F7Hgc/1S1RQTEbJi+IL9U=";
};
nativeBuildInputs = [
cmake
];
cmakeFlags = [
"-DMKALIAS_VERSION=${finalAttrs.version}"
];
installPhase = ''
runHook preInstall
install -D mkalias $out/bin/mkalias
runHook postInstall
'';
meta = {
description = "Quick'n'dirty tool to make APFS aliases";
homepage = "https://github.com/vs49688/mkalias";
license = lib.licenses.gpl2Only;
mainProgram = "mkalias";
maintainers = with lib.maintainers; [
zane
emilytrau
];
platforms = lib.platforms.darwin;
};
})

View File

@@ -0,0 +1,50 @@
{
lib,
stdenv,
fetchFromGitHub,
elfutils,
pcre,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "mkbootimage";
version = "2.3-unstable-2022-05-26";
src = fetchFromGitHub {
owner = "antmicro";
repo = "zynq-mkbootimage";
rev = "872363ce32c249f8278cf107bc6d3bdeb38d849f";
hash = "sha256-5FPyAhUWZDwHbqmp9J2ZXTmjaXPz+dzrJMolaNwADHs=";
};
# Using elfutils because libelf is being discontinued
# See https://github.com/NixOS/nixpkgs/pull/271568
buildInputs = [
elfutils
pcre
];
postPatch = ''
substituteInPlace Makefile --replace "git rev-parse --short HEAD" "echo ${finalAttrs.src.rev}"
'';
installPhase = ''
runHook preInstall
install -Dm755 mkbootimage -t $out/bin
install -Dm755 exbootimage -t $out/bin
runHook postInstall
'';
hardeningDisable = [ "fortify" ];
meta = with lib; {
description = "Open source replacement of the Xilinx bootgen application";
homepage = "https://github.com/antmicro/zynq-mkbootimage";
license = licenses.bsd2;
platforms = platforms.linux;
maintainers = [ maintainers.fsagbuya ];
mainProgram = "mkbootimage";
};
})

View File

@@ -0,0 +1,45 @@
{
lib,
buildGoModule,
fetchFromGitHub,
versionCheckHook,
}:
buildGoModule (finalAttrs: {
pname = "mkbrr";
version = "1.16.0";
src = fetchFromGitHub {
owner = "autobrr";
repo = "mkbrr";
tag = "v${finalAttrs.version}";
hash = "sha256-9BII74aH480UWjrPgoBn+ioXV3TRhtVmxyO+T+fljK4=";
};
vendorHash = "sha256-MEDzZd67iXPY/MioMd1FcTLY+8CdJN7+oC7qus63yJ8=";
ldflags = [
"-s"
"-w"
"-X main.version=v${finalAttrs.version}"
"-X main.buildTime=unknown"
];
doCheck = true;
doInstallCheck = true;
nativeInstallCheckInputs = [
versionCheckHook
];
versionCheckProgramArg = "version";
meta = {
description = "Tool to create, modify and inspect torrent files";
homepage = "https://github.com/autobrr/mkbrr";
license = lib.licenses.gpl2Plus;
maintainers = with lib.maintainers; [ ambroisie ];
mainProgram = "mkbrr";
};
})

View File

@@ -0,0 +1,115 @@
{
stdenv,
lib,
fetchFromGitHub,
gitUpdater,
testers,
cmake,
doxygen,
extra-cmake-modules,
graphviz,
libsForQt5,
perl,
pkg-config,
tzdata,
ctestCheckHook,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "mkcal";
version = "0.7.28";
src = fetchFromGitHub {
owner = "sailfishos";
repo = "mkcal";
tag = finalAttrs.version;
hash = "sha256-tL42f8egP/anB4jOaAjmIh7C2pQyR3fgTDJ1E9t8EWk=";
};
outputs = [
"out"
"dev"
"doc"
];
postPatch = ''
substituteInPlace doc/CMakeLists.txt \
--replace-fail 'COMMAND ''${DOXYGEN}' 'WORKING_DIRECTORY ''${CMAKE_SOURCE_DIR} COMMAND ''${DOXYGEN}'
# Dynamic menus are broken in docs
sed -i doc/libmkcal.cfg -e '1i HTML_DYNAMIC_MENUS = NO'
'';
strictDeps = true;
nativeBuildInputs = [
cmake
extra-cmake-modules
doxygen
graphviz
perl
pkg-config
]
++ (with libsForQt5; [
wrapQtAppsHook
]);
buildInputs = with libsForQt5; [
kcalendarcore
qtbase
qtpim
timed
];
nativeCheckInputs = [
tzdata
ctestCheckHook
];
cmakeFlags = [
(lib.cmakeBool "BUILD_PLUGINS" false)
(lib.cmakeBool "BUILD_TESTS" finalAttrs.finalPackage.doCheck)
(lib.cmakeBool "INSTALL_TESTS" false)
(lib.cmakeBool "BUILD_DOCUMENTATION" true)
];
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
disabledTests = [
# Test expects to be passed a real, already existing database to test migrations. We don't have one
"tst_perf"
# 10/97 tests fail. Half seem related to time (zone) issues w/ local time / Helsinki timezone
# Other half are x-1/x on lists of alarms/events
"tst_storage"
];
# Parallelism breaks tests
enableParallelChecking = false;
preCheck = ''
export HOME=$TMP
export QT_QPA_PLATFORM=minimal
export QT_PLUGIN_PATH=${lib.getBin libsForQt5.qtbase}/${libsForQt5.qtbase.qtPluginPrefix}
'';
passthru = {
updateScript = gitUpdater { };
tests.pkg-config = testers.hasPkgConfigModules {
package = finalAttrs.finalPackage;
# version field doesn't exactly match current version
};
};
meta = {
description = "Mobile version of the original KCAL from KDE";
homepage = "https://github.com/sailfishos/mkcal";
changelog = "https://github.com/sailfishos/mkcal/releases/tag/${finalAttrs.version}";
license = lib.licenses.lgpl2Plus;
mainProgram = "mkcaltool";
teams = [ lib.teams.lomiri ];
platforms = lib.platforms.linux;
pkgConfigModules = [
"libmkcal-qt5"
];
};
})

View File

@@ -0,0 +1,35 @@
{
lib,
buildGoModule,
fetchFromGitHub,
}:
buildGoModule rec {
pname = "mkcert";
version = "1.4.4";
src = fetchFromGitHub {
owner = "FiloSottile";
repo = "mkcert";
rev = "v${version}";
sha256 = "sha256-FMAXjRL+kJ/hwGmaWBy8ecON+JCMgRytfpryeLWsSVc=";
};
vendorHash = "sha256-DdA7s+N5S1ivwUgZ+M2W/HCp/7neeoqRQL0umn3m6Do=";
doCheck = false;
ldflags = [
"-s"
"-w"
"-X main.Version=v${version}"
];
meta = with lib; {
homepage = "https://github.com/FiloSottile/mkcert";
description = "Simple tool for making locally-trusted development certificates";
mainProgram = "mkcert";
license = licenses.bsd3;
maintainers = [ ];
};
}

View File

@@ -0,0 +1,32 @@
{
lib,
stdenv,
fetchurl,
cmake,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "mkclean";
version = "0.9.0";
src = fetchurl {
url = "mirror://sourceforge/matroska/mkclean-${finalAttrs.version}.tar.bz2";
hash = "sha256-L1zcqw4Jtl+f74lJpV7wDuPdcA5LQFDiRdRCNH18w9s=";
};
nativeBuildInputs = [ cmake ];
hardeningDisable = [ "format" ];
postInstall = ''
install -Dm0755 mkclean/mkclean $out/bin/mkclean
'';
meta = {
description = "Command line tool to clean and optimize Matroska (.mkv / .mka / .mks / .mk3d) and WebM (.webm / .weba) files that have already been muxed";
homepage = "https://www.matroska.org";
license = lib.licenses.bsdOriginal;
maintainers = with lib.maintainers; [ cawilliamson ];
platforms = lib.platforms.unix;
};
})

View File

@@ -0,0 +1,28 @@
{
lib,
stdenv,
fetchurl,
}:
stdenv.mkDerivation rec {
pname = "mkcue";
version = "1";
src = fetchurl {
url = "http://http.debian.net/debian/pool/main/m/mkcue/mkcue_${version}.orig.tar.gz";
sha256 = "0rs897wp08z4hd904bjb5sl4lb8qxj82x5ayklr28bhg9pd5gbra";
};
env.CXXFLAGS = "-std=c++98";
preInstall = "mkdir -pv $out/bin";
postInstall = "chmod -v +w $out/bin/mkcue";
meta = with lib; {
description = "Generates CUE sheets from a CD TOC";
license = licenses.lgpl2Plus;
platforms = platforms.linux;
maintainers = with maintainers; [ pSub ];
mainProgram = "mkcue";
};
}

View File

@@ -0,0 +1,53 @@
{
lib,
stdenv,
fetchurl,
pkg-config,
libfontenc,
freetype,
xorgproto,
zlib,
writeScript,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "mkfontscale";
version = "1.2.3";
src = fetchurl {
url = "mirror://xorg/individual/app/mkfontscale-${finalAttrs.version}.tar.xz";
hash = "sha256-KSHNw0TxrO4EvNbqHilWXBMIJjAG4TSp7jjPnJ1v514=";
};
strictDeps = true;
nativeBuildInputs = [ pkg-config ];
buildInputs = [
libfontenc
freetype
xorgproto
zlib
];
passthru = {
updateScript = writeScript "update-${finalAttrs.pname}" ''
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p common-updater-scripts
version="$(list-directory-versions --pname ${finalAttrs.pname} \
--url https://xorg.freedesktop.org/releases/individual/app/ \
| sort -V | tail -n1)"
update-source-version ${finalAttrs.pname} "$version"
'';
};
meta = {
description = "Utilities to create the fonts.scale and fonts.dir index files used by the legacy X11 font system";
homepage = "https://gitlab.freedesktop.org/xorg/app/mkfontscale";
license = with lib.licenses; [
mit
mitOpenGroup
hpndSellVariant
];
maintainers = [ ];
mainProgram = "mkfontscale";
platforms = lib.platforms.unix;
};
})

View File

@@ -0,0 +1,34 @@
{
lib,
stdenv,
fetchurl,
}:
stdenv.mkDerivation rec {
pname = "mkinitcpio-nfs-utils";
version = "0.3";
src = fetchurl {
url = "https://sources.archlinux.org/other/mkinitcpio/mkinitcpio-nfs-utils-${version}.tar.xz";
sha256 = "0fc93sfk41ycpa33083kyd7i4y00ykpbhj5qlw611bjghj4x946j";
# ugh, upstream...
name = "mkinitcpio-nfs-utils-${version}.tar.gz";
};
makeFlags = [
"DESTDIR=$(out)"
"bindir=/bin"
];
postInstall = ''
rm -rf $out/usr
'';
meta = with lib; {
homepage = "https://archlinux.org/";
description = "ipconfig and nfsmount tools for root on NFS, ported from klibc";
license = licenses.gpl2Only;
platforms = platforms.linux;
maintainers = [ ];
};
}

View File

@@ -0,0 +1,119 @@
{
mkDerivation,
lib,
fetchFromGitHub,
aeson,
base,
bytestring,
containers,
criterion,
doctest,
Glob,
mersenne-random-pure64,
mtl,
optparse-applicative,
parsec,
random,
regex-tdfa,
scientific,
text,
time,
unordered-containers,
uuid,
vector,
}:
mkDerivation rec {
pname = "mkjson";
version = "0.4.0";
src = fetchFromGitHub {
owner = "mfussenegger";
repo = "mkjson";
rev = "${version}";
hash = "sha256-+NDLFtsWWxHv/6XC9hJOAHPU6YED5oHqS/j5BPwNsqA=";
};
isLibrary = false;
isExecutable = true;
libraryHaskellDepends = [
aeson
base
bytestring
containers
mersenne-random-pure64
mtl
optparse-applicative
parsec
random
regex-tdfa
scientific
text
time
unordered-containers
uuid
vector
];
executableHaskellDepends = [
aeson
base
bytestring
containers
mersenne-random-pure64
mtl
optparse-applicative
parsec
random
regex-tdfa
scientific
text
time
unordered-containers
uuid
vector
];
testHaskellDepends = [
aeson
base
bytestring
containers
doctest
Glob
mersenne-random-pure64
mtl
optparse-applicative
parsec
random
regex-tdfa
scientific
text
time
unordered-containers
uuid
vector
];
benchmarkHaskellDepends = [
aeson
base
bytestring
containers
criterion
mersenne-random-pure64
mtl
optparse-applicative
parsec
random
regex-tdfa
scientific
text
time
unordered-containers
uuid
vector
];
description = "Commandline tool to generate static or random JSON records";
homepage = "https://github.com/mfussenegger/mkjson";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ athas ];
mainProgram = "mkjson";
}

View File

@@ -0,0 +1,2 @@
{ haskell, haskellPackages }:
haskell.lib.justStaticExecutables (haskellPackages.callPackage ./generated.nix { })

View File

@@ -0,0 +1,224 @@
{
lib,
stdenv,
callPackage,
stdenvNoCC,
fetchurl,
rpmextract,
_7zz,
cctools,
validatePkgConfig,
enableStatic ? stdenv.hostPlatform.isStatic,
}:
/*
For details on using mkl as a blas provider for python packages such as numpy,
numexpr, scipy, etc., see the Python section of the NixPkgs manual.
*/
let
# Release notes and download URLs are here:
# https://registrationcenter.intel.com/en/products/
version = "${mklVersion}.${rel}";
mklVersion = "2023.1.0";
rel = if stdenvNoCC.hostPlatform.isDarwin then "43558" else "46342";
# Intel openmp uses its own versioning.
openmpVersion = "2023.1.0";
openmpRel = "46305";
# Thread Building Blocks release.
tbbVersion = "2021.9.0";
tbbRel = "43484";
shlibExt = stdenvNoCC.hostPlatform.extensions.sharedLibrary;
oneapi-mkl = fetchurl {
url = "https://yum.repos.intel.com/oneapi/intel-oneapi-mkl-${mklVersion}-${mklVersion}-${rel}.x86_64.rpm";
hash = "sha256-PGLPNnR+11AmmaNxldeze/l2Kw/4+mfjB+RqsPhP6oM=";
};
oneapi-mkl-common = fetchurl {
url = "https://yum.repos.intel.com/oneapi/intel-oneapi-mkl-common-${mklVersion}-${mklVersion}-${rel}.noarch.rpm";
hash = "sha256-wztTE2R/IdG6ujGf7KFocpRmXzlZSnEKopTBOlPPlBw=";
};
oneapi-mkl-common-devel = fetchurl {
url = "https://yum.repos.intel.com/oneapi/intel-oneapi-mkl-common-devel-${mklVersion}-${mklVersion}-${rel}.noarch.rpm";
hash = "sha256-MWa8mpyFM4zgDLup+EzFRM+N2Oxf0o6FBBRM8mAanbI=";
};
oneapi-mkl-devel = fetchurl {
url = "https://yum.repos.intel.com/oneapi/intel-oneapi-mkl-devel-${mklVersion}-${mklVersion}-${rel}.x86_64.rpm";
hash = "sha256-Arq5kXktI92031XqfV0pkzQCHaFsTRKX05iOA/fPNOs=";
};
oneapi-openmp = fetchurl {
url = "https://yum.repos.intel.com/oneapi/intel-oneapi-openmp-${mklVersion}-${mklVersion}-${openmpRel}.x86_64.rpm";
hash = "sha256-cyBD3P4AEvyreP4pP3BE+yyDB+ptblOQ9GYI8ysGsIM=";
};
oneapi-tbb = fetchurl {
url = "https://yum.repos.intel.com/oneapi/intel-oneapi-tbb-${tbbVersion}-${tbbVersion}-${tbbRel}.x86_64.rpm";
hash = "sha256-pzJpQdiYVpcKDShePak2I0uEh7u08vJgX7OBF5p5yAM=";
};
in
stdenvNoCC.mkDerivation (
{
pname = "mkl";
inherit version;
dontUnpack = stdenvNoCC.hostPlatform.isLinux;
sourceRoot = if stdenvNoCC.hostPlatform.isDarwin then "." else null;
nativeBuildInputs = [
validatePkgConfig
]
++ (
if stdenvNoCC.hostPlatform.isDarwin then
[
_7zz
cctools
]
else
[ rpmextract ]
);
buildPhase =
if stdenvNoCC.hostPlatform.isDarwin then
''
for f in bootstrapper.app/Contents/Resources/packages/*/cupPayload.cup; do
tar -xf $f
done
mkdir -p opt/intel
mv _installdir opt/intel/oneapi
''
else
''
rpmextract ${oneapi-mkl}
rpmextract ${oneapi-mkl-common}
rpmextract ${oneapi-mkl-common-devel}
rpmextract ${oneapi-mkl-devel}
rpmextract ${oneapi-openmp}
rpmextract ${oneapi-tbb}
'';
installPhase = ''
for f in $(find . -name 'mkl*.pc') ; do
bn=$(basename $f)
substituteInPlace $f \
--replace $\{MKLROOT} "$out" \
--replace "lib/intel64" "lib"
sed -r -i "s|^prefix=.*|prefix=$out|g" $f
done
for f in $(find opt/intel -name 'mkl*iomp.pc') ; do
substituteInPlace $f --replace "../compiler/lib" "lib"
done
# License
install -Dm0655 -t $out/share/doc/mkl opt/intel/oneapi/mkl/${mklVersion}/licensing/license.txt
# Dynamic libraries
mkdir -p $out/lib
cp -a opt/intel/oneapi/mkl/${mklVersion}/lib/${lib.optionalString stdenvNoCC.hostPlatform.isLinux "intel64"}/*${shlibExt}* $out/lib
cp -a opt/intel/oneapi/compiler/${mklVersion}/${
if stdenvNoCC.hostPlatform.isDarwin then "mac" else "linux"
}/compiler/lib/${lib.optionalString stdenvNoCC.hostPlatform.isLinux "intel64_lin"}/*${shlibExt}* $out/lib
cp -a opt/intel/oneapi/tbb/${tbbVersion}/lib/${lib.optionalString stdenvNoCC.hostPlatform.isLinux "intel64/gcc4.8"}/*${shlibExt}* $out/lib
# Headers
cp -r opt/intel/oneapi/mkl/${mklVersion}/include $out/
# CMake config
cp -r opt/intel/oneapi/mkl/${mklVersion}/lib/cmake $out/lib
''
+ (
if enableStatic then
''
install -Dm0644 -t $out/lib opt/intel/oneapi/mkl/${mklVersion}/lib/${lib.optionalString stdenvNoCC.hostPlatform.isLinux "intel64"}/*.a
install -Dm0644 -t $out/lib/pkgconfig opt/intel/oneapi/mkl/${mklVersion}/lib/pkgconfig/*.pc
''
else
''
cp opt/intel/oneapi/mkl/${mklVersion}/lib/${lib.optionalString stdenvNoCC.hostPlatform.isLinux "intel64"}/*${shlibExt}* $out/lib
install -Dm0644 -t $out/lib/pkgconfig opt/intel/oneapi/mkl/${mklVersion}/lib/pkgconfig/*dynamic*.pc
''
)
+ ''
# Setup symlinks for blas / lapack
ln -s $out/lib/libmkl_rt${shlibExt} $out/lib/libblas${shlibExt}
ln -s $out/lib/libmkl_rt${shlibExt} $out/lib/libcblas${shlibExt}
ln -s $out/lib/libmkl_rt${shlibExt} $out/lib/liblapack${shlibExt}
ln -s $out/lib/libmkl_rt${shlibExt} $out/lib/liblapacke${shlibExt}
''
+ lib.optionalString stdenvNoCC.hostPlatform.isLinux ''
ln -s $out/lib/libmkl_rt${shlibExt} $out/lib/libblas${shlibExt}".3"
ln -s $out/lib/libmkl_rt${shlibExt} $out/lib/libcblas${shlibExt}".3"
ln -s $out/lib/libmkl_rt${shlibExt} $out/lib/liblapack${shlibExt}".3"
ln -s $out/lib/libmkl_rt${shlibExt} $out/lib/liblapacke${shlibExt}".3"
'';
# fixDarwinDylibName fails for libmkl_cdft_core.dylib because the
# larger updated load commands do not fit. Use install_name_tool
# explicitly and ignore the error.
postFixup = lib.optionalString stdenvNoCC.hostPlatform.isDarwin ''
for f in $out/lib/*.dylib; do
install_name_tool -id $out/lib/$(basename $f) $f || true
done
install_name_tool -change @rpath/libiomp5.dylib $out/lib/libiomp5.dylib $out/lib/libmkl_intel_thread.dylib
install_name_tool -change @rpath/libtbb.12.dylib $out/lib/libtbb.12.dylib $out/lib/libmkl_tbb_thread.dylib
install_name_tool -change @rpath/libtbbmalloc.2.dylib $out/lib/libtbbmalloc.2.dylib $out/lib/libtbbmalloc_proxy.dylib
'';
# Per license agreement, do not modify the binary
dontStrip = true;
dontPatchELF = true;
passthru.tests = {
pkg-config-dynamic-iomp = callPackage ./test {
enableStatic = false;
execution = "iomp";
};
pkg-config-static-iomp = callPackage ./test {
enableStatic = true;
execution = "iomp";
};
pkg-config-dynamic-seq = callPackage ./test {
enableStatic = false;
execution = "seq";
};
pkg-config-static-seq = callPackage ./test {
enableStatic = true;
execution = "seq";
};
};
meta = with lib; {
description = "Intel OneAPI Math Kernel Library";
longDescription = ''
Intel OneAPI Math Kernel Library (Intel oneMKL) optimizes code with minimal
effort for future generations of Intel processors. It is compatible with your
choice of compilers, languages, operating systems, and linking and
threading models.
'';
homepage = "https://software.intel.com/en-us/mkl";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
license = licenses.issl;
platforms = [
"x86_64-linux"
"x86_64-darwin"
];
maintainers = with maintainers; [ bhipple ];
};
}
// lib.optionalAttrs stdenvNoCC.hostPlatform.isDarwin {
src = fetchurl {
url = "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/087a9190-9d96-4b8c-bd2f-79159572ed89/m_onemkl_p_${mklVersion}.${rel}_offline.dmg";
hash = "sha256-bUaaJPSaLr60fw0DzDCjPvY/UucHlLbCSLyQxyiAi04=";
};
}
)

View File

@@ -0,0 +1,45 @@
{
stdenv,
pkg-config,
mkl,
enableStatic ? false,
execution ? "seq",
}:
let
linkType = if enableStatic then "static" else "dynamic";
in
stdenv.mkDerivation {
pname = "mkl-test";
version = mkl.version;
unpackPhase = ''
cp ${./test.c} test.c
'';
nativeBuildInputs = [ pkg-config ];
buildInputs = [ (mkl.override { inherit enableStatic; }) ];
doCheck = true;
buildPhase = ''
# Check regular Nix build.
gcc test.c -o test $(pkg-config --cflags --libs mkl-${linkType}-ilp64-${execution})
# Clear flags to ensure that we are purely relying on options
# provided by pkg-config.
NIX_CFLAGS_COMPILE="" \
NIX_LDFLAGS="" \
gcc test.c -o test $(pkg-config --cflags --libs mkl-${linkType}-ilp64-${execution})
'';
installPhase = ''
touch $out
'';
checkPhase = ''
./test
'';
}

View File

@@ -0,0 +1,12 @@
#include <assert.h>
#include <mkl_cblas.h>
int main() {
float u[] = {1., 2., 3.};
float v[] = {4., 5., 6.};
float dp = cblas_sdot(3, u, 1, v, 1);
assert(dp == 32.);
}

View File

@@ -0,0 +1,153 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Moritz Sanft <58110325+msanft@users.noreply.github.com>
Date: Tue, 3 Sep 2024 08:57:26 +0200
Subject: [PATCH] Use wrapped binaries instead of Python interpreter
Rather than calling ukify and mkosi with sys.executable, which doesn't use the Python wrappers for PATH and PYTHONPATH, we call the wrapped binaries directly.
Signed-off-by: Moritz Sanft <58110325+msanft@users.noreply.github.com>
---
mkosi/__init__.py | 17 +++++++----------
mkosi/bootloader.py | 3 +--
mkosi/run.py | 8 ++++----
3 files changed, 12 insertions(+), 16 deletions(-)
diff --git a/mkosi/__init__.py b/mkosi/__init__.py
index 65cac772bf1fc9feabec5740ed89a958ba406125..c0debc09a76f36ae878bd172294eee6637b95bcb 100644
--- a/mkosi/__init__.py
+++ b/mkosi/__init__.py
@@ -570,7 +570,7 @@ def finalize_host_scripts(
if context.config.find_binary(binary):
scripts[binary] = (binary, "--root", "/buildroot")
if ukify := context.config.find_binary("ukify"):
- scripts["ukify"] = (python_binary(context.config), ukify)
+ scripts["ukify"] = (ukify,)
return finalize_scripts(context.config, scripts | dict(helpers))
@@ -702,7 +702,7 @@ def script_maybe_chroot_sandbox(
helpers = {
"mkosi-chroot": [
- finalize_interpreter(bool(context.config.tools_tree)), "-SI", "/sandbox.py",
+ @MKOSI_SANDBOX@,
"--bind", "/buildroot", "/",
"--bind", "/var/tmp", "/var/tmp",
*apivfs_options(root=Path("/")),
@@ -1593,7 +1593,7 @@ def run_ukify(
sign: bool = True,
json_out: bool = False,
) -> dict[str, Any]:
- ukify = context.config.find_binary("ukify", "/usr/lib/systemd/ukify")
+ ukify = context.config.find_binary("ukify", "@UKIFY@")
if not ukify:
die("Could not find ukify")
@@ -1605,7 +1605,6 @@ def run_ukify(
(context.workspace / "cmdline").write_text(f"{' '.join(cmdline)}\x00")
cmd = [
- python_binary(context.config),
ukify,
"build",
*arguments,
@@ -1700,7 +1699,7 @@ def build_uki(
profiles: Sequence[Path],
output: Path,
) -> dict[str, Any]:
- if not (ukify := context.config.find_binary("ukify", "/usr/lib/systemd/ukify")):
+ if not (ukify := context.config.find_binary("ukify", "@UKIFY@")):
die("Could not find ukify")
json_out = False
@@ -1759,7 +1758,6 @@ def build_uki(
# TODO: bump version to 258 once it is released
if (
systemd_tool_version(
- python_binary(context.config),
ukify,
sandbox=context.sandbox,
)
@@ -1819,7 +1817,6 @@ def build_uki(
# new .ucode section support?
if (
systemd_tool_version(
- python_binary(context.config),
ukify,
sandbox=context.sandbox,
)
@@ -1887,7 +1884,7 @@ def want_uki(context: Context) -> bool:
or (
context.config.unified_kernel_images == ConfigFeature.auto
and systemd_stub_binary(context).exists()
- and context.config.find_binary("ukify", "/usr/lib/systemd/ukify") is not None
+ and context.config.find_binary("ukify", "@UKIFY@") is not None
)
)
@@ -2769,9 +2766,9 @@ def check_ukify(
reason: str,
hint: Optional[str] = None,
) -> None:
- ukify = check_tool(config, "ukify", "/usr/lib/systemd/ukify", reason=reason, hint=hint)
+ ukify = check_tool(config, "ukify", "@UKIFY@", reason=reason, hint=hint)
- v = systemd_tool_version(python_binary(config), ukify, sandbox=config.sandbox)
+ v = systemd_tool_version(ukify, sandbox=config.sandbox)
if v < version:
die(
f"Found '{ukify}' with version {v} but version {version} or newer is required to {reason}.",
diff --git a/mkosi/bootloader.py b/mkosi/bootloader.py
index 6f112b854f72a8863dc5e7348f0154851d3dda96..28b32b9c8fcaa7c49a7d69e7e303ccf332d47d58 100644
--- a/mkosi/bootloader.py
+++ b/mkosi/bootloader.py
@@ -270,8 +270,7 @@ def find_signed_grub_image(context: Context) -> Optional[Path]:
def python_binary(config: Config) -> PathString:
# If there's no tools tree, prefer the interpreter from MKOSI_INTERPRETER. If there is a tools
# tree, just use the default python3 interpreter.
- exe = Path(sys.executable)
- return "python3" if config.tools_tree or not exe.is_relative_to("/usr") else exe
+ return "python3" if config.tools_tree else "@PYTHON_PEFILE@"
def extract_pe_section(context: Context, binary: Path, section: str, output: Path) -> Path:
diff --git a/mkosi/run.py b/mkosi/run.py
index 422006d889802182d7e2f1734b2c342318583e7b..b9a1490bcd7780fea75d834e3ea4fb9a7033cc51 100644
--- a/mkosi/run.py
+++ b/mkosi/run.py
@@ -277,7 +277,7 @@ def finalize_path(
# Make sure that /usr/bin and /usr/sbin are always in $PATH.
path += [s for s in ("/usr/bin", "/usr/sbin") if s not in path]
else:
- path += ["/usr/bin", "/usr/sbin"]
+ path += ["/usr/bin", "/usr/sbin", "@NIX_PATH@"]
if prefix_usr:
path = [os.fspath(root / s.lstrip("/")) if s in ("/usr/bin", "/usr/sbin") else s for s in path]
@@ -463,7 +463,7 @@ def sandbox_cmd(
cmdline: list[PathString] = [
*setup,
*(["strace", "--detach-on=execve"] if ARG_DEBUG_SANDBOX.get() else []),
- sys.executable, "-SI", module / "sandbox.py",
+ @MKOSI_SANDBOX@,
"--proc", "/proc",
# We mounted a subdirectory of TMPDIR to /var/tmp so we unset TMPDIR so that /tmp or /var/tmp are
# used instead.
@@ -633,7 +633,7 @@ def chroot_options() -> list[PathString]:
"--unshare-ipc",
"--setenv", "container", "mkosi",
"--setenv", "HOME", "/",
- "--setenv", "PATH", "/usr/bin:/usr/sbin",
+ "--setenv", "PATH", "/usr/bin:/usr/sbin:@NIX_PATH@",
"--setenv", "BUILDROOT", "/",
] # fmt: skip
@@ -647,7 +647,7 @@ def chroot_cmd(
) -> Iterator[list[PathString]]:
with vartmpdir() as dir, resource_path(sys.modules[__package__ or __name__]) as module:
cmdline: list[PathString] = [
- sys.executable, "-SI", module / "sandbox.py",
+ @MKOSI_SANDBOX@,
*root("/"),
# We mounted a subdirectory of TMPDIR to /var/tmp so we unset TMPDIR so that /tmp or /var/tmp are
# used instead.

View File

@@ -0,0 +1,34 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Moritz Sanft <58110325+msanft@users.noreply.github.com>
Date: Tue, 3 Sep 2024 09:00:34 +0200
Subject: [PATCH] Fix library resolving
As ctypes doesn't do lookups in the Nix store for libraries, we supply the exact paths.
Signed-off-by: Moritz Sanft <58110325+msanft@users.noreply.github.com>
---
mkosi/sandbox.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mkosi/sandbox.py b/mkosi/sandbox.py
index c79b48739f3d7127375274bc0b1ef3463cae9032..1d7ad421f4534e25c6456c3a169ea9189668aefd 100755
--- a/mkosi/sandbox.py
+++ b/mkosi/sandbox.py
@@ -92,7 +92,7 @@ class cap_user_data_t(ctypes.Structure):
]
-libc = ctypes.CDLL(None, use_errno=True)
+libc = ctypes.CDLL("@LIBC@", use_errno=True)
libc.syscall.restype = ctypes.c_long
libc.unshare.argtypes = (ctypes.c_int,)
@@ -221,7 +221,7 @@ def seccomp_suppress(*, chown: bool = False, sync: bool = False) -> None:
if not chown and not sync:
return
- libseccomp = ctypes.CDLL("libseccomp.so.2")
+ libseccomp = ctypes.CDLL("@LIBSECCOMP@")
if libseccomp is None:
raise FileNotFoundError("libseccomp.so.2")

View File

@@ -0,0 +1,23 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Moritz Sanft <58110325+msanft@users.noreply.github.com>
Date: Tue, 3 Sep 2024 09:09:19 +0200
Subject: [PATCH] Fix QEMU firmware path
Signed-off-by: Moritz Sanft <58110325+msanft@users.noreply.github.com>
---
mkosi/qemu.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mkosi/qemu.py b/mkosi/qemu.py
index 0c406d818a9fa9dcce3be97d0c89e9df0d2a96fa..c134ab4a8bfba1e3564c831a5069be52d90ee15a 100644
--- a/mkosi/qemu.py
+++ b/mkosi/qemu.py
@@ -211,7 +211,7 @@ def find_ovmf_firmware(config: Config, firmware: Firmware) -> Optional[OvmfConfi
if not firmware.is_uefi():
return None
- desc = list((config.tools() / "usr/share/qemu/firmware").glob("*"))
+ desc = list((config.tools() / "@QEMU_FIRMWARE@").glob("*"))
if config.tools() == Path("/"):
desc += list((config.tools() / "etc/qemu/firmware").glob("*"))

View File

@@ -0,0 +1,135 @@
{
lib,
python3Packages,
fetchFromGitHub,
stdenv,
systemd,
pandoc,
kmod,
gnutar,
util-linux,
cpio,
bash,
coreutils,
btrfs-progs,
libseccomp,
replaceVars,
udevCheckHook,
# Optional dependencies
withQemu ? false,
qemu,
# Workaround for supporting providing additional package manager
# dependencies in the recursive use in the binary path.
# This can / should be removed once the `finalAttrs` pattern is
# available for Python packages.
extraDeps ? [ ],
}:
let
# For systemd features used by mkosi, see
# https://github.com/systemd/mkosi/blob/19bb5e274d9a9c23891905c4bcbb8f68955a701d/action.yaml#L64-L72
systemdForMkosi = systemd.override {
withRepart = true;
withBootloader = true;
withSysusers = true;
withFirstboot = true;
withEfi = true;
withUkify = true;
withKernelInstall = true;
};
pythonWithPefile = python3Packages.python.withPackages (ps: [ ps.pefile ]);
deps = [
bash
btrfs-progs
coreutils
cpio
gnutar
kmod
systemdForMkosi
util-linux
]
++ extraDeps
++ lib.optionals withQemu [
qemu
];
in
python3Packages.buildPythonApplication rec {
pname = "mkosi";
version = "25.3";
format = "pyproject";
outputs = [
"out"
"man"
];
src = fetchFromGitHub {
owner = "systemd";
repo = "mkosi";
rev = "21850673a7f75125d516268ce379dae776dd816a";
hash = "sha256-3dhr9lFJpI8aN8HILaMvGuuTbmTVUqdaLAGxSpqciTs=";
};
patches = [
(replaceVars ./0001-Use-wrapped-binaries-instead-of-Python-interpreter.patch {
UKIFY = "${systemdForMkosi}/lib/systemd/ukify";
PYTHON_PEFILE = lib.getExe pythonWithPefile;
NIX_PATH = toString (lib.makeBinPath deps);
MKOSI_SANDBOX = null; # will be replaced in postPatch
})
(replaceVars ./0002-Fix-library-resolving.patch {
LIBC = "${stdenv.cc.libc}/lib/libc.so.6";
LIBSECCOMP = "${libseccomp.lib}/lib/libseccomp.so.2";
})
]
++ lib.optional withQemu (
replaceVars ./0003-Fix-QEMU-firmware-path.patch {
QEMU_FIRMWARE = "${qemu}/share/qemu/firmware";
}
);
postPatch = ''
# As we need the $out reference, we can't use `replaceVars` here.
substituteInPlace mkosi/{run,__init__}.py \
--replace-fail '@MKOSI_SANDBOX@' "\"$out/bin/mkosi-sandbox\""
'';
nativeBuildInputs = [
pandoc
python3Packages.setuptools
python3Packages.setuptools-scm
python3Packages.wheel
udevCheckHook
];
dependencies = deps;
postBuild = ''
./tools/make-man-page.sh
'';
checkInputs = [
python3Packages.pytestCheckHook
];
postInstall = ''
mkdir -p $out/share/man/man1
mv mkosi/resources/man/mkosi.1 $out/share/man/man1/
'';
meta = with lib; {
description = "Build legacy-free OS images";
homepage = "https://github.com/systemd/mkosi";
changelog = "https://github.com/systemd/mkosi/releases/tag/v${version}";
license = licenses.lgpl21Only;
mainProgram = "mkosi";
maintainers = with maintainers; [
malt3
msanft
];
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,73 @@
{
stdenv,
lib,
fetchFromGitHub,
autoreconfHook,
libsodium,
}:
stdenv.mkDerivation rec {
pname = "mkp224o";
version = "1.7.0";
src = fetchFromGitHub {
owner = "cathugger";
repo = "mkp224o";
rev = "v${version}";
sha256 = "sha256-OL3xhoxIS1OqfVp0QboENFdNH/e1Aq1R/MFFM9LNFbQ=";
};
buildCommand =
let
# compile few variants with different implementation of crypto
# the fastest depends on a particular cpu
variants = [
{
suffix = "ref10";
configureFlags = [ "--enable-ref10" ];
}
{
suffix = "donna";
configureFlags = [ "--enable-donna" ];
}
]
++ lib.optionals stdenv.hostPlatform.isx86 [
{
suffix = "donna-sse2";
configureFlags = [ "--enable-donna-sse2" ];
}
]
++ lib.optionals (!stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) [
{
suffix = "amd64-51-30k";
configureFlags = [ "--enable-amd64-51-30k" ];
}
{
suffix = "amd64-64-24k";
configureFlags = [ "--enable-amd64-64-24k" ];
}
];
in
lib.concatMapStrings (
{ suffix, configureFlags }:
''
install -D ${
stdenv.mkDerivation {
name = "mkp224o-${suffix}-${version}";
inherit version src configureFlags;
nativeBuildInputs = [ autoreconfHook ];
buildInputs = [ libsodium ];
installPhase = "install -D mkp224o $out";
}
} $out/bin/mkp224o-${suffix}
''
) variants;
meta = with lib; {
description = "Vanity address generator for tor onion v3 (ed25519) hidden services";
homepage = "http://cathug2kyi4ilneggumrenayhuhsvrgn6qv2y47bgeet42iivkpynqad.onion/";
license = licenses.cc0;
platforms = platforms.unix;
maintainers = [ ];
};
}

View File

@@ -0,0 +1,26 @@
{
lib,
stdenv,
fetchurl,
}:
stdenv.mkDerivation rec {
pname = "mkrand";
version = "0.1.0";
src = fetchurl {
url = "https://github.com/mknight-tag/MKRAND/releases/download/v${version}/mkrand-${version}.tar.gz";
sha256 = "1irwyv2j5c3606k3qbq77yrd65y27rcq3jdlp295rz875q8iq9fs";
};
doCheck = true;
meta = {
description = "Digital Random Bit Generator";
mainProgram = "mkrand";
longDescription = "MKRAND is a utility for generating random information.";
homepage = "https://github.com/mknight-tag/MKRAND/";
license = lib.licenses.mit;
platforms = lib.platforms.all;
};
}

View File

@@ -0,0 +1,68 @@
{
lib,
stdenv,
fetchurl,
installShellFiles,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "mksh";
version = "59c";
src = fetchurl {
urls = [
"http://www.mirbsd.org/MirOS/dist/mir/mksh/mksh-R${finalAttrs.version}.tgz"
"http://pub.allbsd.org/MirOS/dist/mir/mksh/mksh-R${finalAttrs.version}.tgz"
];
hash = "sha256-d64WZaM38cSMYda5Yds+UhGbOOWIhNHIloSvMfh7xQY=";
};
strictDeps = true;
nativeBuildInputs = [
installShellFiles
];
dontConfigure = true;
buildPhase = ''
runHook preBuild
sh ./Build.sh -r
runHook postBuild
'';
installPhase = ''
runHook preInstall
install -D mksh $out/bin/mksh
install -D dot.mkshrc $out/share/mksh/mkshrc
installManPage mksh.1
runHook postInstall
'';
passthru = {
shellPath = "/bin/mksh";
};
meta = {
homepage = "http://www.mirbsd.org/mksh.htm";
changelog = "https://www.mirbsd.org/mksh.htm#clog";
description = "MirBSD Korn Shell";
mainProgram = "mksh";
longDescription = ''
The MirBSD Korn Shell is a DFSG-free and OSD-compliant (and OSI
approved) successor to pdksh, developed as part of the MirOS
Project as native Bourne/POSIX/Korn shell for MirOS BSD, but
also to be readily available under other UNIX(R)-like operating
systems.
'';
license = with lib.licenses; [
miros
isc
unicode-dfs-2016
];
maintainers = with lib.maintainers; [
joachifm
];
platforms = lib.platforms.unix;
};
})

View File

@@ -0,0 +1,44 @@
{
lib,
stdenv,
fetchurl,
fetchpatch,
groff,
}:
stdenv.mkDerivation rec {
pname = "mktemp";
version = "1.7";
# Have `configure' avoid `/usr/bin/nroff' in non-chroot builds.
NROFF = "${groff}/bin/nroff";
patches = [
# Pull upstream fix for parallel install failures.
(fetchpatch {
name = "parallel-install.patch";
url = "https://www.mktemp.org/repos/mktemp/raw-rev/eb87d96ce8b7";
hash = "sha256-cJ/0pFj8tOkByUwhlMwLNSQgTHyAU8svEkjKWWwsNmY=";
})
];
# Don't use "install -s"
postPatch = ''
substituteInPlace Makefile.in --replace " 0555 -s " " 0555 "
'';
src = fetchurl {
url = "ftp://ftp.mktemp.org/pub/mktemp/mktemp-${version}.tar.gz";
sha256 = "0x969152znxxjbj7387xb38waslr4yv6bnj5jmhb4rpqxphvk54f";
};
enableParallelBuilding = true;
meta = with lib; {
description = "Simple tool to make temporary file handling in shells scripts safe and simple";
mainProgram = "mktemp";
homepage = "https://www.mktemp.org";
license = licenses.isc;
platforms = platforms.unix;
};
}

View File

@@ -0,0 +1,42 @@
{
lib,
stdenv,
fetchFromGitHub,
openssl,
}:
stdenv.mkDerivation rec {
pname = "mktorrent";
version = "1.1";
src = fetchFromGitHub {
owner = "pobrn";
repo = "mktorrent";
rev = "v${version}";
sha256 = "17pdc5mandl739f8q26n5is8ga56s83aqcrwhlnnplbxwx2inidr";
};
makeFlags = [
"USE_PTHREADS=1"
"USE_OPENSSL=1"
"USE_LONG_OPTIONS=1"
]
++ lib.optional stdenv.hostPlatform.isi686 "USE_LARGE_FILES=1"
++ lib.optional stdenv.hostPlatform.isLinux "CFLAGS=-lgcc_s";
installFlags = [ "PREFIX=${placeholder "out"}" ];
buildInputs = [ openssl ];
meta = with lib; {
description = "Command line utility to create BitTorrent metainfo files";
homepage = "https://github.com/pobrn/mktorrent/wiki";
license = licenses.gpl2Plus;
maintainers = with maintainers; [
Profpatsch
winter
];
platforms = platforms.all;
mainProgram = "mktorrent";
};
}

View File

@@ -0,0 +1,46 @@
{
lib,
python3Packages,
fetchFromGitHub,
}:
let
version = "1.2.14";
in
python3Packages.buildPythonApplication {
pname = "mktxp";
inherit version;
pyproject = false;
src = fetchFromGitHub {
owner = "akpw";
repo = "mktxp";
tag = "v${version}";
hash = "sha256-4+0aw/r71FcVrxASco3AkYzi7zbFeiEkJB7acGdb1FQ=";
};
nativeBuildInputs = with python3Packages; [
pypaInstallHook
setuptoolsBuildHook
];
dependencies = with python3Packages; [
prometheus-client
routeros-api
configobj
humanize
texttable
speedtest-cli
waitress
packaging
];
meta = {
homepage = "https://github.com/akpw/mktxp";
changelog = "https://github.com/akpw/mktxp/releases/tag/v${version}";
description = "Prometheus Exporter for Mikrotik RouterOS devices";
license = lib.licenses.gpl2;
platforms = lib.platforms.linux;
maintainers = [ lib.maintainers.BonusPlay ];
mainProgram = "mktxp";
};
}

View File

@@ -0,0 +1,60 @@
{
lib,
# Build fails with Go 1.25, with the following error:
# 'vendor/golang.org/x/tools/internal/tokeninternal/tokeninternal.go:64:9: invalid array length -delta * delta (constant -256 of type int64)'
# Wait for upstream to update their vendored dependencies before unpinning.
buildGo124Module,
fetchFromGitHub,
coreutils,
bash,
stdenv,
}:
buildGo124Module {
pname = "mkuimage";
version = "0-unstable-2025-09-05";
src = fetchFromGitHub {
owner = "u-root";
repo = "mkuimage";
rev = "9a40452f5d3ba67f236a83de54fa2c40f797b68b";
hash = "sha256-asC4j2DXkQnx6BZntxA8hSaM2k6p0CxraHYq3bK9vNQ=";
};
vendorHash = "sha256-KX9uv5m4N4+7gOgjhotRac9sz8tWSJ1krq98RWdsbzg=";
subPackages = [
"cmd/gentpldeps"
"cmd/mkuimage"
];
env.CGO_ENABLED = "0";
ldflags = [ "-s" ];
# Tests are failing on darwin as they try to compile u-root binaries
# that only work on linux.
#
# Notice that due to some legacy/bug in buildGoModule, the build isn't
# failing even the tests are, as we get a false-positive the output
# filtering: https://github.com/NixOS/nixpkgs/issues/349468
doCheck = stdenv.hostPlatform.isLinux;
# The tests want to copy /bin/bash and /bin/ls, but we don't have those.
# As these are interesting e2e tests to check if things work, we substitute
# them with the actual paths instead of just skipping the tests.
preCheck = ''
substituteInPlace ./cmd/mkuimage/main_test.go \
--replace-fail '-files=/bin/bash"' '-files=${bash}/bin/bash:bin/bash"' \
--replace-fail '-files=/bin/ls"' '-files=${coreutils}/bin/ls:bin/ls"' \
--replace-fail '-files=/bin/bash' '-files=${bash}/bin/bash'
'';
meta = {
description = "Create small Go-based root file systems -- with support for CPIOs and (TBD) Docker images";
homepage = "https://github.com/u-root/mkuimage";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ katexochen ];
mainProgram = "mkuimage";
};
}

View File

@@ -0,0 +1,151 @@
{
lib,
stdenv,
fetchFromGitea,
pkg-config,
autoreconfHook,
rake,
boost,
cmark,
docbook_xsl,
expat,
file,
flac,
fmt,
gettext,
gmp,
gtest,
libdvdread,
libebml,
libiconv,
libmatroska,
libogg,
libvorbis,
libxslt,
nlohmann_json,
pugixml,
qt6,
utf8cpp,
xdg-utils,
zlib,
nix-update-script,
withGUI ? true,
}:
let
inherit (lib)
enableFeature
getDev
getLib
optionals
optionalString
;
phase = name: args: ''
runHook pre${name}
rake ${args}
runHook post${name}
'';
in
stdenv.mkDerivation (finalAttrs: {
pname = "mkvtoolnix";
version = "95.0";
src = fetchFromGitea {
domain = "codeberg.org";
owner = "mbunkus";
repo = "mkvtoolnix";
tag = "release-${finalAttrs.version}";
hash = "sha256-FwOVqBHzgDveT8dGRfb2ONIAhCGEKU4UqpM3g7m0klA=";
};
passthru = {
updateScript = nix-update-script {
extraArgs = [ "--version-regex=release-(.*)" ];
};
};
nativeBuildInputs = [
autoreconfHook
docbook_xsl
gettext
gtest
libxslt
pkg-config
rake
]
++ optionals withGUI [ qt6.wrapQtAppsHook ];
# qtbase and qtmultimedia are needed without the GUI
buildInputs = [
boost
expat
file
flac
fmt
gmp
libdvdread
libebml
libmatroska
libogg
libvorbis
nlohmann_json
pugixml
qt6.qtbase
qt6.qtmultimedia
utf8cpp
xdg-utils
zlib
]
++ optionals withGUI [ cmark ]
++ optionals stdenv.hostPlatform.isLinux [ qt6.qtwayland ];
# autoupdate is not needed but it silences a ton of pointless warnings
postPatch = ''
patchShebangs . > /dev/null
autoupdate configure.ac ac/*.m4
'';
configureFlags = [
"--disable-debug"
"--disable-precompiled-headers"
"--disable-profiling"
"--disable-update-check"
"--enable-optimization"
"--with-boost-libdir=${getLib boost}/lib"
"--with-docbook-xsl-root=${docbook_xsl}/share/xml/docbook-xsl"
"--with-gettext"
"--with-extra-includes=${getDev utf8cpp}/include/utf8cpp"
"--with-extra-libs=${getLib utf8cpp}/lib"
(enableFeature withGUI "gui")
];
buildPhase = phase "Build" "";
installPhase = phase "Install" "install";
doCheck = true;
checkPhase = phase "Check" "tests:run_unit";
dontWrapQtApps = true;
postFixup = optionalString withGUI ''
wrapQtApp $out/bin/mkvtoolnix-gui
'';
meta = {
description = "Cross-platform tools for Matroska";
homepage = "https://mkvtoolnix.download/";
license = lib.licenses.gpl2Only;
mainProgram = if withGUI then "mkvtoolnix-gui" else "mkvtoolnix";
maintainers = with lib.maintainers; [
codyopel
rnhmjoj
];
platforms = lib.platforms.unix;
};
})