-
Notifications
You must be signed in to change notification settings - Fork 15
/
mopidy-scrobbler.rb
41 lines (33 loc) · 1.45 KB
/
mopidy-scrobbler.rb
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
class MopidyScrobbler < Formula
desc "Mopidy extension for scrobbling played tracks to Last.fm"
homepage "https://github.com/mopidy/mopidy-scrobbler"
url "https://files.pythonhosted.org/packages/4b/2b/f5e71a37ca6698e4f287384482601b869d48fefeed8823b5db87a358bcfc/Mopidy-Scrobbler-2.0.1.tar.gz"
sha256 "001920edc5433678091cb74c56e39c57ffcdb280396447b07d6fbe4eba7a7d87"
head "https://github.com/mopidy/mopidy-scrobbler.git"
revision 2
depends_on "python@3.12"
depends_on "mopidy/mopidy/mopidy"
# Dependencies assumed bundled by mopidy:
# - pykka
resource "pylast" do
url "https://files.pythonhosted.org/packages/c1/3b/05414f6c406d571604a6ee19530ba0a0bd35a8c2cae158ffac0caaa74179/pylast-3.1.0.tar.gz"
sha256 "7eb58682beccc0052c3284aba64a9a6454b5e89706f789ebeb2403dc1045606a"
end
def install
python3 = Formula["python@3.12"].opt_bin/"python3.12"
resources.each do |r|
r.stage do
system python3, *Language::Python.setup_install_args(libexec)
end
end
system python3, *Language::Python.setup_install_args(libexec)
xy = Language::Python.major_minor_version python3
site_packages = "lib/python#{xy}/site-packages"
pth_contents = "import site; site.addsitedir('#{libexec/site_packages}')\n"
(prefix/site_packages/"homebrew-mopidy-scrobbler.pth").write pth_contents
end
test do
python3 = Formula["python@3.12"].opt_bin/"python3.12"
system python3, "-c", "import mopidy_scrobbler"
end
end