opencv-python-headless 4.5.3.56 for python38
= Wrapper package for OpenCV python bindings.
Project license:
Custom Python tests:
Custom Nix configuration:
1
2
3
|
{
runtimeLibstdcppRpath = true;
}
|
Required Python dependencies:
Try it out:
Nix stable:
-
1
2
3
|
$ nix-shell \
--attr 'projects."opencv-python-headless"."4.5.3.56".python38.dev' \
'https://github.com/on-nix/python/tarball/d8a7fa21b76ac3b8a1a3fedb41e86352769b09ed'
|
Nix Flakes:
-
1
2
|
$ nix develop \
'github:on-nix/python/d8a7fa21b76ac3b8a1a3fedb41e86352769b09ed#"opencv-python-headless-4.5.3.56-python38"'
|
Install opencv-python-headless's command line applications in your system:
Nix stable:
-
1
2
3
|
$ nix-env --install \
--attr 'apps."opencv-python-headless"."4.5.3.56"' \
--file 'https://github.com/on-nix/python/tarball/d8a7fa21b76ac3b8a1a3fedb41e86352769b09ed'
|
Nix Flakes:
-
1
2
|
$ nix profile install \
'github:on-nix/python#"opencv-python-headless-4.5.3.56-python38-bin"'
|
Use many Python projects together:
Nix stable:
-
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
# Save this file as: ./example.nix
let
# Import Nixpkgs
nixpkgs = import <nixpkgs> { };
# Import Python on Nix
pythonOnNix = import
(builtins.fetchGit {
ref = "main";
rev = "d8a7fa21b76ac3b8a1a3fedb41e86352769b09ed";
url = "https://github.com/on-nix/python";
})
{ inherit nixpkgs; };
env = pythonOnNix.python38Env {
name = "example";
projects = {
"opencv-python-headless" = "4.5.3.56";
# You can add more projects here as you need
# "a" = "1.0";
# "b" = "2.0";
# ...
};
};
# `env` has two attributes:
# - dev: The activation script for the Python on Nix environment
# - out: The raw contents of the Python site-packages
in
{
# The activation script can be used as dev-shell
shell = env.dev;
# You can also use with Nixpkgs
example = nixpkgs.stdenv.mkDerivation {
# Let's use the activation script as build input
# so the Python environment is loaded
buildInputs = [ env.dev ];
builder = builtins.toFile "builder.sh" ''
source $stdenv/setup
# opencv-python-headless will be available here!
touch $out
'';
name = "example";
};
}
# Usage:
#
# Dev Shell:
# $ nix-shell --attr shell ./example.nix
#
# Build example:
# $ nix-build --attr example ./example.nix
|
Nix Flakes:
-
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
# Save this file as: ./flake.nix
{
inputs = {
flakeUtils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:nixos/nixpkgs";
pythonOnNix.url = "github:on-nix/python/d8a7fa21b76ac3b8a1a3fedb41e86352769b09ed";
pythonOnNix.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, ... } @ inputs:
inputs.flakeUtils.lib.eachSystem [ "x86_64-linux" ] (system:
let
nixpkgs = inputs.nixpkgs.legacyPackages.${system};
pythonOnNix = inputs.pythonOnNix.lib.${system};
env = pythonOnNix.python38Env {
name = "example";
projects = {
"opencv-python-headless" = "4.5.3.56";
# You can add more projects here as you need
# "a" = "1.0";
# "b" = "2.0";
# ...
};
};
# `env` has two attributes:
# - dev: The activation script for the Python on Nix environment
# - out: The raw contents of the Python site-packages
in
{
devShells = {
# The activation script can be used as dev-shell
shell = env.dev;
};
packages = {
# You can also use with Nixpkgs
example = nixpkgs.stdenv.mkDerivation {
# Let's use the activation script as build input
# so the Python environment is loaded
buildInputs = [ env.dev ];
virtualEnvironment = env.out;
builder = builtins.toFile "builder.sh" ''
source $stdenv/setup
# opencv-python-headless will be available here!
touch $out
'';
name = "example";
};
};
}
);
}
# Usage:
# First add your changes:
# $ git add flake.nix
#
# Dev Shell:
# $ nix develop .#shell
#
# Build example:
# $ nix build .#example
|