Installing AMC with MacPorts on macOS

Version 2 (Pieter Van den Hombergh, 03/23/2024 09:13 am) → Version 3/46 (Pieter Van den Hombergh, 03/23/2024 09:13 am)

h1. Building AMC for MAC OSX

This is a translation of the original wiki entry by Joël Brogniart. Any spelling or translation errors are either mine or Google translate's.

(This installation is running OS X 10.7.5 and OS X 10.8.3 with Xcode 4.6.2 and MacPorts 2.1.3)

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.

It is possible to install the pre-compiled version 1.1.1 , 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.

For the moment, this installation guide is quite technical and involves only OS X 10.8 (and 10.7.5 with the 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. There is a little problem for communication with the printing tools and the installed version can not print directly, so you might miss some comfort compared to the Linux version. (But you will be producing pdf files which can be handled by your mac quite well). Documents generated by AMC will be printed from OS X.

For this installation you will create a local MacPort repository. In this repository you will add macports description files unknown to macports. The procedure will create a port file for AMC and some additional port files for tools needed to run AMC. Once these files are installed by macport, the installation of AMC can de started.

h2. Prerequisites

The requirements are the same as the installation of version 1.1.1 AMC. To work with the interface, AMC requires the graphical environment X Window System and X11 font Linux Libertine characters and and installation MacPorts system.

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.

Linux Libertine font

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 site. "LinuxLibertine.org":http://www.linuxlibertine.org.

*Attention* : The current version of XQuartz (2.7.4) does not recognize the fonts installed in the user's folder. You must install the fonts by moving in the "/ Library / Fonts" folder.

h3. MacPorts

MacPorts is a system to build, install and manage open source software. You need to download the installation package Mountain Lion on the site "MacPorts" http://www.macports.org and install MacPorts.

h2. MacPorts files installation (port) files

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.
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. Some tools required for installation and operation of AMC are absent from MacPorts. So we have to create the files to port these tools and file port for the development version of AMC.

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.

*Note*: MacPorts is a collaborative effort and many developers are involved in its development. The files described here they have been proposed to be added to the files referenced in MacPorts. When and if an addition is accepted, the local port file is no longer needed. One day a MacPorts update may be accepted in the standard hierarchy of MacPorts.

h3. Local repository MacPorts

For MacPorts to use a local folder, you must create that local folder.

<pre>mkdir -p ~/nix/macports</pre>

An archive containing files ports described here is available for download: attachment:macports.zip.

Ports are grouped into categories and file organization reflects this port group. Each port is part of a main category and has its own folder. The main category of AMC in MacPorts X11 is also the case for AMC port will be located within a folder @X11@. AMC is developed in PERL and requires many CPAN modules. PERL modules to be added will be in the @file@ perl. The following PERL ports will be added.
* p5-email-abstract (module CPAN "Email::Abstract":http://search.cpan.org/~rjbs/Email-Abstract)
* p5-email-sender (module CPAN "Email::Sender":http://search.cpan.org/~rjbs/Email-Sender)
* p5-moo (module CPAN "Moo":http://search.cpan.org/~mstrout/Moo)
* p5-moox-types-mooselike (module CPAN "Moox::Types::MooseLike":http://search.cpan.org/~mateu/MooX-Types-MooseLike)
* p5-role-tiny (module CPAN "Role::Tiny":http://search.cpan.org/~ilmari/Role-Tiny)
* p5-strictures (module CPAN "strictures":http://search.cpan.org/~ether/strictures)
* p5-throwable (module CPAN "Throwable":http://search.cpan.org/~rjbs/Throwable)

-The following ports will be updated because the version currently available in MacPort is too old. -
* -p5-class-load (module CPAN "Class::Load":http://search.cpan.org/~drolsky/Class-Load)- (plus nécessaire, mis à jour dans MacPorts)
* -p5-email-mime (module CPAN "Email::MIME":http://search.cpan.org/~rjbs/Email-MIME)- (plus nécessaire, mis à jour dans MacPorts)
* -p5-email-simple (module CPAN "Email::Simple":http://search.cpan.org/~rjbs/Email-Simple)- (plus nécessaire, mis à jour dans MacPorts)

Here is a command to create the hierarchy.
<pre>cd ~/nix/macports
mkdir -p perl/p5-email-abstract perl/p5-email-sender perl/p5-moo \
perl/p5-moox-types-mooselike perl/p5-role-tiny perl/p5-strictures \
perl/p5-throwable x11/auto-multiple-choice-devel</pre>

This should produce:

!port-hierarchy.png!

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.