From 67b0b91e70e60b23945ccdb4c0b9c013efaca14e Mon Sep 17 00:00:00 2001 From: Guanran Wang Date: Sun, 6 Oct 2024 18:39:55 +0800 Subject: [PATCH] mumble-git: init at 1.5.634-unstable-2024-10-05 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit no more qt5 >:) Version 256 -> 257: mumble: 1.5.634, 1.5.634-fish → 1.5.634-unstable-2024-10-05, 1.5.634-unstable-2024-10-05-fish, -174.6 KiB qtbase: 5.15.14 → ∅, -46431.0 KiB qtdeclarative: 5.15.14 → ∅, -21670.9 KiB qtquickcontrols: 5.15.14 → ∅, -5387.2 KiB qtsvg: 5.15.14 → ∅, -568.6 KiB qttools: 5.15.14 → ∅, -11973.5 KiB qttranslations: 5.15.14 → ∅, -15127.5 KiB qtwayland: 5.15.14 → ∅, -6992.5 KiB --- flake.nix | 11 +++- home/default.nix | 44 ++++++++------ pkgs/default.nix | 3 - pkgs/mumble-git/package.nix | 118 ++++++++++++++++++++++++++++++++++++ 4 files changed, 154 insertions(+), 22 deletions(-) delete mode 100644 pkgs/default.nix create mode 100644 pkgs/mumble-git/package.nix diff --git a/flake.nix b/flake.nix index f8ded1e..dbe74f4 100644 --- a/flake.nix +++ b/flake.nix @@ -114,7 +114,16 @@ checks.formatting = treefmtEval.config.build.check inputs.self; # nix {run,shell,build} - legacyPackages = import ./pkgs pkgs; + # NOTE: 301: All packages are migrated to `github:Guanran928/nur-packages`, + # only keeping some packages that only fits for personal use. + legacyPackages = + pkgs.lib.packagesFromDirectoryRecursive { + inherit (pkgs) callPackage; + directory = ./pkgs; + } + // { + background = pkgs.nixos-artwork.wallpapers.nineish-dark-gray.src; + }; # nix develop devShells.default = pkgs.mkShellNoCC { diff --git a/home/default.nix b/home/default.nix index 7cb1751..ef30aa8 100644 --- a/home/default.nix +++ b/home/default.nix @@ -1,4 +1,9 @@ -{ lib, pkgs, ... }: +{ + lib, + inputs, + pkgs, + ... +}: { home = { username = "guanranwang"; @@ -25,24 +30,27 @@ udiskie.enable = true; }; - home.packages = with pkgs; [ - dconf-editor - fastfetch - fd - file-roller - fractal - gnome-calculator - hyperfine - libnotify - loupe - pwvucontrol - seahorse - wl-clipboard + home.packages = + (with pkgs; [ + dconf-editor + fastfetch + fd + file-roller + fractal + gnome-calculator + hyperfine + libnotify + loupe + pwvucontrol + seahorse + wl-clipboard - mumble - osu-lazer-bin - prismlauncher - ]; + osu-lazer-bin + prismlauncher + ]) + ++ (with inputs.self.legacyPackages.${pkgs.stdenv.hostPlatform.system}; [ + mumble-git + ]); home.sessionVariables = { # https://github.com/ppy/osu-framework/pull/6292 diff --git a/pkgs/default.nix b/pkgs/default.nix deleted file mode 100644 index 51ed0ea..0000000 --- a/pkgs/default.nix +++ /dev/null @@ -1,3 +0,0 @@ -# NOTE: 301: All packages are migrated to `github:Guanran928/nur-packages`, -# only keeping some packages that only fits for personal use. -pkgs: { background = pkgs.nixos-artwork.wallpapers.nineish-dark-gray.src; } diff --git a/pkgs/mumble-git/package.nix b/pkgs/mumble-git/package.nix new file mode 100644 index 0000000..06b40b0 --- /dev/null +++ b/pkgs/mumble-git/package.nix @@ -0,0 +1,118 @@ +{ + lib, + alsa-lib, + avahi-compat, + boost, + cmake, + fetchFromGitHub, + flac, + libjack2, + libogg, + libopus, + libpulseaudio, + libsndfile, + libvorbis, + nixosTests, + pipewire, + pkg-config, + poco, + protobuf, + python3, + qt6, + rnnoise, + speechd, + speex, + stdenv, + jackSupport ? false, + pipewireSupport ? true, + pulseSupport ? true, + speechdSupport ? false, +}: +stdenv.mkDerivation (finalAttrs: { + pname = "mumble"; + version = "1.5.634-unstable-2024-10-05"; + + src = fetchFromGitHub { + owner = "mumble-voip"; + repo = "mumble"; + rev = "cb01bfa5200fce53db68b769d05995c999e7cdd8"; + hash = "sha256-Tf029ae+PfFPhchU45y96IJVeY9GPzWD2E+NprI/ZYk="; + fetchSubmodules = true; + }; + + nativeBuildInputs = [ + cmake + pkg-config + python3 + qt6.wrapQtAppsHook + qt6.qttools + ]; + + buildInputs = + [ + avahi-compat + boost + flac + libogg + libopus + libsndfile + libvorbis + poco + protobuf + qt6.qtsvg + rnnoise + speex + ] + ++ lib.optional (!jackSupport) alsa-lib + ++ lib.optional jackSupport libjack2 + ++ lib.optional speechdSupport speechd + ++ lib.optional pulseSupport libpulseaudio + ++ lib.optional pipewireSupport pipewire; + + env.NIX_CFLAGS_COMPILE = lib.optionalString speechdSupport "-I${speechd}/include/speech-dispatcher"; + + cmakeFlags = + [ + "-D g15=OFF" + "-D server=OFF" + "-D bundled-celt=ON" + "-D bundled-opus=OFF" + "-D bundled-speex=OFF" + "-D bundle-qt-translations=OFF" + "-D update=OFF" + "-D overlay-xcompile=OFF" + "-D oss=OFF" + "-D warnings-as-errors=OFF" # conversion error workaround + ] + ++ lib.optional (!speechdSupport) "-D speechd=OFF" + ++ lib.optional (!pulseSupport) "-D pulseaudio=OFF" + ++ lib.optional (!pipewireSupport) "-D pipewire=OFF" + ++ lib.optional jackSupport "-D alsa=OFF -D jackaudio=ON"; + + preConfigure = '' + patchShebangs scripts + ''; + + postFixup = '' + wrapProgram $out/bin/mumble \ + --prefix LD_LIBRARY_PATH : "${ + lib.makeLibraryPath ( + lib.optional pulseSupport libpulseaudio ++ lib.optional pipewireSupport pipewire + ) + }" + ''; + + passthru.tests.connectivity = nixosTests.mumble; + + meta = { + description = "Low-latency, high quality voice chat software"; + homepage = "https://mumble.info"; + license = lib.licenses.bsd3; + mainProgram = "mumble"; + maintainers = with lib.maintainers; [ + felixsinger + lilacious + ]; + platforms = lib.platforms.linux; + }; +})