summaryrefslogtreecommitdiff
path: root/archivers/peazip/Makefile
blob: a6f01d4470dca0a3ca7ae0564ad3837bca032ac0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
PORTNAME=	peazip
PORTVERSION=	9.1.0
PORTREVISION=	1
CATEGORIES=	archivers
MASTER_SITES=	https://github.com/giorgiotani/PeaZip/releases/download/${PORTVERSION}/
PKGNAMESUFFIX=	${LAZARUS_PKGNAMESUFFIX}
DISTNAME=	${PORTNAME}-${PORTVERSION}.src

MAINTAINER=	acm@FreeBSD.org
COMMENT=	Free archiver and file compressor
WWW=		https://peazip.github.io

LICENSE=	LGPL3

USES=		cpe desktop-file-utils dos2unix fpc lazarus:flavors zip xorg
USE_FPC=	cairo chm fcl-base fcl-image fcl-xml pasjpeg rtl-objpas x11
USE_XORG=	x11

CPE_VENDOR=	giorgio_tani

SUB_FILES=	pea peazip

DOS2UNIX_REGEX=		.*\.([txt]|pas|lpi|txt)

LAZARUS_PROJECT_FILES=	dev/project_pea.lpi dev/project_peach.lpi
LAZBUILD_ARGS=		-d

gtk2_CONFLICTS_INSTALL=	${PORTNAME}-qt5
qt5_CONFLICTS_INSTALL=	${PORTNAME}-gtk2

ARCHIVER_FILES=		#

OPTIONS_DEFINE=		7Z ARC ZPAQ UNACE

7Z_DESC=		7z file archiver support
ARC_DESC=		Arc file archiver support
ZPAQ_DESC=		Zpaq file archiver support
UNACE_DESC=		Unace file archiver support

OPTIONS_DEFAULT=	7Z

.if ${FLAVOR:Ugtk2:Mgtk2}
USES+=		gnome
USE_GNOME+=	cairo
.endif

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:M7Z}
RUN_DEPENDS+=	7zz:archivers/7-zip
ARCHIVER_FILES+=7z
PLIST_SUB+=	7Z=""
.else
PLIST_SUB+=	7Z="@comment "
.endif

.if ${PORT_OPTIONS:MARC}
RUN_DEPENDS+=	arc:archivers/arc
ARCHIVER_FILES+=arc
PLIST_SUB+=	ARC=""
.else
PLIST_SUB+=	ARC="@comment "
.endif

.if ${PORT_OPTIONS:MZPAQ}
RUN_DEPENDS+=	zpaq:archivers/paq
ARCHIVER_FILES+=zpaq
PLIST_SUB+=	ZPAQ=""
.else
PLIST_SUB+=	ZPAQ="@comment "
.endif

.if ${PORT_OPTIONS:MUNACE}
RUN_DEPENDS+=	unace:archivers/unace
ARCHIVER_FILES+=unace
PLIST_SUB+=	UNACE=""
.else
PLIST_SUB+=	UNACE="@comment "
.endif

.include <bsd.port.pre.mk>

post-patch:
	${REINPLACE_CMD} 's|GetSelectedNodePath|Path|g' ${WRKSRC}/dev/peach.pas

pre-install:
	@${ECHO_CMD} "#" > ${WRKSRC}/altconf.txt
	@${ECHO_CMD} "appdata" >> ${WRKSRC}/altconf.txt

do-install:
	@${MKDIR} ${STAGEDIR}${DATADIR}/res/bin
	@${MKDIR} ${STAGEDIR}${DATADIR}/res/share
.for ARCHIVER in ${ARCHIVER_FILES}
	@${MKDIR} ${STAGEDIR}${DATADIR}/res/bin/${ARCHIVER}
.if ${ARCHIVER} == "7z"
	@${LN} -sf ${LOCALBASE}/bin/7zz ${STAGEDIR}${DATADIR}/res/bin/${ARCHIVER}/${ARCHIVER}
.else
	@${LN} -sf ${LOCALBASE}/bin/${ARCHIVER} ${STAGEDIR}${DATADIR}/res/bin/${ARCHIVER}/${ARCHIVER}
.endif
.endfor
	@cd ${WRKSRC}/res/share && ${COPYTREE_SHARE} "icons lang themes" ${STAGEDIR}${DATADIR}/res/share
	@cd ${WRKSRC} && ${INSTALL_DATA} altconf.txt ${STAGEDIR}${DATADIR}/res && \
			${INSTALL_PROGRAM} dev/pea ${STAGEDIR}${DATADIR}/res && \
			${INSTALL_PROGRAM} dev/peazip ${STAGEDIR}${DATADIR}
	@${MKDIR} ${STAGEDIR}${PREFIX}/share/icons/hicolor/256x256/apps
	@cd ${WRKSRC}/res/share/batch/freedesktop_integration && \
		${INSTALL_DATA} peazip*.desktop ${STAGEDIR}${DESKTOPDIR} && \
		${INSTALL_DATA} peazip*.png ${STAGEDIR}${PREFIX}/share/icons/hicolor/256x256/apps/
	${INSTALL_SCRIPT} ${WRKDIR}/pea ${WRKDIR}/peazip ${STAGEDIR}${PREFIX}/bin/

.include <bsd.port.post.mk>