From 01831dd339c6f76aec740d68280c15b273fb95c2 Mon Sep 17 00:00:00 2001 From: aleksana Date: Fri, 5 Jul 2024 13:10:17 +0800 Subject: [PATCH 1/3] soundconverter: format with nixfmt-rfc-style --- .../audio/soundconverter/default.nix | 64 ++++++++++++------- 1 file changed, 42 insertions(+), 22 deletions(-) diff --git a/pkgs/applications/audio/soundconverter/default.nix b/pkgs/applications/audio/soundconverter/default.nix index 27238e36d088..e495ef18391f 100644 --- a/pkgs/applications/audio/soundconverter/default.nix +++ b/pkgs/applications/audio/soundconverter/default.nix @@ -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 From af33ff24a8c2dc1847a3c9657f5d60d13188e699 Mon Sep 17 00:00:00 2001 From: aleksana Date: Fri, 5 Jul 2024 13:22:42 +0800 Subject: [PATCH 2/3] soundconverter: 4.0.3 -> 4.0.5 --- .../audio/soundconverter/default.nix | 38 +++++++++++-------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/pkgs/applications/audio/soundconverter/default.nix b/pkgs/applications/audio/soundconverter/default.nix index e495ef18391f..0c1ac2e2476f 100644 --- a/pkgs/applications/audio/soundconverter/default.nix +++ b/pkgs/applications/audio/soundconverter/default.nix @@ -1,8 +1,8 @@ { lib, - fetchurl, # Optional due to unfree license. faacSupport ? false, + fetchFromGitHub, glib, python3Packages, gtk3, @@ -17,11 +17,13 @@ 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 = [ @@ -40,11 +42,11 @@ 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 ]; @@ -76,7 +78,7 @@ python3Packages.buildPythonApplication rec { sed -i '49 a\ @unittest.skip("Gio.file_parse_name issues")' tests/testcases/names.py '' + lib.optionalString (!faacSupport) '' - substituteInPlace tests/testcases/integration.py --replace \ + substituteInPlace tests/testcases/gui_integration.py --replace \ "for encoder in ['fdkaacenc', 'faac', 'avenc_aac']:" \ "for encoder in ['fdkaacenc', 'avenc_aac']:" ''; @@ -90,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"; @@ -99,8 +107,8 @@ 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 ]; }; } From 14cb110d94705710029d1a660ca0b26a402a43cb Mon Sep 17 00:00:00 2001 From: aleksana Date: Fri, 5 Jul 2024 13:27:05 +0800 Subject: [PATCH 3/3] soundconverter: add aleksana to maintainers --- pkgs/applications/audio/soundconverter/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/audio/soundconverter/default.nix b/pkgs/applications/audio/soundconverter/default.nix index 0c1ac2e2476f..5e5303bb1da3 100644 --- a/pkgs/applications/audio/soundconverter/default.nix +++ b/pkgs/applications/audio/soundconverter/default.nix @@ -109,6 +109,9 @@ python3Packages.buildPythonApplication rec { ''; license = lib.licenses.gpl3Only; platforms = lib.platforms.linux; - maintainers = with lib.maintainers; [ jakubgs ]; + maintainers = with lib.maintainers; [ + jakubgs + aleksana + ]; }; }