diff --git a/pkgs/applications/audio/soundconverter/default.nix b/pkgs/applications/audio/soundconverter/default.nix index 27238e36d088..5e5303bb1da3 100644 --- a/pkgs/applications/audio/soundconverter/default.nix +++ b/pkgs/applications/audio/soundconverter/default.nix @@ -1,17 +1,29 @@ -{ 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, + # Optional due to unfree license. + faacSupport ? false, + fetchFromGitHub, + glib, + python3Packages, + gtk3, + wrapGAppsHook3, + gsettings-desktop-schemas, + intltool, + xvfb-run, + gobject-introspection, + gst_all_1, + fdk-aac-encoder, +}: python3Packages.buildPythonApplication rec { pname = "soundconverter"; - version = "4.0.3"; + version = "4.0.5"; - src = fetchurl { - url = "https://launchpad.net/soundconverter/trunk/${version}/+download/${pname}-${version}.tar.gz"; - sha256 = "sha256-hzIG/4LD3705erPYvXb7uoRwF9LtKKIKB3jrhpYMsZ0="; + src = fetchFromGitHub { + owner = "kassoulet"; + repo = "soundconverter"; + rev = version; + hash = "sha256-sno5EOh8HHfBTIE67VA8mheYp5wUMFRCbcS2EtKES3c="; }; buildInputs = [ @@ -30,16 +42,14 @@ python3Packages.buildPythonApplication rec { gobject-introspection ]; - propagatedBuildInputs = [ - python3Packages.gst-python - python3Packages.distutils-extra - python3Packages.setuptools - python3Packages.pygobject3 + dependencies = with python3Packages; [ + gst-python + distutils-extra + setuptools + pygobject3 ]; - nativeCheckInputs = [ - xvfb-run - ]; + nativeCheckInputs = [ xvfb-run ]; postPatch = '' substituteInPlace bin/soundconverter --replace \ @@ -47,19 +57,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/gui_integration.py --replace \ + "for encoder in ['fdkaacenc', 'faac', 'avenc_aac']:" \ + "for encoder in ['fdkaacenc', 'avenc_aac']:" + ''; checkPhase = '' runHook preCheck @@ -70,7 +92,13 @@ python3Packages.buildPythonApplication rec { # Necessary to set GDK_PIXBUF_MODULE_FILE. strictDeps = false; - meta = with lib; { + dontWrapGApps = true; + + preFixup = '' + makeWrapperArgs+=("''${gappsWrapperArgs[@]}") + ''; + + meta = { homepage = "https://soundconverter.org/"; description = "Leading audio file converter for the GNOME Desktop"; mainProgram = "soundconverter"; @@ -79,8 +107,11 @@ python3Packages.buildPythonApplication rec { and writes WAV, FLAC, MP3, AAC and Ogg Vorbis files. Uses Python and GTK+ GUI toolkit, and runs on X Window System. ''; - license = licenses.gpl3Only; - platforms = platforms.linux; - maintainers = with maintainers; [ jakubgs ]; + license = lib.licenses.gpl3Only; + platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [ + jakubgs + aleksana + ]; }; }