diff options
author | Mathieu Fenniak <mathieu@fenniak.net> | 2023-11-25 14:40:06 -0700 |
---|---|---|
committer | Mathieu Fenniak <mathieu@fenniak.net> | 2023-11-25 14:56:08 -0700 |
commit | 748ccc92a6f72c99258ce5b5bf464e79c6244710 (patch) | |
tree | 630a2d8f36290c8e333e56f1405339c328f7f84c /pkgs/desktops/plasma-5 | |
parent | 3820cc90caa77cb888e6f1b0f62eb7a788de644a (diff) |
libsForQt5.bismuth: Fix generated JS
As of 5789287a95caf4ea3228cdc15a0901b063fbebe6, esbuild was updated to 0.18.5 which introduced a new transpilation called "Static fields with assign semantics now use static blocks if possible" (https://github.com/evanw/esbuild/blob/v0.18.5/CHANGELOG.md). This causes generation of JavaScript code that is incompatible with KWin's JavaScript engine, resulting in errors loading Bismuth. This update uses esbuild's `--target` option to generate compatible output code.
Diffstat (limited to 'pkgs/desktops/plasma-5')
-rw-r--r-- | pkgs/desktops/plasma-5/3rdparty/addons/bismuth/0001-esbuild-config.patch | 13 | ||||
-rw-r--r-- | pkgs/desktops/plasma-5/3rdparty/addons/bismuth/default.nix | 4 |
2 files changed, 17 insertions, 0 deletions
diff --git a/pkgs/desktops/plasma-5/3rdparty/addons/bismuth/0001-esbuild-config.patch b/pkgs/desktops/plasma-5/3rdparty/addons/bismuth/0001-esbuild-config.patch new file mode 100644 index 0000000000000..8ec7a34d97605 --- /dev/null +++ b/pkgs/desktops/plasma-5/3rdparty/addons/bismuth/0001-esbuild-config.patch @@ -0,0 +1,13 @@ +diff --git a/src/kwinscript/CMakeLists.txt b/src/kwinscript/CMakeLists.txt +index 9e2f7054..ed607027 100644 +--- a/src/kwinscript/CMakeLists.txt ++++ b/src/kwinscript/CMakeLists.txt +@@ -39,7 +39,7 @@ endif() + set(ESBUILD_COMMAND + "esbuild" "--bundle" "${CMAKE_CURRENT_SOURCE_DIR}/index.ts" + "--outfile=${CMAKE_CURRENT_BINARY_DIR}/bismuth/contents/code/index.mjs" +- "--format=esm" "--platform=neutral") ++ "--format=esm" "--platform=neutral" "--target=es6") + if(USE_NPM) + list(PREPEND ESBUILD_COMMAND "npx") + endif() diff --git a/pkgs/desktops/plasma-5/3rdparty/addons/bismuth/default.nix b/pkgs/desktops/plasma-5/3rdparty/addons/bismuth/default.nix index ee43f98fda207..ca54ff8887804 100644 --- a/pkgs/desktops/plasma-5/3rdparty/addons/bismuth/default.nix +++ b/pkgs/desktops/plasma-5/3rdparty/addons/bismuth/default.nix @@ -21,6 +21,10 @@ mkDerivation rec { sha256 = "sha256-c13OFEw6E/I8j/mqeLnuc9Chi6pc3+AgwAMPpCzh974="; }; + patches = [ + ./0001-esbuild-config.patch + ]; + cmakeFlags = [ "-DUSE_TSC=OFF" "-DUSE_NPM=OFF" |