Erlang port of libphonenumber
- This project is active. I'm doing updates very offen because I see the original author is no longer maintaining it.
- Compatible with both
rebar
andrebar3
orhex
- To change the
libphonenumber
version modify inrebar.config
theTAG
argument sent tomake
In order to compile you need to make sure all dependencies needed to build libphonenumber
are already installed.
Next you can find a resume for each operating system where library was tested but in case you encounter problems you can
consult as well the documentation from building libphonenumber
located here
On the latest versions it's enough to do:
sudo apt-get install cmake cmake-curses-gui libgtest-dev libre2-dev libicu-dev
sudo apt-get install libboost-dev libboost-thread-dev libboost-system-dev
sudo apt-get install libprotobuf-dev protobuf-compiler
In case you are using Ubuntu 14.04
also follow the following steps in order to install libre
and cmake-3
:
sudo apt-get remove cmake cmake-data
sudo -E add-apt-repository -y ppa:george-edison55/cmake-3.x
sudo -E apt-get update
sudo apt-get install cmake
wget http://mt.archive.ubuntu.com/ubuntu/pool/universe/r/re2/libre2-1_20140304+dfsg-2_amd64.deb -O libre2-1.deb
wget http://es.archive.ubuntu.com/ubuntu/pool/universe/r/re2/libre2-dev_20140304+dfsg-2_amd64.deb -O libre2-dev.deb
sudo dpkg -i libre2*.deb
The same as for Ubuntu
sudo apt-get install cmake cmake-curses-gui libgtest-dev libre2-dev libicu-dev
sudo apt-get install libboost-dev libboost-thread-dev libboost-system-dev
sudo apt-get install libprotobuf-dev protobuf-compiler
Enable EPEL (for RE2 & gtest):
sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
And install packages:
sudo yum install cmake git boost-devel gtest-devel libicu-devel protobuf-devel protobuf-compiler re2-devel
On Mac OS
make sure you have brew
installed and rebar will automatically install all necessary dependencies.
In order to do this make sure the application is started then use phonenumber_to_carrier:carrier_for_number/2
method
application:ensure_all_started(elibphonenumber).
phonenumber_to_carrier:carrier_for_number(<<"44743655551">>, <<"en">>).
rebar3 eunit