Merge pull request #188901 from dwf/novnc_websockify

novnc: correctly install and point to `websockify`
This commit is contained in:
Anderson Torres 2022-09-30 22:26:50 -03:00 committed by GitHub
commit 018547fc8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 2 deletions

View File

@ -1,4 +1,4 @@
{ lib, stdenv, fetchFromGitHub }:
{ lib, python3, stdenv, substituteAll, fetchFromGitHub }:
stdenv.mkDerivation rec {
pname = "novnc";
@ -11,7 +11,12 @@ stdenv.mkDerivation rec {
sha256 = "sha256-Z+bks7kcwj+Z3uf/t0u25DnGOM60QhSH6uuoIi59jqU=";
};
patches = [ ./fix-paths.patch ];
patches = with python3.pkgs; [
(substituteAll {
src = ./websockify.patch;
inherit websockify;
})
] ++ [ ./fix-paths.patch ];
postPatch = ''
substituteAllInPlace utils/novnc_proxy

View File

@ -0,0 +1,13 @@
diff --git a/utils/novnc_proxy b/utils/novnc_proxy
index 0365c1e..7eba2db 100755
--- a/utils/novnc_proxy
+++ b/utils/novnc_proxy
@@ -167,7 +167,7 @@ if [[ -d ${HERE}/websockify ]]; then
echo "Using local websockify at $WEBSOCKIFY"
else
- WEBSOCKIFY_FROMSYSTEM=$(which websockify 2>/dev/null)
+ WEBSOCKIFY_FROMSYSTEM="@websockify@/bin/websockify"
WEBSOCKIFY_FROMSNAP=${HERE}/../usr/bin/python2-websockify
[ -f $WEBSOCKIFY_FROMSYSTEM ] && WEBSOCKIFY=$WEBSOCKIFY_FROMSYSTEM
[ -f $WEBSOCKIFY_FROMSNAP ] && WEBSOCKIFY=$WEBSOCKIFY_FROMSNAP