Skip to content

Instantly share code, notes, and snippets.

@leingang
Created May 8, 2018 16:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leingang/f00b246c3faeb503e76e41d6d789235c to your computer and use it in GitHub Desktop.
Save leingang/f00b246c3faeb503e76e41d6d789235c to your computer and use it in GitHub Desktop.
Roll back AMC to 1.2 with macports
#!/bin/bash
# Install version 1.2.8 of auto-multiple-choice, with some patches
# (C) 2018 Akim Demaille and Matthew Leingang
#
# See https://project.auto-multiple-choice.net/boards/2/topics/6301
#
# UNTESTED
cd /tmp
git clone --single-branch https://github.com/macports/macports-ports.git
cd macports-ports
git co a82a684b671a52c83fe6608c4f530ddf82fe8e5f
cd x11/auto-multiple-choice
port deactivate auto-multiple-choice
port -n install # -n to avoid updating opencv, which fails today
perl -pi -e "s{use encoding .utf-?8.;}{use utf8;}" /opt/local/lib/AMC/perl/*.pl
cat <<EOT >> AMC-meptex.pl.patch
119c119
< if(/\\page{([^\}]+)}{([^\}]+)}{([^\}]+)}/) {
---
> if(/\\page\{([^\}]+)}\{([^\}]+)}\{([^\}]+)}/) {
EOT
patch /opt/local/lib/AMC/perl/AMC-meptex.pl < AMC-meptex.pl.patch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment