git: 6ccf832def91 - main - net-im/signal-desktop: Update to 6.2.0

From: Mikael Urankar <mikael_at_FreeBSD.org>
Date: Sun, 15 Jan 2023 15:03:19 UTC
The branch main has been updated by mikael:

URL: https://cgit.FreeBSD.org/ports/commit/?id=6ccf832def9121b6bbce9d8cc964a0ced9897a3f

commit 6ccf832def9121b6bbce9d8cc964a0ced9897a3f
Author:     Mikael Urankar <mikael@FreeBSD.org>
AuthorDate: 2023-01-15 15:01:04 +0000
Commit:     Mikael Urankar <mikael@FreeBSD.org>
CommitDate: 2023-01-15 15:01:55 +0000

    net-im/signal-desktop: Update to 6.2.0
    
    Changes:
      https://github.com/signalapp/Signal-Desktop/releases/tag/v6.2.0
---
 net-im/signal-desktop/Makefile                   | 26 ++++++++++--------------
 net-im/signal-desktop/distinfo                   | 22 ++++++++++----------
 net-im/signal-desktop/files/patch-signal-desktop | 20 ------------------
 net-im/signal-desktop/files/sqlite3.gyp.diff     | 24 +++++++++++-----------
 net-im/signal-desktop/pkg-plist                  |  2 +-
 5 files changed, 35 insertions(+), 59 deletions(-)

diff --git a/net-im/signal-desktop/Makefile b/net-im/signal-desktop/Makefile
index 19be85ba8bd5..33def16c5f00 100644
--- a/net-im/signal-desktop/Makefile
+++ b/net-im/signal-desktop/Makefile
@@ -1,15 +1,16 @@
 PORTNAME=	signal-desktop
 DISTVERSIONPREFIX=	v
-DISTVERSION=	6.1.0
+DISTVERSION=	6.2.0
 CATEGORIES=	net-im
 MASTER_SITES=	LOCAL/mikael/signal-desktop/:yarn \
 		LOCAL/mikael/signal-desktop/:electron_gyp \
 		LOCAL/mikael/signal-desktop/:npm \
-		LOCAL/mikael/signal-desktop/:sqlite
+		https://build-artifacts.signal.org/desktop/:sqlcipher
 DISTFILES=	signal-desktop-${DISTVERSION}-yarn-cache.tar.gz:yarn \
 		signal-desktop-${DISTVERSION}-electron-gyp-cache.tar.gz:electron_gyp \
 		signal-desktop-${DISTVERSION}-npm-cache.tar.gz:npm \
-		sqlcipher.tar.gz:sqlite
+		sqlcipher-4.5.2--3.0.7-4587e88a4219cb76fd595a5b73f82bfd919b235d75626f40783525f4f58a7503.tar.gz:sqlcipher
+		
 
 MAINTAINER=	mikael@FreeBSD.org
 COMMENT=	Cross-platform centralized encrypted messaging service
@@ -25,7 +26,7 @@ BUILD_DEPENDS=	${LOCALBASE}/lib/libringrtc.so:multimedia/ringrtc \
 		app-builder>0:devel/app-builder \
 		electron${ELECTRON_VER_MAJOR}:devel/electron${ELECTRON_VER_MAJOR} \
 		npm:www/npm-node16 \
-		openssl>0:security/openssl \
+		${LOCALBASE}/lib/libcrypto.a:security/openssl-devel \
 		vips>0:graphics/vips \
 		yarn:www/yarn-node16
 LIB_DEPENDS=	libasound.so:audio/alsa-lib \
@@ -64,7 +65,8 @@ MAKE_ENV+=	ELECTRON_OVERRIDE_DIST_PATH=${LOCALBASE}/share/electron${ELECTRON_VER
 		PLAYWRIGHT_BROWSERS_PATH=${WRKDIR}/.cache \
 		PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=true \
 		PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS=true \
-		USE_SYSTEM_APP_BUILDER=true
+		USE_SYSTEM_APP_BUILDER=true \
+		SOURCE_DATE_EPOCH=${_BUILD_DATE}
 
 # Don't download electron binary distribution on electron node_modules installation
 MAKE_ENV+=	ELECTRON_SKIP_BINARY_DOWNLOAD=1
@@ -82,7 +84,7 @@ ELECTRON_VER_MAJOR=	21
 # ll work/.cache/yarn/v6 | egrep "ringrtc|signal-client|npm-better-sqlite3|esbuild-freebsd-64"
 NPM_SIGNAL_DIR=		npm-@signalapp-libsignal-client-0.21.1-381d6162ae0e7719dc625780c1d6c3f9f558c33d-integrity
 NPM_RINGRTC_DIR=	npm-ringrtc-2.22.0-9a9d9fbc1ca43e7a0707a960ce9642dbf82dc64a/
-NPM_SQLITE3_DIR=	npm-better-sqlite3-7.5.1-afdbd49cf18d0046d7385ca4d23da20c66f00d50/
+NPM_SQLITE3_DIR=	npm-@signalapp-better-sqlite3-8.0.3-c279ca3f1d1e7f6554d2a629d717e96e1ec45809-integrity/
 NPM_PLAYWRITE_DIR=	npm-playwright-core-1.17.1-a16e0f89284a0ed8ae6d77e1c905c84b8a2ba022-integrity
 NPM_ESBUILD_VERS=	0.15.8
 
@@ -93,10 +95,6 @@ APP_OUT_DIR=		linux-${ARCH:S/aarch64/arm64-/:S/amd64//}unpacked
 PLIST_SUB=		NODE_ARCH=${NODE_ARCH} \
 			SHARP_ARCH=${ARCH:S/aarch64/arm64v8/:S/amd64/x64/}
 
-post-patch:
-	${REINPLACE_CMD} "s#%%EPOCH%%#${_BUILD_DATE}#" \
-		${WRKSRC}/ts/scripts/get-expire-time.ts
-
 do-build:
 	${ECHO_CMD} 'yarn-offline-mirror "../yarn-cache"' > ${WRKSRC}/.yarnrc
 
@@ -116,11 +114,9 @@ do-build:
 	${CP} ${LOCALBASE}/lib/libringrtc.so \
 		${WRKDIR}/.cache/yarn/v6/${NPM_RINGRTC_DIR}/node_modules/ringrtc/build/freebsd/libringrtc-${NODE_ARCH}.node
 
-	# sqlcipher.tar.gz requires git-lfs to fetch, just copy a previously downloaded one (I've had to use ubuntu for that,
-	# as I didn't manage to do it with FreeBSD, see https://github.com/signalapp/Signal-Desktop/blob/development/CONTRIBUTING.md for instructions)
-	${MKDIR} ${WRKDIR}/.cache/yarn/v6/${NPM_SQLITE3_DIR}/node_modules/better-sqlite3/deps
-	${CP} ${DISTDIR}/sqlcipher.tar.gz \
-		${WRKDIR}/.cache/yarn/v6/${NPM_SQLITE3_DIR}/node_modules/better-sqlite3/deps/sqlcipher.tar.gz
+	${MKDIR} ${WRKDIR}/.cache/yarn/v6/${NPM_SQLITE3_DIR}/node_modules/@signalapp/better-sqlite3/deps
+	${CP} ${DISTDIR}/sqlcipher-4.5.2--3.0.7-4587e88a4219cb76fd595a5b73f82bfd919b235d75626f40783525f4f58a7503.tar.gz \
+		${WRKDIR}/.cache/yarn/v6/${NPM_SQLITE3_DIR}/node_modules/@signalapp/better-sqlite3/deps/sqlcipher.tar.gz
 
 	# patch-package can't patch playwright-core, patch the yarn cache instead
 	${CP} ${FILESDIR}/playwrigth-registry.js \
diff --git a/net-im/signal-desktop/distinfo b/net-im/signal-desktop/distinfo
index cc8233d55117..2b75cc2e82e4 100644
--- a/net-im/signal-desktop/distinfo
+++ b/net-im/signal-desktop/distinfo
@@ -1,11 +1,11 @@
-TIMESTAMP = 1671199606
-SHA256 (signal-desktop-6.1.0-yarn-cache.tar.gz) = 377cc4aef808c0dbdd939e5f6b101d67b41af36240f6153e83c4ea1242d933e5
-SIZE (signal-desktop-6.1.0-yarn-cache.tar.gz) = 1084112692
-SHA256 (signal-desktop-6.1.0-electron-gyp-cache.tar.gz) = 0cf1ecdb87c699e99ce3af4a2378d95e5440c7e532c209222ddd122deb1d3a4e
-SIZE (signal-desktop-6.1.0-electron-gyp-cache.tar.gz) = 267010
-SHA256 (signal-desktop-6.1.0-npm-cache.tar.gz) = 7695f2e5c39eb6aa36a704ba77f34925e5e1e54f65b8b2d8e1f2905730ee512a
-SIZE (signal-desktop-6.1.0-npm-cache.tar.gz) = 4429759
-SHA256 (sqlcipher.tar.gz) = fe8bdc5e2f182970fb63a71ec4c519c8192453800bf142f755d7ed99e79fff84
-SIZE (sqlcipher.tar.gz) = 25833894
-SHA256 (signalapp-Signal-Desktop-v6.1.0_GH0.tar.gz) = f981ca229651826dcf2b511499612217719827ab98edac46f931fe2751eccd6f
-SIZE (signalapp-Signal-Desktop-v6.1.0_GH0.tar.gz) = 38301590
+TIMESTAMP = 1673792962
+SHA256 (signal-desktop-6.2.0-yarn-cache.tar.gz) = 60a52b9f048f90144129643aa012b97c00317e217e2c1ab218ed2f21036040d6
+SIZE (signal-desktop-6.2.0-yarn-cache.tar.gz) = 1051289021
+SHA256 (signal-desktop-6.2.0-electron-gyp-cache.tar.gz) = 9515098bca084289d8a356e70e95f139d2451c9a62914d510286984937cf298d
+SIZE (signal-desktop-6.2.0-electron-gyp-cache.tar.gz) = 266707
+SHA256 (signal-desktop-6.2.0-npm-cache.tar.gz) = a4bfca0df78ccff27b27b0f84a9bc523667b83e6da12b6b4316c98580d25cf9b
+SIZE (signal-desktop-6.2.0-npm-cache.tar.gz) = 4433937
+SHA256 (sqlcipher-4.5.2--3.0.7-4587e88a4219cb76fd595a5b73f82bfd919b235d75626f40783525f4f58a7503.tar.gz) = 4587e88a4219cb76fd595a5b73f82bfd919b235d75626f40783525f4f58a7503
+SIZE (sqlcipher-4.5.2--3.0.7-4587e88a4219cb76fd595a5b73f82bfd919b235d75626f40783525f4f58a7503.tar.gz) = 41118646
+SHA256 (signalapp-Signal-Desktop-v6.2.0_GH0.tar.gz) = dcb6967c5a72eada96ddf1fc0fa5ac122b9280cc5c08bfc28d3b93ba1ce40e79
+SIZE (signalapp-Signal-Desktop-v6.2.0_GH0.tar.gz) = 38307325
diff --git a/net-im/signal-desktop/files/patch-signal-desktop b/net-im/signal-desktop/files/patch-signal-desktop
index 1ecb066caf3f..9f7bf961a391 100644
--- a/net-im/signal-desktop/files/patch-signal-desktop
+++ b/net-im/signal-desktop/files/patch-signal-desktop
@@ -166,23 +166,3 @@
    windowIcon = join(__dirname, '../images/signal-logo-desktop-linux.png');
  } else {
    windowIcon = join(__dirname, '../build/icons/png/512x512.png');
---- ts/scripts/get-expire-time.ts.orig	2022-02-16 15:11:39.000000000 +0000
-+++ ts/scripts/get-expire-time.ts	2022-02-25 12:31:18.650062000 +0000
-@@ -2,15 +2,12 @@
- // SPDX-License-Identifier: AGPL-3.0-only
- 
- import { join } from 'path';
--import { execSync } from 'child_process';
- import { writeFileSync } from 'fs';
- 
- import { DAY } from '../util/durations';
- 
--const unixTimestamp = parseInt(
--  execSync('git show -s --format=%ct').toString('utf8'),
--  10
--);
-+const unixTimestamp = %%EPOCH%%;
-+
- const buildCreation = unixTimestamp * 1000;
- 
- const buildExpiration = buildCreation + DAY * 90;
diff --git a/net-im/signal-desktop/files/sqlite3.gyp.diff b/net-im/signal-desktop/files/sqlite3.gyp.diff
index fc4d9b0fcaa0..5e78830a21ca 100644
--- a/net-im/signal-desktop/files/sqlite3.gyp.diff
+++ b/net-im/signal-desktop/files/sqlite3.gyp.diff
@@ -1,17 +1,17 @@
---- npm-better-sqlite3-7.5.1-afdbd49cf18d0046d7385ca4d23da20c66f00d50/node_modules/better-sqlite3/deps/sqlite3.gyp.orig	2022-07-02 14:34:04 UTC
-+++ npm-better-sqlite3-7.5.1-afdbd49cf18d0046d7385ca4d23da20c66f00d50/node_modules/better-sqlite3/deps/sqlite3.gyp
-@@ -95,6 +95,14 @@
-             ]
-           }
-         },
+--- npm-@signalapp-better-sqlite3-8.0.3-c279ca3f1d1e7f6554d2a629d717e96e1ec45809-integrity/node_modules/@signalapp/better-sqlite3/deps/sqlite3.gyp.orig	2022-07-02 14:34:04 UTC
++++ npm-@signalapp-better-sqlite3-8.0.3-c279ca3f1d1e7f6554d2a629d717e96e1ec45809-integrity/node_modules/@signalapp/better-sqlite3/deps/sqlite3.gyp
+@@ -92,6 +92,14 @@
+             'libraries': [
+               # This statically links libcrypto, whereas -lcrypto would dynamically link it
+               '<(SHARED_INTERMEDIATE_DIR)/sqlite3/OpenSSL-mac-<(target_arch)/libcrypto.a'
++            ]
++          }
++        },
 +        'OS == "freebsd"', {
 +          'link_settings': {
 +            'libraries': [
 +              # This statically links libcrypto, whereas -lcrypto would dynamically link it
 +              '/usr/local/lib/libcrypto.a'
-+            ]
-+          }
-+        },
-         { # Linux
-           'link_settings': {
-             'libraries': [
+             ]
+           }
+         },
diff --git a/net-im/signal-desktop/pkg-plist b/net-im/signal-desktop/pkg-plist
index 6b3ac0810722..be2b9b228d6f 100644
--- a/net-im/signal-desktop/pkg-plist
+++ b/net-im/signal-desktop/pkg-plist
@@ -103,8 +103,8 @@ share/pixmaps/signal-desktop.png
 %%DATADIR%%/locales/zh-TW.pak
 %%DATADIR%%/resources.pak
 %%DATADIR%%/resources/app.asar
+%%DATADIR%%/resources/app.asar.unpacked/node_modules/@signalapp/better-sqlite3/build/Release/better_sqlite3.node
 %%DATADIR%%/resources/app.asar.unpacked/node_modules/@signalapp/libsignal-client/prebuilds/freebsd-%%NODE_ARCH%%/node.napi.node
-%%DATADIR%%/resources/app.asar.unpacked/node_modules/better-sqlite3/build/Release/better_sqlite3.node
 %%DATADIR%%/resources/app.asar.unpacked/node_modules/ringrtc/build/freebsd/libringrtc-%%NODE_ARCH%%.node
 @(,,755) %%DATADIR%%/signal-desktop
 %%DATADIR%%/snapshot_blob.bin