From nobody Sat Jul 02 14:29:27 2022 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id D068187F967; Sat, 2 Jul 2022 14:29:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LZvbC5ZMpz3HvY; Sat, 2 Jul 2022 14:29:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656772167; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CB+lBtMIGf7BUN+Ol9hNqaafbyteE7ldc6OQf+AQdow=; b=grvwsOgMYECvbzKOGYBoFBeSX6GzB0mRKdbq7+RIksBUkKBWFGox0OB2ObAQXlJRA8NWDn bfaLHhh+BFi9Hxd1cso1E7m+M1dd8R8SIyIF68ExmxhRwt9BW8+5GVK4B1STAvouvx7WJ+ NoVonwMRtEoPsWlcvbJ1o3IT2zYvm0VuRqpdN6h3g24k67GJ7tX1XV8hu5BhcRP/3atsKW fxFvaoSkJrgpOTxGCgPO/VYAxmqyYK3YjHTM5QxbIadaWWEZ6fzbiyflowi/Htk4zrPKoY Sf3Hp4i1EMRTXwv4B44b7RGr9nuKVE2/C5RPYqmAij9VDnJ2khU6F0hXcrEm1w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9F26211E01; Sat, 2 Jul 2022 14:29:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 262ETRVS066383; Sat, 2 Jul 2022 14:29:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 262ETRfq066382; Sat, 2 Jul 2022 14:29:27 GMT (envelope-from git) Date: Sat, 2 Jul 2022 14:29:27 GMT Message-Id: <202207021429.262ETRfq066382@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Mikael Urankar Subject: git: b990f5d66341 - main - net-im/signal-desktop: Fix build on aarch64 List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mikael X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b990f5d66341986260d02727a86102f01d81fec4 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656772167; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CB+lBtMIGf7BUN+Ol9hNqaafbyteE7ldc6OQf+AQdow=; b=H3ht8WbVbXFpFi7jS3gfE00pLPI3WIfagVtDFM676Nl0H6XzLh9fTJ4zJv9ZWYkvYkhFjY BnYAX/9W7zZiTd8VrV6cz7t62DeaQy5taVOX2wGRzoXVlYJy75sxsHoXWuprs0OdBL+0fQ x4m33rTnnCqYxjA9cVh4hwD8ehyI5Ge0IUSVrHvrjwOabUBabCEK8VHEDqMt/O8RJEv6T4 gKpeQrL4geY4kEF9g7CmEHKQ9UwGlxfRpayIQ3UUwqZTWgLS3wdjGMuZ6gFCnNJK+u58yw F9vGhVRQUf0ypa9PCOPSl00a9qw8oI7WkUxJKAvTC0K0NPfdBM372DSUk/WCvA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1656772167; a=rsa-sha256; cv=none; b=q96yDikO82bU6mk7WtnBYB6Y2x+b8M1/R0iiK2NKNQBE1si9i/tExGtja+QisFDuOVxht8 3L47Qu4feU+2geDiyYNgiz3NJ721/QvAz+M9Smqx7RUgaNV8vHDE1V0rx4KlkdJwNLlaxL oggK65J2mC4Ulx6EzmHOzxOPqXijbhY78FLL1VktJc8Emz7jxeeEX4MejDNImn/lt4S27A 4Yr6EjOFty4xsWptQhb1JA1b07+FoAaLxnxJhPA3HaHPlt6PPScNx1kYh2IUTWzaot0tFk dD4c3kKDi9lOOj7ZWem7krwOq1flmceo27sjijP3ltr27YGijPYCmjj/eXFH4g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mikael: URL: https://cgit.FreeBSD.org/ports/commit/?id=b990f5d66341986260d02727a86102f01d81fec4 commit b990f5d66341986260d02727a86102f01d81fec4 Author: Mikael Urankar AuthorDate: 2022-07-02 12:52:00 +0000 Commit: Mikael Urankar CommitDate: 2022-07-02 14:17:59 +0000 net-im/signal-desktop: Fix build on aarch64 - patch-package can't patch sqlite3 on aarch64, patch the yarn cache instead - Delete ${WRKDIR}/electron${ELECTRON_VER_MAJOR}, as it may already contains electron19 (in case of a build failure) - Update electron-builder patch file --- net-im/signal-desktop/Makefile | 18 ++++++++++++++---- .../files/patch-patches_better-sqlite3+7.5.0.patch | 20 -------------------- ...h => patch-patches_electron-builder+23.0.8.patch} | 4 ++-- net-im/signal-desktop/files/sqlite3.gyp.diff | 17 +++++++++++++++++ net-im/signal-desktop/pkg-plist | 6 +++--- 5 files changed, 36 insertions(+), 29 deletions(-) diff --git a/net-im/signal-desktop/Makefile b/net-im/signal-desktop/Makefile index 7d2d242e277a..c535cdbc833f 100644 --- a/net-im/signal-desktop/Makefile +++ b/net-im/signal-desktop/Makefile @@ -90,6 +90,12 @@ NPM_PLAYWRITE_DIR= npm-playwright-core-1.17.1-a16e0f89284a0ed8ae6d77e1c905c84b8a NPM_ESBUILD_VERS= 0.14.28 NPM_ESBUILD_DIR= npm-esbuild-${NPM_ESBUILD_VERS}-7738635d2ea19e446bd319d83a1802545e6aebb8-integrity +NODE_ARCH= ${ARCH:S/aarch64/arm64/:S/amd64/x64/} +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 @@ -101,16 +107,17 @@ do-build: # copy ${LOCALBASE}/share/electron19 in WRKDIR # it's needed for the do-install phase, it's here because of this issue # https://github.com/MikaelUrankar/signal-desktop/issues/6 (I don't know why it fails though) + @${RM} -r ${WRKDIR}/electron${ELECTRON_VER_MAJOR} @${CP} -pR ${LOCALBASE}/share/electron${ELECTRON_VER_MAJOR} ${WRKDIR}/electron${ELECTRON_VER_MAJOR} ${CHMOD} -R a+w ${WRKDIR}/electron${ELECTRON_VER_MAJOR} # Install libsignal_node.so and libringrtc.so binaries in the yarn cache - ${MKDIR} ${WRKDIR}/.cache/yarn/v6/${NPM_SIGNAL_DIR}/node_modules/@signalapp/libsignal-client/prebuilds/freebsd-x64 \ + ${MKDIR} ${WRKDIR}/.cache/yarn/v6/${NPM_SIGNAL_DIR}/node_modules/@signalapp/libsignal-client/prebuilds/freebsd-${NODE_ARCH} \ ${WRKDIR}/.cache/yarn/v6/${NPM_RINGRTC_DIR}/node_modules/ringrtc/build/freebsd ${CP} ${LOCALBASE}/lib/libsignal_node.so \ - ${WRKDIR}/.cache/yarn/v6/${NPM_SIGNAL_DIR}/node_modules/@signalapp/libsignal-client/prebuilds/freebsd-x64/node.napi.node + ${WRKDIR}/.cache/yarn/v6/${NPM_SIGNAL_DIR}/node_modules/@signalapp/libsignal-client/prebuilds/freebsd-${NODE_ARCH}/node.napi.node ${CP} ${LOCALBASE}/lib/libringrtc.so \ - ${WRKDIR}/.cache/yarn/v6/${NPM_RINGRTC_DIR}/node_modules/ringrtc/build/freebsd/libringrtc-x64.node + ${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) @@ -122,6 +129,9 @@ do-build: ${CP} ${FILESDIR}/playwrigth-registry.js \ ${WRKDIR}/.cache/yarn/v6/${NPM_PLAYWRITE_DIR}/node_modules/playwright-core/lib/utils/registry.js + # patch-package can't patch sqlite3 on aarch64, patch the yarn cache instead + cd ${WRKDIR}/.cache/yarn/v6 && ${PATCH} -s -N -i ${FILESDIR}/sqlite3.gyp.diff + ${MKDIR} ${WRKDIR}/esbuild-freebsd-64-${NPM_ESBUILD_VERS} ${TAR} -xf ${WRKDIR}/yarn-cache/esbuild-freebsd-64-${NPM_ESBUILD_VERS}.tgz -C ${WRKDIR}/esbuild-freebsd-64-${NPM_ESBUILD_VERS} ${CP} ${WRKDIR}/esbuild-freebsd-64-${NPM_ESBUILD_VERS}/package/bin/esbuild \ @@ -155,7 +165,7 @@ do-install: --config.electronDist=${WRKDIR}/electron${ELECTRON_VER_MAJOR} ${MKDIR} ${STAGEDIR}${DATADIR} - cd ${BUILD_WRKSRC}/dist/linux-unpacked && \ + cd ${BUILD_WRKSRC}/dist/${APP_OUT_DIR} && \ ${COPYTREE_SHARE} . ${STAGEDIR}${DATADIR} ${MKDIR} ${STAGEDIR}${PREFIX}/share/pixmaps diff --git a/net-im/signal-desktop/files/patch-patches_better-sqlite3+7.5.0.patch b/net-im/signal-desktop/files/patch-patches_better-sqlite3+7.5.0.patch deleted file mode 100644 index 3b02e7399c4b..000000000000 --- a/net-im/signal-desktop/files/patch-patches_better-sqlite3+7.5.0.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- patches/better-sqlite3+7.5.0.patch.orig 2021-05-16 17:14:17 UTC -+++ patches/better-sqlite3+7.5.0.patch -@@ -0,0 +1,17 @@ -+--- a/node_modules/better-sqlite3/deps/sqlite3.gyp.orig -++++ b/node_modules/better-sqlite3/deps/sqlite3.gyp -+@@ -95,6 +95,14 @@ -+ ] -+ } -+ }, -++ '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/files/patch-patches_electron-builder+23.0.1.patch b/net-im/signal-desktop/files/patch-patches_electron-builder+23.0.8.patch similarity index 86% rename from net-im/signal-desktop/files/patch-patches_electron-builder+23.0.1.patch rename to net-im/signal-desktop/files/patch-patches_electron-builder+23.0.8.patch index d0de11b7c8c7..1dbd00a2200f 100644 --- a/net-im/signal-desktop/files/patch-patches_electron-builder+23.0.1.patch +++ b/net-im/signal-desktop/files/patch-patches_electron-builder+23.0.8.patch @@ -1,5 +1,5 @@ ---- patches/electron-builder+23.0.1.patch.orig 2022-02-24 13:03:47 UTC -+++ patches/electron-builder+23.0.1.patch +--- patches/electron-builder+23.0.8.patch.orig 2022-02-24 13:03:47 UTC ++++ patches/electron-builder+23.0.8.patch @@ -0,0 +1,13 @@ +diff --git a/node_modules/electron-builder/out/cli/install-app-deps.js b/node_modules/electron-builder/out/cli/install-app-deps.js +index 0c58564..2b6f9a5 100644 diff --git a/net-im/signal-desktop/files/sqlite3.gyp.diff b/net-im/signal-desktop/files/sqlite3.gyp.diff new file mode 100644 index 000000000000..81f31a90fa68 --- /dev/null +++ b/net-im/signal-desktop/files/sqlite3.gyp.diff @@ -0,0 +1,17 @@ +--- npm-better-sqlite3-7.5.0-3c4a7eebba3d5f5d8cb88fe83be1c01b8c0dea7d/node_modules/better-sqlite3/deps/sqlite3.gyp.orig 2022-07-02 14:34:04 UTC ++++ npm-better-sqlite3-7.5.0-3c4a7eebba3d5f5d8cb88fe83be1c01b8c0dea7d/node_modules/better-sqlite3/deps/sqlite3.gyp +@@ -95,6 +95,14 @@ + ] + } + }, ++ '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 be1863b8bd50..48b8204f269d 100644 --- a/net-im/signal-desktop/pkg-plist +++ b/net-im/signal-desktop/pkg-plist @@ -84,10 +84,10 @@ 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/libsignal-client/prebuilds/freebsd-x64/node.napi.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-x64.node -%%DATADIR%%/resources/app.asar.unpacked/node_modules/sharp/build/Release/sharp-freebsd-x64.node +%%DATADIR%%/resources/app.asar.unpacked/node_modules/ringrtc/build/freebsd/libringrtc-%%NODE_ARCH%%.node +%%DATADIR%%/resources/app.asar.unpacked/node_modules/sharp/build/Release/sharp-freebsd-%%SHARP_ARCH%%.node @(,,755) %%DATADIR%%/signal-desktop %%DATADIR%%/snapshot_blob.bin %%DATADIR%%/v8_context_snapshot.bin