Skip to content

Commit

Permalink
Update dependencies and patches
Browse files Browse the repository at this point in the history
  • Loading branch information
kleisauke committed Aug 18, 2022
1 parent 79a3b53 commit 5e3b052
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 26 deletions.
18 changes: 10 additions & 8 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ echo "Compiling zlib-ng"
echo "============================================="
test -f "$TARGET/lib/pkgconfig/zlib.pc" || (
mkdir $DEPS/zlib-ng
curl -Ls https://github.com/zlib-ng/zlib-ng/archive/$VERSION_ZLIBNG.tar.gz | tar xzC $DEPS/zlib-ng --strip-components=1
curl -Ls https://github.com/zlib-ng/zlib-ng/archive/refs/tags/$VERSION_ZLIBNG.tar.gz | tar xzC $DEPS/zlib-ng --strip-components=1
cd $DEPS/zlib-ng
# SSE intrinsics needs to be checked for wasm32
sed -i 's/|\s*x86_64/& | wasm32/g' configure
Expand Down Expand Up @@ -255,11 +255,13 @@ echo "Compiling jpeg"
echo "============================================="
test -f "$TARGET/lib/pkgconfig/libjpeg.pc" || (
mkdir $DEPS/jpeg
curl -Ls https://github.com/mozilla/mozjpeg/archive/v$VERSION_JPEG.tar.gz | tar xzC $DEPS/jpeg --strip-components=1
curl -Ls https://github.com/mozilla/mozjpeg/archive/refs/tags/v$VERSION_JPEG.tar.gz | tar xzC $DEPS/jpeg --strip-components=1
cd $DEPS/jpeg
# https://github.com/libjpeg-turbo/libjpeg-turbo/issues/250#issuecomment-407615180
# Compile without SIMD support, see: https://github.com/libjpeg-turbo/libjpeg-turbo/issues/250
# Disable environment variables usage, see: https://github.com/libjpeg-turbo/libjpeg-turbo/issues/600
emcmake cmake -B_build -H. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$TARGET -DENABLE_STATIC=TRUE \
-DENABLE_SHARED=FALSE -DWITH_JPEG8=TRUE -DWITH_SIMD=FALSE -DWITH_TURBOJPEG=FALSE -DPNG_SUPPORTED=FALSE
-DENABLE_SHARED=FALSE -DWITH_JPEG8=TRUE -DWITH_SIMD=FALSE -DWITH_TURBOJPEG=FALSE -DPNG_SUPPORTED=FALSE \
-DCMAKE_C_FLAGS="$CFLAGS -DNO_GETENV -DNO_PUTENV"
make -C _build install
)

Expand All @@ -268,7 +270,7 @@ echo "Compiling spng"
echo "============================================="
test -f "$TARGET/lib/pkgconfig/spng.pc" || (
mkdir $DEPS/spng
curl -Ls https://github.com/randy408/libspng/archive/v$VERSION_SPNG.tar.gz | tar xzC $DEPS/spng --strip-components=1
curl -Ls https://github.com/randy408/libspng/archive/refs/tags/v$VERSION_SPNG.tar.gz | tar xzC $DEPS/spng --strip-components=1
cd $DEPS/spng
# TODO(kleisauke): Discuss this patch upstream
patch -p1 <$SOURCE_DIR/build/patches/libspng-emscripten.patch
Expand All @@ -284,7 +286,7 @@ echo "Compiling imagequant"
echo "============================================="
test -f "$TARGET/lib/pkgconfig/imagequant.pc" || (
mkdir $DEPS/imagequant
curl -Ls https://github.com/lovell/libimagequant/archive/v$VERSION_IMAGEQUANT.tar.gz | tar xzC $DEPS/imagequant --strip-components=1
curl -Ls https://github.com/lovell/libimagequant/archive/refs/tags/v$VERSION_IMAGEQUANT.tar.gz | tar xzC $DEPS/imagequant --strip-components=1
cd $DEPS/imagequant
# TODO(kleisauke): Discuss this patch upstream
patch -p1 <$SOURCE_DIR/build/patches/imagequant-emscripten.patch
Expand All @@ -298,10 +300,10 @@ echo "Compiling cgif"
echo "============================================="
test -f "$TARGET/lib/pkgconfig/cgif.pc" || (
mkdir $DEPS/cgif
curl -Ls https://github.com/dloebl/cgif/archive/V$VERSION_CGIF.tar.gz | tar xzC $DEPS/cgif --strip-components=1
curl -Ls https://github.com/dloebl/cgif/archive/refs/tags/V$VERSION_CGIF.tar.gz | tar xzC $DEPS/cgif --strip-components=1
cd $DEPS/cgif
meson setup _build --prefix=$TARGET --cross-file=$MESON_CROSS --default-library=static --buildtype=release \
-Dtests=false
-Dtests=false
ninja -C _build install
)

Expand Down
6 changes: 3 additions & 3 deletions build/patches/emscripten-auto-deletelater.patch
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ diff --git a/src/embind/embind.js b/src/embind/embind.js
index 1111111..2222222 100644
--- a/src/embind/embind.js
+++ b/src/embind/embind.js
@@ -14,7 +14,7 @@
@@ -13,7 +13,7 @@
/*jslint sub:true*/ /* The symbols 'fromWireType' and 'toWireType' must be accessed via array notation to be closure-safe since craftInvokerFunction crafts functions as strings that can't be closured. */

// -- jshint doesn't understand library syntax, so we need to specifically tell it about the symbols we define
Expand All @@ -19,7 +19,7 @@ index 1111111..2222222 100644
/*global ensureOverloadTable, embind__requireFunction, awaitingDependencies, makeLegalFunctionName, embind_charCodes:true, registerType, createNamedFunction, RegisteredPointer, throwInternalError*/
/*global simpleReadValueFromPointer, floatReadValueFromPointer, integerReadValueFromPointer, enumReadValueFromPointer, replacePublicSymbol, craftInvokerFunction, tupleRegistrations*/
/*global finalizationRegistry, attachFinalizer, detachFinalizer, releaseClassHandle, runDestructor*/
@@ -42,11 +42,12 @@ var LibraryEmbind = {
@@ -41,11 +41,12 @@ var LibraryEmbind = {

$init_embind__deps: [
'$getInheritedInstanceCount', '$getLiveInheritedInstances',
Expand All @@ -33,7 +33,7 @@ index 1111111..2222222 100644
Module['flushPendingDeletes'] = flushPendingDeletes;
Module['setDelayFunction'] = setDelayFunction;
#if IN_TEST_HARNESS
@@ -1758,15 +1759,25 @@ var LibraryEmbind = {
@@ -1757,15 +1758,25 @@ var LibraryEmbind = {
}
},

Expand Down
20 changes: 10 additions & 10 deletions build/patches/emscripten-vector-as-js-array.patch
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ diff --git a/src/embind/embind.js b/src/embind/embind.js
index 1111111..2222222 100644
--- a/src/embind/embind.js
+++ b/src/embind/embind.js
@@ -413,6 +413,36 @@ var LibraryEmbind = {
@@ -412,6 +412,36 @@ var LibraryEmbind = {
return array;
},

Expand Down Expand Up @@ -48,7 +48,7 @@ index 1111111..2222222 100644
$requireRegisteredType__deps: [
'$registeredTypes', '$getTypeName', '$throwBindingError'],
$requireRegisteredType: function(rawType, humanName) {
@@ -443,7 +473,7 @@ var LibraryEmbind = {
@@ -442,7 +472,7 @@ var LibraryEmbind = {

_embind_register_bool__sig: 'vpppii',
_embind_register_bool__deps: [
Expand All @@ -57,7 +57,7 @@ index 1111111..2222222 100644
_embind_register_bool: function(rawType, name, size, trueValue, falseValue) {
var shift = getShiftFromSize(size);

@@ -461,16 +491,7 @@ var LibraryEmbind = {
@@ -460,16 +490,7 @@ var LibraryEmbind = {
'argPackAdvance': 8,
'readValueFromPointer': function(pointer) {
// TODO: if heap is fixed (like in asm.js) this could be executed outside
Expand All @@ -75,7 +75,7 @@ index 1111111..2222222 100644
return this['fromWireType'](heap[pointer >> shift]);
},
destructorFunction: null, // This type does not need a destructor
@@ -489,60 +510,57 @@ var LibraryEmbind = {
@@ -488,60 +509,57 @@ var LibraryEmbind = {
}
},

Expand Down Expand Up @@ -159,7 +159,7 @@ index 1111111..2222222 100644
}
},

@@ -569,7 +587,7 @@ var LibraryEmbind = {
@@ -568,7 +586,7 @@ var LibraryEmbind = {
fromWireType = (value) => (value << bitshift) >>> bitshift;
}

Expand All @@ -168,7 +168,7 @@ index 1111111..2222222 100644
var checkAssertions = (value, toTypeName) => {
#if ASSERTIONS
if (typeof value != "number" && typeof value != "boolean") {
@@ -613,7 +631,7 @@ var LibraryEmbind = {
@@ -612,7 +630,7 @@ var LibraryEmbind = {

var shift = getShiftFromSize(size);

Expand All @@ -177,15 +177,15 @@ index 1111111..2222222 100644

// maxRange comes through as -1 for uint64_t (see issue 13902). Work around that temporarily
if (isUnsignedType) {
@@ -785,6 +803,7 @@ var LibraryEmbind = {
@@ -784,6 +802,7 @@ var LibraryEmbind = {
_embind_register_std_wstring__sig: 'vppp',
_embind_register_std_wstring__deps: [
'$readLatin1String', '$registerType', '$simpleReadValueFromPointer',
+ '$getIntegerHeap',
'$UTF16ToString', '$stringToUTF16', '$lengthBytesUTF16',
'$UTF32ToString', '$stringToUTF32', '$lengthBytesUTF32',
],
@@ -790,18 +809,16 @@ var LibraryEmbind = {
@@ -789,18 +808,16 @@ var LibraryEmbind = {
],
_embind_register_std_wstring: function(rawType, charSize, name) {
name = readLatin1String(name);
Expand All @@ -205,7 +205,7 @@ index 1111111..2222222 100644
shift = 2;
}
registerType(rawType, {
@@ -809,7 +826,7 @@ var LibraryEmbind = {
@@ -808,7 +825,7 @@ var LibraryEmbind = {
'fromWireType': function(value) {
// Code mostly taken from _embind_register_std_string fromWireType
var length = HEAPU32[value >> 2];
Expand All @@ -214,7 +214,7 @@ index 1111111..2222222 100644
var str;

var decodeStartPtr = value + 4;
@@ -884,6 +901,71 @@ var LibraryEmbind = {
@@ -883,6 +900,71 @@ var LibraryEmbind = {
});
},

Expand Down
2 changes: 1 addition & 1 deletion build/patches/emscripten-wasmfs-implement-fs-unlink.patch
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ diff --git a/emcc.py b/emcc.py
index 1111111..2222222 100644
--- a/emcc.py
+++ b/emcc.py
@@ -2091,6 +2091,7 @@ def phase_linker_setup(options, state, newargs, user_settings):
@@ -2093,6 +2093,7 @@ def phase_linker_setup(options, state, newargs, user_settings):
settings.REQUIRED_EXPORTS += [
'_wasmfs_write_file',
'_wasmfs_mkdir',
Expand Down
2 changes: 1 addition & 1 deletion build/patches/emscripten-wasmfs-implement-munmap.patch
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ diff --git a/system/lib/wasmfs/syscalls.cpp b/system/lib/wasmfs/syscalls.cpp
index 1111111..2222222 100644
--- a/system/lib/wasmfs/syscalls.cpp
+++ b/system/lib/wasmfs/syscalls.cpp
@@ -1545,6 +1545,13 @@ intptr_t _mmap_js(
@@ -1558,6 +1558,13 @@ intptr_t _mmap_js(
return (intptr_t)ptr;
}

Expand Down
2 changes: 1 addition & 1 deletion build/patches/emscripten-wasmfs-mmap-shared.patch
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ diff --git a/system/lib/wasmfs/syscalls.cpp b/system/lib/wasmfs/syscalls.cpp
index 1111111..2222222 100644
--- a/system/lib/wasmfs/syscalls.cpp
+++ b/system/lib/wasmfs/syscalls.cpp
@@ -1511,12 +1511,6 @@ intptr_t _mmap_js(
@@ -1524,12 +1524,6 @@ intptr_t _mmap_js(
return -ENODEV;
}

Expand Down
4 changes: 2 additions & 2 deletions playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
"mini-css-extract-plugin": "^2.6.1",
"monaco-editor": "^0.34.0",
"monaco-editor-webpack-plugin": "^7.0.1",
"terser-webpack-plugin": "^5.3.3",
"terser-webpack-plugin": "^5.3.5",
"webpack": "^5.74.0",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.9.3"
"webpack-dev-server": "^4.10.0"
}
}

0 comments on commit 5e3b052

Please sign in to comment.