-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Portfile
162 lines (140 loc) · 6.1 KB
/
Portfile
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
PortSystem 1.0
PortGroup bitbucket 1.0
PortGroup perl5 1.0
PortGroup texlive 1.0
perl5.branches 5.26
name auto-multiple-choice
categories x11 tex education
platforms darwin
license GPL-2+
maintainers {laposte.fr:joel.brogniart @nortcele} openmaintainer
description Auto Multiple Choice - Multiple Choice Papers Management
long_description Utility to manage multiple choice questionnaires, \
with optionally mixed questions and answers. \
AMC provides automatic marking from papers' scans. \
Annotated papers are produced. Marks can be exported \
as an OpenOffice.org sheet file.
homepage http://www.auto-multiple-choice.net/
subport auto-multiple-choice-devel {}
if {${subport} eq ${name}} {
# release
set bitbucket_commit "15d39fd2d4aa"
set amc_revision "2132"
set amc_date "2017111201428"
checksums rmd160 325cce4d2c16b503f2de74922282188843c8131f \
sha256 6c19ac832039b22ca266310c471aeff744c0e547d148e537969e6ba7668179dc
conflicts auto-multiple-choice-devel
} else {
# devel
set bitbucket_commit "74c619d2a6ac"
set amc_revision "2134"
set amc_date "201711231020"
checksums rmd160 7b9304264d3fa069ea7f0b1122c9ca254c56d0f1 \
sha256 7361beaabf58254b26977693908ab3528309e7d87ded23695350dba6ead0a77f
conflicts auto-multiple-choice
}
bitbucket.setup auto-multiple-choice auto-multiple-choice ${bitbucket_commit}
version 1.3.0.${amc_revision}
depends_build-append \
port:dblatex \
port:p${perl5.major}-xml-libxml
depends_lib-append port:opencv
depends_run \
port:gdk-pixbuf2 \
port:libnotify \
port:librsvg \
port:netpbm \
port:p${perl5.major}-archive-zip \
port:p${perl5.major}-clone \
port:p${perl5.major}-dbd-sqlite \
port:p${perl5.major}-digest-md5 \
port:p${perl5.major}-email-mime \
port:p${perl5.major}-email-sender \
port:p${perl5.major}-file-basedir \
port:p${perl5.major}-file-mimeinfo \
port:p${perl5.major}-glib-object-introspection \
port:p${perl5.major}-gtk3 \
port:p${perl5.major}-locale-gettext \
port:p${perl5.major}-module-load-conditional \
port:p${perl5.major}-openoffice-oodoc \
port:p${perl5.major}-perlmagick \
port:p${perl5.major}-text-csv \
port:p${perl5.major}-xml-simple \
port:p${perl5.major}-xml-writer \
port:pdftk \
port:poppler \
port:sqlite3 \
port:texlive \
port:texlive-lang-japanese \
port:texlive-latex-extra
configure {
if {![variant_isset mactex]} {
set amc.texmflocal ${texlive_texmflocal}
}
system -W ${worksrcpath} "${build.cmd} version_files AMCCONF=macports BASEPATH=${prefix} PERLPATH=${perl5.bin} PERLDIR=${perl5.lib} SYSTEM_TYPE=macports TEXDIR=${amc.texmflocal}/tex/latex/AMC TEXDOCDIR=${amc.texmflocal}/doc/latex/AMC"
}
pre-destroot {
destroot.args-append PERLDIR=${perl5.lib}
if {![variant_isset mactex]} {
set amc.texmflocal ${texlive_texmflocal}
}
destroot.args-append TEXDIR="${amc.texmflocal}/tex/latex/AMC"
destroot.args-append TEXDOCDIR="${amc.texmflocal}/doc/latex/AMC"
}
destroot.args AMCCONF=macports \
BASEPATH=${prefix}
# The mactex variant expects MacTeX to be installed
# and installs dblatex's stylefiles to MacTeX's texmf (local)
set amc.texmflocal ""
set amc.mactex_bin ""
variant mactex description {The mactex variant allow Auto Multiple Choice to use a MacTeX installation \
instead of Macports texlive tools. To install the mactex variant \
/Library/TeX/texbin must be added to binpath in macports.conf.} {
# First, check if MacTeX actually seems to be there…
set amc.mactex_candidates { \
"/Library/TeX/texbin" \
"/usr/texbin" \
}
foreach dir ${amc.mactex_candidates} {
if [file executable "${dir}/kpsewhich"] {
set amc.mactex_bin ${dir}
break
}
}
if { ${amc.mactex_bin} != "" } {
set amc.texmflocal \
[exec ${amc.mactex_bin}/kpsewhich --expand-var='\$TEXMFLOCAL']
regsub -all {'} ${amc.texmflocal} "" amc.texmflocal
} else {
return -code error "Cannot find MacTeX installation; aborting"
}
depends_run-delete \
port:texlive \
port:texlive-lang-japanese \
port:texlive-latex-extra
notes "The mactex variant will install styles to MacTeX's texmf-local
${amc.texmflocal}
(which is outside macport's common directory structure).
For the mactex variant to work,
${amc.mactex_bin} must also be added to binpath in macports.conf"
# AND, since we're installing files outside macports' normal directories
destroot.violate_mtree yes
}
proc amc.mktexlsr {} {
if {![variant_isset mactex]} {
texlive.mktexlsr
} else {
global amc.mactex_bin
system "${amc.mactex_bin}/mktexlsr"
if [file exists "${amc.mactex_bin}/mtxrun"] {
system "${amc.mactex_bin}/mtxrun --generate"
}
}
}
post-activate {
amc.mktexlsr
}
post-deactivate {
amc.mktexlsr
}