From a0f85bf7fd70a56a23fd094f89bf4971ac206a08 Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Sat, 25 Feb 2023 20:42:43 -0800 Subject: [PATCH] xborders: setup.py in separate file --- modules/xborders/setup.py | 12 ++++++++++++ modules/xborders/xborders.nix | 22 ++++++++-------------- 2 files changed, 20 insertions(+), 14 deletions(-) create mode 100644 modules/xborders/setup.py 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; {