Compile and build PeaZip from sources
Download PeaZip free archiver sources
PeaZip free
archiver sources are released under GNU LGPL
v3 Open Source license, and are avilable as:
- Git repository on GitHub
- standalone, downloadable ZIP package containing source files
PeaZip is written in FreePascal
, a
powerful Open Source
cross-platform programming language highly
compatible with Delphi and ObjectPascal, and Lazarus
IDE is
required to
compile, build, and edit the source code.
Lazarus/FPC supports many more platforms
(architectures and Operating Systems) than the ones PeaZip is
built/tested for, following the "Write
once, compile anywhere"
(WOCA)
philosophy.
While PeaZip sources contains ASM sections, a Pure Pascal alternative
implementation is always available to allow porting to new
architectures.
Lazarus/FPC also supports multiple widgetsets (Win32/64, WinCE, GTK1, GTK2, Qt4/5, Carbon, Cocoa, fpGUI) to allow compilation of GUI applications for the various supported systems (BSD, Darwin, Linux, macOS, Windows/ReactOS) and to create different “flavours” of the application for platforms supporting multiple widgetsets, e.g. Linux.
In PeaZip's sourcecode platform-specific, OS-specific, and architecture-specific code sections are contained in conditional compilations blocks.
Portable and installable packages shares the same code base, PeaZip is
natively an auto contained application as Lazarus tries to statically
link the binaries containing all the dependencies (or as much as
possible); only the packaging changes between the versions.
Windows setup
scripts (.iss files) are written using InnoSetup, which also uses a
Delphi-like syntax and are easily understandable for developers
proficient in Delphi or ObjectPascal dialects.
Please note that PeaZip provides strong cryptographic functions, so please refer to cryptography laws and regulations that may apply in your country.
Quick
start to compile PeaZip and build
a distributable package
Source package contains "dev" subdirectory containing sources to compile the application's binaries, "res" subdirectory containing resources needed by the application, and a readme.txt file containing instructions to compile peazip and build a distributable package, either as Portable application and for many different package management systems.
- Download and install Lazarus IDE
for your
OS / architecture platform. In case of troubles installing
Lazarus, its forum
is an
excellent starting point for obtaining support from a friendly
and competent community of developers using Lazarus / FreePascal. - Add (peazip
sources)/dev/metadarkstyle/metadarkstyle.lpk
Lazarus package to the project - otherwise it will be asked later
by the IDE, reporting missing package error, when trying to compile
peazip or pea binaries
- Compile sources in "dev" subdirectory, see below "Notes for developers" section for details about manual and automated compiling.
- Compiled binaries must be moved up one level, into package's root folder (where readme.txt file is); now dev subdir is no longer needed.
- Find appropriate builds of third party binaries for the intended target OS and architecture, and copy them into (peazip)/res/bin/ subfolders: please note that "res" folder provided in source package (as template for creating a working PeaZip port / distributable package) contains only non- OS / architecture -dependant resources, so res/bin is simply a placeholder, not containing actual binaries but rather only the directories the binaries need to be copied in.
- Zip the package to use / distribute it as a portable
application, or
- Read further suggestions below in "Notes for
developers" section to create an installable
package for your intended OS target
Quick suggestion about the Lazarus IDEOn Linux and BSD, download and install FreePascal sources, FreePascal compiler, and Lazarus IDE packages from the Lazarus repository.
Lazarus currently uses GTK2 widget set by default on Linux, but it is possible to target other widget sets (and arcihtectures, in Project > Project Options, Configuration and Target),in example:
- Qt6
requires installation of Qt bindings

- GTK3 (currently in alpha stage) requires GTK3 development library, e.g. in Ubuntu use sudo apt-get install libgtk-3-dev
On macOS, download and install
FreePascal sources, FreePascal
compiler, and Lazarus IDE packages from the Lazarus
repository.
You will also need to install Apple's Xcode
, and to
separately install standalone Xcode
Command Line Tools, using the command:
sudo xcode-select --install
Note: after updating macOS to a new release it is likely you need to
also update Xcode and Xcode Command line Tools.
Lazarus currently uses Cocoa as
default widget set on macOS.
Binaries compiled for x84_64
architecture will run both on old Intel and newer
Apple Silicon (M1, M2...) Macs.
To change target architecture open main menu, Project >
Project Options,
Configuration and Target, e.g. set Darwin
as
destination OS, and aarch64 as
destination CPU family.
Please note macOS will
ask
for permission to run to (or to access some paths) the first time you
are running an unsigned binary.
Please refer to Lazarus' macOS
programming tips
for
subjects as creation of universal
binaries, code signing
and notarization, and to
create a macOS application bundle
(in which PeaZip for macOS packages may be used as example).
Lazarus IDE supports many different widgetsets (as Cocoa, GTK2, GTK3,
Qt6, Win32) in
various stage of development/supprt, please refer to Widgetsets Wiki
page
for more
information.
Following table summarize the status of PeaZip project on different operating systems, architectures, widget sets, and package management systems: any help is deeply appreciated to port PeaZip to new platforms!
| Operating
System |
Archirecture |
Widgetset |
Status |
| Linux |
arm,
i386 |
GTK,
GTK2, Qt4 |
legacy, available from third party, see links in Linux download sections |
| Linux |
x86_64 |
GTK2,
Qt6, GTK3 |
released as portable and installable DEB and RPM packages, Qt6 Flatpak available on Flathub (linked on download page). GTK3 version is ALPHA and it is meant for evaluation and debugging (Lazarus/FPC support is marked as alpha for GTK3) |
| Linux |
aarch64 |
GTK2,
Qt6 |
released
as portable GTK2 package, also available
as Qt6 Flatpak on Flathub (linked on download page) |
| BSD |
x86_64 | GTK2 |
released
as portable package, alternatives are available from third party linked
on BSD download page |
| macOS |
x86_64 |
Cocoa |
released
as ZIP and installable DMG package, can also be used as portable app,
run on
Intel and Apple Silicon machines |
| macOS |
aarch64 |
Cocoa |
released
as installable DMG package, can also be used as portable app, run on
Apple Silicon machines only |
| Windows |
i386 |
Win32 |
released
as portable and as installable EXE packages, recommended for legacy machines only |
| Windows
64 bit |
x86_64 |
Win32 |
released
as portable and as installable EXE, and as MSIX package (not published
in MS Store) |
Notes for developers
HOW TO COMPILE AND BUILD PEAZIP APP BINARIES
MANUALLY, FROM LAZARUS IDE GUI
Open .lpi project files in Lazarus IDE and use main menu Run > Build all to compile and build the binaries:
- add /dev/metadarkstyle//metadarkstyle.lpk Lazarus
package to the project, otherwise the IDE will ask later, notifying the
missing lpk
- project_peach.lpi builds peazip, the main app executable, file and archive manager
- project_pea.lpi builds pea, to manage pea archives, and to
provide file management, encryption
(AES, Serpent, Twofish),
and hashing / checksum
routines (Whirlpool, SHA / SHA2 / SHA3, BLAKE2, Ripemd160, MD5, various
CRCs)
AUTOMATICALLY, FROM COMMAND LINE OR SCRIPT
Replace
lazbuild string in following examples with the full qualified
path to lazbuild binary if needed - e.g. on Windows it is usually
C:\lazarus\lazbuild.exe.
Replace (peazip sources) with the full qualified path of PeaZip
source's
directory.
Run:
- lazbuild --add-package (peazip sources)/dev/metadarkstyle/metadarkstyle.lpk
- lazbuild --add-package (peazip sources)\dev\dragdropfilesdll\DragDropLazarus.lpk //only needed to build dragdropfilesdll.dll for Windows systems
- lazbuild (peazip sources)/project_peach.lpi
- lazbuild (peazip sources)/project_pea.lpi
- lazbuild (peazip sources)\dev\dragdropfilesdll\dragdropfilesdll.lpi //only needed to build dragdropfilesdll.dll for Windows systems
In example, lazbuild --widgetset=qt6 project_peach.lpi will compile peazip binary for Qt6 libraries, if available to Lazarus IDE.COMPILE TIME PEAZIP OPTIONS
From main menu, Options > Settings, Advanced tab it is possible to
set PeaZip to NOT use non-free
software or archive formats.
This behavior can be hardcoded setting HLIBRE_DIR constant in peazip
(project_peach.lpi) at compile time:
0 not hardcoded, read from configuration;
1 hardcoded to allow only using known Free Software components
2 hardcoded to allow only using known Free Software components and
known open archive formats (not encumbered by patents for read nor
write)
It is now possible to hardcode paths
of backend binaries, configuration, and resources at compile
time in order to met specific FHS or security requirements - e.g.
allowing paths only writeable with admin / root privileges.
Those paths are defined by HBINPATH, HCONFPATH, and
HSHAREPATH constants.
It is now possible to define at compile time a list of known SHA256 hash values for known binaries invoked by PeaZip, in function "checkhash" in peach.pas source file. This list can be checked on demand to detect non-matching values, and in this case inform user that some binaries are unknown.
HOW TO ASSEMBLE PEAZIP APP PACKAGES
NAMING
PeaZip project packages follows this naming convention: name-version.architecture
DEB packages are an exception to this rule, following Debian naming convention: name_version_architecture
"name" states the pakage (i.e. PeaZip, PeaZip Portable, sources...)
"version" field starts with version number x.y.z, then states target OS (LINUX, WINDOWS, WIN64); on Linux systems is then declared the target widgetset (i.e. GKT2, Qt6), and finally the release number (usually -1).
"architecture" on Linux declare target architecture (on Debian amd64 is used in place of x86_64) and is omitted on Windows.
PORTABLE PACKAGES
PeaZip
Portable should be built compressing a directory here referred
as (peazip), containing:
- pea and peazip binaries compiled for the target
system (and dragdropfilesdll.dll on Windows) in root directory of the
app
- (peazip)/res directory which contains resources divided by type
- (peazip)/res/portable empty file marking the package as portable
- (peazip)/res/bin directory containing architecture dependent binaries, that should be compiled by respective third party sources for the target system: refer to THIRD PARTIES section below, or refer to the content of an existing package
- (peazip)/res/share directory containing non-architecture dependent data such as texts, sample scripts, media, documentation: refer to DETAILS ABOUT RES/SHARE section for further information
- (peazip)/res/conf directory containing configuration files, and user-created custom scripts, compression settings, archive layouts
- For details on content of each res subpath plesase refer to (peazip sources)/res, and possibly to an existing up to date Portable package.
Installer packages can be built starting from portable package:
- Remove (peazip)/res/portable file, in this way the application will write configuration file to appropriate user specific directory for the known systems, $XDG_CONFIG_HOME/peazip or $HOME/.config/peazip for non_Windows systems following Open Deskptop standard.
- Take care to place resources in proper paths depending on the filesystem standards of the target system, e.g. (peazip)/res/bin and (peazip)/res/share should be replaced to links to pointing to (proper path)/peazip directory created in proper branches of the filesystem for the type of resources.
- In example, in current Linux packages, (peazip) is written to /usr/lib/peazip, with (peazip)/res/bin being /usr/lib/peazip/res/bin directory, and (peazip)/res/share being a link to /usr/share/peazip directory.
- This mechanism can be used, on systems not supporting Open Desktop standards, also to redirect configuraton folder, letting (peazip)/res/portable file, which tells the application to write configuration to (peazip)/res/conf which will be, in this case, replaced by a link.
- (required for Windows packages only), place "Configure peazip.exe" compiled from InnoSetup script peazip-setup_script_WIN*-configure.iss in (peazip)/res/bin directory
At its core, PeaZip is simply a standalone, as autocontained as possible application (just as the Portable versions, which shares the same code base) which is told to save the configuration in system-specific user's path, and a set of scripts (mostly collected in (peazip)/res/share/batch path, e.g. OpenDesktop .desktop files) which instructs the host system on how to pass input and parameters to PeaZip.
"Packages examples" package peazip-x.y.z.pack.zip
provides examples of
the directory structures used to create DEB and RPM packages for the
current release, in order to help developers in assembling packages for
distribution with different package managers.
It is not needed to compile sources, it is only meant as additional
help to assemble packages.
(peazip)/res/share directory, containing non-architecture dependent
resources, can be used "as is" on all systems and types of packages.
If desired, system dependent resources can be omitted to reduce the
size of the package, i.e. in non-Windows packages it can be safely
removed sample .bat and .reg files, being of no use.
This directory should contain (or link to) peazip_help.pdf in its root
in order to provide offline help to users.
(peazip)/res/share/batch subfolder contains sample scripts to use PeaZip from command line, .desktop files, SendTo examples for Windows, and freedesktop_integration subpath which contains files for integration in desktop environments compliant with freedesktop standars (i.e. Gnome, KDE, and other common Linux DE)
(peazip)/res/share/copying contains copying.txt (the license file for PeaZip project sources, released under LGPLv3) and third-parties directory containing thir party licenses.
(peazip)/res/share/icons (required on Windows only) contains Windows icons; .png icons for non-Windows systems are available in batch/freedesktop_integration forlder
(peazip)/res/share/lang path contains translations of application's text, most of which are contributed by third parties translators
(peazip)/res/share/lang-wincontext (required on Windows only) path contains .reg files to localize app's context menus in Windows
(peazip)/res/share/presets contains preset files for PeaZip defining custom compression settings. Those files are editable, but user-defined custom compression settings should be saved in configuration directory consistently with PeaZip's behavior
(peazip)/res/share/readme files contains a minimal system-dependent explanation about the application, for Windows and Linux users
(peazip)/res/share/themes path contains themes for PeaZip project; themes are .7z files (with .theme suffix before .7z extension) containing graphic resources and the theme file, an UTF-8 with BOM file containing theming options
THIRD PARTIES TECHNOLOGIES
The units of crypto and math utilities library used in PeaZip are
derived from Wolfgang Ehrhardt's crypto library (originally
aes_2017-11-17.zip, crc_hash_2018-01-01.zip, fca_2017-11-17.zip,
serpent_2017-11-17.zip, tf_2017-11-17.zip, and util_2018-11-27.zip
libraries), released under Zlib license by Wolfgang Ehrhardt.
Libraries are kept up to date, in example were patched to allow build
on aarch64 architecture.
7z (LGPL), p7zip (LGPL), 7-Zip-zstd codecs (LGPL), Brotli (MIT License), Zstandard (Dual license BSD / GPLv2), ARC (GPL), ZPAQ/LPAQ/PAQ8* (GPL), QUAD (LGPL) / BALZ (public domain) / BCM (Apache v2), strip and UPX (GPL) binaries are needed to support mainstream file formats.
Those binaries are not included in source package (but are included in the program's precompiled packages) and are intellectual property of respective Authors.
Up to date links to aforementioned projects are:
- https://www.7-zip.org/download.html
7-Zip's 7z
(Windows, Linux, and macOS), should be placed in (peazip)/res/bin/7z,
to manage 7Z files and most of
the other supported formats (including ISO, RAR, TAR, WIM, ZIP formats)
- http://p7zip.sourceforge.net/
vanilla p7zip, can be
placed as alternative to 7z in (peazip)/res/bin/7z - https://github.com/cielavenir/p7zip
(Linux, macOS) p7zip fork with
extra algorithms for .7Z format (Brotli, FLZMA, Lizard, LZ4, LZ5,
Zstd), placed in (peazip)/res/bin/7z/, can be used instead of vanilla
7z by setting "7z / p7zip alias" to "7zalt" in Options > Settings,
Advanced tab
- https://github.com/mcmilk/7-Zip-zstd
(Windows) extra algorithms for .7Z format, available as separate codecs
for vanilla 7z binary which are placed in (peazip)/res/bin/7z/Codecs - http://freearc.sourceforge.net/
FreeArc
, should be
placed in (peazip)/res/bin/arc to manage
ARC files
- https://github.com/google/brotli
Google's Brotli
compressor, should be placed in (peazip)/res/bin/brotli to manage Brotli compressed files
- http://mattmahoney.net/dc/
*PAQ, should be placed in
(peazip)/res/bin/lpaq, /paq, and /zpaq to work with PAQ files
family
- https://github.com/encode84/bcm
, http://www.encode.su/
, http://sourceforge.net/projects/bcm/
Ilia
Muraviev's QUAD/BALZ/BCM, should be placed in (peazip)/res/bin/quad - https://www.gnu.org/software/binutils/
strip (needed
only on Windows), should be placed in (peazip)/res/bin/upx - https://upx.github.io/
UPX, should be placed in
(peazip)/res/bin/upx - https://facebook.github.io/zstd/
Facebook's Zstandard
compressor, should be placed in (peazip)/res/bin/zstd to work with Zstandard
compressed files - https://github.com/zamtmn/metadarkstyle
zamtmn's Lazarus package adding support for Windows 10+ dark mode
PeaZip can also support other binaries, which MUST NOT be included in base packages due their closed source nature: official PeaZip packages only contain software released under OSI-approved licenses.
- WinAce UnACE (royalty free), to work with ACE files, can be supported as back-end binary if placed in (peazip)/res/bin/unace, but must not be included in packages because non-free license.
- RarLab UnRar (royalty free) can be supported as back-end binary if placed in (peazip)/res/bin/unrar as alternative rar files extractor tool, but must not be included in packages because non-free license.
- RarLab Rar.exe (shareware) can be supported as back-end binary if installed on the same system (PeaZip can auto-configure itself to use it to create RAR archives), but must not included in packages because it is non-free software AND has non royalty free license.
Synopsis: Download page
of PeaZip sources (LGPLv3). Compile and build the application from
source code with Lazarus/FPC, help porting PeaZip to new Operating
Systems
and architectures, package PeaZip binaries for more installers types
and package managers systems. How to assemble Portable version and
installable packages.
Topics: PeaZip source
packages, code base Git repository, how to create portable or
installable packages for PeaZip
PeaZip > Downloads > Compile and buid PeaZip from sources
| RECOMMENDED PAGES | PEAZIP FILE MANAGER GUI |
PORTABLE FILE ARCHIVER |
FREE ZIP ARCHIVER | TAR FILES UTILITY |
| MACOS ZIP FILES UTILITY |
OPEN ENCRYPTED FILES |
CREATE PEAZIP CLI SCRIPTS | OPEN 7Z RAR TAR ZIP ARCHIVES | FREE RAR |