VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Build
diff options
context:
space:
mode:
Diffstat (limited to 'src/Build')
-rw-r--r--src/Build/CMakeLists.txt39
-rw-r--r--src/Build/Resources/MacOSX/Info.plist.legacy.xml2
-rw-r--r--src/Build/Resources/MacOSX/Info.plist.xml4
-rwxr-xr-xsrc/Build/Tools/MacOSX/yasmbin892672 -> 1696040 bytes
-rwxr-xr-xsrc/Build/build_cmake_deb.sh130
-rw-r--r--src/Build/build_cmake_opensuse.sh65
-rw-r--r--src/Build/build_cmake_rpm.sh (renamed from src/Build/build_cmake_rpm_gtk2.sh)61
-rw-r--r--src/Build/build_cmake_rpm_gtk3.sh75
-rwxr-xr-xsrc/Build/build_veracrypt_freebsd.sh54
-rwxr-xr-xsrc/Build/build_veracrypt_linux.sh53
-rw-r--r--src/Build/build_veracrypt_linux_gtk3.sh47
-rwxr-xr-xsrc/Build/build_veracrypt_linux_no_sse2.sh53
-rwxr-xr-xsrc/Build/build_veracrypt_macosx.sh147
-rw-r--r--src/Build/sign_rpm.sh54
14 files changed, 495 insertions, 289 deletions
diff --git a/src/Build/CMakeLists.txt b/src/Build/CMakeLists.txt
index eb4f8a6d..ce3d372b 100644
--- a/src/Build/CMakeLists.txt
+++ b/src/Build/CMakeLists.txt
@@ -1,45 +1,45 @@
# - Minimum CMake version
cmake_minimum_required(VERSION 2.8.0)
# - Obligatory parameters
# -DVERACRYPT_BUILD_DIR : folder that contains 'usr' folder
# -DNOGUI : TRUE if building 'Console' version, 'FALSE' if building 'GUI' version
if ( NOT DEFINED VERACRYPT_BUILD_DIR )
MESSAGE(FATAL_ERROR "VERACRYPT_BUILD_DIR variable MUST BE set to the path of the folder which contains 'usr' folder")
elseif ( NOT DEFINED NOGUI )
MESSAGE(FATAL_ERROR "NOGUI variable MUST BE set to TRUE if building 'Console' version, 'FALSE' otherwise")
endif()
# - Set version of the package
-set( FULL_VERSION "1.26.4" )
-set( VERSION "1.26.4" )
+set( FULL_VERSION "1.26.15" )
+set( VERSION "1.26.15" )
set( RELEASE "1" )
# - Set PROJECT_NAME and CONFLICT_PACKAGE values
if (NOGUI)
set( PROJECT_NAME "veracrypt-console" )
set( CONFLICT_PACKAGE "veracrypt" )
else()
set( PROJECT_NAME "veracrypt" )
set( CONFLICT_PACKAGE "veracrypt-console" )
endif()
project(${PROJECT_NAME})
# - Check whether 'Tcdefs.h' and 'License.txt' exist
if(NOT EXISTS "$ENV{SOURCEPATH}/Common/Tcdefs.h")
MESSAGE(FATAL_ERROR "Tcdefs.h does not exist.")
elseif(NOT EXISTS "$ENV{SOURCEPATH}/License.txt")
MESSAGE(FATAL_ERROR "License.txt does not exist.")
endif()
# - Detect build system bitness
# The following variable will be set
# $SUFFIX 32 64
# $CMAKE_SYSTEM_NAME Windows Linux Darwin
# N.B :
# To build for 32-bit under 64-bit, set 'CMAKE_SIZEOF_VOID_P' to '4'
if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
# Build System is under 64-bit arch
set (SUFFIX "64")
MESSAGE(STATUS "Build System = ${CMAKE_SYSTEM_NAME} - Bitness : 64-bit - Compiler : ${CMAKE_CXX_COMPILER_ID}")
@@ -220,122 +220,131 @@ set( CONTACT "VeraCrypt Team <veracrypt@idrix.fr>" )
set( CPACK_PACKAGE_DESCRIPTION_SUMMARY "Disk encryption with strong security based on TrueCrypt." )
set( CPACK_PACKAGE_DESCRIPTION "This package contains binaries for VeraCrypt, a disk encryption with strong security based on TrueCrypt." )
set( CPACK_PACKAGE_NAME ${PROJECT_NAME} )
set( CPACK_PACKAGE_VERSION ${VERSION} )
set( CPACK_PACKAGE_RELEASE ${RELEASE} )
set( CPACK_PACKAGE_VENDOR ${VENDOR} )
set( CPACK_PACKAGE_LICENSE ${LICENSE} )
set( CPACK_RESOURCE_FILE_LICENSE "$ENV{SOURCEPATH}/License.txt")
set( CPACK_PACKAGE_CONTACT ${CONTACT} )
set( CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}-${FULL_VERSION}-${DISTRO_NAME}-${ARCHITECTURE} )
set( CPACK_PACKAGE_CHECKSUM SHA256 )
set( CPACK_PACKAGE_RELOCATABLE "OFF") # Disable package relocation (especially for rpm)
set( CPACK_PACKAGE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Packaging )
if ( ( PLATFORM STREQUAL "Debian" ) OR ( PLATFORM STREQUAL "Ubuntu" ) )
# Debian control script(s)
file( MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Packaging/debian-control)
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/Packaging/debian-control/prerm ${CMAKE_CURRENT_BINARY_DIR}/Packaging/debian-control/prerm)
set( DEBIAN_PRERM ${CMAKE_CURRENT_BINARY_DIR}/Packaging/debian-control/prerm)
set( CPACK_GENERATOR "DEB" ) # mandatory
set( CPACK_DEBIAN_PACKAGE_NAME ${CPACK_PACKAGE_NAME} ) # mandatory
set( CPACK_DEBIAN_FILE_NAME ${CPACK_PACKAGE_FILE_NAME}.deb ) # mandatory
set( CPACK_DEBIAN_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION} ) # mandatory
set( CPACK_DEBIAN_PACKAGE_RELEASE ${CPACK_PACKAGE_RELEASE} )
set( CPACK_DEBIAN_PACKAGE_ARCHITECTURE ${ARCHITECTURE} ) # mandatory
if (NOGUI)
# Link against statically built wxWidgets so that we don't depend on any GTK library
- set( CPACK_DEBIAN_PACKAGE_DEPENDS "libfuse2, dmsetup, sudo, libpcsclite1, pcscd" )
+ # In case of Ubuntu 24.04/ Debian 13 or newer, libfuse2 package was renamed libfuse2t64
+ if ( ( ( PLATFORM STREQUAL "Debian" ) AND ( PLATFORM_VERSION VERSION_GREATER_EQUAL "13" ) )
+ OR ( ( PLATFORM STREQUAL "Ubuntu" ) AND ( PLATFORM_VERSION VERSION_GREATER_EQUAL "24.04" ) ) )
+ set( CPACK_DEBIAN_PACKAGE_DEPENDS "libfuse2t64, dmsetup, sudo, libpcsclite1, pcscd" )
+ else ()
+ set( CPACK_DEBIAN_PACKAGE_DEPENDS "libfuse2, dmsetup, sudo, libpcsclite1, pcscd" )
+ endif()
else ()
# Link against gtk3 version of wxWidgets if >= Debian 10 or >= Ubuntu 18.04
# Otherwise, link against gtk2 version of wxWidgets
- if ( ( ( PLATFORM STREQUAL "Debian" ) AND ( PLATFORM_VERSION VERSION_GREATER_EQUAL "12" ) )
+ # In case of Ubuntu 24.04, we depend on libfuse2t64 instead of libfuse2 and we link statically against wxWidgets
+ # because there is a bug in wxWidgets that ships with Ubuntu 24.04 and which was fixed in wxWidgets 3.2.5
+ if ( ( ( PLATFORM STREQUAL "Debian" ) AND ( PLATFORM_VERSION VERSION_GREATER_EQUAL "13" ) )
+ OR ( ( PLATFORM STREQUAL "Ubuntu" ) AND ( PLATFORM_VERSION VERSION_GREATER_EQUAL "24.04" ) ) )
+
+ set( CPACK_DEBIAN_PACKAGE_DEPENDS "libgtk-3-0t64, libayatana-appindicator3-1, libfuse2t64, dmsetup, sudo, libpcsclite1, pcscd" )
+
+ elseif ( ( ( PLATFORM STREQUAL "Debian" ) AND ( PLATFORM_VERSION VERSION_GREATER_EQUAL "12" ) )
OR ( ( PLATFORM STREQUAL "Ubuntu" ) AND ( PLATFORM_VERSION VERSION_GREATER_EQUAL "23.04" ) ) )
set( CPACK_DEBIAN_PACKAGE_DEPENDS "libwxgtk3.2-1, libayatana-appindicator3-1, libfuse2, dmsetup, sudo, libpcsclite1, pcscd" )
elseif ( ( ( PLATFORM STREQUAL "Debian" ) AND ( PLATFORM_VERSION VERSION_GREATER_EQUAL "10" ) )
OR ( ( PLATFORM STREQUAL "Ubuntu" ) AND ( PLATFORM_VERSION VERSION_GREATER_EQUAL "18.04" ) ) )
set( CPACK_DEBIAN_PACKAGE_DEPENDS "libwxgtk3.0-gtk3-0v5, libayatana-appindicator3-1, libfuse2, dmsetup, sudo, libpcsclite1, pcscd" )
else ()
# Link against statically built wxWidgets on Ubuntu 14.04 and older, and Debian 8 and older
if ( ( ( PLATFORM STREQUAL "Debian" ) AND ( PLATFORM_VERSION VERSION_LESS_EQUAL "8" ) )
OR ( ( PLATFORM STREQUAL "Ubuntu" ) AND ( PLATFORM_VERSION VERSION_LESS_EQUAL "14.04" ) ) )
set( CPACK_DEBIAN_PACKAGE_DEPENDS "libgtk2.0-0, libfuse2, dmsetup, sudo, libpcsclite1, pcscd" )
else ()
set( CPACK_DEBIAN_PACKAGE_DEPENDS "libwxgtk3.0-0v5, libfuse2, dmsetup, sudo, libpcsclite1, pcscd" )
endif ()
endif()
endif()
set( CPACK_DEBIAN_PACKAGE_MAINTAINER ${CONTACT} ) # mandatory
set( CPACK_DEBIAN_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION_SUMMARY} ) # mandatory
set( CPACK_DEBIAN_ARCHIVE_TYPE "gnutar") # mandatory
set( CPACK_DEBIAN_COMPRESSION_TYPE "gzip") # mandatory
set( CPACK_DEBIAN_PACKAGE_PRIORITY "optional" ) # mandatory
set( CPACK_DEBIAN_PACKAGE_SECTION "libs" ) # recommended, Section relative to Debian sections (https://www.debian.org/doc/debian-policy/ch-archive.html#s-subsections)
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA ${DEBIAN_PREINST};${DEBIAN_POSTINST};${DEBIAN_PRERM};${DEBIAN_POSTRM})
set(CPACK_DEBIAN_PACKAGE_CONFLICTS "${CONFLICT_PACKAGE}")
elseif ( ( PLATFORM STREQUAL "CentOS" ) OR ( PLATFORM STREQUAL "openSUSE" ) )
# RPM control script(s)
file( MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Packaging/rpm-control)
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/Packaging/rpm-control/prerm.sh ${CMAKE_CURRENT_BINARY_DIR}/Packaging/rpm-control/prerm.sh)
set( RPM_PRERM ${CMAKE_CURRENT_BINARY_DIR}/Packaging/rpm-control/prerm.sh)
set( CPACK_GENERATOR "RPM" ) # mandatory
set( CPACK_RPM_PACKAGE_SUMMARY ${CPACK_PACKAGE_SUMMARY} ) # mandatory
set( CPACK_RPM_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION} ) # mandatory
set( CPACK_RPM_PACKAGE_NAME ${CPACK_PACKAGE_NAME} ) # mandatory
set( CPACK_RPM_FILE_NAME ${CPACK_PACKAGE_FILE_NAME}.rpm ) # mandatory
set( CPACK_RPM_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION} ) # mandatory
set( CPACK_RPM_PACKAGE_ARCHITECTURE ${ARCHITECTURE} ) # mandatory
set( CPACK_RPM_PACKAGE_RELEASE ${CPACK_PACKAGE_RELEASE} ) # mandatory
set( CPACK_RPM_PACKAGE_LICENSE ${CPACK_PACKAGE_LICENSE} ) # mandatory
set( CPACK_RPM_PACKAGE_GROUP "Applications/System" ) # mandatory, https://fedoraproject.org/wiki/RPMGroups
set( CPACK_RPM_PACKAGE_VENDOR ${CPACK_PACKAGE_VENDOR} ) # mandatory
set( CPACK_RPM_PACKAGE_AUTOREQ "no" ) # disable automatic shared libraries dependency detection (most of the time buggy)
if (NOGUI)
set( CPACK_RPM_PACKAGE_REQUIRES "fuse, device-mapper, sudo" )
else ()
- if ( PLATFORM STREQUAL "CentOS" )
-
- if ( DEFINED WITHGTK3 AND WITHGTK3 )
- set( CPACK_RPM_PACKAGE_REQUIRES "fuse, device-mapper, gtk3, sudo, pcsc-lite" )
- else ()
- set( CPACK_RPM_PACKAGE_REQUIRES "fuse, device-mapper, gtk2, sudo, pcsc-lite" )
- endif()
-
- elseif ( PLATFORM STREQUAL "openSUSE" )
-
- set( CPACK_RPM_PACKAGE_REQUIRES "fuse, device-mapper, gtk2, sudo, pcsc-lite" )
+ find_package(PkgConfig REQUIRED)
+ pkg_check_modules(GTK3 gtk+-3.0)
+
+ if(GTK3_FOUND)
+ set( CPACK_RPM_PACKAGE_REQUIRES "fuse, device-mapper, gtk3, sudo, pcsc-lite" )
+ else()
+ set( CPACK_RPM_PACKAGE_REQUIRES "fuse, device-mapper, gtk2, sudo, pcsc-lite" )
endif()
endif()
set( CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE ${RPM_PRERM}) # optional
# Prevents CPack from generating file conflicts
# This is to avoid having %dir of these directories in the .spec file
set( CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr" )
list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/bin" )
list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/sbin" )
list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/share" )
list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/share/applications" )
list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/share/doc" )
list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/share/mime" )
list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/share/mime/packages" )
list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/share/pixmaps" )
set( CPACK_RPM_PACKAGE_RELOCATABLE "OFF" )
set( CPACK_RPM_PACKAGE_CONFLICTS "${CONFLICT_PACKAGE}")
endif()
include(CPack)
diff --git a/src/Build/Resources/MacOSX/Info.plist.legacy.xml b/src/Build/Resources/MacOSX/Info.plist.legacy.xml
index 52c1a652..5b9ced6e 100644
--- a/src/Build/Resources/MacOSX/Info.plist.legacy.xml
+++ b/src/Build/Resources/MacOSX/Info.plist.legacy.xml
@@ -47,60 +47,60 @@
<string>Viewer</string>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>LSItemContentTypes</key>
<array>
<!-- my app supports files with my custom extension (see UTExportedTypeDeclarations) -->
<string>org.idrix.veracrypt.hc</string>
</array>
</dict>
</array>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>VeraCrypt</string>
<key>CFBundleIconFile</key>
<string>VeraCrypt.icns</string>
<key>CFBundleName</key>
<string>VeraCrypt</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>TRUE</string>
<key>CFBundleVersion</key>
- <string>1.26.4</string>
+ <string>_VERSION_</string>
<key>CFBundleShortVersionString</key>
<string>_VERSION_</string>
<key>CFBundleLongVersionString</key>
<string>VeraCrypt _VERSION_</string>
<key>LSArchitecturePriority</key>
<array>
<string>x86_64</string>
<string>i386</string>
</array>
<key>LSMinimumSystemVersion</key>
<string>10.7.0</string>
<key>LSRequiresCarbon</key>
<false/>
<key>CSResourcesFileMapped</key>
<true/>
<key>NSHighResolutionCapable</key>
<true/>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>
diff --git a/src/Build/Resources/MacOSX/Info.plist.xml b/src/Build/Resources/MacOSX/Info.plist.xml
index d6e71e2e..04ed21c1 100644
--- a/src/Build/Resources/MacOSX/Info.plist.xml
+++ b/src/Build/Resources/MacOSX/Info.plist.xml
@@ -47,54 +47,54 @@
<string>Viewer</string>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>LSItemContentTypes</key>
<array>
<!-- my app supports files with my custom extension (see UTExportedTypeDeclarations) -->
<string>org.idrix.veracrypt.hc</string>
</array>
</dict>
</array>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>VeraCrypt</string>
<key>CFBundleIconFile</key>
<string>VeraCrypt.icns</string>
<key>CFBundleName</key>
<string>VeraCrypt</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>TRUE</string>
<key>CFBundleVersion</key>
- <string>1.26.4</string>
+ <string>_VERSION_</string>
<key>CFBundleShortVersionString</key>
<string>_VERSION_</string>
<key>CFBundleLongVersionString</key>
<string>VeraCrypt _VERSION_</string>
<key>LSMinimumSystemVersion</key>
- <string>10.9.0</string>
+ <string>12.0.0</string>
<key>LSRequiresCarbon</key>
<false/>
<key>CSResourcesFileMapped</key>
<true/>
<key>NSHighResolutionCapable</key>
<true/>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>
diff --git a/src/Build/Tools/MacOSX/yasm b/src/Build/Tools/MacOSX/yasm
index d17889a9..36a9c0d4 100755
--- a/src/Build/Tools/MacOSX/yasm
+++ b/src/Build/Tools/MacOSX/yasm
Binary files differ
diff --git a/src/Build/build_cmake_deb.sh b/src/Build/build_cmake_deb.sh
index a6263a90..8bceb886 100755
--- a/src/Build/build_cmake_deb.sh
+++ b/src/Build/build_cmake_deb.sh
@@ -1,86 +1,114 @@
#!/bin/sh
#
-# Copyright (c) 2013-2022 IDRIX
+# Copyright (c) 2013-2024 IDRIX
# Governed by the Apache License 2.0 the full text of which is contained
# in the file License.txt included in VeraCrypt binary and source
# code distribution packages.
#
# Errors should cause script to exit
set -e
# Absolute path to this script
export SCRIPT=$(readlink -f "$0")
# Absolute path this script is in
export SCRIPTPATH=$(dirname "$SCRIPT")
# Source directory which contains the Makefile
export SOURCEPATH=$(readlink -f "$SCRIPTPATH/..")
# Directory where the VeraCrypt has been checked out
export PARENTDIR=$(readlink -f "$SCRIPTPATH/../../..")
-# The sources of wxWidgets 3.2.2.1 must be extracted to the parent directory
-export WX_ROOT=$PARENTDIR/wxWidgets-3.2.2.1
-echo "Using wxWidgets sources in $WX_ROOT"
-
-cd $SOURCEPATH
-
-if [ "$#" = "1" ] && [ "$1" = "WXSTATIC" ]
-then
-echo "Building GUI version of VeraCrypt for DEB using wxWidgets static libraries"
-
-# This will be the temporary wxWidgets directory
-export WX_BUILD_DIR=$PARENTDIR/wxBuildGUI
-
-# To build wxWidgets without GUI
-make WXSTATIC=1 wxbuild || exit 1
-make WXSTATIC=1 clean || exit 1
-make WXSTATIC=1 || exit 1
-make WXSTATIC=1 install DESTDIR="$PARENTDIR/VeraCrypt_Setup/GUI" || exit 1
-
+# Check the condition of wxBuildConsole and wxWidgets-3.2.5 in the original PARENTDIR
+if [ -d "$PARENTDIR/wxBuildConsole" ]; then
+ echo "Using existing PARENTDIR: $PARENTDIR, wxBuildConsole is present."
+elif [ -d "$PARENTDIR/wxWidgets-3.2.5" ]; then
+ echo "Using existing PARENTDIR: $PARENTDIR, wxWidgets-3.2.5 is present."
else
-
-echo "Building GUI version of VeraCrypt for DEB using system wxWidgets"
-make clean || exit 1
-
-if [ "$#" = "1" ] && [ "$1" = "INDICATOR" ]
-then
-
-make INDICATOR=1 || exit 1
-make INDICATOR=1 install DESTDIR="$PARENTDIR/VeraCrypt_Setup/GUI" || exit 1
-
-else
-
-make || exit 1
-make install DESTDIR="$PARENTDIR/VeraCrypt_Setup/GUI" || exit 1
-
+ # Change PARENTDIR to /tmp and check conditions again
+ export PARENTDIR="/tmp"
+ if [ -d "$PARENTDIR/wxBuildConsole" ]; then
+ echo "Switched to PARENTDIR: /tmp, wxBuildConsole is present in /tmp."
+ elif [ -d "$PARENTDIR/wxWidgets-3.2.5" ]; then
+ echo "Switched to PARENTDIR: /tmp, wxWidgets-3.2.5 is present in /tmp."
+ else
+ echo "Error: Neither wxBuildConsole nor wxWidgets-3.2.5 found in /tmp. Exiting."
+ exit 1
+ fi
fi
-fi
+# The sources of wxWidgets 3.2.5 must be extracted to the parent directory
+export WX_ROOT=$PARENTDIR/wxWidgets-3.2.5
-echo "Building console version of VeraCrypt for DEB using wxWidgets static libraries"
-
-# This is to avoid " Error: Unable to initialize GTK+, is DISPLAY set properly?"
-# when building over SSH without X11 Forwarding
-# export DISPLAY=:0.0
+cd $SOURCEPATH
-# This will be the temporary wxWidgets directory
-export WX_BUILD_DIR=$PARENTDIR/wxBuildConsole
+build_and_install() {
+ target=$1
+ wxstatic=$2
+ indicator=$3
+ nogui=""
+
+ # Determine wxWidgets build directory based on target
+ if [ "$target" = "Console" ]; then
+ export WX_BUILD_DIR="$PARENTDIR/wxBuildConsole"
+ nogui="NOGUI=1"
+ else
+ export WX_BUILD_DIR="$PARENTDIR/wxBuildGUI"
+ fi
+
+ wxstatic_value=""
+ if [ "$wxstatic" = "WXSTATIC" ]; then
+ wxstatic_value="WXSTATIC=1"
+ # Check if wx-config exists in WX_BUILD_DIR
+ if [ -L "${WX_BUILD_DIR}/wx-config" ]; then
+ echo "wx-config already exists in ${WX_BUILD_DIR}. Skipping wxbuild."
+ else
+ echo "Using wxWidgets sources in $WX_ROOT"
+ make $wxstatic_value $nogui wxbuild || exit 1
+ fi
+ fi
+
+ indicator_value=""
+ if [ "$indicator" = "INDICATOR" ]; then
+ indicator_value="INDICATOR=1"
+ fi
+
+ make $wxstatic_value $indicator_value $nogui clean || exit 1
+ make $wxstatic_value $indicator_value $nogui || exit 1
+ make $wxstatic_value $indicator_value $nogui install DESTDIR="$PARENTDIR/VeraCrypt_Setup/$target" || exit 1
+}
+
+# Handle arguments
+case "$1$2" in
+"WXSTATIC")
+ echo "Building GUI version of VeraCrypt for DEB using wxWidgets static libraries"
+ build_and_install "GUI" "WXSTATIC" ""
+ ;;
+"INDICATOR")
+ echo "Building GUI version of VeraCrypt for DEB using system wxWidgets and indicator"
+ build_and_install "GUI" "" "INDICATOR"
+ ;;
+"WXSTATICINDICATOR"|"INDICATORWXSTATIC")
+ echo "Building GUI version of VeraCrypt for DEB using wxWidgets static libraries and indicator"
+ build_and_install "GUI" "WXSTATIC" "INDICATOR"
+ ;;
+*)
+ echo "Building GUI version of VeraCrypt for DEB using system wxWidgets"
+ build_and_install "GUI" "" ""
+ ;;
+esac
-# To build wxWidgets without GUI
-make WXSTATIC=1 NOGUI=1 wxbuild || exit 1
-make WXSTATIC=1 NOGUI=1 clean || exit 1
-make WXSTATIC=1 NOGUI=1 || exit 1
-make WXSTATIC=1 NOGUI=1 install DESTDIR="$PARENTDIR/VeraCrypt_Setup/Console" || exit 1
+echo "Building console version of VeraCrypt for DEB using wxWidgets static libraries"
+build_and_install "Console" "WXSTATIC" ""
echo "Creating VeraCrypt DEB packages"
# -DCPACK_RPM_PACKAGE_DEBUG=TRUE for debugging cpack DEB
# -DCPACK_RPM_PACKAGE_DEBUG=TRUE for debugging cpack DEB
-mkdir -p $PARENTDIR/VeraCrypt_Packaging/GUI
-mkdir -p $PARENTDIR/VeraCrypt_Packaging/Console
+mkdir -p $PARENTDIR/VeraCrypt_Packaging/{GUI,Console}
cmake -H$SCRIPTPATH -B$PARENTDIR/VeraCrypt_Packaging/GUI -DVERACRYPT_BUILD_DIR="$PARENTDIR/VeraCrypt_Setup/GUI" -DNOGUI=FALSE || exit 1
cpack --config $PARENTDIR/VeraCrypt_Packaging/GUI/CPackConfig.cmake || exit 1
+
cmake -H$SCRIPTPATH -B$PARENTDIR/VeraCrypt_Packaging/Console -DVERACRYPT_BUILD_DIR="$PARENTDIR/VeraCrypt_Setup/Console" -DNOGUI=TRUE || exit 1
-cpack --config $PARENTDIR/VeraCrypt_Packaging/Console/CPackConfig.cmake || exit 1
+cpack --config $PARENTDIR/VeraCrypt_Packaging/Console/CPackConfig.cmake || exit 1
diff --git a/src/Build/build_cmake_opensuse.sh b/src/Build/build_cmake_opensuse.sh
index 622eb4cd..13a75bec 100644
--- a/src/Build/build_cmake_opensuse.sh
+++ b/src/Build/build_cmake_opensuse.sh
@@ -1,77 +1,96 @@
#!/bin/sh
#
-# Copyright (c) 2013-2022 IDRIX
+# Copyright (c) 2013-2024 IDRIX
# Governed by the Apache License 2.0 the full text of which is contained
# in the file License.txt included in VeraCrypt binary and source
# code distribution packages.
#
# Errors should cause script to exit
set -e
# Absolute path to this script
export SCRIPT=$(readlink -f "$0")
# Absolute path this script is in
export SCRIPTPATH=$(dirname "$SCRIPT")
# Source directory which contains the Makefile
export SOURCEPATH=$(readlink -f "$SCRIPTPATH/..")
# Directory where the VeraCrypt has been checked out
export PARENTDIR=$(readlink -f "$SCRIPTPATH/../../..")
-# The sources of wxWidgets 3.2.2.1 must be extracted to the parent directory
-export WX_ROOT=$PARENTDIR/wxWidgets-3.2.2.1
-echo "Using wxWidgets sources in $WX_ROOT"
+# Check the condition of wxBuildConsole and wxWidgets-3.2.5 in the original PARENTDIR
+if [ -d "$PARENTDIR/wxBuildConsole" ]; then
+ echo "Using existing PARENTDIR: $PARENTDIR, wxBuildConsole is present."
+elif [ -d "$PARENTDIR/wxWidgets-3.2.5" ]; then
+ echo "Using existing PARENTDIR: $PARENTDIR, wxWidgets-3.2.5 is present."
+else
+ # Change PARENTDIR to /tmp and check conditions again
+ export PARENTDIR="/tmp"
+ if [ -d "$PARENTDIR/wxBuildConsole" ]; then
+ echo "Switched to PARENTDIR: /tmp, wxBuildConsole is present in /tmp."
+ elif [ -d "$PARENTDIR/wxWidgets-3.2.5" ]; then
+ echo "Switched to PARENTDIR: /tmp, wxWidgets-3.2.5 is present in /tmp."
+ else
+ echo "Error: Neither wxBuildConsole nor wxWidgets-3.2.5 found in /tmp. Exiting."
+ exit 1
+ fi
+fi
+
+# The sources of wxWidgets 3.2.5 must be extracted to the parent directory
+export WX_ROOT=$PARENTDIR/wxWidgets-3.2.5
cd $SOURCEPATH
echo "Building GUI version of VeraCrypt for RPM using wxWidgets static libraries"
# This will be the temporary wxWidgets directory
export WX_BUILD_DIR=$PARENTDIR/wxBuildGui
-# To build wxWidgets using GTK-2
-make WXSTATIC=1 wxbuild || exit 1
-ln -s $WX_BUILD_DIR/lib $WX_BUILD_DIR/lib64
+# Check if wx-config exists in WX_BUILD_DIR
+if [ -L "${WX_BUILD_DIR}/wx-config" ]; then
+ echo "wx-config already exists in ${WX_BUILD_DIR}. Skipping wxbuild."
+else
+ echo "Using wxWidgets sources in $WX_ROOT"
+ make WXSTATIC=1 wxbuild || exit 1
+ ln -s $WX_BUILD_DIR/lib $WX_BUILD_DIR/lib64
+fi
+
make WXSTATIC=1 clean || exit 1
make WXSTATIC=1 || exit 1
make WXSTATIC=1 install DESTDIR="$PARENTDIR/VeraCrypt_Setup/GUI" || exit 1
-# Uncomment below and comment lines above to reuse existing wxWidgets build
-# make WXSTATIC=1 clean || exit 1
-# make WXSTATIC=1 || exit 1
-# make WXSTATIC=1 install DESTDIR="$PARENTDIR/VeraCrypt_Setup/GUI" || exit 1
-
echo "Building console version of VeraCrypt for RPM using wxWidgets static libraries"
# This is to avoid " Error: Unable to initialize GTK+, is DISPLAY set properly?"
# when building over SSH without X11 Forwarding
# export DISPLAY=:0.0
# This will be the temporary wxWidgets directory
export WX_BUILD_DIR=$PARENTDIR/wxBuildConsole
-# To build wxWidgets using GTK-2
-make WXSTATIC=1 NOGUI=1 wxbuild || exit 1
-ln -s $WX_BUILD_DIR/lib $WX_BUILD_DIR/lib64
+# Check if wx-config exists in WX_BUILD_DIR
+if [ -L "${WX_BUILD_DIR}/wx-config" ]; then
+ echo "wx-config already exists in ${WX_BUILD_DIR}. Skipping wxbuild."
+else
+ echo "Using wxWidgets sources in $WX_ROOT"
+ make WXSTATIC=1 NOGUI=1 wxbuild || exit 1
+ ln -s $WX_BUILD_DIR/lib $WX_BUILD_DIR/lib64
+fi
+
make WXSTATIC=1 NOGUI=1 clean || exit 1
make WXSTATIC=1 NOGUI=1 || exit 1
make WXSTATIC=1 NOGUI=1 install DESTDIR="$PARENTDIR/VeraCrypt_Setup/Console" || exit 1
-# Uncomment below and comment lines above to reuse existing wxWidgets build
-# make WXSTATIC=1 NOGUI=1 clean || exit 1
-# make WXSTATIC=1 NOGUI=1 || exit 1
-# make WXSTATIC=1 NOGUI=1 install DESTDIR="$PARENTDIR/VeraCrypt_Setup/Console" || exit 1
-
echo "Creating VeraCrypt RPM packages "
# -DCPACK_RPM_PACKAGE_DEBUG=TRUE for debugging cpack RPM
# -DCPACK_RPM_PACKAGE_DEBUG=TRUE for debugging cpack RPM
mkdir -p $PARENTDIR/VeraCrypt_Packaging/GUI
mkdir -p $PARENTDIR/VeraCrypt_Packaging/Console
-# wxWidgets was built using GTK-2
-cmake -H$SCRIPTPATH -B$PARENTDIR/VeraCrypt_Packaging/GUI -DVERACRYPT_BUILD_DIR="$PARENTDIR/VeraCrypt_Setup/GUI" -DWITHGTK3=FALSE -DNOGUI=FALSE || exit 1
+# wxWidgets was built using native GTK version
+cmake -H$SCRIPTPATH -B$PARENTDIR/VeraCrypt_Packaging/GUI -DVERACRYPT_BUILD_DIR="$PARENTDIR/VeraCrypt_Setup/GUI" -DNOGUI=FALSE || exit 1
cpack --config $PARENTDIR/VeraCrypt_Packaging/GUI/CPackConfig.cmake || exit 1
-cmake -H$SCRIPTPATH -B$PARENTDIR/VeraCrypt_Packaging/Console -DVERACRYPT_BUILD_DIR="$PARENTDIR/VeraCrypt_Setup/Console" -DWITHGTK3=FALSE -DNOGUI=TRUE || exit 1
+cmake -H$SCRIPTPATH -B$PARENTDIR/VeraCrypt_Packaging/Console -DVERACRYPT_BUILD_DIR="$PARENTDIR/VeraCrypt_Setup/Console" -DNOGUI=TRUE || exit 1
cpack --config $PARENTDIR/VeraCrypt_Packaging/Console/CPackConfig.cmake|| exit 1
diff --git a/src/Build/build_cmake_rpm_gtk2.sh b/src/Build/build_cmake_rpm.sh
index 3f33cc1c..ba6ea355 100644
--- a/src/Build/build_cmake_rpm_gtk2.sh
+++ b/src/Build/build_cmake_rpm.sh
@@ -1,75 +1,94 @@
#!/bin/sh
#
-# Copyright (c) 2013-2022 IDRIX
+# Copyright (c) 2013-2024 IDRIX
# Governed by the Apache License 2.0 the full text of which is contained
# in the file License.txt included in VeraCrypt binary and source
# code distribution packages.
#
# Errors should cause script to exit
set -e
# Absolute path to this script
export SCRIPT=$(readlink -f "$0")
# Absolute path this script is in
export SCRIPTPATH=$(dirname "$SCRIPT")
# Source directory which contains the Makefile
export SOURCEPATH=$(readlink -f "$SCRIPTPATH/..")
# Directory where the VeraCrypt has been checked out
export PARENTDIR=$(readlink -f "$SCRIPTPATH/../../..")
-# The sources of wxWidgets 3.2.2.1 must be extracted to the parent directory
-export WX_ROOT=$PARENTDIR/wxWidgets-3.2.2.1
-echo "Using wxWidgets sources in $WX_ROOT"
+# Check the condition of wxBuildConsole and wxWidgets-3.2.5 in the original PARENTDIR
+if [ -d "$PARENTDIR/wxBuildConsole" ]; then
+ echo "Using existing PARENTDIR: $PARENTDIR, wxBuildConsole is present."
+elif [ -d "$PARENTDIR/wxWidgets-3.2.5" ]; then
+ echo "Using existing PARENTDIR: $PARENTDIR, wxWidgets-3.2.5 is present."
+else
+ # Change PARENTDIR to /tmp and check conditions again
+ export PARENTDIR="/tmp"
+ if [ -d "$PARENTDIR/wxBuildConsole" ]; then
+ echo "Switched to PARENTDIR: /tmp, wxBuildConsole is present in /tmp."
+ elif [ -d "$PARENTDIR/wxWidgets-3.2.5" ]; then
+ echo "Switched to PARENTDIR: /tmp, wxWidgets-3.2.5 is present in /tmp."
+ else
+ echo "Error: Neither wxBuildConsole nor wxWidgets-3.2.5 found in /tmp. Exiting."
+ exit 1
+ fi
+fi
+
+# The sources of wxWidgets 3.2.5 must be extracted to the parent directory
+export WX_ROOT=$PARENTDIR/wxWidgets-3.2.5
cd $SOURCEPATH
echo "Building GUI version of VeraCrypt for RPM using wxWidgets static libraries"
# This will be the temporary wxWidgets directory
export WX_BUILD_DIR=$PARENTDIR/wxBuildGui
-# To build wxWidgets using GTK-2
-make WXSTATIC=1 wxbuild || exit 1
+# Check if wx-config exists in WX_BUILD_DIR
+if [ -L "${WX_BUILD_DIR}/wx-config" ]; then
+ echo "wx-config already exists in ${WX_BUILD_DIR}. Skipping wxbuild."
+else
+ echo "Using wxWidgets sources in $WX_ROOT"
+ make WXSTATIC=1 wxbuild || exit 1
+fi
+
make WXSTATIC=1 clean || exit 1
make WXSTATIC=1 || exit 1
make WXSTATIC=1 install DESTDIR="$PARENTDIR/VeraCrypt_Setup/GUI" || exit 1
-# Uncomment below and comment lines above to reuse existing wxWidgets build
-# make WXSTATIC=1 clean || exit 1
-# make WXSTATIC=1 || exit 1
-# make WXSTATIC=1 install DESTDIR="$PARENTDIR/VeraCrypt_Setup/GUI" || exit 1
-
echo "Building console version of VeraCrypt for RPM using wxWidgets static libraries"
# This is to avoid " Error: Unable to initialize GTK+, is DISPLAY set properly?"
# when building over SSH without X11 Forwarding
# export DISPLAY=:0.0
# This will be the temporary wxWidgets directory
export WX_BUILD_DIR=$PARENTDIR/wxBuildConsole
-# To build wxWidgets using GTK-2
-make WXSTATIC=1 NOGUI=1 wxbuild || exit 1
+# Check if wx-config exists in WX_BUILD_DIR
+if [ -L "${WX_BUILD_DIR}/wx-config" ]; then
+ echo "wx-config already exists in ${WX_BUILD_DIR}. Skipping wxbuild."
+else
+ echo "Using wxWidgets sources in $WX_ROOT"
+ make WXSTATIC=1 NOGUI=1 wxbuild || exit 1
+fi
+
make WXSTATIC=1 NOGUI=1 clean || exit 1
make WXSTATIC=1 NOGUI=1 || exit 1
make WXSTATIC=1 NOGUI=1 install DESTDIR="$PARENTDIR/VeraCrypt_Setup/Console" || exit 1
-# Uncomment below and comment lines above to reuse existing wxWidgets build
-# make WXSTATIC=1 NOGUI=1 clean || exit 1
-# make WXSTATIC=1 NOGUI=1 || exit 1
-# make WXSTATIC=1 NOGUI=1 install DESTDIR="$PARENTDIR/VeraCrypt_Setup/Console" || exit 1
-
echo "Creating VeraCrypt RPM packages "
# -DCPACK_RPM_PACKAGE_DEBUG=TRUE for debugging cpack RPM
# -DCPACK_RPM_PACKAGE_DEBUG=TRUE for debugging cpack RPM
mkdir -p $PARENTDIR/VeraCrypt_Packaging/GUI
mkdir -p $PARENTDIR/VeraCrypt_Packaging/Console
-# wxWidgets was built using GTK-2
-cmake -H$SCRIPTPATH -B$PARENTDIR/VeraCrypt_Packaging/GUI -DVERACRYPT_BUILD_DIR="$PARENTDIR/VeraCrypt_Setup/GUI" -DWITHGTK3=FALSE -DNOGUI=FALSE || exit 1
+# wxWidgets was built using native GTK version
+cmake -H$SCRIPTPATH -B$PARENTDIR/VeraCrypt_Packaging/GUI -DVERACRYPT_BUILD_DIR="$PARENTDIR/VeraCrypt_Setup/GUI" -DNOGUI=FALSE || exit 1
cpack --config $PARENTDIR/VeraCrypt_Packaging/GUI/CPackConfig.cmake || exit 1
-cmake -H$SCRIPTPATH -B$PARENTDIR/VeraCrypt_Packaging/Console -DVERACRYPT_BUILD_DIR="$PARENTDIR/VeraCrypt_Setup/Console" -DWITHGTK3=FALSE -DNOGUI=TRUE || exit 1
+cmake -H$SCRIPTPATH -B$PARENTDIR/VeraCrypt_Packaging/Console -DVERACRYPT_BUILD_DIR="$PARENTDIR/VeraCrypt_Setup/Console" -DNOGUI=TRUE || exit 1
cpack --config $PARENTDIR/VeraCrypt_Packaging/Console/CPackConfig.cmake || exit 1
diff --git a/src/Build/build_cmake_rpm_gtk3.sh b/src/Build/build_cmake_rpm_gtk3.sh
deleted file mode 100644
index 72556dcf..00000000
--- a/src/Build/build_cmake_rpm_gtk3.sh
+++ /dev/null
@@ -1,75 +0,0 @@
-#!/bin/sh
-#
-# Copyright (c) 2013-2022 IDRIX
-# Governed by the Apache License 2.0 the full text of which is contained
-# in the file License.txt included in VeraCrypt binary and source
-# code distribution packages.
-#
-
-# Errors should cause script to exit
-set -e
-
-# Absolute path to this script
-export SCRIPT=$(readlink -f "$0")
-# Absolute path this script is in
-export SCRIPTPATH=$(dirname "$SCRIPT")
-# Source directory which contains the Makefile
-export SOURCEPATH=$(readlink -f "$SCRIPTPATH/..")
-# Directory where the VeraCrypt has been checked out
-export PARENTDIR=$(readlink -f "$SCRIPTPATH/../../..")
-
-# The sources of wxWidgets 3.2.2.1 must be extracted to the parent directory
-export WX_ROOT=$PARENTDIR/wxWidgets-3.2.2.1
-echo "Using wxWidgets sources in $WX_ROOT"
-
-cd $SOURCEPATH
-
-echo "Building GUI version of VeraCrypt for RPM using wxWidgets static libraries"
-
-# This will be the temporary wxWidgets directory
-export WX_BUILD_DIR=$PARENTDIR/wxBuildGui
-
-# To build wxWidgets using GTK-3
-make WXSTATIC=1 WITHGTK3=1 wxbuild || exit 1
-make WXSTATIC=1 clean || exit 1
-make WXSTATIC=1 || exit 1
-make WXSTATIC=1 install DESTDIR="$PARENTDIR/VeraCrypt_Setup/GUI" || exit 1
-
-# Uncomment below and comment lines above to reuse existing wxWidgets build
-# make WXSTATIC=1 clean || exit 1
-# make WXSTATIC=1 || exit 1
-# make WXSTATIC=1 install DESTDIR="$PARENTDIR/VeraCrypt_Setup/GUI" || exit 1
-
-echo "Building console version of VeraCrypt for RPM using wxWidgets static libraries"
-
-# This is to avoid " Error: Unable to initialize GTK+, is DISPLAY set properly?"
-# when building over SSH without X11 Forwarding
-# export DISPLAY=:0.0
-
-# This will be the temporary wxWidgets directory
-export WX_BUILD_DIR=$PARENTDIR/wxBuildConsole
-
-# To build wxWidgets using GTK-3
-make WXSTATIC=1 WITHGTK3=1 NOGUI=1 wxbuild || exit 1
-make WXSTATIC=1 NOGUI=1 clean || exit 1
-make WXSTATIC=1 NOGUI=1 || exit 1
-make WXSTATIC=1 NOGUI=1 install DESTDIR="$PARENTDIR/VeraCrypt_Setup/Console" || exit 1
-
-# Uncomment below and comment lines above to reuse existing wxWidgets build
-# make WXSTATIC=1 NOGUI=1 clean || exit 1
-# make WXSTATIC=1 NOGUI=1 || exit 1
-# make WXSTATIC=1 NOGUI=1 install DESTDIR="$PARENTDIR/VeraCrypt_Setup/Console" || exit 1
-
-echo "Creating VeraCrypt RPM packages "
-
-# -DCPACK_RPM_PACKAGE_DEBUG=TRUE for debugging cpack RPM
-# -DCPACK_RPM_PACKAGE_DEBUG=TRUE for debugging cpack RPM
-
-mkdir -p $PARENTDIR/VeraCrypt_Packaging/GUI
-mkdir -p $PARENTDIR/VeraCrypt_Packaging/Console
-
-# wxWidgets was built using GTK-3
-cmake -H$SCRIPTPATH -B$PARENTDIR/VeraCrypt_Packaging/GUI -DVERACRYPT_BUILD_DIR="$PARENTDIR/VeraCrypt_Setup/GUI" -DWITHGTK3=TRUE -DNOGUI=FALSE || exit 1
-cpack --config $PARENTDIR/VeraCrypt_Packaging/GUI/CPackConfig.cmake || exit 1
-cmake -H$SCRIPTPATH -B$PARENTDIR/VeraCrypt_Packaging/Console -DVERACRYPT_BUILD_DIR="$PARENTDIR/VeraCrypt_Setup/Console" -DWITHGTK3=TRUE -DNOGUI=TRUE || exit 1
-cpack --config $PARENTDIR/VeraCrypt_Packaging/Console/CPackConfig.cmake|| exit 1
diff --git a/src/Build/build_veracrypt_freebsd.sh b/src/Build/build_veracrypt_freebsd.sh
index 176c8499..892a7eed 100755
--- a/src/Build/build_veracrypt_freebsd.sh
+++ b/src/Build/build_veracrypt_freebsd.sh
@@ -1,48 +1,72 @@
#!/bin/sh
#
-# Copyright (c) 2013-2022 IDRIX
+# Copyright (c) 2013-2024 IDRIX
# Governed by the Apache License 2.0 the full text of which is contained
# in the file License.txt included in VeraCrypt binary and source
# code distribution packages.
#
# Absolute path to this script
SCRIPT=$(readlink -f "$0")
# Absolute path this script is in
SCRIPTPATH=$(dirname "$SCRIPT")
# source directory which contains the Makefile
SOURCEPATH=$(readlink -f "$SCRIPTPATH/..")
# directory where the VeraCrypt has been checked out
PARENTDIR=$(readlink -f "$SCRIPTPATH/../../..")
-# Make sure only root can run our script
-if [ "$(id -u)" != "0" ]; then
- echo "VeraCrypt must be built by root" 1>&2
- exit 1
+# Check the condition of wxBuildConsole and wxWidgets-3.2.5 in the original PARENTDIR
+if [ -d "$PARENTDIR/wxBuildConsole" ]; then
+ echo "Using existing PARENTDIR: $PARENTDIR, wxBuildConsole is present."
+elif [ -d "$PARENTDIR/wxWidgets-3.2.5" ]; then
+ echo "Using existing PARENTDIR: $PARENTDIR, wxWidgets-3.2.5 is present."
+else
+ # Change PARENTDIR to /tmp and check conditions again
+ export PARENTDIR="/tmp"
+ if [ -d "$PARENTDIR/wxBuildConsole" ]; then
+ echo "Switched to PARENTDIR: /tmp, wxBuildConsole is present in /tmp."
+ elif [ -d "$PARENTDIR/wxWidgets-3.2.5" ]; then
+ echo "Switched to PARENTDIR: /tmp, wxWidgets-3.2.5 is present in /tmp."
+ else
+ echo "Error: Neither wxBuildConsole nor wxWidgets-3.2.5 found in /tmp. Exiting."
+ exit 1
+ fi
fi
-# the sources of wxWidgets 3.2.2.1 must be extracted to the parent directory
-export WX_ROOT=$PARENTDIR/wxWidgets-3.2.2.1
-echo "Using wxWidgets sources in $WX_ROOT"
+# The sources of wxWidgets 3.2.5 must be extracted to the parent directory
+export WX_ROOT=$PARENTDIR/wxWidgets-3.2.5
cd $SOURCEPATH
echo "Building GUI version of VeraCrypt"
# this will be the temporary wxWidgets directory
export WX_BUILD_DIR=$PARENTDIR/wxBuildGui
-gmake WXSTATIC=1 wxbuild && gmake WXSTATIC=1 clean && gmake WXSTATIC=1 && gmake WXSTATIC=1 package
+# Check if wx-config exists in WX_BUILD_DIR
+if [ -L "${WX_BUILD_DIR}/wx-config" ]; then
+ echo "wx-config already exists in ${WX_BUILD_DIR}. Skipping wxbuild."
+else
+ echo "Using wxWidgets sources in $WX_ROOT"
+ gmake WXSTATIC=1 wxbuild || exit 1
+fi
-# Uncomment below and comment line above to reuse existing wxWidgets build
-#gmake WXSTATIC=1 clean && gmake WXSTATIC=1 && gmake WXSTATIC=1 package
+gmake WXSTATIC=1 clean || exit 1
+gmake WXSTATIC=1 || exit 1
+gmake WXSTATIC=1 package || exit 1
echo "Building console version of VeraCrypt"
# this will be the temporary wxWidgets directory
export WX_BUILD_DIR=$PARENTDIR/wxBuildConsole
-gmake WXSTATIC=1 NOGUI=1 wxbuild && gmake WXSTATIC=1 NOGUI=1 clean && gmake WXSTATIC=1 NOGUI=1 && gmake WXSTATIC=1 NOGUI=1 package
-
-# Uncomment below and comment line above to reuse existing wxWidgets build
-#gmake WXSTATIC=1 NOGUI=1 clean && gmake WXSTATIC=1 NOGUI=1 && gmake WXSTATIC=1 NOGUI=1 package
+# Check if wx-config exists in WX_BUILD_DIR
+if [ -L "${WX_BUILD_DIR}/wx-config" ]; then
+ echo "wx-config already exists in ${WX_BUILD_DIR}. Skipping wxbuild."
+else
+ echo "Using wxWidgets sources in $WX_ROOT"
+ gmake WXSTATIC=1 NOGUI=1 wxbuild || exit 1
+fi
+gmake WXSTATIC=1 NOGUI=1 clean || exit 1
+gmake WXSTATIC=1 NOGUI=1 || exit 1
+gmake WXSTATIC=1 NOGUI=1 package || exit 1
diff --git a/src/Build/build_veracrypt_linux.sh b/src/Build/build_veracrypt_linux.sh
index fa928556..b6ac39ed 100755
--- a/src/Build/build_veracrypt_linux.sh
+++ b/src/Build/build_veracrypt_linux.sh
@@ -1,47 +1,76 @@
#
-# Copyright (c) 2013-2022 IDRIX
+# Copyright (c) 2013-2024 IDRIX
# Governed by the Apache License 2.0 the full text of which is contained
# in the file License.txt included in VeraCrypt binary and source
# code distribution packages.
#
# Absolute path to this script
SCRIPT=$(readlink -f "$0")
# Absolute path this script is in
SCRIPTPATH=$(dirname "$SCRIPT")
# source directory which contains the Makefile
SOURCEPATH=$(readlink -f "$SCRIPTPATH/..")
# directory where the VeraCrypt has been checked out
PARENTDIR=$(readlink -f "$SCRIPTPATH/../../..")
# Make sure only root can run our script
if [ "$(id -u)" != "0" ]; then
echo "VeraCrypt must be built by root" 1>&2
exit 1
fi
-# the sources of wxWidgets 3.2.2.1 must be extracted to the parent directory
-export WX_ROOT=$PARENTDIR/wxWidgets-3.2.2.1
-echo "Using wxWidgets sources in $WX_ROOT"
+# Check the condition of wxBuildConsole and wxWidgets-3.2.5 in the original PARENTDIR
+if [ -d "$PARENTDIR/wxBuildConsole" ]; then
+ echo "Using existing PARENTDIR: $PARENTDIR, wxBuildConsole is present."
+elif [ -d "$PARENTDIR/wxWidgets-3.2.5" ]; then
+ echo "Using existing PARENTDIR: $PARENTDIR, wxWidgets-3.2.5 is present."
+else
+ # Change PARENTDIR to /tmp and check conditions again
+ export PARENTDIR="/tmp"
+ if [ -d "$PARENTDIR/wxBuildConsole" ]; then
+ echo "Switched to PARENTDIR: /tmp, wxBuildConsole is present in /tmp."
+ elif [ -d "$PARENTDIR/wxWidgets-3.2.5" ]; then
+ echo "Switched to PARENTDIR: /tmp, wxWidgets-3.2.5 is present in /tmp."
+ else
+ echo "Error: Neither wxBuildConsole nor wxWidgets-3.2.5 found in /tmp. Exiting."
+ exit 1
+ fi
+fi
+
+# The sources of wxWidgets 3.2.5 must be extracted to the parent directory
+export WX_ROOT=$PARENTDIR/wxWidgets-3.2.5
cd $SOURCEPATH
echo "Building GUI version of VeraCrypt"
# this will be the temporary wxWidgets directory
export WX_BUILD_DIR=$PARENTDIR/wxBuildGui
-make WXSTATIC=1 wxbuild && make WXSTATIC=1 clean && make WXSTATIC=1 && make WXSTATIC=1 package
-
-# Uncomment below and comment line above to reuse existing wxWidgets build
-# make WXSTATIC=1 clean && make WXSTATIC=1 && make WXSTATIC=1 package
+# Check if wx-config exists in WX_BUILD_DIR
+if [ -L "${WX_BUILD_DIR}/wx-config" ]; then
+ echo "wx-config already exists in ${WX_BUILD_DIR}. Skipping wxbuild."
+else
+ echo "Using wxWidgets sources in $WX_ROOT"
+ make WXSTATIC=1 wxbuild || exit 1
+fi
+make WXSTATIC=1 clean || exit 1
+make WXSTATIC=1 || exit 1
+make WXSTATIC=1 package || exit 1
echo "Building console version of VeraCrypt"
# this will be the temporary wxWidgets directory
export WX_BUILD_DIR=$PARENTDIR/wxBuildConsole
-make WXSTATIC=1 NOGUI=1 wxbuild && make WXSTATIC=1 NOGUI=1 clean && make WXSTATIC=1 NOGUI=1 && make WXSTATIC=1 NOGUI=1 package
-
-# Uncomment below and comment line above to reuse existing wxWidgets build
-# make WXSTATIC=1 NOGUI=1 clean && make WXSTATIC=1 NOGUI=1 && make WXSTATIC=1 NOGUI=1 package
+# Check if wx-config exists in WX_BUILD_DIR
+if [ -L "${WX_BUILD_DIR}/wx-config" ]; then
+ echo "wx-config already exists in ${WX_BUILD_DIR}. Skipping wxbuild."
+else
+ echo "Using wxWidgets sources in $WX_ROOT"
+ make WXSTATIC=1 NOGUI=1 wxbuild || exit 1
+fi
+make WXSTATIC=1 NOGUI=1 clean || exit 1
+make WXSTATIC=1 NOGUI=1 || exit 1
+make WXSTATIC=1 NOGUI=1 package || exit 1
diff --git a/src/Build/build_veracrypt_linux_gtk3.sh b/src/Build/build_veracrypt_linux_gtk3.sh
deleted file mode 100644
index bae6a856..00000000
--- a/src/Build/build_veracrypt_linux_gtk3.sh
+++ /dev/null
@@ -1,47 +0,0 @@
-#
-# Copyright (c) 2013-2022 IDRIX
-# Governed by the Apache License 2.0 the full text of which is contained
-# in the file License.txt included in VeraCrypt binary and source
-# code distribution packages.
-#
-
-# Absolute path to this script
-SCRIPT=$(readlink -f "$0")
-# Absolute path this script is in
-SCRIPTPATH=$(dirname "$SCRIPT")
-# source directory which contains the Makefile
-SOURCEPATH=$(readlink -f "$SCRIPTPATH/..")
-# directory where the VeraCrypt has been checked out
-PARENTDIR=$(readlink -f "$SCRIPTPATH/../../..")
-
-# Make sure only root can run our script
-if [ "$(id -u)" != "0" ]; then
- echo "VeraCrypt must be built by root" 1>&2
- exit 1
-fi
-
-# the sources of wxWidgets 3.2.2.1 must be extracted to the parent directory
-export WX_ROOT=$PARENTDIR/wxWidgets-3.2.2.1
-echo "Using wxWidgets sources in $WX_ROOT"
-
-cd $SOURCEPATH
-
-echo "Building GUI version of VeraCrypt"
-
-# this will be the temporary wxWidgets directory
-export WX_BUILD_DIR=$PARENTDIR/wxBuildGui
-
-make WXSTATIC=1 WITHGTK3=1 wxbuild && make WXSTATIC=1 clean && make WXSTATIC=1 && make WXSTATIC=1 package
-
-# Uncomment below and comment line above to reuse existing wxWidgets build
-#make WXSTATIC=1 clean && make WXSTATIC=1 && make WXSTATIC=1 package
-
-echo "Building console version of VeraCrypt"
-
-# this will be the temporary wxWidgets directory
-export WX_BUILD_DIR=$PARENTDIR/wxBuildConsole
-
-make WXSTATIC=1 WITHGTK3=1 NOGUI=1 wxbuild && make WXSTATIC=1 NOGUI=1 clean && make WXSTATIC=1 NOGUI=1 && make WXSTATIC=1 NOGUI=1 package
-
-# Uncomment below and comment line above to reuse existing wxWidgets build
-#make WXSTATIC=1 NOGUI=1 clean && make WXSTATIC=1 NOGUI=1 && make WXSTATIC=1 NOGUI=1 package
diff --git a/src/Build/build_veracrypt_linux_no_sse2.sh b/src/Build/build_veracrypt_linux_no_sse2.sh
index f68641b9..6f0739c7 100755
--- a/src/Build/build_veracrypt_linux_no_sse2.sh
+++ b/src/Build/build_veracrypt_linux_no_sse2.sh
@@ -1,47 +1,76 @@
#
-# Copyright (c) 2013-2022 IDRIX
+# Copyright (c) 2013-2024 IDRIX
# Governed by the Apache License 2.0 the full text of which is contained
# in the file License.txt included in VeraCrypt binary and source
# code distribution packages.
#
# Absolute path to this script
SCRIPT=$(readlink -f "$0")
# Absolute path this script is in
SCRIPTPATH=$(dirname "$SCRIPT")
# source directory which contains the Makefile
SOURCEPATH=$(readlink -f "$SCRIPTPATH/..")
# directory where the VeraCrypt has been checked out
PARENTDIR=$(readlink -f "$SCRIPTPATH/../../..")
# Make sure only root can run our script
if [ "$(id -u)" != "0" ]; then
echo "VeraCrypt must be built by root" 1>&2
exit 1
fi
-# the sources of wxWidgets 3.2.2.1 must be extracted to the parent directory
-export WX_ROOT=$PARENTDIR/wxWidgets-3.2.2.1
-echo "Using wxWidgets sources in $WX_ROOT"
+# Check the condition of wxBuildConsole and wxWidgets-3.2.5 in the original PARENTDIR
+if [ -d "$PARENTDIR/wxBuildConsole" ]; then
+ echo "Using existing PARENTDIR: $PARENTDIR, wxBuildConsole is present."
+elif [ -d "$PARENTDIR/wxWidgets-3.2.5" ]; then
+ echo "Using existing PARENTDIR: $PARENTDIR, wxWidgets-3.2.5 is present."
+else
+ # Change PARENTDIR to /tmp and check conditions again
+ export PARENTDIR="/tmp"
+ if [ -d "$PARENTDIR/wxBuildConsole" ]; then
+ echo "Switched to PARENTDIR: /tmp, wxBuildConsole is present in /tmp."
+ elif [ -d "$PARENTDIR/wxWidgets-3.2.5" ]; then
+ echo "Switched to PARENTDIR: /tmp, wxWidgets-3.2.5 is present in /tmp."
+ else
+ echo "Error: Neither wxBuildConsole nor wxWidgets-3.2.5 found in /tmp. Exiting."
+ exit 1
+ fi
+fi
+
+# The sources of wxWidgets 3.2.5 must be extracted to the parent directory
+export WX_ROOT=$PARENTDIR/wxWidgets-3.2.5
cd $SOURCEPATH
echo "Building GUI version of VeraCrypt"
# this will be the temporary wxWidgets directory
export WX_BUILD_DIR=$PARENTDIR/wxBuildGuiNoSSE2
-make WXSTATIC=1 NOSSE2=1 wxbuild && make WXSTATIC=1 NOSSE2=1 clean && make WXSTATIC=1 NOSSE2=1 && make WXSTATIC=1 NOSSE2=1 package
-
-# Uncomment below and comment line above to reuse existing wxWidgets build
-# make WXSTATIC=1 NOSSE2=1 clean && make WXSTATIC=1 NOSSE2=1 && make WXSTATIC=1 NOSSE2=1 package
+# Check if wx-config exists in WX_BUILD_DIR
+if [ -L "${WX_BUILD_DIR}/wx-config" ]; then
+ echo "wx-config already exists in ${WX_BUILD_DIR}. Skipping wxbuild."
+else
+ echo "Using wxWidgets sources in $WX_ROOT"
+ make WXSTATIC=1 NOSSE2=1 wxbuild || exit 1
+fi
+make WXSTATIC=1 NOSSE2=1 clean || exit 1
+make WXSTATIC=1 NOSSE2=1 || exit 1
+make WXSTATIC=1 NOSSE2=1 package || exit 1
echo "Building console version of VeraCrypt"
# this will be the temporary wxWidgets directory
export WX_BUILD_DIR=$PARENTDIR/wxBuildConsoleNoSSE2
-make WXSTATIC=1 NOGUI=1 NOSSE2=1 wxbuild && make WXSTATIC=1 NOGUI=1 NOSSE2=1 clean && make WXSTATIC=1 NOGUI=1 NOSSE2=1 && make WXSTATIC=1 NOGUI=1 NOSSE2=1 package
-
-# Uncomment below and comment line above to reuse existing wxWidgets build
-# make WXSTATIC=1 NOGUI=1 NOSSE2=1 clean && make WXSTATIC=1 NOGUI=1 NOSSE2=1 && make WXSTATIC=1 NOGUI=1 NOSSE2=1 package
+# Check if wx-config exists in WX_BUILD_DIR
+if [ -L "${WX_BUILD_DIR}/wx-config" ]; then
+ echo "wx-config already exists in ${WX_BUILD_DIR}. Skipping wxbuild."
+else
+ echo "Using wxWidgets sources in $WX_ROOT"
+ make WXSTATIC=1 NOGUI=1 NOSSE2=1 wxbuild || exit 1
+fi
+make WXSTATIC=1 NOGUI=1 NOSSE2=1 clean || exit 1
+make WXSTATIC=1 NOGUI=1 NOSSE2=1 || exit 1
+make WXSTATIC=1 NOGUI=1 NOSSE2=1 package || exit
diff --git a/src/Build/build_veracrypt_macosx.sh b/src/Build/build_veracrypt_macosx.sh
index 4636d27d..13302442 100755
--- a/src/Build/build_veracrypt_macosx.sh
+++ b/src/Build/build_veracrypt_macosx.sh
@@ -1,33 +1,150 @@
+#!/usr/bin/env bash
+
#
-# Copyright (c) 2013-2019 IDRIX
+# Copyright (c) 2013-2024 IDRIX
# Governed by the Apache License 2.0 the full text of which is contained
# in the file License.txt included in VeraCrypt binary and source
# code distribution packages.
#
+# Exit immediately if a command exits with a non-zero status
+set -e
+
# Absolute path this script is in
-SCRIPTPATH=$(cd "$(dirname "$0")"; pwd)
+SCRIPTPATH=$(cd "$(dirname "$0")" && pwd)
# source directory which contains the Makefile
-SOURCEPATH=$(cd "$(dirname "$SCRIPTPATH/../.")"; pwd)
+SOURCEPATH=$(cd "$(dirname "$SCRIPTPATH/../.")" && pwd)
# directory where the VeraCrypt project has been checked out
-PARENTDIR=$(cd "$(dirname "$SCRIPTPATH/../../../.")"; pwd)
+PARENTDIR=$(cd "$(dirname "$SCRIPTPATH/../../../.")" && pwd)
+
+# Default wxWidgets version
+DEFAULT_WX_VERSION="3.2.5"
+WX_VERSION="$DEFAULT_WX_VERSION"
+
+# Initialize flags
+brew=false
+package=false
+fuset=false
+local_build=false
+
+# Function to display usage information
+usage() {
+ echo "Usage: $0 [options]"
+ echo "Options:"
+ echo " -b Use Homebrew to build with precompiled packages"
+ echo " -p Create a package after building"
+ echo " -f Build with FUSE-T support"
+ echo " -l Use local wxWidgets and disable universal binaries"
+ echo " -v <version> Specify wxWidgets version (default: $DEFAULT_WX_VERSION)"
+ echo " -h Display this help message"
+ exit 1
+}
+
+# Parse command-line options
+while getopts "bpflv:h" flag
+do
+ case "${flag}" in
+ b) brew=true;;
+ p) package=true;;
+ f) fuset=true;;
+ l) local_build=true;;
+ v)
+ if [ -z "$OPTARG" ]; then
+ echo "Error: -v requires a version argument."
+ usage
+ fi
+ WX_VERSION=${OPTARG}
+ ;;
+ h) usage;;
+ *) usage;;
+ esac
+done
+
+export VC_OSX_FUSET=$([ "$fuset" = true ] && echo 1 || echo 0)
+
+if [ "$fuset" = true ]; then
+ echo "Building VeraCrypt with FUSE-T support"
+else
+ echo "Building VeraCrypt with MacFUSE support"
+fi
+
+if [ "$brew" = true ]; then
+ if ! command -v brew &> /dev/null; then
+ echo "Homebrew is not installed. Please install Homebrew or run without the -b flag."
+ exit 1
+ fi
+
+ export VC_OSX_SDK=$(xcrun --show-sdk-version) # use the latest version installed, this might fail
+ export VC_OSX_TARGET=${VC_OSX_SDK}
+ echo "Using MacOSX SDK $VC_OSX_SDK with target set to $VC_OSX_TARGET"
+ cd "$SOURCEPATH"
+
+ echo "Building VeraCrypt with precompiled homebrew packages"
+ cellar=$(brew --cellar "wxwidgets")
+ version=$(brew list --versions "wxwidgets" | head -1 | awk '{print $2}')
+ export WX_BUILD_DIR="$cellar/$version/bin"
+ # skip signing and build only for local arch
+ export LOCAL_DEVELOPMENT_BUILD=true
+ # set the correct CPU arch for Makefile
+ export CPU_ARCH=$(uname -m)
+ export AS=$(which yasm)
+ export COMPILE_ASM=$( if [[ "$CPU_ARCH" != "arm64" ]]; then echo true; else echo false; fi )
+ make clean
+ make
+ if [ "$package" = true ]; then
+ make package
+ fi
+ exit 0
+fi
+
+if [ "$local_build" = true ]; then
+ echo "Building VeraCrypt with local wxWidgets support and no universal binary"
+ export LOCAL_DEVELOPMENT_BUILD=true
+fi
+
+# Check the condition of wxBuildConsole and wxWidgets-$WX_VERSION in the original PARENTDIR
+if [ -d "$PARENTDIR/wxBuildConsole" ]; then
+ echo "Using existing PARENTDIR: $PARENTDIR, wxBuildConsole is present."
+elif [ -d "$PARENTDIR/wxWidgets-$WX_VERSION" ]; then
+ echo "Using existing PARENTDIR: $PARENTDIR, wxWidgets-$WX_VERSION is present."
+else
+ # Change PARENTDIR to /tmp and check conditions again
+ export PARENTDIR="/tmp"
+ if [ -d "$PARENTDIR/wxBuildConsole" ]; then
+ echo "Switched to PARENTDIR: /tmp, wxBuildConsole is present in /tmp."
+ elif [ -d "$PARENTDIR/wxWidgets-$WX_VERSION" ]; then
+ echo "Switched to PARENTDIR: /tmp, wxWidgets-$WX_VERSION is present in /tmp."
+ else
+ echo "Error: Neither wxBuildConsole nor wxWidgets-$WX_VERSION found in /tmp. Exiting."
+ exit 1
+ fi
+fi
-# the sources of wxWidgets 3.1.2 must be extracted to the parent directory (for night mode)
-export WX_ROOT=$PARENTDIR/wxWidgets-3.1.2
-echo "Using wxWidgets sources in $WX_ROOT"
+# The sources of wxWidgets $WX_VERSION must be extracted to the parent directory
+export WX_ROOT="$PARENTDIR/wxWidgets-$WX_VERSION"
# this will be the temporary wxWidgets directory
-export WX_BUILD_DIR=$PARENTDIR/wxBuild-3.1.2
+export WX_BUILD_DIR="$PARENTDIR/wxBuild-$WX_VERSION"
-# define the SDK version to use and OSX minimum target. We target 10.9 by default
-export VC_OSX_TARGET=10.9
-export VC_OSX_SDK=11.3
+# define the SDK version to use and OSX minimum target. We target 12 by default
+export VC_OSX_TARGET=12
+export VC_OSX_SDK=$(xcrun --show-sdk-version) #use the latest version installed
echo "Using MacOSX SDK $VC_OSX_SDK with target set to $VC_OSX_TARGET"
-cd $SOURCEPATH
+cd "$SOURCEPATH"
echo "Building VeraCrypt"
-make WXSTATIC=FULL wxbuild && make WXSTATIC=FULL clean && make WXSTATIC=FULL && make WXSTATIC=FULL package
+# Check if wx-config exists in WX_BUILD_DIR
+if [ -L "${WX_BUILD_DIR}/wx-config" ]; then
+ echo "wx-config already exists in ${WX_BUILD_DIR}. Skipping wxbuild."
+else
+ echo "Using wxWidgets sources in $WX_ROOT"
+ make WXSTATIC=FULL wxbuild
+fi
+make WXSTATIC=FULL clean
+make WXSTATIC=FULL
+if [ "$package" = true ]; then
+ make WXSTATIC=FULL package
+fi
-# Uncomment below and comment line above to reuse existing wxWidgets build
-# make WXSTATIC=FULL clean && make WXSTATIC=FULL && make WXSTATIC=FULL package \ No newline at end of file
+echo "VeraCrypt build completed successfully."
diff --git a/src/Build/sign_rpm.sh b/src/Build/sign_rpm.sh
new file mode 100644
index 00000000..9abc041e
--- /dev/null
+++ b/src/Build/sign_rpm.sh
@@ -0,0 +1,54 @@
+#!/bin/bash
+
+# Function to display usage information
+usage() {
+ echo "Usage: $0 <directory>"
+ exit 1
+}
+
+# Check if a directory was provided as an argument
+if [ $# -ne 1 ]; then
+ usage
+fi
+
+DIRECTORY="$1"
+
+# Check if the specified directory exists
+if [ ! -d "$DIRECTORY" ]; then
+ echo "Error: Directory '$DIRECTORY' does not exist."
+ exit 1
+fi
+
+# Check if there are any RPM files in the directory
+shopt -s nullglob # Make the glob return an empty array if no match
+rpm_files=("$DIRECTORY"/*.rpm)
+
+if [ ${#rpm_files[@]} -eq 0 ]; then
+ echo "No RPM files found in directory '$DIRECTORY'."
+ exit 0
+fi
+
+# Iterate over each RPM file in the directory
+for rpm_file in "${rpm_files[@]}"; do
+ echo "Processing $rpm_file..."
+
+ # Remove the existing signature if any
+ echo "Removing existing signature from $rpm_file (if any)..."
+ rpmsign --delsign "$rpm_file" || {
+ echo "Failed to remove signature from $rpm_file."
+ exit 1
+ }
+
+ # Sign the RPM file
+ echo "Signing $rpm_file..."
+ rpmsign --define "_gpg_name veracrypt@idrix.fr" \
+ --define "_gpg_digest_algo sha512" \
+ --define "_source_filedigest_algorithm 10" \
+ --define "_binary_filedigest_algorithm 10" \
+ --addsign "$rpm_file" || {
+ echo "Failed to sign $rpm_file. Aborting."
+ exit 1
+ }
+
+ echo "Successfully signed $rpm_file."
+done