diff --git a/flake.nix b/flake.nix index a5aa531..2399cb0 100644 --- a/flake.nix +++ b/flake.nix @@ -47,6 +47,7 @@ myEmacs = pkgs.callPackage ./pkgs/emacs {inherit my-dotfiles;}; simplematch = unstable.callPackage ./pkgs/simplematch {}; ExifRead = unstable.callPackage ./pkgs/exifread {}; + kcc = unstable.callPackage ./pkgs/kcc {}; organize = unstable.callPackage ./pkgs/organize {inherit simplematch ExifRead;}; obsidian-nvim = pkgs.callPackage ./pkgs/obsidian-nvim {}; nix = unstable.nix; diff --git a/pkgs/kcc/default.nix b/pkgs/kcc/default.nix new file mode 100644 index 0000000..1223d4a --- /dev/null +++ b/pkgs/kcc/default.nix @@ -0,0 +1,64 @@ +{ + lib, + pkgs, + python3, + python3Packages, + fetchPypi, + fetchFromGitHub, + mailman, + nixosTests, +}: let + mozjpeg_lossless_optimization = python3Packages.buildPythonApplication rec { + pname = "mozjpeg_lossless_optimization"; + version = "1.1.3"; + + src = fetchPypi { + inherit version; + pname = "mozjpeg-lossless-optimization"; + sha256 = "sha256-cl2Ydy6UP8oYsIAcuU5kXEd/9S5WrQsnvdt23fCRyj4="; + }; + + nativeBuildInputs = [pkgs.mozjpeg pkgs.cmake]; + propagatedBuildInputs = [python3Packages.cffi]; + dontUseCmakeConfigure = true; + }; +in + python3Packages.buildPythonPackage rec { + version = "5.7.0"; + pname = "kcc"; + + src = fetchFromGitHub { + owner = "ciromattia"; + repo = "${pname}"; + rev = "v${version}"; + hash = "sha256-LUUKCSjVrqlnkMnnx1h0BUZ/0rO/ezlIwgXE9wq9uQQ="; + }; + + nativeBuildInputs = with python3Packages; [ + pip + raven + requests + # Tests fail because they need this package which doesn't build + # pyside6 + ]; + propagatedBuildInputs = + [pkgs.p7zip] + ++ (with python3Packages; [ + psutil + pillow + python-slugify + natsort + mozjpeg_lossless_optimization + distro + ]); + + # There is an AssertionError + doCheck = false; + + meta = with lib; { + description = ""; + homepage = ""; + license = licenses.gpl3Plus; + maintainers = with maintainers; [qyliss]; + }; + }