Installing AMC with MacPorts on macOS

Version 10 (Joël Brogniart, 03/23/2024 09:13 am)

1 7 Joël Brogniart
h1. Installing AMC development version on OS X
2 1
3 7 Joël Brogniart
This is a translation of the French entry wiki. First translation was done by Pieter Van den Hombergh.
4 1
5 10 Joël Brogniart
_(This installation - AMC version 1.3.0 revision 1728 b36f9124e727 3/16/2016 - was tested with_
6 10 Joël Brogniart
* _OS X 10.11.5 (Xcode 7.3.1, MacPorts 2.3.4),_
7 10 Joël Brogniart
* _OS X 10.10 (Xcode 7.2.1, MacPorts 2.3.4),_
8 10 Joël Brogniart
* _OS X 10.9.5 (Xcode 6.2, MacPorts 2.3.4)._
9 1
10 9 Joël Brogniart
Auto Multiple Choice (AMC) is a software to manage questionnaires and multiple choice exams. It allows, from the definition of the multiple choice questions to generate sheets of questionnaires. The question types can be one only choice, multiple choices, question, right/wrong answers etc. Once the completed questionnaires are digitized, AMC automatically corrects the questionnaires. This software runs in a graphical environment X Window System on Linux and OS X. Linux is used as the develop environment, so it probably runs best there. Your mileage may vary.
11 1
12 1
In previous versions of this note, the source code of all necessary files were shown. As these sources are provided in the associated archive and not to burden the instructions, source code no longer appear in the note.
13 9 Joël Brogniart
14 10 Joël Brogniart
It is possible to install the "1.1.2 pre-compiled version":http://project.auto-multiple-choice.net/projects/auto-multiple-choice/wiki/Installation_d'AMC_sous_OS_X , but you would miss the newest developments happening in this active project. You can also install from the source, directly from the development  repository. This will give you the bleeding edge version.
15 9 Joël Brogniart
16 10 Joël Brogniart
For the moment, this installation guide is quite technical and has only been tested on OS X 10.11.5, 10.10.5 and 10.9.5 with the corresponding latest version of Xcode. You will need "MacPorts":http://www.macports.org, a little understanding of the dependencies between different tools (Subversion, MacPorts, PERL, X11, port ...) and the OS X architecture. You should also have administrative rights on the computer. This manual is therefore unfortunately not for everyone.
17 7 Joël Brogniart
18 9 Joël Brogniart
For this installation you will create a local MacPort repository. In this repository you will add macports description for AMC and possibly files for additional ports. Once these files are installed, the installation of AMC can be started.
19 1
20 1
h2. Prerequisites
21 1
22 9 Joël Brogniart
The requirements are the same as the installation of version 1.1.2 AMC. To work with the interface, AMC requires the graphical environment X Window System and X11, the Linux Libertine font, the DejaVu font family and the MacPorts installation system.
23 1
24 1
OS X does not contain the standard X11 graphical environment. It is possible to fill this gap by installing XQuartz, an X Windows System environment running OS X. You can download the application on the XQuartz site. "XQuartz":http://xquartz.macosforge.org.
25 7 Joël Brogniart
26 7 Joël Brogniart
h3. MacPorts
27 1
28 1
MacPorts is a system to build, install and manage open source software. You need to download the OS X Yosemite installation package on the site "MacPorts":http://www.macports.org and install MacPorts.
29 1
30 1
h3. Linux Libertine font
31 1
32 9 Joël Brogniart
Linux Libertine font is a free font that covers code pages for Latin languages​​, Greek, Cyrillic languages​​, Hebrew, the International Phonetic Alphabet (and other). You need to download the package "OTF" on "LinuxLibertine.org":http://www.linuxlibertine.org site.
33 1
34 9 Joël Brogniart
*Caution* : The current version of XQuartz (2.7.8) does not recognize the fonts installed in the user's folder. You must install the fonts by moving them in the "@/Library/Fonts@" folder.
35 1
36 9 Joël Brogniart
h3. DejaVu font family
37 9 Joël Brogniart
38 9 Joël Brogniart
DejaVu fonts are used for japanese documentation generation.
39 9 Joël Brogniart
 Ces polices sont utilisées pour la génération des documentations en japonais. You need to download the fonts on "dejavu-fonts.org":http://dejavu-fonts.org/wiki/Download site.
40 9 Joël Brogniart
41 9 Joël Brogniart
*Caution* : The current version of XQuartz (2.7.8) does not recognize the fonts installed in the user's folder. You must install the fonts by moving them in the "@/Library/Fonts@" folder.
42 9 Joël Brogniart
43 1
h2. MacPorts installation (port) files
44 7 Joël Brogniart
45 7 Joël Brogniart
The MacPorts port file contains information that allows a program to be installed into the MacPorts system. It shows what tools are needed for installation and operation of the program and how to install the program. 
46 2 Joël Brogniart
MacPorts contains "many ports":http://www.macports.org/ports.php but it does not contain a port describing the AMC installation from the source code of the program. So we have to create the file port for the development version of AMC.
47 1
48 4 Joël Brogniart
To avoid conflicts with ports already described in MacPorts, new ports will be installed in the folders of the user who installs, instead of being installed in folders directly managed by MacPorts.
49 7 Joël Brogniart
50 4 Joël Brogniart
h3. Local MacPorts repository
51 7 Joël Brogniart
52 7 Joël Brogniart
For MacPorts to use a local folder, you must create that local folder.
53 7 Joël Brogniart
54 9 Joël Brogniart
<pre>mkdir -p ~/nix</pre>
55 7 Joël Brogniart
56 1
You should then tell MacPorts to take the local folder into account, before considering the standard hierarchy MacPorts. To do this you must edit the file "@/opt/local/etc/macports/sources.conf@" and add a URL to the local file before the URL of the repository @rsync@ MacPorts.
57 7 Joël Brogniart
58 1
<pre>file:///Users/julesvernes/nix/macports
59 1
rsync://rsync.macports.org/release/tarballs/ports.tar [default]</pre>
60 1
61 1
h3. Port Files
62 1
63 10 Joël Brogniart
Two archives containing the port files are available for download:
64 10 Joël Brogniart
* for installation on OS X 10.9 and 10.10 attachment:macports.zip,
65 10 Joël Brogniart
* for installation on OS X 10.11 attachment:macports-10.11.zip.
66 10 Joël Brogniart
First archive contains only AMC port description while the archive for OS X 10.11 contains adaptation for @gcc5@ and @pdftk@ port to make them working on OS X 10.11.
67 4 Joël Brogniart
68 10 Joël Brogniart
Download and uncompress this archive then move the "@macports@" folder inside the previously created folder.
69 1
70 4 Joël Brogniart
!port-hierarchy.png!
71 4 Joël Brogniart
72 4 Joël Brogniart
Each directory must contain a port document named @Portfile@. This document is a text document containing a description for the MacPorts installation tool.
73 7 Joël Brogniart
74 9 Joël Brogniart
h4. Excerpt for @x11/auto-multiple-choice-devel/Portfile@
75 1
<pre title="x11/auto-multiple-choice-devel/Portfile"># -*- 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
76 1
# $Id: Portfile 96038 2012-07-30 02:14:11Z dports@macports.org $
77 1
78 7 Joël Brogniart
PortSystem              1.0
79 4 Joël Brogniart
PortGroup               bitbucket 1.0
80 9 Joël Brogniart
PortGroup               perl5 1.0
81 4 Joël Brogniart
82 9 Joël Brogniart
set bitbucket_commit    "23cc81f7ce8a"
83 9 Joël Brogniart
set amc_revision        "1900"
84 9 Joël Brogniart
#1900:23cc81f7ce8a
85 4 Joël Brogniart
bitbucket.setup         auto-multiple-choice auto-multiple-choice ${bitbucket_commit}
86 9 Joël Brogniart
#perl5.branches          5.16
87 4 Joël Brogniart
name                    auto-multiple-choice-devel
88 9 Joël Brogniart
version                 1.3.${amc_revision}
89 7 Joël Brogniart
categories              x11 tex education
90 4 Joël Brogniart
platforms               darwin
91 7 Joël Brogniart
license                 GPL-2+
92 7 Joël Brogniart
maintainers             laposte.fr:joel.brogniart,openmaintainer
93 7 Joël Brogniart
94 4 Joël Brogniart
description             Auto Multiple Choice - Multiple Choice Papers Management
95 4 Joël Brogniart
long_description        Utility to manage multiple choice questionnaires, \
96 7 Joël Brogniart
                        with optionally mixed questions and answers. \
97 4 Joël Brogniart
                        AMC provides automatic marking from papers' scans. \
98 7 Joël Brogniart
                        Annotated papers are produced. Marks can be exported \
99 9 Joël Brogniart
                        as an OpenOffice.org sheet file.
100 9 Joël Brogniart
101 4 Joël Brogniart
homepage                http://home.gna.org/auto-qcm
102 9 Joël Brogniart
103 9 Joël Brogniart
checksums               rmd160  52a2f16741171f3c2430d291b7ae086813a879e6 \
104 4 Joël Brogniart
                        sha256  3aea36ff2c5acc872559fa36c14db628bb6bdc71c8c958dfd8715aaf4c9f70df
105 4 Joël Brogniart
106 1
depends_build-append    \
107 9 Joël Brogniart
                        port:dblatex \
108 4 Joël Brogniart
                        port:p${perl5.major}-xml-libxml
109 1
</pre>
110 4 Joël Brogniart
111 7 Joël Brogniart
h2. Installing AMC
112 1
113 10 Joël Brogniart
Once the port files set up, generate the index of the new port.
114 1
<pre>cd ~/nix/macports
115 1
portindex</pre>
116 1
117 10 Joël Brogniart
*Warning*: standard and development of AMC versions can't be installed simultaneously. If a standard version was previously installed, you must uninstall it before installing the development version.
118 1
119 1
<pre>sudo port uninstall auto-multiple-choice</pre>
120 1
121 10 Joël Brogniart
The installation of the development version of AMC can be launched. AMC depends on many other ports. The calculation and verification of all dependencies generates the opening of a large number of files that can cause installation failure. To avoid a failure, it is best to proceed in stages. First install the @pdftk@ port.
122 10 Joël Brogniart
123 10 Joël Brogniart
<pre>sudo port install pdftk</pre>
124 10 Joël Brogniart
125 10 Joël Brogniart
Then install @pdflatex@ port.
126 10 Joël Brogniart
127 10 Joël Brogniart
<pre>sudo port install pdflatex</pre>
128 10 Joël Brogniart
129 10 Joël Brogniart
Finally install AMC.
130 7 Joël Brogniart
131 5 Joël Brogniart
<pre>sudo port install auto-multiple-choice-devel</pre>
132 7 Joël Brogniart
133 5 Joël Brogniart
The installation may take a while. When it is complete and if there is no error, AMC is ready to be used.
134 5 Joël Brogniart
135 5 Joël Brogniart
h2. Using AMC
136 5 Joël Brogniart
137 5 Joël Brogniart
You can start from the terminal or from XQuartz.
138 7 Joël Brogniart
139 5 Joël Brogniart
h3. In the Terminal
140 7 Joël Brogniart
141 5 Joël Brogniart
<pre>auto-multiple-choice</pre>
142 5 Joël Brogniart
143 5 Joël Brogniart
This command will launch XQuartz and AMC application.
144 7 Joël Brogniart
145 5 Joël Brogniart
h3. In XQuartz
146 5 Joël Brogniart
147 5 Joël Brogniart
Start XQuartz application.
148 5 Joël Brogniart
149 5 Joël Brogniart
!xquartz.png!
150 7 Joël Brogniart
151 5 Joël Brogniart
We can immediately set XQuartz to facilitate the launch of AMC. Open the @Applications > Customize...@ menu.
152 5 Joël Brogniart
153 5 Joël Brogniart
!xquartz-menu-applications-personnaliser.png!
154 7 Joël Brogniart
155 7 Joël Brogniart
In the Personalization window, click the button @Add an entry@.
156 5 Joël Brogniart
157 5 Joël Brogniart
!xquartz-fenetre-personnaliser-menu-applications.png!
158 7 Joël Brogniart
159 5 Joël Brogniart
Set "@Auto Multiple Choice@" in the @Name@ column and "@auto-multiple-choice@" in the @Command@ column of the new menu item.
160 7 Joël Brogniart
161 5 Joël Brogniart
!xquartz-fenetre-personnaliser-menu-applications-2.png!
162 7 Joël Brogniart
163 5 Joël Brogniart
Close the Customize window, then select the @Applications > Auto Multiple Choice@ menu.
164 7 Joël Brogniart
165 5 Joël Brogniart
!xquartz-menu-applications-amc.png!
166 5 Joël Brogniart
167 5 Joël Brogniart
AMC window should appear.
168 7 Joël Brogniart
169 5 Joël Brogniart
!auto-multiple-choice-window.png!
170 7 Joël Brogniart
171 5 Joël Brogniart
Auto-multiple-choice is now ready to work.
172 5 Joël Brogniart
173 5 Joël Brogniart
h2. Links
174 5 Joël Brogniart
175 7 Joël Brogniart
* Auto Multiple Choice, "http://home.gna.org/auto-qcm/":http://home.gna.org/auto-qcm/.
176 5 Joël Brogniart
* Auto Multiple Choice, "Installation sous OS X (10.8)":http://project.auto-multiple-choice.net/projects/auto-multiple-choice/wiki/Installation_d'AMC_sous_OS_X_Mountain_Lion.
177 5 Joël Brogniart
* MacPorts, "http://www.macports.org":http://www.macports.org.
178 5 Joël Brogniart
* MacPorts, "Local Portfile Repositories":http://guide.macports.org/#development.local-repositories.
179 5 Joël Brogniart
* MacPorts, "How to create portfiles for CPAN Perl modules":https://trac.macports.org/wiki/howto/cpan2port.
180 1
* XQuartz, http://xquartz.macosforge.org</a>.