1{
2 lib,
3 python3,
4 fetchFromGitHub,
5}:
6
7python3.pkgs.buildPythonApplication {
8 pname = "coffeegrindsize";
9 # no tags in the repo
10 version = "0-unstable-2021-04-20";
11
12 format = "other";
13
14 src = fetchFromGitHub {
15 owner = "jgagneastro";
16 repo = "coffeegrindsize";
17 rev = "22661ebd21831dba4cf32bfc6ba59fe3d49f879c";
18 hash = "sha256-HlTw0nmr+VZL6EUX9RJzj253fnAred9LNFNgVHqoAoI=";
19 };
20
21 propagatedBuildInputs = with python3.pkgs; [
22 tkinter
23 matplotlib
24 numpy
25 pandas
26 pillow
27 ];
28
29 installPhase = ''
30 runHook preInstall
31
32 mkdir -p $out/bin
33 echo "#!/usr/bin/env python" > "$out/bin/coffeegrindsize"
34 cat coffeegrindsize.py >> "$out/bin/coffeegrindsize"
35 chmod +x "$out/bin/coffeegrindsize"
36 patchShebangs "$out/bin/coffeegrindsize"
37
38 runHook postInstall
39 '';
40
41 meta = with lib; {
42 description = "Detects the individual coffee grounds in a white-background picture to determine particle size distribution";
43 mainProgram = "coffeegrindsize";
44 homepage = "https://github.com/jgagneastro/coffeegrindsize";
45 license = licenses.mit;
46 maintainers = with maintainers; [ t4ccer ];
47 };
48}