Permalink
Fetching contributors…
Cannot retrieve contributors at this time
174 lines (150 sloc) 6.64 KB
# -*- 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 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 {}
set gitlab.home https://gitlab.com
set gitlab.author jojo_boulix
set gitlab.project ${name}
if {${subport} eq ${name}} {
# release
set gitlab.commit "a488cdbc7f8d6d1d6b7fde48b6ce92e9d972d62a"
set amc_revision "git201805011238"
set amc_date "201805011238"
version 1.3.0.${amc_revision}
revision 1
checksums rmd160 fe210d0320577e27d09ee1975f6452cfccdd3606 \
sha256 4303691433ebea2e9420517d6a1c89b3ea2e1746f37753ea08109f44cdd8f2b7
conflicts auto-multiple-choice-devel
} else {
# devel
set gitlab.commit "4ca39bbf03488828a87e05a873379ae39cdce6cf"
set amc_revision "201805310528"
set amc_date "201805310528"
version 1.4.0.b${amc_revision}
revision 1
checksums rmd160 fb5a8adac676eff04fa3fe50fce035700031be34 \
sha256 7e7841eff281dd0496eb4bbc0303d16f47b97dee086f3f0e99ac18081d314e8c
depends_build-append port:gmake
build.cmd ${prefix}/bin/gmake
conflicts auto-multiple-choice
}
master_sites https://gitlab.com/jojo_boulix/auto-multiple-choice/repository/archive.tar.gz?ref=${gitlab.commit}&dummy=
distname ${gitlab.project}-${gitlab.commit}-${gitlab.commit}
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:poppler \
port:qpdf \
port:sqlite3 \
port:texlive \
port:texlive-fonts-extra \
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-fonts-extra \
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
}