Unverified Commit 84f60a7d authored by Marcin Serwin's avatar Marcin Serwin
Browse files

signal-desktop-source: 7.48.0 -> 7.49.0

parent bbb47458
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -24,23 +24,23 @@ let
in
rustPlatform.buildRustPackage (finalAttrs: {
  pname = "libsignal-node";
  version = "0.67.3";
  version = "0.67.4";

  src = fetchFromGitHub {
    owner = "signalapp";
    repo = "libsignal";
    tag = "v${finalAttrs.version}";
    hash = "sha256-kZZS3IpmxFFuHMH4O1H+JLyf2zBTSr1RnuV0wrwZeXk=";
    hash = "sha256-s7vTzAOWKvGCkrWcxDcKptsmxvW5VxrF5X9Vfkjj1jA=";
  };
  useFetchCargoVendor = true;
  cargoHash = "sha256-ozroDfxDdBtyBEE0d7nf63wUqilBhakT/lxwYV/7V5I=";
  cargoHash = "sha256-wxBbq4WtqzHbdro+tm2hU6JVwTgC2X/Cx9po+ndgECg=";

  npmRoot = "node";
  npmDeps = fetchNpmDeps {
    name = "${finalAttrs.pname}-npm-deps";
    inherit (finalAttrs) version src;
    sourceRoot = "${finalAttrs.src.name}/${finalAttrs.npmRoot}";
    hash = "sha256-TpjpRDsKT/RCPxzV7mzfmZHI9QhH+OColGuEMSdVwBA=";
    hash = "sha256-GJTNuVK1YGDpx89fF6hXXd+/fEqnFMG5FgJUJhp6344=";
  };

  nativeBuildInputs = [
+6 −23
Original line number Diff line number Diff line
@@ -27,7 +27,6 @@ let
    tar -C $out --strip-components=1 -xvf ${electron.headers}
  '';

  sqlcipher-signal-extension = callPackage ./sqlcipher-signal-extension.nix { };
  libsignal-node = callPackage ./libsignal-node.nix { inherit nodejs; };

  ringrtc-bin = callPackage ./ringrtc-bin.nix { };
@@ -53,13 +52,13 @@ let
    '';
  });

  version = "7.48.0";
  version = "7.49.0";

  src = fetchFromGitHub {
    owner = "signalapp";
    repo = "Signal-Desktop";
    tag = "v${version}";
    hash = "sha256-/jtuGsBOFsSgJZNpRilWZ0daI0iYVziZBaF/vLvQ7NU=";
    hash = "sha256-URWDSHiPK+DCh8giT8YFW2HNY0tYNokqbAKBpBWZKD0=";
  };

  sticker-creator = stdenv.mkDerivation (finalAttrs: {
@@ -119,15 +118,15 @@ stdenv.mkDerivation (finalAttrs: {
      ;
    hash =
      if withAppleEmojis then
        "sha256-xba5MfIjwnLHDKVM9+2KSpC3gcw6cM4cX3dn3/jqT3o="
        "sha256-QBlouzA3PhRGiL94sCQS/zRSdsFbKf4VI20x3seMpE4="
      else
        "sha256-I5UGY9Fz4wCa23snq0pir2uq/P+w+fAGU4Bks+CqEgk=";
        "sha256-LKSFptmJyfI0ACo1egZ2LAY5pAXexu9UNjIhD79rJ9E=";
  };

  env = {
    ELECTRON_SKIP_BINARY_DOWNLOAD = "1";
    SIGNAL_ENV = "production";
    SOURCE_DATE_EPOCH = 1743538878;
    SOURCE_DATE_EPOCH = 1743627521;
  };

  preBuild = ''
@@ -151,22 +150,6 @@ stdenv.mkDerivation (finalAttrs: {
      die "ringrtc version mismatch"
    fi

    sqlcipherVersion=${sqlcipher-signal-extension.passthru.sqlcipher-amalgamation.version}
    if ! grep "const SQLCIPHER_VERSION = '$sqlcipherVersion';" \
      node_modules/@signalapp/better-sqlite3/deps/download.js
    then
      die "sqlcipher version mismatch"
    fi

    extensionVersion=${sqlcipher-signal-extension.passthru.signal-sqlcipher-extension.version}
    if ! grep "const EXTENSION_VERSION = '$extensionVersion-asm2';" \
      node_modules/@signalapp/better-sqlite3/deps/download.js
    then
      die "signal-sqlcipher-extension version mismatch"
    fi

    cp ${sqlcipher-signal-extension}/share/sqlite3.gyp node_modules/@signalapp/better-sqlite3/deps/sqlite3.gyp

    cp -r ${ringrtc-bin} node_modules/@signalapp/ringrtc/build

    rm -fr node_modules/@signalapp/libsignal-client/prebuilds
@@ -234,7 +217,6 @@ stdenv.mkDerivation (finalAttrs: {

  passthru = {
    inherit
      sqlcipher-signal-extension
      libsignal-node
      ringrtc-bin
      sticker-creator
@@ -271,6 +253,7 @@ stdenv.mkDerivation (finalAttrs: {
    sourceProvenance = with lib.sourceTypes; [
      fromSource

      # @signalapp/sqlcipher
      # ringrtc
      binaryNativeCode
    ];
+53 −36
Original line number Diff line number Diff line
diff --git a/ACKNOWLEDGMENTS.md b/ACKNOWLEDGMENTS.md
index aed1048..e4c1f50 100644
index 2c963f1..96edd02 100644
--- a/ACKNOWLEDGMENTS.md
+++ b/ACKNOWLEDGMENTS.md
@@ -745,30 +745,6 @@ Signal Desktop makes use of the following open source projects.
@@ -1636,30 +1636,6 @@ Signal Desktop makes use of the following open source projects.
     OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
     SOFTWARE.
 
@@ -46,10 +46,10 @@ index 68dceea..4b35bb1 100644
     getBadgesPath(userDataPath),
     getDraftPath(userDataPath),
diff --git a/package.json b/package.json
index 3a6ac26..40cdb25 100644
index 5755fec..86125ba 100644
--- a/package.json
+++ b/package.json
@@ -130,7 +130,6 @@
@@ -137,7 +137,6 @@
     "dashdash": "2.0.0",
     "direction": "1.0.4",
     "emoji-datasource": "15.1.2",
@@ -57,11 +57,18 @@ index 3a6ac26..40cdb25 100644
     "emoji-regex": "10.4.0",
     "encoding": "0.1.13",
     "fabric": "4.6.0",
@@ -649,4 +648,4 @@
       "sticker-creator/dist/**"
     ]
   }
-}
+}
\ No newline at end of file
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index ba2f205..705e454 100644
index f04b2b1..070fa0f 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -169,9 +169,6 @@ importers:
@@ -184,9 +184,6 @@ importers:
       emoji-datasource:
         specifier: 15.1.2
         version: 15.1.2
@@ -71,7 +78,7 @@ index ba2f205..705e454 100644
       emoji-regex:
         specifier: 10.4.0
         version: 10.4.0
@@ -4790,9 +4787,6 @@ packages:
@@ -4817,9 +4814,6 @@ packages:
     resolution: {integrity: sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==}
     engines: {node: '>=12'}
 
@@ -81,7 +88,7 @@ index ba2f205..705e454 100644
   emoji-datasource@15.1.2:
     resolution: {integrity: sha512-tXAqGsrDVhgCRpFePtaD9P4Z8Ro2SUQSL/4MIJBG0SxqQJaMslEbin8J53OaFwEBu6e7JxFaIF6s4mw9+8acAQ==}
 
@@ -14929,8 +14923,6 @@ snapshots:
@@ -14990,8 +14984,6 @@ snapshots:
 
   emittery@0.13.1: {}
 
@@ -90,14 +97,42 @@ index ba2f205..705e454 100644
   emoji-datasource@15.1.2: {}
 
   emoji-regex@10.4.0: {}
diff --git a/ts/components/conversation/Emojify.tsx b/ts/components/conversation/Emojify.tsx
index f0b1115..7613230 100644
--- a/ts/components/conversation/Emojify.tsx
+++ b/ts/components/conversation/Emojify.tsx
@@ -35,8 +35,15 @@ function getImageTag({
diff --git a/stylesheets/components/fun/FunEmoji.scss b/stylesheets/components/fun/FunEmoji.scss
index 78c7563..83d196c 100644
--- a/stylesheets/components/fun/FunEmoji.scss
+++ b/stylesheets/components/fun/FunEmoji.scss
@@ -5,19 +5,9 @@
 $emoji-sprite-sheet-grid-item-count: 62;
 
 @mixin emoji-sprite($sheet, $margin, $scale) {
-  $size: calc($sheet * 1px * $scale);
-  $margin-start: calc($margin * $scale);
-  $margin-end: calc($margin * $scale);
-  $size-outer: calc($size + $margin-start + $margin-end);
-  $image: url('../images/emoji-sheet-#{$sheet}.webp');
-  background-image: $image;
-  background-size: calc($size-outer * $emoji-sprite-sheet-grid-item-count);
-  background-position-x: calc(
-    var(--fun-emoji-sheet-x) * ($size-outer * -1) + ($margin-start * -1)
-  );
-  background-position-y: calc(
-    var(--fun-emoji-sheet-y) * ($size-outer * -1) + ($margin-start * -1)
-  );
+  background-image: var(--fun-emoji-jumbo-image);
+  background-size: contain;
+  background-position: center;
   background-repeat: no-repeat;
 }
 
   let srcSet: string | undefined;
diff --git a/ts/components/fun/FunEmoji.tsx b/ts/components/fun/FunEmoji.tsx
index 08785e8..d25b868 100644
--- a/ts/components/fun/FunEmoji.tsx
+++ b/ts/components/fun/FunEmoji.tsx
@@ -10,7 +10,14 @@ export const FUN_STATIC_EMOJI_CLASS = 'FunStaticEmoji';
 export const FUN_INLINE_EMOJI_CLASS = 'FunInlineEmoji';
 
 function getEmojiJumboUrl(emoji: EmojiVariantData): string {
-  return `emoji://jumbo?emoji=${encodeURIComponent(emoji.value)}`;
+  const emojiToNotoName = (emoji: string): string =>
+    `emoji_u${
+      [...emoji]
@@ -105,25 +140,7 @@ index f0b1115..7613230 100644
+        .map(c => c.codePointAt(0)?.toString(16).padStart(4, "0"))
+        .join("_")
+    }.png`;
   if (sizeClass != null && JUMBO_SIZES.has(sizeClass)) {
-    srcSet = `emoji://jumbo?emoji=${encodeURIComponent(match)} 2x, ${img}`;
+    srcSet = `file://@noto-emoji-pngs@/${emojiToNotoName(match)} 2x, ${img}`;
+  return `file://@noto-emoji-pngs@/${emojiToNotoName(emoji.value)}`;
 }
 
   return (
diff --git a/ts/components/emoji/lib.ts b/ts/components/emoji/lib.ts
index 9753017..cf51d3d 100644
--- a/ts/components/emoji/lib.ts
+++ b/ts/components/emoji/lib.ts
@@ -102,7 +102,10 @@ const ROOT_PATH = get(
 );
 
 const makeImagePath = (src: string) => {
-  return `${ROOT_PATH}node_modules/emoji-datasource-apple/img/apple/64/${src}`;
+  const datasourceToNoto = (name: string): string =>
+    `emoji_u${name.slice(0,-4).split("-").filter(c => c != "fe0f").join("_")}.png`;
+
+  return `@noto-emoji-pngs@/${datasourceToNoto(src)}`;
 };
 
 const imageQueue = new PQueue({
 export type FunStaticEmojiSize =
+2 −2
Original line number Diff line number Diff line
@@ -7,10 +7,10 @@
}:
stdenv.mkDerivation (finalAttrs: {
  pname = "ringrtc-bin";
  version = "2.50.2";
  version = "2.50.3";
  src = fetchzip {
    url = "https://build-artifacts.signal.org/libraries/ringrtc-desktop-build-v${finalAttrs.version}.tar.gz";
    hash = "sha256-hNlz+gSulyJ//FdbPvY/5OHbtJ4rEUdi9/SHJDX6gZE=";
    hash = "sha256-UJqH/UiT9j36r6fr673CP/Z4lGaSPXIzAkf72YZfExo=";
  };

  installPhase = ''
+0 −109
Original line number Diff line number Diff line
{
  rustPlatform,
  lib,
  fetchFromGitHub,
  sqlcipher,
  fetchpatch,
  stdenv,
  openssl,
  tcl,
  buildEnv,
  rust-cbindgen,
}:
let
  signal-sqlcipher-extension = rustPlatform.buildRustPackage (finalAttrs: {
    pname = "signal-sqlcipher-extension";
    version = "0.2.1";

    src = fetchFromGitHub {
      owner = "signalapp";
      repo = "Signal-Sqlcipher-Extension";
      tag = "v${finalAttrs.version}";
      hash = "sha256-INSkm7ZuetPASuIqezzzG/bXoEHClUb9XpxWbxLVXRc=";
    };
    useFetchCargoVendor = true;
    cargoHash = "sha256-qT4HM/FRL8qugKKNlMYM/0zgUsC6cDOa9fgd1d4VIrc=";

    meta = {
      description = "SQLite extension used by Signal Desktop";
      homepage = "https://github.com/signalapp/Signal-Sqlcipher-Extension";
      license = lib.licenses.agpl3Only;
      maintainers = with lib.maintainers; [ marcin-serwin ];
      platforms = lib.platforms.all;
    };
  });

  sqlcipher-amalgamation = stdenv.mkDerivation {
    pname = "sqlcipher-amalgamation";
    version = "${sqlcipher.version}-signal-patch2";

    inherit (sqlcipher) src meta;

    patches = [
      (fetchpatch {
        # https://github.com/sqlcipher/sqlcipher/pull/529
        name = "custom-crypto-provider.patch";
        url = "https://github.com/sqlcipher/sqlcipher/commit/0e3b20c155df8a2943b62a9f3cc0f4d3dba9e152.patch";
        hash = "sha256-OKh6qCGHBQWZyzXfyEveAs71wrNwlWLuG9jNqDeKNG4=";
      })
    ];

    nativeBuildInputs = [ tcl ];

    buildInputs = [ openssl ];

    CFLAGS = [ "-DSQLITE_ENABLE_UPDATE_DELETE_LIMIT=1" ];

    makeFlags = [ "sqlite3.c" ];

    installPhase = ''
      install -Dm644 sqlite3.c $out/src/sqlite3.c
      install -Dm644 sqlite3.h $out/include/sqlite3.h
      install -Dm644 sqlite3ext.h $out/include/sqlite3ext.h
    '';
  };

  signal-tokenizer-headers = rustPlatform.buildRustPackage (finalAttrs: {
    pname = "Signal-FTS5-Extension";
    version = "0.2.1";

    src = fetchFromGitHub {
      owner = "signalapp";
      repo = "Signal-FTS5-Extension";
      tag = "v${finalAttrs.version}";
      hash = "sha256-MzgdRuRsfL3yhlVU0RAAUtAaOukMpqSSa42nRYhpmh0=";
    };
    useFetchCargoVendor = true;
    cargoHash = "sha256-0DDX3ciXk5/3MqsHzxV8s4qEhqYmrwGg7cSbrkFRZbw=";

    nativeBuildInputs = [ rust-cbindgen ];

    buildPhase = ''
      cbindgen --profile release . -o signal-tokenizer.h
    '';
    installPhase = ''
      install -Dm644 signal-tokenizer.h $out/include/signal-tokenizer.h
    '';
    doCheck = false;
  });

in
buildEnv {
  name = "sqlcipher-signal";
  passthru = {
    inherit sqlcipher-amalgamation signal-sqlcipher-extension;
  };

  paths = [
    sqlcipher-amalgamation
    signal-tokenizer-headers
    signal-sqlcipher-extension
  ];

  postBuild = ''
    install -Dm644 ${./sqlite3.gyp} $out/share/sqlite3.gyp
    substituteInPlace $out/share/sqlite3.gyp \
      --replace-fail "@extension@" "$out" \
      --replace-fail "@static_lib_ext@" "${stdenv.hostPlatform.extensions.staticLibrary}"
  '';
}