soundconverter: format with nixfmt-rfc-style

This commit is contained in:
aleksana 2024-07-05 13:10:17 +08:00
parent 4b42a2b912
commit 01831dd339

View File

@ -1,9 +1,19 @@
{ lib, fetchurl
# Optional due to unfree license.
, faacSupport ? false
, glib, python3Packages, gtk3, wrapGAppsHook3
, gsettings-desktop-schemas, intltool, xvfb-run
, gobject-introspection, gst_all_1, fdk-aac-encoder }:
{
lib,
fetchurl,
# Optional due to unfree license.
faacSupport ? false,
glib,
python3Packages,
gtk3,
wrapGAppsHook3,
gsettings-desktop-schemas,
intltool,
xvfb-run,
gobject-introspection,
gst_all_1,
fdk-aac-encoder,
}:
python3Packages.buildPythonApplication rec {
pname = "soundconverter";
@ -37,9 +47,7 @@ python3Packages.buildPythonApplication rec {
python3Packages.pygobject3
];
nativeCheckInputs = [
xvfb-run
];
nativeCheckInputs = [ xvfb-run ];
postPatch = ''
substituteInPlace bin/soundconverter --replace \
@ -47,19 +55,31 @@ python3Packages.buildPythonApplication rec {
"DATA_PATH = '$out/share/soundconverter'"
'';
preCheck = let
self = { outPath = "$out"; name = "${pname}-${version}"; };
xdgPaths = lib.concatMapStringsSep ":" glib.getSchemaDataDirPath;
in ''
export HOME=$TMPDIR
export XDG_DATA_DIRS=$XDG_DATA_DIRS:${xdgPaths [gtk3 gsettings-desktop-schemas self]}
# FIXME: Fails due to weird Gio.file_parse_name() behavior.
sed -i '49 a\ @unittest.skip("Gio.file_parse_name issues")' tests/testcases/names.py
'' + lib.optionalString (!faacSupport) ''
substituteInPlace tests/testcases/integration.py --replace \
"for encoder in ['fdkaacenc', 'faac', 'avenc_aac']:" \
"for encoder in ['fdkaacenc', 'avenc_aac']:"
'';
preCheck =
let
self = {
outPath = "$out";
name = "${pname}-${version}";
};
xdgPaths = lib.concatMapStringsSep ":" glib.getSchemaDataDirPath;
in
''
export HOME=$TMPDIR
export XDG_DATA_DIRS=$XDG_DATA_DIRS:${
xdgPaths [
gtk3
gsettings-desktop-schemas
self
]
}
# FIXME: Fails due to weird Gio.file_parse_name() behavior.
sed -i '49 a\ @unittest.skip("Gio.file_parse_name issues")' tests/testcases/names.py
''
+ lib.optionalString (!faacSupport) ''
substituteInPlace tests/testcases/integration.py --replace \
"for encoder in ['fdkaacenc', 'faac', 'avenc_aac']:" \
"for encoder in ['fdkaacenc', 'avenc_aac']:"
'';
checkPhase = ''
runHook preCheck