Skip to content

Commit dba1f6a

Browse files
committed
interstellar: 0.11.1 -> 0.11.2
1 parent 2196a21 commit dba1f6a

File tree

4 files changed

+243
-63
lines changed

4 files changed

+243
-63
lines changed
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
--- a/lib/src/widgets/emoji_picker/emoji_builder.dart
2+
+++ b/lib/src/widgets/emoji_picker/emoji_builder.dart
3+
@@ -1,7 +1,7 @@
4+
import 'dart:convert';
5+
+import 'dart:io';
6+
7+
import 'package:build/build.dart';
8+
-import 'package:http/http.dart' as http;
9+
import 'package:interstellar/src/utils/trie.dart';
10+
11+
Builder emojiBuilder(BuilderOptions options) =>
12+
@@ -29,15 +29,9 @@
13+
};
14+
15+
Future<String> _generateContent() async {
16+
- final dataResponse = await http.get(
17+
- Uri.parse('$_sourcePrefix/compact.raw.json'),
18+
- );
19+
- final dataJson = jsonDecode(dataResponse.body);
20+
+ final dataJson = jsonDecode(await File('@compact.raw.json@').readAsString()) as List;
21+
22+
- final messagesResponse = await http.get(
23+
- Uri.parse('$_sourcePrefix/messages.raw.json'),
24+
- );
25+
- final messagesJson = jsonDecode(messagesResponse.body);
26+
+ final messagesJson = jsonDecode(await File('@messages.raw.json@').readAsString()) as Map<String, dynamic>;
27+
28+
final s = StringBuffer()
29+
..write('''
30+
@@ -53,8 +47,9 @@
31+
32+
final emojiGroups = <String>[];
33+
34+
- for (var i = 0; i < (messagesJson['groups'] as List).length; i++) {
35+
- final group = messagesJson['groups'][i];
36+
+ final groups = messagesJson['groups'] as List;
37+
+ for (var i = 0; i < groups.length; i++) {
38+
+ final group = groups[i] as Map<String, dynamic>;
39+
40+
assert(group['order'] == i, 'Emoji group order value should match index');
41+
42+
@@ -61,4 +56,4 @@
43+
- emojiGroups.add(group['message']);
44+
+ emojiGroups.add(group['message'] as String);
45+
}
46+
47+
s
48+
@@ -72,7 +67,8 @@
49+
50+
{
51+
var i = 0;
52+
- for (final emoji in dataJson) {
53+
+ for (final emojiItem in dataJson) {
54+
+ final emoji = emojiItem as Map<String, dynamic>;
55+
if (emoji['group'] == null || emoji['order'] == null) continue;
56+
57+
assert(emoji['order'] == i + 1, 'Emoji order value should match index');
58+
@@ -84,9 +80,9 @@
59+
: emoji['emoticon']),
60+
];
61+
62+
- trie.addChild(Trie.normalizeTerm(emoji['label']), {i});
63+
+ trie.addChild(Trie.normalizeTerm(emoji['label'] as String), {i});
64+
for (final tag in tags) {
65+
- trie.addChild(Trie.normalizeTerm(tag), {i});
66+
+ trie.addChild(Trie.normalizeTerm(tag as String), {i});
67+
}
68+
69+
s
70+
@@ -93,9 +89,9 @@
71+
..write('const Emoji("')
72+
- ..write(emoji['unicode'])
73+
+ ..write(emoji['unicode'] as String)
74+
..write('","')
75+
- ..write(emoji['label'])
76+
+ ..write(emoji['label'] as String)
77+
..write('",')
78+
- ..write(emoji['group'])
79+
+ ..write(emoji['group'].toString())
80+
..write('),\n');
81+
82+
i++;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2+
"flutter_web_auth_2": "sha256-x3SVeFIYS+UtyNKr4ohq4dvktCgS6nECGrb2vMg9aZc=",
23
"webcrypto": "sha256-HX8CcCRbDlVMLMbKGnqKlrkMT9XITLbQE/2OW9zO72w="
34
}

pkgs/by-name/in/interstellar/package.nix

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
lib,
3-
flutter338,
3+
flutter341,
44
fetchFromGitHub,
5+
fetchurl,
56
imagemagick,
67
alsa-lib,
78
libass,
@@ -13,25 +14,40 @@
1314
dart,
1415
}:
1516

16-
let
17+
flutter341.buildFlutterApplication (finalAttrs: {
1718
pname = "interstellar";
18-
19-
version = "0.11.1";
19+
version = "0.11.2";
2020

2121
src = fetchFromGitHub {
2222
owner = "interstellar-app";
2323
repo = "interstellar";
24-
tag = "v${version}";
25-
hash = "sha256-ZhZBy/KECz/Gs3RSuuXmTtI5pKPBMFQNG/kS8JvEaFc=";
24+
tag = "v${finalAttrs.version}";
25+
hash = "sha256-WprvuIN7yS5yLR4eUF/M9yG25ZU1Sf1I1myujclF4oM=";
2626
};
27-
in
28-
flutter338.buildFlutterApplication {
29-
inherit pname version src;
3027

3128
pubspecLock = lib.importJSON ./pubspec.lock.json;
3229

3330
gitHashes = lib.importJSON ./git-hashes.json;
3431

32+
patches = [ ./emoji_builder.patch ];
33+
34+
postPatch = ''
35+
substituteInPlace lib/src/widgets/emoji_picker/emoji_builder.dart \
36+
--replace-fail "@compact.raw.json@" "${
37+
fetchurl {
38+
url = "https://raw.githubusercontent.com/milesj/emojibase/a5fc630a91ca42cddf3f4a66492965600fd3bce8/packages/data/en/compact.raw.json";
39+
hash = "sha256-OivCYjiBEooRx3zni9jAr3lR0rzpoa3HX2l/a0UwDpE=";
40+
}
41+
}" \
42+
--replace-fail "@messages.raw.json@" "${
43+
fetchurl {
44+
url = "https://raw.githubusercontent.com/milesj/emojibase/a5fc630a91ca42cddf3f4a66492965600fd3bce8/packages/data/en/messages.raw.json";
45+
hash = "sha256-ZQWXZJ5jXxDNQHaOAsxApAt6oanvaEwZ6VXbDA0YeMs=";
46+
}
47+
}"
48+
sed -i 's/const Color.from(alpha: 1, red: 1, green: 1, blue: 1).value32bit/0xFFFFFFFF/g; s/const Color.from(alpha: 1, red: 0, green: 0, blue: 0).value32bit/0xFF000000/g' lib/src/controller/database/database.dart
49+
'';
50+
3551
nativeBuildInputs = [ imagemagick ];
3652

3753
buildInputs = [
@@ -54,14 +70,14 @@ flutter338.buildFlutterApplication {
5470
'';
5571

5672
extraWrapProgramArgs = ''
57-
--prefix LD_LIBRARY_PATH : $out/app/${pname}/lib
73+
--prefix LD_LIBRARY_PATH : $out/app/${finalAttrs.pname}/lib
5874
'';
5975

6076
passthru = {
6177
pubspecSource =
6278
runCommand "pubspec.lock.json"
6379
{
64-
inherit src;
80+
inherit (finalAttrs) src;
6581
nativeBuildInputs = [ yq-go ];
6682
}
6783
''
@@ -96,4 +112,4 @@ flutter338.buildFlutterApplication {
96112
platforms = lib.platforms.linux;
97113
maintainers = with lib.maintainers; [ JollyDevelopment ];
98114
};
99-
}
115+
})

0 commit comments

Comments
 (0)