Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pyfda: init at 0.2.1 #72875

Closed
wants to merge 1 commit into from
Closed

pyfda: init at 0.2.1 #72875

wants to merge 1 commit into from

Conversation

sbourdeauducq
Copy link
Contributor

Motivation for this change

Add a nice digital filter design tool.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Copy link
Member

@JohnAZoidberg JohnAZoidberg left a comment

Choose a reason for hiding this comment

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

Does it work for you?
When I try to start it, it fails to find the QT plugins:

> ./result/bin/pyfdax
[   INFO] [pyfda.pyfda_rc:191] Using 'DejaVu Sans' font.
qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

fish: “./result/bin/pyfdax” terminated by signal SIGABRT (Abort)

See: https://nixos.org/nixpkgs/manual/#sec-language-qt

pkgs/applications/science/misc/pyfda/default.nix Outdated Show resolved Hide resolved
pkgs/top-level/all-packages.nix Outdated Show resolved Hide resolved
pkgs/applications/science/misc/pyfda/default.nix Outdated Show resolved Hide resolved
pkgs/applications/science/misc/pyfda/default.nix Outdated Show resolved Hide resolved
@sbourdeauducq
Copy link
Contributor Author

Does it work for you?

Yes, when the nixpkgs versions used for pyfda is the same as the one currently running on the system. Otherwise, I get the same error also.
Is it possible to have different Qt versions like that? I don't see other pyqt5 applications doing anything special.

@sbourdeauducq
Copy link
Contributor Author

Thanks for the suggestions, I have implemented them.

Copy link
Member

@veprbl veprbl left a comment

Choose a reason for hiding this comment

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

On minor nitpick

pkgs/applications/science/misc/pyfda/default.nix Outdated Show resolved Hide resolved
@sbourdeauducq sbourdeauducq force-pushed the for-upstream branch 2 times, most recently from 34a0d57 to 07fb994 Compare January 2, 2020 02:36
@veprbl
Copy link
Member

veprbl commented Jan 28, 2020

This is missing wrapQtAppsHook

diff --git a/pkgs/applications/science/misc/pyfda/default.nix b/pkgs/applications/science/misc/pyfda/default.nix
index 791b4be1454..e325a05e80d 100644
--- a/pkgs/applications/science/misc/pyfda/default.nix
+++ b/pkgs/applications/science/misc/pyfda/default.nix
@@ -1,15 +1,16 @@
-{ lib, buildPythonApplication, fetchPypi, numpy, scipy, matplotlib, pyqt5, docutils, nmigen }:
+{ lib, python3Packages, wrapQtAppsHook }:
 
-buildPythonApplication rec {
+python3Packages.buildPythonApplication rec {
   pname = "pyfda";
   version = "0.2.1";
 
-  src = fetchPypi {
+  src = python3Packages.fetchPypi {
     inherit pname version;
     sha256 = "11whn2hhr0szbzpmly2p47prvsm2rhizf60iz3pfgkbrnrjs7mhv";
   };
 
-  propagatedBuildInputs = [ numpy scipy matplotlib pyqt5 docutils nmigen ];
+  nativeBuildInputs = [ wrapQtAppsHook ];
+  propagatedBuildInputs = with python3Packages; [ numpy scipy matplotlib pyqt5 docutils nmigen ];
 
   patches = [ ./nmigen.diff ];
   postPatch = ''
@@ -28,6 +29,10 @@ buildPythonApplication rec {
     export HOME=`mktemp -d`
   '';
 
+  postInstall = ''
+    wrapQtApp "$out"/bin/pyfdax
+  '';
+
   meta = with lib; {
     description = "Python filter design analysis tool";
     homepage = "https://github.com/chipmuenk/pyfda";
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 53eb951db7d..bd7a43e3b09 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -23789,7 +23789,7 @@ in
 
   openmolcas = callPackage ../applications/science/chemistry/openmolcas { };
 
-  pyfda = python3Packages.callPackage ../applications/science/misc/pyfda { };
+  pyfda = libsForQt5.callPackage ../applications/science/misc/pyfda { };
 
   pymol = callPackage ../applications/science/chemistry/pymol { };
 

@JohnAZoidberg
Copy link
Member

@sbourdeauducq can you please add the qt-wrapper?

@sbourdeauducq
Copy link
Contributor Author

Done, sorry about the delay

Copy link
Member

@JohnAZoidberg JohnAZoidberg left a comment

Choose a reason for hiding this comment

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

Nice! Now with the qtwrapper it starts properly and looks like it's working.

nativeBuildInputs = [ wrapQtAppsHook ];
propagatedBuildInputs = with python3Packages; [ numpy scipy matplotlib pyqt5 docutils nmigen ];

patches = [ ./nmigen.diff ];
Copy link
Member

Choose a reason for hiding this comment

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

Could you please add a short comment explaining why this patch is necessary and why you choose nmigen instead of migen?
Could this be upstreamed?

--replace "'pyfdax_no_term = pyfda.pyfdax:main'," ""

# This code is unused but causes problems with Py3.7 due to the async keyword.
rm pyfda/fixpoint_widgets/iir_df1.py
Copy link
Member

Choose a reason for hiding this comment

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

Could this be upstreamed?

description = "Python filter design analysis tool";
homepage = "https://github.com/chipmuenk/pyfda";
license = licenses.mit;
maintainers = [ maintainers.sb0 ];
Copy link
Member

Choose a reason for hiding this comment

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

Could you please put a platforms attribute?

Copy link
Member

Choose a reason for hiding this comment

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

Actually, this is not required for a python module.

Copy link
Member

Choose a reason for hiding this comment

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

It is not required if it is all.

@stale

This comment has been minimized.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Aug 19, 2020
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Nov 9, 2020
@stale
Copy link

stale bot commented Jun 3, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 3, 2021
@SuperSandro2000
Copy link
Member

Closing due to inactivity from author.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants