[Windows] Fix driver version detection of AMD RDNA+ GPU on Windows 10
[xbmc.git] / docs / README.FreeBSD.md
blob7b3867c0fd04ad878de83b47771ebbbdc5c63540
1 ![Kodi Logo](resources/banner_slim.png)
3 # FreeBSD build guide
4 This guide has been tested with FreeBSD 12.1 x86_64. Please read it in full before you proceed to familiarize yourself with the build procedure.
6 Several other distributions have **[specific build guides](README.md)** and a general **[Linux build guide](README.Linux.md)** is also available.
8 ## Table of Contents
9 1. **[Document conventions](#1-document-conventions)**
10 2. **[Get the source code](#2-get-the-source-code)**
11 3. **[Install the required packages](#3-install-the-required-packages)**  
12   3.1. **[Build missing dependencies](#31-build-missing-dependencies)**
13 4. **[Build Kodi](#4-build-kodi)**  
14   4.1. **[Configure build](#41-configure-build)**  
15   4.2. **[Build](#42-build)**
16 5. **[Build binary add-ons](#5-build-binary-add-ons)**
17 6. **[Run Kodi](#6-run-kodi)**
18 7. **[Uninstall Kodi](#7-uninstall-kodi)**
19 8. **[Test suite](#8-test-suite)**
21 ## 1. Document conventions
22 This guide assumes you are using `terminal`, also known as `console`, `command-line` or simply `cli`. Commands need to be run at the terminal, one at a time and in the provided order.
24 This is a comment that provides context:
25 ```
26 this is a command
27 this is another command
28 and yet another one
29 ```
31 **Example:** Clone Kodi's current master branch:
32 ```
33 git clone https://github.com/xbmc/xbmc kodi
34 ```
36 Commands that contain strings enclosed in angle brackets denote something you need to change to suit your needs.
37 ```
38 git clone -b <branch-name> https://github.com/xbmc/xbmc kodi
39 ```
41 **Example:** Clone Kodi's current Krypton branch:
42 ```
43 git clone -b Krypton https://github.com/xbmc/xbmc kodi
44 ```
46 Several different strategies are used to draw your attention to certain pieces of information. In order of how critical the information is, these items are marked as a note, tip, or warning. For example:
48 > [!NOTE]  
49 > Linux is user friendly... It's just very particular about who its friends are.
51 > [!TIP]
52 > Algorithm is what developers call code they do not want to explain.
54 > [!WARNING]  
55 > Developers don't change light bulbs. It's a hardware problem.
57 **[back to top](#table-of-contents)** | **[back to section top](#1-document-conventions)**
59 ## 2. Get the source code
60 Make sure `git` is installed:
61 ```
62 sudo pkg install git
63 ```
65 Change to your `home` directory:
66 ```
67 cd $HOME
68 ```
70 Clone Kodi's current master branch:
71 ```
72 git clone https://github.com/xbmc/xbmc kodi
73 ```
75 **[back to top](#table-of-contents)**
77 ## 3. Install the required packages
78 If you get a `package not found` type of message with the below command, remove the offending package(s) from the install list and reissue the command. Take a note of the missing dependencies and, after a successful step completion, **[build the missing dependencies manually](#31-build-missing-dependencies)**.
80 > [!NOTE]  
81 > Kodi requires a compiler with C++17 support, i.e. gcc >= 7 or clang >= 5
83 Install build dependencies:
84 ```
85 sudo pkg install autoconf automake avahi-app binutils cmake curl dbus doxygen e2fsprogs-libuuid enca encodings flac flatbuffers font-util fontconfig freetype2 fribidi fstrcmp gawk gettext-tools giflib git glew gmake gmp gnutls googletest gperf gstreamer1-vaapi hal jpeg-turbo libaacs libass libbdplus libbluray libcapn libcdio libcec libedit libfmt libgcrypt libgpg-error libidn libinotify libmicrohttpd libnfs libogg libplist librtmp libtool libudev-devd libva libvdpau libvorbis libxslt lirc lzo2 m4 mesa-libs mysql57-client nasm openjdk8 p8-platform pkgconf python3 rapidjson shairplay sndio sqlite3 swig30 taglib tiff tinyxml tinyxml2 xf86-input-keyboard xf86-input-mouse xorg-server xrandr zip
86 ```
88 > [!WARNING]  
89 > Make sure you copy paste the entire line or you might receive an error or miss a few dependencies.
91 > [!NOTE]  
92 > For developers and anyone else who builds frequently it is recommended to install `ccache` to expedite subsequent builds of Kodi.
94 You can install it with:
95 ```
96 sudo pkg install ccache
97 ```
99 > [!TIP]
100 > If you have multiple computers at home, `distcc` will distribute build workloads of C and C++ code across several machines on a network. Team Kodi may not be willing to give support if problems arise using such a build configuration.
102 You can install it with:
104 sudo pkg install distcc
107 ### 3.1. Build missing dependencies
108 See the general **[Linux build guide](README.Linux.md)** for reference.
110 **[back to top](#table-of-contents)** | **[back to section top](#3-install-the-required-packages)**
112 ## 4. Build Kodi
113 ### 4.1. Configure build
114 If you get a `Could NOT find...` error message during CMake configuration step, take a note of the missing dependencies and either install them from repositories (if available) or **[build the missing dependencies manually](#31-build-missing-dependencies)**.
116 Create an out-of-source build directory:
118 mkdir $HOME/kodi-build
121 Change to build directory:
123 cd $HOME/kodi-build
126 Configure build:
128 cmake ../kodi -DCMAKE_INSTALL_PREFIX=/usr/local
131 ### 4.2. Build
133 cmake --build . -- VERBOSE=1 -j$(sysctl hw.ncpu | awk '{print $2}')
135 > [!TIP]
136 > By adding `-j<number>` to the make command, you can choose how many concurrent jobs will be used and expedite the build process. It is recommended to use `-j$(sysctl hw.ncpu | awk '{print $2}')` to compile on all available processor cores.
138 After the build process completes successfully you can test your shiny new Kodi build while in the build directory:
140 ./kodi-x11
143 If everything was OK during your test you can now install the binaries to their place, in this example */usr/local*.
145 sudo gmake install
148 > [!NOTE]  
149 > `gmake` stands for *GNU Make*. BSD's own make does not work here.
151 This will install Kodi in the prefix provided in **[section 4.1](#41-configure-build)**.
153 > [!TIP]
154 > To override Kodi's install location, use `DESTDIR=<path>`. For example:
157 sudo gmake install DESTDIR=$HOME/kodi
160 **[back to top](#table-of-contents)** | **[back to section top](#4-build-kodi)**
162 ## 5. Build binary add-ons
163 You can find a complete list of available binary add-ons **[here](https://github.com/xbmc/repo-binary-addons)**.
165 Change to Kodi's source code directory:
167 cd $HOME/kodi
170 Build all add-ons:
172 sudo gmake -j$(sysctl hw.ncpu | awk '{print $2}') -C tools/depends/target/binary-addons PREFIX=/usr/local
175 Build specific add-ons:
177 sudo gmake -j$(sysctl hw.ncpu | awk '{print $2}') -C tools/depends/target/binary-addons PREFIX=/usr/local ADDONS="audioencoder.flac pvr.vdr.vnsi audiodecoder.snesapu"
180 Build a specific group of add-ons:
182 sudo gmake -j$(sysctl hw.ncpu | awk '{print $2}') -C tools/depends/target/binary-addons PREFIX=/usr/local ADDONS="pvr.*"
185 Clean-up binary add-ons:
187 sudo gmake -C tools/depends/target/binary-addons clean
190 For additional information on regular expression usage for ADDONS_TO_BUILD, view ADDONS_TO_BUILD section located at [Kodi add-ons CMake based buildsystem](../cmake/addons/README.md)
192 > [!NOTE]  
193 > `PREFIX=/usr/local` should match Kodi's `-DCMAKE_INSTALL_PREFIX=` prefix used in **[section 4.1](#41-configure-build)**.
195 **[back to top](#table-of-contents)**
197 ## 6. Run Kodi
198 If you chose to install Kodi using `/usr` or `/usr/local` as the `-DCMAKE_INSTALL_PREFIX=`, you can just issue *kodi* in a terminal session.
200 If you changed `-DCMAKE_INSTALL_PREFIX=` to install Kodi into some non-standard location, you will have to run Kodi directly:
202 <CMAKE_INSTALL_PREFIX>/bin/kodi
205 To run Kodi in *portable* mode (useful for testing):
207 <CMAKE_INSTALL_PREFIX>/bin/kodi -p
210 **[back to top](#table-of-contents)**
212 ## 7. Uninstall Kodi
214 sudo gmake uninstall
216 > [!WARNING]  
217 > If you reran CMakes' configure step with a different `-DCMAKE_INSTALL_PREFIX=`, you will need to rerun configure with the correct path for this step to work correctly.
219 If you would like to also remove any settings and third-party addons (skins, scripts, etc.) and Kodi configuration files, you should also run:
221 rm -rf ~/.kodi
224 **[back to top](#table-of-contents)**
226 ## 8. Test suite
227 Kodi has a test suite which uses the Google C++ Testing Framework. This framework is provided directly in Kodi's source tree.
229 Build and run Kodi's test suite:
231 gmake check
234 Build Kodi's test suite without running it:
236 gmake kodi-test
239 Run Kodi's test suite manually:
241 ./kodi-test
244 Show Kodi's test suite *help* notes:
246 ./kodi-test --gtest_help
249 Useful options:
251 --gtest_list_tests
252   List the names of all tests instead of running them.
253   The name of TEST(Foo, Bar) is "Foo.Bar".
255 --gtest_filter=POSITIVE_PATTERNS[-NEGATIVE_PATTERNS]
256   Run only the tests whose name matches one of the positive patterns but
257   none of the negative patterns. '?' matches any single character; '*'
258   matches any substring; ':' separates two patterns.
261 **[back to top](#table-of-contents)**