From d69583c6c26551d30e7dac024fb83a65e13e1f65 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Mon, 27 Sep 2021 13:57:14 +0000 Subject: opencv2: don't build unfree libraries by default In opencv 2.x, unfree libraries are built by default. The package should therefore have been marked as unfree, but wasn't. I've disabled the non-free libraries by default, and added an option to enable them. There are three programs in Nixpkgs that depend on opencv2: mathematica, pfstools, and p2pvc. pfstools requires the non-free libraries if it's built with opencv support, so I've disabled opencv by default there and added an option to enable it. p2pvc links fine, so presumably doesn't need the non-free libraries. I can't test mathematica, so I'm just going to leave it alone. --- pkgs/tools/graphics/pfstools/default.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'pkgs/tools/graphics/pfstools') diff --git a/pkgs/tools/graphics/pfstools/default.nix b/pkgs/tools/graphics/pfstools/default.nix index 99b9e3e0e487f..a81321204757b 100644 --- a/pkgs/tools/graphics/pfstools/default.nix +++ b/pkgs/tools/graphics/pfstools/default.nix @@ -1,6 +1,7 @@ { lib, stdenv, mkDerivation, fetchurl, cmake, pkg-config, darwin , openexr, zlib, imagemagick6, libGLU, libGL, freeglut, fftwFloat -, fftw, gsl, libexif, perl, opencv2, qtbase, netpbm +, fftw, gsl, libexif, perl, qtbase, netpbm +, enableUnfree ? false, opencv2 }: mkDerivation rec { @@ -28,12 +29,12 @@ mkDerivation rec { nativeBuildInputs = [ cmake pkg-config ]; buildInputs = [ openexr zlib imagemagick6 fftwFloat - fftw gsl libexif perl opencv2 qtbase netpbm + fftw gsl libexif perl qtbase netpbm ] ++ (if stdenv.isDarwin then (with darwin.apple_sdk.frameworks; [ OpenGL GLUT ]) else [ libGLU libGL freeglut - ]); + ]) ++ lib.optional enableUnfree (opencv2.override { enableUnfree = true; }); patches = [ ./threads.patch ./pfstools.patch ./pfsalign.patch ]; -- cgit 1.4.1