diff --git a/modules/xborders/setup.py b/modules/xborders/setup.py new file mode 100644 index 0000000..a002625 --- /dev/null +++ b/modules/xborders/setup.py @@ -0,0 +1,12 @@ +from setuptools import setup + +setup( + name='@pname@', + version='@version@', + author='deter0', + description='@desc@', + install_requires=['pycairo', 'requests', 'PyGObject'], + scripts=[ + 'xborders', + ], +) diff --git a/modules/xborders/xborders.nix b/modules/xborders/xborders.nix index e1997a9..75ee459 100644 --- a/modules/xborders/xborders.nix +++ b/modules/xborders/xborders.nix @@ -28,20 +28,14 @@ with pkgs; callPackage python3Packages.buildPythonPackage rec { pygobject3 ]; - preBuild = '' - cat >setup.py <<'EOF' - from setuptools import setup - setup( - name='${pname}', - version='${version}', - author='deter0', - description='${meta.description}', - install_requires=['pycairo', 'requests', 'PyGObject'], - scripts=[ - 'xborders', - ], - ) - EOF + postPatch = let + setup = pkgs.substituteAll { + src = ./setup.py; + desc = meta.description; # "description" is reserved + inherit pname version; + }; + in '' + ln -s ${setup} setup.py ''; meta = with lib; {