tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
0
fork
atom
lol
0
fork
atom
overview
issues
pulls
pipelines
fluffychat: 1.7.0 -> 2.0.0
aleksana
9 months ago
b5aec1f9
61eda88c
+209
-86
3 changed files
expand all
collapse all
unified
split
pkgs
by-name
fl
fluffychat
package.nix
pubspec.lock.json
vodozemac-wasm.nix
+44
-64
pkgs/by-name/fl/fluffychat/package.nix
···
1
1
{
2
2
lib,
3
3
-
fetchzip,
4
3
fetchFromGitHub,
5
5
-
fetchpatch,
6
4
imagemagick,
7
5
libgbm,
8
6
libdrm,
9
7
flutter332,
10
8
pulseaudio,
9
9
+
copyDesktopItems,
11
10
makeDesktopItem,
12
12
-
olm,
11
11
+
12
12
+
callPackage,
13
13
+
vodozemac-wasm ? callPackage ./vodozemac-wasm.nix { flutter = flutter332; },
13
14
14
15
targetFlutterPlatform ? "linux",
15
16
}:
···
24
25
flutter332.buildFlutterApplication (
25
26
rec {
26
27
pname = "fluffychat-${targetFlutterPlatform}";
27
27
-
version = "1.27.0";
28
28
+
version = "2.0.0";
28
29
29
30
src = fetchFromGitHub {
30
31
owner = "krille-chan";
31
32
repo = "fluffychat";
32
33
tag = "v${version}";
33
33
-
hash = "sha256-kt4VpegxcZ+d0NIKan2A0AUqFLdYNcU9HY/4zyd2eSU=";
34
34
+
hash = "sha256-fFc6nIVQUY9OiGkEc7jrzXnBQPDWC5x5A4/XHUhu6hs=";
34
35
};
35
36
36
36
-
# https://github.com/krille-chan/fluffychat/pull/1965
37
37
-
patches = [
38
38
-
(fetchpatch {
39
39
-
name = "fix_compilation_mxc_image.patch";
40
40
-
url = "https://github.com/krille-chan/fluffychat/commit/e1ec87d3aaae00eb030bcfda28ec8f247e2c3346.patch";
41
41
-
hash = "sha256-/cd3geNVPifAC7iTcx8V1l2WY9Y/mEw+VPl2B4HSJKY=";
42
42
-
})
43
43
-
];
44
44
-
45
37
inherit pubspecLock;
46
38
47
39
gitHashes = {
48
48
-
flutter_secure_storage_linux = "sha256-cFNHW7dAaX8BV7arwbn68GgkkBeiAgPfhMOAFSJWlyY=";
49
40
flutter_web_auth_2 = "sha256-3aci73SP8eXg6++IQTQoyS+erUUuSiuXymvR32sxHFw=";
50
41
flutter_typeahead = "sha256-ZGXbbEeSddrdZOHcXE47h3Yu3w6oV7q+ZnO6GyW7Zg8=";
42
42
+
flutter_secure_storage_linux = "sha256-cFNHW7dAaX8BV7arwbn68GgkkBeiAgPfhMOAFSJWlyY=";
51
43
};
52
44
53
45
inherit targetFlutterPlatform;
54
46
55
55
-
meta = {
56
56
-
description = "Chat with your friends (matrix client)";
57
57
-
homepage = "https://fluffychat.im/";
58
58
-
license = lib.licenses.agpl3Plus;
59
59
-
mainProgram = "fluffychat";
60
60
-
maintainers = with lib.maintainers; [
61
61
-
mkg20001
62
62
-
tebriel
63
63
-
aleksana
64
64
-
];
65
65
-
platforms = [
66
66
-
"x86_64-linux"
67
67
-
"aarch64-linux"
68
68
-
];
69
69
-
sourceProvenance = [ lib.sourceTypes.fromSource ];
70
70
-
inherit (olm.meta) knownVulnerabilities;
71
71
-
};
47
47
+
meta =
48
48
+
{
49
49
+
description = "Chat with your friends (matrix client)";
50
50
+
homepage = "https://fluffychat.im/";
51
51
+
license = lib.licenses.agpl3Plus;
52
52
+
maintainers = with lib.maintainers; [
53
53
+
mkg20001
54
54
+
tebriel
55
55
+
aleksana
56
56
+
];
57
57
+
badPlatforms = lib.platforms.darwin;
58
58
+
}
59
59
+
// lib.optionalAttrs (targetFlutterPlatform == "linux") {
60
60
+
mainProgram = "fluffychat";
61
61
+
};
72
62
}
73
63
// lib.optionalAttrs (targetFlutterPlatform == "linux") {
74
74
-
nativeBuildInputs = [ imagemagick ];
64
64
+
nativeBuildInputs = [
65
65
+
imagemagick
66
66
+
copyDesktopItems
67
67
+
];
75
68
76
69
runtimeDependencies = [ pulseaudio ];
77
70
78
71
env.NIX_LDFLAGS = "-rpath-link ${libwebrtcRpath}";
79
72
80
80
-
desktopItem = makeDesktopItem {
81
81
-
name = "Fluffychat";
82
82
-
exec = "fluffychat";
83
83
-
icon = "fluffychat";
84
84
-
desktopName = "Fluffychat";
85
85
-
genericName = "Chat with your friends (matrix client)";
86
86
-
categories = [
87
87
-
"Chat"
88
88
-
"Network"
89
89
-
"InstantMessaging"
90
90
-
];
91
91
-
};
73
73
+
desktopItems = [
74
74
+
(makeDesktopItem {
75
75
+
name = "Fluffychat";
76
76
+
exec = "fluffychat";
77
77
+
icon = "fluffychat";
78
78
+
desktopName = "Fluffychat";
79
79
+
genericName = "Chat with your friends (matrix client)";
80
80
+
categories = [
81
81
+
"Chat"
82
82
+
"Network"
83
83
+
"InstantMessaging"
84
84
+
];
85
85
+
})
86
86
+
];
92
87
93
88
postInstall = ''
94
89
FAV=$out/app/fluffychat-linux/data/flutter_assets/assets/favicon.png
95
90
ICO=$out/share/icons
96
91
97
97
-
install -D $FAV $ICO/fluffychat.png
98
98
-
mkdir $out/share/applications
99
99
-
cp $desktopItem/share/applications/*.desktop $out/share/applications
100
92
for size in 24 32 42 64 128 256 512; do
101
101
-
D=$ICO/hicolor/''${s}x''${s}/apps
93
93
+
D=$ICO/hicolor/''${size}x''${size}/apps
102
94
mkdir -p $D
103
95
magick $FAV -resize ''${size}x''${size} $D/fluffychat.png
104
96
done
···
107
99
'';
108
100
}
109
101
// lib.optionalAttrs (targetFlutterPlatform == "web") {
110
110
-
prePatch =
111
111
-
# https://github.com/krille-chan/fluffychat/blob/v1.17.1/scripts/prepare-web.sh
112
112
-
let
113
113
-
# Use Olm 1.3.2, the oldest version, for FluffyChat 1.14.1 which depends on olm_flutter 1.2.0.
114
114
-
olmVersion = pubspecLock.packages.flutter_olm.version;
115
115
-
olmJs = fetchzip {
116
116
-
url = "https://github.com/famedly/olm/releases/download/v${olmVersion}/olm.zip";
117
117
-
stripRoot = false;
118
118
-
hash = "sha256-Vl3Cp2OaYzM5CPOOtTHtUb1W48VXePzOV6FeiIzyD1Y=";
119
119
-
};
120
120
-
in
121
121
-
''
122
122
-
rm -r assets/js/package
123
123
-
cp -r '${olmJs}/javascript' assets/js/package
124
124
-
'';
102
102
+
preBuild = ''
103
103
+
cp -r ${vodozemac-wasm}/* ./assets/vodozemac/
104
104
+
'';
125
105
}
126
106
)
+42
-22
pkgs/by-name/fl/fluffychat/pubspec.lock.json
···
176
176
"source": "hosted",
177
177
"version": "2.1.2"
178
178
},
179
179
+
"build_cli_annotations": {
180
180
+
"dependency": "transitive",
181
181
+
"description": {
182
182
+
"name": "build_cli_annotations",
183
183
+
"sha256": "b59d2769769efd6c9ff6d4c4cede0be115a566afc591705c2040b707534b1172",
184
184
+
"url": "https://pub.dev"
185
185
+
},
186
186
+
"source": "hosted",
187
187
+
"version": "2.1.0"
188
188
+
},
179
189
"canonical_json": {
180
190
"dependency": "transitive",
181
191
"description": {
···
764
774
"source": "hosted",
765
775
"version": "1.1.1"
766
776
},
767
767
-
"flutter_olm": {
768
768
-
"dependency": "direct main",
769
769
-
"description": {
770
770
-
"name": "flutter_olm",
771
771
-
"sha256": "5e6211af8cba1abf7d1f92e543f6d573dfe6017fe4742e0d04ba84beab47f940",
772
772
-
"url": "https://pub.dev"
773
773
-
},
774
774
-
"source": "hosted",
775
775
-
"version": "2.0.0"
776
776
-
},
777
777
"flutter_openssl_crypto": {
778
778
"dependency": "direct main",
779
779
"description": {
···
793
793
},
794
794
"source": "hosted",
795
795
"version": "2.0.28"
796
796
+
},
797
797
+
"flutter_rust_bridge": {
798
798
+
"dependency": "transitive",
799
799
+
"description": {
800
800
+
"name": "flutter_rust_bridge",
801
801
+
"sha256": "b416ff56002789e636244fb4cc449f587656eff995e5a7169457eb0593fcaddb",
802
802
+
"url": "https://pub.dev"
803
803
+
},
804
804
+
"source": "hosted",
805
805
+
"version": "2.10.0"
796
806
},
797
807
"flutter_secure_storage": {
798
808
"dependency": "direct main",
···
882
892
"source": "git",
883
893
"version": "5.2.0"
884
894
},
895
895
+
"flutter_vodozemac": {
896
896
+
"dependency": "direct main",
897
897
+
"description": {
898
898
+
"name": "flutter_vodozemac",
899
899
+
"sha256": "2405ca121b84d1cd83200a14021022e1691b123a23bcefc36adc7740cefbc1f9",
900
900
+
"url": "https://pub.dev"
901
901
+
},
902
902
+
"source": "hosted",
903
903
+
"version": "0.2.2"
904
904
+
},
885
905
"flutter_web_auth_2": {
886
906
"dependency": "direct main",
887
907
"description": {
···
1445
1465
"dependency": "direct main",
1446
1466
"description": {
1447
1467
"name": "matrix",
1448
1448
-
"sha256": "f8f78700f967de4333a0c9ca609dac2ae05914a27faa60c5530026b7aca6ae78",
1468
1468
+
"sha256": "996e3b1560959afaa3118ec2b5a06734ad29acf64f9c3c09a605c3ddef22039f",
1449
1469
"url": "https://pub.dev"
1450
1470
},
1451
1471
"source": "hosted",
1452
1452
-
"version": "0.40.2"
1472
1472
+
"version": "1.0.1"
1453
1473
},
1454
1474
"meta": {
1455
1475
"dependency": "transitive",
···
1520
1540
},
1521
1541
"source": "hosted",
1522
1542
"version": "2.0.2"
1523
1523
-
},
1524
1524
-
"olm": {
1525
1525
-
"dependency": "transitive",
1526
1526
-
"description": {
1527
1527
-
"name": "olm",
1528
1528
-
"sha256": "6a3fe1e5170b954dd9e4ba3b27513e6aa9b7591eb7bb0d7f6f32140b7f140c6f",
1529
1529
-
"url": "https://pub.dev"
1530
1530
-
},
1531
1531
-
"source": "hosted",
1532
1532
-
"version": "3.1.0"
1533
1543
},
1534
1544
"opus_caf_converter_dart": {
1535
1545
"dependency": "direct main",
···
2746
2756
},
2747
2757
"source": "hosted",
2748
2758
"version": "15.0.0"
2759
2759
+
},
2760
2760
+
"vodozemac": {
2761
2761
+
"dependency": "transitive",
2762
2762
+
"description": {
2763
2763
+
"name": "vodozemac",
2764
2764
+
"sha256": "dba14017e042748fb22d270e8ab1d3e46965b89788dd3857dba938ec07571968",
2765
2765
+
"url": "https://pub.dev"
2766
2766
+
},
2767
2767
+
"source": "hosted",
2768
2768
+
"version": "0.2.0"
2749
2769
},
2750
2770
"wakelock_plus": {
2751
2771
"dependency": "direct main",
+123
pkgs/by-name/fl/fluffychat/vodozemac-wasm.nix
···
1
1
+
{
2
2
+
lib,
3
3
+
stdenv,
4
4
+
fluffychat-web,
5
5
+
symlinkJoin,
6
6
+
buildPackages,
7
7
+
rustc,
8
8
+
rustPlatform,
9
9
+
cargo,
10
10
+
flutter,
11
11
+
flutter_rust_bridge_codegen,
12
12
+
which,
13
13
+
wasm-pack,
14
14
+
wasm-bindgen-cli_0_2_100,
15
15
+
binaryen,
16
16
+
writableTmpDirAsHomeHook,
17
17
+
runCommand,
18
18
+
}:
19
19
+
20
20
+
let
21
21
+
pubSources = fluffychat-web.pubspecLock.dependencySources;
22
22
+
23
23
+
# wasm-pack doesn't take 'RUST_SRC_PATH' into consideration
24
24
+
rustcWithLibSrc = buildPackages.rustc.override {
25
25
+
sysroot = symlinkJoin {
26
26
+
name = "rustc_unwrapped_with_libsrc";
27
27
+
paths = [
28
28
+
buildPackages.rustc.unwrapped
29
29
+
];
30
30
+
postBuild = ''
31
31
+
mkdir -p $out/lib/rustlib/src/rust
32
32
+
ln -s ${rustPlatform.rustLibSrc} $out/lib/rustlib/src/rust/library
33
33
+
'';
34
34
+
};
35
35
+
};
36
36
+
in
37
37
+
38
38
+
# https://github.com/krille-chan/fluffychat/blob/main/scripts/prepare-web.sh
39
39
+
stdenv.mkDerivation {
40
40
+
pname = "vodozemac-wasm";
41
41
+
inherit (pubSources.vodozemac) version;
42
42
+
43
43
+
# These two were in the same repository, so just reuse them
44
44
+
unpackPhase = ''
45
45
+
runHook preUnpack
46
46
+
47
47
+
cp -r ${pubSources.flutter_vodozemac}/rust ./rust
48
48
+
cp -r ${pubSources.vodozemac} ./dart
49
49
+
chmod -R +rwx .
50
50
+
51
51
+
runHook postUnpack
52
52
+
'';
53
53
+
54
54
+
# Remove dev_dependencies to avoid downloading them
55
55
+
postPatch = ''
56
56
+
sed -i '/^dev_dependencies:/,/^$/d' dart/pubspec.yaml
57
57
+
'';
58
58
+
59
59
+
cargoRoot = "rust";
60
60
+
61
61
+
cargoDeps = symlinkJoin {
62
62
+
name = "vodozemac-wasm-cargodeps";
63
63
+
paths = [
64
64
+
pubSources.flutter_vodozemac.passthru.cargoDeps
65
65
+
# Pull in rust vendor so we don't have to vendor rustLibSrc again
66
66
+
# This is required because `-Z build-std=std,panic_abort` rebuilds std
67
67
+
rustPlatform.rustVendorSrc
68
68
+
];
69
69
+
};
70
70
+
71
71
+
nativeBuildInputs = [
72
72
+
rustPlatform.cargoSetupHook
73
73
+
rustcWithLibSrc
74
74
+
rustc.llvmPackages.lld
75
75
+
cargo
76
76
+
flutter
77
77
+
flutter_rust_bridge_codegen
78
78
+
which
79
79
+
wasm-pack
80
80
+
wasm-bindgen-cli_0_2_100
81
81
+
binaryen
82
82
+
writableTmpDirAsHomeHook
83
83
+
];
84
84
+
85
85
+
buildPhase = ''
86
86
+
runHook preBuild
87
87
+
88
88
+
pushd dart
89
89
+
dart pub get --offline
90
90
+
popd
91
91
+
RUST_LOG=info flutter_rust_bridge_codegen build-web \
92
92
+
--dart-root $(realpath ./dart) --rust-root $(realpath ./rust) --release
93
93
+
94
94
+
runHook postBuild
95
95
+
'';
96
96
+
97
97
+
installPhase = ''
98
98
+
runHook preInstall
99
99
+
100
100
+
mkdir -p $out
101
101
+
cp -r dart/web/pkg/vodozemac_bindings_dart* $out/
102
102
+
103
103
+
runHook postInstall
104
104
+
'';
105
105
+
106
106
+
env = {
107
107
+
# Build a pub cache from fluffychat, as dart-vodozemac should be a subset
108
108
+
# This is required because dart-vodozemac, as a pub, doesn't have a pubspec.lock
109
109
+
# But flutter_rust_bridge_codegen still requires all dependencies of it
110
110
+
PUB_CACHE = runCommand "fluffychat-pub-cache" { } ''
111
111
+
mkdir -p $out/hosted/pub.dev
112
112
+
pushd $out/hosted/pub.dev
113
113
+
${lib.concatMapAttrsStringSep "; " (
114
114
+
_: p:
115
115
+
"ln -s ${p} ./${if lib.hasPrefix "pub-" p.name then lib.removePrefix "pub-" p.name else p.name}"
116
116
+
) pubSources}
117
117
+
popd
118
118
+
'';
119
119
+
RUSTC_BOOTSTRAP = 1; # `-Z build-std=std,panic_abort` requires nightly toolchain
120
120
+
};
121
121
+
122
122
+
inherit (fluffychat-web) meta;
123
123
+
}