Skip to content

Commit

Permalink
MacPorts: qt4 patch for Big Sur
Browse files Browse the repository at this point in the history
see #606
  • Loading branch information
devernay committed Apr 23, 2021
1 parent bd97d24 commit 4007f81
Show file tree
Hide file tree
Showing 84 changed files with 8,835 additions and 0 deletions.
1,252 changes: 1,252 additions & 0 deletions tools/MacPorts/aqua/qt4-mac/Portfile

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions tools/MacPorts/aqua/qt4-mac/files/c++11.prf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_CXX11
QMAKE_OBJECTIVE_CXXFLAGS += $$QMAKE_OBJECTIVE_CXXFLAGS_CXX11
QMAKE_LFLAGS += $$QMAKE_LFLAGS_CXX11
21 changes: 21 additions & 0 deletions tools/MacPorts/aqua/qt4-mac/files/c++11/c++11.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh

CXX11_SUPPORT=no
COMPILER=$1
VERBOSE=$2
WORKDIR=$3

cd $3

if "$COMPILER" -std=c++11 -c c++11_test.cpp 2>/dev/null 1>&2; then
CXX11_SUPPORT=yes
fi
rm -f c++11_test.o

if [ "$CXX11_SUPPORT" != "yes" ]; then
[ "$VERBOSE" = "yes" ] && echo "C++11 support not detected"
exit 0
else
[ "$VERBOSE" = "yes" ] && echo "C++11 support detected"
exit 1
fi
12 changes: 12 additions & 0 deletions tools/MacPorts/aqua/qt4-mac/files/c++11/c++11_test.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// from Qt 5.0

#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__)
#else
# error "__cplusplus must be >= 201103L, or __GXX_EXPERIMENTAL_CXX0X__ must be defined"
#endif

constexpr int get_five() {return 5;}

int some_value[get_five() + 7];

int main(int, char **) { return 0; }
34 changes: 34 additions & 0 deletions tools/MacPorts/aqua/qt4-mac/files/cpath/cpath.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/sh

CPATH_SUPPORT=no
COMPILER=$1
VERBOSE=$2
WORKDIR=$3

done=no
cd $3
unset CPATH

# (1) do the test, without CPATH; should fail
if "$COMPILER" -nostdinc -c cpath_test.c 2>/dev/null 1>&2; then
echo "Compile seems to work even with CPATH not set; assuming CPATH does not work"
done=0
else
# (2) do the test, with CPATH set; should pass
export CPATH=.
if "$COMPILER" -nostdinc -c cpath_test.c 2>/dev/null 1>&2; then
CPATH_SUPPORT=yes
fi
fi
rm -f cpath_test.o

# if done above, assume it works and exit
[ "$done" != "no" ] && exit $done

if [ "$CPATH_SUPPORT" != "yes" ]; then
[ "$VERBOSE" = "yes" ] && echo "CPATH support not detected"
exit 0
else
[ "$VERBOSE" = "yes" ] && echo "CPATH support detected"
exit 1
fi
8 changes: 8 additions & 0 deletions tools/MacPorts/aqua/qt4-mac/files/cpath/cpath_test.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include <cpath_test.h>

int test_cpath = 1;

int main (void) {
(void) test_cpath;
return (0);
}
1 change: 1 addition & 0 deletions tools/MacPorts/aqua/qt4-mac/files/cpath/cpath_test.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
extern int test_cpath;
26 changes: 26 additions & 0 deletions tools/MacPorts/aqua/qt4-mac/files/fconstant_cfstrings.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/sh

FCONSTANT_CFSTRINGS_SUPPORT=no
COMPILER=$1
VERBOSE=$2
WORKDIR=$3

cd $3
touch fconstant_cfstrings.c

if "$COMPILER" -fconstant-cfstrings -c fconstant_cfstrings.c 2>/dev/null 1>&2; then
if "$COMPILER" -fconstant-cfstrings -c fconstant_cfstrings.c 2>&1 | grep "unrecognized" >/dev/null ; then
true
else
FCONSTANT_CFSTRINGS_SUPPORT=yes
fi
fi
rm -f fconstant_cfstrings.c fconstant_cfstrings.o

if [ "$FCONSTANT_CFSTRINGS_SUPPORT" != "yes" ]; then
[ "$VERBOSE" = "yes" ] && echo "compiler flag -fconstant-cfstrings support not detected"
exit 0
else
[ "$VERBOSE" = "yes" ] && echo "compiler flag -fconstant-cfstrings support detected"
exit 1
fi
41 changes: 41 additions & 0 deletions tools/MacPorts/aqua/qt4-mac/files/library_path/library_path.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/sh

LIBRARY_PATH_SUPPORT=no
COMPILER=$1
VERBOSE=$2
WORKDIR=$3

done=no
cd $3
unset LIBRARY_PATH

# (1) make the library
if "$COMPILER" -dynamiclib -o library_path_lib.dylib library_path_lib.c 2>/dev/null 1>&2; then
# (2) do the test, without LIBRARY_PATH; should fail
if "$COMPILER" -nostdinc -I. -o library_path_test library_path_test.c -lrary_path_lib 2>/dev/null 1>&2; then
echo "Compile seems to work even with LIBRARY_PATH not set; assuming LIBRARY_PATH does not work"
done=0
else
# (3) do the test, with LIBRARY_PATH set; should pass
export LIBRARY_PATH=.
if "$COMPILER" -nostdinc -I. -o library_path_test library_path_test.c -lrary_path_lib 2>/dev/null 1>&2; then
LIBRARY_PATH_SUPPORT=yes
fi
fi
rm -f library_path_test.o library_path_test
else
echo "Unable to compile library; please fix this issue"
done=0
fi
rm -f library_path_lib.dylib library_path_lib.o

# if done above, assume it works and exit
[ "$done" != "no" ] && exit $done

if [ "$LIBRARY_PATH_SUPPORT" != "yes" ]; then
[ "$VERBOSE" = "yes" ] && echo "LIBRARY_PATH support not detected"
exit 0
else
[ "$VERBOSE" = "yes" ] && echo "LIBRARY_PATH support detected"
exit 1
fi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
int test_cpath;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
extern int test_cpath;
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include <library_path_lib.h>

int main (void) {
test_cpath = 1;
return (0);
}
21 changes: 21 additions & 0 deletions tools/MacPorts/aqua/qt4-mac/files/objc_block/objc_block.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh

OBJC_BLOCK_SUPPORT=no
COMPILER=$1
VERBOSE=$2
WORKDIR=$3

cd $3

if "$COMPILER" -c objc_block_test.m 2>/dev/null 1>&2; then
OBJC_BLOCK_SUPPORT=yes
fi
rm -f objc_block_test.o

if [ "$OBJC_BLOCK_SUPPORT" != "yes" ]; then
[ "$VERBOSE" = "yes" ] && echo "Objective-C block (^) support not detected"
exit 0
else
[ "$VERBOSE" = "yes" ] && echo "Objective-C block (^) support detected"
exit 1
fi
10 changes: 10 additions & 0 deletions tools/MacPorts/aqua/qt4-mac/files/objc_block/objc_block_test.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
double (^multiplyTwoValues)(double, double) =
^(double firstValue, double secondValue) {
return firstValue * secondValue;
};

int main () {
double result = multiplyTwoValues(2,4);
(void) result;
return (0);
}
18 changes: 18 additions & 0 deletions tools/MacPorts/aqua/qt4-mac/files/objective_cxx.prf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Add compiler directives for Objective C++ (.mm) only
#
# OBJECTIVE_CXX_SOURCES has already been set in "split_sources"

isEmpty(QMAKE_OBJECTIVE_CXX):QMAKE_OBJECTIVE_CXX = $$QMAKE_CXX

OBJECTIVE_CXX_OBJECTS_DIR = $$OBJECTS_DIR
isEmpty(OBJECTIVE_CXX_OBJECTS_DIR):OBJECTIVE_CXX_OBJECTS_DIR = .
isEmpty(QMAKE_EXT_OBJECTIVE_CXX):QMAKE_EXT_OBJECTIVE_CXX = .mm

objective_cxx.dependency_type = TYPE_C
objective_cxx.variables = QMAKE_OBJECTIVE_CXXFLAGS
objective_cxx.commands = $$QMAKE_OBJECTIVE_CXX -c $(QMAKE_COMP_QMAKE_OBJECTIVE_CXXFLAGS) $(DEFINES) $(INCPATH) -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_IN}
objective_cxx.output = $$OBJECTIVE_CXX_OBJECTS_DIR/${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
objective_cxx.input = OBJECTIVE_CXX_SOURCES
objective_cxx.name = Compile ${QMAKE_FILE_IN}
silent:objective_cxx.commands = @echo objective-cxx ${QMAKE_FILE_IN} && $$objective_cxx.commands
QMAKE_EXTRA_COMPILERS += objective_cxx
145 changes: 145 additions & 0 deletions tools/MacPorts/aqua/qt4-mac/files/patch-QtHelp_10.4_only.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
--- tools/assistant/tools/assistant/assistant.pro.orig
+++ tools/assistant/tools/assistant/assistant.pro
@@ -120,3 +120,30 @@
DEFINES += USE_STATIC_SQLITE_PLUGIN
}
}
+
+qclucene = QtCLucene$${QT_LIBINFIX}
+if(!debug_and_release|build_pass):CONFIG(debug, debug|release) {
+ mac:qclucene = $${qclucene}_debug
+ win32:qclucene = $${qclucene}d
+}
+linux-lsb-g++:LIBS_PRIVATE += --lsb-shared-libs=$$qclucene
+LIBS_PRIVATE += -l$$qclucene
+
+qcnetwork = QtNetwork$${QT_LIBINFIX}
+if(!debug_and_release|build_pass):CONFIG(debug, debug|release) {
+ mac:qcnetwork = $${qcnetwork}_debug
+ win32:qcnetwork = $${qcnetwork}d
+}
+linux-lsb-g++:LIBS_PRIVATE += --lsb-shared-libs=$$qcnetwork
+LIBS_PRIVATE += -l$$qcnetwork
+
+qcwebkit = QtWebKit$${QT_LIBINFIX}
+if(!debug_and_release|build_pass):CONFIG(debug, debug|release) {
+ mac:qcwebkit = $${qcwebkit}_debug
+ win32:qcwebkit = $${qcwebkit}d
+}
+linux-lsb-g++:LIBS_PRIVATE += --lsb-shared-libs=$$qcwebkit
+LIBS_PRIVATE += -l$$qcwebkit
+
+
+
--- tools/assistant/tools/qcollectiongenerator/qcollectiongenerator.pro.orig
+++ tools/assistant/tools/qcollectiongenerator/qcollectiongenerator.pro
@@ -19,3 +19,27 @@
../shared/collectionconfiguration.cpp
HEADERS += ../shared/helpgenerator.h \
../shared/collectionconfiguration.h
+
+qclucene = QtCLucene$${QT_LIBINFIX}
+if(!debug_and_release|build_pass):CONFIG(debug, debug|release) {
+ mac:qclucene = $${qclucene}_debug
+ win32:qclucene = $${qclucene}d
+}
+linux-lsb-g++:LIBS_PRIVATE += --lsb-shared-libs=$$qclucene
+LIBS_PRIVATE += -l$$qclucene
+
+qcnetwork = QtNetwork$${QT_LIBINFIX}
+if(!debug_and_release|build_pass):CONFIG(debug, debug|release) {
+ mac:qcnetwork = $${qcnetwork}_debug
+ win32:qcnetwork = $${qcnetwork}d
+}
+linux-lsb-g++:LIBS_PRIVATE += --lsb-shared-libs=$$qcnetwork
+LIBS_PRIVATE += -l$$qcnetwork
+
+qcwebkit = QtWebKit$${QT_LIBINFIX}
+if(!debug_and_release|build_pass):CONFIG(debug, debug|release) {
+ mac:qcwebkit = $${qcwebkit}_debug
+ win32:qcwebkit = $${qcwebkit}d
+}
+linux-lsb-g++:LIBS_PRIVATE += --lsb-shared-libs=$$qcwebkit
+LIBS_PRIVATE += -l$$qcwebkit
--- tools/assistant/tools/qhelpconverter/qhelpconverter.pro.orig
+++ tools/assistant/tools/qhelpconverter/qhelpconverter.pro
@@ -49,3 +49,27 @@
outputpage.ui

RESOURCES += qhelpconverter.qrc
+
+qclucene = QtCLucene$${QT_LIBINFIX}
+if(!debug_and_release|build_pass):CONFIG(debug, debug|release) {
+ mac:qclucene = $${qclucene}_debug
+ win32:qclucene = $${qclucene}d
+}
+linux-lsb-g++:LIBS_PRIVATE += --lsb-shared-libs=$$qclucene
+LIBS_PRIVATE += -l$$qclucene
+
+qcnetwork = QtNetwork$${QT_LIBINFIX}
+if(!debug_and_release|build_pass):CONFIG(debug, debug|release) {
+ mac:qcnetwork = $${qcnetwork}_debug
+ win32:qcnetwork = $${qcnetwork}d
+}
+linux-lsb-g++:LIBS_PRIVATE += --lsb-shared-libs=$$qcnetwork
+LIBS_PRIVATE += -l$$qcnetwork
+
+qcwebkit = QtWebKit$${QT_LIBINFIX}
+if(!debug_and_release|build_pass):CONFIG(debug, debug|release) {
+ mac:qcwebkit = $${qcwebkit}_debug
+ win32:qcwebkit = $${qcwebkit}d
+}
+linux-lsb-g++:LIBS_PRIVATE += --lsb-shared-libs=$$qcwebkit
+LIBS_PRIVATE += -l$$qcwebkit
--- tools/assistant/tools/qhelpgenerator/qhelpgenerator.pro.orig
+++ tools/assistant/tools/qhelpgenerator/qhelpgenerator.pro
@@ -17,3 +17,27 @@
main.cpp

HEADERS += ../shared/helpgenerator.h
+
+qclucene = QtCLucene$${QT_LIBINFIX}
+if(!debug_and_release|build_pass):CONFIG(debug, debug|release) {
+ mac:qclucene = $${qclucene}_debug
+ win32:qclucene = $${qclucene}d
+}
+linux-lsb-g++:LIBS_PRIVATE += --lsb-shared-libs=$$qclucene
+LIBS_PRIVATE += -l$$qclucene
+
+qcnetwork = QtNetwork$${QT_LIBINFIX}
+if(!debug_and_release|build_pass):CONFIG(debug, debug|release) {
+ mac:qcnetwork = $${qcnetwork}_debug
+ win32:qcnetwork = $${qcnetwork}d
+}
+linux-lsb-g++:LIBS_PRIVATE += --lsb-shared-libs=$$qcnetwork
+LIBS_PRIVATE += -l$$qcnetwork
+
+qcwebkit = QtWebKit$${QT_LIBINFIX}
+if(!debug_and_release|build_pass):CONFIG(debug, debug|release) {
+ mac:qcwebkit = $${qcwebkit}_debug
+ win32:qcwebkit = $${qcwebkit}d
+}
+linux-lsb-g++:LIBS_PRIVATE += --lsb-shared-libs=$$qcwebkit
+LIBS_PRIVATE += -l$$qcwebkit
--- tools/designer/src/plugins/qwebview/qwebview.pro.orig
+++ tools/designer/src/plugins/qwebview/qwebview.pro
@@ -13,3 +13,19 @@
SOURCES += qwebview_plugin.cpp
HEADERS += qwebview_plugin.h
RESOURCES += qwebview_plugin.qrc
+
+qcnetwork = QtNetwork$${QT_LIBINFIX}
+if(!debug_and_release|build_pass):CONFIG(debug, debug|release) {
+ mac:qcnetwork = $${qcnetwork}_debug
+ win32:qcnetwork = $${qcnetwork}d
+}
+linux-lsb-g++:LIBS_PRIVATE += --lsb-shared-libs=$$qcnetwork
+LIBS_PRIVATE += -l$$qcnetwork
+
+qcwebkit = QtWebKit$${QT_LIBINFIX}
+if(!debug_and_release|build_pass):CONFIG(debug, debug|release) {
+ mac:qcwebkit = $${qcwebkit}_debug
+ win32:qcwebkit = $${qcwebkit}d
+}
+linux-lsb-g++:LIBS_PRIVATE += --lsb-shared-libs=$$qcwebkit
+LIBS_PRIVATE += -l$$qcwebkit

0 comments on commit 4007f81

Please sign in to comment.