From faaff6e3665ae07fc73abf0c76071f5275044874 Mon Sep 17 00:00:00 2001 From: jokatzke Date: Mon, 16 Oct 2023 10:48:07 +0200 Subject: [PATCH 01/42] maintainers: add jokatzke --- maintainers/maintainer-list.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 471d97cb1bc0..f6afbd852103 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -8978,6 +8978,12 @@ fingerprint = "7249 70E6 A661 D84E 8B47 678A 0590 93B1 A278 BCD0"; }]; }; + jokatzke = { + email = "jokatzke@fastmail.com"; + github = "jokatzke"; + githubId = 46931073; + name = "Jonas Katzke"; + }; joko = { email = "ioannis.koutras@gmail.com"; github = "jokogr"; From 3f00b40fff0e6de822196dd926d8efca430b490b Mon Sep 17 00:00:00 2001 From: Hadi Date: Mon, 22 Jan 2024 17:41:51 -0500 Subject: [PATCH 02/42] androidenv: don't include emulator when includeEmulator is false --- .../androidenv/compose-android-packages.nix | 14 +- .../examples/shell-with-emulator.nix | 33 ++++ .../examples/shell-without-emulator.nix | 152 ++++++++++++++++++ .../mobile/androidenv/test-suite.nix | 10 +- pkgs/development/mobile/androidenv/tools.nix | 2 +- 5 files changed, 200 insertions(+), 11 deletions(-) create mode 100644 pkgs/development/mobile/androidenv/examples/shell-without-emulator.nix diff --git a/pkgs/development/mobile/androidenv/compose-android-packages.nix b/pkgs/development/mobile/androidenv/compose-android-packages.nix index 8d3f7f6e20df..a0ab34cef33c 100644 --- a/pkgs/development/mobile/androidenv/compose-android-packages.nix +++ b/pkgs/development/mobile/androidenv/compose-android-packages.nix @@ -151,7 +151,7 @@ rec { postInstall = '' ${linkPlugin { name = "platform-tools"; plugin = platform-tools; }} ${linkPlugin { name = "patcher"; plugin = patcher; }} - ${linkPlugin { name = "emulator"; plugin = emulator; }} + ${linkPlugin { name = "emulator"; plugin = emulator; check = includeEmulator; }} ''; }; @@ -171,14 +171,14 @@ rec { } ) buildToolsVersions; - emulator = callPackage ./emulator.nix { + emulator = lib.optionals includeEmulator (callPackage ./emulator.nix { inherit deployAndroidPackage os; package = check-version packages "emulator" emulatorVersion; postInstall = '' ${linkSystemImages { images = system-images; check = includeSystemImages; }} ''; - }; + }); platforms = map (version: deployAndroidPackage { @@ -373,9 +373,11 @@ rec { ln -s $i $out/bin done - for i in ${emulator}/bin/*; do - ln -s $i $out/bin - done + ${lib.optionalString includeEmulator '' + for i in ${emulator}/bin/*; do + ln -s $i $out/bin + done + ''} find $ANDROID_SDK_ROOT/${cmdline-tools-package.path}/bin -type f -executable | while read i; do ln -s $i $out/bin diff --git a/pkgs/development/mobile/androidenv/examples/shell-with-emulator.nix b/pkgs/development/mobile/androidenv/examples/shell-with-emulator.nix index 3c08887eb5be..1315b1ff98a2 100644 --- a/pkgs/development/mobile/androidenv/examples/shell-with-emulator.nix +++ b/pkgs/development/mobile/androidenv/examples/shell-with-emulator.nix @@ -132,6 +132,39 @@ pkgs.mkShell rec { touch "$out" ''; + shell-with-emulator-sdkmanager-excluded-packages-test = pkgs.runCommand "shell-with-emulator-sdkmanager-excluded-packages-test" + { + nativeBuildInputs = [ androidSdk jdk ]; + } '' + output="$(sdkmanager --list)" + installed_packages_section=$(echo "''${output%%Available Packages*}" | awk 'NR>4 {print $1}') + + excluded_packages=( + "platforms;android-23" "platforms;android-24" "platforms;android-25" "platforms;android-26" \ + "platforms;android-27" "platforms;android-28" "platforms;android-29" "platforms;android-30" \ + "platforms;android-31" "platforms;android-32" "platforms;android-33" \ + "sources;android-23" "sources;android-24" "sources;android-25" "sources;android-26" \ + "sources;android-27" "sources;android-28" "sources;android-29" "sources;android-30" \ + "sources;android-31" "sources;android-32" "sources;android-33" "sources;android-34" \ + "system-images;android-28" \ + "system-images;android-29" \ + "system-images;android-30" \ + "system-images;android-31" \ + "system-images;android-32" \ + "system-images;android-33" \ + "ndk" + ) + + for package in "''${excluded_packages[@]}"; do + if [[ $installed_packages_section =~ "$package" ]]; then + echo "$package package was installed, while it was excluded!" + exit 1 + fi + done + + touch "$out" + ''; + shell-with-emulator-avdmanager-create-avd-test = pkgs.runCommand "shell-with-emulator-avdmanager-create-avd-test" { nativeBuildInputs = [ androidSdk androidEmulator jdk ]; } '' diff --git a/pkgs/development/mobile/androidenv/examples/shell-without-emulator.nix b/pkgs/development/mobile/androidenv/examples/shell-without-emulator.nix new file mode 100644 index 000000000000..ec7020a0c9a9 --- /dev/null +++ b/pkgs/development/mobile/androidenv/examples/shell-without-emulator.nix @@ -0,0 +1,152 @@ +{ + # To test your changes in androidEnv run `nix-shell android-sdk-with-emulator-shell.nix` + + # If you copy this example out of nixpkgs, use these lines instead of the next. + # This example pins nixpkgs: https://nix.dev/tutorials/towards-reproducibility-pinning-nixpkgs.html + /*nixpkgsSource ? (builtins.fetchTarball { + name = "nixpkgs-20.09"; + url = "https://github.com/NixOS/nixpkgs/archive/20.09.tar.gz"; + sha256 = "1wg61h4gndm3vcprdcg7rc4s1v3jkm5xd7lw8r2f67w502y94gcy"; + }), + pkgs ? import nixpkgsSource { + config.allowUnfree = true; + }, + */ + + # If you want to use the in-tree version of nixpkgs: + pkgs ? import ../../../../.. { + config.allowUnfree = true; + } +, config ? pkgs.config +}: + +# Copy this file to your Android project. +let + # Declaration of versions for everything. This is useful since these + # versions may be used in multiple places in this Nix expression. + android = { + versions = { + cmdLineToolsVersion = "11.0"; + platformTools = "34.0.5"; + buildTools = "34.0.0"; + }; + platforms = [ "34" ]; + }; + + # If you copy this example out of nixpkgs, something like this will work: + /*androidEnvNixpkgs = fetchTarball { + name = "androidenv"; + url = "https://github.com/NixOS/nixpkgs/archive/.tar.gz"; + sha256 = ""; + }; + + androidEnv = pkgs.callPackage "${androidEnvNixpkgs}/pkgs/development/mobile/androidenv" { + inherit config pkgs; + licenseAccepted = true; + };*/ + + # Otherwise, just use the in-tree androidenv: + androidEnv = pkgs.callPackage ./.. { + inherit config pkgs; + # You probably need to uncomment below line to express consent. + # licenseAccepted = true; + }; + + sdkArgs = { + cmdLineToolsVersion = android.versions.cmdLineToolsVersion; + platformToolsVersion = android.versions.platformTools; + buildToolsVersions = [ android.versions.buildTools ]; + platformVersions = android.platforms; + includeNDK = false; + includeSystemImages = false; + includeEmulator = false; + + # Accepting more licenses declaratively: + extraLicenses = [ + # Already accepted for you with the global accept_license = true or + # licenseAccepted = true on androidenv. + # "android-sdk-license" + + # These aren't, but are useful for more uncommon setups. + "android-sdk-preview-license" + "android-googletv-license" + "android-sdk-arm-dbt-license" + "google-gdk-license" + "intel-android-extra-license" + "intel-android-sysimage-license" + "mips-android-sysimage-license" + ]; + }; + + androidComposition = androidEnv.composeAndroidPackages sdkArgs; + androidSdk = androidComposition.androidsdk; + platformTools = androidComposition.platform-tools; + jdk = pkgs.jdk; +in +pkgs.mkShell rec { + name = "androidenv-example-without-emulator-demo"; + packages = [ androidSdk platformTools jdk pkgs.android-studio ]; + + LANG = "C.UTF-8"; + LC_ALL = "C.UTF-8"; + JAVA_HOME = jdk.home; + + # Note: ANDROID_HOME is deprecated. Use ANDROID_SDK_ROOT. + ANDROID_SDK_ROOT = "${androidSdk}/libexec/android-sdk"; + + shellHook = '' + # Write out local.properties for Android Studio. + cat < local.properties + # This file was automatically generated by nix-shell. + sdk.dir=$ANDROID_SDK_ROOT + EOF + ''; + + passthru.tests = { + + shell-without-emulator-sdkmanager-packages-test = pkgs.runCommand "shell-without-emulator-sdkmanager-packages-test" + { + nativeBuildInputs = [ androidSdk jdk ]; + } '' + output="$(sdkmanager --list)" + installed_packages_section=$(echo "''${output%%Available Packages*}" | awk 'NR>4 {print $1}') + echo "installed_packages_section: ''${installed_packages_section}" + + packages=( + "build-tools;34.0.0" "cmdline-tools;11.0" \ + "patcher;v4" "platform-tools" "platforms;android-34" + ) + + for package in "''${packages[@]}"; do + if [[ ! $installed_packages_section =~ "$package" ]]; then + echo "$package package was not installed." + exit 1 + fi + done + + touch "$out" + ''; + + shell-without-emulator-sdkmanager-excluded-packages-test = pkgs.runCommand "shell-without-emulator-sdkmanager-excluded-packages-test" + { + nativeBuildInputs = [ androidSdk jdk ]; + } '' + output="$(sdkmanager --list)" + installed_packages_section=$(echo "''${output%%Available Packages*}" | awk 'NR>4 {print $1}') + + excluded_packages=( + "emulator" "ndk" + ) + + for package in "''${excluded_packages[@]}"; do + if [[ $installed_packages_section =~ "$package" ]]; then + echo "$package package was installed, while it was excluded!" + exit 1 + fi + done + + touch "$out" + ''; + }; +} + diff --git a/pkgs/development/mobile/androidenv/test-suite.nix b/pkgs/development/mobile/androidenv/test-suite.nix index b5aeca432461..c3a8cc64f0f4 100644 --- a/pkgs/development/mobile/androidenv/test-suite.nix +++ b/pkgs/development/mobile/androidenv/test-suite.nix @@ -1,9 +1,11 @@ -{callPackage, lib, stdenv}: +{ callPackage, lib, stdenv }: let - examples-shell = callPackage ./examples/shell.nix {}; - examples-shell-with-emulator = callPackage ./examples/shell-with-emulator.nix {}; + examples-shell = callPackage ./examples/shell.nix { }; + examples-shell-with-emulator = callPackage ./examples/shell-with-emulator.nix { }; + examples-shell-without-emulator = callPackage ./examples/shell-without-emulator.nix { }; all-tests = examples-shell.passthru.tests // - examples-shell-with-emulator.passthru.tests; + (examples-shell-with-emulator.passthru.tests // + examples-shell-without-emulator.passthru.tests); in stdenv.mkDerivation { name = "androidenv-test-suite"; diff --git a/pkgs/development/mobile/androidenv/tools.nix b/pkgs/development/mobile/androidenv/tools.nix index 0177d8e6f7b7..91ddbe4f9edc 100644 --- a/pkgs/development/mobile/androidenv/tools.nix +++ b/pkgs/development/mobile/androidenv/tools.nix @@ -1,7 +1,7 @@ {deployAndroidPackage, lib, package, autoPatchelfHook, makeWrapper, os, pkgs, pkgsi686Linux, postInstall}: deployAndroidPackage { - name = "androidsdk"; + name = "androidsdk-tools"; inherit os package; nativeBuildInputs = [ makeWrapper ] ++ lib.optionals (os == "linux") [ autoPatchelfHook ]; From 28077c7e24732423d9951e438927b67b56c98cab Mon Sep 17 00:00:00 2001 From: Dane Lipscombe Date: Mon, 29 Jan 2024 17:04:12 +1100 Subject: [PATCH 03/42] turbo: refactor to remove golang code --- pkgs/tools/misc/turbo/default.nix | 104 +----------------------------- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 4 insertions(+), 102 deletions(-) diff --git a/pkgs/tools/misc/turbo/default.nix b/pkgs/tools/misc/turbo/default.nix index 904e89da76ce..c891ad5d0da2 100644 --- a/pkgs/tools/misc/turbo/default.nix +++ b/pkgs/tools/misc/turbo/default.nix @@ -1,13 +1,7 @@ { stdenv , lib , fetchFromGitHub -, buildGo120Module -, git -, nodejs -, capnproto , protobuf -, protoc-gen-go -, protoc-gen-go-grpc , rustPlatform , pkg-config , openssl @@ -17,15 +11,13 @@ , testers , turbo , nix-update-script -, go -, zlib -, libiconv -, Security , IOKit , CoreServices , CoreFoundation +, capnproto }: -let +rustPlatform.buildRustPackage rec{ + pname = "turbo"; version = "1.11.3"; src = fetchFromGitHub { owner = "vercel"; @@ -33,92 +25,6 @@ let rev = "v${version}"; hash = "sha256-hjJXbGct9ZmriKdVjB7gwfmFsV1Tv57V7DfUMFZ8Xv0="; }; - - ffi = rustPlatform.buildRustPackage { - pname = "turbo-ffi"; - inherit src version; - cargoBuildFlags = [ "--package" "turborepo-ffi" ]; - - cargoHash = "sha256-3eN8/nBARuaezlzPjAL0YPEPvNqm6jNQAREth8PgcSQ="; - - RUSTC_BOOTSTRAP = 1; - nativeBuildInputs = [ - pkg-config - extra-cmake-modules - protobuf - ]; - buildInputs = [ - openssl - fontconfig - ]; - - doCheck = false; - - postInstall = '' - cp target/release-tmp/libturborepo_ffi.a $out/lib - ''; - }; - - - go-turbo = buildGo120Module { - inherit src version; - pname = "go-turbo"; - modRoot = "cli"; - - proxyVendor = true; - vendorHash = "sha256-JHTg9Gcc0DVdltTGCUaOPSVxL0XVkwPJQm/LoKffU/o="; - - nativeBuildInputs = [ - git - nodejs - protobuf - protoc-gen-go - protoc-gen-go-grpc - ]; - - buildInputs = [zlib ] ++ lib.optionals stdenv.isDarwin [ - Security - libiconv - ]; - - ldflags = [ - "-s -w" - "-X main.version=${version}" - "-X main.commit=${src.rev}" - "-X main.date=1970-01-01-00:00:01" - "-X main.builtBy=goreleaser" - ]; - - preBuild = '' - make compile-protos - cp ${ffi}/lib/libturborepo_ffi.a ./internal/ffi/libturborepo_ffi_${go.GOOS}_${go.GOARCH}.a - ''; - - preCheck = '' - # Some tests try to run mkdir $HOME - HOME=$TMP - - # Test_getTraversePath requires that source is a git repo - # pwd: /build/source/cli - pushd .. - git config --global init.defaultBranch main - git init - popd - - # package_deps_hash_test.go:492: hash of child-dir/libA/pkgignorethisdir/file, got 67aed78ea231bdee3de45b6d47d8f32a0a792f6d want go-turbo> package_deps_hash_test.go:499: found extra hashes in map[.gitignore:3237694bc3312ded18386964 a855074af7b066af some-dir/another-one:7e59c6a6ea9098c6d3beb00e753e2c54ea502311 some-dir/excluded-file:7e59 c6a6ea9098c6d3beb00e753e2c54ea502311 some-dir/other-file:7e59c6a6ea9098c6d3beb00e753e2c54ea502311 some-fil e:7e59c6a6ea9098c6d3beb00e753e2c54ea502311] - rm ./internal/hashing/package_deps_hash_test.go - rm ./internal/hashing/package_deps_hash_go_test.go - # Error: Not equal: - # expected: env.DetailedMap{All:env.EnvironmentVariableMap(nil), BySource:env.BySource{Explicit:env.EnvironmentVariableMap{}, Matching:env.EnvironmentVariableMap{}}} - # actual : env.DetailedMap{All:env.EnvironmentVariableMap{}, BySource:env.BySource{Explicit:env.EnvironmentVariableMap{}, Matching:env.EnvironmentVariableMap{}}} - rm ./internal/run/global_hash_test.go - ''; - - }; -in -rustPlatform.buildRustPackage { - pname = "turbo"; - inherit src version; cargoBuildFlags = [ "--package" "turbo" @@ -144,10 +50,6 @@ rustPlatform.buildRustPackage { CoreFoundation ]; - postInstall = '' - ln -s ${go-turbo}/bin/turbo $out/bin/go-turbo - ''; - # Browser tests time out with chromium and google-chrome doCheck = false; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4b59863a7228..eafdc2b68e9c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -14170,7 +14170,7 @@ with pkgs; tuptime = callPackage ../tools/system/tuptime { }; turbo = callPackage ../tools/misc/turbo { - inherit (darwin.apple_sdk_11_0.frameworks) Security IOKit CoreServices CoreFoundation; + inherit (darwin.apple_sdk_11_0.frameworks) IOKit CoreServices CoreFoundation; }; turses = callPackage ../applications/networking/instant-messengers/turses { }; From 6a6529ace1f564668ed7546fe032e2418e4b3f0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Na=C3=AFm=20Favier?= Date: Wed, 31 Jan 2024 16:08:35 +0100 Subject: [PATCH 04/42] nix-bash-completions: fix improper escaping --- pkgs/shells/bash/nix-bash-completions/default.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/shells/bash/nix-bash-completions/default.nix b/pkgs/shells/bash/nix-bash-completions/default.nix index d6cc156cba1d..10fb097fd2c8 100644 --- a/pkgs/shells/bash/nix-bash-completions/default.nix +++ b/pkgs/shells/bash/nix-bash-completions/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchFromGitHub }: +{ lib, stdenv, fetchFromGitHub, fetchpatch }: stdenv.mkDerivation rec { version = "0.6.8"; @@ -11,6 +11,14 @@ stdenv.mkDerivation rec { sha256 = "1n5zs6xcnv4bv1hdaypmz7fv4j7dsr4a0ifah99iyj4p5j85i1bc"; }; + patches = [ + # Fix improper escaping: https://github.com/NixOS/nixpkgs/issues/284162 + (fetchpatch { + url = "https://github.com/hedning/nix-bash-completions/pull/28/commits/ef2055aa28754fa9e009bbfebc1491972e4f4e67.patch"; + hash = "sha256-TRkHrk7bX7DX0COzzYR+1pgTqLy7J55BcejNjRwthII="; + }) + ]; + postPatch = '' # Nix 2.4+ provides its own completion for the nix command, see https://github.com/hedning/nix-bash-completions/issues/20 # NixOS provides its own completions for nixos-rebuild now. From 50866dc20fb85063f1d4e103b11530092c490d03 Mon Sep 17 00:00:00 2001 From: Jared Baur Date: Wed, 31 Jan 2024 09:12:28 -0800 Subject: [PATCH 05/42] nixos/sysupdate: allow lists in sysupdate config Lists are convenient to have in sysupdate configuration when using multiple `MatchPattern` under `Target` when the target can have multiple filenames. This use-case is helpful for BootLoaderSpec bootcounting where the target file on disk can have multiple filenames, and in order for sysupdate to properly ensure only N number of instances of this target exist at one time, we need to have multiple match patterns. --- nixos/modules/system/boot/systemd/sysupdate.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/modules/system/boot/systemd/sysupdate.nix b/nixos/modules/system/boot/systemd/sysupdate.nix index cab35ddf270c..1f4088ddf825 100644 --- a/nixos/modules/system/boot/systemd/sysupdate.nix +++ b/nixos/modules/system/boot/systemd/sysupdate.nix @@ -3,7 +3,7 @@ let cfg = config.systemd.sysupdate; - format = pkgs.formats.ini { }; + format = pkgs.formats.ini { listToValue = toString; }; definitionsDirectory = utils.systemdUtils.lib.definitions "sysupdate.d" @@ -79,7 +79,7 @@ in Source = { Type = "url-file"; Path = "https://download.example.com/"; - MatchPattern = "nixos_@v.efi.xz"; + MatchPattern = [ "nixos_@v+@l-@d.efi" "nixos_@v+@l.efi" "nixos_@v.efi" ]; }; Target = { From 514bfa6674600e08c321b9efdab807a14835c4ff Mon Sep 17 00:00:00 2001 From: Jared Baur Date: Wed, 31 Jan 2024 09:16:04 -0800 Subject: [PATCH 06/42] nixos/sysupdate: fix systemd-sysupdate test The test fails when the `Target`'s parent directories don't exist. For the purpose of this test though, we can just download it to the root directory for simplicity. --- nixos/tests/systemd-sysupdate.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/nixos/tests/systemd-sysupdate.nix b/nixos/tests/systemd-sysupdate.nix index 37811605dbb2..6592764c9ff4 100644 --- a/nixos/tests/systemd-sysupdate.nix +++ b/nixos/tests/systemd-sysupdate.nix @@ -23,8 +23,8 @@ in mkdir -p $out cd $out - echo "nixos" > nixos_1.efi - sha256sum nixos_1.efi > SHA256SUMS + echo "nixos" > nixos_1.txt + sha256sum nixos_1.txt > SHA256SUMS export GNUPGHOME="$(mktemp -d)" cp -R ${gpgKeyring}/* $GNUPGHOME @@ -39,15 +39,15 @@ in systemd.sysupdate = { enable = true; transfers = { - "uki" = { + "text-file" = { Source = { Type = "url-file"; Path = "http://server/"; - MatchPattern = "nixos_@v.efi"; + MatchPattern = "nixos_@v.txt"; }; Target = { - Path = "/boot/EFI/Linux"; - MatchPattern = "nixos_@v.efi"; + Path = "/"; + MatchPattern = [ "nixos_@v.txt" ]; }; }; }; @@ -61,6 +61,6 @@ in server.wait_for_unit("nginx.service") target.succeed("systemctl start systemd-sysupdate") - assert "nixos" in target.wait_until_succeeds("cat /boot/EFI/Linux/nixos_1.efi", timeout=5) + assert "nixos" in target.wait_until_succeeds("cat /nixos_1.txt", timeout=5) ''; } From 8dde3a1788f1d4a280dfe097178d4fb09c42d7df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stanis=C5=82aw=20Pitucha?= Date: Sun, 4 Feb 2024 21:28:05 +1100 Subject: [PATCH 07/42] python3Packages.mlx: init at 0.1.0 --- .../python-modules/mlx/default.nix | 78 +++++++++++++++++++ .../mlx/disable-accelerate.patch | 13 ++++ pkgs/top-level/python-packages.nix | 2 + 3 files changed, 93 insertions(+) create mode 100644 pkgs/development/python-modules/mlx/default.nix create mode 100644 pkgs/development/python-modules/mlx/disable-accelerate.patch diff --git a/pkgs/development/python-modules/mlx/default.nix b/pkgs/development/python-modules/mlx/default.nix new file mode 100644 index 000000000000..036bbfac0418 --- /dev/null +++ b/pkgs/development/python-modules/mlx/default.nix @@ -0,0 +1,78 @@ +{ stdenv +, lib +, fetchFromGitHub +, buildPythonPackage +, python3Packages +, pybind11 +, cmake +, xcbuild +, zsh +, darwin +, blas +, lapack +}: + +let + # static dependencies included directly during compilation + gguf-tools = fetchFromGitHub { + owner = "antirez"; + repo = "gguf-tools"; + rev = "af7d88d808a7608a33723fba067036202910acb3"; + hash = "sha256-LqNvnUbmq0iziD9VP5OTJCSIy+y/hp5lKCUV7RtKTvM="; + }; + nlohmann_json = fetchFromGitHub { + owner = "nlohmann"; + repo = "json"; + rev = "v3.11.3"; + hash = "sha256-7F0Jon+1oWL7uqet5i1IgHX0fUw/+z0QwEcA3zs5xHg="; + }; +in +buildPythonPackage rec { + pname = "mlx"; + version = "0.1.0"; + + src = fetchFromGitHub { + owner = "ml-explore"; + repo = "mlx"; + rev = "refs/tags/v${version}"; + hash = "sha256-xNJPG8XGbC0fy6RGcn1cxCsejyHsgnV35PuP8F1I4R4="; + }; + + pyproject = true; + + patches = [ + # With Darwin SDK 11 we cannot include vecLib/cblas_new.h, this needs to wait for PR #229210 + # In the meantime, pretend Accelerate is not available and use blas/lapack instead. + ./disable-accelerate.patch + ]; + + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace "/usr/bin/xcrun" "${xcbuild}/bin/xcrun" \ + ''; + + dontUseCmakeConfigure = true; + + env = { + PYPI_RELEASE = version; + # we can't use Metal compilation with Darwin SDK 11 + CMAKE_ARGS = toString [ + (lib.cmakeBool "MLX_BUILD_METAL" false) + (lib.cmakeOptionType "filepath" "FETCHCONTENT_SOURCE_DIR_GGUFLIB" "${gguf-tools}") + (lib.cmakeOptionType "filepath" "FETCHCONTENT_SOURCE_DIR_JSON" "${nlohmann_json}") + ]; + }; + + nativeBuildInputs = [ cmake pybind11 xcbuild zsh gguf-tools nlohmann_json ] ++ (with python3Packages; [ setuptools ]); + + buildInputs = [ blas lapack ]; + + meta = with lib; { + homepage = "https://github.com/ml-explore/mlx"; + description = "An array framework for Apple silicon"; + changelog = "https://github.com/ml-explore/mlx/releases/tag/v${version}"; + license = licenses.mit; + platforms = [ "aarch64-darwin" ]; + maintainers = with maintainers; [ viraptor ]; + }; +} diff --git a/pkgs/development/python-modules/mlx/disable-accelerate.patch b/pkgs/development/python-modules/mlx/disable-accelerate.patch new file mode 100644 index 000000000000..693e7f41104d --- /dev/null +++ b/pkgs/development/python-modules/mlx/disable-accelerate.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2d6bef9..d099673 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -104,7 +104,7 @@ elseif (MLX_BUILD_METAL) + ${QUARTZ_LIB}) + endif() + +-find_library(ACCELERATE_LIBRARY Accelerate) ++#find_library(ACCELERATE_LIBRARY Accelerate) + if (MLX_BUILD_ARM AND ACCELERATE_LIBRARY) + message(STATUS "Accelerate found ${ACCELERATE_LIBRARY}") + set(MLX_BUILD_ACCELERATE ON) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index f06c38f06d89..d435ab07388b 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7164,6 +7164,8 @@ self: super: with self; { mlrose = callPackage ../development/python-modules/mlrose { }; + mlx = callPackage ../development/python-modules/mlx { }; + mlxtend = callPackage ../development/python-modules/mlxtend { }; mlt = toPythonModule (pkgs.mlt.override { From 5731572c47b948cc9d1c1bb89f21c740b5cf0010 Mon Sep 17 00:00:00 2001 From: jokatzke Date: Fri, 5 Jan 2024 07:57:49 +0100 Subject: [PATCH 08/42] python3Packages.courlan: init at 0.9.5 --- .../python-modules/courlan/default.nix | 54 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 56 insertions(+) create mode 100644 pkgs/development/python-modules/courlan/default.nix diff --git a/pkgs/development/python-modules/courlan/default.nix b/pkgs/development/python-modules/courlan/default.nix new file mode 100644 index 000000000000..d906f44c0f16 --- /dev/null +++ b/pkgs/development/python-modules/courlan/default.nix @@ -0,0 +1,54 @@ +{ lib +, buildPythonPackage +, fetchPypi +, langcodes +, pytestCheckHook +, tld +, urllib3 +, pythonOlder +}: + +buildPythonPackage rec { + pname = "courlan"; + version = "0.9.5"; + format = "setuptools"; + + disabled = pythonOlder "3.6"; + + src = fetchPypi { + inherit pname version; + hash = "sha256-ONw1suO/H11RbQDVGsEuveVD40F8a+b2oic8D8W1s1M="; + }; + + propagatedBuildInputs = [ + langcodes + tld + urllib3 + ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + # disable tests that require an internet connection + disabledTests = [ + "test_urlcheck" + ]; + + # nixify path to the courlan binary in the test suite + postPatch = '' + substituteInPlace tests/unit_tests.py \ + --replace "\"courlan --help\"" "\"$out/bin/courlan --help\"" \ + --replace "courlan_bin = \"courlan\"" "courlan_bin = \"$out/bin/courlan\"" + ''; + + pythonImportsCheck = [ "courlan" ]; + + meta = with lib; { + description = "Clean, filter and sample URLs to optimize data collection"; + homepage = "https://github.com/adbar/courlan"; + changelog = "https://github.com/adbar/courlan/blob/v${version}/HISTORY.md"; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ jokatzke ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 6d38976064ce..8b869860ebfd 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2372,6 +2372,8 @@ self: super: with self; { cot = callPackage ../development/python-modules/cot { }; + courlan = callPackage ../development/python-modules/courlan { }; + cov-core = callPackage ../development/python-modules/cov-core { }; coverage = callPackage ../development/python-modules/coverage { }; From b4edc2b435382440c6f99e5bad545a54e7e921e6 Mon Sep 17 00:00:00 2001 From: jokatzke Date: Mon, 16 Oct 2023 10:48:07 +0200 Subject: [PATCH 09/42] python3Packages.htmldate: init at 1.6.0 --- .../python-modules/htmldate/default.nix | 56 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 58 insertions(+) create mode 100644 pkgs/development/python-modules/htmldate/default.nix diff --git a/pkgs/development/python-modules/htmldate/default.nix b/pkgs/development/python-modules/htmldate/default.nix new file mode 100644 index 000000000000..464db47f03ed --- /dev/null +++ b/pkgs/development/python-modules/htmldate/default.nix @@ -0,0 +1,56 @@ +{ lib +, buildPythonPackage +, fetchPypi +, pythonOlder +, charset-normalizer +, dateparser +, lxml +, pytestCheckHook +, python-dateutil +, urllib3 +, backports-datetime-fromisoformat +}: + +buildPythonPackage rec { + pname = "htmldate"; + version = "1.6.0"; + format = "setuptools"; + + disabled = pythonOlder "3.6"; + + src = fetchPypi { + inherit pname version; + hash = "sha256-WCfI9iahaACinlfoGIo9MtCwjKTHvWYlN7c7u/IsRaY="; + }; + + propagatedBuildInputs = [ + charset-normalizer + dateparser + lxml + python-dateutil + urllib3 + ] ++ lib.optionals (pythonOlder "3.7") [ + backports-datetime-fromisoformat + ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + # disable tests that require an internet connection + disabledTests = [ + "test_input" + "test_cli" + "test_download" + ]; + + pythonImportsCheck = [ "htmldate" ]; + + meta = with lib; { + description = "Fast and robust extraction of original and updated publication dates from URLs and web pages"; + homepage = "https://htmldate.readthedocs.io"; + changelog = "https://github.com/adbar/htmldate/blob/v${version}/CHANGELOG.md"; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ jokatzke ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 8b869860ebfd..ed437fa524f9 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5229,6 +5229,8 @@ self: super: with self; { html5-parser = callPackage ../development/python-modules/html5-parser { }; + htmldate = callPackage ../development/python-modules/htmldate { }; + htmllaundry = callPackage ../development/python-modules/htmllaundry { }; htmllistparse = callPackage ../development/python-modules/htmllistparse { }; From c0980c450417dcd95b7d5e047ce7a06d354e419d Mon Sep 17 00:00:00 2001 From: jokatzke Date: Mon, 16 Oct 2023 10:48:07 +0200 Subject: [PATCH 10/42] python3Packages.justext: init at 3.0.0 --- .../python-modules/justext/default.nix | 43 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 45 insertions(+) create mode 100644 pkgs/development/python-modules/justext/default.nix diff --git a/pkgs/development/python-modules/justext/default.nix b/pkgs/development/python-modules/justext/default.nix new file mode 100644 index 000000000000..82f0aa804565 --- /dev/null +++ b/pkgs/development/python-modules/justext/default.nix @@ -0,0 +1,43 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pytestCheckHook +, lxml +}: + +buildPythonPackage rec { + pname = "justext"; + version = "3.0.0"; + format = "setuptools"; + + src = fetchFromGitHub { + owner = "miso-belica"; + repo = "jusText"; + rev = "refs/tags/v${version}"; + hash = "sha256-WNxDoM5666tEHS9pMl5dOoig4S7dSYaCLZq71tehWqw="; + }; + + propagatedBuildInputs = [ + lxml + ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + # patch out coverage report + postPatch = '' + substituteInPlace setup.cfg \ + --replace " --cov=justext --cov-report=term-missing --no-cov-on-fail" "" + ''; + + pythonImportsCheck = [ "justext" ]; + + meta = with lib; { + description = "Heuristic based boilerplate removal tool"; + homepage = "https://github.com/miso-belica/jusText"; + changelog = "https://github.com/miso-belica/jusText/blob/v${version}/CHANGELOG.rst"; + license = licenses.bsd2; + maintainers = with maintainers; [ jokatzke ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index ed437fa524f9..bc1f54dd6ddb 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6002,6 +6002,8 @@ self: super: with self; { justbytes = callPackage ../development/python-modules/justbytes { }; + justext = callPackage ../development/python-modules/justext { }; + justnimbus = callPackage ../development/python-modules/justnimbus { }; jwcrypto = callPackage ../development/python-modules/jwcrypto { }; From 16d9eff4673f67ff74b9e42109b512f17cee7808 Mon Sep 17 00:00:00 2001 From: jokatzke Date: Mon, 16 Oct 2023 10:48:07 +0200 Subject: [PATCH 11/42] python3Packages.py3langid: init at 0.2.2 --- .../python-modules/py3langid/default.nix | 43 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 45 insertions(+) create mode 100644 pkgs/development/python-modules/py3langid/default.nix diff --git a/pkgs/development/python-modules/py3langid/default.nix b/pkgs/development/python-modules/py3langid/default.nix new file mode 100644 index 000000000000..02631320c4af --- /dev/null +++ b/pkgs/development/python-modules/py3langid/default.nix @@ -0,0 +1,43 @@ +{ lib +, buildPythonPackage +, fetchPypi +, pythonOlder +, numpy +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "py3langid"; + version = "0.2.2"; + format = "setuptools"; + + disabled = pythonOlder "3.6"; + + src = fetchPypi { + inherit pname version; + hash = "sha256-tN4B2tfnAfKdIWoJNeheCWzIZ1kD0j6oRFsrtfCQuW8="; + }; + + propagatedBuildInputs = [ + numpy + ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + # nixify path to the courlan binary in the test suite + postPatch = '' + substituteInPlace tests/test_langid.py --replace "'langid'" "'$out/bin/langid'" + ''; + + pythonImportsCheck = [ "py3langid" ]; + + meta = with lib; { + description = "Fork of the language identification tool langid.py, featuring a modernized codebase and faster execution times"; + homepage = "https://github.com/adbar/py3langid"; + changelog = "https://github.com/adbar/py3langid/blob/v${version}/HISTORY.rst"; + license = licenses.bsd3; + maintainers = with maintainers; [ jokatzke ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index bc1f54dd6ddb..b908cbe0bfc3 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -9982,6 +9982,8 @@ self: super: with self; { py3exiv2 = callPackage ../development/python-modules/py3exiv2 { }; + py3langid = callPackage ../development/python-modules/py3langid { }; + py3nvml = callPackage ../development/python-modules/py3nvml { }; py3rijndael = callPackage ../development/python-modules/py3rijndael { }; From 8200b0b5a0997903a3d7c2ec4d90b27fe4b60d31 Mon Sep 17 00:00:00 2001 From: jokatzke Date: Mon, 16 Oct 2023 10:48:08 +0200 Subject: [PATCH 12/42] python3Packages.trafilatura: init at 1.6.3 --- .../python-modules/trafilatura/default.nix | 67 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 69 insertions(+) create mode 100644 pkgs/development/python-modules/trafilatura/default.nix diff --git a/pkgs/development/python-modules/trafilatura/default.nix b/pkgs/development/python-modules/trafilatura/default.nix new file mode 100644 index 000000000000..57042627c968 --- /dev/null +++ b/pkgs/development/python-modules/trafilatura/default.nix @@ -0,0 +1,67 @@ +{ lib +, buildPythonPackage +, fetchPypi +, pytestCheckHook +, pythonOlder +, certifi +, charset-normalizer +, courlan +, htmldate +, justext +, lxml +, urllib3 +}: + +buildPythonPackage rec { + pname = "trafilatura"; + version = "1.6.3"; + format = "setuptools"; + + disabled = pythonOlder "3.6"; + + src = fetchPypi { + inherit pname version; + hash = "sha256-Zx3W4AAOEBxLzo1w9ECLy3n8vyJ17iVZHv4z4sihYA0="; + }; + + propagatedBuildInputs = [ + certifi + charset-normalizer + courlan + htmldate + justext + lxml + urllib3 + ]; + + nativeCheckInputs = [ pytestCheckHook ]; + + # disable tests that require an internet connection + disabledTests = [ + "test_download" + "test_fetch" + "test_redirection" + "test_meta_redirections" + "test_crawl_page" + "test_whole" + "test_probing" + "test_cli_pipeline" + ]; + + # patch out gui cli because it is not supported in this packaging + # nixify path to the trafilatura binary in the test suite + postPatch = '' + substituteInPlace setup.py --replace '"trafilatura_gui=trafilatura.gui:main",' "" + substituteInPlace tests/cli_tests.py --replace "trafilatura_bin = 'trafilatura'" "trafilatura_bin = '$out/bin/trafilatura'" + ''; + + pythonImportsCheck = [ "trafilatura" ]; + + meta = with lib; { + description = "Python package and command-line tool designed to gather text on the Web"; + homepage = "https://trafilatura.readthedocs.io"; + changelog = "https://github.com/adbar/trafilatura/blob/v${version}/HISTORY.md"; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ jokatzke ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index b908cbe0bfc3..8a76ceba9994 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -14493,6 +14493,8 @@ self: super: with self; { trackpy = callPackage ../development/python-modules/trackpy { }; + trafilatura = callPackage ../development/python-modules/trafilatura { }; + trailrunner = callPackage ../development/python-modules/trailrunner {}; trainer = callPackage ../development/python-modules/trainer {}; From 8e06976c2afe9dee06d8f1b2795c30c04eb46e65 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Tue, 6 Feb 2024 18:54:07 +0000 Subject: [PATCH 13/42] tigerbeetle: 0.14.177 -> 0.14.178 --- pkgs/by-name/ti/tigerbeetle/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/ti/tigerbeetle/package.nix b/pkgs/by-name/ti/tigerbeetle/package.nix index f496c549087b..8baa7488c396 100644 --- a/pkgs/by-name/ti/tigerbeetle/package.nix +++ b/pkgs/by-name/ti/tigerbeetle/package.nix @@ -14,13 +14,13 @@ let in stdenv.mkDerivation (finalAttrs: { pname = "tigerbeetle"; - version = "0.14.177"; + version = "0.14.178"; src = fetchFromGitHub { owner = "tigerbeetle"; repo = "tigerbeetle"; rev = "refs/tags/${finalAttrs.version}"; - hash = "sha256-oMsDHz/yOWtS1XhJcXR74pA3YvPzANUdRAy7tjNO5lc="; + hash = "sha256-QbNfy9S+h+o6WJTMdNzGsGZhrfCTGTyhcO3psbmQKaU="; }; nativeBuildInputs = [ custom_zig_hook ]; From 275855d632b4991893974e273686811a246cd6f2 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Tue, 6 Feb 2024 22:45:01 +0000 Subject: [PATCH 14/42] nixos: hostapd: drop unused `crda` package import --- nixos/modules/services/networking/hostapd.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/nixos/modules/services/networking/hostapd.nix b/nixos/modules/services/networking/hostapd.nix index 5bd8e1d4d7a0..00482e59acf3 100644 --- a/nixos/modules/services/networking/hostapd.nix +++ b/nixos/modules/services/networking/hostapd.nix @@ -1197,8 +1197,6 @@ in { environment.systemPackages = [cfg.package]; - services.udev.packages = with pkgs; [crda]; - systemd.services.hostapd = { description = "IEEE 802.11 Host Access-Point Daemon"; From c8ed63e8ac6828b8db1037c9db56537c122e28d0 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 6 Feb 2024 23:45:10 +0100 Subject: [PATCH 15/42] python311Packages.motionblinds: 0.6.19 -> 0.6.20 Diff: https://github.com/starkillerOG/motion-blinds/compare/refs/tags/0.6.19...0.6.20 Changelog: https://github.com/starkillerOG/motion-blinds/releases/tag/0.6.20 --- pkgs/development/python-modules/motionblinds/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/motionblinds/default.nix b/pkgs/development/python-modules/motionblinds/default.nix index ef6bd75d5f97..80047154c1b3 100644 --- a/pkgs/development/python-modules/motionblinds/default.nix +++ b/pkgs/development/python-modules/motionblinds/default.nix @@ -7,7 +7,7 @@ buildPythonPackage rec { pname = "motionblinds"; - version = "0.6.19"; + version = "0.6.20"; format = "setuptools"; disabled = pythonOlder "3.7"; @@ -16,7 +16,7 @@ buildPythonPackage rec { owner = "starkillerOG"; repo = "motion-blinds"; rev = "refs/tags/${version}"; - hash = "sha256-t2Y3ASGoMZKlZzbafpAjZHeWgaWS+UsvFd5wyfmJGvE="; + hash = "sha256-Ri14GwRpORk+8RdpPnrOOfDD+sqdQp9ESlYDnaS9ln8="; }; propagatedBuildInputs = [ From 31fc36fcd96da4f7cc232c9beae1771aa919d15d Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Tue, 6 Feb 2024 22:45:47 +0000 Subject: [PATCH 16/42] wireless-regdb: revert "add `crda` to tests" This reverts commit eb657c45f99e64b326ad21eab76df1afb347953b. Prepare for `crda` removal from `nixpkgs`. According to upstream https://lore.kernel.org/linux-wireless/455bafff0d609eb182ba30a5fbf319888e0e961d.camel@sipsolutions.net/ `crda` is not needed for kernels `4.16` or later. Such old kernels are not in `nixpkgs` anymore. --- pkgs/data/misc/wireless-regdb/default.nix | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/pkgs/data/misc/wireless-regdb/default.nix b/pkgs/data/misc/wireless-regdb/default.nix index f2fcd0be4ae4..cc419ffbea15 100644 --- a/pkgs/data/misc/wireless-regdb/default.nix +++ b/pkgs/data/misc/wireless-regdb/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenvNoCC, fetchurl, directoryListingUpdater, crda }: +{ lib, stdenvNoCC, fetchurl, directoryListingUpdater }: stdenvNoCC.mkDerivation rec { pname = "wireless-regdb"; @@ -16,12 +16,7 @@ stdenvNoCC.mkDerivation rec { "PREFIX=" ]; - passthru = { - tests = { - inherit crda; # validate data base signature - }; - updateScript = directoryListingUpdater { }; - }; + passthru.updateScript = directoryListingUpdater { }; meta = with lib; { description = "Wireless regulatory database for CRDA"; From 5e716b3472bf2788d11bb97a47243620284f0cb1 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 6 Feb 2024 23:46:39 +0100 Subject: [PATCH 17/42] python311Packages.motionblinds: refactor --- pkgs/development/python-modules/motionblinds/default.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/motionblinds/default.nix b/pkgs/development/python-modules/motionblinds/default.nix index 80047154c1b3..6e0d245f0f07 100644 --- a/pkgs/development/python-modules/motionblinds/default.nix +++ b/pkgs/development/python-modules/motionblinds/default.nix @@ -3,12 +3,13 @@ , fetchFromGitHub , pycryptodomex , pythonOlder +, setuptools }: buildPythonPackage rec { pname = "motionblinds"; version = "0.6.20"; - format = "setuptools"; + pyproject = true; disabled = pythonOlder "3.7"; @@ -19,6 +20,10 @@ buildPythonPackage rec { hash = "sha256-Ri14GwRpORk+8RdpPnrOOfDD+sqdQp9ESlYDnaS9ln8="; }; + nativeBuildInputs = [ + setuptools + ]; + propagatedBuildInputs = [ pycryptodomex ]; From 8c618c742cdffd547d0c8e9810e1db2e7e185507 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Tue, 6 Feb 2024 22:50:09 +0000 Subject: [PATCH 18/42] crda: remove package According to upstream https://lore.kernel.org/linux-wireless/455bafff0d609eb182ba30a5fbf319888e0e961d.camel@sipsolutions.net/ `crda` is not needed for kernels `4.16` or later. Such old kernels are not in `nixpkgs` anymore. --- pkgs/os-specific/linux/crda/default.nix | 78 ------------------------- pkgs/top-level/aliases.nix | 1 + pkgs/top-level/all-packages.nix | 2 - 3 files changed, 1 insertion(+), 80 deletions(-) delete mode 100644 pkgs/os-specific/linux/crda/default.nix diff --git a/pkgs/os-specific/linux/crda/default.nix b/pkgs/os-specific/linux/crda/default.nix deleted file mode 100644 index ffed5fc36a78..000000000000 --- a/pkgs/os-specific/linux/crda/default.nix +++ /dev/null @@ -1,78 +0,0 @@ -{ lib, stdenv, fetchurl, fetchpatch, libgcrypt, libnl, pkg-config, python3Packages, wireless-regdb }: - -stdenv.mkDerivation rec { - pname = "crda"; - version = "4.14"; - - src = fetchurl { - url = "https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/crda.git/snapshot/crda-${version}.tar.gz"; - sha256 = "sha256-Wo81u4snR09Gaw511FG6kXQz2KqxiJZ4pk2cTnKouMI="; - }; - - patches = [ - # Fix python 3 build: except ImportError, e: SyntaxError: invalid syntax - (fetchpatch { - url = "https://raw.githubusercontent.com/archlinux/svntogit-packages/d234fddf451fab0f4fc412e2769f54e11f10d7d8/trunk/crda-4.14-python-3.patch"; - sha256 = "sha256-KEezEKrfizq9k4ZiE2mf3Nl4JiBayhXeVnFl7wYh28Y="; - }) - - (fetchpatch { - url = "https://raw.githubusercontent.com/archlinux/svntogit-packages/d48ec843222b0d74c85bce86fa6f087c7dfdf952/trunk/0001-Makefile-Link-libreg.so-against-the-crypto-library.patch"; - sha256 = "sha256-j93oydi209f22OF8aXZ/NczuUOnlhkdSeYvy2WRRvm0="; - }) - ]; - - strictDeps = true; - - nativeBuildInputs = [ - pkg-config - python3Packages.m2crypto # only used for a build time script - ]; - - buildInputs = [ - libgcrypt - libnl - ]; - - postPatch = '' - patchShebangs utils/ - substituteInPlace Makefile \ - --replace 'gzip' 'gzip -n' \ - --replace ldconfig true \ - --replace pkg-config $PKG_CONFIG - sed -i crda.c \ - -e "/\/usr\/.*\/regulatory.bin/d" \ - -e "s|/lib/crda|${wireless-regdb}/lib/crda|g" - ''; - - makeFlags = [ - "PREFIX=$(out)" - "SBINDIR=$(out)/bin/" - "UDEV_RULE_DIR=$(out)/lib/udev/rules.d/" - "REG_BIN=${wireless-regdb}/lib/crda/regulatory.bin" - ]; - - buildFlags = [ "all_noverify" ]; - enableParallelBuilding = true; - - doCheck = true; - checkTarget = "verify"; - - meta = with lib; { - description = "Linux wireless Central Regulatory Domain Agent"; - longDescription = '' - CRDA acts as the udev helper for communication between the kernel and - userspace for regulatory compliance. It relies on nl80211 for communication. - - CRDA is intended to be run only through udev communication from the kernel. - To use it under NixOS, add - - services.udev.packages = [ pkgs.crda ]; - - to the system configuration. - ''; - homepage = "https://wireless.wiki.kernel.org/en/developers/regulatory/crda"; - license = licenses.free; # "copyleft-next 0.3.0", as yet without a web site - platforms = platforms.linux; - }; -} diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index f588bb778153..7b5c94d9a9e6 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -173,6 +173,7 @@ mapAliases ({ concurrencykit = libck; # Added 2021-03 connmanPackages = throw "'connmanPackages' was removed and their subpackages/attributes were promoted to top level."; # Added 2023-10-08 convoy = throw "'convoy' has been removed from nixpkgs, as it was archived upstream"; # Added 2023-12-27 + crda = throw "'crda' has been removed from nixpkgs, as it is needed only for kernels before 4.16"; # Added 2024-02-06 cups-kyodialog3 = cups-kyodialog; # Added 2022-11-12 cvs_fast_export = cvs-fast-export; # Added 2021-06-10 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 701ca27a7e13..30b037fbc282 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -27622,8 +27622,6 @@ with pkgs; cramfsswap = callPackage ../os-specific/linux/cramfsswap { }; - crda = callPackage ../os-specific/linux/crda { }; - cshatag = callPackage ../os-specific/linux/cshatag { }; # Darwin package set From 21924d4c931f4149ba26e13d79e17301550040a5 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Tue, 6 Feb 2024 22:53:14 +0000 Subject: [PATCH 19/42] wireless-regdb: 2023.09.01 -> 2024.01.23 (take 2, with crda removed) Now that `crda` is removed from `nixpkgs` we can update `wireless-regdb` to a newer version. --- pkgs/data/misc/wireless-regdb/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/data/misc/wireless-regdb/default.nix b/pkgs/data/misc/wireless-regdb/default.nix index cc419ffbea15..284e6f524de5 100644 --- a/pkgs/data/misc/wireless-regdb/default.nix +++ b/pkgs/data/misc/wireless-regdb/default.nix @@ -2,11 +2,11 @@ stdenvNoCC.mkDerivation rec { pname = "wireless-regdb"; - version = "2023.09.01"; + version = "2024.01.23"; src = fetchurl { url = "https://www.kernel.org/pub/software/network/${pname}/${pname}-${version}.tar.xz"; - hash = "sha256-JtTCpyfMWSObhHNarYVrfH0LBOMKpcI1xPf0f18FNJE="; + hash = "sha256-yKYcms92+n60I56J9kDe4+hwmNn2m001GMnGD8bSDFU="; }; dontBuild = true; From a45d18dbb652b0df5dc776a6e780a8d5732a27ce Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 6 Feb 2024 23:56:41 +0100 Subject: [PATCH 20/42] python311Packages.xknx: 2.11.2 -> 2.12.0 Diff: https://github.com/XKNX/xknx/compare/refs/tags/2.11.2...2.12.0 Changelog: https://github.com/XKNX/xknx/releases/tag/2.12.0 --- .../development/python-modules/xknx/default.nix | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/pkgs/development/python-modules/xknx/default.nix b/pkgs/development/python-modules/xknx/default.nix index 6151edfb5066..91721fdd169a 100644 --- a/pkgs/development/python-modules/xknx/default.nix +++ b/pkgs/development/python-modules/xknx/default.nix @@ -2,7 +2,6 @@ , async-timeout , buildPythonPackage , fetchFromGitHub -, fetchpatch , cryptography , ifaddr , pytest-asyncio @@ -14,26 +13,18 @@ buildPythonPackage rec { pname = "xknx"; - version = "2.11.2"; - format = "pyproject"; + version = "2.12.0"; + pyproject = true; disabled = pythonOlder "3.8"; src = fetchFromGitHub { owner = "XKNX"; - repo = pname; + repo = "xknx"; rev = "refs/tags/${version}"; - hash = "sha256-rKvHb0wkWVuZO8M8uIQdOiY1N6DmGSpqUgz4YYbUfSM="; + hash = "sha256-Fwo76tvkLLx8QJeokuGohhnt83eGBMyWIUSHJGuQWJ4="; }; - patches = [ - (fetchpatch { - name = "unpin-setuptools.patch"; - url = "https://github.com/XKNX/xknx/commit/c0826aec52ab69b8bd81f600bea154fae16f334e.patch"; - hash = "sha256-EpfgEq4pIx7ahqJZalzo30ruj8NlZYHcKHxFXCGL98w="; - }) - ]; - nativeBuildInputs = [ setuptools wheel From d9fd193d2f3943a956669d916ed3f30023187d3c Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 7 Feb 2024 00:01:57 +0100 Subject: [PATCH 21/42] python311Packages.xknxproject: 3.4.1 -> 3.5.0 Diff: https://github.com/XKNX/xknxproject/compare/refs/tags/3.4.1...3.5.0 Changelog: https://github.com/XKNX/xknxproject/releases/tag/3.5.0 --- pkgs/development/python-modules/xknxproject/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/xknxproject/default.nix b/pkgs/development/python-modules/xknxproject/default.nix index 56d08ad5146d..940ab2423374 100644 --- a/pkgs/development/python-modules/xknxproject/default.nix +++ b/pkgs/development/python-modules/xknxproject/default.nix @@ -12,8 +12,8 @@ buildPythonPackage rec { pname = "xknxproject"; - version = "3.4.1"; - format = "pyproject"; + version = "3.5.0"; + pyproject = true; disabled = pythonOlder "3.9"; @@ -21,7 +21,7 @@ buildPythonPackage rec { owner = "XKNX"; repo = "xknxproject"; rev = "refs/tags/${version}"; - hash = "sha256-J257Y8Y0mVtlFHiHju5lxPyV0yx3IAYH8ikbmZlI3fY="; + hash = "sha256-0tnmD5X2wskyX9AKhn3JKwzZFpkKy5cKaGnzkUyjWhk="; }; nativeBuildInputs = [ From 8a43061fa55cda17747c236139aaabf86a0d54f3 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 7 Feb 2024 00:02:18 +0100 Subject: [PATCH 22/42] python311Packages.python-otbr-api: 2.5.0 -> 2.6.0 Diff: https://github.com/home-assistant-libs/python-otbr-api/compare/refs/tags/2.5.0...2.6.0 Changelog: https://github.com/home-assistant-libs/python-otbr-api/releases/tag/2.6.0 --- .../python-otbr-api/default.nix | 20 ++++--------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/pkgs/development/python-modules/python-otbr-api/default.nix b/pkgs/development/python-modules/python-otbr-api/default.nix index d6137cf191e2..675f72d5e035 100644 --- a/pkgs/development/python-modules/python-otbr-api/default.nix +++ b/pkgs/development/python-modules/python-otbr-api/default.nix @@ -4,41 +4,29 @@ , buildPythonPackage , cryptography , fetchFromGitHub -, fetchpatch , pytest-asyncio , pytestCheckHook , pythonOlder , setuptools , voluptuous -, wheel }: buildPythonPackage rec { pname = "python-otbr-api"; - version = "2.5.0"; - format = "pyproject"; + version = "2.6.0"; + pyproject = true; disabled = pythonOlder "3.9"; src = fetchFromGitHub { owner = "home-assistant-libs"; - repo = pname; + repo = "python-otbr-api"; rev = "refs/tags/${version}"; - hash = "sha256-bPN2h60ypjlKpXs1xDS7bZcGRXvatA3EdlAX/HLxxTM="; + hash = "sha256-RMj4NdEbMIxh2PDzbhUWgmcdzRXY8RxcQNN/bbGOW5Q="; }; - patches = [ - # https://github.com/home-assistant-libs/python-otbr-api/pull/68 - (fetchpatch { - name = "relax-setuptools-dependency.patch"; - url = "https://github.com/home-assistant-libs/python-otbr-api/commit/37eb19c12d17ac7d040ded035d8401def872fbda.patch"; - hash = "sha256-JGsaLQNbUfz0uK/MeGnR2XTJDs4RnTOEg7BavfDPArg="; - }) - ]; - nativeBuildInputs = [ setuptools - wheel ]; propagatedBuildInputs = [ From 50d2bdfbe325c97a83c404f5811511098a362be2 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 7 Feb 2024 00:12:42 +0100 Subject: [PATCH 23/42] python311Packages.boto3-stubs: 1.34.35 -> 1.34.36 --- pkgs/development/python-modules/boto3-stubs/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/boto3-stubs/default.nix b/pkgs/development/python-modules/boto3-stubs/default.nix index 0657088a9cce..858fb617c8b6 100644 --- a/pkgs/development/python-modules/boto3-stubs/default.nix +++ b/pkgs/development/python-modules/boto3-stubs/default.nix @@ -365,14 +365,14 @@ buildPythonPackage rec { pname = "boto3-stubs"; - version = "1.34.35"; + version = "1.34.36"; pyproject = true; disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - hash = "sha256-kXJa7GEJ+bTR03pQ58lHjOnK9B1b196+gKMew+H4SlA="; + hash = "sha256-AvhzNyVC7Seap0a5kIX5UyAyhUeyp7A0R7bZAMZ5XtI="; }; nativeBuildInputs = [ From 14a041aa79811bfdd31e2383d597b8af978a116d Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 7 Feb 2024 00:13:10 +0100 Subject: [PATCH 24/42] python311Packages.botocore-stubs: 1.34.35 -> 1.34.36 --- pkgs/development/python-modules/botocore-stubs/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/botocore-stubs/default.nix b/pkgs/development/python-modules/botocore-stubs/default.nix index 953a80219c40..ce45115603f0 100644 --- a/pkgs/development/python-modules/botocore-stubs/default.nix +++ b/pkgs/development/python-modules/botocore-stubs/default.nix @@ -9,7 +9,7 @@ buildPythonPackage rec { pname = "botocore-stubs"; - version = "1.34.35"; + version = "1.34.36"; format = "pyproject"; disabled = pythonOlder "3.7"; @@ -17,7 +17,7 @@ buildPythonPackage rec { src = fetchPypi { pname = "botocore_stubs"; inherit version; - hash = "sha256-312PNpggpky4TxJKKEG2IDDz6Gtr0HlJN276sxw4RcU="; + hash = "sha256-+VvELnYPQr54AgvmqJ6lzrMHtgRzDiyiVdmMrkhoM40="; }; nativeBuildInputs = [ From 9d6ec0c45ae807995ea30293015c995764ad4b64 Mon Sep 17 00:00:00 2001 From: Trent Small Date: Thu, 1 Feb 2024 16:11:27 -0700 Subject: [PATCH 25/42] ocamlPackages.res: init at 5.0.1 --- .../development/ocaml-modules/res/default.nix | 24 +++++++++++++++++++ pkgs/top-level/ocaml-packages.nix | 2 ++ 2 files changed, 26 insertions(+) create mode 100644 pkgs/development/ocaml-modules/res/default.nix diff --git a/pkgs/development/ocaml-modules/res/default.nix b/pkgs/development/ocaml-modules/res/default.nix new file mode 100644 index 000000000000..779a3c3d8a5f --- /dev/null +++ b/pkgs/development/ocaml-modules/res/default.nix @@ -0,0 +1,24 @@ +{ lib , fetchurl , buildDunePackage }: + +buildDunePackage rec { + pname = "res"; + version = "5.0.1"; + + minimalOCamlVersion = "4.08"; + + src = fetchurl { + url = "https://github.com/mmottl/res/releases/download/${version}/res-${version}.tbz"; + hash = "sha256-rSrDMQBfnbWAr2LuajP3fveOtOwLyRbKPkaTKsnocQ4="; + }; + + doCheck = true; + + meta = { + description = "Library for resizable, contiguous datastructures"; + homepage = "https://github.com/mmottl/res"; + changelog = "https://github.com/mmottl/res/blob/${version}/CHANGES.md"; + license = lib.licenses.lgpl2Plus; + maintainers = with lib.maintainers; [ sixstring982 ]; + }; +} + diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index 8f5004d66c96..0dfdbdfc8c0a 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -1608,6 +1608,8 @@ let repr = callPackage ../development/ocaml-modules/repr { }; + res = callPackage ../development/ocaml-modules/res { }; + resource-pooling = callPackage ../development/ocaml-modules/resource-pooling { }; resto = callPackage ../development/ocaml-modules/resto { }; From b141f3467b7c2a0aa04686bfd039031c01e7652c Mon Sep 17 00:00:00 2001 From: Trent Small Date: Thu, 1 Feb 2024 16:11:59 -0700 Subject: [PATCH 26/42] ocamlPackages.capnp: init at 3.6.0 --- .../ocaml-modules/capnp/default.nix | 56 +++++++++++++++++++ pkgs/top-level/ocaml-packages.nix | 2 + 2 files changed, 58 insertions(+) create mode 100644 pkgs/development/ocaml-modules/capnp/default.nix diff --git a/pkgs/development/ocaml-modules/capnp/default.nix b/pkgs/development/ocaml-modules/capnp/default.nix new file mode 100644 index 000000000000..2d405dceaab1 --- /dev/null +++ b/pkgs/development/ocaml-modules/capnp/default.nix @@ -0,0 +1,56 @@ +{ lib +, buildDunePackage +, fetchFromGitHub +, base_quickcheck ? null +, capnproto +, ocplib-endian +, ounit2 +, res +, result +, stdint +, stdio +}: + +buildDunePackage rec { + pname = "capnp"; + version = "3.6.0"; + + minimalOCamlVersion = "4.08"; + + src = fetchFromGitHub { + owner = "capnproto"; + repo = "capnp-ocaml"; + rev = "v${version}"; + hash = "sha256-G4B1llsHnGcuGIarDB248QMaRBvS47IEQB5B93wY7nA="; + }; + + nativeBuildInputs = [ + capnproto + ]; + + buildInputs = [ + stdio + ]; + + propagatedBuildInputs = [ + ocplib-endian + res + result + stdint + ]; + + checkInputs = [ + base_quickcheck + ounit2 + ]; + + doCheck = true; + + meta = { + description = "OCaml code generation plugin for the Cap'n Proto serialization framework"; + homepage = "https://github.com/capnproto/capnp-ocaml"; + changelog = "https://github.com/capnproto/capnp-ocaml/blob/${version}/CHANGES.md"; + license = lib.licenses.bsd2; + maintainers = with lib.maintainers; [ sixstring982 ]; + }; +} diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index 0dfdbdfc8c0a..5e59435d789b 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -156,6 +156,8 @@ let then callPackage ../development/ocaml-modules/camomile { } else callPackage ../development/ocaml-modules/camomile/0.8.5.nix { }; + capnp = callPackage ../development/ocaml-modules/capnp { }; + caqti = callPackage ../development/ocaml-modules/caqti { }; caqti-async = callPackage ../development/ocaml-modules/caqti/async.nix { }; From bea217ba83f3c61d5cfa1336e1768765c0ca4b35 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Wed, 7 Feb 2024 06:25:46 +0000 Subject: [PATCH 27/42] croc: 9.6.6 -> 9.6.8 --- pkgs/tools/networking/croc/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/networking/croc/default.nix b/pkgs/tools/networking/croc/default.nix index ffc8579869ca..68a426d10270 100644 --- a/pkgs/tools/networking/croc/default.nix +++ b/pkgs/tools/networking/croc/default.nix @@ -2,16 +2,16 @@ buildGoModule rec { pname = "croc"; - version = "9.6.6"; + version = "9.6.8"; src = fetchFromGitHub { owner = "schollz"; repo = pname; rev = "v${version}"; - sha256 = "sha256-y2uS6GlqxfBpLE+6cOl+vLI+KSZ1ThFMjnUNEGplnxM="; + sha256 = "sha256-AiRtEXYWu7Y2D7pNnOrmkT3YQ3FUEHHWuEwJrABPkX0="; }; - vendorHash = "sha256-JLNbRmiO38M+JQiSJfxFcdFYrEyNBA1KOHnxbjaCusE="; + vendorHash = "sha256-Qt+NMpcEHn6K6rA+rxkW6uqTBvjbMkUK1KvmvUHJ8XM="; subPackages = [ "." ]; From d5917b14b367fe517070503f6a93881991424961 Mon Sep 17 00:00:00 2001 From: Sandro Date: Wed, 7 Feb 2024 08:14:34 +0100 Subject: [PATCH 28/42] mk-python-derivation: fix passthru.updateScript being merged into the derivation (#241922) Before updateScript was being merged to pdm.updateScript. With this commit it is being moved to the expected location pdm.passthru.updateScript --- .../interpreters/python/mk-python-derivation.nix | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pkgs/development/interpreters/python/mk-python-derivation.nix b/pkgs/development/interpreters/python/mk-python-derivation.nix index e6f9087de866..6944f70a4918 100644 --- a/pkgs/development/interpreters/python/mk-python-derivation.nix +++ b/pkgs/development/interpreters/python/mk-python-derivation.nix @@ -308,7 +308,10 @@ let passthru.updateScript = let filename = builtins.head (lib.splitString ":" self.meta.position); in attrs.passthru.updateScript or [ update-python-libraries filename ]; -in lib.extendDerivation - (disabled -> throw "${name} not supported for interpreter ${python.executable}") - passthru - self +in + if disabled then + throw "${name} not supported for interpreter ${python.executable}" +else + self.overrideAttrs (attrs: { + passthru = lib.recursiveUpdate passthru attrs.passthru; + }) From d15652a1afbdcac74b00e049ab1ab2ce278f2a3b Mon Sep 17 00:00:00 2001 From: Rodney Lorrimar Date: Fri, 2 Feb 2024 13:02:13 +0800 Subject: [PATCH 29/42] phoc: Update source url to point to new releases page --- pkgs/applications/misc/phoc/default.nix | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/pkgs/applications/misc/phoc/default.nix b/pkgs/applications/misc/phoc/default.nix index 9853cf5f8844..bb5dcf91d48d 100644 --- a/pkgs/applications/misc/phoc/default.nix +++ b/pkgs/applications/misc/phoc/default.nix @@ -17,7 +17,7 @@ , libxkbcommon , wlroots , xorg -, gitUpdater +, directoryListingUpdater , nixosTests }: @@ -39,7 +39,7 @@ in stdenv.mkDerivation rec { src = fetchurl { # This tarball includes the meson wrapped subproject 'gmobile'. - url = "https://storage.puri.sm/releases/phoc/phoc-${version}.tar.xz"; + url = "https://sources.phosh.mobi/releases/phoc/phoc-${version}.tar.xz"; hash = "sha256-P7Bs9JMv6KNKo4d2ID0/Ba4+Nel6DMn8o4I7EDvY4vY="; }; @@ -74,10 +74,7 @@ in stdenv.mkDerivation rec { passthru = { tests.phosh = nixosTests.phosh; - updateScript = gitUpdater { - url = "https://gitlab.gnome.org/World/Phosh/phoc"; - rev-prefix = "v"; - }; + updateScript = directoryListingUpdater { }; }; meta = with lib; { From ea05237d93e7ca8ec101bfe557a34ba29b2725f5 Mon Sep 17 00:00:00 2001 From: Rodney Lorrimar Date: Fri, 2 Feb 2024 13:07:26 +0800 Subject: [PATCH 30/42] phoc: Provide patched wlroots as mkDerivation attribute This lets users more easily override phoc and its wlroots. Also the wlroots patch is taken from the phoc source tree, rather than from GitLab. This way, the patch is automatically updated along with source updates. --- pkgs/applications/misc/phoc/default.nix | 37 +++++++++++++------------ 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/pkgs/applications/misc/phoc/default.nix b/pkgs/applications/misc/phoc/default.nix index bb5dcf91d48d..dff1b179f1c5 100644 --- a/pkgs/applications/misc/phoc/default.nix +++ b/pkgs/applications/misc/phoc/default.nix @@ -1,7 +1,7 @@ { lib , stdenv +, stdenvNoCC , fetchurl -, fetchpatch , meson , ninja , pkg-config @@ -21,25 +21,13 @@ , nixosTests }: -let - phocWlroots = wlroots.overrideAttrs (old: { - patches = (old.patches or []) ++ [ - # Revert "layer-shell: error on 0 dimension without anchors" - # https://source.puri.sm/Librem5/phosh/-/issues/422 - (fetchpatch { - name = "0001-Revert-layer-shell-error-on-0-dimension-without-anch.patch"; - url = "https://gitlab.gnome.org/World/Phosh/phoc/-/raw/acb17171267ae0934f122af294d628ad68b09f88/subprojects/packagefiles/wlroots/0001-Revert-layer-shell-error-on-0-dimension-without-anch.patch"; - hash = "sha256-uNJaYwkZImkzNUEqyLCggbXAoIRX5h2eJaGbSHj1B+o="; - }) - ]; - }); -in stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "phoc"; version = "0.31.0"; src = fetchurl { # This tarball includes the meson wrapped subproject 'gmobile'. - url = "https://sources.phosh.mobi/releases/phoc/phoc-${version}.tar.xz"; + url = with finalAttrs; "https://sources.phosh.mobi/releases/${pname}/${pname}-${version}.tar.xz"; hash = "sha256-P7Bs9JMv6KNKo4d2ID0/Ba4+Nel6DMn8o4I7EDvY4vY="; }; @@ -61,12 +49,27 @@ in stdenv.mkDerivation rec { # For keybindings settings schemas gnome.mutter wayland - phocWlroots + finalAttrs.wlroots xorg.xcbutilwm ]; mesonFlags = ["-Dembed-wlroots=disabled"]; + # Patch wlroots to remove a check which crashes Phosh. + # This patch can be found within the phoc source tree. + wlroots = wlroots.overrideAttrs (old: { + patches = (old.patches or []) ++ [ + (stdenvNoCC.mkDerivation { + name = "0001-Revert-layer-shell-error-on-0-dimension-without-anch.patch"; + inherit (finalAttrs) src; + preferLocalBuild = true; + allowSubstitutes = false; + phases = "unpackPhase installPhase"; + installPhase = "cp subprojects/packagefiles/wlroots/$name $out"; + }) + ]; + }); + postPatch = '' chmod +x build-aux/post_install.py patchShebangs build-aux/post_install.py @@ -84,4 +87,4 @@ in stdenv.mkDerivation rec { maintainers = with maintainers; [ masipcat tomfitzhenry zhaofengli ]; platforms = platforms.linux; }; -} +}) From 6885a4db8f923f8a809a4367c80c313024a2dbe5 Mon Sep 17 00:00:00 2001 From: Rodney Lorrimar Date: Fri, 2 Feb 2024 05:12:24 +0000 Subject: [PATCH 31/42] phoc: 0.31.0 -> 0.35.0 --- pkgs/applications/misc/phoc/default.nix | 9 ++------- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/pkgs/applications/misc/phoc/default.nix b/pkgs/applications/misc/phoc/default.nix index dff1b179f1c5..72348209580f 100644 --- a/pkgs/applications/misc/phoc/default.nix +++ b/pkgs/applications/misc/phoc/default.nix @@ -23,12 +23,12 @@ stdenv.mkDerivation (finalAttrs: { pname = "phoc"; - version = "0.31.0"; + version = "0.35.0"; src = fetchurl { # This tarball includes the meson wrapped subproject 'gmobile'. url = with finalAttrs; "https://sources.phosh.mobi/releases/${pname}/${pname}-${version}.tar.xz"; - hash = "sha256-P7Bs9JMv6KNKo4d2ID0/Ba4+Nel6DMn8o4I7EDvY4vY="; + hash = "sha256-q2wyM0R7Mi/XuckNb6ZDkStaV9yJH1BgJ4cjqQc6EI4="; }; nativeBuildInputs = [ @@ -70,11 +70,6 @@ stdenv.mkDerivation (finalAttrs: { ]; }); - postPatch = '' - chmod +x build-aux/post_install.py - patchShebangs build-aux/post_install.py - ''; - passthru = { tests.phosh = nixosTests.phosh; updateScript = directoryListingUpdater { }; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 701ca27a7e13..28f2988c89a2 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -12018,7 +12018,7 @@ with pkgs; pfstools = libsForQt5.callPackage ../tools/graphics/pfstools { }; phoc = callPackage ../applications/misc/phoc { - wlroots = wlroots_0_16; + wlroots = wlroots_0_17; }; phockup = callPackage ../applications/misc/phockup { }; From bc695020db880c0e7e9321ff19748f5805091732 Mon Sep 17 00:00:00 2001 From: Rodney Lorrimar Date: Thu, 1 Feb 2024 16:05:39 +0800 Subject: [PATCH 32/42] phoc: add passthru.tests.version --- pkgs/applications/misc/phoc/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/applications/misc/phoc/default.nix b/pkgs/applications/misc/phoc/default.nix index 72348209580f..ba235aab2b05 100644 --- a/pkgs/applications/misc/phoc/default.nix +++ b/pkgs/applications/misc/phoc/default.nix @@ -19,6 +19,7 @@ , xorg , directoryListingUpdater , nixosTests +, testers }: stdenv.mkDerivation (finalAttrs: { @@ -72,6 +73,9 @@ stdenv.mkDerivation (finalAttrs: { passthru = { tests.phosh = nixosTests.phosh; + tests.version = testers.testVersion { + package = finalAttrs.finalPackage; + }; updateScript = directoryListingUpdater { }; }; From 45cac73752e4b7ec13be57d96d1174af3555d268 Mon Sep 17 00:00:00 2001 From: Rodney Lorrimar Date: Fri, 2 Feb 2024 12:13:18 +0800 Subject: [PATCH 33/42] phosh: 0.33.0 -> 0.34.1, use release tarball for src --- .../window-managers/phosh/default.nix | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/pkgs/applications/window-managers/phosh/default.nix b/pkgs/applications/window-managers/phosh/default.nix index 9e009e1f128c..3665d9ca3a2c 100644 --- a/pkgs/applications/window-managers/phosh/default.nix +++ b/pkgs/applications/window-managers/phosh/default.nix @@ -1,7 +1,7 @@ { lib , stdenv -, fetchFromGitLab -, gitUpdater +, fetchurl +, directoryListingUpdater , meson , ninja , pkg-config @@ -36,16 +36,12 @@ stdenv.mkDerivation rec { pname = "phosh"; - version = "0.33.0"; + version = "0.34.1"; - src = fetchFromGitLab { - domain = "gitlab.gnome.org"; - group = "World"; - owner = "Phosh"; - repo = pname; - rev = "v${version}"; - fetchSubmodules = true; # including gvc and libcall-ui which are designated as subprojects - sha256 = "sha256-t+1MYfsz7KqsMvN8TyLIUrTLTQPWQQpOSk/ysxgE7kg="; + src = fetchurl { + # Release tarball which includes subprojects gvc and libcall-ui + url = "https://sources.phosh.mobi/releases/${pname}/${pname}-${version}.tar.xz"; + hash = "sha256-nuPFhfnpLIHn1z3nQE7Lg3j75uIogWJatL4oGuoy1PE="; }; nativeBuildInputs = [ @@ -126,9 +122,7 @@ stdenv.mkDerivation rec { tests.phosh = nixosTests.phosh; - updateScript = gitUpdater { - rev-prefix = "v"; - }; + updateScript = directoryListingUpdater { }; }; meta = with lib; { From d1b00d0765502651990a85d51105bfedc17a845a Mon Sep 17 00:00:00 2001 From: Rodney Lorrimar Date: Thu, 1 Feb 2024 11:45:59 +0800 Subject: [PATCH 34/42] phosh: 0.34.1 -> 0.35.0 --- pkgs/applications/window-managers/phosh/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/window-managers/phosh/default.nix b/pkgs/applications/window-managers/phosh/default.nix index 3665d9ca3a2c..6147d3e1cb59 100644 --- a/pkgs/applications/window-managers/phosh/default.nix +++ b/pkgs/applications/window-managers/phosh/default.nix @@ -36,12 +36,12 @@ stdenv.mkDerivation rec { pname = "phosh"; - version = "0.34.1"; + version = "0.35.0"; src = fetchurl { # Release tarball which includes subprojects gvc and libcall-ui url = "https://sources.phosh.mobi/releases/${pname}/${pname}-${version}.tar.xz"; - hash = "sha256-nuPFhfnpLIHn1z3nQE7Lg3j75uIogWJatL4oGuoy1PE="; + hash = "sha256-hfm89G9uxVc8j8rDOg1ytI+Pm9s9WQWazH3yLZdWSRg="; }; nativeBuildInputs = [ From a45634d41506651da468dcff8f7a22bd2073b71c Mon Sep 17 00:00:00 2001 From: Rodney Lorrimar Date: Fri, 2 Feb 2024 12:27:13 +0800 Subject: [PATCH 35/42] phosh-mobile-settings: 0.23.1 -> 0.31.0, use release tarball for src --- .../phosh/phosh-mobile-settings.nix | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/pkgs/applications/window-managers/phosh/phosh-mobile-settings.nix b/pkgs/applications/window-managers/phosh/phosh-mobile-settings.nix index c09df0065ef4..b78784ef0a7c 100644 --- a/pkgs/applications/window-managers/phosh/phosh-mobile-settings.nix +++ b/pkgs/applications/window-managers/phosh/phosh-mobile-settings.nix @@ -1,7 +1,7 @@ { lib , stdenv -, fetchFromGitLab -, gitUpdater +, fetchurl +, directoryListingUpdater , meson , ninja , pkg-config @@ -18,14 +18,12 @@ stdenv.mkDerivation rec { pname = "phosh-mobile-settings"; - version = "0.23.1"; + version = "0.31.0"; - src = fetchFromGitLab { - domain = "gitlab.gnome.org"; - owner = "guidog"; - repo = "phosh-mobile-settings"; - rev = "v${version}"; - sha256 = "sha256-D605efn25Dl3Bj92DZiagcx+MMcRz0GRaWxplBRcZhA="; + src = fetchurl { + # This tarball includes the meson wrapped subproject 'gmobile'. + url = "https://sources.phosh.mobi/releases/${pname}/${pname}-${version}.tar.xz"; + hash = "sha256-5Qa6LSOLvZL0sFh2co9AqyS5ZTQQ+JRnPiHuMl1UgDI="; }; nativeBuildInputs = [ @@ -57,9 +55,7 @@ stdenv.mkDerivation rec { --replace 'Exec=phosh-mobile-settings' "Exec=$out/bin/phosh-mobile-settings" ''; - passthru.updateScript = gitUpdater { - rev-prefix = "v"; - }; + passthru.updateScript = directoryListingUpdater { }; meta = with lib; { description = "A settings app for mobile specific things"; From 6263d48ee01bd31bf05b55151b078607b79af05c Mon Sep 17 00:00:00 2001 From: Rodney Lorrimar Date: Fri, 2 Feb 2024 04:30:15 +0000 Subject: [PATCH 36/42] phosh-mobile-settings: 0.31.0 -> 0.35.1 --- .../phosh/phosh-mobile-settings.nix | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/window-managers/phosh/phosh-mobile-settings.nix b/pkgs/applications/window-managers/phosh/phosh-mobile-settings.nix index b78784ef0a7c..ed67a9635695 100644 --- a/pkgs/applications/window-managers/phosh/phosh-mobile-settings.nix +++ b/pkgs/applications/window-managers/phosh/phosh-mobile-settings.nix @@ -14,16 +14,18 @@ , phoc , phosh , wayland-protocols +, json-glib +, gsound }: stdenv.mkDerivation rec { pname = "phosh-mobile-settings"; - version = "0.31.0"; + version = "0.35.1"; src = fetchurl { # This tarball includes the meson wrapped subproject 'gmobile'. url = "https://sources.phosh.mobi/releases/${pname}/${pname}-${version}.tar.xz"; - hash = "sha256-5Qa6LSOLvZL0sFh2co9AqyS5ZTQQ+JRnPiHuMl1UgDI="; + hash = "sha256-Kg3efPs0knbJ9b0buIkgqIL1XplcZpGIi0hxJptG6UI="; }; nativeBuildInputs = [ @@ -42,15 +44,23 @@ stdenv.mkDerivation rec { lm_sensors phoc wayland-protocols + json-glib + gsound ]; + postPatch = '' + # There are no schemas to compile. + substituteInPlace meson.build \ + --replace 'glib_compile_schemas: true' 'glib_compile_schemas: false' + ''; + postInstall = '' # this is optional, but without it phosh-mobile-settings won't know about lock screen plugins ln -s '${phosh}/lib/phosh' "$out/lib/phosh" # .desktop files marked `OnlyShowIn=Phosh;` aren't displayed even in our phosh, so remove that. # also make the Exec path absolute. - substituteInPlace "$out/share/applications/org.sigxcpu.MobileSettings.desktop" \ + substituteInPlace "$out/share/applications/mobi.phosh.MobileSettings.desktop" \ --replace 'OnlyShowIn=Phosh;' "" \ --replace 'Exec=phosh-mobile-settings' "Exec=$out/bin/phosh-mobile-settings" ''; From 1326c3dbb4c1ad80fb5004fff3102f7df6f69207 Mon Sep 17 00:00:00 2001 From: Rodney Lorrimar Date: Sat, 3 Feb 2024 10:48:58 +0800 Subject: [PATCH 37/42] phosh-mobile-settings: set meta.maintainers to self https://github.com/NixOS/nixpkgs/pull/285487#issuecomment-1924673842 --- .../window-managers/phosh/phosh-mobile-settings.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/window-managers/phosh/phosh-mobile-settings.nix b/pkgs/applications/window-managers/phosh/phosh-mobile-settings.nix index ed67a9635695..e37f4c767e2b 100644 --- a/pkgs/applications/window-managers/phosh/phosh-mobile-settings.nix +++ b/pkgs/applications/window-managers/phosh/phosh-mobile-settings.nix @@ -72,7 +72,7 @@ stdenv.mkDerivation rec { homepage = "https://gitlab.gnome.org/guidog/phosh-mobile-settings"; changelog = "https://gitlab.gnome.org/guidog/phosh-mobile-settings/-/blob/v${version}/debian/changelog"; license = licenses.gpl3Plus; - maintainers = with maintainers; [ colinsane ]; + maintainers = with maintainers; [ rvl ]; platforms = platforms.linux; }; } From 42952e0ea27fd88d39f9350aca33b6883fe96236 Mon Sep 17 00:00:00 2001 From: Rodney Lorrimar Date: Tue, 6 Feb 2024 11:10:14 +0800 Subject: [PATCH 38/42] phosh: build tweaks --- .../window-managers/phosh/default.nix | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/pkgs/applications/window-managers/phosh/default.nix b/pkgs/applications/window-managers/phosh/default.nix index 6147d3e1cb59..52d5ee053be1 100644 --- a/pkgs/applications/window-managers/phosh/default.nix +++ b/pkgs/applications/window-managers/phosh/default.nix @@ -6,7 +6,7 @@ , ninja , pkg-config , python3 -, wrapGAppsHook +, wrapGAppsHook4 , libadwaita , libhandy , libxkbcommon @@ -34,13 +34,13 @@ , nixosTests }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "phosh"; version = "0.35.0"; src = fetchurl { # Release tarball which includes subprojects gvc and libcall-ui - url = "https://sources.phosh.mobi/releases/${pname}/${pname}-${version}.tar.xz"; + url = with finalAttrs; "https://sources.phosh.mobi/releases/${pname}/${pname}-${version}.tar.xz"; hash = "sha256-hfm89G9uxVc8j8rDOg1ytI+Pm9s9WQWazH3yLZdWSRg="; }; @@ -50,7 +50,7 @@ stdenv.mkDerivation rec { ninja pkg-config python3 - wrapGAppsHook + wrapGAppsHook4 ]; buildInputs = [ @@ -90,7 +90,10 @@ stdenv.mkDerivation rec { "-Dsystemd=true" "-Dcompositor=${phoc}/bin/phoc" # https://github.com/NixOS/nixpkgs/issues/36468 + # https://gitlab.gnome.org/World/Phosh/phosh/-/merge_requests/1363 "-Dc_args=-I${glib.dev}/include/gio-unix-2.0" + # Save some time building if tests are disabled + "-Dtests=${lib.boolToString finalAttrs.finalPackage.doCheck}" ]; checkPhase = '' @@ -128,10 +131,10 @@ stdenv.mkDerivation rec { meta = with lib; { description = "A pure Wayland shell prototype for GNOME on mobile devices"; homepage = "https://gitlab.gnome.org/World/Phosh/phosh"; - changelog = "https://gitlab.gnome.org/World/Phosh/phosh/-/blob/v${version}/debian/changelog"; + changelog = "https://gitlab.gnome.org/World/Phosh/phosh/-/blob/v${finalAttrs.version}/debian/changelog"; license = licenses.gpl3Plus; maintainers = with maintainers; [ masipcat tomfitzhenry zhaofengli ]; platforms = platforms.linux; mainProgram = "phosh-session"; }; -} +}) From a9982a78ee7057eb58e988d865156ed41e690ba8 Mon Sep 17 00:00:00 2001 From: Rodney Lorrimar Date: Tue, 6 Feb 2024 12:52:59 +0800 Subject: [PATCH 39/42] phosh: Use wayland session desktop entry from upstream --- pkgs/applications/window-managers/phosh/default.nix | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/pkgs/applications/window-managers/phosh/default.nix b/pkgs/applications/window-managers/phosh/default.nix index 52d5ee053be1..62ae5f40aa0d 100644 --- a/pkgs/applications/window-managers/phosh/default.nix +++ b/pkgs/applications/window-managers/phosh/default.nix @@ -113,18 +113,9 @@ stdenv.mkDerivation (finalAttrs: { ) ''; - postFixup = '' - mkdir -p $out/share/wayland-sessions - ln -s $out/share/applications/sm.puri.Phosh.desktop $out/share/wayland-sessions/ - ''; - passthru = { - providedSessions = [ - "sm.puri.Phosh" - ]; - + providedSessions = [ "phosh" ]; tests.phosh = nixosTests.phosh; - updateScript = directoryListingUpdater { }; }; From 8513f69b24a08de94af164aa068b90ad0da74630 Mon Sep 17 00:00:00 2001 From: Rodney Lorrimar Date: Tue, 6 Feb 2024 16:12:15 +0800 Subject: [PATCH 40/42] nixos/phosh: Ensure that desktop session is identified as Phosh --- .../services/x11/desktop-managers/phosh.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/nixos/modules/services/x11/desktop-managers/phosh.nix b/nixos/modules/services/x11/desktop-managers/phosh.nix index 5392ab73aeb8..75e02130addc 100644 --- a/nixos/modules/services/x11/desktop-managers/phosh.nix +++ b/nixos/modules/services/x11/desktop-managers/phosh.nix @@ -186,6 +186,21 @@ in UtmpIdentifier = "tty7"; UtmpMode = "user"; }; + environment = { + # We are running without a display manager, so need to provide + # a value for XDG_CURRENT_DESKTOP. + # + # Among other things, this variable influences: + # - visibility of desktop entries with "OnlyShowIn=Phosh;" + # https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-1.5.html#key-onlyshowin + # - the chosen xdg-desktop-portal configuration. + # https://flatpak.github.io/xdg-desktop-portal/docs/portals.conf.html + XDG_CURRENT_DESKTOP = "Phosh:GNOME"; + # pam_systemd uses these to identify the session in logind. + # https://www.freedesktop.org/software/systemd/man/latest/pam_systemd.html#desktop= + XDG_SESSION_DESKTOP = "phosh"; + XDG_SESSION_TYPE = "wayland"; + }; }; environment.systemPackages = [ From d1238f3546b55cda310d74eeacb239c8c7c8b78e Mon Sep 17 00:00:00 2001 From: Rodney Lorrimar Date: Tue, 6 Feb 2024 13:08:09 +0800 Subject: [PATCH 41/42] phosh-mobile-settings: Drop desktop entry tweaks The app launcher will appear under Phosh without these changes. --- .../window-managers/phosh/phosh-mobile-settings.nix | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pkgs/applications/window-managers/phosh/phosh-mobile-settings.nix b/pkgs/applications/window-managers/phosh/phosh-mobile-settings.nix index e37f4c767e2b..3d0517386d69 100644 --- a/pkgs/applications/window-managers/phosh/phosh-mobile-settings.nix +++ b/pkgs/applications/window-managers/phosh/phosh-mobile-settings.nix @@ -57,12 +57,6 @@ stdenv.mkDerivation rec { postInstall = '' # this is optional, but without it phosh-mobile-settings won't know about lock screen plugins ln -s '${phosh}/lib/phosh' "$out/lib/phosh" - - # .desktop files marked `OnlyShowIn=Phosh;` aren't displayed even in our phosh, so remove that. - # also make the Exec path absolute. - substituteInPlace "$out/share/applications/mobi.phosh.MobileSettings.desktop" \ - --replace 'OnlyShowIn=Phosh;' "" \ - --replace 'Exec=phosh-mobile-settings' "Exec=$out/bin/phosh-mobile-settings" ''; passthru.updateScript = directoryListingUpdater { }; From f4f9d00a45a7757a647f99d165e2800911472b82 Mon Sep 17 00:00:00 2001 From: zowoq <59103226+zowoq@users.noreply.github.com> Date: Wed, 7 Feb 2024 08:13:59 +1000 Subject: [PATCH 42/42] go_1_20: 1.20.13 -> 1.20.14 Changelog: https://go.dev/doc/devel/release#go1.20 --- pkgs/development/compilers/go/1.20.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/compilers/go/1.20.nix b/pkgs/development/compilers/go/1.20.nix index 2adeaf69bb11..5b3cbdd4cc81 100644 --- a/pkgs/development/compilers/go/1.20.nix +++ b/pkgs/development/compilers/go/1.20.nix @@ -46,11 +46,11 @@ let in stdenv.mkDerivation (finalAttrs: { pname = "go"; - version = "1.20.13"; + version = "1.20.14"; src = fetchurl { url = "https://go.dev/dl/go${finalAttrs.version}.src.tar.gz"; - hash = "sha256-D+dFxTDy8dZxk688XqJSRr4HeYnsUXjfJm6XXzUyRJ4="; + hash = "sha256-Gu8yGg4+OLfpHS1+tkBAZmyr3Md9OD3jyVItDWm2f04="; }; strictDeps = true;