VeraCrypt
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2019-12-21 02:45:08 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2019-12-21 02:46:50 +0100
commitf8beac6ebd00ac8b8e1286a34dfb52ef92d7e89c (patch)
tree302821f96fe5faafb528bf56a3b8765e70ffff85
parentde52f51f5bac0a25df78c071d9038f0232b45ca6 (diff)
downloadVeraCrypt-f8beac6ebd00ac8b8e1286a34dfb52ef92d7e89c.tar.gz
VeraCrypt-f8beac6ebd00ac8b8e1286a34dfb52ef92d7e89c.zip
Linux: Fix building and packaging console-only version to remove dependency on GTK
-rw-r--r--src/Build/CMakeLists.txt47
-rwxr-xr-xsrc/Build/build_cmake_deb.sh17
2 files changed, 41 insertions, 23 deletions
diff --git a/src/Build/CMakeLists.txt b/src/Build/CMakeLists.txt
index f1a176c6..0c602f03 100644
--- a/src/Build/CMakeLists.txt
+++ b/src/Build/CMakeLists.txt
@@ -242,19 +242,24 @@ if ( ( PLATFORM STREQUAL "Debian" ) OR ( PLATFORM STREQUAL "Ubuntu" ) )
242 set( CPACK_DEBIAN_PACKAGE_RELEASE ${CPACK_PACKAGE_RELEASE} ) 242 set( CPACK_DEBIAN_PACKAGE_RELEASE ${CPACK_PACKAGE_RELEASE} )
243 set( CPACK_DEBIAN_PACKAGE_ARCHITECTURE ${ARCHITECTURE} ) # mandatory 243 set( CPACK_DEBIAN_PACKAGE_ARCHITECTURE ${ARCHITECTURE} ) # mandatory
244 244
245 # Link against gtk3 version of wxWidgets if >= Debian 10 or >= Ubuntu 18.04 245 if (NOGUI)
246 # Otherwise, link against gtk2 version of wxWidgets 246 # We build wxWidgets statically so that we don't depend on any GTK library
247 if ( ( ( PLATFORM STREQUAL "Debian" ) AND ( PLATFORM_VERSION VERSION_GREATER_EQUAL "10" ) ) 247 set( CPACK_DEBIAN_PACKAGE_DEPENDS "libfuse2, dmsetup, sudo" )
248 OR ( ( PLATFORM STREQUAL "Ubuntu" ) AND ( PLATFORM_VERSION VERSION_GREATER_EQUAL "18.04" ) ) )
249
250 set( CPACK_DEBIAN_PACKAGE_DEPENDS "libwxgtk3.0-gtk3-0v5, libfuse2, dmsetup, sudo" )
251
252 else () 248 else ()
253 249 # Link against gtk3 version of wxWidgets if >= Debian 10 or >= Ubuntu 18.04
254 set( CPACK_DEBIAN_PACKAGE_DEPENDS "libwxgtk3.0-0v5, libfuse2, dmsetup, sudo" ) 250 # Otherwise, link against gtk2 version of wxWidgets
251 if ( ( ( PLATFORM STREQUAL "Debian" ) AND ( PLATFORM_VERSION VERSION_GREATER_EQUAL "10" ) )
252 OR ( ( PLATFORM STREQUAL "Ubuntu" ) AND ( PLATFORM_VERSION VERSION_GREATER_EQUAL "18.04" ) ) )
253
254 set( CPACK_DEBIAN_PACKAGE_DEPENDS "libwxgtk3.0-gtk3-0v5, libfuse2, dmsetup, sudo" )
255
256 else ()
255 257
258 set( CPACK_DEBIAN_PACKAGE_DEPENDS "libwxgtk3.0-0v5, libfuse2, dmsetup, sudo" )
259
260 endif()
256 endif() 261 endif()
257 262
258 set( CPACK_DEBIAN_PACKAGE_MAINTAINER ${CONTACT} ) # mandatory 263 set( CPACK_DEBIAN_PACKAGE_MAINTAINER ${CONTACT} ) # mandatory
259 set( CPACK_DEBIAN_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION_SUMMARY} ) # mandatory 264 set( CPACK_DEBIAN_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION_SUMMARY} ) # mandatory
260 set( CPACK_DEBIAN_ARCHIVE_TYPE "gnutar") # mandatory 265 set( CPACK_DEBIAN_ARCHIVE_TYPE "gnutar") # mandatory
@@ -284,19 +289,23 @@ elseif ( ( PLATFORM STREQUAL "CentOS" ) OR ( PLATFORM STREQUAL "openSUSE" ) )
284 set( CPACK_RPM_PACKAGE_VENDOR ${CPACK_PACKAGE_VENDOR} ) # mandatory 289 set( CPACK_RPM_PACKAGE_VENDOR ${CPACK_PACKAGE_VENDOR} ) # mandatory
285 set( CPACK_RPM_PACKAGE_AUTOREQ "no" ) # disable automatic shared libraries dependency detection (most of the time buggy) 290 set( CPACK_RPM_PACKAGE_AUTOREQ "no" ) # disable automatic shared libraries dependency detection (most of the time buggy)
286 291
287 if ( PLATFORM STREQUAL "CentOS" ) 292 if (NOGUI)
293 set( CPACK_RPM_PACKAGE_REQUIRES "fuse, device-mapper, sudo" )
294 else ()
295 if ( PLATFORM STREQUAL "CentOS" )
296
297 if ( DEFINED WITHGTK3 AND WITHGTK3 )
298 set( CPACK_RPM_PACKAGE_REQUIRES "fuse, device-mapper, gtk3, sudo" )
299 else ()
300 set( CPACK_RPM_PACKAGE_REQUIRES "fuse, device-mapper, gtk2, sudo" )
301 endif()
302
303 elseif ( PLATFORM STREQUAL "openSUSE" )
288 304
289 if ( DEFINED WITHGTK3 AND WITHGTK3 )
290 set( CPACK_RPM_PACKAGE_REQUIRES "fuse, device-mapper, gtk3, sudo" )
291 else ()
292 set( CPACK_RPM_PACKAGE_REQUIRES "fuse, device-mapper, gtk2, sudo" ) 305 set( CPACK_RPM_PACKAGE_REQUIRES "fuse, device-mapper, gtk2, sudo" )
293 endif() 306 endif()
294
295 elseif ( PLATFORM STREQUAL "openSUSE" )
296
297 set( CPACK_RPM_PACKAGE_REQUIRES "fuse, device-mapper, gtk2, sudo" )
298 endif() 307 endif()
299 308
300 set( CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE ${RPM_PRERM}) # optional 309 set( CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE ${RPM_PRERM}) # optional
301 310
302 # Prevents CPack from generating file conflicts 311 # Prevents CPack from generating file conflicts
diff --git a/src/Build/build_cmake_deb.sh b/src/Build/build_cmake_deb.sh
index 3be23dda..7b546fdd 100755
--- a/src/Build/build_cmake_deb.sh
+++ b/src/Build/build_cmake_deb.sh
@@ -19,15 +19,24 @@ make clean || exit 1
19make || exit 1 19make || exit 1
20make install DESTDIR="$PARENTDIR/VeraCrypt_Setup/GUI" || exit 1 20make install DESTDIR="$PARENTDIR/VeraCrypt_Setup/GUI" || exit 1
21 21
22echo "Building console version of VeraCrypt for DEB using system wxWidgets" 22echo "Building console version of VeraCrypt for DEB using wxWidgets static libraries"
23 23
24# This is to avoid " Error: Unable to initialize GTK+, is DISPLAY set properly?" 24# This is to avoid " Error: Unable to initialize GTK+, is DISPLAY set properly?"
25# when building over SSH without X11 Forwarding 25# when building over SSH without X11 Forwarding
26# export DISPLAY=:0.0 26# export DISPLAY=:0.0
27 27
28make NOGUI=1 clean || exit 1 28# The sources of wxWidgets 3.0.4 must be extracted to the parent directory
29make NOGUI=1 || exit 1 29export WX_ROOT=$PARENTDIR/wxWidgets-3.0.4
30make NOGUI=1 install DESTDIR="$PARENTDIR/VeraCrypt_Setup/Console" || exit 1 30echo "Using wxWidgets sources in $WX_ROOT"
31
32# This will be the temporary wxWidgets directory
33export WX_BUILD_DIR=$PARENTDIR/wxBuildConsole
34
35# To build wxWidgets without GUI
36make WXSTATIC=1 NOGUI=1 wxbuild || exit 1
37make WXSTATIC=1 NOGUI=1 clean || exit 1
38make WXSTATIC=1 NOGUI=1 || exit 1
39make WXSTATIC=1 NOGUI=1 install DESTDIR="$PARENTDIR/VeraCrypt_Setup/Console" || exit 1
31 40
32echo "Creating VeraCrypt DEB packages" 41echo "Creating VeraCrypt DEB packages"
33 42