Skip to content

Fixed build problem on OSX #2276

New issue

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

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

Already on GitHub? Sign in to your account

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
df80271
Fixed build problem on OSX
johnrobinsn Aug 3, 2020
919c82c
Fixed drag behavior when dragging outside of a window
johnrobinsn Aug 20, 2020
62f794b
Moved pxContext and related files out of Spark and into pxCore area
johnrobinsn Aug 20, 2020
14cb2b0
Attempt to cleanup windows build a bit
johnrobinsn Aug 25, 2020
57461bb
Old patch was not working correctly with git apply
johnrobinsn Aug 25, 2020
dee9807
Fixed up SparkGL on Windows
johnrobinsn Aug 30, 2020
3d3c332
Modifier Keys Should Not Emit Key Events
johnrobinsn Aug 30, 2020
4c531f2
Spark.cpp cleanup and reducing WIN32 #ifdefs
johnrobinsn Sep 1, 2020
f7e7c0a
Adding editorconfig
johnrobinsn Sep 1, 2020
897b9ea
Attempt to handle subsystem windows
johnrobinsn Sep 1, 2020
35084d6
Fixes to try and get OSX running after BigSur
johnrobinsn Sep 22, 2021
d395f50
Updated node patch file for subsystem:windows
johnrobinsn Sep 22, 2021
974bfa4
Merge pull request #1 from johnrobinsn/git-configure
johnrobinsn Sep 23, 2021
582b091
not using the old spark-webgl stuff anymore
johnrobinsn Sep 23, 2021
2568995
Some more build.sh fixes and cleanups
johnrobinsn Sep 23, 2021
d9cd0b3
Rolling back a few changes that broke build.sh
johnrobinsn Sep 23, 2021
6d96a60
Fixed resizing weirdness on Big Sur
johnrobinsn Sep 25, 2021
a89b98c
Preserving browser: urls during navigation
johnrobinsn Sep 25, 2021
5cf66f6
stubbed out pxSharedContextNative for linux/X
johnrobinsn Oct 23, 2021
ce9f48a
Cleanup to avoid compiler warnings (as errors)
johnrobinsn Oct 23, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ charset = utf-8
indent_size = 2

[*.py]
indent_size = 4
indent_size = 2

[Makefile]
indent_style = tab
Expand All @@ -38,4 +38,4 @@ indent_brace_style = Stroustrup
indent_style = tab

[*.{c++,cc,cxx}]
indent_brace_style = Allman
indent_brace_style = Stroustrup
14 changes: 11 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,21 @@ xcuserdata
node-v0.12.7-darwin-x64
temp/*
build/*
bld/*
gl2d*
apinames
src/obj/
src/.vscode/

examples/pxScene2d/external/giflib-5.1.9/*.obj
examples/pxScene2d/external/giflib-5.1.9/*.lib

examples/pxScene2d/external/libpng-1.6.12/Makefile
examples/pxScene2d/external/libpng-1.6.12/config.h
examples/pxScene2d/external/libpng-1.6.12/config.status
examples/pxScene2d/external/libpng-1.6.12/libtool/*
examples/pxScene2d/external/libpng-1.6.12/libtool
examples/pxScene2d/external/libpng-1.6.12/arm/*

examples/pxScene2d/external/libpng-1.6.28/Makefile
examples/pxScene2d/external/libpng-1.6.28/config.h
examples/pxScene2d/external/libpng-1.6.28/config.status
Expand All @@ -39,6 +43,7 @@ examples/pxScene2d/external/freetype-2.5.3/builds/unix/ftconfig.h

examples/pxScene2d/external/jpeg-9a/jconfig.h

examples/pxScene2d/external/sqlite-autoconf-3280000

examples/pxScene2d/external/curl-7.40.0/config.log
examples/pxScene2d/external/curl-7.40.0/config.status
Expand Down Expand Up @@ -91,6 +96,9 @@ examples/pxScene2d/external/curl-7.40.0/include/curl/curlbuild.h
examples/pxScene2d/external/zlib-1.2.11/Makefile
examples/pxScene2d/external/zlib-1.2.11/configure.log
examples/pxScene2d/src/jsbindings/build/*
examples/pxScene2d/src/Release/*
examples/pxScene2d/src/Debug/*


examples/pxScene2d/external/libnode-v6.9.0/cctest.vcxproj
examples/pxScene2d/external/libnode-v6.9.0/cctest.vcxproj.filters
Expand Down Expand Up @@ -168,8 +176,8 @@ Makefile
cmake_install.cmake

examples/pxScene2d/external/dukluv/Makefile
examples/pxScene2d/external/dukluv/dukluv
examples/pxScene2d/external/dukluv/build/dukluv
examples/pxScene2d/external/dukluv/build/*

examples/pxScene2d/external/libpng-1.6.28/libtool
examples/pxScene2d/external/libpng-1.6.28/timepng

Expand Down
4 changes: 2 additions & 2 deletions examples/pxBenchmark/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -fpermissive -g -Wall -Wno-attributes
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -fpermissive -g -Wall -Wno-attributes -Wall -Wextra")
set(PXSCENE_LINK_DIRECTORIES ${PXSCENE_LINK_DIRECTORIES} ${PXCORE_LIB_LOCATION})
set(PXSCENE_DEFINITIONS ${PXSCENE_DEFINITIONS} -DENABLE_NODE_V_6_9 -D_DARWIN_USE_64_BIT_INODE=1 -DNODE_ARCH="x64" -DNODE_WANT_INTERNALS=1 -DV8_DEPRECATION_WARNINGS= -DNODE_SHARED_MODE -DNODE_USE_V8_PLATFORM=1 -DNODE_HAVE_I18N_SUPPORT=1 -DNODE_HAVE_SMALL_ICU=1 -DHAVE_INSPECTOR=1 -DV8_INSPECTOR_USE_STL=1 -DV8_INSPECTOR_USE_OLD_STL=1 -DHAVE_OPENSSL=1 -DHAVE_DTRACE=1 -D__POSIX__ -DNODE_PLATFORM=darwin -DDUCONFIG_NO_TRANSLITERATION=1 -DUCONFIG_NO_SERVICE=1 -DUCONFIG_NO_REGULAR_EXPRESSIONS=1 -DU_ENABLE_DYLOAD=0 -DU_STATIC_IMPLEMENTATION=1 -DU_HAVE_STD_STRING=0 -DUCONFIG_NO_BREAK_ITERATION=0 -DUCONFIG_NO_LEGACY_CONVERSION=1 -DUCONFIG_NO_CONVERSION=1 -DHTTP_PARSER_STRICT=0 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64)
set(PLATFORM_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/../../pxScene2d/src/mac/pxContextUtils.mm)
set(PLATFORM_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/../../pxScene2d/src/mac/pxSharedContextNative.mm)
set(PXSCENE_LINKER_OPTIONS "-framework OpenGL -framework Cocoa -framework Foundation")
if (ENABLE_THREAD_SANITIZER)
set(PXSCENE_LINKER_OPTIONS "${PXSCENE_LINKER_OPTIONS} -fsanitize=thread")
Expand Down Expand Up @@ -246,7 +246,7 @@ ${NODEDIR}/src/udp_wrap.cc ${NODEDIR}/src/util.cc ${NODEDIR}/src/uv.cc)
endif (SUPPORT_NODE)
set(PLATFORM_SOURCES ${PLATFORM_SOURCES} ${PXCOREDIR}/src/utf8.c)
set_source_files_properties(utf8.c PROPERTIES LANGUAGE CXX)
set(PXSCENE_DEFINITIONS ${PXSCENE_DEFINITIONS} -DHAS_WINDOWS_BREAKPAD)
#set(PXSCENE_DEFINITIONS ${PXSCENE_DEFINITIONS} -DHAS_WINDOWS_BREAKPAD)
add_definitions(-DPX_PLATFORM_WIN -DRT_PLATFORM_WINDOWS -DWIN32 -DWIN32_LEAN_AND_MEAN -DGLEW_STATIC -D_TIMESPEC_DEFINED -D_CONSOLE
-DCURL_STATICLIB -DRUNINMAIN -DENABLE_RT_NODE -DDISABLE_WAYLAND -DNODE_WANT_INTERNALS=1
-DENABLE_NODE_V_6_9 -DENABLE_V8_HEAP_PARAMS=1 -DV8_DEPRECATION_WARNINGS=1 -DNODE_SHARED_MODE -DHAVE_INSPECTOR=1
Expand Down
32 changes: 18 additions & 14 deletions examples/pxScene2d/external/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -181,16 +181,7 @@ fi

#--------

#-------- GLIB

if [ ! -e $EXT_INSTALL_PATH/lib/libglib-2.0.la ]
then
banner "GLIB"

./glib/build.sh
fi

#--------

#--------- GIF

Expand Down Expand Up @@ -309,13 +300,13 @@ fi

#--------- CURL

if [ ! -e $EXT_INSTALL_PATH/lib/libcurl.la ]; then
if [ ! -e curl/lib/libcurl.la ]; then

banner "CURL"

cd curl

CPPFLAGS="-I${OPENSSL_DIR} -I${OPENSSL_DIR}/include" LDFLAGS="-L${OPENSSL_DIR}/lib -Wl,-rpath,${OPENSSL_DIR}/lib " LIBS="-ldl -lpthread" PKG_CONFIG_PATH=$EXT_INSTALL_PATH/lib/pkgconfig:$PKG_CONFIG_PATH ./configure --with-ssl="${OPENSSL_DIR}" --prefix=$EXT_INSTALL_PATH
CPPFLAGS="-I${OPENSSL_DIR} -I${OPENSSL_DIR}/include" LDFLAGS="-L${OPENSSL_DIR}/lib -Wl,-rpath,${OPENSSL_DIR}/lib " LIBS="-ldl -lpthread" PKG_CONFIG_PATH=$EXT_INSTALL_PATH/lib/pkgconfig:$PKG_CONFIG_PATH ./configure --without-nghttp2 --with-ssl="${OPENSSL_DIR}" --prefix=$EXT_INSTALL_PATH

if [ "$(uname)" = "Darwin" ]; then
#Removing api definition for Yosemite compatibility.
Expand Down Expand Up @@ -395,7 +386,8 @@ then
if [ -e "node-v${NODE_VER}_mods.patch" ]
then
git apply --ignore-space-change --whitespace=nowarn "node-v${NODE_VER}_mods.patch"
git apply --ignore-space-change --whitespace=nowarn "openssl_1.0.2_compatibility.patch"
git apply --ignore-space-change --whitespace=nowarn "openssl_1.0.2_compatibility.patch"
git apply --ignore-space-change --whitespace=nowarn "node-v${NODE_VER}_fixclang.patch"
fi

cd "libnode-v${NODE_VER}"
Expand Down Expand Up @@ -461,7 +453,7 @@ then
cp Makefile.build Makefile
fi

CPPFLAGS="${IDE_SEARCH_PATH} -I${OPENSSL_DIR} -I${OPENSSL_DIR}/include" LDFLAGS="-L${OPENSSL_DIR}/lib -Wl,-rpath,${OPENSSL_DIR}/lib " make
CPPFLAGS="${IDE_SEARCH_PATH} -I../libnode-v${NODE_VER}/deps/uv/include/ -I${OPENSSL_DIR} -I${OPENSSL_DIR}/include" LDFLAGS="-L${OPENSSL_DIR}/lib -Wl,-rpath,${OPENSSL_DIR}/lib " make

git ls-files -z . | xargs -0 git update-index --assume-unchanged # ... help GIT out

Expand Down Expand Up @@ -520,7 +512,8 @@ fi

#-------- SPARK-WEBGL

if [ ! -d "spark-webgl/build" ]; then
#TODO I don't think this is used anymore...
if false && [ ! -d "spark-webgl/build" ]; then

export NODE_PATH=$NODE_PATH:`pwd`/../src/node_modules
export PATH=`pwd`/node/deps/npm/bin/node-gyp-bin/:`pwd`/node/out/Release:$PATH
Expand Down Expand Up @@ -568,6 +561,17 @@ fi
if [[ $# -eq 1 ]] && [[ $1 == "SPARK_ENABLE_VIDEO" ]]
then

#-------- GLIB

if [ ! -e $EXT_INSTALL_PATH/lib/libglib-2.0.la ]
then
banner "GLIB"

./glib/build.sh
fi

#--------

#-------- cJSON

if [ ! -e $EXT_INSTALL_PATH/lib/libcjson.$LIBEXTN ]
Expand Down
22 changes: 7 additions & 15 deletions examples/pxScene2d/external/buildWindows.bat
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ cd ..

REM --------- GIF
cd giflib-5.1.9
patch -p1 < ../giflib-5.1.9-windows.diff
REM patch -p1 < ../giflib-5.1.9-windows.diff
git apply --ignore-space-change --ignore-whitespace --whitespace=nowarn ../giflib-5.1.9-windows.diff

cl /c /EHsc dgif_lib.c egif_lib.c getarg.c gif2rgb.c gif_err.c gif_font.c gif_hash.c gifalloc.c gifbg.c gifbuild.c gifclrmp.c gifcolor.c gifecho.c giffilter.c giffix.c gifhisto.c gifinto.c gifsponge.c giftext.c giftool.c gifwedge.c openbsd-reallocarray.c qprintf.c quantize.c

Expand All @@ -50,18 +51,7 @@ cd openssl-1.0.2o
cd ..

@rem freetype latest version needs to be updated here. Because the lib is named based on version, so to avoid a build failure and to build the external when there is a difference in version.
cat vc.build\config.props | grep "freetype-2.8.1"
if !errorlevel! == 0 (
if exist vc.build\builds\freetype281MT_D.lib (
echo "freetpye cache available"
) ELSE (
set buildExternal=1
echo "Exact cache is not present, Externals will be built"
)
) ELSE (
set buildExternal=1
echo "Exact library version is not present, Externals will be built"
)
set buildExternal=1


if [%APPVEYOR_REPO_COMMIT%] == [] (
Expand Down Expand Up @@ -100,7 +90,8 @@ cd ..\..\..\..\
REM --------- NANOSVG

cd nanosvg
patch -p1 < patches/add_ScaleXY.diff
REM patch -p1 < patches/add_ScaleXY.diff
git apply --ignore-space-change --ignore-whitespace --whitespace=nowarn patches/add_ScaleXY.diff
cd ..

REM --------- LIBNODE
Expand All @@ -118,7 +109,8 @@ cd ..
REM --------- DUKLUV

cd dukluv
patch -p1 < patches/dukluv.git.patch
REM patch -p1 < patches/dukluv.git.patch
git apply --ignore-space-change --ignore-whitespace --whitespace=nowarn patches/dukluv.git.patch
mkdir build
cd build
cmake ..
Expand Down
6 changes: 3 additions & 3 deletions examples/pxScene2d/external/clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ make clean -j3
cd ..

#--------- spark-webgl
cd spark-webgl
node-gyp clean
cd ..
#cd spark-webgl
#node-gyp clean
#cd ..


#--------- GIF
Expand Down
42 changes: 19 additions & 23 deletions examples/pxScene2d/external/giflib-5.1.9-windows.diff
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
diff --git giflib-5.1.9/gif_hash.h giflib-5.1.9/gif_hash.h
diff --git a/examples/pxScene2d/external/giflib-5.1.9/dgif_lib.c b/examples/pxScene2d/external/giflib-5.1.9/dgif_lib.c
index c6291e7c4..c0c4e9942 100644
--- a/examples/pxScene2d/external/giflib-5.1.9/dgif_lib.c
+++ b/examples/pxScene2d/external/giflib-5.1.9/dgif_lib.c
@@ -941,7 +941,7 @@ DGifDecompressLine(GifFileType *GifFile, GifPixelType *Line, int LineLen)
while (StackPtr != 0 && i < LineLen)
Line[i++] = Stack[--StackPtr];
}
- if (LastCode != NO_SUCH_CODE && Private->RunningCode - 2 < LZ_MAX_CODE && Prefix[Private->RunningCode - 2] == NO_SUCH_CODE) {
+ if (LastCode != NO_SUCH_CODE && Prefix[Private->RunningCode - 2] == NO_SUCH_CODE) {
Prefix[Private->RunningCode - 2] = LastCode;

if (CrntCode == Private->RunningCode - 2) {
diff --git a/examples/pxScene2d/external/giflib-5.1.9/gif_hash.h b/examples/pxScene2d/external/giflib-5.1.9/gif_hash.h
index ac20a43cb..a236bb56d 100644
--- giflib-5.1.9/gif_hash.h
+++ giflib-5.1.9/gif_hash.h
--- a/examples/pxScene2d/external/giflib-5.1.9/gif_hash.h
+++ b/examples/pxScene2d/external/giflib-5.1.9/gif_hash.h
@@ -7,7 +7,7 @@ gif_hash.h - magfic constants and declarations for GIF LZW
#ifndef _GIF_HASH_H_
#define _GIF_HASH_H_
Expand All @@ -11,10 +24,10 @@ index ac20a43cb..a236bb56d 100644
#include <stdint.h>

#define HT_SIZE 8192 /* 12bits = 4096 or twice as big! */
diff --git giflib-5.1.9/giftool.c giflib-5.1.9/giftool.c
diff --git a/examples/pxScene2d/external/giflib-5.1.9/giftool.c b/examples/pxScene2d/external/giflib-5.1.9/giftool.c
index 21b9c486b..afdce4567 100644
--- giflib-5.1.9/giftool.c
+++ giflib-5.1.9/giftool.c
--- a/examples/pxScene2d/external/giflib-5.1.9/giftool.c
+++ b/examples/pxScene2d/external/giflib-5.1.9/giftool.c
@@ -10,7 +10,7 @@ giftool.c - GIF transformation tool.
#include <fcntl.h>
#include <stdbool.h>
Expand All @@ -24,20 +37,3 @@ index 21b9c486b..afdce4567 100644
#include "getarg.h"
#include "gif_lib.h"



diff --git giflib-5.1.9/dgif_lib.c giflib-5.1.9/dgif_lib.c
index 21b9c486b..afdce4567 100644
--- giflib-5.1.9/dgif_lib.c
+++ giflib-5.1.9/dgif_lib.c

@@ -941,7 +941,7 @@ DGifDecompressLine(GifFileType *GifFile, GifPixelType *Line, int LineLen)
while (StackPtr != 0 && i < LineLen)
Line[i++] = Stack[--StackPtr];
}
- if (LastCode != NO_SUCH_CODE && Private->RunningCode - 2 < LZ_MAX_CODE && Prefix[Private->RunningCode - 2] == NO_SUCH_CODE) {
+ if (LastCode != NO_SUCH_CODE && Prefix[Private->RunningCode - 2] == NO_SUCH_CODE) {
Prefix[Private->RunningCode - 2] = LastCode;

if (CrntCode == Private->RunningCode - 2) {

22 changes: 22 additions & 0 deletions examples/pxScene2d/external/node-v10.15.3_fixclang.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
diff --git a/examples/pxScene2d/external/libnode-v10.15.3/deps/v8/src/torque/ast-generator.cc b/examples/pxScene2d/external/libnode-v10.15.3/deps/v8/src/torque/ast-generator.cc
index 617afd148..65e465dda 100755
--- a/examples/pxScene2d/external/libnode-v10.15.3/deps/v8/src/torque/ast-generator.cc
+++ b/examples/pxScene2d/external/libnode-v10.15.3/deps/v8/src/torque/ast-generator.cc
@@ -120,7 +120,7 @@ Statement* AstGenerator::GetOptionalHelperBody(

antlrcpp::Any AstGenerator::visitParameterList(
TorqueParser::ParameterListContext* context) {
- ParameterList result{{}, {}, context->VARARGS(), {}};
+ ParameterList result{{}, {}, context->VARARGS() != nullptr, {}};
if (context->VARARGS()) {
result.arguments_variable = context->IDENTIFIER()->getSymbol()->getText();
}
@@ -141,7 +141,7 @@ antlrcpp::Any AstGenerator::visitTypeList(

antlrcpp::Any AstGenerator::visitTypeListMaybeVarArgs(
TorqueParser::TypeListMaybeVarArgsContext* context) {
- ParameterList result{{}, {}, context->VARARGS(), {}};
+ ParameterList result{{}, {}, context->VARARGS() != nullptr, {}};
result.types.reserve(context->type().size());
for (auto* type : context->type()) {
result.types.push_back(GetType(type));
20 changes: 18 additions & 2 deletions examples/pxScene2d/external/node-v10.15.3_mods.patch
Original file line number Diff line number Diff line change
Expand Up @@ -1651,10 +1651,26 @@ index a6cc01f12..ceee5e7ef 100755
TCPWrap* wrap;
ASSIGN_OR_RETURN_UNWRAP(&wrap,
diff --git a/examples/pxScene2d/external/libnode-v10.15.3/deps/uv/src/win/handle.c b/examples/pxScene2d/external/libnode-v10.15.3/deps/uv/src/win/handle.c
index 9d76c3f..8e9a6df 100755
index 9d76c3f54..c31c2f4f6 100755
--- a/examples/pxScene2d/external/libnode-v10.15.3/deps/uv/src/win/handle.c
+++ b/examples/pxScene2d/external/libnode-v10.15.3/deps/uv/src/win/handle.c
@@ -148,6 +148,26 @@ void uv_close(uv_handle_t* handle, uv_close_cb cb) {
@@ -52,8 +52,13 @@ uv_handle_type uv_guess_handle(uv_file file) {
case FILE_TYPE_DISK:
return UV_FILE;

- default:
- return UV_UNKNOWN_HANDLE;
+ default: {
+ if (file == 0 || file == 1 || file == 2) { // JRJR Hack to prevent the node stdio from dying when using /subsystem:windows
+ return UV_FILE;
+ }
+ else
+ return UV_UNKNOWN_HANDLE;
+ }
}
}

@@ -148,6 +153,26 @@ void uv_close(uv_handle_t* handle, uv_close_cb cb) {
}
}

Expand Down
Loading