Skip to content

Commit

Permalink
Update flake for new mailcap dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
lucc committed Dec 7, 2024
1 parent 9c5b737 commit f29e9b9
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@
# get a list of python packages by name, used to get the nix packages
# for the dependency names from the pyproject file
getPkgs = names: builtins.attrValues (pkgs.lib.attrsets.getAttrs names pkgs.python3Packages);
# extract the python dependencies from the pyprojec file, cut the version constraint
dependencies' = pkgs.lib.lists.concatMap (builtins.match "([^>=<]*).*") pyproject.project.dependencies;
# extract the python dependencies from the pyprojec file, cut the version constraints
dependencies' = pkgs.lib.lists.concatMap (builtins.match "([^>=<;]*).*") pyproject.project.dependencies;
# the package is called gpg on PyPI but gpgme in nixpkgs
dependencies = map (x: if x == "gpg" then "gpgme" else x) dependencies';
renameGPG = x: if x == "gpg" then "gpgme" else x;
# mailcap has been removed from the stdlib in py3.13 and needs to be
# fetched from pypi
withMailcap = x: (pkgs.lib.strings.versionOlder "3.12" pkgs.python3.version) || (x != "standard-mailcap");
dependencies = map renameGPG (builtins.filter withMailcap dependencies');
in
{
packages = {
Expand Down

0 comments on commit f29e9b9

Please sign in to comment.