Open garaiza-93 opened 1 year ago
I've made some changes, but pyaudio still fails to build; same result.
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
dream2nix.url = "github:nix-community/dream2nix";
};
outputs = { self, dream2nix, nixpkgs }:
let
l = nixpkgs.lib // builtins;
allPkgs =
l.map
(system: nixpkgs.legacyPackages.${system})
["x86_64-linux" "aarch64-linux"];
in
dream2nix.lib.makeFlakeOutputs rec {
systemsFromFile = ./nix_systems;
config.projectRoot = ./.;
source = ./.;
projects = ./projects.toml;
pkgs = allPkgs;
packageOverrides = {
pyaudio = {
buildInputs = old: old ++ [ pkgs.portaudio ];
};
};
};
}
I have also tried using a flake that someone kindly wrote for me:
{
inputs = {
dream2nix.url = "github:nix-community/dream2nix";
};
outputs =
{ self
, dream2nix
} @ inp:
let
pkgs = inp.dream2nix.inputs.nixpkgs.legacyPackages.x86_64-linux;
in
dream2nix.lib.makeFlakeOutputs {
systems = [ "x86_64-linux" ];
config.projectRoot = ./.;
source = ./.;
projects = ./projects.toml;
packageOverrides = {
main.add-portaudio = {
overrideAttrs = ol: {
buildInputs = (ol.buildInputs or [ ]) ++
[
pkgs.portaudio
pkgs.libxkbcommon
pkgs.fontconfig
pkgs.freetype
pkgs.wayland
pkgs.xorg.libXcomposite
];
};
};
};
};
}
Good news: pyaudio builds Bad news: auto-patchelf fails to patch many, many missing libraries.
error: auto-patchelf could not satisfy dependency libxcb-icccm.so.4 wanted by /nix/store/s1z66kivplmv65i58vxxs4502hl2vwlg-python3.10-main/lib/python3.10/site-packages/PyQt5/Qt5/plugins/platforms/libqxcb.so
error: auto-patchelf could not satisfy dependency libxcb-image.so.0 wanted by /nix/store/s1z66kivplmv65i58vxxs4502hl2vwlg-python3.10-main/lib/python3.10/site-packages/PyQt5/Qt5/plugins/platforms/libqxcb.so
error: auto-patchelf could not satisfy dependency libxcb-util.so.1 wanted by /nix/store/s1z66kivplmv65i58vxxs4502hl2vwlg-python3.10-main/lib/python3.10/site-packages/PyQt5/Qt5/plugins/platforms/libqxcb.so
error: auto-patchelf could not satisfy dependency libxcb-keysyms.so.1 wanted by /nix/store/s1z66kivplmv65i58vxxs4502hl2vwlg-python3.10-main/lib/python3.10/site-packages/PyQt5/Qt5/plugins/platforms/libqxcb.so
error: auto-patchelf could not satisfy dependency libxcb-render-util.so.0 wanted by /nix/store/s1z66kivplmv65i58vxxs4502hl2vwlg-python3.10-main/lib/python3.10/site-packages/PyQt5/Qt5/plugins/platforms/libqxcb.so
error: auto-patchelf could not satisfy dependency libQt5EglFSDeviceIntegration.so.5 wanted by /nix/store/s1z66kivplmv65i58vxxs4502hl2vwlg-python3.10-main/lib/python3.10/site-packages/PyQt5/Qt5/plugins/platforms/libqeglfs.so
error: auto-patchelf could not satisfy dependency libdrm.so.2 wanted by /nix/store/s1z66kivplmv65i58vxxs4502hl2vwlg-python3.10-main/lib/python3.10/site-packages/PyQt5/Qt5/plugins/platforms/libqlinuxfb.so
and so much more.
I have attempted to add more build inputs as shown in this flake, but it's silly how many I have to do.
I have figured this out, and hopefully no one else has to bang their head on the wall for hours like I did. I solved the last bit by adding another override to use pkgs.python310Packages.pyqt5
, such that the working flake is:
{
inputs.dream2nix.url = "github:nix-community/dream2nix";
outputs = inp:
let
pkgs = inp.dream2nix.inputs.nixpkgs.legacyPackages.x86_64-linux;
in
inp.dream2nix.lib.makeFlakeOutputs {
systems = [ "x86_64-linux" ];
config.projectRoot = ./.;
source = ./.;
projects = ./projects.toml;
packageOverrides.main = {
pyaudio.overrideAttrs = oldAttrs: {
buildInputs = old: old ++ [
pkgs.portaudio
];
};
pyqt5.overrideAttrs = oldAttrs: {
buildInputs = old: old ++ [
pkgs.python310Packages.pyqt5
];
};
};
};
}
However, could the last bit with auto-patchelf be due to something dream2nix related, or was it something with the package from pip? I will close the issue once I get an answer to this question.
because I cannot find any working example with any translator perhaps someone could help (with this one)?
only trying to reproduce those code parts with
- system: `"x86_64-linux"`
- host os: `Linux 5.15.88, NixOS, 22.11 (Raccoon), 22.11.1705.b83e7f5a04a`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.11.1`
- channels(root): `"nixos-22.11, nixos-hardware"`
- nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
results in:
nix flake show
path:/home/pyaudio?lastModified=1674244907&narHash=sha256-99rgQgCDNKBl35bMQK0SP7SQZJp9y033vAU3acRq7Hg=
├───apps
│ └───x86_64-linux
│ └───detect-projects: app
└───packages
└───x86_64-linux
├───main: package 'main'
└───resolveImpure: package 'resolve'
direnv allow
direnv: loading ~/pyaudio/.envrc
direnv: using flake
error: flake 'path:/home/pyaudio' does not provide attribute 'devShells.x86_64-linux.default', 'devShell.x86_64-linux', 'packages.x86_64-linux.default' or 'defaultPackage.x86_64-linux'
In a project I want to package, it requires
pyaudio
. However,pyaudio
depends onportaudio
.Based on the flake template provided in the readme, this is my current flake:
and my
projects.toml
file:Log from building this flake.:
This results in the flake failing to build. A different approach I have tried is to instead use the
portaudio
package fromnixos-unstable
inextraSetupDeps
as described in the documentation Flake with attempted workaround:...which then fails again, with the message
flake 'github:nix-community/nixpkgs/e2b4abe3c8f2e09adfc6a52007841d1b96c89371' has an unsupported attribute 'edition', at /nix/store/k57k9avjpkzpclfi02sglsqhig7skwzn-source/flake.nix:4:3
So i'm stumped. How would I go about adding
portaudio
so that the pyaudio wheel can build?