Skip to content

soundconverter: init at 4.0.3#152733

Merged
SuperSandro2000 merged 1 commit intoNixOS:masterfrom
jakubgs:init/soundconverter
Mar 10, 2022
Merged

soundconverter: init at 4.0.3#152733
SuperSandro2000 merged 1 commit intoNixOS:masterfrom
jakubgs:init/soundconverter

Conversation

@jakubgs
Copy link
Contributor

@jakubgs jakubgs commented Dec 30, 2021

Motivation for this change

SoundConverter is a clean and simple GUI for converting audio files using GStreamer.

Thanks to @austinbutler for his help in the Discourse thread.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.05 Release Notes (or backporting 21.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/how-to-provide-gstreamer-to-a-python-gtk-application/16814/5

@jakubgs
Copy link
Contributor Author

jakubgs commented Dec 30, 2021

Actually, I got this working without using strictDeps = false like this:

diff --git a/pkgs/applications/audio/soundconverter/default.nix b/pkgs/applications/audio/soundconverter/default.nix
index 3a3a73c5c72..87810c7d11e 100644
--- a/pkgs/applications/audio/soundconverter/default.nix
+++ b/pkgs/applications/audio/soundconverter/default.nix
@@ -14,18 +14,22 @@ python3Packages.buildPythonApplication rec {
   doCheck = false;
 
   buildInputs = with pkgs; [
+    gst_all_1.gst-plugins-bad
+    gst_all_1.gst-plugins-base
+    gst_all_1.gst-plugins-good
+    gst_all_1.gst-plugins-ugly
     gtk3
-    intltool
     python3Packages.distutils_extra
     wrapGAppsHook
   ];
 
+  nativeBuildInputs = with pkgs; [
+    intltool
+    gobject-introspection
+  ];
+
   propagatedBuildInputs = with pkgs; [
     gobject-introspection
-    gst_all_1.gst-plugins-bad
-    gst_all_1.gst-plugins-base
-    gst_all_1.gst-plugins-good
-    gst_all_1.gst-plugins-ugly
     python3Packages.pygobject3
   ];
 
@@ -35,8 +39,6 @@ python3Packages.buildPythonApplication rec {
       "DATA_PATH = '$out/share/soundconverter'"
   '';
 
-  strictDeps = false;
-
   meta = with lib; {
     homepage = "https://soundconverter.org/";
     description = "Leading audio file converter for the GNOME Desktop";

Not sure why but it appears gobject-introspection needs to be both in nativeBuildInputs and propagatedBuildInputs because if it's not in propagatedBuildInputs I get:

soundconverter needs GTK >= 3.0 (Error: "Namespace GstPbutils not available")

And if it's not in nativeBuildInputs, then I get:

GLib-GIO-ERROR **: 16:53:53.141: No GSettings schemas are installed on the system

@jakubgs jakubgs force-pushed the init/soundconverter branch from 0dee2e5 to f31b7e5 Compare December 30, 2021 15:55
@ofborg ofborg bot added 8.has: package (new) This PR adds a new package 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. labels Dec 30, 2021
Copy link
Contributor

@dasj19 dasj19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just built it and it fails like this

Traceback (most recent call last):

  File "/nix/store/m0qlqgs6gxgbpaq4n8d6mvw6pwj9yip2-soundconverter-4.0.3/bin/..soundconverter-wrapped-wrapped", line 34, in <module>
    import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'

I'll check which python dependency is missing

@jakubgs jakubgs force-pushed the init/soundconverter branch from f31b7e5 to 5a53d24 Compare December 30, 2021 16:07
@jakubgs
Copy link
Contributor Author

jakubgs commented Dec 30, 2021

Interesting, it builds and works fine for me:

 > $(nix-build --no-out-link -A pkgs.soundconverter)/bin/soundconverter --help
Usage: .soundconverter-wrapped [options]

Options:
  -h, --help            show this help message and exit
...

How does that happen if we are using the same commit with the same version of nixpkgs.

@jakubgs
Copy link
Contributor Author

jakubgs commented Dec 30, 2021

Your error looks related to this:
https://nixos.wiki/wiki/Packaging/Python#ModuleNotFoundError:_No_module_named_.27pkg_resources.27

It's suggested to add setuptools to propagatedBuildInputs.

@jakubgs jakubgs force-pushed the init/soundconverter branch from 5a53d24 to a5d3600 Compare December 30, 2021 16:17
@dasj19
Copy link
Contributor

dasj19 commented Dec 30, 2021

Yes, I'll check building again as soon as my system updates (I was not up-to-date with nixpkgs)

@jakubgs jakubgs force-pushed the init/soundconverter branch from a5d3600 to 2a54cfb Compare December 30, 2021 19:15
Copy link
Contributor

@dasj19 dasj19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried for quite some time to get the tests working... some of them are passing but some are failing.
This is what I used:

{ pkgs, python3Packages, lib, fetchurl }:

python3Packages.buildPythonApplication rec {
  pname = "soundconverter";
  version = "4.0.3";

  src = fetchurl {
    url = "https://launchpad.net/soundconverter/trunk/${version}/+download/${pname}-${version}.tar.gz";
    sha256 = "sha256-hzIG/4LD3705erPYvXb7uoRwF9LtKKIKB3jrhpYMsZ0=";
  };

  buildInputs = with pkgs; [
    gtk3
    wrapGAppsHook
  ];

  nativeBuildInputs = with pkgs; [
    intltool
    gobject-introspection
  ];

  propagatedBuildInputs = with pkgs; [
    gobject-introspection
    (gst_all_1.gst-plugins-bad.override { faacSupport = true; })
    gst_all_1.gst-plugins-base
    gst_all_1.gst-plugins-good
    gst_all_1.gst-plugins-ugly
    python3Packages.distutils_extra
    python3Packages.pygobject3
    python3Packages.setuptools
  ];

  postPatch = ''
    substituteInPlace  bin/soundconverter --replace \
      "DATA_PATH = os.path.join(SOURCE_PATH, 'data')" \
      "DATA_PATH = '$out/share/soundconverter'"
  '';

  checkInputs = with pkgs; [
    xvfb-run
  ];
  checkPhase = ''
    export XDG_DATA_DIRS=${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}:${pkgs.gtk3}/share/gsettings-schemas/${pkgs.gtk3.name}:$out/share/gsettings-schemas/${pname}-${version}:$XDG_DATA_DIRS
    xvfb-run python tests/test.py
  '';

  meta = with lib; {
    homepage = "https://soundconverter.org/";
    description = "Leading audio file converter for the GNOME Desktop";
    longDescription = ''
      SoundConverter reads anything the GStreamer library can read,
      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 ];
  };
}

@jakubgs jakubgs force-pushed the init/soundconverter branch 4 times, most recently from a662187 to 7600760 Compare January 2, 2022 13:14
@jakubgs jakubgs force-pushed the init/soundconverter branch 2 times, most recently from 5685600 to 207a935 Compare January 2, 2022 18:00
@jakubgs jakubgs force-pushed the init/soundconverter branch from 207a935 to add0877 Compare January 10, 2022 23:53
@jakubgs jakubgs requested review from dasj19 and jtojnar January 10, 2022 23:53
@jakubgs jakubgs force-pushed the init/soundconverter branch from add0877 to 5583005 Compare January 11, 2022 21:41
@jakubgs jakubgs requested a review from dasj19 January 12, 2022 14:27
@Tungsten842
Copy link
Member

Result of nixpkgs-review pr 152733 run on x86_64-linux 1

1 package built:
  • soundconverter

@jakubgs jakubgs force-pushed the init/soundconverter branch 2 times, most recently from 06577e6 to 2601105 Compare March 6, 2022 16:22
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/762

@jakubgs jakubgs force-pushed the init/soundconverter branch from 2601105 to 15c56f1 Compare March 7, 2022 10:58
Signed-off-by: Jakub Sokołowski <jakub@status.im>
@jakubgs jakubgs force-pushed the init/soundconverter branch from 15c56f1 to 073e7d5 Compare March 7, 2022 11:01
@SuperSandro2000 SuperSandro2000 merged commit 635b5af into NixOS:master Mar 10, 2022
@jakubgs jakubgs deleted the init/soundconverter branch October 6, 2023 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

8.has: package (new) This PR adds a new package 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants