forked from baresip/baresip
-
Notifications
You must be signed in to change notification settings - Fork 0
152 lines (135 loc) · 4.91 KB
/
fedora.yml
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
# Build re and baresip almost the same way like they would be built in Fedora. This helps to avoid
# e.g. rpath issues, requires however the usage of rpmbuild(1) to use the same compiler flags and
# options like Fedora does. Just running 'RPM_BUILD_ROOT=<top-dir> /usr/lib/rpm/check-rpaths' on
# own builds without the Fedora-specific options effectively leads to garbage results. See also:
# https://github.com/baresip/baresip/issues/2849 and https://github.com/baresip/baresip/pull/2850
name: Fedora
on:
push:
branches:
- main
pull_request:
branches:
- main
- stable
jobs:
dependency:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: sreimers/[email protected]
with:
name: re
repo: https://github.com/baresip/re
secret: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@v4
with:
name: re-fedora
path: re
retention-days: 1
build:
needs: dependency
runs-on: ubuntu-latest
container: fedora
steps:
- uses: actions/checkout@v4
- name: "Install build-time requirements"
run: |
# List of build-time requirements can be generated from Fedora's baresip.spec file like this:
#
# curl https://src.fedoraproject.org/rpms/baresip/raw/rawhide/f/baresip.spec 2> /dev/null | \
# gawk 'sub(/^BuildRequires:\s*/, "") { \
# if ($0 !~ /(cmake3|openssl[13]|libre-devel|devtoolset|desktop-file-utils|svg)/) { \
# gsub(/^%{_bindir}/, "/usr/bin"); print " \047" $0 "\047 \\" }}' | \
# sort -u | head -c -3
#
# Note: The rpm-build package is preinstalled in the Fedora build system by default, but not
# in Docker containers, thus it explicitly needs to be mentioned (and installed) here.
# The zlib-devel package is needed by re and thus not part of the Fedora baresip.spec.
dnf -y update && \
dnf -y install rpm-build zlib-devel \
'alsa-lib-devel' \
'cmake' \
'codec2-devel' \
'fdk-aac-free-devel' \
'gcc' \
'gcc-c++' \
'lame-devel' \
'libaom-devel' \
'libpng-devel' \
'libsndfile-devel' \
'libv4l-devel' \
'libvpx-devel' \
'libX11-devel' \
'libXext-devel' \
'mosquitto-devel' \
'mpg123-devel' \
'openssl-devel' \
'opus-devel' \
'pkgconfig(gio-unix-2.0)' \
'pkgconfig(glib-2.0)' \
'pkgconfig(glib-2.0) >= 2.32' \
'pkgconfig(gstreamer-1.0)' \
'pkgconfig(gtk+-3.0) >= 3.0' \
'pkgconfig(jack)' \
'pkgconfig(libpipewire-0.3)' \
'pkgconfig(libpulse)' \
'pkgconfig(vpx) >= 1.3.0' \
'portaudio-devel' \
'python3-devel' \
'SDL2-devel' \
'spandsp-devel' \
'speex-devel' \
'speexdsp-devel' \
'twolame-devel' \
'/usr/bin/gdbus-codegen'
- uses: actions/download-artifact@v4
with:
name: re-fedora
path: re
- name: "Write placeholer RPM spec file"
# Use same placeholder RPM spec file until re and baresip need different %build commands
run: |
cat > placeholder.spec <<EOF
Summary: Placeholder
Name: placeholder
Version: 0
Release: 0
License: Placeholder
%description
Placeholder
%build
%cmake
%cmake_build
%install
%cmake_install
%files
/*
%changelog
* $(date +'%a %b %d %Y') Placeholder
- Placeholder
EOF
- name: "Write RPM macros configuration for re"
run: |
echo "%_builddir ${PWD}/re" > "${HOME}/.rpmmacros"
echo "%buildroot ${PWD}/re/%{_vendor}-%{_target_os}-install" >> "${HOME}/.rpmmacros"
- name: "RPM %build re"
run: rpmbuild -bc --short-circuit placeholder.spec
- name: "RPM %install re"
# Runs 'RPM_BUILD_ROOT=<top-dir> /usr/lib/rpm/check-rpaths' at the end of %install
run: rpmbuild -bi --short-circuit placeholder.spec
- name: "Relocate re from RPM %{buildroot} to /"
run: |
cp -avT $(rpm --eval '%{buildroot}/') / # Work around '%{buildroot} can not be "/"' from RPM
rm -rf re # Baresip must not pick up this directory (or wrong rpaths are written to binaries)
- name: "Run ldconfig"
run: ldconfig
- name: "Write RPM macros configuration for baresip"
run: |
echo "%_builddir ${PWD}" > "${HOME}/.rpmmacros"
echo "%buildroot ${PWD}/%{_vendor}-%{_target_os}-install" >> "${HOME}/.rpmmacros"
- name: "RPM %build baresip"
run: rpmbuild -bc --short-circuit placeholder.spec
- name: "RPM %install baresip"
# Runs 'RPM_BUILD_ROOT=<top-dir> /usr/lib/rpm/check-rpaths' at the end of %install
run: rpmbuild -bi --short-circuit placeholder.spec