diff --git a/build_linux.sh b/build_linux.sh new file mode 100644 index 0000000..2373da1 --- /dev/null +++ b/build_linux.sh @@ -0,0 +1,63 @@ +#!/bin/bash + +if [ $# -lt 1 ]; then + echo "Usage: $0 " + exit 1 +fi + +# Install dependencies +echo "Installing dependencies..." +sudo apt-get update && sudo apt-get install -y \ + libfontconfig1-dev libfreetype6-dev libx11-dev libx11-xcb-dev libxext-dev \ + libxfixes-dev libxi-dev libxrender-dev libxcb1-dev libxcb-cursor-dev libxcb-glx0-dev libxcb-keysyms1-dev \ + libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-shape0-dev \ + libxcb-randr0-dev libxcb-render-util0-dev libxcb-util-dev libxcb-xinerama0-dev libxcb-xkb-dev \ + libxkbcommon-dev libxkbcommon-x11-dev xorg-dev \ + libglu1-mesa-dev freeglut3-dev mesa-common-dev libglfw3-dev libgles2-mesa-dev \ + libpulse-dev + +# Clone the Qt repository +echo "Cloning the Qt repository..." +git clone https://github.com/qt/qt5.git qt6 -b $1 + +# Navigate to the Qt directory +cd qt6 + +# Initialize the Qt repository with the required modules +echo "Initializing the Qt repository with required modules..." +perl init-repository --module-subset=qtbase,qtdeclarative,qtimageformats,qtmultimedia,qtsvg,qtshadertools + +# Create and enter the build directory +echo "Creating and entering the build directory..." +mkdir -p build && cd build + +# Clone additional dependencies +echo "Cloning additional dependencies..." +git clone https://github.com/xpilot-project/dependencies.git + +# Set OPENSSL_LIBS environment variable +echo "Setting OPENSSL_LIBS environment variable..." + +OPENSSL_ROOT_DIR="$(pwd)/dependencies/platform/linux/openssl" +echo $OPENSSL_ROOT_DIR + +export OPENSSL_LIBS="$OPENSSL_ROOT_DIR/libssl.a $OPENSSL_ROOT_DIR/libcrypto.a" +echo $OPENSSL_LIBS + +# Configure Qt build +echo "Configuring Qt build..." +../configure -prefix ./install -debug-and-release -static -confirm-license \ + -feature-relocatable -qt-zlib -nomake examples -nomake tests -no-dbus -openssl-linked \ + -skip qt3d,qtactiveqt,qtandroidextras,qtcanvas3d,qtcharts,qtconnectivity \ + -skip qtdatavis3d,qtdoc,qtgamepad,qtgraphicaleffects,qtlocation,qtmacextras \ + -skip qtnetworkauth,qtpurchasing,qtremoteobjects,qtscript,qtscxml,qtsensors \ + -skip qtserialbus,qtspeech,qttools,qttranslations,qtvirtualkeyboard,qtwayland \ + -skip qtwebchannel,qtwebview,qtwinextras,qtx11extras,qtxmlpatterns,qtwebengine,qtimageformats \ + -- -DOPENSSL_ROOT_DIR="$OPENSSL_ROOT_DIR" + +# Build Qt +echo "Building Qt..." +cmake --build . && cmake --install . + +# Add files to 7z archive +cd install && 7z a linux * \ No newline at end of file diff --git a/build_macos.sh b/build_macos.sh new file mode 100644 index 0000000..f09e22d --- /dev/null +++ b/build_macos.sh @@ -0,0 +1,53 @@ +#!/bin/bash + +if [ $# -lt 1 ]; then + echo "Usage: $0 " + exit 1 +fi + +export PLATFORM="./dependencies/platform/macos" + +# Clone the Qt repository +echo "Cloning the Qt repository..." +git clone https://github.com/qt/qt5.git qt6 -b $1 + +# Navigate to the Qt directory +cd qt6 + +# Initialize the Qt repository with the required modules +echo "Initializing the Qt repository with required modules..." +perl init-repository --module-subset=qtbase,qtdeclarative,qtimageformats,qtmultimedia,qtsvg,qtshadertools + +# Create and enter the build directory +echo "Creating and entering the build directory..." +mkdir -p build && cd build + +# Clone additional dependencies +echo "Cloning additional dependencies..." +git clone https://github.com/xpilot-project/dependencies.git + +# Set OPENSSL_LIBS environment variable +echo "Setting OPENSSL_LIBS environment variable..." +export OPENSSL_LIBS="$PLATFORM/openssl/libssl.a $PLATFORM/openssl/libcrypto.a" +echo $OPENSSL_LIBS + +OPENSSL_ROOT_DIR="$(pwd)/dependencies/platform/macos/openssl" +echo $OPENSSL_ROOT_DIR + +# Configure Qt build +echo "Configuring Qt build..." +../configure -prefix ./install -debug-and-release -static -confirm-license \ + -feature-relocatable -qt-zlib -nomake examples -nomake tests -no-dbus -openssl-linked \ + -skip qt3d,qtactiveqt,qtandroidextras,qtcanvas3d,qtcharts,qtconnectivity \ + -skip qtdatavis3d,qtdoc,qtgamepad,qtgraphicaleffects,qtlocation,qtmacextras \ + -skip qtnetworkauth,qtpurchasing,qtremoteobjects,qtscript,qtscxml,qtsensors \ + -skip qtserialbus,qtspeech,qttools,qttranslations,qtvirtualkeyboard,qtwayland \ + -skip qtwebchannel,qtwebview,qtwinextras,qtx11extras,qtxmlpatterns,qtwebengine,qtimageformats \ + -- -DOPENSSL_ROOT_DIR="$OPENSSL_ROOT_DIR" + +# Build Qt +echo "Building Qt..." +cmake --build . && cmake --install . + +# Add files to 7z archive +cd install && 7z a macos * \ No newline at end of file diff --git a/build_windows.ps1 b/build_windows.ps1 new file mode 100644 index 0000000..67036eb --- /dev/null +++ b/build_windows.ps1 @@ -0,0 +1,65 @@ +if(-not $args[0]) { + Write-Host "Version parameter is required" + Exit 1 +} + +Push-Location + +Write-Output "Cloning the Qt repository" + +git clone https://github.com/qt/qt5.git qt6 -b $args[0] + +# Navigate to the Qt directory +Set-Location qt6 + +# Initialize the Qt repository with the required modules +Write-Output "Initializing the Qt repository with required modules..." +perl init-repository --module-subset=qtbase,qtdeclarative,qtimageformats,qtmultimedia,qtsvg,qtshadertools + +Write-Output "Creating and entering the build directory..." +New-Item -Path 'build' -ItemType Directory -Force +Set-Location -Path 'build' + +$platform = $pwd.Path + "\dependencies\platform\windows" + +Write-Output "Cloning additional dependencies" +git clone https://github.com/xpilot-project/dependencies.git + +Write-Output "Setting OPENSSL environment variable..." +$openssl_root_dir = "$platform\openssl" +$openssl_libs = "$platform\openssl\ssl.lib $platform\openssl\crypto.lib" + +# Setup VC tools +$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" +$vcvarspath = &$vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath +Write-Output "Found path to VC tools: $vcvarspath" + +cmd.exe /c "call `"$vcvarspath\VC\Auxiliary\Build\vcvars64.bat`" && set > %temp%\vcvars.txt" + +Get-Content "$env:temp\vcvars.txt" | Foreach-Object { + if ($_ -match "^(.*?)=(.*)$") { + Set-Content "env:\$($matches[1])" $matches[2] + } +} + +Write-Output "Configuring Qt build..." +& "..\configure.bat" -prefix "./install" -debug-and-release -static -static-runtime -confirm-license ` + -feature-relocatable -qt-zlib -nomake examples -nomake tests -no-dbus -openssl-linked ` + -skip qt3d,qtactiveqt,qtandroidextras,qtcanvas3d,qtcharts,qtconnectivity ` + -skip qtdatavis3d,qtdoc,qtgamepad,qtgraphicaleffects,qtlocation,qtmacextras ` + -skip qtnetworkauth,qtpurchasing,qtremoteobjects,qtscript,qtscxml,qtsensors ` + -skip qtserialbus,qtspeech,qttools,qttranslations,qtvirtualkeyboard,qtwayland ` + -skip qtwebchannel,qtwebview,qtwinextras,qtx11extras,qtxmlpatterns,qtwebengine,qtimageformats ` + -- -DOPENSSL_ROOT_DIR="$openssl_root_dir" + +Write-Output "Build Qt..." +cmake --build . --parallel + +Write-Output "Install Qt..." +cmake --install . + +Write-Output "Add files to 7z archive..." +Set-Location install +7z a windows * + +Pop-Location \ No newline at end of file