Difference between revisions of "Apertium on Mac OS X"
Snippyhollow (talk | contribs) |
TommiPirinen (talk | contribs) (→Basic Installation Using Macports: fix links) |
||
(23 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
[[Installation sur Mac OS X|En français]] |
|||
⚫ | |||
Use either Homebrew or Macports. |
|||
== Basic Installation Using Homebrew == |
|||
# Make sure '''Homebrew''' is installed |
|||
## If not, you can get it from https://brew.sh |
|||
# Install all dependencies by running the following in the terminal: |
|||
#: <pre> |
|||
#:: brew install gperftools help2man pcre icu4c perl518 gawk autoconf automake pkg-config cmake wget gcc</pre> |
|||
#: Note that if you have a slightly older version of macOS, you'll want to use <code>apple-gcc42</code> instead of <code>gcc</code> |
|||
# <pre> curl https://apertium.projectjj.com/osx/install-nightly.sh | sudo zsh</pre> |
|||
#: Then type your password |
|||
#: Note that you'll probably need to type your sudo password, and the prompt may be covered up by the curl display. |
|||
#: Note also that if you have an old version of macOS, you may need <code>bash</code> instead of <code>zsh</code> |
|||
== Basic Installation Using Macports == |
|||
# Make sure '''XCode''' is installed |
|||
## If not, download it from http://developer.apple.com/xcode/ |
|||
## Be sure to include '''Command Line Tools''' |
|||
## (http://railsapps.github.io/xcode-command-line-tools.html is nice guide if you get stuck here) |
|||
# Make sure '''Macports''' is installed |
|||
## If not, download it from http://www.macports.org/install.php |
|||
# Install all dependencies by running the following in the terminal: |
|||
#: <pre> |
|||
#:: sudo port install autoconf automake expat flex \ |
|||
#:: gettext gperf help2man libiconv libtool \ |
|||
#:: libxml2 libxslt m4 ncurses p5-locale-gettext \ |
|||
#:: pcre perl5 pkgconfig zlib gawk icu cmake boost gperftools</pre> |
|||
# <pre> curl https://apertium.projectjj.com/osx/install-nightly.sh | sudo bash</pre> |
|||
== Language data packages == |
|||
If you've installed tools with install-nightly.sh, you can install language data with |
|||
https://apertium.projectjj.com/osx/install-nightly-data.sh . |
|||
First, download the script and make it executable |
|||
curl https://apertium.projectjj.com/osx/install-nightly-data.sh |
|||
chmod +x install-nightly-data.sh |
|||
If the curl command does not deliver the install-nightly-data.sh, just download it via your browser (click the link). Remeember to remove the .txt part the browser added to the filename. then run the chmod +x command as shown. |
|||
Then to install a language pair: |
|||
./install-nightly-data.sh apertium-eng-deu |
|||
and try it out: |
|||
echo 'Hello world' | apertium eng-deu |
|||
This language date is compiled '''nightly''' from git versions, but you'll have to re-run the script to get new versions. |
|||
The script can only fetch what's there. You can see available language pairs / packages at: |
|||
* https://apertium.projectjj.com/osx/nightly/data.php |
|||
Remember, you need to ''install tools first'' (see above sections). |
|||
There is also a script for '''release''' versions of pairs, https://apertium.projectjj.com/osx/install-release-data.sh , which can fetch the pairs listed at: |
|||
* https://apertium.projectjj.com/osx/release/data.php |
|||
== Compiling from Source == |
|||
<div style="background-color:pink; text-align:center; line-height:2.5; border: 1px solid crimson;">Are you sure this is the part you want?<br/>If you're here because one of the previous sections didn't work, log on to [[IRC]] and describe what went wrong.</div> |
|||
<span style="color: #f00;">You probably want [[Prerequisites for Mac OS X]] which gives you all the dev tools you might want</span> – this page has more in-depth documentation on compiling the core/dev tools from source. |
|||
⚫ | |||
⚫ | |||
⚫ | * [[Apertium on Mac OS X (Local)]] — The second way is to install locally (that is in your home directory, e.g. <code>/Users/myname/Local</code>), this is more contained but slower and more difficult, choose this if you don't have root, or want to make the Apertium installation completely separated from your main system. This can be better for developers. |
||
If you do not have any experience compiling source code, you can also follow the more user-friendly Mac guide [[Apertium on Mac OS X (User)]], which walks you through every step. |
|||
⚫ | |||
⚫ | *[[Apertium on Mac OS X (Local)]] — The second way is to install locally (that is in your home directory, e.g. <code>/Users/myname/Local</code>), this is more contained but slower and more difficult, choose this if you don't have root, or want to |
||
Note that the Mac terminal is using LC_CTYPE instead of LANG to know which charset to use. |
|||
[[Category:Documentation]] |
[[Category:Documentation]] |
||
[[Category:Installation]] |
|||
[[Category:Documentation in English]] |
Latest revision as of 11:57, 18 November 2022
Use either Homebrew or Macports.
Contents
Basic Installation Using Homebrew[edit]
- Make sure Homebrew is installed
- If not, you can get it from https://brew.sh
- Install all dependencies by running the following in the terminal:
- brew install gperftools help2man pcre icu4c perl518 gawk autoconf automake pkg-config cmake wget gcc
- Note that if you have a slightly older version of macOS, you'll want to use
apple-gcc42
instead ofgcc
curl https://apertium.projectjj.com/osx/install-nightly.sh | sudo zsh
- Then type your password
- Note that you'll probably need to type your sudo password, and the prompt may be covered up by the curl display.
- Note also that if you have an old version of macOS, you may need
bash
instead ofzsh
Basic Installation Using Macports[edit]
- Make sure XCode is installed
- If not, download it from http://developer.apple.com/xcode/
- Be sure to include Command Line Tools
- (http://railsapps.github.io/xcode-command-line-tools.html is nice guide if you get stuck here)
- Make sure Macports is installed
- If not, download it from http://www.macports.org/install.php
- Install all dependencies by running the following in the terminal:
- sudo port install autoconf automake expat flex \
- gettext gperf help2man libiconv libtool \
- libxml2 libxslt m4 ncurses p5-locale-gettext \
- pcre perl5 pkgconfig zlib gawk icu cmake boost gperftools
curl https://apertium.projectjj.com/osx/install-nightly.sh | sudo bash
Language data packages[edit]
If you've installed tools with install-nightly.sh, you can install language data with https://apertium.projectjj.com/osx/install-nightly-data.sh .
First, download the script and make it executable
curl https://apertium.projectjj.com/osx/install-nightly-data.sh chmod +x install-nightly-data.sh
If the curl command does not deliver the install-nightly-data.sh, just download it via your browser (click the link). Remeember to remove the .txt part the browser added to the filename. then run the chmod +x command as shown.
Then to install a language pair:
./install-nightly-data.sh apertium-eng-deu
and try it out:
echo 'Hello world' | apertium eng-deu
This language date is compiled nightly from git versions, but you'll have to re-run the script to get new versions.
The script can only fetch what's there. You can see available language pairs / packages at:
Remember, you need to install tools first (see above sections).
There is also a script for release versions of pairs, https://apertium.projectjj.com/osx/install-release-data.sh , which can fetch the pairs listed at:
Compiling from Source[edit]
If you're here because one of the previous sections didn't work, log on to IRC and describe what went wrong.
You probably want Prerequisites for Mac OS X which gives you all the dev tools you might want – this page has more in-depth documentation on compiling the core/dev tools from source.
There are two main options for installing, "system" and "local":
- Apertium on Mac OS X (System) — The fastest and easiest way is to install in your main system path (that is in
/usr/local
), choose this if you have root access on your system. - Apertium on Mac OS X (Local) — The second way is to install locally (that is in your home directory, e.g.
/Users/myname/Local
), this is more contained but slower and more difficult, choose this if you don't have root, or want to make the Apertium installation completely separated from your main system. This can be better for developers.
If you do not have any experience compiling source code, you can also follow the more user-friendly Mac guide Apertium on Mac OS X (User), which walks you through every step.