96 lines
1.8 KiB
Nix
Executable File
96 lines
1.8 KiB
Nix
Executable File
{
|
|
lib,
|
|
rustPlatform,
|
|
pkg-config,
|
|
makeWrapper,
|
|
autoPatchelfHook,
|
|
dbus,
|
|
libpulseaudio,
|
|
wayland,
|
|
libxkbcommon,
|
|
libGL,
|
|
expat,
|
|
fontconfig,
|
|
freetype,
|
|
makeDesktopItem,
|
|
copyDesktopItems,
|
|
namespace,
|
|
stdenv,
|
|
pkgs,
|
|
}:
|
|
let
|
|
inherit (lib.trivial) importJSON;
|
|
inherit (lib.${namespace}) selectVariant mkAllSources;
|
|
inherit lib;
|
|
|
|
versionSpec = importJSON ./version.json;
|
|
selected = selectVariant versionSpec null null;
|
|
sources = mkAllSources pkgs selected;
|
|
inherit (stdenv.hostPlatform) system;
|
|
cargoHash = selected.sources.librepods.cargoHash;
|
|
in
|
|
rustPlatform.buildRustPackage rec {
|
|
pname = "librepods";
|
|
version = "0.1.0-${system}";
|
|
|
|
src = sources.librepods;
|
|
|
|
sourceRoot = "${src.name}/linux-rust";
|
|
|
|
inherit cargoHash;
|
|
|
|
nativeBuildInputs = [
|
|
pkg-config
|
|
libpulseaudio
|
|
autoPatchelfHook
|
|
makeWrapper
|
|
copyDesktopItems
|
|
];
|
|
|
|
buildInputs = [
|
|
dbus
|
|
libpulseaudio
|
|
wayland
|
|
expat
|
|
fontconfig
|
|
freetype
|
|
freetype.dev
|
|
libGL
|
|
pkg-config
|
|
# libx11
|
|
# libXcursor
|
|
# libXi
|
|
# libXandr
|
|
wayland
|
|
libxkbcommon
|
|
];
|
|
|
|
desktopItem = makeDesktopItem {
|
|
name = "librepods";
|
|
desktopName = "LibrePODS";
|
|
comment = "Open source alternative for AirPods";
|
|
exec = "librepods";
|
|
icon = "librepods";
|
|
terminal = false;
|
|
categories = [
|
|
"Audio"
|
|
"Utility"
|
|
];
|
|
};
|
|
|
|
postFixup = ''
|
|
wrapProgram $out/bin/librepods --suffix LD_LIBRARY_PATH : ${lib.makeLibraryPath buildInputs}
|
|
'';
|
|
|
|
passthru.imaging = desktopItem;
|
|
|
|
meta = with lib; {
|
|
description = "Open source alternative for AirPods";
|
|
homepage = "https://github.com/kavishdevar/librepods";
|
|
license = licenses.gpl3;
|
|
maintainers = [ ];
|
|
mainProgram = "librepods";
|
|
platforms = platforms.linux;
|
|
};
|
|
}
|