aboutsummaryrefslogtreecommitdiff
path: root/hydrilla-guix/hydrilla.scm
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2022-10-25 15:33:40 +0200
committerWojtek Kosior <koszko@koszko.org>2022-10-25 16:10:33 +0200
commitf7c4dff95e88d58d61c51b2a6b94c90e2e4e0c4b (patch)
tree1993c0e707912b975cc7998016ed026720dde274 /hydrilla-guix/hydrilla.scm
parent37b3cf9fb2a56cfa980844f527d834916b38cca8 (diff)
downloadhaketilo-hydrilla-f7c4dff95e88d58d61c51b2a6b94c90e2e4e0c4b.tar.gz
haketilo-hydrilla-f7c4dff95e88d58d61c51b2a6b94c90e2e4e0c4b.zip
[builder][server][proxy] prevent Guix package interference with locally-installed Python packages
Diffstat (limited to 'hydrilla-guix/hydrilla.scm')
-rw-r--r--hydrilla-guix/hydrilla.scm19
1 files changed, 17 insertions, 2 deletions
diff --git a/hydrilla-guix/hydrilla.scm b/hydrilla-guix/hydrilla.scm
index f580942..d505bf8 100644
--- a/hydrilla-guix/hydrilla.scm
+++ b/hydrilla-guix/hydrilla.scm
@@ -296,12 +296,27 @@ static types.")
(local-file (string-append %source-dir "/dist/" source-tarball-name)))
(build-system python-build-system)
(arguments
- `(#:phases
+ `(#:modules ((ice-9 match)
+ (guix build utils)
+ (guix build python-build-system))
+ #:phases
(modify-phases %standard-phases
(replace 'check
(lambda* (#:key tests? #:allow-other-keys)
(when tests?
- (invoke "pytest")))))))
+ (invoke "pytest"))))
+ (add-after 'wrap 'prevent-local-package-interference
+ (lambda* (#:key outputs #:allow-other-keys)
+ (match-let ((((_ . dir)) outputs))
+ (for-each (lambda (prog-name)
+ (substitute* (string-append dir "/bin/" prog-name)
+ (("^#!/.*$" shabang)
+ (string-append shabang
+ "export PYTHONNOUSERSITE=1\n"))))
+ '("hydrilla"
+ "hydrilla-server"
+ "hydrilla-builder"
+ "haketilo"))))))))
(propagated-inputs
(list mitmproxy
python-beautifulsoup4