mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 02:58:07 +00:00
README: add getting started instructions
This commit is contained in:
parent
f8f7397113
commit
d1d85f0554
2 changed files with 100 additions and 54 deletions
42
README.md
42
README.md
|
|
@ -1,5 +1,22 @@
|
|||
[](https://travis-ci.org/BelledonneCommunications/linphone-iphone)
|
||||
|
||||
Linphone is a free VoIP and video softphone based on the SIP protocol.
|
||||
|
||||

|
||||
|
||||
# Getting started
|
||||
|
||||
Here's how to launch Linphone for iPhone (more details below):
|
||||
|
||||
1. Install [Xcode from AppStore](https://itunes.apple.com/us/app/Xcode/id497799835?mt=12#).
|
||||
2. Install [HomeBrew, a package manager for OS X](http://brew.sh) (MacPorts is supported but deprecated).
|
||||
3. Install Linphone dependencies: open iTerm.app in the current directory and list dependencies to install using:
|
||||
`./prepare.py`
|
||||
4. Build SDK (see below for options and explanations):
|
||||
`./prepare.py -c && ./prepare.py && make`
|
||||
5. Open linphone.xcodeproj in Xcode: `open linphone.xcodeproj`
|
||||
6. Press `⌘R` and voilà!
|
||||
|
||||
# Building the SDK
|
||||
|
||||
Linphone for iPhone depends on liblinphone SDK. This SDK is generated from makefiles and shell scripts.
|
||||
|
|
@ -12,19 +29,18 @@ Linphone for iPhone depends on liblinphone SDK. This SDK is generated from makef
|
|||
|
||||
## Licensing: GPL third parties versus non GPL third parties
|
||||
|
||||
This SDK can be generated in 2 flavors.
|
||||
This SDK can be generated in 2 flavors:
|
||||
|
||||
* When choosing using GPL third parties, it means liblinphone includes GPL third parties like FFmpeg or X264. If you choose this flavor, your final application must comply with GPL in any case. This is the default mode.
|
||||
* GPL third parties enabled means that liblinphone includes GPL third parties like FFmpeg or X264. If you choose this flavor, your final application **must comply with GPL in any case**. This is the default mode.
|
||||
|
||||
* When choosing NOT using GPL third parties, Linphone will only use non GPL code except for `liblinphone`, `mediastreamer2`, `oRTP` and `belle-sip`.
|
||||
If you choose this flavor, your final application is still subject to GPL except if you have a commercial license for liblinphone, mediastreamer2, oRTP, belle-sip.
|
||||
To generate the liblinphone multi arch SDK in non GPL mode, do:
|
||||
* NO GPL third parties means that Linphone will only use non GPL code except for `liblinphone`, `mediastreamer2`, `oRTP` and `belle-sip`. If you choose this flavor, your final application is **still subject to GPL except if you have a [commercial license for the mentioned libraries](http://www.belledonne-communications.com/products.html)**.
|
||||
To generate the liblinphone multi arch SDK without GPL third parties, invoke:
|
||||
|
||||
./prepare.py -DENABLE_GPL_THIRD_PARTIES=NO [other options] && make
|
||||
./prepare.py -DENABLE_GPL_THIRD_PARTIES=OFF [other options] && make
|
||||
|
||||
## Customizing features
|
||||
|
||||
You can choose to enable / disable features such as custom audio / video codecs, media encryption, etc. To get a list of all features, the simplest way is to invoke `prepare.py` with `--list-features`:
|
||||
You can choose to enable/disable features such as custom audio/video codecs, media encryption, etc. To get a list of all features, the simplest way is to invoke `prepare.py` with `--list-features`:
|
||||
|
||||
./prepare.py --list-features
|
||||
|
||||
|
|
@ -41,7 +57,7 @@ You can for instance enable X264 by using:
|
|||
- 64 bits x86_64 for simulator for all ARM64 devices.
|
||||
- 32 bits i386 for simulator for all ARMv7 older devices.
|
||||
|
||||
Note: We are not compiling for the 32 bits i386 simulator by default because xCode default device (iPhone 6) runs in 64 bits. If you want to enable it, you should invoke `prepare.py` with `i386` argument: `./prepare.py i386 [other options]`.
|
||||
Note: We are not compiling for the 32 bits i386 simulator by default because Xcode default device (iPhone 6) runs in 64 bits. If you want to enable it, you should invoke `prepare.py` with `i386` argument: `./prepare.py i386 [other options]`.
|
||||
|
||||
## Upgrading your iOS SDK
|
||||
|
||||
|
|
@ -55,24 +71,24 @@ After the SDK is built, just open the Linphone Xcode project with Xcode, and pre
|
|||
|
||||
## Note regarding third party components subject to license
|
||||
|
||||
The liblinphone-sdk is compiled with third parties code that are subject to patent license, specially: AMR, SILK G729 and H264 codecs.
|
||||
The liblinphone SDK is compiled with third parties code that are subject to patent license, specially: AMR, SILK G729 and H264 codecs.
|
||||
Linphone controls the embedding of these codecs thanks to the preprocessor macros HAVE_SILK, HAVE_AMR, HAVE_G729 HAVE_OPENH264 positioned in Xcode project.
|
||||
Before embedding these 4 codecs in the final application, make sure to have the right to do so.
|
||||
Before embedding these 4 codecs in the final application, **make sure to have the right to do so**.
|
||||
|
||||
# Testing the application
|
||||
|
||||
We are using the KIF framework to test the UI of Linphone. It is used as a submodule (instead of CocoaPods) for ease.
|
||||
|
||||
Simply press `Command + U` and the default simulator / device will launch and try to pass all the tests.
|
||||
Simply press `⌘U` and the default simulator / device will launch and try to pass all the tests.
|
||||
|
||||
|
||||
# Limitations and known bugs
|
||||
|
||||
* Video capture will not work in simulator (not implemented in simulator).
|
||||
* Video capture will not work in simulator (not implemented in it).
|
||||
|
||||
# Debugging the SDK
|
||||
|
||||
Sometime it can be useful to step into liblinphone SDK functions. To allow XCode to enable breakpoint within liblinphone, SDK must be built with debug symbols by using option `--debug`:
|
||||
Sometime it can be useful to step into liblinphone SDK functions. To allow Xcode to enable breakpoint within liblinphone, SDK must be built with debug symbols by using option `--debug`:
|
||||
|
||||
./prepare.py --debug [other options] && make
|
||||
|
||||
|
|
|
|||
112
prepare.py
112
prepare.py
|
|
@ -37,7 +37,7 @@ try:
|
|||
import prepare
|
||||
except:
|
||||
error(
|
||||
"Could not find prepare module, probably missing submodules/cmake-builder? Try running git submodule update --init --recursive")
|
||||
"Could not find prepare module, probably missing submodules/cmake-builder? Try running:\ngit submodule update --init --recursive")
|
||||
exit(1)
|
||||
|
||||
|
||||
|
|
@ -115,24 +115,24 @@ def gpl_disclaimer(platforms):
|
|||
gpl_third_parties_enabled = ("ENABLE_GPL_THIRD_PARTIES:BOOL=ON" in open(cmakecache).read())
|
||||
|
||||
if gpl_third_parties_enabled:
|
||||
warning("***************************************************************************\n"
|
||||
"***************************************************************************\n"
|
||||
"***** CAUTION, this liblinphone SDK is built using 3rd party GPL code *****\n"
|
||||
"***** Even if you acquired a proprietary license from Belledonne *****\n"
|
||||
"***** Communications, this SDK is GPL and GPL only. *****\n"
|
||||
"***** To disable 3rd party gpl code, please use: *****\n"
|
||||
"***** $ ./prepare.py -DENABLE_GPL_THIRD_PARTIES=NO *****\n"
|
||||
"***************************************************************************\n"
|
||||
"***************************************************************************\n")
|
||||
warning("\n***************************************************************************"
|
||||
"\n***************************************************************************"
|
||||
"\n***** CAUTION, this liblinphone SDK is built using 3rd party GPL code *****"
|
||||
"\n***** Even if you acquired a proprietary license from Belledonne *****"
|
||||
"\n***** Communications, this SDK is GPL and GPL only. *****"
|
||||
"\n***** To disable 3rd party gpl code, please use: *****"
|
||||
"\n***** $ ./prepare.py -DENABLE_GPL_THIRD_PARTIES=NO *****"
|
||||
"\n***************************************************************************"
|
||||
"\n***************************************************************************")
|
||||
else:
|
||||
warning("*****************************************************************\n"
|
||||
"*****************************************************************\n"
|
||||
"***** Linphone SDK without 3rd party GPL software *****\n"
|
||||
"***** If you acquired a proprietary license from Belledonne *****\n"
|
||||
"***** Communications, this SDK can be used to create *****\n"
|
||||
"***** a proprietary linphone-based application. *****\n"
|
||||
"*****************************************************************\n"
|
||||
"*****************************************************************\n")
|
||||
warning("\n***************************************************************************"
|
||||
"\n***************************************************************************"
|
||||
"\n***** Linphone SDK without 3rd party GPL software *****"
|
||||
"\n***** If you acquired a proprietary license from Belledonne *****"
|
||||
"\n***** Communications, this SDK can be used to create *****"
|
||||
"\n***** a proprietary linphone-based application. *****"
|
||||
"\n***************************************************************************"
|
||||
"\n***************************************************************************")
|
||||
|
||||
|
||||
def extract_libs_list():
|
||||
|
|
@ -149,36 +149,72 @@ def extract_libs_list():
|
|||
return list(set(l))
|
||||
|
||||
|
||||
missing_dependencies = {}
|
||||
|
||||
|
||||
def check_is_installed(binary, prog=None, warn=True):
|
||||
if not find_executable(binary):
|
||||
|
||||
if warn:
|
||||
error("Could not find {}. Please install {}.".format(binary, prog))
|
||||
missing_dependencies[binary] = prog
|
||||
# error("Could not find {}. Please install {}.".format(binary, prog))
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
def detect_package_manager():
|
||||
if find_executable("brew"):
|
||||
return "brew"
|
||||
elif find_executable("port"):
|
||||
return "sudo port"
|
||||
else:
|
||||
error(
|
||||
"No package manager found. Please README or install brew using:\n\truby -e \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)\"")
|
||||
return "brew"
|
||||
|
||||
|
||||
def check_tools():
|
||||
package_manager_info = {"brew-pkg-config": "pkg-config",
|
||||
"sudo port-pkg-config": "pkgconfig",
|
||||
"brew-binary-path": "/usr/local/bin/",
|
||||
"sudo port-binary-path": "/opt/local/bin/"
|
||||
}
|
||||
reterr = 0
|
||||
|
||||
if " " in os.path.dirname(os.path.realpath(__file__)):
|
||||
error("Invalid location: linphone-iphone path should not contain any spaces.")
|
||||
reterr = 1
|
||||
|
||||
for prog in ["autoconf", "automake", "pkg-config", "doxygen", "java", "nasm", "cmake", "wget", "yasm", "optipng"]:
|
||||
reterr |= not check_is_installed(prog, "it")
|
||||
for prog in ["autoconf", "automake", "doxygen", "java", "nasm", "cmake", "wget", "yasm", "optipng"]:
|
||||
reterr |= not check_is_installed(prog, prog)
|
||||
|
||||
reterr |= not check_is_installed("pkg-config", package_manager_info[detect_package_manager() + "-pkg-config"])
|
||||
reterr |= not check_is_installed("ginstall", "coreutils")
|
||||
reterr |= not check_is_installed("intltoolize", "intltool")
|
||||
reterr |= not check_is_installed("convert", "imagemagick")
|
||||
|
||||
if find_executable("nasm"):
|
||||
nasm_output = Popen("nasm -f elf32".split(" "), stderr=PIPE, stdout=PIPE).stderr.read()
|
||||
if "fatal: unrecognised output format" in nasm_output:
|
||||
missing_dependencies["nasm"] = "nasm"
|
||||
reterr = 1
|
||||
|
||||
if check_is_installed("libtoolize", warn=False):
|
||||
if not check_is_installed("glibtoolize", "libtool"):
|
||||
glibtoolize_path = find_executable(glibtoolize)
|
||||
reterr = 1
|
||||
error = "Please do a symbolic link from glibtoolize to libtoolize: 'ln -s {} ${}'."
|
||||
error(error.format(glibtoolize_path, glibtoolize_path.replace("glibtoolize", "libtoolize")))
|
||||
msg = "Please do a symbolic link from glibtoolize to libtoolize:\n\tln -s {} ${}"
|
||||
error(msg.format(glibtoolize_path, glibtoolize_path.replace("glibtoolize", "libtoolize")))
|
||||
|
||||
# list all missing packages to install
|
||||
if missing_dependencies:
|
||||
error("The following binaries are missing: {}. Please install them using:\n\t{} install {}".format(
|
||||
" ".join(missing_dependencies.keys()),
|
||||
detect_package_manager(),
|
||||
" ".join(missing_dependencies.values())))
|
||||
|
||||
devnull = open(os.devnull, 'wb')
|
||||
# just ensure that JDK is installed - if not, it will automatiaclyl display a popup to user
|
||||
# just ensure that JDK is installed - if not, it will automatically display a popup to user
|
||||
p = Popen("java -version".split(" "), stderr=devnull, stdout=devnull)
|
||||
p.wait()
|
||||
if p.returncode != 0:
|
||||
|
|
@ -186,20 +222,17 @@ def check_tools():
|
|||
reterr = 1
|
||||
|
||||
# needed by x264
|
||||
check_is_installed("gas-preprocessor.pl", """it:
|
||||
wget --no-check-certificate https://raw.github.com/yuvi/gas-preprocessor/master/gas-preprocessor.pl
|
||||
chmod +x gas-preprocessor.pl
|
||||
sudo mv gas-preprocessor.pl /usr/local/bin/""")
|
||||
|
||||
nasm_output = Popen("nasm -f elf32".split(" "), stderr=PIPE, stdout=PIPE).stderr.read()
|
||||
if "fatal: unrecognised output format" in nasm_output:
|
||||
error(
|
||||
"Invalid version of nasm: your version does not support elf32 output format. If you have installed nasm, please check that your PATH env variable is set correctly.")
|
||||
if not find_executable("gas-preprocessor.pl"):
|
||||
error("""Could not find gas-preprocessor.pl, please install it:
|
||||
wget --no-check-certificate https://raw.github.com/yuvi/gas-preprocessor/master/gas-preprocessor.pl && \\
|
||||
chmod +x gas-preprocessor.pl && \\
|
||||
sudo mv gas-preprocessor.pl {}""".format(package_manager_info[detect_package_manager() + "-binary-path"]))
|
||||
reterr = 1
|
||||
|
||||
if not os.path.isdir("submodules/linphone/mediastreamer2") or not os.path.isdir("submodules/linphone/oRTP"):
|
||||
error("Missing some git submodules. Did you run:\n\tgit submodule update --init --recursive")
|
||||
reterr = 1
|
||||
|
||||
if not os.path.isdir("submodules/linphone/mediastreamer2") or not os.path.isdir("submodules/linphone/oRTP"):
|
||||
error("Missing some git submodules. Did you run 'git submodule update --init --recursive'?")
|
||||
reterr = 1
|
||||
p = Popen("xcrun --sdk iphoneos --show-sdk-path".split(" "), stdout=devnull, stderr=devnull)
|
||||
p.wait()
|
||||
if p.returncode != 0:
|
||||
|
|
@ -211,12 +244,9 @@ def check_tools():
|
|||
sdk_strings_path = "{}/{}".format(sdk_platform_path, "Developer/usr/bin/strings")
|
||||
if not os.path.isfile(sdk_strings_path):
|
||||
strings_path = find_executable("strings")
|
||||
error("strings binary missing, please run 'sudo ln -s {} {}'.".format(strings_path, sdk_strings_path))
|
||||
error("strings binary missing, please run:\n\tsudo ln -s {} {}".format(strings_path, sdk_strings_path))
|
||||
reterr = 1
|
||||
|
||||
if reterr == 1:
|
||||
error("Failed to detect required tools, aborting.")
|
||||
|
||||
return reterr
|
||||
|
||||
|
||||
|
|
@ -504,7 +534,7 @@ def main(argv=None):
|
|||
tmptarget = IOSarm64Target()
|
||||
|
||||
option_regex = re.compile("ENABLE_(.*):(.*)=(.*)")
|
||||
option_list = [ "" ]
|
||||
option_list = [""]
|
||||
for line in Popen(tmptarget.cmake_command("Debug", False, True, additional_args),
|
||||
cwd=tmpdir, shell=False, stdout=PIPE).stdout.readlines():
|
||||
match = option_regex.match(line)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue