forked from coderholic/pyradio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.html
158 lines (158 loc) · 11.7 KB
/
build.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<title>PyRadio Build Instructions</title>
<style>
body {padding: 2em;}
@media screen and (max-width: 770px) {
body {padding: 10px;}
}
body {max-width: 750px; margin: auto;}
h2 {margin-top: 2.5em; border-bottom:1px solid SaddleBrown; color: SaddleBrown;}
h3 {margin-top: 2em; color: SaddleBrown; text-decoration: underline SaddleBrown}
h4 {margin-top: 2em; color: SaddleBrown;}
h4:before {content: "# "; font-size: 200%; font-weight: bold; vertical-align: middle;}
STRONG {color: SaddleBrown;}
dl {margin: 2em;}
dd {margin: 1em;}
dt {font-weight: bold;}
TABLE {border: 1px solid SaddleBrown; border-collapse: collapse; margin-left: auto; margin-right: auto; border-radius: 5px; -moz-border-radius: 5px; border-collapse:separate; box-shadow: 5px 5px 15px #888888;}
TH {text-align: left; vertical-align: top; padding: 5px;color: SaddleBrown;border: 1px solid SaddleBrown; background-color: SaddleBrown; color: white;}
TD {text-align: left; vertical-align: top; padding: 5px 10px;border: 1px solid SaddleBrown;}
pre { background-color: rgba(245, 245, 245, 1); color: #474747; padding: 1.5em; border: 1px solid #C7C7C7; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; overflow: auto; box-shadow: 5px 5px 15px #C7C7C7;}
.task-list {list-style-type: none; padding: 0; margin: 0 0 0 1em ;}
img{display: block; margin-left: auto; margin-right: auto; max-width: 750; width: 100%; background:transparent; padding:3px; border:1px solid #999999; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; box-shadow:5px 5px 15px #888888;}
a{ color: SaddleBrown;}
a:visited{color: SaddleBrown;}
</style>
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
<![endif]-->
</head>
<body>
<header id="title-block-header">
</header>
<h1 style="color: SaddleBrown"id="pyradio-build-instructions">PyRadio Build Instructions</h1>
<p><strong>PyRadio</strong>: Command line internet radio player.</p>
<p>Ben Dowling - <a target="_blank" href="https://github.com/coderholic">https://github.com/coderholic</a></p>
<h2 id="table-of-contents">Table of Contents <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></style></h2>
<!-- vim-markdown-toc Marked -->
<ul>
<li><a href="#current-state-of-the-project">Current state of the project</a>
<ul>
<li><a href="#what-does-it-all-mean-and-why-should-you-care">What does it all mean and why should you care</a></li>
</ul></li>
<li><a href="#preparing-for-the-installation">Preparing for the installation</a>
<ul>
<li><a href="#linux">Linux</a>
<ul>
<li><a href="#notice-for-python-2-users">Notice for Python 2 users</a></li>
<li><a href="#rasberry-pi-installation">Rasberry Pi installation</a></li>
</ul></li>
<li><a href="#macos">macOS</a></li>
<li><a href="#windows">Windows</a></li>
</ul></li>
<li><a href="#performing-the-installation">Performing the installation</a>
<ul>
<li><a href="#note-for-macos-users">Note for macOS users</a></li>
<li><a href="#updating-a-pre-0.8.9-installation">Updating a pre 0.8.9 installation</a></li>
</ul></li>
</ul>
<!-- vim-markdown-toc -->
<p><a href="README.html">[Return to main doc]</a></p>
<h2 id="current-state-of-the-project">Current state of the project <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></style></h2>
<p>Starting with version <strong>0.8.9.15</strong>, <strong>PyRadio</strong> has changed its installation method from invoking <em>setup.py</em> directly to <em>pip</em> (i.e. from “<em>python setup.py install</em>” to “<em>python -m pip .</em>”). This is a must for all <strong>Python</strong> projects in order to keep up with the latest developments. For more info, please refer to “<a target="_blank" href="https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html">Why you shouldn’t invoke setup.py directly</a>”.</p>
<h3 id="what-does-it-all-mean-and-why-should-you-care">What does it all mean and why should you care</h3>
<p>Moving to the <strong>pip</strong> way of doing things has its implications:</p>
<ol type="1">
<li><strong>PyRadio</strong> will be installed as a pip package.</p></li>
<li><strong>PyRadio</strong> will no longer be installed as a system-wide package.<br />
<br />
This means that after installing <strong>PyRadio</strong>, it will only be available to the current user. If another user wants to use it as well, he would have to install it again.<br />
<br />
In other words, in order to have a <strong>Pyradio system-wide installation</strong>, your distribution has to provide a package for it.</p></li>
<li>As I’m starting the procedure to move away from <em>Python 2</em>, <strong>PyRadio</strong> will not be compatible with it on <em>macOs</em> and <em>Windows</em> (but will still be on <em>Linux</em>, at least for the time being).</p></li>
</ol>
<h2 id="preparing-for-the-installation">Preparing for the installation <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></style></h2>
<p>Before installing <strong>PyRadio</strong> you have to prepare your system, so that you end up with a working installation. The process depends on the OS you are on.</p>
<h3 id="linux">Linux</h3>
<p>Use your distribution method to install</p>
<ol type="1">
<li><em>python-wheel</em></li>
<li><em>python-setuptools</em></li>
<li><em>python-requests</em></li>
<li><em>python-dnspython</em></li>
<li><em>python-psutil</em></li>
<li><em>sed</em></li>
<li>any one of <em>MPV</em>, <em>MPlayer</em> and/or <em>VLC</em>.</li>
</ol>
<h4 id="notice-for-python-2-users">Notice for Python 2 users</h4>
<p>If you are still using <strong>Python 2</strong>, plase make sure “<strong>pip</strong>” is installed. Execute the following command to verify its existance:</p>
<pre>python[2] -m pip list</pre>
<p>If you get a response, you are good to go. Otherwise, use your distro package manager to install it.</p>
<p>If your distro does not provide it (some do not anymore), use the following commands to get it:</p>
<pre>curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py
sudo python[2] get-pip.py</pre>
<p>When you are done, proceed to “<a href="#performing-the-installation">Performing the installation</a>”.</p>
<h4 id="rasberry-pi-installation">Rasberry Pi installation</h4>
<p>If installing on a Rasberry Pi, there are a couple of things you should be aware of:</p>
<ol type="1">
<li>The default player will be <strong>MPlayer</strong></li>
<li>If you still want to use <strong>MPV</strong>, please make sure you increase the <em>Connection timeout</em> value to at least 20 (sometimes even 30 for some machines). Even then, your machine may eventually crash, if it’s on the lower end of things and <strong>PyRadio</strong> is left running for hours.</li>
</ol>
<h3 id="macos">macOS</h3>
<p>First thing you do is install python dependencies (assuming python 3 is installed):</p>
<pre>python3 -m pip install --upgrade wheel setuptools requests dnspython psutil</pre>
<p>Everything else you need to install and run <strong>pyradio</strong> is available on <a target="_blank" href="https://github.com/Homebrew/homebrew">Homebrew</a>. If you haven’t already downloaded its client, go ahead and do it.</p>
<p>Open a <strong>terminal</strong> and type:</p>
<pre>/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"</pre>
<p>Depending on your macOS version, you may have to install <strong>sed</strong> too:</p>
<pre>brew install gnu-sed --default-names</pre>
<p>Now it’s time to install a media player. You are free to install any one of them or even more than one…</p>
<p>1. <strong><em>MPV</em></strong></p>
<pre>brew install mpv</pre>
<p>2. <strong><em>MPlayer</em></strong></p>
<pre>brew install mplayer</pre>
<p>3. <strong><em>VLC</em></strong></p>
<p>You can get VLC from the official site or from <a target="_blank" href="https://github.com/Homebrew/homebrew">Homebrew</a>.</p>
<p>a. <strong><em>Oficial package</em></strong></p>
<p>You just go to <a target="_blank" href="http://www.videolan.org/vlc/download-macos.html">videolan.org</a>, download and install the program as you usually do with any other application.</p>
<p>Finally, add a symbolic link to the executable as follows:</p>
<pre>sudo ln -s /Applications/VLC.app/Contents/MacOS/VLC /usr/local/bin/cvlc</pre>
<p>b. <strong><em>Homebrew package</em></strong></p>
<pre>brew cask install vlc
sudo ln -s /usr/local/bin/vlc /usr/local/bin/cvlc</pre>
<p>Your system is ready now for <strong>pyradio</strong> to be installed. You can follow the instructions given at “<a href="#performing-the-installation">Performing the installation</a>”.</p>
<h3 id="windows">Windows</h3>
<p>Windows installation is presented in its <a href="windows.html">own page</a>.</p>
<h2 id="performing-the-installation">Performing the installation <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></style></h2>
<p>First thing you do is get the installation script. Open a <strong>terminal</strong> and type:</p>
<pre>cd
wget https://raw.githubusercontent.com/coderholic/pyradio/master/pyradio/install.py</pre>
<p>or using curl:</p>
<pre>cd
curl -L https://raw.githubusercontent.com/coderholic/pyradio/master/pyradio/install.py -o install.py</pre>
<p><strong>Note</strong>: If you have neither <em>wget</em> or <em>curl</em> installed, just right click on <a target="_blank" href="https://raw.githubusercontent.com/coderholic/pyradio/master/pyradio/install.py">this link</a> and use your browser “<strong>Save link as</strong>” menu entry to save the file in your home folder.</p>
<p>Finally, execute the command:</p>
<pre>python install.py</pre>
<p>On <strong>Debian</strong> based systems you will have to execute:</p>
<pre>python3 install.py</pre>
<p>If for some reason you want a <strong>python 2</strong> installation, execute:</p>
<pre>python2 install.py</pre>
<h3 id="note-for-macos-users">Note for macOS users</h3>
<p>This release of <strong>PyRadio</strong> has been tested on <strong>Catalina</strong> and <strong>Big Sur</strong>.</p>
<p>On <strong>Catalina</strong> the executable has been placed on a location which is not directly accessible (not in the PATH). <strong>PyRadio</strong> will try to link it to your <strong>bin</strong> folder (creating <em>~/bin/pyradio</em>), and <strong>PyRadio</strong> will be ready yo be executed, provided that this folder is in your PATH and that <strong>Homebrew</strong> default installation folders have been used during the installation of <strong>Python 3</strong>.</p>
<p>In case a different <strong>Homebrew</strong> location has been used (or a different package manager, for this matter), you can just point the installation to the correct path, using the following command (post installation):</p>
<pre>python3 install.py --brew /path/to/homebrew/installation</pre>
<p>so that <strong>PyRadio</strong> can find and link the executable to your <strong>bin</strong> folder.</p>
<h3 id="updating-a-pre-0.8.9-installation">Updating a pre 0.8.9 installation</h3>
<p>If you are on a pre 0.8.9 release and want to update <strong>PyRadio</strong>, just follow the instructions above, but add the “<em>–force</em>” command line parameter to the installation command.</p>
<p>So, instead of</p>
<pre>python install.py</pre>
<p>do a</p>
<pre>python install.py --force</pre>
</body>
</html>