Skip to content

Instantly share code, notes, and snippets.

@LuisChDev
Created February 20, 2022 03:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LuisChDev/e171efda79437384adef948631184a70 to your computer and use it in GitHub Desktop.
Save LuisChDev/e171efda79437384adef948631184a70 to your computer and use it in GitHub Desktop.
code for packaging AutoThemely
{ lib, fetchFromGitHub, python3, gtk3, wrapGAppsHook }:
# need to override this as astral 2.0 has breaking changes
let
python3_ = python3.override {
packageOverrides = self: super: {
astral = super.astral.overrideAttrs (old: rec {
version = "1.10.1";
src = super.fetchPypi {
inherit version;
pname = "astral";
sha256 = "sha256-0qZyQ8RQMTHIVsr7GxJ23lKobluKHVB7fgi+5Ry2e/E=";
};
});
};
};
in python3_.pkgs.buildPythonApplication rec {
pname = "automathemely";
version = "latest";
src = fetchFromGitHub {
owner = "C2N14";
repo = "AutomaThemely";
rev = "3f6f9973eb78c707454b53a26dbe746f8667a924";
sha256 = "sha256-90EKU1ycu+AY+ZVRPIC9sKn1w292r6wFMWp+qHC6czE=";
};
nativeBuildInputs = [
wrapGAppsHook
];
buildInputs = [
gtk3
];
propagatedBuildInputs = with python3_.pkgs; [
astral
requests
pytz
tzlocal
schedule
pygobject3 # implicit dependency
];
postPatch = ''
# tries to call itself during install just to read the version. And this causes an attempt to read $HOME
substituteInPlace setup.py --replace 'from automathemely import __version__ as version' ' '
substituteInPlace setup.py --replace 'version=version' 'version="latest"'
'';
doCheck = false; # no tests anyway, and again tries to access $HOME
meta = with lib; {
description =
"Simple, set-and-forget python application for changing between desktop themes according to light and dark hours";
license = licenses.gpl3;
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment