diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 08dc15de..7fcd975a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -215,15 +215,4 @@ jobs: .. make -j5 - - popd - # Patch output - python wasm_patches/patch_it.py - - - uses: actions/upload-artifact@v2 - with: - name: xeus-python-wasm - path: | - build/xpython_wasm.js - build/xpython_wasm.wasm - + \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index abf75eb2..72112373 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -398,7 +398,7 @@ if (XPYT_BUILD_XPYTHON_EXTENSION) xpyt_target_link_libraries(xpython_extension) endif() -# xpython_wasm +# xpython # ============ if (EMSCRIPTEN) @@ -410,19 +410,19 @@ if (EMSCRIPTEN) $ENV{PREFIX}/lib/libffi.a ) - add_executable(xpython_wasm ${XPYTHON_WASM_SRC}) - target_link_libraries(xpython_wasm PRIVATE ${PYTHON_UTIL_LIBS} pybind11::embed) + add_executable(xpython ${XPYTHON_WASM_SRC}) + target_link_libraries(xpython PRIVATE ${PYTHON_UTIL_LIBS} pybind11::embed) - xpyt_set_common_options(xpython_wasm) - target_compile_options(xpython_wasm PRIVATE -fPIC) + xpyt_set_common_options(xpython) + target_compile_options(xpython PRIVATE -fPIC) - xpyt_set_kernel_options(xpython_wasm) - target_link_libraries(xpython_wasm PRIVATE xeus-python-wasm xeus-lite) + xpyt_set_kernel_options(xpython) + target_link_libraries(xpython PRIVATE xeus-python-wasm xeus-lite) include(WasmBuildOptions) - xeus_wasm_compile_options(xpython_wasm) - xeus_wasm_link_options(xpython_wasm "web,worker") - target_link_options(xpython_wasm + xeus_wasm_compile_options(xpython) + xeus_wasm_link_options(xpython "web,worker") + target_link_options(xpython PUBLIC "SHELL: -s LZ4=1" PUBLIC "SHELL: --post-js ${CMAKE_CURRENT_BINARY_DIR}/post.js" PUBLIC "SHELL: --pre-js pre.js" @@ -513,8 +513,9 @@ endif () if (EMSCRIPTEN) install(FILES - "$/xpython_wasm.js" - "$/xpython_wasm.wasm" - DESTINATION ${XJUPYTER_DATA_DIR}/kernels/xpython/ + "$/xpython.js" + "$/xpython.wasm" + DESTINATION ${CMAKE_INSTALL_BINDIR} ) + endif () diff --git a/share/jupyter/kernels/xpython/kernel.json.in b/share/jupyter/kernels/xpython/kernel.json.in index 88e7e387..4b67027c 100644 --- a/share/jupyter/kernels/xpython/kernel.json.in +++ b/share/jupyter/kernels/xpython/kernel.json.in @@ -6,5 +6,5 @@ "{connection_file}" ], "language": "python", - "metadata": { "debugger": true, "wasm_name" : "xpython_wasm"} + "metadata": { "debugger": true} } diff --git a/wasm_patches/patch_it.py b/wasm_patches/patch_it.py deleted file mode 100644 index 617a7c4f..00000000 --- a/wasm_patches/patch_it.py +++ /dev/null @@ -1,9 +0,0 @@ -with open('./build/xpython_wasm.js', 'r') as f: - content = f.read() - - -query = 'Module["preloadPlugins"].push(audioPlugin);' -content = content.replace(query, '') - -with open('./build/xpython_wasm.js', 'w') as f: - f.write(content)