diff --git a/editors/vscode/Makefile b/editors/vscode/Makefile index d0b1b7b7a864..8feaafd423ff 100644 --- a/editors/vscode/Makefile +++ b/editors/vscode/Makefile @@ -1,310 +1,311 @@ PORTNAME= vscode DISTVERSION= 1.88.0 +PORTREVISION= 1 CATEGORIES= editors MASTER_SITES= https://github.com/tagattie/FreeBSD-VSCode/releases/download/${DISTVERSION}/:yarn_cache DISTFILES= yarn-offline-cache-${DISTVERSION}${EXTRACT_SUFX}:yarn_cache \ vscode-marketplace-exts-${DISTVERSION}${EXTRACT_SUFX}:yarn_cache DIST_SUBDIR= ${PORTNAME} MAINTAINER= tagattie@FreeBSD.org COMMENT= Visual Studio Code - Open Source ("Code - OSS") WWW= https://code.visualstudio.com/ LICENSE= MIT LICENSE_FILE= ${WRKSRC}/LICENSE.txt ONLY_FOR_ARCHS= amd64 BUILD_DEPENDS= zip:archivers/zip \ electron${ELECTRON_VER_MAJOR}:devel/electron${ELECTRON_VER_MAJOR} \ rg:textproc/ripgrep \ npm-node${NODE_VER_MAJOR}>0:www/npm-node${NODE_VER_MAJOR} \ yarn-node${NODE_VER_MAJOR}>0:www/yarn-node${NODE_VER_MAJOR} LIB_DEPENDS= libatk-bridge-2.0.so:accessibility/at-spi2-core \ libatspi.so:accessibility/at-spi2-core \ libsnappy.so:archivers/snappy \ libFLAC.so:audio/flac \ libopus.so:audio/opus \ libsndio.so:audio/sndio \ libdbus-1.so:devel/dbus \ libicuuc.so:devel/icu \ libepoll-shim.so:devel/libepoll-shim \ libevent.so:devel/libevent \ libffi.so:devel/libffi \ libinotify.so:devel/libinotify \ libnotify.so:devel/libnotify \ libpci.so:devel/libpci \ libnspr4.so:devel/nspr \ libpcre2-8.so:devel/pcre2 \ libre2.so:devel/re2 \ liblcms2.so:graphics/lcms2 \ libdrm.so:graphics/libdrm \ libpng.so:graphics/png \ libwayland-client.so:graphics/wayland \ libwebp.so:graphics/webp \ libdav1d.so:multimedia/dav1d \ libvpx.so:multimedia/libvpx \ libopenh264.so:multimedia/openh264 \ libpipewire-0.3.so:multimedia/pipewire \ libcups.so:print/cups \ libfreetype.so:print/freetype2 \ libharfbuzz.so:print/harfbuzz \ libkrb5.so.3:security/krb5 \ libsecret-1.so:security/libsecret \ libnss3.so:security/nss \ libexpat.so:textproc/expat2 \ libxkbcommon.so:x11/libxkbcommon \ libxshmfence.so:x11/libxshmfence \ libfontconfig.so:x11-fonts/fontconfig RUN_DEPENDS= xdg-open:devel/xdg-utils \ bash:shells/bash TEST_DEPENDS= electron${ELECTRON_VER_MAJOR}:devel/electron${ELECTRON_VER_MAJOR} \ bash:shells/bash USES= desktop-file-utils gl gmake gnome iconv:wchar_t jpeg \ localbase:ldflags pkgconfig python:build shebangfix xorg USE_GITHUB= yes GH_ACCOUNT= microsoft SOURCE_COMMIT_HASH= 5c3e652f63e798a5ac2f31ffd0d863669328dc4c BINARY_ALIAS= python=${PYTHON_CMD} USE_XORG= x11 xcb xcomposite xcursor xdamage xext xfixes xi xkbfile \ xrandr xrender xscrnsaver xtst USE_GL= gbm gl glesv2 USE_GNOME= atk cairo pango gdkpixbuf2 gtk30 libxml2 libxslt USE_LDCONFIG= ${DATADIR} # Keep NODE_VER in sync with www/node18 DISTVERSION NODE_VER= 18.19.1 NODE_VER_MAJOR= ${NODE_VER:C/\..*$//} SHEBANG_REGEX= ./(extensions|resources|scripts|src)/.*\.sh$$ PATHFIX_FILES= src/vs/workbench/contrib/debug/node/terminals.ts DATADIR= ${PREFIX}/share/code-oss TMPDIR= ${WRKDIR} MAKE_ENV+= BUILD_SOURCEVERSION=${SOURCE_COMMIT_HASH} # Don't download electron binary distribution on electron node_modules installation MAKE_ENV+= ELECTRON_SKIP_BINARY_DOWNLOAD=1 # Don't download browser binaries on playwright node_modules installation MAKE_ENV+= PLAYWRIGHT_BROWSERS_PATH=${WRKDIR}/pw-browsers \ PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 # Don't create __pycache__ directory when executing node-gyp # This is a workaround to avoid filesystem violations during poudriere build MAKE_ENV+= PYTHONDONTWRITEBYTECODE=1 OPTIONS_DEFINE= REH OPTIONS_DEFAULT=# none REH_DESC= Build remote extension host ELECTRON_DIR= ${.CURDIR}/../../devel/electron28 .include "${ELECTRON_DIR}/Makefile.version" ELECTRON_DOWNLOAD_URL= https://github.com/electron/electron/releases/download/v${ELECTRON_VER} ELECTRON_DOWNLOAD_URL_HASH!= /sbin/sha256 -q -s ${ELECTRON_DOWNLOAD_URL} pre-everything:: @${ECHO_MSG} "" @${ECHO_MSG} "The limit imposed by poudriere(8) for the maximum number of files allowed to be" @${ECHO_MSG} "opened by a jail (default 1024) is exceeded during the build of ${PORTNAME}." @${ECHO_MSG} "To successfully build ${PORTNAME} with poudriere(8), you must add the following" @${ECHO_MSG} "line to poudriere.conf:" @${ECHO_MSG} "MAX_FILES_${PORTNAME}=8192" @${ECHO_MSG} "" post-extract: ${CP} ${WRKSRC}/build/.moduleignore.linux \ ${WRKSRC}/build/.moduleignore.freebsd post-patch: # force use of electron version matching port one ${REINPLACE_CMD} -E 's|^(target ").*(")$$|\1${ELECTRON_VER}\2|' \ ${WRKSRC}/.yarnrc # force use of node version matching port one ${REINPLACE_CMD} -E 's|^(target ").*(")$$|\1${NODE_VER}\2|' \ ${WRKSRC}/remote/.yarnrc # setup yarnrc for using local node headers ${ECHO_CMD} 'nodedir "${LOCALBASE}/share/electron${ELECTRON_VER_MAJOR}/node_headers"' >> \ ${WRKSRC}/.yarnrc ${ECHO_CMD} 'nodedir "${LOCALBASE}"' >> \ ${WRKSRC}/remote/.yarnrc # setup yarnrc for offline node_modules installation ${ECHO_CMD} 'yarn-offline-mirror "../yarn-offline-cache"' >> \ ${WRKSRC}/.yarnrc ${ECHO_CMD} 'yarn-offline-mirror "../../yarn-offline-cache"' >> \ ${WRKSRC}/remote/.yarnrc (cd ${WRKSRC} && \ ${FIND} -E . -type f -iregex '${SHEBANG_REGEX}' \ -exec ${SED} -i '' -e "s|/usr/bin/pgrep|/bin/pgrep|g" {} ';') (cd ${WRKSRC} && \ ${FIND} ${PATHFIX_FILES} -type f \ -exec ${SED} -i '' -e "s|/usr/bin/pgrep|/bin/pgrep|g" {} ';') ${REINPLACE_CMD} -e 's/@@NAME_LONG@@/Code - OSS/; \ s/@@NAME_SHORT@@/Code - OSS/; \ s/@@PRODNAME@@/Code - OSS/; \ s/@@NAME@@/code-oss/g; \ s|@@EXEC@@|${PREFIX}/bin/code-oss|; \ s/@@ICON@@/com.visualstudio.code.oss/; \ s/@@URLPROTOCOL@@/code-oss/; \ s/@@LICENSE@@/MIT/; \ s/@@APPNAME@@/code-oss/g; \ s|/usr/share|${PREFIX}/share|' \ ${WRKSRC}/resources/completions/bash/code \ ${WRKSRC}/resources/completions/zsh/_code \ ${WRKSRC}/resources/linux/bin/code.sh \ ${WRKSRC}/resources/linux/code.appdata.xml \ ${WRKSRC}/resources/linux/code.desktop \ ${WRKSRC}/resources/linux/code-url-handler.desktop (cd ${WRKDIR}/builtInExtensions && \ ${FIND} . -type f -name '*.sh' \ -exec ${SED} -i '' -e "s|/usr/bin/pgrep|/bin/pgrep|g" \ -e 's|#!/bin/bash|#!${LOCALBASE}/bin/bash|' {} ';') pre-build: install-node-modules patch-node-modules rebuild-node-modules copy-rg-binary install-node-modules: # install node_modules without executing post-installation scripts cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \ yarn --frozen-lockfile --ignore-scripts --offline cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \ yarn postinstall --frozen-lockfile --ignore-scripts --offline patch-node-modules: # patch install node modules before building native node modules for p in ${PATCHDIR}/node_modules/patch-*; do \ ${PATCH} -p0 -s -d ${WRKSRC} < $${p}; \ done rebuild-node-modules: # rebuild native node modules for electron for subdir in `${FIND} ${WRKSRC}/node_modules -type f -name binding.gyp -exec ${DIRNAME} {} ';'`; do \ cd $${subdir} && \ ${SETENV} ${MAKE_ENV} \ npm_config_runtime=electron \ npm_config_target=${ELECTRON_VER} \ npm_config_nodedir=${LOCALBASE}/share/electron${ELECTRON_VER_MAJOR}/node_headers \ node ${LOCALBASE}/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js rebuild; \ done cd ${WRKSRC}/extensions && \ ${SETENV} ${MAKE_ENV} \ npm_config_runtime=electron \ npm_config_target=${ELECTRON_VER} \ npm_config_nodedir=${LOCALBASE}/share/electron${ELECTRON_VER_MAJOR}/node_headers \ npm rebuild --verbose # rebuild native node modules for node .for dir in build remote cd ${WRKSRC}/${dir} && \ ${SETENV} ${MAKE_ENV} \ npm_config_nodedir=${LOCALBASE} \ npm rebuild --verbose .endfor copy-rg-binary: # copy rg binary files to vscode-ripgrep module directory ${MKDIR} ${WRKSRC}/node_modules/@vscode/ripgrep/bin ${CP} ${LOCALBASE}/bin/rg ${WRKSRC}/node_modules/@vscode/ripgrep/bin ${MKDIR} ${WRKSRC}/remote/node_modules/@vscode/ripgrep/bin ${CP} ${LOCALBASE}/bin/rg ${WRKSRC}/remote/node_modules/@vscode/ripgrep/bin do-build: # setup download cache for gulp-atom-electron ${MKDIR} ${WRKDIR}/.cache/electron/${ELECTRON_DOWNLOAD_URL_HASH} cd ${LOCALBASE}/share/electron${ELECTRON_VER_MAJOR} && \ zip -q -r ${WRKDIR}/.cache/electron/${ELECTRON_DOWNLOAD_URL_HASH}/electron-v${ELECTRON_VER}-linux-x64.zip . cd ${WRKDIR}/.cache/electron/${ELECTRON_DOWNLOAD_URL_HASH} && \ ${SHA256} -r *-v${ELECTRON_VER}-linux-*.zip | \ ${SED} -e 's/ / */' > SHASUMS256.txt # add newline character at the end of the file if not already ${AWK} '1' ${WRKSRC}/build/checksums/electron.txt > \ ${WRKSRC}/build/checksums/electron.txt.new ${MV} -f ${WRKSRC}/build/checksums/electron.txt.new \ ${WRKSRC}/build/checksums/electron.txt cd ${WRKDIR}/.cache/electron/${ELECTRON_DOWNLOAD_URL_HASH} && \ ${SHA256} -r *-v${ELECTRON_VER}-linux-*.zip | \ ${SED} -e 's/ / */' >> ${WRKSRC}/build/checksums/electron.txt # build and package vscode cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} yarn run tsc -p build/tsconfig.build.json cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} yarn gulp vscode-linux-x64-min # copy marketplace extensions ${MV} ${WRKDIR}/builtInExtensions/* ${WRKDIR}/VSCode-linux-x64/resources/app/extensions do-build-REH-on: # setup download cache for node ${MKDIR} ${WRKSRC}/.build/node/v${NODE_VER}/linux-x64 ${CP} ${LOCALBASE}/bin/node ${WRKSRC}/.build/node/v${NODE_VER}/linux-x64 # build vscode remote extension host cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} yarn gulp vscode-reh-linux-x64-min ${MKDIR} ${WRKDIR}/vscode-reh/bin/${SOURCE_COMMIT_HASH} cd ${WRKDIR}/vscode-reh-linux-x64 && ${TAR} -cf - . | \ ${TAR} -xf - -C ${WRKDIR}/vscode-reh/bin/${SOURCE_COMMIT_HASH} cd ${WRKDIR}/vscode-reh && \ ${TAR} -czf ../vscode-reh-${DISTVERSION}-${OPSYS:tl}${OSREL:R}-${ARCH}.tar.gz . # cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} yarn gulp vscode-reh-web-linux-x64-min do-install: ${MKDIR} ${STAGEDIR}${PREFIX}/etc/bash_completion.d ${INSTALL_DATA} ${WRKSRC}/resources/completions/bash/code \ ${STAGEDIR}${PREFIX}/etc/bash_completion.d/code-oss ${MKDIR} ${STAGEDIR}${PREFIX}/share/zsh/site-functions ${INSTALL_DATA} ${WRKSRC}/resources/completions/zsh/_code \ ${STAGEDIR}${PREFIX}/share/zsh/site-functions/_code-oss ${MKDIR} ${STAGEDIR}${PREFIX}/share/appdata ${INSTALL_DATA} ${WRKSRC}/resources/linux/code.appdata.xml \ ${STAGEDIR}${PREFIX}/share/appdata/code-oss.appdata.xml ${MKDIR} ${STAGEDIR}${PREFIX}/share/applications .for f in code.desktop code-url-handler.desktop ${INSTALL_DATA} ${WRKSRC}/resources/linux/${f} \ ${STAGEDIR}${PREFIX}/share/applications/${f:S/code/code-oss/} .endfor ${MKDIR} ${STAGEDIR}${PREFIX}/share/pixmaps ${INSTALL_DATA} ${WRKSRC}/resources/linux/code.png \ ${STAGEDIR}${PREFIX}/share/pixmaps/com.visualstudio.code.oss.png ${MKDIR} ${STAGEDIR}${DATADIR} cd ${WRKDIR}/VSCode-linux-x64 && \ ${TAR} -cf - . | ${TAR} -xf - -C ${STAGEDIR}${DATADIR} cd ${STAGEDIR}${DATADIR}/resources/app/node_modules.asar.unpacked && \ ${FIND} . -type f -exec ${FILE} {} ';' | \ ${GREP} 'ELF.*FreeBSD' | ${AWK} -F ':' '{print $$1}' | ${XARGS} ${STRIP_CMD} .for f in chromedriver mksnapshot v8_context_snapshot_generator ${RM} ${STAGEDIR}${DATADIR}/${f} .endfor ${RM} -r ${STAGEDIR}${DATADIR}/gen ${RM} -r ${STAGEDIR}${DATADIR}/node_headers ${RM} -r ${STAGEDIR}${DATADIR}/resources/completions ${RLN} ${STAGEDIR}${DATADIR}/bin/code-oss ${STAGEDIR}${PREFIX}/bin ${INSTALL_SCRIPT} ${FILESDIR}/wrapper.sh ${STAGEDIR}${PREFIX}/bin/${PORTNAME} pre-test: # setup electron dependency for unit tests ${MKDIR} ${WRKSRC}/.build/electron cd ${LOCALBASE}/share/electron${ELECTRON_VER_MAJOR} && \ ${TAR} -cf - . | ${TAR} -xf - -C ${WRKSRC}/.build/electron cd ${WRKSRC}/.build/electron && ${MV} -f electron code-oss do-test: # Note: Xvfb or something similar is necessary for headless testing # unit tests cd ${WRKSRC} && ${SETENV} ${TEST_ENV} ./scripts/test.sh || ${TRUE} # UI smoke tests cd ${WRKSRC} && ${SETENV} ${TEST_ENV} yarn smoketest ### targets for port maintainer(s) make-yarn-cache: # do "make configure" before executing this target ${RM} -r ${WRKDIR}/yarn-offline-cache cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \ yarn --frozen-lockfile --ignore-scripts cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \ yarn postinstall --frozen-lockfile --ignore-scripts cd ${WRKDIR} && ${TAR} -czf \ yarn-offline-cache-${DISTVERSION}${EXTRACT_SUFX} yarn-offline-cache make-marketplace-exts: ${RM} -r ${WRKSRC}/.build/builtInExtensions cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \ yarn download-builtin-extensions && \ cd ${WRKSRC}/.build && ${TAR} -czf \ ${WRKDIR}/vscode-marketplace-exts-${DISTVERSION}${EXTRACT_SUFX} builtInExtensions .include diff --git a/net-im/signal-desktop/Makefile b/net-im/signal-desktop/Makefile index a01016810dbb..48e56c91d72f 100644 --- a/net-im/signal-desktop/Makefile +++ b/net-im/signal-desktop/Makefile @@ -1,234 +1,234 @@ PORTNAME= signal-desktop DISTVERSIONPREFIX= v DISTVERSION= 6.48.1 -PORTREVISION= 6 +PORTREVISION= 7 CATEGORIES= net-im MASTER_SITES= LOCAL/mikael/signal-desktop/:npm \ LOCAL/mikael/signal-desktop/:sqlite \ LOCAL/mikael/signal-desktop/:yarn \ https://build-artifacts.signal.org/desktop/:sqlcipher DISTFILES= signal-desktop-${DISTVERSION}-yarn-cache.tar.gz:yarn \ signal-desktop-6.37.0-npm-cache.tar.gz:npm \ ${SQLCIPHER}.tar.gz:sqlcipher MAINTAINER= ports@FreeBSD.org COMMENT= Cross-platform centralized encrypted messaging service WWW= https://signal.org/ LICENSE= AGPLv3 LICENSE_FILE= ${WRKSRC}/LICENSE ONLY_FOR_ARCHS= aarch64 amd64 EXTRACT_DEPENDS=jq:textproc/jq \ yarn-node18>0:www/yarn-node18 BUILD_DEPENDS= ${LOCALBASE}/lib/libcrypto.a:security/openssl \ ${LOCALBASE}/lib/libringrtc.so:multimedia/ringrtc \ ${LOCALBASE}/lib/libsignal_node.so:net-im/libsignal-node \ ${LOCALBASE}/lib/libsignal_tokenizer.a:devel/signal-fts5-extension \ app-builder>0:devel/app-builder \ electron${ELECTRON_VER_MAJOR}:devel/electron${ELECTRON_VER_MAJOR} \ jq:textproc/jq \ npm:www/npm-node18 \ yarn:www/yarn-node18 LIB_DEPENDS= libasound.so:audio/alsa-lib \ libatk-bridge-2.0.so:accessibility/at-spi2-core \ libatspi.so:accessibility/at-spi2-core \ libcups.so:print/cups \ libdbus-1.so:devel/dbus \ libdrm.so:graphics/libdrm \ libepoll-shim.so:devel/libepoll-shim \ libevent.so:devel/libevent \ libexpat.so:textproc/expat2 \ libFLAC.so:audio/flac \ libffi.so:devel/libffi \ libfontconfig.so:x11-fonts/fontconfig \ libfreetype.so:print/freetype2 \ libharfbuzz.so:print/harfbuzz \ libicuuc.so:devel/icu \ libnspr4.so:devel/nspr \ libnss3.so:security/nss \ libopenh264.so:multimedia/openh264 \ libopus.so:audio/opus \ libpci.so:devel/libpci \ libpng16.so:graphics/png \ libsnappy.so:archivers/snappy \ libwayland-client.so:graphics/wayland \ libwebp.so:graphics/webp \ libxkbcommon.so:x11/libxkbcommon \ libxshmfence.so:x11/libxshmfence USES= desktop-file-utils gettext-runtime gl gnome jpeg xorg USE_GITHUB= yes GH_ACCOUNT= signalapp GH_PROJECT= Signal-Desktop USE_GL= gbm gl USE_GNOME= atk cairo gdkpixbuf2 glib20 gtk30 libxml2 libxslt pango USE_XORG= x11 xcb xcomposite xdamage xext xfixes xi xrandr xrender xtst PACKAGE_ENV= SIGNAL_ENV=production MAKE_ENV+= ELECTRON_OVERRIDE_DIST_PATH=${LOCALBASE}/share/electron${ELECTRON_VER_MAJOR} \ HOME=${WRKDIR} \ USE_SYSTEM_APP_BUILDER=true \ SOURCE_DATE_EPOCH=${_BUILD_DATE} \ PATH=${WRKSRC}/node_modules/.bin:${LOCALBASE}/bin:${PATH} # Don't download electron binary distribution on electron node_modules installation MAKE_ENV+= ELECTRON_SKIP_BINARY_DOWNLOAD=1 # Don't create __pycache__ directory when executing node-gyp # This is a workaround to avoid filesystem violations during poudriere build MAKE_ENV+= PYTHONDONTWRITEBYTECODE=1 MAKE_ENV+= ESBUILD_BINARY_PATH=${WRKDIR}/esbuild-freebsd-64/package/bin/esbuild _BUILD_DATE= $$(date +'%s') ELECTRON_VER_MAJOR= 28 # sh get_deps.sh NPM_SIGNAL_DIR= npm-@signalapp-libsignal-client-0.39.1-15b41f15c516ae3eecf8a098a9c9c7aac00444d7-integrity NPM_RINGRTC_DIR= npm-@signalapp-ringrtc-2.37.0-d8f98d839c8cd8737acacdec111fb3bf272af54c-integrity NPM_SQLITE3_DIR= npm-@signalapp-better-sqlite3-8.6.0-0413f4d0626b99838cd64ad09c88720aa2bec6ed-integrity NPM_ESBUILD_VERS= 0.18.20 SQLCIPHER= sqlcipher-4.5.5-fts5-fix--3.0.7--0.2.1-ef53ea45ed92b928ecfd33c552d8d405263e86e63dec38e1ec63e1b0193b630b ESBUILD_ARCH= ${ARCH:S/aarch64/arm64/:S/amd64/x64/} 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/} YARN_TIMESTAMP= 1661146515 .include .if ${ARCH} == aarch64 PLIST_SUB+= NOT_AARCH64="@comment " .elif ${ARCH} == amd64 PLIST_SUB+= NOT_AARCH64="" .endif fetch-yarn: if [ ! -f ${DISTDIR}/signal-desktop-${DISTVERSION}-yarn-cache.tar.gz ]; then \ ${MKDIR} /tmp/signal-desktop; \ ${FETCH_CMD} -o - https://raw.githubusercontent.com/signalapp/Signal-Desktop/v${DISTVERSION}/package.json | \ ${PREFIX}/bin/jq '.devDependencies.esbuild = "0.18.20"' | \ ${PREFIX}/bin/jq '.engines.node = ""' > /tmp/signal-desktop/package.json; \ ${FETCH_CMD} -o /tmp/signal-desktop/yarn.lock https://raw.githubusercontent.com/signalapp/Signal-Desktop/v${DISTVERSION}/yarn.lock; \ ${ECHO_CMD} 'yarn-offline-mirror "./yarn-offline-cache"' >> \ /tmp/signal-desktop/.yarnrc; \ ${PREFIX}/bin/jq 'del(.devDependencies."@signalapp/mock-server")' /tmp/signal-desktop/package.json > /tmp/signal-desktop/package.json.tmp; \ ${MV} /tmp/signal-desktop/package.json.tmp /tmp/signal-desktop/package.json; \ cd /tmp/signal-desktop && ${SETENV} HOME=/tmp/signal-desktop XDG_CACHE_HOME=/tmp/signal-desktop/.cache \ yarn --ignore-scripts; \ ${MTREE_CMD} -cbnSp yarn-offline-cache | ${MTREE_CMD} -C | ${SED} \ -e 's:time=[0-9.]*:time=${YARN_TIMESTAMP}.000000000:' \ -e 's:\([gu]id\)=[0-9]*:\1=0:g' \ -e 's:flags=.*:flags=none:' \ -e 's:^\.:./yarn-offline-cache:' > yarn-offline-cache.mtree; \ ${TAR} cJf ${DISTDIR}/signal-desktop-${DISTVERSION}-yarn-cache.tar.gz \ @yarn-offline-cache.mtree; \ ${RM} -r ${WRKDIR}; \ fi post-extract: # install yarn modules and fail silently ${ECHO_CMD} 'yarn-offline-mirror "../yarn-offline-cache"' > ${WRKSRC}/.yarnrc ${ECHO_CMD} 'nodedir "${LOCALBASE}"' >> ${WRKSRC}/.yarnrc # Update node engine ${PREFIX}/bin/jq '.engines.node = ""' ${WRKSRC}/package.json > ${WRKSRC}/package.json.tmp.1 ${PREFIX}/bin/jq '.devDependencies.esbuild = "0.18.20"' ${WRKSRC}/package.json.tmp.1 > ${WRKSRC}/package.json.tmp ${MV} ${WRKSRC}/package.json.tmp ${WRKSRC}/package.json # remove mock-server as it doesn't build and is useless ${PREFIX}/bin/jq 'del(.devDependencies."@signalapp/mock-server")' ${WRKSRC}/package.json > ${WRKSRC}/package.json.tmp ${MV} ${WRKSRC}/package.json.tmp ${WRKSRC}/package.json ${CP} ${FILESDIR}/yarn.lock ${WRKSRC} cd ${WRKSRC} && \ ${SETENV} ${MAKE_ENV} yarn install --ignore-optional --offline || ${TRUE} do-build: ${ECHO_CMD} 'yarn-offline-mirror "../yarn-offline-cache"' > ${WRKSRC}/.yarnrc ${ECHO_CMD} 'nodedir "${LOCALBASE}/share/electron${ELECTRON_VER_MAJOR}/node_headers"' >> ${WRKSRC}/.yarnrc # electron-builder is stupid and tries to open ${LOCALBASE}/share/electron25/electron with WRITE priv # copy ${LOCALBASE}/share/electron25 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-${NODE_ARCH} \ ${WRKDIR}/.cache/yarn/v6/${NPM_RINGRTC_DIR}/node_modules/@signalapp/ringrtc/build/freebsd ${CP} ${LOCALBASE}/lib/libsignal_node.so \ ${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/@signalapp/ringrtc/build/freebsd/libringrtc-${NODE_ARCH}.node ${MKDIR} ${WRKDIR}/.cache/yarn/v6/${NPM_SQLITE3_DIR}/node_modules/@signalapp/better-sqlite3/deps ${CP} ${DISTDIR}/${SQLCIPHER}.tar.gz \ ${WRKDIR}/.cache/yarn/v6/${NPM_SQLITE3_DIR}/node_modules/@signalapp/better-sqlite3/deps/sqlcipher.tar.gz ${CP} ${FILESDIR}/fetch-prebuild.js \ ${WRKDIR}/.cache/yarn/v6/${NPM_RINGRTC_DIR}/node_modules/@signalapp/ringrtc/scripts/fetch-prebuild.js ${CP} ${FILESDIR}/download.js \ ${WRKDIR}/.cache/yarn/v6/${NPM_SQLITE3_DIR}/node_modules/@signalapp/better-sqlite3/deps/download.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 ${TAR} -xf ${WRKDIR}/yarn-offline-cache/@esbuild-freebsd-${ESBUILD_ARCH}-${NPM_ESBUILD_VERS}.tgz -C ${WRKDIR}/esbuild-freebsd-64 # For offline build ${ECHO_CMD} offline=true > ${WRKDIR}/.npmrc cd ${WRKSRC} && \ ${SETENV} ${MAKE_ENV} yarn install --frozen-lockfile --ignore-optional --offline cd ${WRKSRC} && \ ${SETENV} ${MAKE_ENV} yarn --offline generate cd ${WRKSRC} && \ ${SETENV} ${MAKE_ENV} yarn --offline build:esbuild:prod do-install: # taken from https://github.com/tagattie/FreeBSD-Electron/blob/master/Mk/Uses/electron.mk#L387 # and editors/vscode cd ${WRKSRC} && \ ${SETENV} ${MAKE_ENV} ${PACKAGE_ENV} yarn run electron-builder \ --linux --dir --config.npmRebuild=false \ --config.electronVersion=${ELECTRON_VER_MAJOR} \ --config.electronDist=${WRKDIR}/electron${ELECTRON_VER_MAJOR} ${MKDIR} ${STAGEDIR}${DATADIR} cd ${BUILD_WRKSRC}/dist/${APP_OUT_DIR} && \ ${COPYTREE_SHARE} . ${STAGEDIR}${DATADIR} ${MKDIR} ${STAGEDIR}${PREFIX}/share/pixmaps ${INSTALL_DATA} ${WRKSRC}/images/signal-logo-desktop-linux.png \ ${STAGEDIR}${PREFIX}/share/pixmaps/signal-desktop.png ${INSTALL_DATA} ${FILESDIR}/${PORTNAME}.desktop \ ${STAGEDIR}${PREFIX}/share/applications .for f in chromedriver mksnapshot v8_context_snapshot_generator ${RM} ${STAGEDIR}${DATADIR}/${f} .endfor ${RM} -r ${STAGEDIR}${DATADIR}/gen ${RM} -r ${STAGEDIR}${DATADIR}/node_headers ${RM} -r ${STAGEDIR}${DATADIR}/resources/completions ${RLN} ${STAGEDIR}${DATADIR}/signal-desktop ${STAGEDIR}${PREFIX}/bin # This seems to be only required for Windows: ${RM} -r ${STAGEDIR}${DATADIR}/resources/app.asar.unpacked/node_modules/@nodert-win10-rs4 ${RM} -r ${STAGEDIR}${DATADIR}/resources/app.asar.unpacked/node_modules/@signalapp/windows-dummy-keystroke create-caches-tarball: # do some cleanup first ${RM} -r ${WRKDIR}/.npm/_logs ${WRKDIR}/.npm/_update-notifier-last-checked ${WRKDIR}/.cache/yarn/v6/.tmp cd ${WRKDIR} && \ ${TAR} czf signal-desktop-${DISTVERSION}-npm-cache.tar.gz .npm .include