This repository has been archived by the owner on Nov 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
signal-ringrtc-zkgroup-el7.spec
416 lines (344 loc) · 13.3 KB
/
signal-ringrtc-zkgroup-el7.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
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
Name: signal-desktop
Version: 1.38.2
Release: 1%{?dist}
Summary: Private messaging from your desktop
License: GPLv3
URL: https://github.com/signalapp/Signal-Desktop/
# https://updates.signal.org/desktop/apt/pool/main/s/signal-desktop/signal-desktop_1.3.0_amd64.deb
Source0: https://github.com/signalapp/Signal-Desktop/archive/v%{version}.tar.gz
Source1: https://github.com/atom/node-spellchecker/archive/613ff91dd2d9a5ee0e86be8a3682beecc4e94887.tar.gz
Source2: https://github.com/signalapp/zkgroup/archive/v0.7.1.tar.gz
#ExclusiveArch: x86_64
BuildRequires: binutils, git, python2, gcc, gcc-c++, yarn, openssl-devel, bsdtar, jq, zlib, xz, python3
BuildRequires: nodejs, ca-certificates, xz, curl
%if 0%{?fedora} > 28
BuildRequires: python-unversioned-command
%endif
%if 0%{?fedora} > 29
BuildRequires: libxcrypt-compat
%endif
%if 0%{?fedora} > 31
BuildRequires: libxcrypt-compat, vips-devel
%endif
%if 0%{?el8}
BuildRequires: platform-python-devel, python3
%endif
AutoReqProv: no
#AutoProv: no
Provides: signal-desktop
Requires: GConf2, libnotify, libappindicator-gtk3, libXtst, nss, libXScrnSaver
%global __requires_exclude_from ^/%{_libdir}/%{name}/release/.*$
%description
Private messaging from your desktop
%prep
# prepare zkgroup lib
tar xfz %{S:2}
rm -rf Signal-Desktop-%{version}
tar xfz %{S:0}
pwd
cd Signal-Desktop-%{version}
node --version
# Allow higher Node versions
sed 's#"node": "#&>=#' -i package.json
# Fix spellchecker for Fedora-based distributions
# TODO: unsure if still needed after signal 1.33.0
#sed -r 's#("spellchecker": ").*"#\1file:../../SOURCES/613ff91dd2d9a5ee0e86be8a3682beecc4e94887.tar.gz"#' -i package.json
#sed -r 's!/usr/share/hunspell!/usr/share/myspell!' -i js/spell_check.js
# avoid building deb/appimage packages, since we're repacking the unpacked sources
# this also solves build failure on epel 7 due to a too outdated 'tar' command when building the .deb file
patch --no-backup-if-mismatch -Np1 << 'EOF'
--- a/package.json
+++ b/package.json
273,320d272
< "mac": {
< "asarUnpack": [
< "**/*.node",
< "node_modules/zkgroup/libzkgroup.*"
< ],
< "artifactName": "${name}-mac-${version}.${ext}",
< "category": "public.app-category.social-networking",
< "darkModeSupport": true,
< "hardenedRuntime": true,
< "entitlements": "./build/entitlements.mac.plist",
< "icon": "build/icons/mac/icon.icns",
< "publish": [
< {
< "provider": "generic",
< "url": "https://updates.signal.org/desktop"
< }
< ],
< "target": [
< "zip",
< "dmg"
< ],
< "bundleVersion": "1"
< },
< "win": {
< "asarUnpack": [
< "**/*.node",
< "node_modules/spellchecker/vendor/hunspell_dictionaries",
< "node_modules/sharp",
< "node_modules/zkgroup/libzkgroup.*"
< ],
< "artifactName": "${name}-win-${version}.${ext}",
< "certificateSubjectName": "Signal (Quiet Riddle Ventures, LLC)",
< "certificateSha1": "77B2AA4421E5F377454B8B91E573746592D1543D",
< "publisherName": "Signal (Quiet Riddle Ventures, LLC)",
< "icon": "build/icons/win/icon.ico",
< "publish": [
< {
< "provider": "generic",
< "url": "https://updates.signal.org/desktop"
< }
< ],
< "target": [
< "nsis"
< ]
< },
< "nsis": {
< "deleteAppDataOnUninstall": true
< },
332,334d283
< "target": [
< "deb"
< ],
336,345d284
< },
< "deb": {
< "depends": [
< "libnotify4",
< "libappindicator1",
< "libxtst6",
< "libnss3",
< "libasound2",
< "libxss1"
< ]
EOF
# fsevents for Apple MacOS also breaks linux build
patch --no-backup-if-mismatch -Np1 << 'EOF'
--- a/yarn.lock
+++ b/yarn.lock
4670,4671d4669
< optionalDependencies:
< fsevents "^1.2.2"
4689,4690d4686
< optionalDependencies:
< fsevents "^1.2.7"
7703,7710d7698
<
< fsevents@^1.2.2, fsevents@^1.2.7:
< version "1.2.9"
< resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.9.tgz#3f5ed66583ccd6f400b5a00db6f7e861363e388f"
< integrity sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw==
< dependencies:
< nan "^2.12.1"
< node-pre-gyp "^0.12.0"
EOF
# fix sqlcipher generic python invocation, incompatible with el8
#%if 0%{?el8}
#yarn install || true
#sed -i 's/python/python3/g' node_modules/@journeyapps/sqlcipher/deps/sqlite3.gyp
mkdir -p ${HOME}/.bin
ln -s %{__python3} ${HOME}/.bin/python
export PATH="${HOME}/.bin:${PATH}"
#%endif
yarn install
%build
# Signal-Desktop ships at least two pre-built binaries. EL7 needs to recompile them due to GLIBC incompatibility
#%if 0%{?el7}
curl https://sh.rustup.rs -sSf | sh -s -- -q -y
#export PATH="$HOME/.cargo/bin:${PATH}"
source $HOME/.bashrc
rustup toolchain install 1.47.0
rustup default 1.47.0
# RingRTC https://github.com/signalapp/ringrtc/
cd %{_builddir}
rm -rf ringrtc depot_tools
git clone https://github.com/signalapp/ringrtc
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH="%{_builddir}/depot_tools:${PATH}"
cd %{_builddir}/ringrtc
export
echo $PATH
make electron PLATFORM=unix
cp -v src/node/build/linux/libringrtc.node %{_builddir}/Signal-Desktop-%{version}/node_modules/ringrtc/build/linux/libringrtc.node
# zkgroup lib: https://github.com/luminoso/fedora-copr-signal-desktop/issues/3
cd %{_builddir}/zkgroup-0.7.1
make libzkgroup
cp -v target/release/libzkgroup.so %{_builddir}/Signal-Desktop-%{version}/node_modules/zkgroup/
ldd %{_builddir}/Signal-Desktop-%{version}/node_modules/zkgroup/libzkgroup.so
#%endif
cd %{_builddir}/Signal-Desktop-%{version}
pwd
# use dynamic linking
patch --no-backup-if-mismatch -Np1 << 'EOF'
--- a/node_modules/@journeyapps/sqlcipher/deps/sqlite3.gyp 2019-10-27 01:53:29.860275405 -0400
+++ b/node_modules/@journeyapps/sqlcipher/deps/sqlite3.gyp 2019-10-27 01:51:32.001730882 -0400
@@ -73,7 +73,7 @@
'link_settings': {
'libraries': [
# This statically links libcrypto, whereas -lcrypto would dynamically link it
- '<(SHARED_INTERMEDIATE_DIR)/sqlcipher-amalgamation-<@(sqlite_version)/OpenSSL-Linux/libcrypto.a'
+ '-lcrypto'
]
}
}]
@@ -141,7 +141,6 @@
{ # linux
'include_dirs': [
'<(SHARED_INTERMEDIATE_DIR)/sqlcipher-amalgamation-<@(sqlite_version)/',
- '<(SHARED_INTERMEDIATE_DIR)/sqlcipher-amalgamation-<@(sqlite_version)/openssl-include/'
]
}]
],
EOF
# We can't read the release date from git so we use SOURCE_DATE_EPOCH instead
patch --no-backup-if-mismatch -Np1 << 'EOF'
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -203,9 +203,7 @@ module.exports = grunt => {
});
grunt.registerTask('getExpireTime', () => {
- grunt.task.requires('gitinfo');
- const gitinfo = grunt.config.get('gitinfo');
- const committed = gitinfo.local.branch.current.lastCommitTime;
+ const committed = parseInt(process.env.SOURCE_DATE_EPOCH, 10) * 1000;
const time = Date.parse(committed) + 1000 * 60 * 60 * 24 * 90;
grunt.file.write(
'config/local-production.json',
EOF
# Gruntfile expects Git commit information which we don't have in a tarball download
# See https://github.com/signalapp/Signal-Desktop/issues/2376
yarn generate exec:build-protobuf exec:transpile concat copy:deps sass
#env SIGNAL_ENV=production yarn --no-default-rc --verbose build-release --linux rpm
yarn build-release
%install
# Electron directory of the final build depends on the arch
%ifnarch x86_64
%global PACKDIR linux-ia32-unpacked
%else
%global PACKDIR linux-unpacked
%endif
# copy base files
install -dm755 %{buildroot}/%{_libdir}/%{name}
cp -a %{_builddir}/Signal-Desktop-%{version}/release/linux-unpacked/* %{buildroot}/%{_libdir}/%{name}
# delete uneeded build files
# this also would make signal-desktop package provide the wrong library .so files
#find %{buildroot}/%{_libdir}/%{name}/resources/ -iname '*.so*' -delete -print
# try to slim down install base. TODO: this breaks voice message player
#rm -rf %{buildroot}/%{_libdir}/%{name}/chrome_*.pak
#rm -rf %{buildroot}/%{_libdir}/%{name}/chrome-sandbox
#rm -rf %{buildroot}/%{_libdir}/%{name}/swiftshader
install -dm755 %{buildroot}%{_bindir}
ln -s %{_libdir}/%{name}/signal-desktop %{buildroot}%{_bindir}/signal-desktop
install -dm755 %{buildroot}%{_datadir}/applications/
# Changes from upstream:
# 1. Run signal WITH sandbox since it looks like there's no problems with fedora and friends
# 2. Use tray icon by default
# 3. Small fix for tray for Plasma users
cat << EOF > %{buildroot}%{_datadir}/applications/signal-desktop.desktop
[Desktop Entry]
Name=Signal
Exec=/usr/bin/signal-desktop --use-tray-icon %U
Terminal=false
Type=Application
Icon=signal-desktop
StartupWMClass=Signal
Comment=Private messaging from your desktop
MimeType=x-scheme-handler/sgnl;
Categories=Network;InstantMessaging;Chat;
EOF
for i in 16 24 32 48 64 128 256 512 1024; do
install -dm755 %{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps/
install -Dm 644 %{_builddir}/Signal-Desktop-%{version}/build/icons/png/${i}x${i}.png %{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps/%{name}.png
done
%files
%defattr(-,root,root)
%{_bindir}/*
%{_libdir}/*
%{_datadir}/*
%changelog
* Fri Sep 25 2020 Guilherme Cardoso <gjc@ua.pt> 1.36.2-1
- Patch to remove fsevents from build, since it make build failing
in linux environments and is only needed for Apple MacOS users
* Mon Jul 27 2020 Guilherme Cardoso <gjc@ua.pt> 1.34.4-3
- Replaced 'requires' 'libappindicator' with 'libappindicator-gtk3'
* Sun Jun 21 2020 Guilherme Cardoso <gjc@ua.pt> 1.34.2-2
- Re-order %build and %prep steps
- Also manually build zkgroup nodemodule shared object on el7
* Tue Apr 28 2020 Guilherme Cardoso <gjc@ua.pt> 1.33.4-1
- Added workarounds for el8 copr build
* Tue Apr 7 2020 Guilherme Cardoso <gjc@ua.pt> 1.33.0-1
- Reordered patching and build flow
- Removed spellchecker directory patch for fedora
* Sat Mar 14 2020 Guilherme Cardoso <gjc@ua.pt> 1.32.1-2
- Don't try to override XDG_CURRENT_DESKTOP anymore
* Sat Feb 08 2020 Guilherme Cardoso <gjc@ua.pt> 1.30.1-3
- Fix spellchecker and audio player. Huge thank you to Christoph Schwille
* Fri Jan 24 2020 Guilherme Cardoso <gjc@ua.pt> 1.30.0-1
- Refactor spec file, since Signal no longer builds rpm file
- Fix package providing and requiring a lot of libraries
- Slimmed down instalation by deleting some build files present on release
* Mon Jan 20 2020 Guilherme Cardoso <gjc@ua.pt> 1.29.6-1
- Resync patches and build recipe from archlinux
- RPM spec build dependencies cleanup (ZaWertun)
* Thu Nov 14 2019 Guilherme Cardoso <gjc@ua.pt> 1.28.0-1
- Simplify changelog to include only major changes
* Fri Sep 6 2019 Guilherme Cardoso <gjc@ua.pt> 1.27.1-1
- Version bump
- Small adjustments to rpm spec file and its patches
* Sat Mar 30 2019 Guilherme Cardoso <gjc@ua.pt> 1.23.2-1
- Updated to dynamic eletron version, idea taken from
ArchLinux AUR Signal package (_installed_electron_version)
* Thu Jan 17 2019 Guilherme Cardoso <gjc@ua.pt> 1.20.0-2
- Version bump
- Updated patches from archlinux aur build
- Add depndencies for Fedora rawhide
* Wed Oct 31 2018 Guilherme Cardoso <gjc@ua.pt> 1.17.2-1
- Version bump
- Explicit nodejs dependency, which tries to solve the requirement of having nodejs LTS version 8
- Thanks clime for the help
* Mon Oct 22 2018 Guilherme Cardoso <gjc@ua.pt> 1.16.3-4
- Fix wrong this rpmspec version info
* Mon Oct 15 2018 Guilherme Cardoso <gjc@ua.pt> 1.16.2-3
- Workaround for KDE plasma Signal's tray icon
https://github.com/signalapp/Signal-Desktop/issues/1876
* Fri Oct 12 2018 Guilherme Cardoso <gjc@ua.pt> 1.16.2-2
- Patch to use tray icon
* Fri Aug 17 2018 Guilherme Cardoso <gjc@ua.pt> 1.15.5-2
- Try to patch to allow higher node versions for Fedora Rawhide
- Manual symlink
* Thu Aug 16 2018 Matthias Andree <mandree@FreeBSD.org> 1.15.5-1
- Shuffle things around a bit
- Add jq to build requisites
- tweak files section so it actually finds its inputs
- add node-gyp to developer dependencies only
- add -no-default-rc to yarn calls throughout
* Tue Aug 14 2018 Guilherme Cardoso <gjc@ua.pt> 1.15.4-1
- Version bump
- Build fixes arround embebed OpenSSL's from mandree and stemid
Link: https://github.com/signalapp/Signal-Desktop/issues/2634
* Wed May 02 2018 Guilherme Cardoso <gjc@ua.pt> 1.9.0-1
- Version bump
- Spec file cleanup
* Mon Apr 16 2018 Guilherme Cardoso <gjc@ua.pt> 1.7.1-4
- Added a few more yarn steps (check, lint)
* Mon Apr 16 2018 Guilherme Cardoso <gjc@ua.pt> 1.7.1-3
- Fix build. Requires 'yarn transpile'. Thanks spacekookie.
Ref: https://github.com/signalapp/Signal-Desktop/issues/2256
* Sat Apr 14 2018 Guilherme Cardoso <gjc@ua.pt> 1.7.1-2
- Remove patch lowering nodejs due to async problems
- Simplified BuildRequires
* Wed Apr 11 2018 Guilherme Cardoso <gjc@ua.pt> 1.6.1-2
- Fix desktop shortcut (thanks to bol for reporting)
* Tue Mar 13 2018 Guilherme Cardoso <gjc@ua.pt> 1.6.0-1
- Version bump
- Update project homepage url
- Patch to override nodejs version of Signal's sources
* Sun Feb 18 2018 Guilherme Cardoso <gjc@ua.pt> 1.3.0-2
- Build from sources instead of unpacking .deb release
* Mon Feb 05 2018 Guilherme Cardoso <gjc@ua.pt> 1.3.0-1
- Version bump
- Added missing dependencies from original deb package
* Thu Nov 02 2017 Richard Monk <richardmonk@gmail.com> 1.0.35-1
- Initial Packaging