Package Details: threema-desktop 1.2.46-2

Git Clone URL: https://aur.archlinux.org/threema-desktop.git (read-only, click to copy)
Package Base: threema-desktop
Description: Threema Desktop (Threema Web in Electron).
Upstream URL: https://github.com/threema-ch/threema-web-electron
Licenses: AGPL
Submitter: dbrgn
Maintainer: dbrgn
Last Packager: dbrgn
Votes: 17
Popularity: 0.056494
First Submitted: 2021-10-27 10:38 (UTC)
Last Updated: 2024-11-22 00:17 (UTC)

Latest Comments

« First ‹ Previous 1 2 3 4 5 6 Next › Last »

dbrgn commented on 2022-12-08 15:35 (UTC)

@solnce: I think I know what the reason is... I suspect an incompatibility with the latest NodeJS. Can you try installing nodejs-lts-gallium (which will replace nodejs) and test if the build succeeds?

solnce commented on 2022-12-08 13:45 (UTC)

@dbrgn: I noticed that, too.

Yes, plain Arch Linux, installed by myself, no derivative anywhere.

Yes, everything is up to date.

Yes, I am also on electron-20.3.8-1, from the community repo.

I am absolutely at a loss here, too.

dbrgn commented on 2022-12-08 12:26 (UTC)

solnce: The two logs you posted are different from the errors you got before. Instead of a patch applying, you get a compilation error:

npm ERR! ../../nan/nan_callbacks.h:55:23: error: ‘AccessorSignature’ is not a member of ‘v8’
npm ERR!    55 | typedef v8::Local<v8::AccessorSignature> Sig;
npm ERR!       |                       ^~~~~~~~~~~~~~~~~
npm ERR! ../../nan/nan_callbacks.h:55:40: error: template argument 1 is invalid
npm ERR!    55 | typedef v8::Local<v8::AccessorSignature> Sig;
npm ERR!       |                                        ^

Sorry, I cannot reproduce your issues. On all my computers, building works just fine. Is your system up to date (including the electron package)? You're using Arch, and not some derivative distro, right? At what version is your electron package? (On my system it's 20.3.8-1)

solnce commented on 2022-12-07 09:39 (UTC)

Same with 1.2.25-2.

https://pastebin.com/EmBn4ntE

solnce commented on 2022-12-07 09:20 (UTC)

The latest version still won't work. Log here.

https://pastebin.com/GqwNtivp

buzo commented on 2022-11-23 20:17 (UTC) (edited on 2022-11-23 20:17 (UTC) by buzo)

Build fails here, too:

==> Starting build()...
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be     problematic.  See https://v8.dev/blog/math-random for details.

added 606 packages, and audited 607 packages in 17s

74 packages are looking for funding
  run `npm fund` for details

7 vulnerabilities (3 moderate, 4 high)

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
npm notice 
npm notice New major version of npm available! 8.19.2 -> 9.1.2
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v9.1.2>
npm notice Run `npm install -g npm@9.1.2` to update!
npm notice 
Patching new user agent detection
../../../tools/patches/patch-user-agent.patch:45: trailing whitespace.
            browser.macosDesktop = /darwinthreemadesktop/.test(uagent) 
../../../tools/patches/patch-user-agent.patch:46: trailing whitespace.
            browser.win32Desktop = /win32threemadesktop/.test(uagent) 
../../../tools/patches/patch-user-agent.patch:47: trailing whitespace.
            browser.linuxDesktop = /linuxthreemadesktop/.test(uagent) 
error: patch failed: src/partials/welcome.ts:174
error: src/partials/welcome.ts: patch does not apply
==> ERROR: A failure occurred in build().

solnce commented on 2022-11-18 14:53 (UTC) (edited on 2022-11-18 14:55 (UTC) by solnce)

@sylphio Interesting, but I cannot confirm this works. Here's how I applied everything.

diff --git a/PKGBUILD b/PKGBUILD
index 3336ecb..4200059 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -17,12 +17,14 @@ source=(
   "threema-web-v${_threema_web_ver}.tar.gz::https://github.com/threema-ch/threema-web/archive/refs/tags/v${_threema_web_ver}.tar.gz"
   "threema.desktop"
   "0001-Remove-browser-warning.patch"
+  "patch-user-agent-patch.patch"
 )
 sha256sums=(
   '9ff6aec5cd4802af8f3951fe9172115b49102003204cd0bd86d01aec98ab2fca'
   '82b4bc5ac2cfde8c3f6ee79f3d90ebb6a395c1db7969756493ab18b321f89783'
   'ccfdae3416e2a1f096cfaf67fd8f8dacb0d8348582fc666ecc8b5b0d08ef5bf2'
   '75be30059dab96e015a9030477c3a7e55584b408761f9c50a9491d1bed152c78'
+  'e0077cef23252632d07121845e827527de46ae3efa29539d3a415da221919994'
 )

 prepare() {
@@ -42,6 +44,7 @@ build() {
   export DEV_ENV=production
   export threema_web_version=threema-web-${_threema_web_ver}
   npm install
+  patch -p0 < ../patch-user-agent-patch.patch
   ./tools/patches/patch-threema-web.sh
   npm run app:build:web
   ./tools/patches/post-patch-threema-web.sh
diff --git a/patch-user-agent-patch.patch b/patch-user-agent-patch.patch
new file mode 100644
index 0000000..b9f69c0
--- /dev/null
+++ b/patch-user-agent-patch.patch
@@ -0,0 +1,21 @@
+--- tools/patches/patch-user-agent.patch
++++ tools/patches/patch-user-agent.patch
+@@ -14,18 +14,6 @@
+          }
+          if (this.mobile) {
+              description += ' [Mobile]';
+-diff --git a/src/partials/welcome.ts b/src/partials/welcome.ts
+-index 03a58b31..72ee154a 100644
+---- a/src/partials/welcome.ts
+-+++ b/src/partials/welcome.ts
+-@@ -174,6 +174,7 @@ class WelcomeController {
+-                 this.log.warn('Edge is too old (' + version + ' < ' + minVersions.EDGE + ')');
+-                 this.showBrowserWarning();
+-             }
+-+        } else if (this.browser.name === threema.BrowserName.win32Desktop || this.browser.name === threema.BrowserName.macosDesktop || this.browser.name === threema.BrowserName.linuxDesktop) {
+-         } else {
+-             this.log.warn('Non-supported browser, please use Chrome, Firefox, Edge or Opera');
+-             this.showBrowserWarning();
+ diff --git a/src/services/browser.ts b/src/services/browser.ts
+ index c65b1541..419ea3a6 100644
+ --- a/src/services/browser.ts

That produces the following output.

==> Making package: threema-desktop 1.2.21-1 (Fri 18 Nov 2022 03:52:05 PM CET)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found threema-web-electron-v1.2.21.tar.gz
  -> Found threema-web-v2.4.4.tar.gz
  -> Found threema.desktop
  -> Found 0001-Remove-browser-warning.patch
  -> Found patch-user-agent-patch.patch
==> Validating source files with sha256sums...
    threema-web-electron-v1.2.21.tar.gz ... Passed
    threema-web-v2.4.4.tar.gz ... Passed
    threema.desktop ... Passed
    0001-Remove-browser-warning.patch ... Passed
    patch-user-agent-patch.patch ... Passed
==> Extracting sources...
  -> Extracting threema-web-electron-v1.2.21.tar.gz with bsdtar
  -> Extracting threema-web-v2.4.4.tar.gz with bsdtar
==> Starting prepare()...
patching file src/partials/welcome.ts
==> Starting build()...
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.

added 606 packages, and audited 607 packages in 4s

74 packages are looking for funding
  run `npm fund` for details

7 vulnerabilities (3 moderate, 4 high)

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
patching file tools/patches/patch-user-agent.patch
Patching new user agent detection
../../../tools/patches/patch-user-agent.patch:33: trailing whitespace.
            browser.macosDesktop = /darwinthreemadesktop/.test(uagent)
../../../tools/patches/patch-user-agent.patch:34: trailing whitespace.
            browser.win32Desktop = /win32threemadesktop/.test(uagent)
../../../tools/patches/patch-user-agent.patch:35: trailing whitespace.
            browser.linuxDesktop = /linuxthreemadesktop/.test(uagent)
warning: 3 lines add whitespace errors.
Patching looks (web icon and status bar)

> app:build:web
> cd app/dependencies/threema-web && rm -rf release && npm install --production && npm rebuild node-sass && npm run dist && cd ../..

npm WARN config production Use `--omit=dev` instead.
npm WARN old lockfile
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile
npm WARN deprecated @npmcli/move-file@1.1.2: This functionality has been moved to @npmcli/fs
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated angular-sanitize@1.8.3: For the actively supported Angular, see https://www.npmjs.com/package/@angular/core. AngularJS support has officially ended. For extended AngularJS support options, see https://goo.gle/angularjs-path-forward.
npm WARN deprecated angular-aria@1.8.3: For the actively supported Angular, see https://www.npmjs.com/package/@angular/core. AngularJS support has officially ended. For extended AngularJS support options, see https://goo.gle/angularjs-path-forward.
npm WARN deprecated angular-route@1.8.3: For the actively supported Angular, see https://www.npmjs.com/package/@angular/core. AngularJS support has officially ended. For extended AngularJS support options, see https://goo.gle/angularjs-path-forward.
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated angular-animate@1.8.3: For the actively supported Angular, see https://www.npmjs.com/package/@angular/core. AngularJS support has officially ended. For extended AngularJS support options, see https://goo.gle/angularjs-path-forward.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated messageformat@2.3.0: Package renamed as '@messageformat/core', see messageformat.github.io for more details. 'messageformat@4' will eventually provide a polyfill for Intl.MessageFormat, once it's been defined by Unicode & ECMA.
npm WARN deprecated angular@1.8.3: For the actively supported Angular, see https://www.npmjs.com/package/@angular/core. AngularJS support has officially ended. For extended AngularJS support options, see https://goo.gle/angularjs-path-forward.
npm WARN deprecated angular-material@1.2.5: For the actively supported Angular Material, see https://www.npmjs.com/package/@angular/material. AngularJS support has officially ended. For extended AngularJS support options, see https://goo.gle/angularjs-path-forward.
npm ERR! code 1
npm ERR! path /tmp/makepkg/threema-desktop/src/threema-web-electron-1.2.21/app/dependencies/threema-web/node_modules/node-sass
npm ERR! command failed
npm ERR! command sh -c -- node scripts/build.js
npm ERR! Building: /usr/bin/node /tmp/makepkg/threema-desktop/src/threema-web-electron-1.2.21/app/dependencies/threema-web/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! make: Entering directory '/tmp/makepkg/threema-desktop/src/threema-web-electron-1.2.21/app/dependencies/threema-web/node_modules/node-sass/build'
npm ERR!   g++ -o Release/obj.target/libsass/src/libsass/src/ast.o ../src/libsass/src/ast.cpp '-DNODE_GYP_MODULE_NAME=libsass' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DLIBSASS_VERSION="3.5.5"' -I/home/timeshifter/.cache/node-gyp/19.1.0/include/node -I/home/timeshifter/.cache/node-gyp/19.1.0/src -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/openssl/config -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/openssl/openssl/include -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/uv/include -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/zlib -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/v8/include -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -fPIC -O3 -fno-omit-frame-pointer -std=gnu++17 -std=c++0x -fexceptions -frtti -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/ast.o.d.raw  -march=native -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -fstack-protector-strong -Wp,-D_GLIBCXX_ASSERTIONS -c
npm ERR!   g++ -o Release/obj.target/libsass/src/libsass/src/ast_fwd_decl.o ../src/libsass/src/ast_fwd_decl.cpp '-DNODE_GYP_MODULE_NAME=libsass' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DLIBSASS_VERSION="3.5.5"' -I/home/timeshifter/.cache/node-gyp/19.1.0/include/node -I/home/timeshifter/.cache/node-gyp/19.1.0/src -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/openssl/config -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/openssl/openssl/include -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/uv/include -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/zlib -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/v8/include -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -fPIC -O3 -fno-omit-frame-pointer -std=gnu++17 -std=c++0x -fexceptions -frtti -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/ast_fwd_decl.o.d.raw  -march=native -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -fstack-protector-strong -Wp,-D_GLIBCXX_ASSERTIONS -c
npm ERR!   g++ -o Release/obj.target/libsass/src/libsass/src/backtrace.o ../src/libsass/src/backtrace.cpp '-DNODE_GYP_MODULE_NAME=libsass' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DLIBSASS_VERSION="3.5.5"' -I/home/timeshifter/.cache/node-gyp/19.1.0/include/node -I/home/timeshifter/.cache/node-gyp/19.1.0/src -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/openssl/config -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/openssl/openssl/include -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/uv/include -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/zlib -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/v8/include -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -fPIC -O3 -fno-omit-frame-pointer -std=gnu++17 -std=c++0x -fexceptions -frtti -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/backtrace.o.d.raw  -march=native -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -fstack-protector-strong -Wp,-D_GLIBCXX_ASSERTIONS -c
npm ERR!   g++ -o Release/obj.target/libsass/src/libsass/src/base64vlq.o ../src/libsass/src/base64vlq.cpp '-DNODE_GYP_MODULE_NAME=libsass' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DLIBSASS_VERSION="3.5.5"' -I/home/timeshifter/.cache/node-gyp/19.1.0/include/node -I/home/timeshifter/.cache/node-gyp/19.1.0/src -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/openssl/config -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/openssl/openssl/include -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/uv/include -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/zlib -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/v8/include -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -fPIC -O3 -fno-omit-frame-pointer -std=gnu++17 -std=c++0x -fexceptions -frtti -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/base64vlq.o.d.raw  -march=native -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -fstack-protector-strong -Wp,-D_GLIBCXX_ASSERTIONS -c
npm ERR!   g++ -o Release/obj.target/libsass/src/libsass/src/bind.o ../src/libsass/src/bind.cpp '-DNODE_GYP_MODULE_NAME=libsass' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DLIBSASS_VERSION="3.5.5"' -I/home/timeshifter/.cache/node-gyp/19.1.0/include/node -I/home/timeshifter/.cache/node-gyp/19.1.0/src -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/openssl/config -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/openssl/openssl/include -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/uv/include -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/zlib -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/v8/include -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -fPIC -O3 -fno-omit-frame-pointer -std=gnu++17 -std=c++0x -fexceptions -frtti -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/bind.o.d.raw  -march=native -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -fstack-protector-strong -Wp,-D_GLIBCXX_ASSERTIONS -c
npm ERR!   cc -o Release/obj.target/libsass/src/libsass/src/cencode.o ../src/libsass/src/cencode.c '-DNODE_GYP_MODULE_NAME=libsass' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DLIBSASS_VERSION="3.5.5"' -I/home/timeshifter/.cache/node-gyp/19.1.0/include/node -I/home/timeshifter/.cache/node-gyp/19.1.0/src -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/openssl/config -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/openssl/openssl/include -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/uv/include -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/zlib -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/v8/include -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -fPIC -O3 -fno-omit-frame-pointer  -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/cencode.o.d.raw  -march=native -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -fstack-protector-strong -c
npm ERR!   g++ -o Release/obj.target/libsass/src/libsass/src/check_nesting.o ../src/libsass/src/check_nesting.cpp '-DNODE_GYP_MODULE_NAME=libsass' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DLIBSASS_VERSION="3.5.5"' -I/home/timeshifter/.cache/node-gyp/19.1.0/include/node -I/home/timeshifter/.cache/node-gyp/19.1.0/src -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/openssl/config -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/openssl/openssl/include -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/uv/include -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/zlib -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/v8/include -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -fPIC -O3 -fno-omit-frame-pointer -std=gnu++17 -std=c++0x -fexceptions -frtti -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/check_nesting.o.d.raw  -march=native -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -fstack-protector-strong -Wp,-D_GLIBCXX_ASSERTIONS -c
npm ERR!   g++ -o Release/obj.target/libsass/src/libsass/src/color_maps.o ../src/libsass/src/color_maps.cpp '-DNODE_GYP_MODULE_NAME=libsass' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DLIBSASS_VERSION="3.5.5"' -I/home/timeshifter/.cache/node-gyp/19.1.0/include/node -I/home/timeshifter/.cache/node-gyp/19.1.0/src -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/openssl/config -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/openssl/openssl/include -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/uv/include -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/zlib -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/v8/include -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -fPIC -O3 -fno-omit-frame-pointer -std=gnu++17 -std=c++0x -fexceptions -frtti -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/color_maps.o.d.raw  -march=native -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -fstack-protector-strong -Wp,-D_GLIBCXX_ASSERTIONS -c
npm ERR!   g++ -o Release/obj.target/libsass/src/libsass/src/constants.o ../src/libsass/src/constants.cpp '-DNODE_GYP_MODULE_NAME=libsass' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DLIBSASS_VERSION="3.5.5"' -I/home/timeshifter/.cache/node-gyp/19.1.0/include/node -I/home/timeshifter/.cache/node-gyp/19.1.0/src -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/openssl/config -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/openssl/openssl/include -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/uv/include -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/zlib -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/v8/include -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -fPIC -O3 -fno-omit-frame-pointer -std=gnu++17 -std=c++0x -fexceptions -frtti -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/constants.o.d.raw  -march=native -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -fstack-protector-strong -Wp,-D_GLIBCXX_ASSERTIONS -c
npm ERR!   g++ -o Release/obj.target/libsass/src/libsass/src/context.o ../src/libsass/src/context.cpp '-DNODE_GYP_MODULE_NAME=libsass' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DLIBSASS_VERSION="3.5.5"' -I/home/timeshifter/.cache/node-gyp/19.1.0/include/node -I/home/timeshifter/.cache/node-gyp/19.1.0/src -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/openssl/config -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/openssl/openssl/include -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/uv/include -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/zlib -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/v8/include -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -fPIC -O3 -fno-omit-frame-pointer -std=gnu++17 -std=c++0x -fexceptions -frtti -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/context.o.d.raw  -march=native -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -fstack-protector-strong -Wp,-D_GLIBCXX_ASSERTIONS -c
npm ERR!   g++ -o Release/obj.target/libsass/src/libsass/src/cssize.o ../src/libsass/src/cssize.cpp '-DNODE_GYP_MODULE_NAME=libsass' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DLIBSASS_VERSION="3.5.5"' -I/home/timeshifter/.cache/node-gyp/19.1.0/include/node -I/home/timeshifter/.cache/node-gyp/19.1.0/src -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/openssl/config -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/openssl/openssl/include -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/uv/include -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/zlib -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/v8/include -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -fPIC -O3 -fno-omit-frame-pointer -std=gnu++17 -std=c++0x -fexceptions -frtti -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/cssize.o.d.raw  -march=native -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -fstack-protector-strong -Wp,-D_GLIBCXX_ASSERTIONS -c
npm ERR!   g++ -o Release/obj.target/libsass/src/libsass/src/emitter.o ../src/libsass/src/emitter.cpp '-DNODE_GYP_MODULE_NAME=libsass' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DLIBSASS_VERSION="3.5.5"' -I/home/timeshifter/.cache/node-gyp/19.1.0/include/node -I/home/timeshifter/.cache/node-gyp/19.1.0/src -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/openssl/config -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/openssl/openssl/include -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/uv/include -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/zlib -I/home/timeshifter/.cache/node-gyp/19.1.0/deps/v8/include -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -fPIC -O3 -fno-omit-frame-pointer -std=gnu++17 -std=c++0x -fexceptions -frtti -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/emitter.o.d.raw  -march=native -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -fstack-protector-strong -Wp,-D_GLIBCXX_ASSERTIONS -c

[snip]

npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack     at ChildProcess.onExit (/tmp/makepkg/threema-desktop/src/threema-web-electron-1.2.21/app/dependencies/threema-web/node_modules/node-gyp/lib/build.js:194:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:293:12)
npm ERR! gyp ERR! System Linux 6.0.8-arch1-1
npm ERR! gyp ERR! command "/usr/bin/node" "/tmp/makepkg/threema-desktop/src/threema-web-electron-1.2.21/app/dependencies/threema-web/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd /tmp/makepkg/threema-desktop/src/threema-web-electron-1.2.21/app/dependencies/threema-web/node_modules/node-sass
npm ERR! gyp ERR! node -v v19.1.0
npm ERR! gyp ERR! node-gyp -v v8.4.1
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/timeshifter/.npm/_logs/2022-11-18T14_52_11_039Z-debug-0.log
==> ERROR: A failure occurred in build().
    Aborting...

Truncated because this goes on forever.

In short: this does not work for at the moment.

sylphio commented on 2022-11-10 22:23 (UTC)

I faced the same error as @solnce:

Patching new user agent detection
../../../tools/patches/patch-user-agent.patch:45: trailing whitespace.
            browser.macosDesktop = /darwinthreemadesktop/.test(uagent)
../../../tools/patches/patch-user-agent.patch:46: trailing whitespace.
            browser.win32Desktop = /win32threemadesktop/.test(uagent)
../../../tools/patches/patch-user-agent.patch:47: trailing whitespace.
            browser.linuxDesktop = /linuxthreemadesktop/.test(uagent)
error: patch failed: src/partials/welcome.ts:174
error: src/partials/welcome.ts: patch does not apply
==> ERROR: A failure occurred in build().
    Aborting...

I do not believe BUILDDIR to be the cause, since it is unset in my makepkg.conf. I found the source of this error elsewhere: 0001-Remove-browser-warning.patch (applied in prepare()) removes from welcome.ts the part that patch-user-agent.patch tries to change; therefore, the patch does not apply and build() fails.

My quick and inelegant solution is to patch the patch.

--- PKGBUILD
+++ PKGBUILD
@@ -42,6 +42,7 @@
   export DEV_ENV=production
   export threema_web_version=threema-web-${_threema_web_ver}
   npm install
+  patch -p0 < ../../patch-user-agent-patch.patch
   ./tools/patches/patch-threema-web.sh
   npm run app:build:web
   ./tools/patches/post-patch-threema-web.sh

The file patch-user-agent-patch.patch is placed in the top directory (same as PKGBUILD) and contains the following. It simply removes the part of patch-user-agent.patch that applies to welcome.ts.

--- tools/patches/patch-user-agent.patch
+++ tools/patches/patch-user-agent.patch
@@ -14,18 +14,6 @@
          }
          if (this.mobile) {
              description += ' [Mobile]';
-diff --git a/src/partials/welcome.ts b/src/partials/welcome.ts
-index 03a58b31..72ee154a 100644
---- a/src/partials/welcome.ts
-+++ b/src/partials/welcome.ts
-@@ -174,6 +174,7 @@ class WelcomeController {
-                 this.log.warn('Edge is too old (' + version + ' < ' + minVersions.EDGE + ')');
-                 this.showBrowserWarning();
-             }
-+        } else if (this.browser.name === threema.BrowserName.win32Desktop || this.browser.name === threema.BrowserName.macosDesktop || this.browser.name === threema.BrowserName.linuxDesktop) {
-         } else {
-             this.log.warn('Non-supported browser, please use Chrome, Firefox, Edge or Opera');
-             this.showBrowserWarning();
 diff --git a/src/services/browser.ts b/src/services/browser.ts
 index c65b1541..419ea3a6 100644
 --- a/src/services/browser.ts

There is probably a more elegant way to solve this problem, but at least it let me build successfully. Perhaps 0001-Remove-browser-warning.patch could apply the changes above to patch-user-agent.patch. Hopefully this will help someone else.

Jino commented on 2022-09-27 10:15 (UTC)

@dbrgn @solnce, thank you for further investigating that issue. I can confirm that with latest update the error persists on my machine. Unfortunately, I am not experienced with the configurations in makepkg.conf. Thus, I didn't try @solnces approach. If you need me for further investigation I would try to get deeper into that topic. Otherwise I think, due to my limited understanding, my contributions wouldn't help here too much.

dbrgn commented on 2022-09-23 23:14 (UTC)

@solnce: Thanks for that hint! I can confirm that this triggers the error. I'm also not yet sure what causes the patching failure, but at least now I have a way to reproduce. I'm very busy at the moment, but will try to find time to investigate this (no guarantees though). If someone else finds the root cause, help is welcome. As a temporary workaround, don't build on ramdisk.