NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.08k stars 14.06k forks source link

Binary cache opencv + gtk #165724

Open tobiasBora opened 2 years ago

tobiasBora commented 2 years ago

Describe the bug

When using the opencv library (which is as I understand the simpler way to play videos in python) we need to enable enableGtk2 = true for we get some errors when playing a video. Unfortunately, this library is not cached, so we need to compile it manually (which takes maybe 10mn). As I guess this library is quite popular, it would be cool to have a binary package for it.

Steps To Reproduce

Steps to reproduce the behavior: start a nix shell with shell.nix being:

{ pkgs ? import <nixpkgs> {} }:
with pkgs;
pkgs.mkShell {
  buildInputs = [ (pkgs.python3.withPackages (ps: with ps; [numpy (opencv4.override { enableGtk2 = true; })])) ];
}

Expected behavior

Everything should install quickly without build.

Notify maintainers

@jonringer @mdaiter @basvandijk

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
output here
lucasew commented 2 years ago

It's possible adding a package to the top-level with a name like opencv3gtk

tfc commented 1 year ago

I also use this from time to time and would profit from a cached gtk-enabled version. However, it seems like a developer-only thing to use opencv with GUI, so just adding a pkgs.opencvWithGtk package for caching (as @lucasew suggested) would be the right thing.

tobiasBora commented 1 year ago

Ahah funny you mention that I was actually compiling it again yesterday. I was just wondering if we want to enable all options in an opencvFull package (there are quite a few), or only the gtk one.

hacker1024 commented 1 year ago

I quite like the idea of a fully-featured opencvFull for development.