-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathflake.nix
More file actions
68 lines (60 loc) · 1.96 KB
/
flake.nix
File metadata and controls
68 lines (60 loc) · 1.96 KB
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
{
description = "A collection of general-purpose VapourSynth functions to be reused in modules and scripts.";
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, flake-utils }: flake-utils.lib.eachSystem [ "x86_64-linux" ] (system:
let
pkgs = import nixpkgs {
inherit system;
};
## Change this to update python versions.
## run "nix flake lock --update-input nixpkgs" after you did that.
python = pkgs.python310;
# On darwin it sadly needs to be monkey-patched still.
vapoursynth_python = py: py.pkgs.vapoursynth;
in
{
devShells.default = pkgs.mkShell {
buildInputs = [
(python.withPackages (ps: [
(vapoursynth_python python)
]))
];
};
devShell = self.devShell.${system}.default;
packages.default = python.pkgs.buildPythonPackage {
pname = "vsutil";
version =
let
content = builtins.readFile ./vsutil/_metadata.py;
version = builtins.match ".*__version__.*'(.*)'.*" content;
in
builtins.elemAt version 0;
src = ./.;
buildInputs = [
(vapoursynth_python python)
];
checkPhase = ''
${python}/bin/python -m unittest discover -s $src/tests
'';
};
packages.dist =
let
build_python = python.withPackages (ps: [
ps.setuptools
ps.wheel
]);
in
pkgs.runCommandNoCC "vsutil-dist" { src = ./.; } ''
# Make sure the package test run.
echo ${self.packages.${system}.default} >/dev/null
cp -r $src/* .
${build_python}/bin/python setup.py bdist_wheel
${build_python}/bin/python setup.py sdist
mkdir $out
cp ./dist/* $out
'';
defaultPackage = self.packages.${system}.default;
}
);
}