fix warning on linux builds and update docs

This commit is contained in:
richard 2022-08-11 22:10:15 +01:00
parent 3e011b329a
commit 3ac76b8aaa
32 changed files with 27346 additions and 21511 deletions

View file

@ -1,21 +1,25 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8" />
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Building from source &mdash; Raylib Python documentation</title><link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<title>Building from source &mdash; Raylib Python documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/graphviz.css" type="text/css" />
<!--[if lt IE 9]>
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->
<script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Raspberry Pi" href="RPI.html" />
<link rel="prev" title="Dynamic Bindings" href="dynamic.html" />
</head>
@ -34,9 +38,9 @@
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption"><span class="caption-text">Contents:</span></p>
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="README.html">Python Bindings for Raylib 4.0.0</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html">Python Bindings for Raylib 4.2</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#quickstart">Quickstart</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#installation">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#how-to-use">How to use</a></li>
@ -56,11 +60,11 @@
<li class="toctree-l3"><a class="reference internal" href="#windows-manual-build">Windows manual build</a></li>
<li class="toctree-l3"><a class="reference internal" href="#linux-manual-build">Linux manual build</a></li>
<li class="toctree-l3"><a class="reference internal" href="#macos-manual-build">Macos manual build</a></li>
<li class="toctree-l3"><a class="reference internal" href="#raspberry-pi">Raspberry Pi</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="RPI.html">Raspberry Pi</a></li>
</ul>
</div>
@ -87,14 +91,15 @@
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="building-from-source">
<section id="building-from-source">
<h1>Building from source<a class="headerlink" href="#building-from-source" title="Permalink to this headline"></a></h1>
<div class="section" id="have-pip-build-from-source">
<section id="have-pip-build-from-source">
<h2>Have Pip build from source<a class="headerlink" href="#have-pip-build-from-source" title="Permalink to this headline"></a></h2>
<p>This is useful if the binaries dont work on your system, or you want to use a newer version of Raylib.</p>
<p>First make sure Raylib is installed. On Linux/Mac it must include the pkg-config files. Best way to ensure this
is to compile and install Raylib using CMake: <a class="reference external" href="https://github.com/raysan5/raylib/wiki/Working-on-GNU-Linux#build-raylib-using-cmake">https://github.com/raysan5/raylib/wiki/Working-on-GNU-Linux#build-raylib-using-cmake</a></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">cd</span> <span class="n">raylib</span><span class="o">-</span><span class="mf">4.0</span><span class="o">.</span><span class="mi">0</span>
<p>Requirements for build: cmake, pkg-config.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">cd</span> <span class="n">raylib</span><span class="o">-</span><span class="mf">4.2.0</span>
<span class="n">mkdir</span> <span class="n">build</span>
<span class="n">cd</span> <span class="n">build</span>
<span class="n">cmake</span> <span class="o">-</span><span class="n">DWITH_PIC</span><span class="o">=</span><span class="n">on</span> <span class="o">-</span><span class="n">DCMAKE_BUILD_TYPE</span><span class="o">=</span><span class="n">Release</span> <span class="o">..</span>
@ -106,8 +111,8 @@ is to compile and install Raylib using CMake: <a class="reference external" href
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">pip3</span> <span class="n">install</span> <span class="o">--</span><span class="n">no</span><span class="o">-</span><span class="n">binary</span> <span class="n">raylib</span> <span class="o">--</span><span class="n">upgrade</span> <span class="o">--</span><span class="n">force</span><span class="o">-</span><span class="n">reinstall</span> <span class="n">raylib</span>
</pre></div>
</div>
</div>
<div class="section" id="or-build-from-source-manually">
</section>
<section id="or-build-from-source-manually">
<h2>Or, Build from source manually<a class="headerlink" href="#or-build-from-source-manually" title="Permalink to this headline"></a></h2>
<p>Useful if the Pip build doesnt work and you want to debug it, or you want to contribute to the
project.</p>
@ -118,7 +123,7 @@ fixed it, a PR.)</p>
</div>
<p>Manual instructions follow, but may be outdated, so see also how we actually build the wheels
at <a class="reference external" href="https://github.com/electronstudio/raylib-python-cffi/blob/master/.github/workflows/build.yml">https://github.com/electronstudio/raylib-python-cffi/blob/master/.github/workflows/build.yml</a></p>
<div class="section" id="windows-manual-build">
<section id="windows-manual-build">
<h3>Windows manual build<a class="headerlink" href="#windows-manual-build" title="Permalink to this headline"></a></h3>
<p>Clone this repo including submodules so you get correct version of
Raylib.</p>
@ -154,13 +159,13 @@ Raylib.</p>
Would be useful if some Windows user could figure out how to auto detect this.</p>
</div>
<p>Then install it:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">pip3</span> <span class="n">install</span> <span class="n">dist</span>\<span class="n">raylib</span><span class="o">-</span><span class="mf">3.7</span><span class="o">.</span><span class="mi">0</span><span class="o">-</span><span class="n">cp37</span><span class="o">-</span><span class="n">cp37m</span><span class="o">-</span><span class="n">win_amd64</span><span class="o">.</span><span class="n">whl</span>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">pip3</span> <span class="n">install</span> <span class="n">dist</span>\<span class="n">raylib</span><span class="o">-</span><span class="mf">3.7.0</span><span class="o">-</span><span class="n">cp37</span><span class="o">-</span><span class="n">cp37m</span><span class="o">-</span><span class="n">win_amd64</span><span class="o">.</span><span class="n">whl</span>
</pre></div>
</div>
<p>(Note: your wheels filename will probably be different than the one
here.)</p>
</div>
<div class="section" id="linux-manual-build">
</section>
<section id="linux-manual-build">
<h3>Linux manual build<a class="headerlink" href="#linux-manual-build" title="Permalink to this headline"></a></h3>
<p>Clone this repo including submodules so you get correct version of
Raylib.</p>
@ -173,7 +178,7 @@ Raylib.</p>
<p>You can instead use a different version of Raylib you installed from elsewhere, and it should still
work!</p>
</div>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">sudo</span> <span class="n">apt</span> <span class="n">install</span> <span class="n">cmake</span> <span class="n">libasound2</span><span class="o">-</span><span class="n">dev</span> <span class="n">mesa</span><span class="o">-</span><span class="n">common</span><span class="o">-</span><span class="n">dev</span> <span class="n">libx11</span><span class="o">-</span><span class="n">dev</span> <span class="n">libxrandr</span><span class="o">-</span><span class="n">dev</span> <span class="n">libxi</span><span class="o">-</span><span class="n">dev</span> <span class="n">xorg</span><span class="o">-</span><span class="n">dev</span> <span class="n">libgl1</span><span class="o">-</span><span class="n">mesa</span><span class="o">-</span><span class="n">dev</span> <span class="n">libglu1</span><span class="o">-</span><span class="n">mesa</span><span class="o">-</span><span class="n">dev</span>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">sudo</span> <span class="n">apt</span> <span class="n">install</span> <span class="n">cmake</span> <span class="n">libasound2</span><span class="o">-</span><span class="n">dev</span> <span class="n">mesa</span><span class="o">-</span><span class="n">common</span><span class="o">-</span><span class="n">dev</span> <span class="n">libx11</span><span class="o">-</span><span class="n">dev</span> <span class="n">libxrandr</span><span class="o">-</span><span class="n">dev</span> <span class="n">libxi</span><span class="o">-</span><span class="n">dev</span> <span class="n">xorg</span><span class="o">-</span><span class="n">dev</span> <span class="n">libgl1</span><span class="o">-</span><span class="n">mesa</span><span class="o">-</span><span class="n">dev</span> <span class="n">libglu1</span><span class="o">-</span><span class="n">mesa</span><span class="o">-</span><span class="n">dev</span> <span class="n">pkg</span><span class="o">-</span><span class="n">config</span> <span class="n">cmake</span>
<span class="n">cd</span> <span class="n">raylib</span><span class="o">-</span><span class="n">python</span><span class="o">-</span><span class="n">cffi</span><span class="o">/</span><span class="n">raylib</span><span class="o">-</span><span class="n">c</span>
<span class="n">mkdir</span> <span class="n">build</span>
<span class="n">cd</span> <span class="n">build</span>
@ -195,7 +200,7 @@ work!</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">cd</span> <span class="o">../..</span>
</pre></div>
</div>
<p>Build</p>
<p>Build the Python library:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">pip3</span> <span class="n">install</span> <span class="n">cffi</span>
<span class="n">rm</span> <span class="o">-</span><span class="n">rf</span> <span class="n">build</span> <span class="n">raylib</span><span class="o">/</span><span class="n">_raylib_cffi</span><span class="o">.*</span>
<span class="n">python3</span> <span class="n">raylib</span><span class="o">/</span><span class="n">build</span><span class="o">.</span><span class="n">py</span>
@ -233,8 +238,8 @@ work!</p>
<p>Separate the instructions for preparing the dynamic module
from the instructions for building the static module!</p>
</div>
</div>
<div class="section" id="macos-manual-build">
</section>
<section id="macos-manual-build">
<h3>Macos manual build<a class="headerlink" href="#macos-manual-build" title="Permalink to this headline"></a></h3>
<p>These instructions have been tested on Macos 10.14.</p>
<p>Clone this repo including submodules so you get correct version of
@ -260,44 +265,16 @@ Raylib.</p>
<span class="n">python3</span> <span class="n">setup</span><span class="o">.</span><span class="n">py</span> <span class="n">install</span>
</pre></div>
</div>
</div>
<div class="section" id="raspberry-pi">
<h3>Raspberry Pi<a class="headerlink" href="#raspberry-pi" title="Permalink to this headline"></a></h3>
<p>Latest info: <a class="reference external" href="https://github.com/electronstudio/raylib-python-cffi/issues/55#issuecomment-1012629701">https://github.com/electronstudio/raylib-python-cffi/issues/55#issuecomment-1012629701</a></p>
<p>Old possibly out of date info that was written for RPi3 and Raylib 3 follows.</p>
<p>The integrated GPU hardware in a Raspberry Pi (“VideoCore”) is rather
idiosyncratic, resulting in a complex set of software options. Probably
the most interesting two options for Raylib applications are:</p>
<ol class="arabic simple">
<li><p>Use the Broadcom proprietary Open GL ES 2.0 drivers, installed by
Raspbian into <code class="docutils literal notranslate"><span class="pre">/opt/vc</span></code>. These are 32-bit only, and currently X11
doesnt use these for its acceleration, so this is most suitable for
driving the entire HDMI output from one application with minimal
overhead (no X11).</p></li>
<li><p>Use the more recent open-source <code class="docutils literal notranslate"><span class="pre">vc4-fkms-v3d</span></code> kernel driver. This
can run in either 32-bit or 64-bit, and X11 can use these, so using
X11 is probably the more common choice here.</p></li>
</ol>
<p>With option 2, the regular linux install instructions above should
probably work as-is.</p>
<p>For option 1, then also follow the above instructions, but with these
modifications:</p>
<ul class="simple">
<li><p>With <code class="docutils literal notranslate"><span class="pre">cmake</span></code>, use
<code class="docutils literal notranslate"><span class="pre">cmake</span> <span class="pre">-DWITH_PIC=on</span> <span class="pre">-DSTATIC=on</span> <span class="pre">-DSHARED=on</span> <span class="pre">-DPLATFORM='Raspberry</span> <span class="pre">Pi'</span> <span class="pre">..</span></code></p></li>
</ul>
<p>(See
<a class="reference external" href="https://github.com/electronstudio/raylib-python-cffi/issues/31#issuecomment-862078330">here</a>
for a Raspberry Pi wheel)</p>
</div>
</div>
</div>
</section>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="dynamic.html" class="btn btn-neutral float-left" title="Dynamic Bindings" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="RPI.html" class="btn btn-neutral float-right" title="Raspberry Pi" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>