pipewire-media-session: init at 0.4.0
This commit is contained in:
93
pkgs/development/libraries/pipewire/media-session.nix
Normal file
93
pkgs/development/libraries/pipewire/media-session.nix
Normal file
@@ -0,0 +1,93 @@
|
||||
{ stdenv
|
||||
, lib
|
||||
, fetchFromGitLab
|
||||
, meson
|
||||
, ninja
|
||||
, pkg-config
|
||||
, doxygen
|
||||
, graphviz
|
||||
, systemd
|
||||
, pipewire
|
||||
, glib
|
||||
, dbus
|
||||
, alsa-lib
|
||||
, callPackage
|
||||
}:
|
||||
|
||||
let
|
||||
mesonEnable = b: if b then "enabled" else "disabled";
|
||||
mesonList = l: "[" + lib.concatStringsSep "," l + "]";
|
||||
|
||||
self = stdenv.mkDerivation rec {
|
||||
pname = "pipewire-media-session";
|
||||
version = "0.4.0";
|
||||
|
||||
src = fetchFromGitLab {
|
||||
domain = "gitlab.freedesktop.org";
|
||||
owner = "pipewire";
|
||||
repo = "media-session";
|
||||
rev = version;
|
||||
sha256 = "sha256-zhOvBlG7DuQkJ+ZZBhBhfKwk+bbLljpt3w4JlK3cJLk=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
doxygen
|
||||
graphviz
|
||||
meson
|
||||
ninja
|
||||
pkg-config
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
alsa-lib
|
||||
dbus
|
||||
glib
|
||||
pipewire
|
||||
systemd
|
||||
];
|
||||
|
||||
mesonFlags = [
|
||||
"-Ddocs=enabled"
|
||||
# We generate these empty files from the nixos module, don't bother installing them
|
||||
"-Dwith-module-sets=[]"
|
||||
];
|
||||
|
||||
postUnpack = ''
|
||||
patchShebangs source/doc/input-filter-h.sh
|
||||
patchShebangs source/doc/input-filter.sh
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
mkdir $out/nix-support
|
||||
cd $out/share/pipewire/media-session.d
|
||||
for f in *.conf; do
|
||||
echo "Generating JSON from $f"
|
||||
${pipewire}/bin/spa-json-dump "$f" > "$out/nix-support/$f.json"
|
||||
done
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
tests = {
|
||||
test-paths = callPackage ./test-paths.nix { package = self; } {
|
||||
paths-out = [
|
||||
"nix-support/alsa-monitor.conf.json"
|
||||
"nix-support/bluez-monitor.conf.json"
|
||||
"nix-support/media-session.conf.json"
|
||||
"nix-support/v4l2-monitor.conf.json"
|
||||
];
|
||||
paths-lib = [];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "Example session manager for PipeWire";
|
||||
homepage = "https://pipewire.org";
|
||||
license = licenses.mit;
|
||||
platforms = platforms.linux;
|
||||
maintainers = with maintainers; [ jtojnar kranzes ];
|
||||
};
|
||||
};
|
||||
|
||||
in
|
||||
self
|
||||
@@ -1,4 +1,4 @@
|
||||
{ lib, runCommand, pipewire, paths-out, paths-lib, paths-out-media-session }:
|
||||
{ lib, runCommand, package, paths-out, paths-lib }:
|
||||
|
||||
let
|
||||
check-path = output: path: ''
|
||||
@@ -14,9 +14,8 @@ let
|
||||
in runCommand "pipewire-test-paths" { } ''
|
||||
touch $out
|
||||
|
||||
${check-output pipewire.mediaSession paths-out-media-session}
|
||||
${check-output pipewire.lib paths-lib}
|
||||
${check-output pipewire paths-out}
|
||||
${check-output package.lib paths-lib}
|
||||
${check-output package paths-out}
|
||||
|
||||
if [[ -n "$error" ]]; then
|
||||
exit 1
|
||||
|
||||
@@ -11,14 +11,27 @@ NIXPKGS_ROOT="$(git rev-parse --show-toplevel)"
|
||||
|
||||
cd "$NIXPKGS_ROOT"
|
||||
nix-update pipewire
|
||||
outputs=$(nix-build . -A pipewire -A pipewire.mediaSession)
|
||||
outputs=$(nix-build . -A pipewire)
|
||||
for p in $outputs; do
|
||||
conf_files=$(find "$p/nix-support/etc/pipewire/" -name '*.conf.json')
|
||||
conf_files=$(find "$p/nix-support/" -name '*.conf.json')
|
||||
for c in $conf_files; do
|
||||
file_name=$(basename "$c")
|
||||
if [[ ! -e "nixos/modules/services/desktops/pipewire/$file_name" ]]; then
|
||||
if [[ ! -e "nixos/modules/services/desktops/pipewire/daemon/$file_name" ]]; then
|
||||
echo "New file $file_name found! Add it to the module config and passthru tests!"
|
||||
fi
|
||||
install -m 0644 "$c" "nixos/modules/services/desktops/pipewire/"
|
||||
install -m 0644 "$c" "nixos/modules/services/desktops/pipewire/daemon/"
|
||||
done
|
||||
done
|
||||
|
||||
nix-update pipewire-media-session
|
||||
outputs=$(nix-build . -A pipewire-media-session)
|
||||
for p in $outputs; do
|
||||
conf_files=$(find "$p/nix-support/" -name '*.conf.json')
|
||||
for c in $conf_files; do
|
||||
file_name=$(basename "$c")
|
||||
if [[ ! -e "nixos/modules/services/desktops/pipewire/media-session/$file_name" ]]; then
|
||||
echo "New file $file_name found! Add it to the module config and passthru tests!"
|
||||
fi
|
||||
install -m 0644 "$c" "nixos/modules/services/desktops/pipewire/media-session/"
|
||||
done
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user