1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-11 02:58:02 -06:00

Improve and simplify macOS builds (#1276)

* Add missing macOS requirement for 'make package'

We need packages for the last build step on macOS, update docs
to reflect the requirement.

* Add build instructions using homebrew

On macOS, we can use a package manager to easily install
dependencies. This simplifies onboarding and building Veracrypt.

* Add flag to use homebrew packages

When building, we can use prebuilt wxwidgets from homebrew to
simplify and speed up local building. We also put the package
behind a flag as it's optional during development.

* Skip signing for local builds

When building with homebrew, skip signing. This can be put behind
a flag to enable, if needed.

* Use system yasm on macOS if available

The binary in the repo is not universal (x86_64) and therefore
building fails on arm architecture if Rosetta is not installed.

Use local yasm if available.

* Build local arch only in development

When building via homebrew and locally, build only the local arch
which skips ASM for arm(Mx) for MacOS. This removes the need to
have rosetta installed for building.

* Fix compilation issue when COMPILE_ASM is undefined

Use a conditional check for COMPILE_ASM not being false instead of true.
This avoids passing the variable to other parts of the build script.

* Set SDK 12 as the minimum requirement and target

Align the requirement to SDK 12 in both the makefile and script,
and update the comment to remove confusion.
I chose to leave this on 12 to be on the side of err and support
as many building platforms as possible, when we can support.

The local script now also sets the target using the local sdk
version. This should improve the local development experience.

* Fix wrong architecture for macOS in x86 builds

We now build only the current arch for local development builds
in macOS. This change also fixes the x86 builds failing.

* Add instructions brew backed macOS local builds

Flags to build a local build using homebrew packages are not
default and require parameter -b to build. We also don't build
packages directly, which requires -p.

* Fix wxwidgets not linking in local x86 macOS development builds

* Clarify build location in the document
This commit is contained in:
Deniz Türkoglu
2024-06-16 18:39:18 +10:00
committed by GitHub
parent 455a4f2176
commit 406a1686f5
5 changed files with 96 additions and 16 deletions

View File

@@ -151,9 +151,24 @@ of the SDK (i.e. 10.15), you can export the environment variable VC_OSX_TARGET:
$ export VC_OSX_TARGET=10.15
For development dependencies management, you can use [homebrew](https://brew.sh).
Before building under MacOSX, pkg-config must be installed if not yet available.
Get it from https://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz and
$ brew install pkg-config yasm wxwidgets
You also need system dependencies
$ brew install --cask macfuse packages
After installating dependencies via brew, you can build a local development build
$ ./src/Build/build_veracrypt_macosx.sh -b
If you want to build the package, you also need to pass `-p` to the build script above. The built
executable will be in `.src/Main`
If you prefer to build from sources, or without homebrew, pkg-config and packages must be installed.
Get pkg-config from https://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz and
compile using the following commands :
$ ./configure --with-internal-glib
@@ -178,7 +193,7 @@ Because of incompatibility issues with OSXFUSE, the SDK 10.9 generates a
VeraCrypt binary that has issues communicating with the OSXFUSE kernel extension.
Thus, we recommend using a different OSX SDK version for building VeraCrypt.
To build the installation package, you will need [packages](http://s.sudre.free.fr/Software/Packages/about.html)
III. FreeBSD
============================