ags_1: fix build on typescript 5.9.2

authored by Kenichi Kamiya and committed by Masum Reza 35523e24 674b91e8

+24
+5
pkgs/by-name/ag/ags_1/package.nix
··· 59 59 upower 60 60 ]; 61 61 62 + patches = [ 63 + # Workaround for TypeScript 5.9: https://github.com/Aylur/ags/issues/725#issuecomment-3070009695 64 + ./ts59.patch 65 + ]; 66 + 62 67 postPatch = '' 63 68 chmod u+x ./post_install.sh && patchShebangs ./post_install.sh 64 69 '';
+19
pkgs/by-name/ag/ags_1/ts59.patch
··· 1 + diff --git a/src/service/greetd.ts b/src/service/greetd.ts 2 + index 10a475e..621a427 100644 3 + --- a/src/service/greetd.ts 4 + +++ b/src/service/greetd.ts 5 + @@ -101,8 +101,12 @@ export class Greetd extends Service { 6 + ostream.put_int32(json.length, null); 7 + ostream.put_string(json, null); 8 + 9 + - const data = await istream.read_bytes_async(4, GLib.PRIORITY_DEFAULT, null); 10 + - const length = new Uint32Array(data.get_data()?.buffer || [0])[0]; 11 + + const data = ( 12 + + await istream.read_bytes_async(4, GLib.PRIORITY_DEFAULT, null) 13 + + ).get_data(); 14 + + const length = data 15 + + ? new DataView(data.buffer, data.byteOffset, data.byteLength).getUint32(0, true) 16 + + : 0; 17 + const res = await istream.read_bytes_async(length, GLib.PRIORITY_DEFAULT, null); 18 + return JSON.parse(this._decoder.decode(res.get_data()!)) as Response; 19 + } finally {