{ lib, rustPlatform, pkg-config, makeWrapper, autoPatchelfHook, dbus, libpulseaudio, wayland, libxkbcommon, libGL, expat, fontconfig, freetype, namespace, }: let inherit (lib.trivial) importJSON; inherit (lib.${namespace}) selectVariant mkAllSources; versionSpec = importJSON ./version.json; selected = selectVariant versionSpec null null; sources = mkAllSources selected; # cargoHash is stored alongside the source in version.json so the TUI can update it cargoHash = selected.sources.librepods.cargoHash; in rustPlatform.buildRustPackage rec { pname = "librepods"; version = "0.1.0"; src = sources.librepods; sourceRoot = "${src.name}/linux-rust"; inherit cargoHash; nativeBuildInputs = [ pkg-config libpulseaudio autoPatchelfHook makeWrapper ]; buildInputs = [ dbus libpulseaudio wayland expat fontconfig freetype freetype.dev libGL pkg-config # libx11 # libXcursor # libXi # libXandr wayland libxkbcommon ]; postFixup = '' wrapProgram $out/bin/librepods --suffix LD_LIBRARY_PATH : ${lib.makeLibraryPath buildInputs} ''; meta = with lib; { description = "Open source alternative for AirPods"; homepage = "https://github.com/kavishdevar/librepods"; license = licenses.gpl3; maintainers = [ ]; mainProgram = "librepods"; platforms = platforms.linux; }; }