Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build error Crypto/Whirpool.c AS2 unknown token in expression #126

Closed
cederom opened this issue Jan 7, 2017 · 6 comments
Closed

Build error Crypto/Whirpool.c AS2 unknown token in expression #126

cederom opened this issue Jan 7, 2017 · 6 comments

Comments

@cederom
Copy link

cederom commented Jan 7, 2017

Hello!

I have this error while building VeraCrypt.. any hints velcome. FUSE support is now good in FreeBSD so I would like to make a port of VeraCrypt.. also I need this to work :-)

% uname -a
FreeBSD hyperbook 11.0-RELEASE-p2 FreeBSD 11.0-RELEASE-p2 #0: Mon Oct 24 06:55:27 UTC 2016     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64

% gmake -version
GNU Make 4.2.1
Built for amd64-portbld-freebsd11.0
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

% gcc --version
gcc (FreeBSD Ports Collection) 4.9.4
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

 % as -version
GNU assembler 2.17.50 [FreeBSD] 2007-07-03
Copyright 2007 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License.  This program has absolutely no warranty.
This assembler was configured for a target of `x86_64-unknown-freebsd'.

% nasm -version
NASM version 2.11.08 compiled on Dec 24 2016

% gmake
Compiling Whirlpool.c
../Crypto/Whirlpool.c:673:3: error: unknown token in expression
                AS2(    movq    [SSE2_workspace+8*WORD_REG(si)], mm0)           // k
                ^
/mnt/DATA/WORK/LAB/VeraCrypt/VeraCrypt.git/src/Crypto/cpu.h:265:23: note: expanded from macro 'AS2'
    #define AS2(x, y) GNU_AS2(x, y)
                      ^
/mnt/DATA/WORK/LAB/VeraCrypt/VeraCrypt.git/src/Crypto/cpu.h:260:27: note: expanded from macro 'GNU_AS2'
    #define GNU_AS2(x, y) #x ", " #y ";" NEW_LINE
                          ^
<scratch space>:136:2: note: expanded from here
"movq [%3+8*rsi]"
 ^
<inline asm>:6:7: note: instantiated into assembly here
movq [%r8+8*rsi], mm0;
      ^
../Crypto/Whirlpool.c:675:3: error: unknown token in expression
                AS2(    movq    [SSE2_workspace+64+8*WORD_REG(si)], mm0)        // s
                ^
/mnt/DATA/WORK/LAB/VeraCrypt/VeraCrypt.git/src/Crypto/cpu.h:265:23: note: expanded from macro 'AS2'
    #define AS2(x, y) GNU_AS2(x, y)
                      ^
/mnt/DATA/WORK/LAB/VeraCrypt/VeraCrypt.git/src/Crypto/cpu.h:260:27: note: expanded from macro 'GNU_AS2'
    #define GNU_AS2(x, y) #x ", " #y ";" NEW_LINE
                          ^
<scratch space>:143:2: note: expanded from here
"movq [%3+64+8*rsi]"
 ^
<inline asm>:8:7: note: instantiated into assembly here
movq [%r8+64+8*rsi], mm0;
      ^
../Crypto/Whirlpool.c:758:3: error: unknown token in expression
                KSL(0, 4, 3, 2, 1, 0)
                ^
../Crypto/Whirlpool.c:688:2: note: expanded from macro 'KSL'
        AS2(mov         eax, [SSE2_workspace+8*i])\
        ^
/mnt/DATA/WORK/LAB/VeraCrypt/VeraCrypt.git/src/Crypto/cpu.h:265:23: note: expanded from macro 'AS2'
    #define AS2(x, y) GNU_AS2(x, y)
                      ^
/mnt/DATA/WORK/LAB/VeraCrypt/VeraCrypt.git/src/Crypto/cpu.h:260:27: note: expanded from macro 'GNU_AS2'
    #define GNU_AS2(x, y) #x ", " #y ";" NEW_LINE
                          ^
<scratch space>:160:2: note: expanded from here
"mov eax"
 ^
<inline asm>:16:11: note: instantiated into assembly here
mov eax, [%r8+8*4];
          ^
../Crypto/Whirlpool.c:759:3: error: unknown token in expression
                KSL(0, 0, 7, 6, 5, 4)
                ^
../Crypto/Whirlpool.c:688:2: note: expanded from macro 'KSL'
        AS2(mov         eax, [SSE2_workspace+8*i])\
        ^
/mnt/DATA/WORK/LAB/VeraCrypt/VeraCrypt.git/src/Crypto/cpu.h:265:23: note: expanded from macro 'AS2'
    #define AS2(x, y) GNU_AS2(x, y)
                      ^
/mnt/DATA/WORK/LAB/VeraCrypt/VeraCrypt.git/src/Crypto/cpu.h:260:27: note: expanded from macro 'GNU_AS2'
    #define GNU_AS2(x, y) #x ", " #y ";" NEW_LINE
                          ^
<scratch space>:192:2: note: expanded from here
"mov eax"
 ^
<inline asm>:26:11: note: instantiated into assembly here
mov eax, [%r8+8*0];
          ^
../Crypto/Whirlpool.c:760:3: error: unknown token in expression
                KSL(1, 1, 0, 7, 6, 5)
                ^
../Crypto/Whirlpool.c:688:2: note: expanded from macro 'KSL'
        AS2(mov         eax, [SSE2_workspace+8*i])\
        ^
/mnt/DATA/WORK/LAB/VeraCrypt/VeraCrypt.git/src/Crypto/cpu.h:265:23: note: expanded from macro 'AS2'
    #define AS2(x, y) GNU_AS2(x, y)
                      ^
/mnt/DATA/WORK/LAB/VeraCrypt/VeraCrypt.git/src/Crypto/cpu.h:260:27: note: expanded from macro 'GNU_AS2'
    #define GNU_AS2(x, y) #x ", " #y ";" NEW_LINE
                          ^
<scratch space>:224:2: note: expanded from here
"mov eax"
 ^
<inline asm>:36:11: note: instantiated into assembly here
mov eax, [%r8+8*1];
          ^
../Crypto/Whirlpool.c:761:3: error: unknown token in expression
                KSL(1, 2, 1, 0, 7, 6)
                ^
../Crypto/Whirlpool.c:688:2: note: expanded from macro 'KSL'
        AS2(mov         eax, [SSE2_workspace+8*i])\
        ^
/mnt/DATA/WORK/LAB/VeraCrypt/VeraCrypt.git/src/Crypto/cpu.h:265:23: note: expanded from macro 'AS2'
    #define AS2(x, y) GNU_AS2(x, y)
                      ^
/mnt/DATA/WORK/LAB/VeraCrypt/VeraCrypt.git/src/Crypto/cpu.h:260:27: note: expanded from macro 'GNU_AS2'
    #define GNU_AS2(x, y) #x ", " #y ";" NEW_LINE
                          ^
<scratch space>:2:2: note: expanded from here
"mov eax"
 ^
<inline asm>:46:11: note: instantiated into assembly here
mov eax, [%r8+8*2];
          ^
../Crypto/Whirlpool.c:762:3: error: unknown token in expression
                KSL(1, 3, 2, 1, 0, 7)
                ^
../Crypto/Whirlpool.c:688:2: note: expanded from macro 'KSL'
        AS2(mov         eax, [SSE2_workspace+8*i])\
        ^
/mnt/DATA/WORK/LAB/VeraCrypt/VeraCrypt.git/src/Crypto/cpu.h:265:23: note: expanded from macro 'AS2'
    #define AS2(x, y) GNU_AS2(x, y)
                      ^
/mnt/DATA/WORK/LAB/VeraCrypt/VeraCrypt.git/src/Crypto/cpu.h:260:27: note: expanded from macro 'GNU_AS2'
    #define GNU_AS2(x, y) #x ", " #y ";" NEW_LINE
                          ^
<scratch space>:34:2: note: expanded from here
"mov eax"
 ^
<inline asm>:56:11: note: instantiated into assembly here
mov eax, [%r8+8*3];
          ^
../Crypto/Whirlpool.c:763:3: error: unknown token in expression
                KSL(1, 5, 4, 3, 2, 1)
                ^
../Crypto/Whirlpool.c:688:2: note: expanded from macro 'KSL'
        AS2(mov         eax, [SSE2_workspace+8*i])\
        ^
/mnt/DATA/WORK/LAB/VeraCrypt/VeraCrypt.git/src/Crypto/cpu.h:265:23: note: expanded from macro 'AS2'
    #define AS2(x, y) GNU_AS2(x, y)
                      ^
/mnt/DATA/WORK/LAB/VeraCrypt/VeraCrypt.git/src/Crypto/cpu.h:260:27: note: expanded from macro 'GNU_AS2'
    #define GNU_AS2(x, y) #x ", " #y ";" NEW_LINE
                          ^
<scratch space>:66:2: note: expanded from here
"mov eax"
 ^
<inline asm>:66:11: note: instantiated into assembly here
mov eax, [%r8+8*5];
          ^
../Crypto/Whirlpool.c:764:3: error: unknown token in expression
                KSL(1, 6, 5, 4, 3, 2)
                ^
../Crypto/Whirlpool.c:688:2: note: expanded from macro 'KSL'
        AS2(mov         eax, [SSE2_workspace+8*i])\
        ^
/mnt/DATA/WORK/LAB/VeraCrypt/VeraCrypt.git/src/Crypto/cpu.h:265:23: note: expanded from macro 'AS2'
    #define AS2(x, y) GNU_AS2(x, y)
                      ^
/mnt/DATA/WORK/LAB/VeraCrypt/VeraCrypt.git/src/Crypto/cpu.h:260:27: note: expanded from macro 'GNU_AS2'
    #define GNU_AS2(x, y) #x ", " #y ";" NEW_LINE
                          ^
<scratch space>:98:2: note: expanded from here
"mov eax"
 ^
<inline asm>:76:11: note: instantiated into assembly here
mov eax, [%r8+8*6];
          ^
../Crypto/Whirlpool.c:765:3: error: unknown token in expression
                KSL(1, 7, 6, 5, 4, 3)
                ^
../Crypto/Whirlpool.c:688:2: note: expanded from macro 'KSL'
        AS2(mov         eax, [SSE2_workspace+8*i])\
        ^
/mnt/DATA/WORK/LAB/VeraCrypt/VeraCrypt.git/src/Crypto/cpu.h:265:23: note: expanded from macro 'AS2'
    #define AS2(x, y) GNU_AS2(x, y)
                      ^
/mnt/DATA/WORK/LAB/VeraCrypt/VeraCrypt.git/src/Crypto/cpu.h:260:27: note: expanded from macro 'GNU_AS2'
    #define GNU_AS2(x, y) #x ", " #y ";" NEW_LINE
                          ^
<scratch space>:130:2: note: expanded from here
"mov eax"
 ^
<inline asm>:86:11: note: instantiated into assembly here
mov eax, [%r8+8*7];
          ^
../Crypto/Whirlpool.c:766:3: error: unknown token in expression
                KSH(0, 0, 7, 6, 5, 4)
                ^
../Crypto/Whirlpool.c:709:2: note: expanded from macro 'KSH'
        AS2(mov         eax, [SSE2_workspace+8*((i+4)-8*((i+4)/8))+4])\
        ^
/mnt/DATA/WORK/LAB/VeraCrypt/VeraCrypt.git/src/Crypto/cpu.h:265:23: note: expanded from macro 'AS2'
    #define AS2(x, y) GNU_AS2(x, y)
                      ^
/mnt/DATA/WORK/LAB/VeraCrypt/VeraCrypt.git/src/Crypto/cpu.h:260:27: note: expanded from macro 'GNU_AS2'
    #define GNU_AS2(x, y) #x ", " #y ";" NEW_LINE
                          ^
<scratch space>:162:2: note: expanded from here
"mov eax"
 ^
<inline asm>:96:11: note: instantiated into assembly here
mov eax, [%r8+8*((0+4)-8*((0+4)/8))+4];
          ^
../Crypto/Whirlpool.c:767:3: error: unknown token in expression
                KSH(0, 4, 3, 2, 1, 0)
                ^
../Crypto/Whirlpool.c:709:2: note: expanded from macro 'KSH'
        AS2(mov         eax, [SSE2_workspace+8*((i+4)-8*((i+4)/8))+4])\
        ^
/mnt/DATA/WORK/LAB/VeraCrypt/VeraCrypt.git/src/Crypto/cpu.h:265:23: note: expanded from macro 'AS2'
    #define AS2(x, y) GNU_AS2(x, y)
                      ^
/mnt/DATA/WORK/LAB/VeraCrypt/VeraCrypt.git/src/Crypto/cpu.h:260:27: note: expanded from macro 'GNU_AS2'
    #define GNU_AS2(x, y) #x ", " #y ";" NEW_LINE
                          ^
<scratch space>:226:2: note: expanded from here
"mov eax"
 ^
<inline asm>:106:11: note: instantiated into assembly here
mov eax, [%r8+8*((4+4)-8*((4+4)/8))+4];
          ^
../Crypto/Whirlpool.c:768:3: error: unknown token in expression
                KSH(1, 1, 0, 7, 6, 5)
                ^
../Crypto/Whirlpool.c:709:2: note: expanded from macro 'KSH'
        AS2(mov         eax, [SSE2_workspace+8*((i+4)-8*((i+4)/8))+4])\
        ^
/mnt/DATA/WORK/LAB/VeraCrypt/VeraCrypt.git/src/Crypto/cpu.h:265:23: note: expanded from macro 'AS2'
    #define AS2(x, y) GNU_AS2(x, y)
                      ^
/mnt/DATA/WORK/LAB/VeraCrypt/VeraCrypt.git/src/Crypto/cpu.h:260:27: note: expanded from macro 'GNU_AS2'
    #define GNU_AS2(x, y) #x ", " #y ";" NEW_LINE
                          ^
<scratch space>:290:2: note: expanded from here
"mov eax"
 ^
<inline asm>:116:11: note: instantiated into assembly here
mov eax, [%r8+8*((1+4)-8*((1+4)/8))+4];
          ^
../Crypto/Whirlpool.c:769:3: error: unknown token in expression
                KSH(1, 2, 1, 0, 7, 6)
                ^
../Crypto/Whirlpool.c:709:2: note: expanded from macro 'KSH'
        AS2(mov         eax, [SSE2_workspace+8*((i+4)-8*((i+4)/8))+4])\
        ^
/mnt/DATA/WORK/LAB/VeraCrypt/VeraCrypt.git/src/Crypto/cpu.h:265:23: note: expanded from macro 'AS2'
    #define AS2(x, y) GNU_AS2(x, y)
                      ^
/mnt/DATA/WORK/LAB/VeraCrypt/VeraCrypt.git/src/Crypto/cpu.h:260:27: note: expanded from macro 'GNU_AS2'
    #define GNU_AS2(x, y) #x ", " #y ";" NEW_LINE
                          ^
<scratch space>:322:2: note: expanded from here
"mov eax"
 ^
<inline asm>:126:11: note: instantiated into assembly here
mov eax, [%r8+8*((2+4)-8*((2+4)/8))+4];
          ^
../Crypto/Whirlpool.c:770:3: error: unknown token in expression
                KSH(1, 5, 4, 3, 2, 1)
                ^
../Crypto/Whirlpool.c:709:2: note: expanded from macro 'KSH'
        AS2(mov         eax, [SSE2_workspace+8*((i+4)-8*((i+4)/8))+4])\
        ^
/mnt/DATA/WORK/LAB/VeraCrypt/VeraCrypt.git/src/Crypto/cpu.h:265:23: note: expanded from macro 'AS2'
    #define AS2(x, y) GNU_AS2(x, y)
                      ^
/mnt/DATA/WORK/LAB/VeraCrypt/VeraCrypt.git/src/Crypto/cpu.h:260:27: note: expanded from macro 'GNU_AS2'
    #define GNU_AS2(x, y) #x ", " #y ";" NEW_LINE
                          ^
<scratch space>:354:2: note: expanded from here
"mov eax"
 ^
<inline asm>:136:11: note: instantiated into assembly here
mov eax, [%r8+8*((5+4)-8*((5+4)/8))+4];
          ^
../Crypto/Whirlpool.c:771:3: error: unknown token in expression
                KSH(1, 6, 5, 4, 3, 2)
                ^
../Crypto/Whirlpool.c:709:2: note: expanded from macro 'KSH'
        AS2(mov         eax, [SSE2_workspace+8*((i+4)-8*((i+4)/8))+4])\
        ^
/mnt/DATA/WORK/LAB/VeraCrypt/VeraCrypt.git/src/Crypto/cpu.h:265:23: note: expanded from macro 'AS2'
    #define AS2(x, y) GNU_AS2(x, y)
                      ^
/mnt/DATA/WORK/LAB/VeraCrypt/VeraCrypt.git/src/Crypto/cpu.h:260:27: note: expanded from macro 'GNU_AS2'
    #define GNU_AS2(x, y) #x ", " #y ";" NEW_LINE
                          ^
<scratch space>:386:2: note: expanded from here
"mov eax"
 ^
<inline asm>:146:11: note: instantiated into assembly here
mov eax, [%r8+8*((6+4)-8*((6+4)/8))+4];
          ^
../Crypto/Whirlpool.c:772:3: error: unknown token in expression
                KSH(2, 3, 2, 1, 0, 7)
                ^
../Crypto/Whirlpool.c:709:2: note: expanded from macro 'KSH'
        AS2(mov         eax, [SSE2_workspace+8*((i+4)-8*((i+4)/8))+4])\
        ^
/mnt/DATA/WORK/LAB/VeraCrypt/VeraCrypt.git/src/Crypto/cpu.h:265:23: note: expanded from macro 'AS2'
    #define AS2(x, y) GNU_AS2(x, y)
                      ^
/mnt/DATA/WORK/LAB/VeraCrypt/VeraCrypt.git/src/Crypto/cpu.h:260:27: note: expanded from macro 'GNU_AS2'
    #define GNU_AS2(x, y) #x ", " #y ";" NEW_LINE
                          ^
<scratch space>:418:2: note: expanded from here
"mov eax"
 ^
<inline asm>:156:11: note: instantiated into assembly here
mov eax, [%r8+8*((3+4)-8*((3+4)/8))+4];
          ^
../Crypto/Whirlpool.c:772:3: error: unknown token in expression
                KSH(2, 3, 2, 1, 0, 7)
                ^
../Crypto/Whirlpool.c:711:2: note: expanded from macro 'KSH'
        KSH##op(a, [AS_REG_6+3*2048+8*WORD_REG(di)])\
        ^
<scratch space>:422:1: note: expanded from here
KSH2
^
../Crypto/Whirlpool.c:706:2: note: expanded from macro 'KSH2'
        AS2(movq        [SSE2_workspace+8*a], mm##a)
        ^
/mnt/DATA/WORK/LAB/VeraCrypt/VeraCrypt.git/src/Crypto/cpu.h:265:23: note: expanded from macro 'AS2'
    #define AS2(x, y) GNU_AS2(x, y)
                      ^
/mnt/DATA/WORK/LAB/VeraCrypt/VeraCrypt.git/src/Crypto/cpu.h:260:27: note: expanded from macro 'GNU_AS2'
    #define GNU_AS2(x, y) #x ", " #y ";" NEW_LINE
                          ^
<scratch space>:428:2: note: expanded from here
"movq [%3+8*2]"
 ^
<inline asm>:159:7: note: instantiated into assembly here
movq [%r8+8*2], mm2;
      ^
../Crypto/Whirlpool.c:772:3: error: unknown token in expression
                KSH(2, 3, 2, 1, 0, 7)
                ^
../Crypto/Whirlpool.c:713:2: note: expanded from macro 'KSH'
        KSH##op(b, [AS_REG_6+2*2048+8*WORD_REG(di)])\
        ^
<scratch space>:5:1: note: expanded from here
KSH2
^
../Crypto/Whirlpool.c:706:2: note: expanded from macro 'KSH2'
        AS2(movq        [SSE2_workspace+8*a], mm##a)
        ^
/mnt/DATA/WORK/LAB/VeraCrypt/VeraCrypt.git/src/Crypto/cpu.h:265:23: note: expanded from macro 'AS2'
    #define AS2(x, y) GNU_AS2(x, y)
                      ^
/mnt/DATA/WORK/LAB/VeraCrypt/VeraCrypt.git/src/Crypto/cpu.h:260:27: note: expanded from macro 'GNU_AS2'
    #define GNU_AS2(x, y) #x ", " #y ";" NEW_LINE
                          ^
<scratch space>:11:2: note: expanded from here
"movq [%3+8*1]"
 ^
<inline asm>:162:7: note: instantiated into assembly here
movq [%r8+8*1], mm1;
      ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
gmake[1]: *** [/mnt/DATA/WORK/LAB/VeraCrypt/VeraCrypt.git/src/Build/Include/Makefile.inc:21: ../Crypto/Whirlpool.o] Error 1
gmake: *** [Makefile:340: all] Error 2
@idrassi
Copy link
Member

idrassi commented Jan 12, 2017

Hi,

This issue is caused by an LLVM bug that makes inline assembly operands not working properly with INTEL syntax (http://llvm.org/bugs/show_bug.cgi?id=24232)

I have pushed a commit that should fix this since it disables inline assembly in this case (fix taken from Crypto++ library)

Can you please check that it fixes the issue on FreeBSD?

Also, it will be helpful to share with us the results of your port to FreeBSD. Thanks.

@bole5
Copy link

bole5 commented Feb 3, 2017

Thank you. This fixed the problem.
I was able to build veracrypt with GUI on FreeBSD 11.0.

@idrassi
Copy link
Member

idrassi commented Feb 3, 2017

Thank you for the confirmation.

@idrassi idrassi closed this as completed Feb 3, 2017
@cederom
Copy link
Author

cederom commented Feb 4, 2017

Hey @idrassi thanks for your reply and fixes!! I have tried to build on VM FreeBSD 11.0-CURRENT, I have chosen to use existing wxWidgets 3.0.2 system package, and the build failed at the linking stage, in a free moment I will see how to fix it, and how it behaves on production 10.3-RELEASE machine. Maybe we could release a port soon! Thanks again!! :-)

@bole5
Copy link

bole5 commented Feb 4, 2017

I was able to compile veracrypt on FreeBSD 11.0-RELEASE-p1. Try using following procedure:

  1. Copy /etc/ports/security/truecrypt to: /etc/ports/security/veracrypt, delete distinfo
  2. Replace /etc/ports/security/veracrypt/Makefile with:

PORTNAME= VeraCrypt
PORTVERSION= master
CATEGORIES= security

MASTER_SITES= SF/wxwindows/${WX_VER}/:wxwidgets
DISTFILES= wxWidgets-${WX_VER}.tar.bz2:wxwidgets
EXTRACT_ONLY= ${VC_SRCFILE} wxWidgets-${WX_VER}.tar.bz2

MAINTAINER= ??@FreeBSD.org
COMMENT= Free open-source disk encryption software

BUILD_DEPENDS= nasm:devel/nasm
RUN_DEPENDS= sudo:security/sudo

VC_SRCFILE= ${GH_ACCOUNT}-${PORTNAME}-${DISTVERSIONPREFIX}${PORTVERSION}-${GH_TAGNAME}_GH0.tar.gz
WRKSRC= ${WRKDIR}/${PORTNAME}-${GH_TAGNAME}/src

USES= fuse iconv pkgconfig gmake
RESTRICTED= May not be redistributed. Must accept license to download.
NO_CDROM= May not be redistributed. Must accept license to download.
NO_PACKAGE= May not be redistributed. Must accept license to download.

WX_VER= 3.0.2

USE_GITHUB= yes
GH_ACCOUNT= veracrypt
GH_TAGNAME= 100b79d

LICENSE_FILE= ${WRKSRC}/License.txt

PLIST_FILES= bin/veracrypt

OPTIONS_DEFINE= X11 DOCS
X11_DESC= With GUI (depends on X)

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MDOCS}
PLIST_FILES+= %%DOCSDIR%%/VeraCrypt\ User\ Guide.pdf
PLIST_FILES+= %%DOCSDIR%%/License.txt
.endif

.if ${PORT_OPTIONS:MX11}
USE_GNOME= gtk20
NOGUI=
.else
NOGUI= NOGUI=1
.endif

.if defined(PACKAGE_BUILDING)
IGNORE= requires manual fetch
.endif

do-build:
@${ECHO_MSG} "===> Building for wxWidgets dependency"
@(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${NOGUI} PKCS11_INC=${WRKSRC}/PKCS11 WX_ROOT=${WRKDIR}/wxWidgets-${WX_VER} wxbuild)
@${ECHO_MSG} "===> Building for ${PKGNAME}"
@(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${NOGUI} WXSTATIC=1 PKCS11_INC=${WRKSRC}/PKCS11)

do-install:
@${INSTALL_PROGRAM} ${WRKSRC}/Main/veracrypt ${STAGEDIR}${PREFIX}/bin
.if ${PORT_OPTIONS:MDOCS}
@${MKDIR} ${STAGEDIR}${DOCSDIR}
@${INSTALL_DATA} ${WRKSRC}/License.txt ${STAGEDIR}${DOCSDIR}
@${INSTALL_DATA} ${WRKSRC}/Release/Setup\ Files/VeraCrypt\ User\ Guide.pdf ${STAGEDIR}${DOCSDIR}
.endif

.include <bsd.port.mk>

  1. Run make to download VeraCrypt and wxWidgets then run make makesum

You can make it with or without GUI. I build mine with GUI...

@cederom
Copy link
Author

cederom commented Feb 4, 2017

Thanks @bole5! We can re-user existing truecrypt port I seee =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants