Package Details: curl-impersonate-chrome v0.9.2-1

Git Clone URL: https://aur.archlinux.org/curl-impersonate-chrome.git (read-only, click to copy)
Package Base: curl-impersonate-chrome
Description: A special compilation of curl that makes it impersonate Chrome
Upstream URL: https://github.com/lexiforest/curl-impersonate
Keywords: curl https scraping security ssl tls
Licenses: MIT
Conflicts: curl-impersonate-bin
Provides: curl-impersonate-chrome, libcurl-impersonate-chrome
Submitter: mattf
Maintainer: mattf
Last Packager: mattf
Votes: 3
Popularity: 0.69
First Submitted: 2022-02-23 06:52 (UTC)
Last Updated: 2025-02-09 08:18 (UTC)

Required by (2)

Sources (1)

Latest Comments

1 2 Next › Last »

utanerime commented on 2025-02-11 17:19 (UTC) (edited on 2025-02-11 17:21 (UTC) by utanerime)

@patlefort I encountered the same error when I tried building this package, not sure if I have any wrong configs in my machine.

mattf commented on 2025-01-27 20:43 (UTC) (edited on 2025-01-27 20:57 (UTC) by mattf)

@dilud Thanks. I also have the same issue as you in the end. I feel that patching the patch feels like a hack, but if we find a way to fix the other issue then we could do it like that.

dllud commented on 2025-01-27 16:45 (UTC)

@mattf, you can just patch it yourself in the PKGBUILD until the BoringSSL patch gets fixed by lexiforest.

Here's a patch to your repo with my suggestion:

From 64c7629d6af352647967bba955b80f574eec7242 Mon Sep 17 00:00:00 2001
Message-ID: <64c7629d6af352647967bba955b80f574eec7242.1737991925.git.dllud riseup net>
From: dllud <dllud riseup net>
Date: Mon, 27 Jan 2025 15:27:10 +0000
Subject: [PATCH] Fix ext_index initialization in BoringSSL patch.

---K
 .SRCINFO                       |  4 +++-
 PKGBUILD                       | 12 ++++++++++--
 boringssl-ext-index-init.patch | 13 +++++++++++++
 3 files changed, 26 insertions(+), 3 deletions(-)
 create mode 100644 boringssl-ext-index-init.patch

diff --git a/.SRCINFO b/.SRCINFO
index 5a6a3f9..e1ee1e4 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
 pkgbase = curl-impersonate-chrome
    pkgdesc = A special compilation of curl that makes it impersonate Chrome
    pkgver = v0.9.0
-   pkgrel = 1
+   pkgrel = 2
    url = https://github.com/lexiforest/curl-impersonate
    arch = x86_64
    arch = i686
@@ -25,6 +25,8 @@ pkgbase = curl-impersonate-chrome
    conflicts = curl-impersonate-bin
    options = !buildflags
    source = curl-impersonate.tar.gz::https://github.com/lexiforest/curl-impersonate/archive/refs/tags/v0.9.0.tar.gz
+   source = boringssl-ext-index-init.patch
    md5sums = 6f0daad3f0545664ec22590ff8504393
+   md5sums = 52374bd0205a7216e95803ac63a9a1d8

 pkgname = curl-impersonate-chrome
diff --git a/PKGBUILD b/PKGBUILD
index 4046f9e..b419c9b 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,7 +2,7 @@

 pkgname=curl-impersonate-chrome
 pkgver=v0.9.0
-pkgrel=1
+pkgrel=2
 pkgdesc="A special compilation of curl that makes it impersonate Chrome"
 url="https://github.com/lexiforest/curl-impersonate"
 license=('MIT')
@@ -18,9 +18,17 @@ options=("!buildflags")

 source=(
   "curl-impersonate.tar.gz::https://github.com/lexiforest/curl-impersonate/archive/refs/tags/${pkgver}.tar.gz"
+  "boringssl-ext-index-init.patch"
 )

-md5sums=('6f0daad3f0545664ec22590ff8504393')
+md5sums=(
+  '6f0daad3f0545664ec22590ff8504393'
+  '52374bd0205a7216e95803ac63a9a1d8'
+)
+
+prepare() {
+  patch -Np1 -d "curl-impersonate-${pkgver/v/}" -i "${srcdir}/boringssl-ext-index-init.patch"
+}

 build () {
   cd curl-impersonate-${pkgver/v/}
diff --git a/boringssl-ext-index-init.patch b/boringssl-ext-index-init.patch
new file mode 100644
index 0000000..b6b6c8f
--- /dev/null
+++ b/boringssl-ext-index-init.patch
@@ -0,0 +1,13 @@
+diff --git a/chrome/patches/boringssl.patch b/chrome/patches/boringssl.patch
+index be50b98..6a8c42d 100644
+--- a/chrome/patches/boringssl.patch
++++ b/chrome/patches/boringssl.patch
+@@ -357,7 +357,7 @@ index c9424c98b..ea76ca366 100644
+ +  char *ext = strtok(tmp, delimiter);
+ +  size_t idx = 0;
+ +  while (ext != nullptr) {
+-+    unsigned ext_index;
+++    unsigned ext_index = 0;
+ +    tls_extension_find(&ext_index, atoi(ext));
+ +    // fprintf(stderr, "found %d -> %d, ", atoi(ext), ext_index);
+ +    order[idx] = ext_index;
-- 
2.48.1

Unfortunately this alone won't make curl-impersonate-chrome compile, at least in my machine. Later I get a configure error while it tries to build cURL:

configure:4998: gcc   -lc++ conftest.c -pthread -lc++ >&5
/usr/bin/ld: cannot find -lc++: No such file or directory
configure:5050: error: C compiler cannot create executables

mattf commented on 2025-01-27 10:04 (UTC)

@simona There is an issue open in upstream about that: https://github.com/lexiforest/curl-impersonate/issues/81

I don't know if there is any proper workaround that could be done here. Let me know if you have suggestions.

simona commented on 2025-01-27 09:36 (UTC)

FAILED: CMakeFiles/ssl.dir/ssl/extensions.cc.o
/bin/g++ -DBORINGSSL_IMPLEMENTATION -I/home/simona/.cache/yay/curl-impersonate-chrome/src/curl-impersonate-0.9.0/build/boringssl-cd95210465496ac2337b313cf49f607762abe286/include -Werror -Wformat=2 -Wsign-compare -Wwrite-strings -Wvla -Wshadow -Wtype-limits -Wmissing-field-initializers -ggdb -Wall -fvisibility=hidden -fno-common -Wno-free-nonheap-object -Wimplicit-fallthrough -Wformat-signedness -Wmissing-declarations -Wnon-virtual-dtor -O3 -DNDEBUG -std=gnu++14 -fPIC -MD -MT CMakeFiles/ssl.dir/ssl/extensions.cc.o -MF CMakeFiles/ssl.dir/ssl/extensions.cc.o.d -o CMakeFiles/ssl.dir/ssl/extensions.cc.o -c /home/simona/.cache/yay/curl-impersonate-chrome/src/curl-impersonate-0.9.0/build/boringssl-cd95210465496ac2337b313cf49f607762abe286/ssl/extensions.cc
/home/simona/.cache/yay/curl-impersonate-chrome/src/curl-impersonate-0.9.0/build/boringssl-cd95210465496ac2337b313cf49f607762abe286/ssl/extensions.cc: In function ‘bool bssl::ssl_set_extension_order(SSL_HANDSHAKE*)’:
/home/simona/.cache/yay/curl-impersonate-chrome/src/curl-impersonate-0.9.0/build/boringssl-cd95210465496ac2337b313cf49f607762abe286/ssl/extensions.cc:3507:16: error: ‘ext_index’ may be used uninitialized [-Werror=maybe-uninitialized]
3507 | order[idx] = ext_index;
/home/simona/.cache/yay/curl-impersonate-chrome/src/curl-impersonate-0.9.0/build/boringssl-cd95210465496ac2337b313cf49f607762abe286/ssl/extensions.cc:3504:14: note: ‘ext_index’ was declared here
3504 | unsigned ext_index;
| ^
cc1plus: all warnings being treated as errors
[383/645] Building CXX object CMakeFiles/boringssl_gtest.dir/third_party/googletest/googletest/src/gtest-all.cc.o
ninja: build stopped: subcommand failed.

patlefort commented on 2025-01-27 07:20 (UTC)

It's failing:

unzip:  cannot find or open boringssl-cd95210465496ac2337b313cf49f607762abe286.zip, boringssl-cd95210465496ac2337b313cf49f607762abe286.zip.zip or boringssl-cd95210465496ac2337b313cf49f607762abe286.zip.ZIP.
make: *** [Makefile:160: boringssl-cd95210465496ac2337b313cf49f607762abe286/.patched] Error 9

simona commented on 2025-01-26 22:39 (UTC)

FAILED: CMakeFiles/ssl.dir/ssl/extensions.cc.o
/bin/g++ -DBORINGSSL_IMPLEMENTATION -I/home/simona/.cache/yay/curl-impersonate-chrome/src/curl-impersonate-0.9.0/build/boringssl-cd95210465496ac2337b313cf49f607762abe286/include -Werror -Wformat=2 -Wsign-compare -Wwrite-strings -Wvla -Wshadow -Wtype-limits -Wmissing-field-initializers -ggdb -Wall -fvisibility=hidden -fno-common -Wno-free-nonheap-object -Wimplicit-fallthrough -Wformat-signedness -Wmissing-declarations -Wnon-virtual-dtor -O3 -DNDEBUG -std=gnu++14 -fPIC -MD -MT CMakeFiles/ssl.dir/ssl/extensions.cc.o -MF CMakeFiles/ssl.dir/ssl/extensions.cc.o.d -o CMakeFiles/ssl.dir/ssl/extensions.cc.o -c /home/simona/.cache/yay/curl-impersonate-chrome/src/curl-impersonate-0.9.0/build/boringssl-cd95210465496ac2337b313cf49f607762abe286/ssl/extensions.cc

gesh commented on 2024-03-25 12:47 (UTC)

Note: The following makedeps are in base or base-devel, and thus shouldn't be specified: autoconf, automake, gcc, patch, tar

screenfox commented on 2024-01-10 12:43 (UTC)

Also getting the error about ignored-attributes. The trick with "CXXFLAGS="-Wno-error=ignored-attributes -g -O2" make chrome-build" did not change anything for me (added the CXXFLAGS part before "make chrome-build" in PKGBUILD).