summarylogtreecommitdiffstats
path: root/workbench-extensions-check.patch
blob: be59033d627300ed0d3e08b795208e87ec73e1a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
From f7526836462245ce519e1f17eecef752b8260dca Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ball=C3=B3=20Gy=C3=B6rgy?= <ballogyor@gmail.com>
Date: Sat, 23 Nov 2024 13:26:21 +0100
Subject: [PATCH] Fix detection of compilers

---
 src/Extensions/Extensions.js | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)

diff --git a/src/Extensions/Extensions.js b/src/Extensions/Extensions.js
index d459920..bd7c46d 100644
--- a/src/Extensions/Extensions.js
+++ b/src/Extensions/Extensions.js
@@ -1,4 +1,5 @@
 import Gio from "gi://Gio";
+import GLib from "gi://GLib";
 
 import { build } from "../../troll/src/main.js";
 
@@ -27,13 +28,13 @@ export function Extensions({ window }) {
   picture_illustration.set_resource(illustration);
 
   extension_rust.available = isRustAvailable();
-  extension_rust.command = `flatpak install flathub org.freedesktop.Sdk.Extension.rust-stable//${freedesktop_version} org.freedesktop.Sdk.Extension.${llvm}//${freedesktop_version}`;
+  extension_rust.command = `pacman -S rust`;
 
   extension_vala.available = isValaAvailable();
-  extension_vala.command = `flatpak install flathub org.freedesktop.Sdk.Extension.vala//${freedesktop_version}`;
+  extension_vala.command = `pacman -S vala`;
 
   extension_typescript.available = isTypeScriptAvailable();
-  extension_typescript.command = `flatpak install flathub org.freedesktop.Sdk.Extension.${node}//${freedesktop_version} org.freedesktop.Sdk.Extension.typescript//${freedesktop_version}`;
+  extension_typescript.command = `pacman -S typescript`;
   extension_typescript.visible = isTypeScriptEnabled();
 
   for (const extension of [
@@ -57,15 +58,14 @@ export function Extensions({ window }) {
 let rust_available = null;
 export function isRustAvailable() {
   rust_available ??=
-    Gio.File.new_for_path("/usr/lib/sdk/rust-stable").query_exists(null) &&
-    Gio.File.new_for_path(`/usr/lib/sdk/${llvm}`).query_exists(null);
+    GLib.find_program_in_path("rustc");
   return rust_available;
 }
 
 let vala_available = null;
 export function isValaAvailable() {
   vala_available ??=
-    Gio.File.new_for_path("/usr/lib/sdk/vala").query_exists(null);
+    GLib.find_program_in_path("valac");
   return vala_available;
 }
 
@@ -73,16 +73,10 @@ let typescript_available = null;
 export function isTypeScriptAvailable() {
   typescript_available ??=
     isTypeScriptEnabled() &&
-    Gio.File.new_for_path("/usr/lib/sdk/typescript").query_exists(null) &&
-    Gio.File.new_for_path(`/usr/lib/sdk/${node}`).query_exists(null);
+    GLib.find_program_in_path("tsc");
   return typescript_available;
 }
 
-const llvm = "llvm18";
-const node = "node20";
-const runtime = getFlatpakInfo().get_string("Application", "runtime");
-const freedesktop_version = runtime.endsWith("master") ? "24.08" : "24.08";
-
 export function isTypeScriptEnabled() {
   return settings.get_boolean("typescript");
 }
-- 
2.47.0