-
Notifications
You must be signed in to change notification settings - Fork 138
Expand file tree
/
Copy pathflake.nix
More file actions
112 lines (95 loc) · 3.13 KB
/
flake.nix
File metadata and controls
112 lines (95 loc) · 3.13 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
{
description = "Software defined LaserDisc decoder";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
python = pkgs.python312;
pythonPackages = python.pkgs;
# PEP-440 compatible version string (for package metadata)
version = "7.2.0";
# Use flake's built-in git properties
# dirtyShortRev already includes "-dirty" suffix, so we need to handle it
gitCommit = if self ? dirtyShortRev then self.dirtyShortRev else self.shortRev;
gitDirty = self ? dirtyRev;
# Build PEP-440 compliant version string with git info
# Format: base_version+git.commit[.dirty]
# dirtyShortRev format is "abc1234-dirty", so replace "-" with "."
fullVersion = "${version}+git.${builtins.replaceStrings ["-"] ["."] gitCommit}";
ld-decode = pythonPackages.buildPythonPackage {
pname = "ld-decode";
inherit version;
src = ./.;
pyproject = true;
nativeBuildInputs = with pythonPackages; [
setuptools
wheel
pkgs.git
];
propagatedBuildInputs = with pythonPackages; [
av
matplotlib
numba
numpy
scipy
];
# Write PEP-440 compliant version file with git info
preBuild = ''
echo "${fullVersion}" > lddecode/version
'';
# Skip tests for minimal build
doCheck = false;
meta = with pkgs.lib; {
description = "Software defined LaserDisc decoder";
homepage = "https://github.com/happycube/ld-decode";
license = licenses.gpl3Plus;
maintainers = [ ];
};
};
in
{
packages = {
default = ld-decode;
ld-decode = ld-decode;
};
apps = {
default = {
type = "app";
program = "${ld-decode}/bin/ld-decode";
};
ld-decode = {
type = "app";
program = "${ld-decode}/bin/ld-decode";
};
ld-ldf-reader-py = {
type = "app";
program = "${ld-decode}/bin/ld-ldf-reader-py";
};
};
devShells.default = pkgs.mkShell {
buildInputs = [
pkgs.cmake
pkgs.ffmpeg
ld-decode
python
pythonPackages.av
pythonPackages.matplotlib
pythonPackages.numba
pythonPackages.numpy
pythonPackages.scipy
pythonPackages.jupyter
pythonPackages.pandas
pythonPackages.pytest
pythonPackages.pytest-cov
];
shellHook = ''
echo "ld-decode development environment"
'';
};
}
);
}