mirror of https://github.com/pyodide/pyodide.git
Add lzma (#2939)
This commit is contained in:
parent
d0cc45fa45
commit
b497ce26ed
|
@ -145,7 +145,7 @@ export MAIN_MODULE_CFLAGS= $(CFLAGS_BASE) \
|
|||
-I$(PYTHONINCLUDE) \
|
||||
-s EXCEPTION_CATCHING_ALLOWED=['we only want to allow exception handling in side modules']
|
||||
|
||||
export STDLIB_MODULE_CFLAGS= $(SIDE_MODULE_CFLAGS) -I Include/ -I .
|
||||
export STDLIB_MODULE_CFLAGS= $(SIDE_MODULE_CFLAGS) -I Include/ -I . -I Include/internal/
|
||||
|
||||
# For RUST
|
||||
export CARGO_HOME ?= $(HOME)/.cargo
|
||||
|
|
|
@ -12,6 +12,10 @@ substitutions:
|
|||
|
||||
# Change Log
|
||||
|
||||
## Unreleased
|
||||
|
||||
- New packages: the standard library lzma module {pr}`2939`
|
||||
|
||||
## Version 0.21.0
|
||||
|
||||
_August 9, 2022_
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
package:
|
||||
name: liblzma
|
||||
version: 5.2.2
|
||||
|
||||
source:
|
||||
url: https://github.com/xz-mirror/xz/releases/download/v5.2.2/xz-5.2.2.tar.gz
|
||||
sha256: 73df4d5d34f0468bd57d09f2d8af363e95ed6cc3a4a86129d2f2c366259902a2
|
||||
|
||||
build:
|
||||
library: true
|
||||
script: |
|
||||
emconfigure ./configure \
|
||||
CFLAGS="-fPIC" \
|
||||
--disable-xz \
|
||||
--disable-xzdec \
|
||||
--disable-lzmadec \
|
||||
--disable-lzmainfo \
|
||||
--disable-lzma-links \
|
||||
--disable-scripts \
|
||||
--disable-doc \
|
||||
--enable-shared=no \
|
||||
--prefix=${WASM_LIBRARY_DIR}
|
||||
|
||||
emmake make -j ${PYODIDE_JOBS:-3}
|
||||
emmake make install
|
|
@ -0,0 +1,23 @@
|
|||
package:
|
||||
name: lzma
|
||||
version: 1.0.0 # Nonesense
|
||||
_cpython_dynlib: true
|
||||
source:
|
||||
path: empty
|
||||
build:
|
||||
sharedlibrary: true
|
||||
script: |
|
||||
mkdir dist
|
||||
export DISTDIR=$(pwd)/dist
|
||||
cd $CPYTHONBUILD
|
||||
emcc $STDLIB_MODULE_CFLAGS -c Modules/_lzmamodule.c -o Modules/_lzmamodule.o \
|
||||
$(pkg-config --cflags --dont-define-prefix liblzma)
|
||||
|
||||
emcc Modules/_lzmamodule.o -o $DISTDIR/_lzma.so $SIDE_MODULE_LDFLAGS \
|
||||
$(pkg-config --libs --dont-define-prefix liblzma)
|
||||
requirements:
|
||||
run:
|
||||
- liblzma
|
||||
test:
|
||||
imports:
|
||||
- lzma
|
|
@ -0,0 +1,17 @@
|
|||
from pytest_pyodide import run_in_pyodide
|
||||
|
||||
|
||||
@run_in_pyodide(packages=["test", "lzma"], pytest_assert_rewrites=False)
|
||||
def test_lzma(selenium):
|
||||
# TODO: libregrtest.main(["test_lzma"]) doesn't collect any tests for some unknown reason.
|
||||
|
||||
import test.test_lzma
|
||||
import unittest
|
||||
|
||||
suite = unittest.TestSuite(
|
||||
[unittest.TestLoader().loadTestsFromModule(test.test_lzma)]
|
||||
)
|
||||
|
||||
runner = unittest.TextTestRunner(verbosity=2)
|
||||
result = runner.run(suite)
|
||||
assert result.wasSuccessful()
|
|
@ -80,6 +80,7 @@ CORE_PACKAGES = {
|
|||
"sharedlib-test-py",
|
||||
"cpp-exceptions-test",
|
||||
"ssl",
|
||||
"lzma",
|
||||
"pytest",
|
||||
"tblib",
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue