Skip to content

Commit

Permalink
app-crypt/veracrypt: initial commit with version 1.19
Browse files Browse the repository at this point in the history
Veracrypt is a platform independent filesystem or container encryptor
derived from truecrypt.
  • Loading branch information
soredake authored and gktrk committed Dec 22, 2016
1 parent 2e60672 commit 4702d71
Show file tree
Hide file tree
Showing 8 changed files with 363 additions and 0 deletions.
1 change: 1 addition & 0 deletions app-crypt/veracrypt/Manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DIST VeraCrypt_1.19.tar.gz 23235780 SHA256 7d3fa5007b8e9dc93691c2da78dee497954b0596763a50e21724ec0564eb761b SHA512 ebce681099e04d938ff0dc10a1af848c82dafd80b165b2431ec355d64e29be4e60d1d63f0d5c9fd1182394080d00f0f573e3ae90f3e2167533dea2b895bd0164 WHIRLPOOL 7a1968e29a6f2757c2d7a1187e9e062872ffd26721b27b3df791cbe8c82c18dc98d42d249725f8bc4fd721fe80eb7dbe4642dde26f89ad0c0f84803c1f06a439
60 changes: 60 additions & 0 deletions app-crypt/veracrypt/files/veracrypt-1.19-execstack-fix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
--- src/Crypto/Aes_hw_cpu.asm.old
+++ src/Crypto/Aes_hw_cpu.asm
@@ -328,3 +328,12 @@


%endif ; __BITS__ != 16
+ %ifidn __OUTPUT_FORMAT__,elf
+ section .note.GNU-stack noalloc noexec nowrite progbits
+ %endif
+ %ifidn __OUTPUT_FORMAT__,elf32
+ section .note.GNU-stack noalloc noexec nowrite progbits
+ %endif
+ %ifidn __OUTPUT_FORMAT__,elf64
+ section .note.GNU-stack noalloc noexec nowrite progbits
+ %endif
--- src/Crypto/AesSmall_x86.asm.old
+++ src/Crypto/AesSmall_x86.asm
@@ -1442,3 +1442,12 @@
db v8(0xe1),v8(0x69),v8(0x14),v8(0x63),v8(0x55),v8(0x21),v8(0x0c),v8(0x7d)

%endif
+ %ifidn __OUTPUT_FORMAT__,elf
+ section .note.GNU-stack noalloc noexec nowrite progbits
+ %endif
+ %ifidn __OUTPUT_FORMAT__,elf32
+ section .note.GNU-stack noalloc noexec nowrite progbits
+ %endif
+ %ifidn __OUTPUT_FORMAT__,elf64
+ section .note.GNU-stack noalloc noexec nowrite progbits
+ %endif
--- src/Crypto/Aes_x64.asm.old
+++ src/Crypto/Aes_x64.asm
@@ -905,3 +905,12 @@
%endif

%endif
+ %ifidn __OUTPUT_FORMAT__,elf
+ section .note.GNU-stack noalloc noexec nowrite progbits
+ %endif
+ %ifidn __OUTPUT_FORMAT__,elf32
+ section .note.GNU-stack noalloc noexec nowrite progbits
+ %endif
+ %ifidn __OUTPUT_FORMAT__,elf64
+ section .note.GNU-stack noalloc noexec nowrite progbits
+ %endif
--- src/Crypto/Aes_x86.asm.old
+++ src/Crypto/Aes_x86.asm
@@ -644,3 +644,12 @@
do_exit

%endif
+ %ifidn __OUTPUT_FORMAT__,elf
+ section .note.GNU-stack noalloc noexec nowrite progbits
+ %endif
+ %ifidn __OUTPUT_FORMAT__,elf32
+ section .note.GNU-stack noalloc noexec nowrite progbits
+ %endif
+ %ifidn __OUTPUT_FORMAT__,elf64
+ section .note.GNU-stack noalloc noexec nowrite progbits
+ %endif
26 changes: 26 additions & 0 deletions app-crypt/veracrypt/files/veracrypt-1.19-makefile-archdetect.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
From 181857089b11045c701e9195275a408430beb580 Mon Sep 17 00:00:00 2001
From: Mounir IDRASSI <[email protected]>
Date: Sat, 5 Nov 2016 23:39:46 +0100
Subject: [PATCH] Linux: Always use "uname -m" to determine processor type.
This fixes Slackware build issue.

---
src/Makefile | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/Makefile b/src/Makefile
index 7bfc5ad..00e6e5b 100644
--- src/Makefile
+++ src/Makefile
@@ -131,10 +131,7 @@ export PLATFORM_UNSUPPORTED := 0
export CPU_ARCH ?= unknown
export SIMD_SUPPORTED := 0

-ARCH = $(shell uname -p)
-ifeq "$(ARCH)" "unknown"
- ARCH = $(shell uname -m)
-endif
+ARCH = $(shell uname -m)

ifneq (,$(filter i386 i486 i586 i686 x86,$(ARCH)))
CPU_ARCH = x86
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
--- src/Main/Main.make.orig
+++ src/Main/Main.make
@@ -190,49 +190,6 @@
rm -fr "$(PWD)/Setup/MacOSX/VeraCrypt_dmg"
endif

-
-
-ifeq "$(PLATFORM)" "Linux"
-ifeq "$(TC_BUILD_CONFIG)" "Release"
- mkdir -p $(PWD)/Setup/Linux/usr/bin
- mkdir -p $(PWD)/Setup/Linux/usr/share/$(APPNAME)/doc
- cp $(PWD)/Main/$(APPNAME) $(PWD)/Setup/Linux/usr/bin/$(APPNAME)
- cp $(PWD)/Setup/Linux/$(APPNAME)-uninstall.sh $(PWD)/Setup/Linux/usr/bin/$(APPNAME)-uninstall.sh
- chmod +x $(PWD)/Setup/Linux/usr/bin/$(APPNAME)-uninstall.sh
- cp $(PWD)/License.txt $(PWD)/Setup/Linux/usr/share/$(APPNAME)/doc/License.txt
- cp "$(PWD)/Release/Setup Files/VeraCrypt User Guide.pdf" "$(PWD)/Setup/Linux/usr/share/$(APPNAME)/doc/VeraCrypt User Guide.pdf"
-
-ifndef TC_NO_GUI
- mkdir -p $(PWD)/Setup/Linux/usr/share/applications
- mkdir -p $(PWD)/Setup/Linux/usr/share/pixmaps
- cp $(PWD)/Resources/Icons/VeraCrypt-256x256.xpm $(PWD)/Setup/Linux/usr/share/pixmaps/$(APPNAME).xpm
- cp $(PWD)/Setup/Linux/$(APPNAME).desktop $(PWD)/Setup/Linux/usr/share/applications/$(APPNAME).desktop
-endif
-
-
- tar cfz $(PWD)/Setup/Linux/$(PACKAGE_NAME) --directory $(PWD)/Setup/Linux usr
-
- @rm -fr $(INTERNAL_INSTALLER_NAME)
- @echo "#!/bin/sh" > $(INTERNAL_INSTALLER_NAME)
- @echo "VERSION=$(TC_VERSION)" >> $(INTERNAL_INSTALLER_NAME)
- @echo "PACKAGE_TYPE=tar" >> $(INTERNAL_INSTALLER_NAME)
- @echo "PACKAGE_NAME=$(PACKAGE_NAME)" >> $(INTERNAL_INSTALLER_NAME)
- @echo "PACKAGE_START=1107" >> $(INTERNAL_INSTALLER_NAME)
- @echo "INSTALLER_TYPE=$(INSTALLER_TYPE)" >> $(INTERNAL_INSTALLER_NAME)
-
- @cat $(PWD)/Setup/Linux/veracrypt_install_template.sh >> $(INTERNAL_INSTALLER_NAME)
- @cat $(PWD)/Setup/Linux/$(PACKAGE_NAME) >> $(INTERNAL_INSTALLER_NAME)
- chmod +x $(INTERNAL_INSTALLER_NAME)
-
- rm -fr $(PWD)/Setup/Linux/packaging
- mkdir -p $(PWD)/Setup/Linux/packaging
- cp $(INTERNAL_INSTALLER_NAME) $(PWD)/Setup/Linux/packaging/.
- makeself $(PWD)/Setup/Linux/packaging $(PWD)/Setup/Linux/$(INSTALLER_NAME) "VeraCrypt $(TC_VERSION) Installer" ./$(INTERNAL_INSTALLER_NAME)
-
-endif
-
-endif
-
$(OBJS): $(PCH)

Resources.o: $(RESOURCES)
17 changes: 17 additions & 0 deletions app-crypt/veracrypt/files/veracrypt.init
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/sbin/openrc-run
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

depend() {
after localmount
need device-mapper
}

stop() {
# Try to remove any dm-crypt mappings
if [ -x /usr/bin/veracrypt ]; then
ebegin "Removing veracrypt mappings"
! /usr/bin/veracrypt -l > /dev/null 2>&1 || /usr/bin/veracrypt -d
eend $?
fi
}
26 changes: 26 additions & 0 deletions app-crypt/veracrypt/metadata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<longdescription>
Platform independent filesystem or container encryptor
derived from truecrypt
</longdescription>
<use>
<flag name="asm">Enable assembly for optimization</flag>
</use>
<maintainer type="person">
<email>[email protected]</email>
<name>soredake</name>
</maintainer>
<maintainer type="person">
<email>[email protected]</email>
<name>Göktürk Yüksek</name>
</maintainer>
<maintainer type="project">
<email>[email protected]</email>
<name>Proxy Maintainers</name>
</maintainer>
<upstream>
<remote-id type="github">veracrypt/VeraCrypt</remote-id>
</upstream>
</pkgmetadata>
89 changes: 89 additions & 0 deletions app-crypt/veracrypt/veracrypt-1.19.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=6
inherit eutils linux-info pax-utils toolchain-funcs wxwidgets

DESCRIPTION="Disk encryption with strong security based on TrueCrypt"
HOMEPAGE="https://veracrypt.codeplex.com"
SRC_URI="https://github.com/veracrypt/VeraCrypt/archive/VeraCrypt_${PV}.tar.gz"

LICENSE="Apache-2.0 truecrypt-3.0"
SLOT="0"
KEYWORDS="~amd64"
IUSE="X +asm"
RESTRICT="mirror bindist"

WX_GTK_VER="3.0"

RDEPEND="
sys-fs/lvm2
sys-fs/fuse
x11-libs/wxGTK:${WX_GTK_VER}[X?]
app-admin/sudo
dev-libs/pkcs11-helper
"
DEPEND="
${RDEPEND}
virtual/pkgconfig
asm? ( dev-lang/nasm )
"

S="${WORKDIR}/VeraCrypt-VeraCrypt_${PV}/src"

pkg_setup() {
local CONFIG_CHECK="~BLK_DEV_DM ~DM_CRYPT ~FUSE_FS ~CRYPTO ~CRYPTO_XTS"
linux-info_pkg_setup

setup-wxwidgets
}

PATCHES=(
# TODO: remove in >=1.20
"${FILESDIR}/${P}-makefile-archdetect.patch"
"${FILESDIR}/${P}-execstack-fix.patch"
"${FILESDIR}/${P}-remove-packaging-from-makefile.patch"
)

src_compile() {
local myemakeargs=(
NOSTRIP=1
NOTEST=1
VERBOSE=1
CC="$(tc-getCC)"
CXX="$(tc-getCXX)"
AR="$(tc-getAR)"
RANLIB="$(tc-getRANLIB)"
TC_EXTRA_CFLAGS="${CFLAGS}"
TC_EXTRA_CXXFLAGS="${CXXFLAGS}"
TC_EXTRA_LFLAGS="${LDFLAGS}"
WX_CONFIG="${WX_CONFIG}"
)
use X || myemakeargs+=( NOGUI=1 )
use asm || myemakeargs+=( NOASM=1 )

emake "${myemakeargs[@]}"
}

src_test() {
"${S}/Main/veracrypt" --text --test || die "tests failed"
}

src_install() {
dobin Main/veracrypt
dodoc Readme.txt "Release/Setup Files/VeraCrypt User Guide.pdf"
newinitd "${FILESDIR}/${PN}.init" ${PN}

if use X; then
newicon Resources/Icons/VeraCrypt-48x48.xpm veracrypt.xpm
make_desktop_entry ${PN} "VeraCrypt" ${PN} "System"
fi

pax-mark -m "${D%/}/usr/bin/veracrypt"
}

pkg_postinst() {
ewarn "VeraCrypt has a very restrictive license. Please be explicitly aware"
ewarn "of the limitations on redistribution of binaries or modified source."
}
Loading

0 comments on commit 4702d71

Please sign in to comment.