Skip to content

Commit

Permalink
Build: More fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kmatheussen committed Dec 24, 2024
1 parent 7c394c7 commit f802404
Show file tree
Hide file tree
Showing 9 changed files with 97 additions and 108 deletions.
6 changes: 3 additions & 3 deletions Makefile.Qt
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ libdir ?= $(PREFIX)/lib

# 2. Where moc and uic for QT5 is installed.
#
MOC ?= "`$(shell pwd)/find_moc_and_uic_paths.sh moc`"
UIC ?= "`$(shell pwd)/find_moc_and_uic_paths.sh uic`"
#RCC ?= "`./find_moc_and_uic_paths.sh rcc`"
MOC ?= moc
UIC ?= uic
#RCC ?= rcc

# 4. Release buid or Debug build
#
Expand Down
2 changes: 2 additions & 0 deletions bash_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ fi

RADIUM_BASH_SETUP_HAS_BEEN_SETUP=1

export PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'

#set -o verbose

set -u # error if using an unset variable
Expand Down
4 changes: 2 additions & 2 deletions bin/packages/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ build_qhttpserver() {
tar xvzf qhttpserver-master.tar.gz
cd qhttpserver-master/
echo "CONFIG += staticlib" >> src/src.pro
`../../../find_moc_and_uic_paths.sh qmake`
$QMAKE
make -j8 # necessary to create the moc files.
cd ..
}
Expand Down Expand Up @@ -277,7 +277,7 @@ build_qscintilla() {
tar xvzf QScintilla_src-2.14.0.tar.gz
cd QScintilla_src-2.14.0/src
echo "CONFIG += staticlib" >> qscintilla.pro
`../../../../find_moc_and_uic_paths.sh qmake`
$QMAKE
patch -p0 <../../qscintilla.patch
make -j8
cd ../..
Expand Down
8 changes: 2 additions & 6 deletions build_linux_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ export RADIUM_BIN="/tmp/radium_bin/radium_linux.bin"
mkdir -p /tmp/radium_bin
mkdir -p /tmp/radium_objects

# find_moc_and_uic_path.sh has been tested on fedora 11, fedora 17, ubuntu 12, and mint 13.
#export MOC="`./find_moc_and_uic_paths.sh moc`"
#export UIC="`./find_moc_and_uic_paths.sh uic`"

# Uncomment next line for debug build.
#export BUILDTYPE=RELEASE
Expand Down Expand Up @@ -134,10 +131,9 @@ export PYOPTS="-I $PYPATH"
#export QT_CFLAGS="-DQT_STATIC -DQT3_SUPPORT -I$RQTDIR/include/Qt3Support -I$RQTDIR/include/QtCore -I$RQTDIR/include/QtGui -I$RQTDIR/include/QtNetwork -I$RQTDIR/include/QtSql -I$RQTDIR/include/QtOpenGL -Ibin/packages/qhttpserver-master/src"
#export QT_LDFLAGS="$RQTDIR/lib/libQt3Support.a $RQTDIR/lib/libQtSql.a $RQTDIR/lib/libQtOpenGL.a $RQTDIR/lib/libQtGui.a $RQTDIR/lib/libQtNetwork.a $RQTDIR/lib/libQtCore.a -lSM -lICE -lfreetype -lfontconfig -lXrender -lpng -lglib-2.0 -lgobject-2.0"

QT_QMAKE_BIN_PATH=`./find_moc_and_uic_paths.sh qmake`
QT_INCLUDE_PATH=`$QT_QMAKE_BIN_PATH -query QT_INSTALL_HEADERS`
QT_INCLUDE_PATH=`$QMAKE -query QT_INSTALL_HEADERS`
export QT_UI_CFLAGS="-I $QT_INCLUDE_PATH/QtUiTools" # Doing this instead of using pkg since there are bugs in the dependencies of the pkg file in some versions of Qt. (same with the lib file below)
export QT_UI_LDFLAGS="`$QT_QMAKE_BIN_PATH -query QT_INSTALL_LIBS`/libQt5UiTools.a"
export QT_UI_LDFLAGS="`$QMAKE -query QT_INSTALL_LIBS`/libQt5UiTools.a"


#One of these:
Expand Down
32 changes: 16 additions & 16 deletions check_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -147,78 +147,78 @@ if [ `uname` == "Linux" ] ; then
rm temp$$.c
fi

if $(./find_moc_and_uic_paths.sh qmake) --version|grep "5\.0\." ; then
if $QMAKE --version|grep "5\.0\." ; then
echo "Qt is too old. Need at least 5.14"
exit 5
fi

if $(./find_moc_and_uic_paths.sh qmake) --version|grep "5\.1\." ; then
if $QMAKE --version|grep "5\.1\." ; then
echo "Qt is too old. Need at least 5.14"
exit 5
fi

if $(./find_moc_and_uic_paths.sh qmake) --version|grep "5\.2\." ; then
if $QMAKE --version|grep "5\.2\." ; then
echo "Qt is too old. Need at least 5.14"
exit 5
fi

if $(./find_moc_and_uic_paths.sh qmake) --version|grep "5\.3\." ; then
if $QMAKE --version|grep "5\.3\." ; then
echo "Qt is too old. Need at least 5.14"
exit 5
fi

if $(./find_moc_and_uic_paths.sh qmake) --version|grep "5\.4\." ; then
if $QMAKE --version|grep "5\.4\." ; then
echo "Qt is too old. Need at least 5.14"
exit 5
fi

if $(./find_moc_and_uic_paths.sh qmake) --version|grep "5\.5\." ; then
if $QMAKE --version|grep "5\.5\." ; then
echo "Qt is too old. Need at least 5.14"
exit 5
fi

if $(./find_moc_and_uic_paths.sh qmake) --version|grep "5\.6\." ; then
if $QMAKE --version|grep "5\.6\." ; then
echo "Qt is too old. Need at least 5.14"
exit 5
fi

if $(./find_moc_and_uic_paths.sh qmake) --version|grep "5\.7\." ; then
if $QMAKE --version|grep "5\.7\." ; then
echo "Qt is too old. Need at least 5.14"
exit 5
fi

if $(./find_moc_and_uic_paths.sh qmake) --version|grep "5\.8\." ; then
if $QMAKE --version|grep "5\.8\." ; then
echo "Qt is too old. Need at least 5.14"
exit 5
fi

if $(./find_moc_and_uic_paths.sh qmake) --version|grep "5\.9\." ; then
if $QMAKE --version|grep "5\.9\." ; then
echo "Qt is too old. Need at least 5.14"
exit 5
fi

if $(./find_moc_and_uic_paths.sh qmake) --version|grep "5\.10\." ; then
if $QMAKE --version|grep "5\.10\." ; then
echo "Qt is too old. Need at least 5.14"
exit 5
fi

if $(./find_moc_and_uic_paths.sh qmake) --version|grep "5\.11\." ; then
if $QMAKE --version|grep "5\.11\." ; then
echo "Qt is too old. Need at least 5.14"
exit 5
fi

if $(./find_moc_and_uic_paths.sh qmake) --version|grep "5\.12\." ; then
if $QMAKE --version|grep "5\.12\." ; then
echo "Qt is too old. Need at least 5.14"
exit 5
fi

if $(./find_moc_and_uic_paths.sh qmake) --version|grep "5\.13\." ; then
if $QMAKE --version|grep "5\.13\." ; then
echo "Qt is too old. Need at least 5.14"
exit 5
fi

if $(./find_moc_and_uic_paths.sh qmake) --version|grep "5\.5\." ; then
QT_QPA_PLATFORM_PLUGIN_PATH=`$(./find_moc_and_uic_paths.sh qmake) -query QT_INSTALL_PLUGINS`
if $QMAKE --version|grep "5\.5\." ; then
QT_QPA_PLATFORM_PLUGIN_PATH=`$QMAKE -query QT_INSTALL_PLUGINS`
if grep -r kf5deprecatedwidgets.so $QT_QPA_PLATFORM_PLUGIN_PATH ; then
echo
echo "The file $QT_QPA_PLATFORM_PLUGIN_PATH/*/kf5deprecatedwidgets.so in Qt 5.5 makes Radium (and other programs) misbehave. You should delete this file or use a different version of Qt."
Expand Down
76 changes: 54 additions & 22 deletions configuration.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
set -eEu


source bash_setup.sh


Expand Down Expand Up @@ -111,18 +112,13 @@ set_var FULL_VERSION 1


########################################################
# RADIUM_QTDIR is the directory where qt5 is installed.
# If set to 0, we will try to find it automatically.
# Note that if settings RADIUM_QTDIR you might also have
# to set either the PKGqt variable or the
# QT_PKG_CONFIGURATION_PATH as well, so that we don't
# mix Qt version. (The build system checks this for
# you, and will tell you if you need to set either
# of these variables.)
# qt5
#
set_var RADIUM_QTDIR 0 # This is the directory where we find bin/qmake, bin/uic, and bin/moc.
set_var PKGqt 0 # Can be set to another pkg-config than is not first in PATH.
set_var QT_PKG_CONFIGURATION_PATH 0 # PKG_CONFIG_PATH will be set to this value.
set_var QMAKE 0
set_var UIC 0
set_var MOC 0



Expand Down Expand Up @@ -152,48 +148,84 @@ set_var MACOSX_DEPLOYMENT_TARGET 12.0
#
########################################################

if [ -v RADIUM_CONFIGURATION_HAS_BEEN_SETUP ] ; then
echo "Something is wrong. configuration.sh should not include itself."
exit -1
fi

RADIUM_CONFIGURATION_HAS_BEEN_SETUP=1


# Note: Run-scripts have not been updated to use
# other pythons than the one included with Radium,
# so setting this value to something else might
# lead to unexpected behaviors.
#
set_var PYTHONEXE `./find_python_path.sh`
if ! env |grep PYTHONEXE_NOT_AVAILABLE_YET ; then
assert_env_path_exists $PYTHONEXE
assert_bin_exists $PYTHONEXE
fi

set_var PKG `which pkg-config`
assert_env_path_exists $PKG
assert_bin_exists $PKG

set_var RADIUM_RELEASE_CFLAGS ""

if ! is_0 $PKGqt ; then
assert_env_path_exists $PKGqt
else
if is_0 $PKGqt ; then
export PKGqt=$PKG
fi

assert_bin_exists $PKGqt

if ! is_0 $QT_PKG_CONFIGURATION_PATH ; then
assert_env_path_exists $QT_PKG_CONFIGURATION_PATH
assert_bin_exists $QT_PKG_CONFIGURATION_PATH
export PKGqt="PKG_CONFIG_PATH=$QT_PKG_CONFIGURATION_PATH $PKGqt"
fi

if is_0 $QMAKE ; then
if which qmake-qt5 ; then
export QMAKE=$(which qmake-qt5)
else
export QMAKE=$(which qmake)
fi
fi

QMAKE=$(./find_moc_and_uic_paths.sh qmake)
if is_0 $UIC ; then
if which uic-qt5 ; then
export UIC=$(which uic-qt5)
else
export UIC=$(which uic)
fi
fi

assert_env_path_exists $QMAKE
if is_0 $MOC ; then
if which moc-qt5 ; then
export MOC=$(which moc-qt5)
else
export MOC=$(which moc)
fi
fi

assert_env_path_exists $(./find_moc_and_uic_paths.sh uic)

assert_env_path_exists $(./find_moc_and_uic_paths.sh moc)
assert_bin_exists $QMAKE
assert_bin_exists $UIC
assert_bin_exists $MOC

if ${QMAKE} -query QT_VERSION | grep -v '^5.1' ; then
handle_failure "Seems like it's the wrong qt version. We need Qt newer than 5.10. Set RADIUM_QTDIR to correct directory to fix".
handle_failure "Seems like qmake has the wrong version. We need Qt newer than 5.10, but not Qt6. Set QMAKE to correct path to fix".
fi

if ${UIC} --version | grep -v '^uic 5.1' ; then
handle_failure "Seems like uic has the wrong version. We need Qt newer than 5.10, but not Qt6. Set UIC to correct path to fix".
fi

if ${MOC} --version | grep -v '^moc 5.1' ; then
handle_failure "Seems like moc has the wrong version. We need Qt newer than 5.10, but not Qt6. Set MOC to correct path to fix".
fi


if [ "$($PKGqt --libs-only-L Qt5Core)" != "" ] ; then
A=$($PKGqt --libs-only-L Qt5Core)
A=$($PKGqt --libs-only-L Qt5Core | xargs)
B="-L$($QMAKE -query QT_INSTALL_PREFIX)/lib"
if [ "$A" != "$B" ] ; then
handle_failure "$PKGqt and $QMAKE doesn't seem to point to the same Qt:\n" \
Expand All @@ -215,7 +247,7 @@ fi
if is_set FAUST_USES_LLVM ; then

set_var LLVM_CONFIG_BIN `which llvm-config`
assert_env_path_exists LLVM_CONFIG_BIN
assert_bin_exists $LLVM_CONFIG_BIN

old_path=""

Expand Down
66 changes: 15 additions & 51 deletions find_moc_and_uic_paths.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,59 +3,23 @@
set -ueE
#set -x

source $(dirname "${0}")/helpers.sh
source $(dirname "${0}")/configuration.sh

if ! is_set RADIUM_QTDIR ; then
source $(dirname $0)/configuration.sh
fi

if [ ! $RADIUM_QTDIR -eq 0 ] ; then
echo $RADIUM_QTDIR/bin/$1
exit 0
fi

#echo `which $1`

if which $1 >/dev/null 2>/dev/null ; then
if $1 -v 2>&1 | grep Qt\ $RADIUM_QT_VERSION >/dev/null ; then
echo `which $1`
case "$1" in
qmake)
echo $QMAKE
exit 0
elif $1 -v 2>&1 | grep version\ $RADIUM_QT_VERSION >/dev/null ; then
echo `which $1`
exit 0
elif $1 -v 2>&1 | grep qt$RADIUM_QT_VERSION >/dev/null ; then
echo `which $1`
;;

moc)
echo $MOC
exit 0
elif $1 -v 2>&1 | grep $1\ $RADIUM_QT_VERSION >/dev/null ; then
echo `which $1`
;;
uic)
echo $UIC
exit 0
fi
fi

if which $1-qt$RADIUM_QT_VERSION >/dev/null 2>/dev/null ; then
echo `which $1-qt$RADIUM_QT_VERSION`
exit 0
fi

if [ -f /etc/fedora-release ] ; then
if uname -a |grep x86_64 >/dev/null ; then
echo /usr/bin/$1-qt$RADIUM_QT_VERSION
else
echo /usr/bin/$1-qt$RADIUM_QT_VERSION
fi

elif grep -i ubuntu /etc/lsb-release >/dev/null 2>/dev/null ; then
echo $1-qt$RADIUM_QT_VERSION

elif grep -i debian /etc/lsb-release >/dev/null 2>/dev/null ; then
echo $1-qt$RADIUM_QT_VERSION

elif grep -i mint /etc/lsb-release >/dev/null 2>/dev/null ; then
echo $1-qt$RADIUM_QT_VERSION

elif grep -i arch /etc/lsb-release >/dev/null 2>/dev/null ; then
echo $1-qt$RADIUM_QT_VERSION
;;
esac

else
echo $1-qt$RADIUM_QT_VERSION
fi
echo "Argument must be qmake, moc, or uic. Found $1"
exit -1
9 changes: 2 additions & 7 deletions helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,11 @@


source $(dirname "${0}")/bash_setup.sh
#source $(dirname "${0}")/bash_setup.sh
#./bash_setup.sh

#echo "almost finished" |grep SFEFEF
#wefwef

#exit 0
assert_env_path_exists()
assert_bin_exists()
{
if [ ! -f "${1}" ] ; then
if [ ! -f $(which "${1}") ] ; then
handle_failure "\"${1}\" doesn't seem to exist."
fi
}
Expand Down
2 changes: 1 addition & 1 deletion run_gdb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ unset QT_QPA_PLATFORM
unset QT_PLUGIN_PATH

# Need this one though
export QT_QPA_PLATFORM_PLUGIN_PATH=`$(./find_moc_and_uic_paths.sh qmake) -query QT_INSTALL_PLUGINS`
export QT_QPA_PLATFORM_PLUGIN_PATH=`$QMAKE -query QT_INSTALL_PLUGINS`

# To avoid freezing X
export USE_SAFE_POPUP="1"
Expand Down

0 comments on commit f802404

Please sign in to comment.