-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchromebook-linux-audio.spec
110 lines (85 loc) · 2.79 KB
/
chromebook-linux-audio.spec
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
%global repository chromebook-linux-audio
%global maincommit 4617151f8ade809b3ef92621d75bbc2a08589741
%global deprepository alsa-ucm-conf-cros
%global depcommit 1908a457c7f2bf8b63264fe3b1e0522ea632ac5a
%global mainversioncommit %(echo -n %{maincommit} | head -c 8)
%global depversioncommit %(echo -n %{depcommit} | head -c 8)
Name: chromebook-linux-audio
Version: 0.0.3
Release: %{mainversioncommit}.%{depversioncommit}%{?dist}
License: BSD 3-Clause License
Summary: RPM package to enable audio support on Chrome devices.
Url: https://github.com/WeirdTreeThing/%{repository}
%package debug
Summary: Enable debug for %{name}
BuildRequires: alsa-sof-firmware
BuildRequires: alsa-ucm
BuildRequires: git
BuildRequires: python3
BuildRequires: wireplumber
Requires: alsa-sof-firmware
Requires: alsa-ucm
Patch1: disable_git_clone.patch
Patch2: disable_max98357a.patch
Patch3: disable_avs_dsp_firmware.patch
Patch4: use_sof_for_apl.patch
Patch5: disable_install_package.patch
Patch6: fail_platform_stoney.patch
%define workdir %{_builddir}/%{repository}
%define datadir %{_datadir}/%{name}
%define builddatadir $RPM_BUILD_ROOT/%{datadir}
%description
RPM package to install chromebook-linux-audio to enable audio support on Chrome devices. All credits go to https://github.com/WeirdTreeThing.
This packages runs the script on install so it will work on immutable devices. If a device is NOT supported it will fail to install.
The original script comes from https://github.com/mikaelvz/chromebook-linux-audio.
%description debug
Enable debug for %{name}
%prep
# Get chromebook-linux-audio script
git clone https://github.com/WeirdTreeThing/%{repository} %{workdir}
cd %{workdir}
git reset --hard %{maincommit}
%autopatch 1
%autopatch 2
%autopatch 3
%autopatch 4
%autopatch 5
%autopatch 6
rm -rf .git
# Get chromebook-linux-audio script dependency
git clone https://github.com/WeirdTreeThing/%{deprepository} %{workdir}/%{deprepository}
cd %{workdir}/%{deprepository}
git reset --hard %{depcommit}
rm -rf .git
%build
%install
mkdir -p $RPM_BUILD_ROOT/%{_datadir}
mv %{workdir} $RPM_BUILD_ROOT/%{_datadir}
%files
%{datadir}
%files debug
%{datadir}
%post
# Patch1 has disabled the dependency git clone in the script and
# this is now provided in this binary. Copy it to correct location
# where the script expect it.
cp -r %{datadir}/%{deprepository} /tmp
# Run the script
cd %{datadir}
./setup-audio
# Cleanup
rm -rf /tmp/%{deprepository}
%post debug
# Patch1 has disabled the dependency git clone in the script and
# this is now provided in this binary. Copy it to correct location
# where the script expect it.
cp -r %{datadir}/%{deprepository} /tmp
# Run the script
cd %{datadir}
./setup-audio --enable-debug
# Cleanup
rm -rf /tmp/%{deprepository}
%preun debug
# Run the script to disable debug
cd %{datadir}
./setup-audio --disable-debug