Unverified Commit 02839caa authored by Toma's avatar Toma Committed by GitHub
Browse files

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

parents 9c492c32 66ab03c8
Loading
Loading
Loading
Loading
+13 −7
Original line number Diff line number Diff line
diff --git a/pack.ts b/pack.ts
index aba98cc..03ce86a 100644
index 0212d09..03ce86a 100644
--- a/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
     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
-    // 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.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.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');
-    await fs.remove(path.join(OUTPUT_DIR, 'nss', 'darwin'));
-    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
-    // really platform agnostic). Not necessary, probably won't work - drop it.
+12 −8
Original line number Diff line number Diff line
@@ -9,19 +9,20 @@
  pkg-config,
  openssl,
  libdatachannel,
  plog,
}:

let
  nodejs = nodejs_20;
  buildNpmPackage' = buildNpmPackage.override { inherit nodejs; };

  version = "1.19.3";
  version = "1.20.1";

  src = fetchFromGitHub {
    owner = "httptoolkit";
    repo = "httptoolkit-server";
    rev = "refs/tags/v${version}";
    hash = "sha256-cIxpV155A76TCOXurJhBA0dQpwn63hTpokBRXMLBEUA=";
    hash = "sha256-iEAYZX7WNk6TvZ44GAOgTqXOcW5oFn4gX+kzixZZbWA=";
  };

  overridesNodeModules = buildNpmPackage' {
@@ -29,7 +30,7 @@ let
    inherit version src;
    sourceRoot = "${src.name}/overrides/js";

    npmDepsHash = "sha256-GRN6ua3FY1AE61bB7PM2wgbKPZI/zJeXa5HOOh/2N2Y=";
    npmDepsHash = "sha256-Uw7XbfwLMX+zbSrzFgvB8lw3hxUyw1eRKazCITrT/28=";

    dontBuild = true;

@@ -41,20 +42,20 @@ let

  nodeDatachannel = buildNpmPackage' {
    pname = "node-datachannel";
    version = "0.4.3";
    version = "0.12.0";

    src = fetchFromGitHub {
      owner = "murat-dogan";
      repo = "node-datachannel";
      rev = "refs/tags/v${nodeDatachannel.version}";
      hash = "sha256-BlfeocqSG+pqbK0onnCf0VKbQw8Qq4qMxhAcfGlFYR8=";
      hash = "sha256-xjYja+e2Z7X5cU4sEuSsJzG0gtmTPl3VrUf+ypd3zdw=";
    };

    npmFlags = [ "--ignore-scripts" ];

    makeCacheWritable = true;

    npmDepsHash = "sha256-pgcOOjiuWKlpD+WJyPj/c9ZhDjYuEnybpLS/BPmzeFM=";
    npmDepsHash = "sha256-Qhib9ZGulTXjoYcZIWunf3/BSd2SLXZuWEmMcstaphs=";

    nativeBuildInputs = [
      cmake
@@ -64,6 +65,7 @@ let
    buildInputs = [
      openssl
      libdatachannel
      plog
    ];

    dontUseCmakeConfigure = true;
@@ -73,10 +75,12 @@ let

    preBuild = ''
      # don't use static libs and don't use FetchContent
      # don't try to link plog (it's headers-only)
      substituteInPlace CMakeLists.txt \
          --replace-fail 'OPENSSL_USE_STATIC_LIBS TRUE' 'OPENSSL_USE_STATIC_LIBS 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
      substituteInPlace node_modules/cmake-js/lib/dist.js \
@@ -98,7 +102,7 @@ buildNpmPackage' {

  patches = [ ./only-build-for-one-platform.patch ];

  npmDepsHash = "sha256-GZESwRDG1gEVhkclR+LBWwoUYaE1xS0z4EvPN7kYTrA=";
  npmDepsHash = "sha256-gHXop4CTsQTSMrZ5mBHkMcmpOr2MIjVLrzjLLCfZ3As=";

  npmFlags = [ "--ignore-scripts" ];

+6 −4
Original line number Diff line number Diff line
@@ -12,16 +12,18 @@

buildNpmPackage rec {
  pname = "httptoolkit";
  version = "1.19.4";
  version = "1.20.1";

  src = fetchFromGitHub {
    owner = "httptoolkit";
    repo = "httptoolkit-desktop";
    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 = {
    ELECTRON_SKIP_BINARY_DOWNLOAD = "1";
@@ -40,7 +42,7 @@ buildNpmPackage rec {
        '"forceCodeSigning": true' \
        '"forceCodeSigning": false'

    cp -r ${electron.dist} electron-dist
    cp -rL ${electron.dist} electron-dist
    chmod -R u+w electron-dist

    npm exec electron-builder -- \