httptoolkit-server: 1.19.3 -> 1.20.1; httptoolkit: 1.19.4 -> 1.20.1 (#388663)

This commit is contained in:
Toma 2025-07-12 15:05:22 +02:00 committed by GitHub
commit 02839caac6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 31 additions and 19 deletions

View File

@ -1,8 +1,8 @@
diff --git a/pack.ts b/pack.ts diff --git a/pack.ts b/pack.ts
index aba98cc..03ce86a 100644 index 0212d09..03ce86a 100644
--- a/pack.ts --- a/pack.ts
+++ b/pack.ts +++ b/pack.ts
@@ -75,33 +75,7 @@ const packageApp = async () => { @@ -75,39 +75,7 @@ const packageApp = async () => {
delete pJson.scripts.prepack; // We don't want to rebuild - all built code will be in the packed content delete pJson.scripts.prepack; // We don't want to rebuild - all built code will be in the packed content
await fs.writeJson(path.join(OUTPUT_DIR, 'package.json'), pJson); await fs.writeJson(path.join(OUTPUT_DIR, 'package.json'), pJson);
@ -10,20 +10,26 @@ index aba98cc..03ce86a 100644
- -
- // Run build-release in this folder, for each platform. For each bundle, we copy in - // Run build-release in this folder, for each platform. For each bundle, we copy in
- // only the relevant platform-specific NSS files. - // only the relevant platform-specific NSS files.
- console.log('Building for Linux'); - console.log('Building for Linux x64');
- await fs.mkdir(path.join(OUTPUT_DIR, 'nss')); - await fs.mkdir(path.join(OUTPUT_DIR, 'nss'));
- await fs.copy(path.join(__dirname, 'nss', 'linux'), path.join(OUTPUT_DIR, 'nss', 'linux')); - await fs.copy(path.join(__dirname, 'nss', 'linux'), path.join(OUTPUT_DIR, 'nss', 'linux'));
- await spawn(buildScript, ['linux'], { cwd: OUTPUT_DIR, stdio: 'inherit' }); - await spawn(buildScript, ['linux', 'x64'], { cwd: OUTPUT_DIR, stdio: 'inherit' });
- -
- console.log('Building for Darwin'); - console.log('Building for Linux arm64');
- await spawn(buildScript, ['linux', 'arm64'], { cwd: OUTPUT_DIR, stdio: 'inherit' });
-
- console.log('Building for Darwin x64');
- await fs.remove(path.join(OUTPUT_DIR, 'nss', 'linux')); - await fs.remove(path.join(OUTPUT_DIR, 'nss', 'linux'));
- await fs.copy(path.join(__dirname, 'nss', 'darwin'), path.join(OUTPUT_DIR, 'nss', 'darwin')); - await fs.copy(path.join(__dirname, 'nss', 'darwin'), path.join(OUTPUT_DIR, 'nss', 'darwin'));
- await spawn(buildScript, ['darwin'], { cwd: OUTPUT_DIR, stdio: 'inherit' }); - await spawn(buildScript, ['darwin', 'x64'], { cwd: OUTPUT_DIR, stdio: 'inherit' });
-
- console.log('Building for Darwin arm64');
- await spawn(buildScript, ['darwin', 'arm64'], { cwd: OUTPUT_DIR, stdio: 'inherit' });
- -
- console.log('Building for Win32'); - console.log('Building for Win32');
- await fs.remove(path.join(OUTPUT_DIR, 'nss', 'darwin')); - await fs.remove(path.join(OUTPUT_DIR, 'nss', 'darwin'));
- await fs.copy(path.join(__dirname, 'nss', 'win32'), path.join(OUTPUT_DIR, 'nss', 'win32')); - await fs.copy(path.join(__dirname, 'nss', 'win32'), path.join(OUTPUT_DIR, 'nss', 'win32'));
- await spawn(buildScript, ['win32'], { cwd: OUTPUT_DIR, stdio: 'inherit' }); - await spawn(buildScript, ['win32', 'x64'], { cwd: OUTPUT_DIR, stdio: 'inherit' });
- -
- // Oclif builds a nodeless platform-agnostic bundle too (although in our case, nothing is - // Oclif builds a nodeless platform-agnostic bundle too (although in our case, nothing is
- // really platform agnostic). Not necessary, probably won't work - drop it. - // really platform agnostic). Not necessary, probably won't work - drop it.

View File

@ -9,19 +9,20 @@
pkg-config, pkg-config,
openssl, openssl,
libdatachannel, libdatachannel,
plog,
}: }:
let let
nodejs = nodejs_20; nodejs = nodejs_20;
buildNpmPackage' = buildNpmPackage.override { inherit nodejs; }; buildNpmPackage' = buildNpmPackage.override { inherit nodejs; };
version = "1.19.3"; version = "1.20.1";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "httptoolkit"; owner = "httptoolkit";
repo = "httptoolkit-server"; repo = "httptoolkit-server";
rev = "refs/tags/v${version}"; rev = "refs/tags/v${version}";
hash = "sha256-cIxpV155A76TCOXurJhBA0dQpwn63hTpokBRXMLBEUA="; hash = "sha256-iEAYZX7WNk6TvZ44GAOgTqXOcW5oFn4gX+kzixZZbWA=";
}; };
overridesNodeModules = buildNpmPackage' { overridesNodeModules = buildNpmPackage' {
@ -29,7 +30,7 @@ let
inherit version src; inherit version src;
sourceRoot = "${src.name}/overrides/js"; sourceRoot = "${src.name}/overrides/js";
npmDepsHash = "sha256-GRN6ua3FY1AE61bB7PM2wgbKPZI/zJeXa5HOOh/2N2Y="; npmDepsHash = "sha256-Uw7XbfwLMX+zbSrzFgvB8lw3hxUyw1eRKazCITrT/28=";
dontBuild = true; dontBuild = true;
@ -41,20 +42,20 @@ let
nodeDatachannel = buildNpmPackage' { nodeDatachannel = buildNpmPackage' {
pname = "node-datachannel"; pname = "node-datachannel";
version = "0.4.3"; version = "0.12.0";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "murat-dogan"; owner = "murat-dogan";
repo = "node-datachannel"; repo = "node-datachannel";
rev = "refs/tags/v${nodeDatachannel.version}"; rev = "refs/tags/v${nodeDatachannel.version}";
hash = "sha256-BlfeocqSG+pqbK0onnCf0VKbQw8Qq4qMxhAcfGlFYR8="; hash = "sha256-xjYja+e2Z7X5cU4sEuSsJzG0gtmTPl3VrUf+ypd3zdw=";
}; };
npmFlags = [ "--ignore-scripts" ]; npmFlags = [ "--ignore-scripts" ];
makeCacheWritable = true; makeCacheWritable = true;
npmDepsHash = "sha256-pgcOOjiuWKlpD+WJyPj/c9ZhDjYuEnybpLS/BPmzeFM="; npmDepsHash = "sha256-Qhib9ZGulTXjoYcZIWunf3/BSd2SLXZuWEmMcstaphs=";
nativeBuildInputs = [ nativeBuildInputs = [
cmake cmake
@ -64,6 +65,7 @@ let
buildInputs = [ buildInputs = [
openssl openssl
libdatachannel libdatachannel
plog
]; ];
dontUseCmakeConfigure = true; dontUseCmakeConfigure = true;
@ -73,10 +75,12 @@ let
preBuild = '' preBuild = ''
# don't use static libs and don't use FetchContent # don't use static libs and don't use FetchContent
# don't try to link plog (it's headers-only)
substituteInPlace CMakeLists.txt \ substituteInPlace CMakeLists.txt \
--replace-fail 'OPENSSL_USE_STATIC_LIBS TRUE' 'OPENSSL_USE_STATIC_LIBS FALSE' \ --replace-fail 'OPENSSL_USE_STATIC_LIBS TRUE' 'OPENSSL_USE_STATIC_LIBS FALSE' \
--replace-fail 'if(NOT libdatachannel)' 'if(false)' \ --replace-fail 'if(NOT libdatachannel)' 'if(false)' \
--replace-fail 'datachannel-static' 'datachannel' --replace-fail 'datachannel-static' 'datachannel' \
--replace-fail 'plog::plog' ""
# don't fetch node headers # don't fetch node headers
substituteInPlace node_modules/cmake-js/lib/dist.js \ substituteInPlace node_modules/cmake-js/lib/dist.js \
@ -98,7 +102,7 @@ buildNpmPackage' {
patches = [ ./only-build-for-one-platform.patch ]; patches = [ ./only-build-for-one-platform.patch ];
npmDepsHash = "sha256-GZESwRDG1gEVhkclR+LBWwoUYaE1xS0z4EvPN7kYTrA="; npmDepsHash = "sha256-gHXop4CTsQTSMrZ5mBHkMcmpOr2MIjVLrzjLLCfZ3As=";
npmFlags = [ "--ignore-scripts" ]; npmFlags = [ "--ignore-scripts" ];

View File

@ -12,16 +12,18 @@
buildNpmPackage rec { buildNpmPackage rec {
pname = "httptoolkit"; pname = "httptoolkit";
version = "1.19.4"; version = "1.20.1";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "httptoolkit"; owner = "httptoolkit";
repo = "httptoolkit-desktop"; repo = "httptoolkit-desktop";
tag = "v${version}"; tag = "v${version}";
hash = "sha256-oDwAosyFY4ff9MP82O8q5o+mN/X6+J7hM3b7myfOq7k="; hash = "sha256-1m4okGTNrboyj+QiMFPT7Z0/+FxZtxrqqAbuAobRgvU=";
}; };
npmDepsHash = "sha256-4kREJgw7OjKkOF/J1HpD3uPn+awtQIfUGWqJctwq3N0="; npmDepsHash = "sha256-NH6Ppj6SsM0BXAgboMgp1ZPwN43ciLNBaHkz5yq8Ff8=";
makeCacheWritable = true;
env = { env = {
ELECTRON_SKIP_BINARY_DOWNLOAD = "1"; ELECTRON_SKIP_BINARY_DOWNLOAD = "1";
@ -40,7 +42,7 @@ buildNpmPackage rec {
'"forceCodeSigning": true' \ '"forceCodeSigning": true' \
'"forceCodeSigning": false' '"forceCodeSigning": false'
cp -r ${electron.dist} electron-dist cp -rL ${electron.dist} electron-dist
chmod -R u+w electron-dist chmod -R u+w electron-dist
npm exec electron-builder -- \ npm exec electron-builder -- \