Merge master into staging-next

This commit is contained in:
github-actions[bot] 2024-05-12 06:01:23 +00:00 committed by GitHub
commit 8101e67b3d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
77 changed files with 3426 additions and 1796 deletions

View File

@ -81,6 +81,8 @@ let
&& final.parsed.kernel == platform.parsed.kernel;
isCompatible = _: throw "2022-05-23: isCompatible has been removed in favor of canExecute, refer to the 22.11 changelog for details";
# Derived meta-data
useLLVM = final.isFreeBSD;
libc =
/**/ if final.isDarwin then "libSystem"
else if final.isMinGW then "msvcrt"

View File

@ -15,20 +15,22 @@
, glib
, gtk4
, libadwaita
, zbar
, gst_all_1
, Security
, Foundation
}:
stdenv.mkDerivation rec {
pname = "warp";
version = "0.6.2";
version = "0.7.0";
src = fetchFromGitLab {
domain = "gitlab.gnome.org";
owner = "World";
repo = pname;
repo = "warp";
rev = "v${version}";
hash = "sha256-pntHIY0cScDKhWR6kXp6YrEbBQiQjUId3MrJzy5l+K8=";
hash = "sha256-GRxZ3y1PdJpBDnGCfmOmZgN8n1aaYf9IhyszRwo3MjQ=";
};
postPatch = ''
@ -38,7 +40,7 @@ stdenv.mkDerivation rec {
cargoDeps = rustPlatform.fetchCargoTarball {
inherit src;
name = "${pname}-${version}";
hash = "sha256-Go/a7aVHF1Yt3yIccKJIVeFy5rckXhSKfd13hdhlLUQ=";
hash = "sha256-v/MhVcQmMYD/n/8wmPCYUy4YpXhL0v4fq8h6cllo/pw=";
};
nativeBuildInputs = [
@ -59,7 +61,12 @@ stdenv.mkDerivation rec {
glib
gtk4
libadwaita
] ++ lib.optionals stdenv.isDarwin [
zbar
] ++ (with gst_all_1; [
gstreamer
gst-plugins-base
gst-plugins-bad
]) ++ lib.optionals stdenv.isDarwin [
Security
Foundation
];

View File

@ -1,18 +1,31 @@
{ stdenv, lib, gccStdenv, fetchurl, zlib, mpi }:
{
stdenv,
lib,
fetchurl,
zlib,
mpi,
}:
gccStdenv.mkDerivation rec {
version = "3.7.2";
stdenv.mkDerivation (finalAttrs: {
version = "5.0.6";
pname = "migrate";
src = fetchurl {
url = "https://peterbeerli.com/migrate-html5/download_version3/${pname}-${version}.src.tar.gz";
sha256 = "1p2364ffjc56i82snzvjpy6pkf6wvqwvlvlqxliscx2c303fxs8v";
url = "https://peterbeerli.com/migrate-html5/download_version4/${finalAttrs.pname}-${finalAttrs.version}.src.tar.gz";
hash = "sha256-twkoR9L6VPUye12OC0B5w0PxcxyKain6RkhCswLEdwg=";
};
buildInputs = [ zlib mpi ];
setSourceRoot = "sourceRoot=$(echo */src)";
buildFlags = [ "thread" "mpis" ];
preInstall = "mkdir -p $out/man/man1";
sourceRoot = "migrate-${finalAttrs.version}/src";
buildInputs = [
zlib
mpi
];
buildFlags = [
"thread"
"mpis"
];
meta = with lib; {
broken = stdenv.isDarwin;
@ -21,5 +34,6 @@ gccStdenv.mkDerivation rec {
license = licenses.mit;
maintainers = [ maintainers.bzizou ];
platforms = platforms.unix;
mainProgram = "migrate-n";
};
}
})

File diff suppressed because it is too large Load Diff

View File

@ -3,31 +3,34 @@
, fetchFromGitLab
, systemd
, coreutils
, gnugrep
, pkg-config
, cmake
, fontconfig
, gtk3
, libappindicator
, libGL
, libinput
, libxkbcommon
, mesa
, seatd
, wayland
}:
rustPlatform.buildRustPackage rec {
pname = "asusctl";
version = "5.0.10";
version = "6.0.6";
src = fetchFromGitLab {
owner = "asus-linux";
repo = "asusctl";
rev = version;
hash = "sha256-H8x3nfOFRv9DkbDkFw+LO1tdHiVyU3SzetqED4twPSk=";
hash = "sha256-to2HJAqU3+xl6Wt90GH7RA7079v1QyP+AE0pL/9rd/M=";
};
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"ecolor-0.21.0" = "sha256-m7eHX6flwO21umtx3dnIuVUnNsEs3ZCyOk5Vvp/lVfI=";
"notify-rust-4.6.0" = "sha256-jhCgisA9f6AI9e9JQUYRtEt47gQnDv5WsdRKFoKvHJs=";
"supergfxctl-5.1.2" = "sha256-WDbUgvWExk5cs2cpjo88CiROdEbc01o2DELhRi9gju4=";
"const-field-offset-0.1.5" = "sha256-53pT9ERsmF4lM9tVG09hgbM0zfbTp1qSM+NDyFQxe3c=";
"notify-rust-4.7.0" = "sha256-A7edUorty5GpGXCUQPszZuXtLdEmbmrDSU9JcoDaiaI=";
"supergfxctl-5.2.2" = "sha256-hg1QJ7DLtn5oH6IqQu7BcWIsZKAsFy6jjsjF/2o1Cos=";
};
};
@ -37,7 +40,9 @@ rustPlatform.buildRustPackage rec {
asusd-user/src/daemon.rs
asusd/src/ctrl_anime/config.rs
rog-aura/src/aura_detection.rs
rog-control-center/src/lib.rs
rog-control-center/src/main.rs
rog-control-center/src/tray.rs
"
for file in $files; do
substituteInPlace $file --replace /usr/share $out/share
@ -50,11 +55,32 @@ rustPlatform.buildRustPackage rec {
substituteInPlace data/asusd-user.service \
--replace /usr/bin/asusd-user $out/bin/asusd-user \
--replace /usr/bin/sleep ${coreutils}/bin/sleep
substituteInPlace Makefile \
--replace /usr/bin/grep ${lib.getExe gnugrep}
'';
nativeBuildInputs = [ pkg-config cmake rustPlatform.bindgenHook ];
nativeBuildInputs = [ pkg-config ];
buildInputs = [ systemd fontconfig gtk3 ];
buildInputs = [
fontconfig
libGL
libinput
libxkbcommon
mesa
seatd
systemd
wayland
];
# force linking to all the dlopen()ed dependencies
RUSTFLAGS = map (a: "-C link-arg=${a}") [
"-Wl,--push-state,--no-as-needed"
"-lEGL"
"-lfontconfig"
"-lwayland-client"
"-Wl,--pop-state"
];
# upstream has minimal tests, so don't rebuild twice
doCheck = false;
@ -63,10 +89,6 @@ rustPlatform.buildRustPackage rec {
make prefix=$out install-data
'';
postFixup = ''
patchelf --add-rpath "${libappindicator}/lib:${libGL}/lib" "$out/bin/rog-control-center"
'';
meta = with lib; {
description = "A control daemon, CLI tools, and a collection of crates for interacting with ASUS ROG laptops";
homepage = "https://gitlab.com/asus-linux/asusctl";

View File

@ -5,16 +5,16 @@
buildGoModule rec {
pname = "flarectl";
version = "0.94.0";
version = "0.95.0";
src = fetchFromGitHub {
owner = "cloudflare";
repo = "cloudflare-go";
rev = "v${version}";
hash = "sha256-8lZJn4/IpkNT9IHK3rGvNE/Rv0CHQlVVu4F3K+J8fRA=";
hash = "sha256-GcmFRtQ8aqicvawCpFDo+oheUSOgKewBETIizPKcyGU=";
};
vendorHash = "sha256-/81Onrs+qyKEt79DtfX4EDDVxhzB0uqaHa3X+GbupWQ=";
vendorHash = "sha256-Jtap4hGwNr8lpXi6huGikL4iUSP242cIiFyvGveszq8=";
subPackages = [ "cmd/flarectl" ];

View File

@ -3,7 +3,6 @@
, stdenv
, lib
, addDriverRunpath
, fetchpatch
, fetchFromGitHub
, protobuf
, protoc-gen-go
@ -100,8 +99,8 @@ let
src = fetchFromGitHub {
owner = "ggerganov";
repo = "llama.cpp";
rev = "6ecf3189e00a1e8e737a78b6d10e1d7006e050a2";
hash = "sha256-JS287UdCzj6Es134cbhr8y/AoejMEux0w++/pZ5NejY=";
rev = "c12452c7aec8a02264afc00196a13caa591a13ac";
hash = "sha256-Kji8dlz7OfhPeNXnYgBHzpGGMhCsRLJ9d+EFf77Q6Co=";
fetchSubmodules = true;
};
postPatch = prev.postPatch + ''
@ -254,8 +253,8 @@ let
src = fetchFromGitHub {
owner = "ggerganov";
repo = "whisper.cpp";
rev = "8fac6455ffeb0a0950a84e790ddb74f7290d33c4";
hash = "sha256-Dez/Q2vMvSmscS+BJwkgZ4QG+ebM/N8s1Okd5my0CWI=";
rev = "73d13ad19a8c9c4da4f405088a85169b1a171e66";
hash = "sha256-7g/J3a3behGgcJXy9ryAYXxgOYnsRMlGmux13re28AY=";
};
nativeBuildInputs = [ cmake pkg-config ]
@ -373,18 +372,18 @@ let
stdenv;
pname = "local-ai";
version = "2.14.0";
version = "2.15.0";
src = fetchFromGitHub {
owner = "go-skynet";
repo = "LocalAI";
rev = "v${version}";
hash = "sha256-wr7sTMjGofGiZZbRJ+RfgXx9TM9Adu2NBAXeB3P5Ep0=";
hash = "sha256-AjNgfZjVxlw0LtPbUTbJuLcUfqJdPzn6vOmUDz/v7Jc=";
};
self = buildGoModule.override { stdenv = effectiveStdenv; } {
inherit pname version src;
vendorHash = "sha256-nWNK2YekQnBSLx4ouNSe6esIe0yFuo69E0HStYLQANg=";
vendorHash = "sha256-+ZPZkOpaTsKrL2HDOEtAr8sT6uqTiQXo/XS+MBNZq5E=";
env.NIX_CFLAGS_COMPILE = lib.optionalString with_stablediffusion " -isystem ${opencv}/include/opencv4";
@ -404,11 +403,13 @@ let
-e 's;git clone.*go-tiny-dream$;${cp} ${if with_tinydream then go-tiny-dream else go-tiny-dream.src} sources/go-tiny-dream;' \
-e 's, && git checkout.*,,g' \
-e '/mod download/ d' \
-e '/^ALL_GRPC_BACKENDS+=backend-assets\/grpc\/llama-cpp-/ d' \
'';
${cp} ${llama-cpp-grpc}/bin/*grpc-server backend/cpp/llama/grpc-server
echo "grpc-server:" > backend/cpp/llama/Makefile
''
;
postConfigure = ''
mkdir -p backend-assets/grpc
cp ${llama-cpp-grpc}/bin/*grpc-server backend-assets/grpc/llama-cpp
'';
buildInputs = [ ]
++ lib.optionals with_cublas [ libcublas ]

View File

@ -28,7 +28,7 @@ in
command = "local-ai --help";
};
health = testers.runNixOSTest ({ config, ... }: {
health = testers.runNixOSTest {
name = self.name + "-health";
nodes.machine = common-config;
testScript =
@ -40,10 +40,9 @@ in
machine.succeed("curl -f http://localhost:${port}/readyz")
machine.succeed("${prom2json}/bin/prom2json http://localhost:${port}/metrics > metrics.json")
machine.copy_from_vm("metrics.json")
'';
});
};
# https://localai.io/features/embeddings/#bert-embeddings
bert =
@ -84,11 +83,12 @@ in
machine.succeed("curl -f http://localhost:${port}/readyz")
machine.succeed("curl -f http://localhost:${port}/v1/models --output models.json")
machine.succeed("${jq}/bin/jq --exit-status 'debug | .data[].id == \"${model}\"' models.json")
machine.succeed("curl -f http://localhost:${port}/embeddings --json @${writers.writeJSON "request.json" requests.request} --output embeddings.json")
machine.copy_from_vm("embeddings.json")
machine.succeed("${jq}/bin/jq --exit-status 'debug | .model == \"${model}\"' embeddings.json")
machine.succeed("${prom2json}/bin/prom2json http://localhost:${port}/metrics > metrics.json")
machine.copy_from_vm("metrics.json")
'';
};
@ -183,19 +183,21 @@ in
machine.succeed("${jq}/bin/jq --exit-status 'debug | .data[].id == \"${model}\"' models.json")
machine.succeed("curl -f http://localhost:${port}/v1/chat/completions --json @${writers.writeJSON "request-chat-completions.json" requests.chat-completions} --output chat-completions.json")
machine.copy_from_vm("chat-completions.json")
machine.succeed("${jq}/bin/jq --exit-status 'debug | .object == \"chat.completion\"' chat-completions.json")
machine.succeed("${jq}/bin/jq --exit-status 'debug | .choices | first.message.content | tonumber == 3' chat-completions.json")
machine.succeed("curl -f http://localhost:${port}/v1/edits --json @${writers.writeJSON "request-edit-completions.json" requests.edit-completions} --output edit-completions.json")
machine.copy_from_vm("edit-completions.json")
machine.succeed("${jq}/bin/jq --exit-status 'debug | .object == \"edit\"' edit-completions.json")
machine.succeed("${jq}/bin/jq --exit-status '.usage.completion_tokens | debug == ${toString requests.edit-completions.max_tokens}' edit-completions.json")
machine.succeed("curl -f http://localhost:${port}/v1/completions --json @${writers.writeJSON "request-completions.json" requests.completions} --output completions.json")
machine.copy_from_vm("completions.json")
machine.succeed("${jq}/bin/jq --exit-status 'debug | .object ==\"text_completion\"' completions.json")
machine.succeed("${jq}/bin/jq --exit-status '.usage.completion_tokens | debug == ${toString model-configs.${model}.parameters.max_tokens}' completions.json")
machine.succeed("${prom2json}/bin/prom2json http://localhost:${port}/metrics > metrics.json")
machine.copy_from_vm("metrics.json")
'';
};
@ -257,12 +259,15 @@ in
machine.succeed("curl -f http://localhost:${port}/readyz")
machine.succeed("curl -f http://localhost:${port}/v1/models --output models.json")
machine.succeed("${jq}/bin/jq --exit-status 'debug' models.json")
machine.succeed("curl -f http://localhost:${port}/tts --json @${writers.writeJSON "request.json" requests.request} --output out.wav")
machine.copy_from_vm("out.wav")
machine.succeed("curl -f http://localhost:${port}/v1/audio/transcriptions --header 'Content-Type: multipart/form-data' --form file=@out.wav --form model=${model-stt} --output transcription.json")
machine.copy_from_vm("transcription.json")
machine.succeed("${jq}/bin/jq --exit-status 'debug | .segments | first.text == \"${requests.request.input}\"' transcription.json")
machine.succeed("${prom2json}/bin/prom2json http://localhost:${port}/metrics > metrics.json")
machine.copy_from_vm("metrics.json")
'';
};

View File

@ -54,7 +54,7 @@ stdenv.mkDerivation {
description = "GStreamer Plugin for MIPI camera support through the IPU6/IPU6EP/IPU6SE on Intel Tigerlake/Alderlake/Jasperlake platforms";
homepage = "https://github.com/intel/icamerasrc/tree/icamerasrc_slim_api";
license = licenses.lgpl21Plus;
maintainers = with maintainers; [ hexa ];
maintainers = with maintainers; [ ];
platforms = [ "x86_64-linux" ];
};
}

View File

@ -82,7 +82,7 @@ stdenv.mkDerivation {
description = "HAL for processing of images in userspace";
homepage = "https://github.com/intel/ipu6-camera-hal";
license = licenses.asl20;
maintainers = with maintainers; [ hexa ];
maintainers = with maintainers; [ ];
platforms = [ "x86_64-linux" ];
};
}

View File

@ -1,19 +1,21 @@
{ lib
, buildPythonPackage
, fetchPypi
, fetchFromGitHub
, setuptools
, deepdiff
, numpy
, opencv4
, pyyaml
, qudida
, scikit-image
, scikit-learn
, scipy
, deepdiff
, pydantic
, pytestCheckHook
, pythonOlder
, pythonRelaxDepsHook
, torch
, torchvision
, typing-extensions
}:
buildPythonPackage rec {
@ -23,9 +25,11 @@ buildPythonPackage rec {
disabled = pythonOlder "3.8";
src = fetchPypi {
inherit pname version;
hash = "sha256-VNpClOBdoaQOqU92Mm/Z5Q7P+fZzR+m43SFA9pSi1M0=";
src = fetchFromGitHub {
owner = "albumentations-team";
repo = "albumentations";
rev = "refs/tags/${version}";
hash = "sha256-7t1+22zzFtkZaAyOo6xjk+MXT9N44PmQ/NRRfvLeRVk=";
};
nativeBuildInputs = [
@ -34,6 +38,7 @@ buildPythonPackage rec {
pythonRemoveDeps = [
"opencv-python"
"pydantic"
];
build-system = [
@ -43,10 +48,12 @@ buildPythonPackage rec {
dependencies = [
numpy
opencv4
pydantic
pyyaml
qudida
scikit-image
scikit-learn
scipy
typing-extensions
];
nativeCheckInputs = [

View File

@ -5,12 +5,12 @@
buildPythonPackage rec {
pname = "btrfs";
version = "13";
version = "14.1";
format = "setuptools";
src = fetchPypi {
inherit pname version;
hash = "sha256-NSyzhpHYDkunuU104XnbVCcVRNDoVBz4KuJRrE7WMO0=";
hash = "sha256-BPKPwT33i8fQYJkUZbnJ8nQNbmKw0Dq6ekb9mr7awEY=";
};
# no tests (in v12)

View File

@ -11,8 +11,8 @@
buildPythonPackage rec {
pname = "desktop-notifier";
version = "3.5.6";
format = "pyproject";
version = "4.0.0";
pyproject = true;
disabled = pythonOlder "3.7";
@ -20,14 +20,14 @@ buildPythonPackage rec {
owner = "SamSchott";
repo = pname;
rev = "refs/tags/v${version}";
hash = "sha256-txUWRCWLQ6jWrdEJ/D5+CsflNad5Onr/wLycENri1z8=";
hash = "sha256-6FtxfY0vjCbCueeXdAXOy6XSjne4I7brQ5OvJ+Q1KsQ=";
};
nativeBuildInputs = [
build-system = [
setuptools
];
propagatedBuildInputs = [
dependencies = [
packaging
] ++ lib.optionals stdenv.isLinux [
dbus-next

View File

@ -2,6 +2,7 @@
, buildPythonPackage
, fetchPypi
, isPy27
, setuptools
, futures ? null
, docloud
, requests
@ -10,7 +11,7 @@
buildPythonPackage rec {
pname = "docplex";
version = "2.27.239";
format = "setuptools";
pyproject = true;
# No source available from official repo
src = fetchPypi {
@ -18,6 +19,15 @@ buildPythonPackage rec {
hash = "sha256-Ug5+jDBBbamqd0JebzHvjLZoTRRPYWQiJl6g8BK0aMQ=";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail "setuptools~=68.2.2" "setuptools>=68.2.2"
'';
build-system = [
setuptools
];
propagatedBuildInputs = [
docloud
requests

View File

@ -2,8 +2,8 @@
, buildPythonPackage
, pythonOlder
, fetchFromGitHub
, requests
, setuptools
, requests
, six
, stone
, mock
@ -15,9 +15,10 @@
buildPythonPackage rec {
pname = "dropbox";
version = "11.36.2";
format = "setuptools";
pyproject = true;
disabled = pythonOlder "3.7";
outputs = ["out" "doc"];
src = fetchFromGitHub {
@ -27,9 +28,12 @@ buildPythonPackage rec {
hash = "sha256-d++lxsbwPxnz1JPguWkImHXB+GQpMa9Uo3JNIxIe2ok=";
};
propagatedBuildInputs = [
requests
build-system = [
setuptools
];
dependencies = [
requests
six
stone
];

View File

@ -1,29 +1,79 @@
{ lib, buildPythonPackage, fetchFromGitHub, cython, numpy, pysam, matplotlib, python, isPy27, isPy3k }:
{
lib,
buildPythonPackage,
fetchFromGitHub,
fetchpatch,
swig,
cython,
matplotlib,
numpy,
pandas,
pysam,
setuptools,
pytestCheckHook,
nix-update-script,
}:
buildPythonPackage rec {
version = "0.12.4";
format = "setuptools";
pname = "htseq";
version = "2.0.4";
pyproject = true;
src = fetchFromGitHub {
owner = "htseq";
repo = "htseq";
rev = "release_${version}";
sha256 = "0y7vh249sljqjnv81060w4xkdx6f1y5zdqkh38yk926x6v9riijm";
hash = "sha256-7ocrmuj9LOtPz9XbI5rKGcdE5JbFz/pZh00Nie65XxE=";
};
nativeBuildInputs = [ cython ];
propagatedBuildInputs = [ numpy pysam matplotlib ];
patches = [
# https://github.com/htseq/htseq/pull/84
(fetchpatch {
name = "replace-distutils-with-sysconfig.patch";
url = "https://github.com/htseq/htseq/commit/f0f1e464ee9aee56f0b44f905e7b3355b0bb8f29.patch";
hash = "sha256-yDYkXCPy+YFgnk1rnXwCB998aZwVd5nJeejZIgeEzAo=";
})
];
checkPhase = lib.optionalString isPy27 ''
${python.interpreter} python2/test/test_general.py
'' + lib.optionalString isPy3k ''
${python.interpreter} python3/test/test_general.py
nativeBuildInputs = [ swig ];
build-system = [
cython
numpy
pysam
setuptools
];
dependencies = [
numpy
pysam
];
optional-dependencies = {
htseq-qa = [ matplotlib ];
};
pythonImportsCheck = [ "HTSeq" ];
nativeCheckInputs = [
pandas
pytestCheckHook
] ++ optional-dependencies.htseq-qa;
preCheck = ''
rm -r src HTSeq
export PATH=$out/bin:$PATH
'';
passthru.updateScript = nix-update-script {
extraArgs = [
"--version-regex"
"release_(.+)"
];
};
meta = with lib; {
homepage = "https://htseq.readthedocs.io/";
description = "A framework to work with high-throughput sequencing data";
maintainers = with maintainers; [ unode ];
platforms = platforms.unix;
};
}

View File

@ -14,7 +14,7 @@
buildPythonPackage rec {
pname = "igraph";
version = "0.11.4";
version = "0.11.5";
disabled = pythonOlder "3.8";
@ -24,7 +24,7 @@ buildPythonPackage rec {
owner = "igraph";
repo = "python-igraph";
rev = "refs/tags/${version}";
hash = "sha256-sR9OqsBxP2DvcYz1dhIP29rrQ56CRKW02oNAXUNttio=";
hash = "sha256-nfXCAjTKxtslVk17h60+v/JQusQTmaTRCPvvFG4/OPk=";
};
postPatch = ''

View File

@ -10,14 +10,14 @@
buildPythonPackage rec {
pname = "ihm";
version = "1.0";
version = "1.1";
pyproject = true;
src = fetchFromGitHub {
owner = "ihmwg";
repo = "python-ihm";
rev = "refs/tags/${version}";
hash = "sha256-a1M3YihN71M9TnkldAzN6N1UuPksDk6SPiBgr4HyC8g=";
hash = "sha256-auzArRwiue2CFo2DNS0NAF+aoZFvadhP6ARM0lRGcSA=";
};
nativeBuildInputs = [

View File

@ -9,12 +9,12 @@
buildPythonPackage rec {
pname = "jenkins-job-builder";
version = "6.2.0";
version = "6.3.0";
format = "setuptools";
src = fetchPypi {
inherit pname version;
hash = "sha256-kV2g1qbS5L7bEqfPijj60eK+pbTc8SAs/tctpNv0PFs=";
hash = "sha256-RD9VQFlwLJ3TiReKty+q056CjsOnSD2J2bpASmqHIEM=";
};
postPatch = ''

View File

@ -11,6 +11,7 @@
, wheel
, astunparse
, numpy
, packaging
, pyparsing
, scipy
, gsd
@ -39,9 +40,31 @@ buildPythonPackage rec {
url = "https://github.com/mdtraj/mdtraj/commit/81209d00817ab07cfc4668bf5ec88088d16904c0.patch";
hash = "sha256-ttNmij7csxF0Z5wPPwhGumRX055W2IgFjRAe6nI6GNY=";
})
# remove pkg_resources usage
# https://github.com/mdtraj/mdtraj/pull/1837
(fetchpatch {
name = "fix-runtime-error.patch";
url = "https://github.com/mdtraj/mdtraj/commit/02d44d4db7039fceb199c85b4f993244804f470d.patch";
hash = "sha256-nhbi3iOrDSM87DyIp1KVt383Vvb6aYOgkjuYzviqiq8=";
})
# remove distutils usage
# https://github.com/mdtraj/mdtraj/pull/1834
(fetchpatch {
name = "python312-compatibility.patch";
url = "https://github.com/mdtraj/mdtraj/commit/95d79747deef42c976ca362a57806b61933409f3.patch";
hash = "sha256-Cq7/d745q6ZgAyWGM4ULnSsWezsbnu1CjSz5eqYSb+g=";
})
# disable intrinsics when SIMD is not available
# TODO: enable SIMD with python3.12
# https://github.com/mdtraj/mdtraj/pull/1884
(fetchpatch {
name = "fix-intrinsics-flag.patch";
url = "https://github.com/mdtraj/mdtraj/commit/d6041c645d51898e2a09030633210213eec7d4c5.patch";
hash = "sha256-kcnlHMoA/exJzV8iQltH+LWXrvSk7gsUV+yWK6xn0jg=";
})
];
nativeBuildInputs = [
build-system = [
cython_0
oldest-supported-numpy
setuptools
@ -54,9 +77,10 @@ buildPythonPackage rec {
llvmPackages.openmp
];
propagatedBuildInputs = [
dependencies = [
astunparse
numpy
packaging
pyparsing
scipy
];
@ -87,7 +111,9 @@ buildPythonPackage rec {
"test_read_atomindices_2"
# flaky test
"test_compare_rdf_t_master"
"test_distances_t"
"test_precentered_2"
];
pythonImportsCheck = [ "mdtraj" ];

View File

@ -12,7 +12,7 @@
buildPythonPackage rec {
pname = "mindsdb-evaluator";
version = "0.0.12";
version = "0.0.13";
pyproject = true;
disabled = pythonOlder "3.8";
@ -21,7 +21,7 @@ buildPythonPackage rec {
src = fetchPypi {
pname = "mindsdb_evaluator";
inherit version;
hash = "sha256-SqcBtoY7WZcorAaoyhqNDscf1MkSz0pE993mz1MRXCU=";
hash = "sha256-SW3GYe9ykbs6ZViScdAgwiBAP9ix4v1VbSm/kJK2jDA=";
};
nativeBuildInputs = [

View File

@ -11,14 +11,14 @@
buildPythonPackage rec {
pname = "neo";
version = "0.13.0";
version = "0.13.1";
pyproject = true;
disabled = pythonOlder "3.7";
src = fetchPypi {
inherit pname version;
hash = "sha256-VnXR+jgaU8LH7ri16SnsA5neILsLUkU+G5nsbWbckfM=";
hash = "sha256-gVhbKLZaTciakucc7TlCxdv9qnG90sw4U3G3ebVlTK0=";
};
nativeBuildInputs = [ setuptools ];

View File

@ -3,7 +3,6 @@
buildPythonPackage,
fetchFromGitHub,
pythonOlder,
pythonAtLeast,
setuptools,
tomli,
pytestCheckHook,
@ -12,17 +11,16 @@
buildPythonPackage rec {
pname = "setuptools-gettext";
version = "0.1.11";
version = "0.1.14";
pyproject = true;
# >=3.12 doesn't work because the package depends on `distutils`
disabled = pythonOlder "3.7" || pythonAtLeast "3.12";
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "breezy-team";
repo = "setuptools-gettext";
rev = "refs/tags/v${version}";
hash = "sha256-yLKn4wwGgRdlsISAT71lD2vkIefsTJRB+OEA030adZY=";
hash = "sha256-05xKWRxmoI8tnRENuiK3Z3WNMyjgXIX5p3vhzSUeytQ=";
};
build-system = [ setuptools ];

View File

@ -25,7 +25,7 @@ let
in
buildPythonPackage rec {
pname = "type-infer";
version = "0.0.19";
version = "0.0.20";
format = "pyproject";
disabled = pythonOlder "3.8";
@ -34,7 +34,7 @@ buildPythonPackage rec {
src = fetchPypi {
pname = "type_infer";
inherit version;
hash = "sha256-7fWRM776lAyOncp6WZDLH9ouVBhVvV23105xvhw8V24=";
hash = "sha256-F+gfA7ofrbMEE5SrVt9H3s2mZKQLyr6roNUmL4EMJbI=";
};
nativeBuildInputs = [

View File

@ -20,7 +20,7 @@ buildPythonPackage rec {
postPatch = ''
substituteInPlace tests/__init__.py \
--replace "'virtualenv'" "'${virtualenv}/bin/virtualenv'" \
--replace "'3.9', '3.10']" "'3.9', '3.10', '3.11']" # if the Python version used isn't in this list, tests fail
--replace "'3.9', '3.10']" "'3.9', '3.10', '3.11', '3.12']" # if the Python version used isn't in this list, tests fail
substituteInPlace tests/test_virtualenv_sys.py \
--replace "'virtualenv'" "'${virtualenv}/bin/virtualenv'"

View File

@ -17,7 +17,7 @@
buildPythonPackage rec {
pname = "weaviate-client";
version = "4.5.7";
version = "4.6.0";
pyproject = true;
disabled = pythonOlder "3.8";
@ -26,7 +26,7 @@ buildPythonPackage rec {
owner = "weaviate";
repo = "weaviate-python-client";
rev = "refs/tags/v${version}";
hash = "sha256-VIGcfAzU/0nrVqhny2Ix6rU0DkDhRvX9UkfK8k412QU=";
hash = "sha256-F4FFG8W8zjEcD1OssioKTik0sy6B/kGITYfW+bqhNkQ=";
};
pythonRelaxDeps = [

View File

@ -5,7 +5,7 @@
callPackage,
crossLibcStdenv,
attributePathToSplice ? [ "freebsd" ],
branch ? "release/13.1.0",
branch ? "release/14.0.0",
}:
let

View File

@ -17,6 +17,7 @@ lib.packagesFromDirectoryRecursive {
}
// {
inherit sourceData patchesRoot versionData;
patches = ./patches/${self.versionData.revision};
# Keep the crawled portion of Nixpkgs finite.
buildFreebsd = lib.dontRecurseIntoAttrs buildFreebsd;
@ -26,7 +27,8 @@ lib.packagesFromDirectoryRecursive {
sha256 = "BpHqJfnGOeTE7tkFJBx0Wk8ryalmf4KNTit/Coh026E=";
};
compatIfNeeded = lib.optional (!stdenvNoCC.hostPlatform.isFreeBSD) self.compat;
compatIsNeeded = !stdenvNoCC.hostPlatform.isFreeBSD;
compatIfNeeded = lib.optional self.compatIsNeeded self.compat;
freebsd-lib = import ./lib {
version = lib.concatStringsSep "." (
map toString (
@ -44,7 +46,7 @@ lib.packagesFromDirectoryRecursive {
compat = self.callPackage ./pkgs/compat/package.nix {
inherit stdenv;
inherit (buildFreebsd) makeMinimal boot-install;
inherit (buildFreebsd) makeMinimal;
};
csu = self.callPackage ./pkgs/csu.nix {
@ -52,13 +54,11 @@ lib.packagesFromDirectoryRecursive {
inherit (self) include;
};
include = self.callPackage ./pkgs/include/package.nix {
inherit (buildFreebsd) makeMinimal install rpcgen;
};
include = self.callPackage ./pkgs/include/package.nix { inherit (buildFreebsd) rpcgen mtree; };
install = self.callPackage ./pkgs/install.nix {
inherit (buildFreebsd) makeMinimal;
inherit (self) mtree libnetbsd;
inherit (self) libmd libnetbsd;
};
libc = self.callPackage ./pkgs/libc/package.nix {
@ -67,16 +67,30 @@ lib.packagesFromDirectoryRecursive {
install
gencat
rpcgen
mkcsmapper
mkesdb
;
inherit (self) csu include;
};
libnetbsd = self.callPackage ./pkgs/libnetbsd/package.nix { inherit (buildFreebsd) makeMinimal; };
libmd = self.callPackage ./pkgs/libmd.nix { inherit (buildFreebsd) makeMinimal; };
mkDerivation = self.callPackage ./pkgs/mkDerivation.nix {
inherit stdenv;
inherit (buildFreebsd) makeMinimal install tsort;
inherit (buildFreebsd)
freebsdSetupHook
makeMinimal
install
tsort
lorder
;
};
makeMinimal = self.callPackage ./pkgs/makeMinimal.nix { inherit (self) make; };
mtree = self.callPackage ./pkgs/mtree.nix { inherit (self) libnetbsd libmd; };
tsort = self.callPackage ./pkgs/tsort.nix { inherit (buildFreebsd) makeMinimal install; };
}

View File

@ -0,0 +1,13 @@
--- a/contrib/mtree/Makefile 2023-12-04 23:02:13.919144141 -0700
+++ b/contrib/mtree/Makefile 2023-12-04 23:02:58.371810109 -0700
@@ -10,8 +10,8 @@
SRCS= compare.c crc.c create.c excludes.c misc.c mtree.c spec.c specspec.c \
verify.c getid.c pack_dev.c only.c
.if (${HOSTPROG:U} == "")
-DPADD+= ${LIBUTIL}
-LDADD+= -lutil
+LIBADD+= ${LIBUTIL}
+#LIBADD+= -lutil
.endif
CPPFLAGS+= -I${NETBSDSRCDIR}/sbin/mknod

View File

@ -0,0 +1,11 @@
--- a/share/mk/src.libnames.mk 2023-12-21 23:56:50.767042385 -0800
+++ b/share/mk/src.libnames.mk 2023-12-21 23:56:39.671089506 -0800
@@ -392,7 +392,7 @@
_DP_ztest= geom m nvpair umem zpool pthread avl zfs_core spl zutil zfs uutil icp
# The libc dependencies are not strictly needed but are defined to make the
# assert happy.
-_DP_c= compiler_rt
+_DP_c=
# Use libssp_nonshared only on i386 and power*. Other archs emit direct calls
# to __stack_chk_fail, not __stack_chk_fail_local provided by libssp_nonshared.
.if ${MK_SSP} != "no" && \

View File

@ -0,0 +1,32 @@
--- a/tools/build/cross-build/include/common/sys/_types.h
+++ b/tools/build/cross-build/include/common/sys/_types.h
@@ -47,3 +47,6 @@
* Neither GLibc nor macOS define __va_list but many FreeBSD headers require it.
*/
typedef __builtin_va_list __va_list;
+
+typedef __UINTPTR_TYPE__ __uintptr_t;
+typedef __INTPTR_TYPE__ __intptr_t;
--- a/tools/build/cross-build/include/common/sys/types.h
+++ b/tools/build/cross-build/include/common/sys/types.h
@@ -49,9 +49,6 @@
#include <sys/sysmacros.h>
#endif
-typedef __UINTPTR_TYPE__ __uintptr_t;
-typedef __INTPTR_TYPE__ __intptr_t;
-
/* needed for gencat */
typedef int __nl_item;
--- a/tools/build/cross-build/include/linux/sys/types.h
+++ b/tools/build/cross-build/include/linux/sys/types.h
@@ -39,6 +39,8 @@
#include_next <sys/types.h>
+#include <sys/_types.h>
+
#ifndef __size_t
typedef __SIZE_TYPE__ __size_t;
#endif

View File

@ -0,0 +1,40 @@
diff --git a/tools/build/Makefile b/tools/build/Makefile
index 948a5f9dfdb..592af84eeae 100644
--- a/tools/build/Makefile
+++ b/tools/build/Makefile
@@ -327,14 +327,14 @@ host-symlinks:
# and cross-tools stages. We do this here using mkdir since mtree may not exist
# yet (this happens if we are crossbuilding from Linux/Mac).
INSTALLDIR_LIST= \
- bin \
- lib/geom \
- usr/include/casper \
- usr/include/private/ucl \
- usr/include/private/zstd \
- usr/lib \
- usr/libdata/pkgconfig \
- usr/libexec
+ ${BINDIR} \
+ ${LIBDIR}/geom \
+ ${INCLUDEDIR}/casper \
+ ${INCLUDEDIR}/private/ucl \
+ ${INCLUDEDIR}/private/zstd \
+ ${LIBDIR} \
+ ${LIBDIR}/libdata/pkgconfig \
+ ${LIBEXECDIR}
installdirs:
mkdir -p ${INSTALLDIR_LIST:S,^,${DESTDIR}/,}
@@ -352,9 +352,9 @@ installdirs:
rm -rf "${DESTDIR}/${_dir}"; \
fi
.endfor
- ln -sfn bin ${DESTDIR}/sbin
- ln -sfn ../bin ${DESTDIR}/usr/bin
- ln -sfn ../bin ${DESTDIR}/usr/sbin
+ ln -sfn bin ${DESTDIR}/${SBINDIR}
+ ln -sfn ../bin ${DESTDIR}/${BINDIR}
+ ln -sfn ../bin ${DESTDIR}/${SBINDIR}
.for _group in ${INCSGROUPS:NINCS}
mkdir -p "${DESTDIR}/${${_group}DIR}"
.endfor

View File

@ -0,0 +1,11 @@
--- a/usr.bin/xinstall/Makefile 2023-09-23 19:18:49.165192183 -0700
+++ b/usr.bin/xinstall/Makefile 2023-12-06 17:06:57.836888028 -0700
@@ -14,7 +14,7 @@
CFLAGS+= -I${SRCTOP}/lib/libnetbsd
LIBADD= md
-CFLAGS+= -DWITH_MD5 -DWITH_RIPEMD160
+CFLAGS+= -I${BSDSRCDIR}/contrib/libc-vis -I${BSDSRCDIR}/lib/libnetbsd
.ifdef BOOTSTRAPPING
# For the bootstrap we disable copy_file_range()

View File

@ -0,0 +1,11 @@
--- a/lib/libc/Makefile
+++ b/lib/libc/Makefile
@@ -194,7 +194,7 @@ SUBDIR.${MK_TESTS}+= tests
# recording a build dependency
CFLAGS+= -I${SRCTOP}/lib/libutil
# Same issue with libm
-MSUN_ARCH_SUBDIR != ${MAKE} -B -C ${SRCTOP}/lib/msun -V ARCH_SUBDIR
+MSUN_ARCH_SUBDIR = ${MACHINE_CPUARCH:S/i386/i387/}
# unfortunately msun/src contains both private and public headers
CFLAGS+= -I${SRCTOP}/lib/msun/${MSUN_ARCH_SUBDIR}
.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"

View File

@ -0,0 +1,10 @@
--- a/lib/libc/Makefile
+++ b/lib/libc/Makefile
@@ -58,7 +58,6 @@ CFLAGS+=${CANCELPOINTS_CFLAGS}
# Link with static libcompiler_rt.a.
#
LDFLAGS+= -nodefaultlibs
-LIBADD+= compiler_rt
.if ${MK_SSP} != "no" && \
(${LIBC_ARCH} == "i386" || ${MACHINE_ARCH:Mpower*} != "")

View File

@ -0,0 +1,32 @@
diff --git a/Makefile b/Makefile
index 22710f3d933..22effc848cf 100644
--- a/lib/libnetbsd/Makefile
+++ b/lib/libnetbsd/Makefile
@@ -9,6 +9,26 @@ CFLAGS+= -I${.CURDIR}
SRCS+= efun.c sockaddr_snprintf.c strsuftoll.c util.c util.h
-INTERNALLIB=
+INCSGROUPS= INCS SYSINCS NETINETINCS
+
+INCS+= \
+ glob.h \
+ pthread.h \
+ rmd160.h \
+ sha1.h \
+ sha2.h \
+ stdlib.h \
+ util.h
+
+SYSINCSDIR= ${INCLUDEDIR}/sys
+SYSINCS+= \
+ sys/cdefs.h \
+ sys/event.h \
+ sys/types.h \
+ sys/wait.h
+
+NETINETINCSDIR= ${INCLUDEDIR}/netinet
+NETINETINCS+= \
+ netinet/in.h
.include <bsd.lib.mk>

View File

@ -0,0 +1,11 @@
--- a/lib/librpcsvc/Makefile
+++ b/lib/librpcsvc/Makefile
@@ -20,7 +20,7 @@ OTHERSRCS+= yp_passwd.c yp_update.c
RPCCOM= RPCGEN_CPP=${CPP:Q} rpcgen -C
-INCDIRS= -I${SYSROOT:U${DESTDIR}}/usr/include/rpcsvc
+INCDIRS= -I${INCLUDEDIR}/rpcsvc
CFLAGS+= -DYP ${INCDIRS}

View File

@ -0,0 +1,13 @@
--- a/contrib/mtree/Makefile 2023-12-04 23:02:13.919144141 -0700
+++ b/contrib/mtree/Makefile 2023-12-04 23:02:58.371810109 -0700
@@ -10,8 +10,8 @@
SRCS= compare.c crc.c create.c excludes.c misc.c mtree.c spec.c specspec.c \
verify.c getid.c pack_dev.c only.c
.if (${HOSTPROG:U} == "")
-DPADD+= ${LIBUTIL}
-LDADD+= -lutil
+LIBADD+= ${LIBUTIL}
+#LIBADD+= -lutil
.endif
CPPFLAGS+= -I${NETBSDSRCDIR}/sbin/mknod

View File

@ -0,0 +1,11 @@
--- a/etc/mtree/BSD.include.dist
+++ b/etc/mtree/BSD.include.dist
@@ -3,7 +3,7 @@
# Please see the file src/etc/mtree/README before making changes to this file.
#
-/set type=dir uname=root gname=wheel mode=0755
+/set type=dir
.
arpa
..

View File

@ -0,0 +1,10 @@
--- a/libexec/rtld-elf/Makefile
+++ b/libexec/rtld-elf/Makefile
@@ -86,7 +86,6 @@
# Some of the required math functions (div & mod) are implemented in
# libcompiler_rt on some architectures.
-LIBADD+= compiler_rt
.include <bsd.prog.mk>
${PROG_FULL}: ${VERSION_MAP}

View File

@ -0,0 +1,13 @@
diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh
index c594724d814..d5287c7b992 100644
--- a/sys/conf/newvers.sh
+++ b/sys/conf/newvers.sh
@@ -177,7 +177,7 @@ u=${USER:-root}
d=$(pwd)
h=${HOSTNAME:-$(hostname)}
if [ -n "$SOURCE_DATE_EPOCH" ]; then
- if ! t=$(date -r $SOURCE_DATE_EPOCH 2>/dev/null); then
+ if ! t=$(date -d @$SOURCE_DATE_EPOCH 2>/dev/null); then
echo "Invalid SOURCE_DATE_EPOCH" >&2
exit 1
fi

View File

@ -0,0 +1,42 @@
--- a/sys/modules/aesni/Makefile 2023-12-16 09:19:28.454892154 -0700
+++ b/sys/Modules/aesni/Makefile 2023-12-16 09:19:41.975047684 -0700
@@ -1,6 +1,5 @@
.PATH: ${SRCTOP}/sys/crypto/aesni
-.PATH: ${SRCTOP}/contrib/llvm-project/clang/lib/Headers
KMOD= aesni
SRCS= aesni.c
@@ -39,8 +38,8 @@
aesni_ghash.o: aesni.h
aesni_wrap.o: aesni.h
aesni_ccm.o: aesni.h
-intel_sha1.o: sha_sse.h immintrin.h shaintrin.h tmmintrin.h xmmintrin.h
-intel_sha256.o: sha_sse.h immintrin.h shaintrin.h tmmintrin.h xmmintrin.h
+intel_sha1.o: sha_sse.h
+intel_sha256.o: sha_sse.h
.include <bsd.kmod.mk>
diff --git a/sys/modules/blake2/Makefile b/sys/modules/blake2/Makefile
index e4b3fb9f126..5bfd9c2ae02 100644
--- a/sys/modules/blake2/Makefile
+++ b/sys/modules/blake2/Makefile
@@ -3,7 +3,6 @@
.PATH: ${SRCTOP}/sys/contrib/libb2
.PATH: ${SRCTOP}/sys/crypto/blake2
.PATH: ${SRCTOP}/sys/opencrypto
-.PATH: ${SRCTOP}/contrib/llvm-project/clang/lib/Headers
KMOD = blake2
@@ -64,8 +63,7 @@ ${src:S/.c/.o/}: ${src}
-D_MM_MALLOC_H_INCLUDED -Wno-unused-function ${.IMPSRC}
${CTFCONVERT_CMD}
-${src:S/.c/.o/}: intrin.h emmintrin.h tmmintrin.h smmintrin.h immintrin.h \
- x86intrin.h ${SRCS:M*.h}
+${src:S/.c/.o/}: ${SRCS:M*.h}
.endfor
# FreeBSD-specific sources:

View File

@ -2,7 +2,7 @@
lib,
stdenv,
mkDerivation,
patchesRoot,
versionData,
bsdSetupHook,
freebsdSetupHook,
makeMinimal,
@ -17,7 +17,7 @@ let
inherit (freebsd-lib) mkBsdArch;
in
mkDerivation rec {
mkDerivation {
pname = "compat";
path = "tools/build";
extraPaths =
@ -40,6 +40,9 @@ mkDerivation rec {
# Take only individual headers, or else we will clobber native libc, etc.
"sys/rpc/types.h"
]
++ lib.optionals (versionData.major == 14) [ "sys/sys/bitcount.h" ]
++ [
# Listed in Makekfile as INC
"include/mpool.h"
@ -53,6 +56,13 @@ mkDerivation rec {
"include/nl_types.h"
"include/elf.h"
"sys/sys/ctf.h"
]
++ lib.optionals (versionData.major == 14) [
"include/bitstring.h"
"sys/sys/bitstring.h"
"sys/sys/nv_namespace.h"
]
++ [
# Listed in Makekfile as SYSINC
@ -80,6 +90,12 @@ mkDerivation rec {
"sys/sys/font.h"
"sys/sys/consio.h"
"sys/sys/fnv_hash.h"
#"sys/sys/cdefs.h"
#"sys/sys/param.h"
"sys/sys/_null.h"
#"sys/sys/types.h"
"sys/sys/_pthreadtypes.h"
"sys/sys/_stdint.h"
"sys/crypto/chacha20/_chacha.h"
"sys/crypto/chacha20/chacha.h"
@ -92,12 +108,11 @@ mkDerivation rec {
"lib/libcapsicum"
"lib/libcasper"
];
"lib/libmd"
patches = [
/${patchesRoot}/compat-install-dirs.patch
/${patchesRoot}/compat-fix-typedefs-locations.patch
];
# idk bro
"sys/sys/kbio.h"
];
preBuild =
''
@ -151,4 +166,9 @@ mkDerivation rec {
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
cp --no-preserve=mode -r cross-build/include/darwin/* $out/1-include
'';
# Compat is for making other platforms look like FreeBSD (e.g. to
# build build-time dependencies for building FreeBSD packages). It is
# not needed when building for FreeBSD.
meta.broken = stdenv.hostPlatform.isFreeBSD;
}

View File

@ -12,6 +12,7 @@
}:
mkDerivation {
isStatic = true;
path = "lib/csu";
extraPaths = [
"lib/Makefile.inc"

View File

@ -1,15 +1,7 @@
{
lib,
stdenv,
mkDerivation,
bsdSetupHook,
freebsdSetupHook,
makeMinimal,
install,
mandoc,
groff,
compatIfNeeded,
libelf,
libdwarf,
zlib,
libspl,
@ -26,21 +18,18 @@ mkDerivation {
];
OPENSOLARIS_USR_DISTDIR = "$(SRCTOP)/cddl/contrib/opensolaris";
OPENSOLARIS_SYS_DISTDIR = "$(SRCTOP)/sys/cddl/contrib/opensolaris";
nativeBuildInputs = [
bsdSetupHook
freebsdSetupHook
makeMinimal
install
mandoc
groff
# flex byacc file2c
makeFlags = [
"STRIP=-s"
"MK_WERROR=no"
"MK_TESTS=no"
];
buildInputs = compatIfNeeded ++ [
libelf
libdwarf
zlib
libspl
];
meta.license = lib.licenses.cddl;
}

View File

@ -0,0 +1,23 @@
{
lib,
pkgsBuildBuild,
runCommand,
writeText,
source,
}:
{
pname,
path,
extraPaths ? [ ],
}:
let
sortedPaths = lib.naturalSort ([ path ] ++ extraPaths);
filterText = writeText "${pname}-src-include" (
lib.concatMapStringsSep "\n" (path: "/${path}") sortedPaths
);
in
runCommand "${pname}-filtered-src" { nativeBuildInputs = [ pkgsBuildBuild.rsync ]; } ''
rsync -a -r --files-from=${filterText} ${source}/ $out
''

View File

@ -5,7 +5,18 @@ setFreeBSDSrcTop() {
addFreeBSDMakeFlags() {
makeFlags="SBINDIR=${!outputBin}/bin $makeFlags"
makeFlags="LIBEXECDIR=${!outputLib}/libexec $makeFlags"
makeFlags="LIBDATADIR=${!outputLib}/data $makeFlags"
makeFlags="INCLUDEDIR=${!outputDev}/include $makeFlags"
makeFlags="CONFDIR=${!outputBin}/etc $makeFlags"
makeFlags="MANDIR=${!outputMan}/share/man/man $makeFlags"
if [ -n "$debug" ]; then
makeFlags="DEBUGFILEDIR=${debug}/lib/debug $makeFlags"
else
makeFlags="DEBUGFILEDIR=${out}/lib/debug $makeFlags"
fi
echo $makeFlags
}
postUnpackHooks+=(setFreeBSDSrcTop)

View File

@ -1,19 +1,13 @@
{
lib,
mkDerivation,
patchesRoot,
buildPackages,
bsdSetupHook,
freebsdSetupHook,
makeMinimal,
install,
mandoc,
groff,
rsync, # , nbperf
rpcgen,
mtree,
}:
mkDerivation {
isStatic = true;
path = "include";
extraPaths = [
@ -22,22 +16,11 @@ mkDerivation {
"sys"
];
nativeBuildInputs = [
bsdSetupHook
freebsdSetupHook
makeMinimal
install
mandoc
groff
rsync # nbperf
extraNativeBuildInputs = [
rpcgen
# HACK use NetBSD's for now
buildPackages.netbsd.mtree
mtree
];
patches = [ /${patchesRoot}/no-perms-BSD.include.dist.patch ];
# The makefiles define INCSDIR per subdirectory, so we have to set
# something else on the command line so those definitions aren't
# overridden.
@ -46,6 +29,7 @@ mkDerivation {
sed -i -E \
-e 's_/usr/include_''${INCSDIR0}_' \
{} \;
sed -E -i -e "/_PATH_LOGIN/d" $BSDSRCDIR/include/paths.h
'';
makeFlags = [ "RPCGEN_CPP=${buildPackages.stdenv.cc.cc}/bin/cpp" ];

View File

@ -4,7 +4,6 @@
mkDerivation,
writeShellScript,
freebsd-lib,
mtree,
bsdSetupHook,
freebsdSetupHook,
makeMinimal,
@ -30,7 +29,7 @@ let
in
mkDerivation {
path = "usr.bin/xinstall";
extraPaths = [ mtree.path ];
extraPaths = [ "contrib/mtree" ];
nativeBuildInputs = [
bsdSetupHook
freebsdSetupHook
@ -44,13 +43,18 @@ mkDerivation {
libmd
libnetbsd
];
makeFlags = [
"STRIP=-s" # flag to install, not command
"MK_WERROR=no"
"TESTSDIR=${builtins.placeholder "test"}"
] ++ lib.optional (stdenv.hostPlatform == stdenv.buildPlatform) "INSTALL=boot-install";
makeFlags =
[
"STRIP=-s" # flag to install, not command
"MK_WERROR=no"
"TESTSDIR=${builtins.placeholder "test"}"
]
++ lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform) [
"BOOTSTRAPPING=1"
"INSTALL=boot-install"
];
postInstall = ''
install -D -m 0550 ${binstall} $out/bin/binstall
install -C -m 0550 ${binstall} $out/bin/binstall
substituteInPlace $out/bin/binstall --subst-var out
mv $out/bin/install $out/bin/xinstall
ln -s ./binstall $out/bin/install

View File

@ -1,8 +1,8 @@
{
lib,
buildPackages,
stdenv,
mkDerivation,
patchesRoot,
bsdSetupHook,
freebsdSetupHook,
@ -12,62 +12,108 @@
byacc,
gencat,
rpcgen,
mkcsmapper,
mkesdb,
csu,
include,
versionData,
}:
mkDerivation rec {
mkDerivation {
isStatic = true;
pname = "libc";
path = "lib/libc";
extraPaths = [
"etc/group"
"etc/master.passwd"
"etc/shells"
"lib/libmd"
"lib/libutil"
"lib/msun"
"sys/kern"
"sys/libkern"
"sys/sys"
"sys/crypto/chacha20"
"include/rpcsvc"
"contrib/jemalloc"
"contrib/gdtoa"
"contrib/libc-pwcache"
"contrib/libc-vis"
"contrib/tzcode/stdtime"
extraPaths =
[
"lib/libc_nonshared"
"etc/group"
"etc/master.passwd"
"etc/shells"
"lib/libmd"
"lib/libutil"
"lib/msun"
"sys/kern"
"sys/libkern"
"sys/sys"
"sys/crypto/chacha20"
"include/rpcsvc"
"contrib/jemalloc"
"contrib/gdtoa"
"contrib/libc-pwcache"
"contrib/libc-vis"
]
++ lib.optionals (versionData.major == 13) [ "contrib/tzcode/stdtime" ]
++ lib.optionals (versionData.major == 14) [ "contrib/tzcode" ]
++ [
# libthr
"lib/libthr"
"lib/libthread_db"
"libexec/rtld-elf"
# libthr
"lib/libthr"
"lib/libthread_db"
"libexec/rtld-elf"
"lib/csu/common/crtbrand.S"
"lib/csu/common/notes.h"
# librpcsvc
"lib/librpcsvc"
# librpcsvc
"lib/librpcsvc"
# librt
"lib/librt"
# librt
"lib/librt"
# libcrypt
"lib/libcrypt"
"lib/libmd"
"sys/crypto/sha2"
];
# libcrypt
"lib/libcrypt"
"lib/libmd"
"sys/crypto/sha2"
"sys/crypto/skein"
patches = [
# Hack around broken propogating MAKEFLAGS to submake, just inline logic
/${patchesRoot}/libc-msun-arch-subdir.patch
# libgcc and friends
"lib/libgcc_eh"
"lib/libgcc_s"
"lib/libcompiler_rt"
"contrib/llvm-project/libunwind"
"contrib/llvm-project/compiler-rt"
#"contrib/llvm-project/libcxx"
# Don't force -lcompiler-rt, we don't actually call it that
/${patchesRoot}/libc-no-force--lcompiler-rt.patch
# terminfo
"lib/ncurses"
"contrib/ncurses"
"lib/Makefile.inc"
]
++ lib.optionals (stdenv.hostPlatform.isx86_32) [ "lib/libssp_nonshared" ]
++ [
"lib/libexecinfo"
"contrib/libexecinfo"
# Fix extra include dir to get rpcsvc headers.
/${patchesRoot}/librpcsvc-include-subdir.patch
];
"lib/libkvm"
"sys" # ummmmmmmmmm libkvm wants arch-specific headers from the kernel tree
"lib/libmemstat"
"lib/libprocstat"
"sys/contrib/openzfs"
"sys/contrib/pcg-c"
"sys/opencrypto"
"sys/contrib/ck"
"sys/crypto"
"lib/libdevstat"
"lib/libelf"
"contrib/elftoolchain"
"lib/libiconv_modules"
"share/i18n"
"include/paths.h"
"lib/libdl"
];
postPatch = ''
substituteInPlace $COMPONENT_PATH/Makefile --replace '.include <src.opts.mk>' ""
substituteInPlace $BSDSRCDIR/include/paths.h \
--replace '/usr/lib/i18n' '${builtins.placeholder "out"}/lib/i18n' \
--replace '/usr/share/i18n' '${builtins.placeholder "out"}/share/i18n'
'';
nativeBuildInputs = [
@ -80,16 +126,20 @@ mkDerivation rec {
byacc
gencat
rpcgen
mkcsmapper
mkesdb
];
buildInputs = [
include
csu
];
env.NIX_CFLAGS_COMPILE = "-B${csu}/lib";
# Suppress lld >= 16 undefined version errors
# https://github.com/freebsd/freebsd-src/commit/2ba84b4bcdd6012e8cfbf8a0d060a4438623a638
env.NIX_LDFLAGS = lib.optionalString (stdenv.targetPlatform.linker == "lld") "--undefined-version";
env.NIX_CFLAGS_COMPILE = toString [
"-B${csu}/lib"
# These are supposed to have _RTLD_COMPAT_LIB_SUFFIX so we can get things like "lib32"
# but that's unnecessary
"-DSTANDARD_LIBRARY_PATH=\"${builtins.placeholder "out"}/lib\""
"-D_PATH_RTLD=\"${builtins.placeholder "out"}/libexec/ld-elf.so.1\""
];
makeFlags = [
"STRIP=-s" # flag to install, not command
@ -100,7 +150,7 @@ mkDerivation rec {
MK_SYMVER = "yes";
MK_SSP = "yes";
MK_NLS = "yes";
MK_ICONV = "no"; # TODO make srctop
MK_ICONV = "yes";
MK_NS_CACHING = "yes";
MK_INET6_SUPPORT = "yes";
MK_HESIOD = "yes";
@ -112,44 +162,125 @@ mkDerivation rec {
MK_MALLOC_PRODUCTION = "yes";
MK_TESTS = "no";
MACHINE_ABI = "";
MK_DETECT_TZ_CHANGES = "no";
MK_MACHDEP_OPTIMIZATIONS = "yes";
MK_ASAN = "no";
MK_UBSAN = "no";
postInstall = ''
pushd ${include}
find . -type d -exec mkdir -p $out/\{} \;
find . \( -type f -o -type l \) -exec cp -pr \{} $out/\{} \;
popd
NO_FSCHG = "yes";
pushd ${csu}
find . -type d -exec mkdir -p $out/\{} \;
find . \( -type f -o -type l \) -exec cp -pr \{} $out/\{} \;
popd
preBuild = lib.optionalString (stdenv.hostPlatform.isx86_32) ''
make -C $BSDSRCDIR/lib/libssp_nonshared $makeFlags
make -C $BSDSRCDIR/lib/libssp_nonshared $makeFlags install
'';
sed -i -e 's| [^ ]*/libc_nonshared.a||' $out/lib/libc.so
postInstall =
''
pushd ${include}
find . -type d -exec mkdir -p $out/\{} \;
find . \( -type f -o -type l \) -exec cp -pr \{} $out/\{} \;
popd
$CC -nodefaultlibs -lgcc -shared -o $out/lib/libgcc_s.so
pushd ${csu}
find . -type d -exec mkdir -p $out/\{} \;
find . \( -type f -o -type l \) -exec cp -pr \{} $out/\{} \;
popd
NIX_CFLAGS_COMPILE+=" -B$out/lib"
NIX_CFLAGS_COMPILE+=" -I$out/include"
NIX_LDFLAGS+=" -L$out/lib"
mkdir $BSDSRCDIR/lib/libcompiler_rt/i386
make -C $BSDSRCDIR/lib/libcompiler_rt $makeFlags
make -C $BSDSRCDIR/lib/libcompiler_rt $makeFlags install
make -C $BSDSRCDIR/lib/libthr $makeFlags
make -C $BSDSRCDIR/lib/libthr $makeFlags install
make -C $BSDSRCDIR/lib/libgcc_eh $makeFlags
make -C $BSDSRCDIR/lib/libgcc_eh $makeFlags install
make -C $BSDSRCDIR/lib/msun $makeFlags
make -C $BSDSRCDIR/lib/msun $makeFlags install
ln -s $BSDSRCDIR/lib/libc/libc.so.7 $BSDSRCDIR/lib/libc/libc.so # not sure
mkdir $BSDSRCDIR/lib/libgcc_s/i386
make -C $BSDSRCDIR/lib/libgcc_s $makeFlags
make -C $BSDSRCDIR/lib/libgcc_s $makeFlags install
make -C $BSDSRCDIR/lib/librpcsvc $makeFlags
make -C $BSDSRCDIR/lib/librpcsvc $makeFlags install
NIX_CFLAGS_COMPILE+=" -B$out/lib"
NIX_CFLAGS_COMPILE+=" -I$out/include"
NIX_LDFLAGS+=" -L$out/lib"
make -C $BSDSRCDIR/lib/libutil $makeFlags
make -C $BSDSRCDIR/lib/libutil $makeFlags install
make -C $BSDSRCDIR/lib/libc_nonshared $makeFlags
make -C $BSDSRCDIR/lib/libc_nonshared $makeFlags install
make -C $BSDSRCDIR/lib/librt $makeFlags
make -C $BSDSRCDIR/lib/librt $makeFlags install
mkdir $BSDSRCDIR/lib/libmd/sys
make -C $BSDSRCDIR/lib/libmd $makeFlags
make -C $BSDSRCDIR/lib/libmd $makeFlags install
make -C $BSDSRCDIR/lib/libcrypt $makeFlags
make -C $BSDSRCDIR/lib/libcrypt $makeFlags install
make -C $BSDSRCDIR/lib/libthr $makeFlags
make -C $BSDSRCDIR/lib/libthr $makeFlags install
make -C $BSDSRCDIR/lib/msun $makeFlags
make -C $BSDSRCDIR/lib/msun $makeFlags install
make -C $BSDSRCDIR/lib/librpcsvc $makeFlags
make -C $BSDSRCDIR/lib/librpcsvc $makeFlags install
make -C $BSDSRCDIR/lib/libutil $makeFlags
make -C $BSDSRCDIR/lib/libutil $makeFlags install
make -C $BSDSRCDIR/lib/librt $makeFlags
make -C $BSDSRCDIR/lib/librt $makeFlags install
make -C $BSDSRCDIR/lib/libcrypt $makeFlags
make -C $BSDSRCDIR/lib/libcrypt $makeFlags install
make -C $BSDSRCDIR/lib/libelf $makeFlags
make -C $BSDSRCDIR/lib/libelf $makeFlags install
make -C $BSDSRCDIR/lib/libexecinfo $makeFlags
make -C $BSDSRCDIR/lib/libexecinfo $makeFlags install
make -C $BSDSRCDIR/lib/libkvm $makeFlags
make -C $BSDSRCDIR/lib/libkvm $makeFlags install
make -C $BSDSRCDIR/lib/libmemstat $makeFlags
make -C $BSDSRCDIR/lib/libmemstat $makeFlags install
make -C $BSDSRCDIR/lib/libprocstat $makeFlags
make -C $BSDSRCDIR/lib/libprocstat $makeFlags install
make -C $BSDSRCDIR/lib/libdevstat $makeFlags
make -C $BSDSRCDIR/lib/libdevstat $makeFlags install
make -C $BSDSRCDIR/lib/libiconv_modules $makeFlags
make -C $BSDSRCDIR/lib/libiconv_modules $makeFlags SHLIBDIR=${builtins.placeholder "out"}/lib/i18n install
make -C $BSDSRCDIR/lib/libdl $makeFlags
make -C $BSDSRCDIR/lib/libdl $makeFlags install
make -C $BSDSRCDIR/share/i18n $makeFlags
make -C $BSDSRCDIR/share/i18n $makeFlags ESDBDIR=${builtins.placeholder "out"}/share/i18n/esdb CSMAPPERDIR=${builtins.placeholder "out"}/share/i18n/csmapper install
''
+ lib.optionalString stdenv.hostPlatform.isx86_32 ''
$CC -c $BSDSRCDIR/contrib/llvm-project/compiler-rt/lib/builtins/udivdi3.c -o $BSDSRCDIR/contrib/llvm-project/compiler-rt/lib/builtins/udivdi3.o
ORIG_NIX_LDFLAGS="$NIX_LDFLAGS"
NIX_LDFLAGS+=" $BSDSRCDIR/contrib/llvm-project/compiler-rt/lib/builtins/udivdi3.o"
''
+ ''
make -C $BSDSRCDIR/libexec/rtld-elf $makeFlags
make -C $BSDSRCDIR/libexec/rtld-elf $makeFlags install
rm -f $out/libexec/ld-elf.so.1
mv $out/bin/ld-elf.so.1 $out/libexec
'';
# libc should not be allowed to refer to anything other than itself
postFixup = ''
find $out -type f | xargs -n1 ${buildPackages.patchelf}/bin/patchelf --shrink-rpath --allowed-rpath-prefixes $out || true
'';
meta.platforms = lib.platforms.freebsd;
# definitely a bad idea to enable stack protection on the stack protection initializers
hardeningDisable = [ "stackprotector" ];
outputs = [
"out"
"man"
"debug"
];
}

View File

@ -1,16 +1,8 @@
{
lib,
stdenv,
mkDerivation,
bsdSetupHook,
freebsdSetupHook,
makeMinimal,
install,
mandoc,
groff,
m4,
compatIfNeeded,
libelf,
zlib,
}:
mkDerivation {
@ -22,16 +14,7 @@ mkDerivation {
"sys/sys/elf64.h"
"sys/sys/elf_common.h"
];
nativeBuildInputs = [
bsdSetupHook
freebsdSetupHook
makeMinimal
install
mandoc
groff
m4
];
buildInputs = compatIfNeeded ++ [ libelf ];
extraNativeBuildInputs = [ m4 ];
buildInputs = compatIfNeeded ++ [ zlib ];
MK_TESTS = "no";
}

View File

@ -1,35 +0,0 @@
{
lib,
stdenv,
mkDerivation,
bsdSetupHook,
freebsdSetupHook,
makeMinimal,
install,
mandoc,
groff,
m4,
}:
mkDerivation {
path = "lib/libelf";
extraPaths = [
"contrib/elftoolchain/libelf"
"contrib/elftoolchain/common"
"sys/sys/elf32.h"
"sys/sys/elf64.h"
"sys/sys/elf_common.h"
];
BOOTSTRAPPING = !stdenv.isFreeBSD;
nativeBuildInputs = [
bsdSetupHook
freebsdSetupHook
makeMinimal
install
mandoc
groff
m4
];
MK_TESTS = "no";
}

View File

@ -0,0 +1,49 @@
{
lib,
stdenv,
mkDerivation,
freebsdSetupHook,
bsdSetupHook,
makeMinimal,
}:
mkDerivation {
path = "lib/libmd";
extraPaths = [
"sys/sys/md5.h"
"sys/crypto/sha2"
"sys/crypto/skein"
];
nativeBuildInputs = [
makeMinimal
bsdSetupHook
freebsdSetupHook
];
makeFlags = [
"STRIP=-s" # flag to install, not command
"RELDIR=."
] ++ lib.optional (!stdenv.hostPlatform.isFreeBSD) "MK_WERROR=no";
preBuild = ''
mkdir sys
'';
installPhase = ''
# libmd is used by install. do it yourself!
mkdir -p $out/include $out/lib $man/share/man
cp libmd.a $out/lib/libmd.a
for f in $(make $makeFlags -V INCS); do
if [ -e "$f" ]; then cp "$f" "$out/include/$f"; fi
if [ -e "$BSDSRCDIR/sys/crypto/sha2/$f" ]; then cp "$BSDSRCDIR/sys/crypto/sha2/$f" "$out/include/$f"; fi
if [ -e "$BSDSRCDIR/sys/crypto/skein/$f" ]; then cp "$BSDSRCDIR/sys/crypto/skein/$f" "$out/include/$f"; fi
done
for f in $(make $makeFlags -V MAN); do
cp "$f" "$man/share/man/$f"
done
'';
outputs = [
"out"
"man"
];
}

View File

@ -2,7 +2,6 @@
lib,
stdenv,
mkDerivation,
patchesRoot,
bsdSetupHook,
freebsdSetupHook,
makeMinimal,
@ -10,7 +9,6 @@
groff,
boot-install,
install,
compatIfNeeded,
}:
mkDerivation {
@ -23,13 +21,8 @@ mkDerivation {
groff
(if stdenv.hostPlatform == stdenv.buildPlatform then boot-install else install)
];
patches = lib.optionals (!stdenv.hostPlatform.isFreeBSD) [
/${patchesRoot}/libnetbsd-do-install.patch
#/${patchesRoot}/libnetbsd-define-__va_list.patch
];
makeFlags = [
"STRIP=-s" # flag to install, not command
"MK_WERROR=no"
] ++ lib.optional (stdenv.hostPlatform == stdenv.buildPlatform) "INSTALL=boot-install";
buildInputs = compatIfNeeded;
}

View File

@ -3,19 +3,20 @@
mkDerivation {
path = "cddl/lib/libspl";
extraPaths = [
"sys/contrib/openzfs/lib/libspl"
"sys/contrib/openzfs/include"
"cddl/compat/opensolaris/include"
"sys/contrib/openzfs/include"
"sys/contrib/openzfs/lib/libspl"
"sys/contrib/openzfs/module/icp/include"
"sys/modules/zfs"
"sys/modules/zfs/zfs_config.h"
];
# nativeBuildInputs = [
# bsdSetupHook freebsdSetupHook
# makeMinimal install mandoc groff
# flex byacc file2c
# ];
# buildInputs = compatIfNeeded ++ [ libnv libsbuf ];
meta.license = lib.licenses.cddl;
# Without a prefix it will try to put object files in nonexistant directories
preBuild = ''
export MAKEOBJDIRPREFIX=$TMP/obj
'';
meta = with lib; {
platform = platforms.freebsd;
license = licenses.cddl;
};
}

View File

@ -6,6 +6,5 @@
mkDerivation {
path = "lib/libutil";
extraPaths = [ "lib/libc/gen" ];
clangFixup = true;
MK_TESTS = "no";
}

View File

@ -3,8 +3,7 @@
bsdSetupHook,
freebsdSetupHook,
}:
mkDerivation rec {
mkDerivation {
path = "usr.bin/lorder";
noCC = true;
dontBuild = true;

View File

@ -7,7 +7,7 @@
freebsdSetupHook,
}:
mkDerivation rec {
mkDerivation {
inherit (make) path;
buildInputs = [ ];
@ -25,6 +25,8 @@ mkDerivation rec {
${make.postPatch}
'';
configureFlags = [ "--with-filemon=no" ];
buildPhase = ''
runHook preBuild

View File

@ -2,11 +2,12 @@
lib,
stdenv,
stdenvNoCC,
versionData,
writeText,
patches,
compatIfNeeded,
runCommand,
rsync,
freebsd-lib,
source,
filterSource,
bsdSetupHook,
freebsdSetupHook,
makeMinimal,
@ -24,21 +25,13 @@ lib.makeOverridable (
in
stdenv'.mkDerivation (
rec {
pname = "${attrs.pname or (baseNameOf attrs.path)}-freebsd";
inherit (freebsd-lib) version;
src = runCommand "${pname}-filtered-src" { nativeBuildInputs = [ rsync ]; } ''
for p in ${lib.concatStringsSep " " ([ attrs.path ] ++ attrs.extraPaths or [ ])}; do
set -x
path="$out/$p"
mkdir -p "$(dirname "$path")"
src_path="${source}/$p"
if [[ -d "$src_path" ]]; then src_path+=/; fi
rsync --chmod="+w" -r "$src_path" "$path"
set +x
done
'';
extraPaths = [ ];
pname = "${attrs.pname or (baseNameOf attrs.path)}";
src = filterSource {
inherit pname;
inherit (attrs) path;
extraPaths = attrs.extraPaths or [ ];
};
nativeBuildInputs = [
bsdSetupHook
@ -48,8 +41,8 @@ lib.makeOverridable (
tsort
lorder
mandoc
groff # statHook
];
groff
] ++ attrs.extraNativeBuildInputs or [ ];
buildInputs = compatIfNeeded;
HOST_SH = stdenv'.shell;
@ -72,11 +65,17 @@ lib.makeOverridable (
strictDeps = true;
meta = with lib; {
maintainers = with maintainers; [ ericson2314 ];
platforms = platforms.unix;
license = licenses.bsd2;
};
meta =
with lib;
{
maintainers = with maintainers; [
rhelmot
artemist
];
platforms = platforms.unix;
license = licenses.bsd2;
}
// attrs.meta or { };
}
// lib.optionalAttrs stdenv'.hasCC {
# TODO should CC wrapper set this?
@ -95,5 +94,71 @@ lib.makeOverridable (
dontBuild = true;
}
// attrs
// lib.optionalAttrs (stdenv'.hasCC && stdenv'.cc.isClang or false && attrs.clangFixup or true) {
preBuild =
''
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -D_VA_LIST -D_VA_LIST_DECLARED -Dva_list=__builtin_va_list -D_SIZE_T_DECLARED -D_SIZE_T -Dsize_t=__SIZE_TYPE__ -D_WCHAR_T"
''
+ lib.optionalString (versionData.major == 13) ''
export NIX_LDFLAGS="$NIX_LDFLAGS --undefined-version"
''
+ (attrs.preBuild or "");
}
// {
patches =
let
isDir =
file:
let
base = baseNameOf file;
type = (builtins.readDir (dirOf file)).${base} or null;
in
file == /. || type == "directory";
consolidatePatches =
patches:
if (lib.isDerivation patches) then
[ patches ]
else if (builtins.isPath patches) then
(if (isDir patches) then (lib.filesystem.listFilesRecursive patches) else [ patches ])
else if (builtins.isList patches) then
(lib.flatten (builtins.map consolidatePatches patches))
else
throw "Bad patches - must be path or derivation or list thereof";
consolidated = consolidatePatches patches;
splitPatch =
patchFile:
let
foldFunc =
a: b:
if (lib.strings.hasPrefix "--- " b) then
(a ++ [ [ b ] ])
else
((lib.lists.init a) ++ (lib.lists.singleton ((lib.lists.last a) ++ [ b ])));
partitionedPatches' = lib.lists.foldl foldFunc [ [ ] ] (
lib.strings.splitString "\n" (builtins.readFile patchFile)
);
partitionedPatches =
if (builtins.length partitionedPatches' > 1) then
(lib.lists.drop 1 partitionedPatches')
else
(throw "${patchFile} does not seem to be a unified patch (diff -u). this is required for FreeBSD.");
filterFunc =
patchLines:
let
prefixedPath = builtins.elemAt (builtins.split " |\t" (builtins.elemAt patchLines 1)) 2;
unfixedPath = lib.path.subpath.join (lib.lists.drop 1 (lib.path.subpath.components prefixedPath));
in
lib.lists.any (included: lib.path.hasPrefix (/. + ("/" + included)) (/. + ("/" + unfixedPath))) (
(attrs.extraPaths or [ ]) ++ [ attrs.path ]
);
filteredLines = builtins.filter filterFunc partitionedPatches;
derive = patchLines: writeText "freebsd-patch" (lib.concatLines patchLines);
derivedPatches = builtins.map derive filteredLines;
in
derivedPatches;
picked = lib.lists.concatMap splitPatch consolidated;
in
picked ++ attrs.patches or [ ];
}
)
)

View File

@ -0,0 +1,22 @@
{
stdenv,
mkDerivation,
byacc,
flex,
}:
mkDerivation {
path = "usr.bin/mkcsmapper";
extraPaths = [
"lib/libc/iconv"
"lib/libiconv_modules/mapper_std"
];
BOOTSTRAPPING = !stdenv.hostPlatform.isFreeBSD;
extraNativeBuildInputs = [
byacc
flex
];
}

View File

@ -0,0 +1,19 @@
{
stdenv,
mkDerivation,
byacc,
flex,
}:
mkDerivation {
path = "usr.bin/mkesdb";
extraPaths = [ "lib/libc/iconv" ];
BOOTSTRAPPING = !stdenv.hostPlatform.isFreeBSD;
extraNativeBuildInputs = [
byacc
flex
];
}

View File

@ -1,6 +1,39 @@
{ mkDerivation, mknod }:
{
lib,
stdenv,
mkDerivation,
compatIfNeeded,
compatIsNeeded,
libmd,
libnetbsd,
libutil,
}:
mkDerivation {
path = "contrib/mtree";
extraPaths = [ mknod.path ];
extraPaths = [ "contrib/mknod" ];
buildInputs =
compatIfNeeded
++ [
libmd
libnetbsd
]
++ lib.optional (stdenv.isFreeBSD) libutil;
postPatch = ''
ln -s $BSDSRCDIR/contrib/mknod/*.c $BSDSRCDIR/contrib/mknod/*.h $BSDSRCDIR/contrib/mtree
'';
preBuild = ''
export NIX_LDFLAGS="$NIX_LDFLAGS ${
toString (
[
"-lmd"
"-lnetbsd"
]
++ lib.optional compatIsNeeded "-legacy"
++ lib.optional stdenv.isFreeBSD "-lutil"
)
}"
'';
}

View File

@ -5,7 +5,7 @@
patchesRoot,
}:
mkDerivation rec {
mkDerivation {
path = "usr.bin/rpcgen";
patches = lib.optionals (stdenv.hostPlatform.libc == "glibc") [
# `WUNTRACED` is defined privately `bits/waitflags.h` in glibc.
@ -22,6 +22,6 @@ mkDerivation rec {
#
# This hacks around this by manually including `WUNTRACED` until
# the problem is fixed properly in glibc.
/${patchesRoot}/rpcgen-glibc-hack.patch
./rpcgen-glibc-hack.patch
];
}

View File

@ -1,7 +1,6 @@
{ mkDerivation, source }:
{ mkDerivation }:
mkDerivation {
path = "usr.bin/sed";
TESTSRC = "${source}/contrib/netbsd-tests";
MK_TESTS = "no";
}

View File

@ -4,7 +4,6 @@
# If you want you could fetchgit from "https://git.FreeBSD.org/src.git" instead.
# The update script still pulls directly from git.freebsd.org
fetchFromGitHub {
name = "src"; # Want to rename this next rebuild
owner = "freebsd";
repo = "freebsd-src";
inherit (sourceData) rev hash;

View File

@ -2,7 +2,6 @@
stdenv,
mkDerivation,
freebsd-lib,
patchesRoot,
buildPackages,
bsdSetupHook,
freebsdSetupHook,
@ -15,7 +14,7 @@
file2c,
gawk,
uudecode,
xargs-j, # , ctfconvert
xargs-j,
}:
mkDerivation (
@ -39,12 +38,6 @@ mkDerivation (
gawk
uudecode
xargs-j
#ctfconvert
];
patches = [
/${patchesRoot}/sys-gnu-date.patch
/${patchesRoot}/sys-no-explicit-intrinsics-dep.patch
];
# --dynamic-linker /red/herring is used when building the kernel.

View File

@ -1,4 +1,5 @@
{
lib,
mkDerivation,
bsdSetupHook,
freebsdSetupHook,
@ -10,6 +11,12 @@
mkDerivation {
path = "usr.bin/tsort";
extraPaths = [ ];
outputs = [ "out" ];
MK_TESTS = "no";
makeFlags = [
"STRIP=-s" # flag to install, not command
];
nativeBuildInputs = [
bsdSetupHook
freebsdSetupHook

View File

@ -9,6 +9,7 @@ mergeNetBSDSourceDir() {
addNetBSDMakeFlags() {
makeFlags="INCSDIR=${!outputDev}/include $makeFlags"
makeFlags="MANDIR=${!outputMan}/share/man $makeFlags"
}
postUnpackHooks+=(mergeNetBSDSourceDir)

View File

@ -49,7 +49,6 @@ addMakeFlags() {
makeFlags="LIBDIR=${!outputLib}/lib $makeFlags"
makeFlags="SHLIBDIR=${!outputLib}/lib $makeFlags"
makeFlags="SHAREDIR=${!outputLib}/share $makeFlags"
makeFlags="MANDIR=${!outputMan}/share/man $makeFlags"
makeFlags="INFODIR=${!outputInfo}/share/info $makeFlags"
makeFlags="DOCDIR=${!outputDoc}/share/doc $makeFlags"
makeFlags="LOCALEDIR=${!outputLib}/share/locale $makeFlags"

View File

@ -52,9 +52,7 @@ stdenv.mkDerivation (finalAttrs: {
sourceProvenance = with sourceTypes; [
binaryFirmware
];
maintainers = with maintainers; [
hexa
];
maintainers = with maintainers; [ ];
platforms = [ "x86_64-linux" ];
};
})

View File

@ -40,9 +40,7 @@ stdenv.mkDerivation {
sourceProvenance = with sourceTypes; [
binaryFirmware
];
maintainers = with maintainers; [
hexa
];
maintainers = with maintainers; [ ];
platforms = [ "x86_64-linux" ];
};
}

View File

@ -45,7 +45,7 @@ stdenv.mkDerivation {
homepage = "https://github.com/intel/ipu6-drivers";
description = "IPU6 kernel driver";
license = lib.licenses.gpl2;
maintainers = with lib.maintainers; [ hexa ];
maintainers = with lib.maintainers; [ ];
platforms = [ "x86_64-linux" ];
# requires 6.1.7 https://github.com/intel/ipu6-drivers/pull/84
broken = kernel.kernelOlder "6.1.7";

View File

@ -36,7 +36,7 @@ stdenv.mkDerivation {
homepage = "https://github.com/intel/ivsc-driver";
description = "Intel Vision Sensing Controller kernel driver";
license = lib.licenses.gpl2;
maintainers = with lib.maintainers; [ hexa ];
maintainers = with lib.maintainers; [ ];
platforms = [ "x86_64-linux" ];
broken = kernel.kernelOlder "5.15";
};

View File

@ -8,82 +8,89 @@
, awscli
}:
python3.pkgs.buildPythonApplication rec {
pname = "awscli";
version = "1.32.101"; # N.B: if you change this, change botocore and boto3 to a matching version too
pyproject = true;
let
botocoreVersion = python3.pkgs.botocore.version;
# awscli.version should be pinned to 2 minor versions less than the botocoreVersion
versionMinor = toString (lib.toInt (lib.versions.minor botocoreVersion) - 2);
versionPatch = lib.versions.patch botocoreVersion;
self = python3.pkgs.buildPythonApplication rec {
pname = "awscli";
version = "1.${versionMinor}.${versionPatch}"; # N.B: if you change this, change botocore and boto3 to a matching version too
pyproject = true;
src = fetchPypi {
inherit pname version;
hash = "sha256-M4KzuQ+srPfk85P5QeQfVMorSKWhmNhdX4AY0AeRDTQ=";
};
nativeBuildInputs = [
python3.pkgs.pythonRelaxDepsHook
];
pythonRelaxDeps = [
"botocore"
"colorama"
"docutils"
"rsa"
];
build-system = [
python3.pkgs.setuptools
];
propagatedBuildInputs = with python3.pkgs; [
botocore
s3transfer
colorama
docutils
rsa
pyyaml
groff
less
];
postInstall = ''
mkdir -p $out/share/bash-completion/completions
echo "complete -C $out/bin/aws_completer aws" > $out/share/bash-completion/completions/awscli
mkdir -p $out/share/zsh/site-functions
mv $out/bin/aws_zsh_completer.sh $out/share/zsh/site-functions
rm $out/bin/aws.cmd
'';
doInstallCheck = true;
installCheckPhase = ''
runHook preInstallCheck
$out/bin/aws --version | grep "${python3.pkgs.botocore.version}"
$out/bin/aws --version | grep "${version}"
runHook postInstallCheck
'';
passthru = {
python = python3; # for aws_shell
updateScript = nix-update-script {
# Excludes 1.x versions from the Github tags list
extraArgs = [ "--version-regex" "^(1\.(.*))" ];
src = fetchPypi {
inherit pname version;
hash = "sha256-GPcXkl2H0XNaeqt2/qD5+KvW23dRB0X+zLWo9hLigQM=";
};
tests.version = testers.testVersion {
package = awscli;
command = "aws --version";
inherit version;
nativeBuildInputs = [
python3.pkgs.pythonRelaxDepsHook
];
pythonRelaxDeps = [
# botocore must not be relaxed
"colorama"
"docutils"
"rsa"
];
build-system = [
python3.pkgs.setuptools
];
propagatedBuildInputs = with python3.pkgs; [
botocore
s3transfer
colorama
docutils
rsa
pyyaml
groff
less
];
postInstall = ''
mkdir -p $out/share/bash-completion/completions
echo "complete -C $out/bin/aws_completer aws" > $out/share/bash-completion/completions/awscli
mkdir -p $out/share/zsh/site-functions
mv $out/bin/aws_zsh_completer.sh $out/share/zsh/site-functions
rm $out/bin/aws.cmd
'';
doInstallCheck = true;
installCheckPhase = ''
runHook preInstallCheck
$out/bin/aws --version | grep "${botocoreVersion}"
$out/bin/aws --version | grep "${version}"
runHook postInstallCheck
'';
passthru = {
python = python3; # for aws_shell
updateScript = nix-update-script {
extraArgs = [ "--version=skip" ];
};
tests.version = testers.testVersion {
package = awscli;
command = "aws --version";
inherit version;
};
};
meta = with lib; {
homepage = "https://aws.amazon.com/cli/";
changelog = "https://github.com/aws/aws-cli/blob/${version}/CHANGELOG.rst";
description = "Unified tool to manage your AWS services";
license = licenses.asl20;
mainProgram = "aws";
maintainers = with maintainers; [ anthonyroussel ];
};
};
meta = with lib; {
homepage = "https://aws.amazon.com/cli/";
changelog = "https://github.com/aws/aws-cli/blob/${version}/CHANGELOG.rst";
description = "Unified tool to manage your AWS services";
license = licenses.asl20;
mainProgram = "aws";
maintainers = with maintainers; [ anthonyroussel ];
};
}
in
assert self ? pythonRelaxDeps -> !(lib.elem "botocore" self.pythonRelaxDeps);
self

View File

@ -193,7 +193,7 @@ with pkgs;
pythonInterpreter = "${python3.withPackages (ps: [ ps.pyelftools ])}/bin/python";
autoPatchelfScript = ../build-support/setup-hooks/auto-patchelf.py;
};
meta.platforms = lib.platforms.linux;
meta.platforms = lib.platforms.linux ++ lib.platforms.freebsd;
} ../build-support/setup-hooks/auto-patchelf.sh;
tomato-c = callPackage ../applications/misc/tomato-c { };
@ -16316,7 +16316,7 @@ with pkgs;
# assumption is that or any later version is good.
choose = platform:
/**/ if platform.isDarwin then 16
else if platform.isFreeBSD then 12
else if platform.isFreeBSD then 16
else if platform.isAndroid then 12
else if platform.isLinux then 17
else if platform.isWasm then 16
@ -22526,7 +22526,7 @@ with pkgs;
# We also provide `libiconvReal`, which will always be a standalone libiconv,
# just in case you want it regardless of platform.
libiconv =
if lib.elem stdenv.hostPlatform.libc [ "glibc" "musl" "nblibc" "wasilibc" ]
if lib.elem stdenv.hostPlatform.libc [ "glibc" "musl" "nblibc" "wasilibc" "fblibc" ]
then libcIconv (if stdenv.hostPlatform != stdenv.buildPlatform
then libcCross
else stdenv.cc.libc)

View File

@ -57,9 +57,7 @@ in
, # Non-GNU/Linux OSes are currently "impure" platforms, with their libc
# outside of the store. Thus, GCC, GFortran, & co. must always look for files
# in standard system directories (/usr/include, etc.)
noSysDirs ? stdenv.buildPlatform.system != "x86_64-freebsd"
&& stdenv.buildPlatform.system != "i686-freebsd"
&& stdenv.buildPlatform.system != "x86_64-solaris"
noSysDirs ? stdenv.buildPlatform.system != "x86_64-solaris"
&& stdenv.buildPlatform.system != "x86_64-kfreebsd-gnu"
, # The configuration attribute set