kitty: fixing environment variable substituition in docs/Makefile

The previous substitutution only worked by accident as make requires
environment variables to be enclosed in curly brackets as shown in this
excerpt from the build output:
> PYTHONPATH=YTHONPATH:.. HOME=MPDIR/nowhere sphinx-build -M html "." "_build" -T

The substituition is moved to the existing patch file to simplify the
builder expression.
This commit is contained in:
Vaskó László 2018-10-20 20:40:20 +02:00
parent 1842c4aaa4
commit 2fdfa2115d
2 changed files with 16 additions and 6 deletions

View File

@ -35,12 +35,6 @@ buildPythonApplication rec {
})
];
postPatch = ''
substituteInPlace docs/Makefile \
--replace 'python3 .. +launch :sphinx-build' \
'PYTHONPATH=$PYTHONPATH:.. HOME=$TMPDIR/nowhere sphinx-build'
'';
buildPhase = ''
python3 setup.py linux-package
'';

View File

@ -9,3 +9,19 @@
if (!done) {
done = true;
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -3,7 +3,7 @@
# Patching is needed here for the following reasons:
# * `sphinx-build` in nixpkgs is not a Python file but a wrapper shell script
# * importing the `constants` package from Kitty has a side effect that it
# creates the user configuration directory. This package gets imported
# while sphinx scans the code for documentation strings.
#
# You can set these variables from the command line.
SPHINXOPTS = -T $(FAIL_WARN)
-SPHINXBUILD = python3 .. +launch :sphinx-build
+SPHINXBUILD = PYTHONPATH=${PYTHONPATH}:.. HOME=${TMPDIR}/kitty-build-home sphinx-build
SPHINXPROJ = kitty
SOURCEDIR = .
BUILDDIR = _build