Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Patch cleanup #135

Merged
merged 12 commits into from
May 27, 2022
13 changes: 0 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,8 @@ a.out.wasm
a.out.js.mem
a.out
a.wasm
src/.deps/
src/WebIDLGrammar.pkl
src/parser.out
src/Makefile
src/Makefile.in
src/aclocal.m4
src/autom4te.cache/
src/compile
src/config.log
src/config.status
src/configure
src/configure~
src/depcomp
src/install-sh
src/missing
lib/expat/xmlwf/xmlwf
dist
.libs/
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM emscripten/emsdk:2.0.20
FROM docker.io/emscripten/emsdk:2.0.34

RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
Expand Down
52 changes: 10 additions & 42 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
BASE_DIR:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
DIST_DIR:=$(BASE_DIR)dist/libraries

GLOBAL_CFLAGS:=-O3 -s ENVIRONMENT=web,webview
GLOBAL_CFLAGS:=-O3
GLOBAL_LDFLAGS:=-s ENVIRONMENT=web,webview,worker -s NO_EXIT_RUNTIME=1
export LDFLAGS = $(GLOBAL_LDFLAGS)

all: subtitleoctopus

Expand All @@ -24,10 +26,7 @@ $(DIST_DIR)/lib/libfribidi.a: build/lib/fribidi/configure
CFLAGS=" \
-s USE_PTHREADS=0 \
$(GLOBAL_CFLAGS) \
-s NO_FILESYSTEM=1 \
-s NO_EXIT_RUNTIME=1 \
-DFRIBIDI_ENTRY=extern \
-s MODULARIZE=1 \
" \
--prefix="$(DIST_DIR)" \
--host=x86-none-linux \
Expand All @@ -50,9 +49,6 @@ $(DIST_DIR)/lib/libexpat.a: build/lib/expat/configured
-DCMAKE_C_FLAGS=" \
-s USE_PTHREADS=0 \
$(GLOBAL_CFLAGS) \
-s NO_FILESYSTEM=1 \
-s NO_EXIT_RUNTIME=1 \
-s MODULARIZE=1 \
" \
-DCMAKE_INSTALL_PREFIX=$(DIST_DIR) \
-DEXPAT_BUILD_DOCS=off \
Expand Down Expand Up @@ -112,9 +108,6 @@ build/lib/freetype/build_hb/dist_hb/lib/libfreetype.a: $(DIST_DIR)/lib/libbrotli
CFLAGS=" \
-s USE_PTHREADS=0 \
$(GLOBAL_CFLAGS) \
-s NO_FILESYSTEM=1 \
-s NO_EXIT_RUNTIME=1 \
-s MODULARIZE=1 \
" \
--prefix="$$(pwd)/dist_hb" \
--host=x86-none-linux \
Expand Down Expand Up @@ -145,20 +138,13 @@ $(DIST_DIR)/lib/libharfbuzz.a: build/lib/freetype/build_hb/dist_hb/lib/libfreety
CFLAGS=" \
-s USE_PTHREADS=0 \
$(GLOBAL_CFLAGS) \
-s NO_FILESYSTEM=1 \
-DHB_NO_MT \
-s NO_EXIT_RUNTIME=1 \
-s MODULARIZE=1 \
" \
CXXFLAGS=" \
-s USE_PTHREADS=0 \
$(GLOBAL_CFLAGS) \
-s NO_FILESYSTEM=1 \
-DHB_NO_MT \
-s NO_EXIT_RUNTIME=1 \
-s MODULARIZE=1 \
" \
LDFLAGS="" \
--prefix="$(DIST_DIR)" \
--host=x86-none-linux \
--build=x86_64 \
Expand All @@ -178,14 +164,11 @@ $(DIST_DIR)/lib/libharfbuzz.a: build/lib/freetype/build_hb/dist_hb/lib/libfreety
# Freetype with Harfbuzz
$(DIST_DIR)/lib/libfreetype.a: $(DIST_DIR)/lib/libharfbuzz.a $(DIST_DIR)/lib/libbrotlidec.a
cd build/lib/freetype && \
EM_PKG_CONFIG_PATH=$(DIST_DIR)/lib/pkgconfig \
EM_PKG_CONFIG_PATH=$(DIST_DIR)/lib/pkgconfig:$(BASE_DIR)build/lib/freetype/build_hb/dist_hb/lib/pkgconfig \
emconfigure ./configure \
CFLAGS=" \
-s USE_PTHREADS=0 \
$(GLOBAL_CFLAGS) \
-s NO_FILESYSTEM=1 \
-s NO_EXIT_RUNTIME=1 \
-s MODULARIZE=1 \
" \
--prefix="$(DIST_DIR)" \
--host=x86-none-linux \
Expand Down Expand Up @@ -217,8 +200,6 @@ $(DIST_DIR)/lib/libfontconfig.a: $(DIST_DIR)/lib/libharfbuzz.a $(DIST_DIR)/lib/l
-s USE_PTHREADS=0 \
-DEMSCRIPTEN \
$(GLOBAL_CFLAGS) \
-s NO_EXIT_RUNTIME=1 \
-s MODULARIZE=1 \
" \
--prefix="$(DIST_DIR)" \
--host=x86-none-linux \
Expand Down Expand Up @@ -247,8 +228,6 @@ $(DIST_DIR)/lib/libass.a: $(DIST_DIR)/lib/libfontconfig.a $(DIST_DIR)/lib/libhar
CFLAGS=" \
-s USE_PTHREADS=0 \
$(GLOBAL_CFLAGS) \
-s NO_EXIT_RUNTIME=1 \
-s MODULARIZE=1 \
" \
--prefix="$(DIST_DIR)" \
--host=x86-none-linux \
Expand All @@ -274,28 +253,17 @@ OCTP_DEPS = \
$(DIST_DIR)/lib/libfontconfig.a \
$(DIST_DIR)/lib/libass.a

# Require a patch to fix some errors
src/SubOctpInterface.cpp: src/SubtitleOctopus.idl
cd src && \
python3 ../build/webidl_binder.py SubtitleOctopus.idl SubOctpInterface

src/Makefile: src/SubOctpInterface.cpp
cd src && \
autoreconf -fi && \
EM_PKG_CONFIG_PATH=$(DIST_DIR)/lib/pkgconfig \
emconfigure ./configure --host=x86-none-linux --build=x86_64 CFLAGS="$(GLOBAL_CFLAGS)"

src/subtitles-octopus-worker.bc: $(OCTP_DEPS) src/Makefile src/SubtitleOctopus.cpp src/SubOctpInterface.cpp
cd src && \
emmake make -j8 && \
mv subtitlesoctopus.bc subtitles-octopus-worker.bc
src/subtitles-octopus-worker.bc: $(OCTP_DEPS) all-src
.PHONY: all-src
all-src:
PKG_CONFIG_PATH=$(DIST_DIR)/lib/pkgconfig \
$(MAKE) -C src all

# Dist Files
EMCC_COMMON_ARGS = \
$(GLOBAL_CFLAGS) \
$(GLOBAL_LDFLAGS) \
-s EXPORTED_FUNCTIONS="['_main', '_malloc']" \
-s EXPORTED_RUNTIME_METHODS="['ccall', 'cwrap', 'getValue', 'FS_createPreloadedFile', 'FS_createPath']" \
-s NO_EXIT_RUNTIME=1 \
--use-preload-plugins \
--preload-file assets/default.woff2 \
--preload-file assets/fonts.conf \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/configure.ac b/configure.ac
index 394c281..1cb2f74 100644
index 26b974a..b73d132 100644
--- a/configure.ac
+++ b/configure.ac
@@ -681,22 +681,8 @@ if $fc_cv_have_solaris_atomic_ops; then
@@ -712,22 +712,8 @@ if $fc_cv_have_solaris_atomic_ops; then
AC_DEFINE(HAVE_SOLARIS_ATOMIC_OPS, 1, [Have Solaris __machine_*_barrier and atomic_* operations])
fi

Expand Down
46 changes: 0 additions & 46 deletions build/patches/fontconfig/0003-fix-fcstats-emscripten.patch

This file was deleted.

26 changes: 0 additions & 26 deletions build/patches/freetype/0001-disable-exports.patch

This file was deleted.

10 changes: 0 additions & 10 deletions build/patches/harfbuzz/0002-disable-dependency-build.patch

This file was deleted.

Empty file removed build/patches/libass/.gitkeep
Empty file.
2 changes: 1 addition & 1 deletion lib/fontconfig
Submodule fontconfig updated from e291fd to d37f97
22 changes: 22 additions & 0 deletions src/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# If needed, override the following variables via `make VARNAME=VAL ...`
# Note: we only compile and not(!) link here, thus -c
CXX = em++ -c
CXXFLAGS = -O3 -g4
LIBASS_CXXFLAGS = $(shell pkg-config --static --cflags "libass >= 0.14.0")
LOCAL_CXXFLAGS = -Wall -Wno-deprecated $(LIBASS_CXXFLAGS)

all: subtitles-octopus-worker.bc

SubOctpInterface.cpp: SubtitleOctopus.idl ../build/webidl_binder.py
@# Our version of WebIDL contains JSO-specific patches
python3 ../build/webidl_binder.py SubtitleOctopus.idl SubOctpInterface

subtitles-octopus-worker.bc: SubtitleOctopus.cpp libass.cpp SubOctpInterface.cpp
@# All later dependencies are already included into the first by CPP
$(CXX) $(LOCAL_CXXFLAGS) $(CXXFLAGS) -o $@ $<

clean:
rm -f subtitles-octopus-worker.bc
rm -f SubOctpInterface.cpp WebIDLGrammar.pkl parser.out

.PHONY: all clean
8 changes: 0 additions & 8 deletions src/Makefile.am

This file was deleted.

20 changes: 0 additions & 20 deletions src/configure.ac

This file was deleted.