repath-studio: 0.4.18 -> 0.4.26

Assisted-by: Antigravity (Gemini 3.8 Flash high)
Signed-off-by: phanirithvij <phanirithvij2000@gmail.com>
This commit is contained in:
phanirithvij
2026-10-16 18:03:52 +05:30
parent 82cdcd5072
commit eb05aa56cf
7 changed files with 140 additions and 31 deletions

View File

@@ -42,7 +42,9 @@
# - start_all()/run_tests()
interactive.sshBackdoor.enable = true;
testScript = /* python */ ''
testScript = /* py */ ''
from datetime import timedelta
start_all()
machine.wait_for_x()
@@ -52,6 +54,11 @@
machine.screenshot("Repath-Studio-GUI-Welcome")
machine.send_key("kp_enter") # OK
# Wait for the home screen and create a new document
machine.sleep(duration=timedelta(seconds=2))
machine.execute("su - alice -c \"DISPLAY=:0 xdotool key ctrl+n\"")
machine.sleep(duration=timedelta(seconds=2))
# move the mouse to the "Save" icon on the toolbar
machine.execute("su - alice -c \"DISPLAY=:0 xdotool mousemove --sync 95 65\"")
@@ -61,13 +68,13 @@
if status == 0:
break
machine.execute("su - alice -c \"DISPLAY=:0 xdotool click 1\"")
machine.sleep(1)
machine.sleep(duration=timedelta(seconds=1))
# wait for the GTK dialog to focus the text input field
machine.sleep(3)
machine.sleep(duration=timedelta(seconds=3))
machine.send_chars("saved.rps") # avoid using absolute path here, doesn't work for some reason
# wait for text to be typed
machine.sleep(2)
machine.sleep(duration=timedelta(seconds=2))
machine.execute("su - alice -c \"DISPLAY=:0 xdotool key alt+s\"") # save file
machine.wait_until_succeeds("ls /home/alice/saved.rps")

View File

@@ -9,28 +9,28 @@ Signed-off-by: phanirithvij <phanirithvij2000@gmail.com>
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/src/electron/main.cljs b/src/electron/main.cljs
index cdc2a5a0..e86922d6 100644
index 4075cbb..561239c 100644
--- a/src/electron/main.cljs
+++ b/src/electron/main.cljs
@@ -5,7 +5,6 @@
["@sentry/electron/main" :as sentry-electron-main]
["electron" :refer [app shell ipcMain BrowserWindow]]
["electron" :refer [app shell ipcMain BrowserWindow Menu]]
["electron-log/main" :as log]
- ["electron-updater" :refer [autoUpdater]]
["electron-window-state" :as window-state-keeper]
["os" :as os]
["path" :as path]
@@ -148,9 +147,7 @@
(register-web-contents-events)
(register-ipc-on-events)
(register-ipc-handle-events)
- (register-window-events)
["url" :as url]
@@ -164,9 +163,7 @@
(register-web-contents-events)
(register-ipc-on-events)
(register-ipc-handle-events)
- (register-window-events)
-
- (.checkForUpdatesAndNotify autoUpdater)))
+ (register-window-events)))
- (.checkForUpdatesAndNotify autoUpdater))
+ (register-window-events))
(defn init-loading-window! []
(set! (.-allowRendererProcessReuse app) false)
(reset! loading-window
--
2.55.0

View File

@@ -1,22 +1,29 @@
--- a/karma.conf.js
+++ b/karma.conf.js
@@ -7,7 +7,7 @@
@@ -2,13 +2,14 @@
var junitOutputDir = process.env.CIRCLE_TEST_REPORTS || "target/junit"
config.set({
- browserDisconnectTimeout: 10000,
+ browserDisconnectTimeout: 300000,
customLaunchers: {
ChromeHeadlessNoSandbox: {
base: 'ChromeHeadless',
- flags: ['--no-sandbox']
+ flags: ['--no-sandbox', '--disable-dev-shm-usage']
flags: [
'--disable-gpu',
- '--no-sandbox'
+ '--no-sandbox',
+ '--disable-dev-shm-usage'
]
},
CustomElectron: {
base: 'Electron',
@@ -42,6 +42,10 @@
@@ -44,6 +45,9 @@
outputDir: junitOutputDir + '/karma', // results will be saved as outputDir/browserName.xml
outputFile: undefined, // if included, results will be saved as outputDir/browserName/outputFile
suite: '' // suite will become the package name attribute in xml testsuite element
- }
+ },
+
+ browserDisconnectTimeout: 300000,
+ browserNoActivityTimeout: 300000,
+ pingTimeout: 300000
})

View File

@@ -4,6 +4,7 @@
buildNpmPackage,
fetchFromGitHub,
runCommand,
pkg-config,
electron,
chromium,
@@ -21,15 +22,49 @@
nixosTests,
}:
let
jediSrc = fetchFromGitHub {
owner = "davidhalter";
repo = "jedi";
rev = "v0.19.2"; # updateScript
hash = "sha256-2nDQJS6LIaq91PG3Av85OMFfs1ZwId00K/kvog3PGXE=";
fetchSubmodules = true;
};
parsoSrc = fetchFromGitHub {
owner = "davidhalter";
repo = "parso";
rev = "v0.8.6"; # updateScript
hash = "sha256-SKXVU19zCYpPik8QF/r2J9V4+ygGiDPEc9Xv6qRb4dM=";
};
pyodideWheels =
runCommand "pyodide-wheels"
{
nativeBuildInputs = with python3.pkgs; [
build
flit-core
setuptools
wheel
];
}
''
mkdir -p $out
cp -r ${jediSrc} jedi && chmod -R u+w jedi
python -m build --wheel --no-isolation jedi --outdir $out
cp -r ${parsoSrc} parso && chmod -R u+w parso
python -m build --wheel --no-isolation parso --outdir $out
'';
in
buildNpmPackage (finalAttrs: {
pname = "repath-studio";
version = "0.4.18";
version = "0.4.26";
src = fetchFromGitHub {
owner = "repath-studio";
repo = "repath-studio";
tag = "v${finalAttrs.version}";
hash = "sha256-uHGF/SEbKZF6Ax1yrXYoAjXH5k6PzKF4aB85TXGJvk4=";
hash = "sha256-aLHQhhIF/GQYVO5p0Wlr8VGt71NOohRnu78tJhGvyp8=";
};
patches = [
@@ -39,11 +74,13 @@ buildNpmPackage (finalAttrs: {
# checks have become flaky in nix build sandbox, increase timeout and disable dev/shm for chrome
./fix-karma-sandbox.patch
./0001-disable-auto-update-check.patch
# pyodide wheels are built locally from source
./use-local-pyodide-wheels.patch
];
makeCacheWritable = true;
npmDepsHash = "sha256-LBzauu5lpyfwOpnncsjPP4NpnoKqqcvX+HbK0YWNerA=";
npmDepsHash = "sha256-8fZjwwZuuiXYTq9NUkvcVaj+mewGfK2vaiq6z7rHoTo=";
nativeBuildInputs = [
finalAttrs.passthru.clojureWithHome
@@ -71,9 +108,9 @@ buildNpmPackage (finalAttrs: {
substituteInPlace shadow-cljs.edn \
--replace-fail ":shadow-git-inject/version" '"v${finalAttrs.version}"'
substituteInPlace src/renderer/shell/impl/python.cljs \
--replace-fail '"/pyodide/pyodide.js"' '"pyodide/pyodide.js"' \
--replace-fail '(js/loadPyodide)' '(js/loadPyodide #js {:indexURL "pyodide/"})'
mkdir -p resources/public/pyodide src/generated
cp ${pyodideWheels}/*.whl resources/public/pyodide/
chmod -R u+w resources/public/pyodide
'';
buildPhase = ''
@@ -175,7 +212,8 @@ buildNpmPackage (finalAttrs: {
# -P -> resolve all normal deps
# -M:alias -> resolve extra-deps of the listed aliases
clojure -P -M:dev:cljs
clojure -P
clojure -M:dev
runHook postBuild
'';
@@ -213,7 +251,7 @@ buildNpmPackage (finalAttrs: {
dontFixup = true;
outputHash = "sha256-0+7pPY/f7Cn+wgGZyM5gKS7g3dsL4j57oQE4GWdCpu0=";
outputHash = "sha256-7J1sK7fg/gBLln4KTt9q65Vt0FjCjR81vGRwhwSdw4o=";
outputHashMode = "recursive";
outputHashAlgo = "sha256";
};
@@ -225,6 +263,7 @@ buildNpmPackage (finalAttrs: {
'';
updateScript = ./update.sh;
inherit jediSrc parsoSrc;
tests = { inherit (nixosTests) repath-studio; };
};

View File

@@ -3,7 +3,7 @@
@@ -1,5 +1,6 @@
{:paths ["src"]
- :deps {binaryage/devtools {:mvn/version "1.0.7"}
+ :deps {org.clojure/clojure {:mvn/version "1.12.5"}
+ :deps {org.clojure/clojure {:mvn/version "1.12.6"}
+ binaryage/devtools {:mvn/version "1.0.7"}
camel-snake-kebab/camel-snake-kebab {:mvn/version "0.4.3"}
clj-kdtree/clj-kdtree {:git/url "https://github.com/abscondment/clj-kdtree.git"

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl jq nix-update gitMinimal diffutils gnused
#!nix-shell -i bash -p curl jq nix-update gitMinimal diffutils gnused common-updater-scripts
set -x
set -eou pipefail
@@ -61,6 +61,28 @@ diff -u --label=a/deps.edn --label=b/deps.edn a/deps.edn b/deps.edn >"$PATCH_CLJ
rm -rf a b
# pyodide dependencies
pyodide_version="$(jq -r '.devDependencies.pyodide // .dependencies.pyodide' "$src/package.json")"
pyodide_lock="$(curl -sL "https://registry.npmjs.org/pyodide/-/pyodide-${pyodide_version}.tgz" | tar -zxOf - package/pyodide-lock.json)"
update_pyodide_dep() {
local repo="$1"
local src_attr="$2"
local version
version="$(jq -r --arg r "$repo" '.packages[$r].version' <<<"$pyodide_lock")"
local current_rev
current_rev="$(nix-instantiate --eval -E "let pkgs = import $NIXPKGS_PATH {}; in pkgs.repath-studio.passthru.$src_attr.rev" | tr -d '"')"
if [[ -n "$version" && "$version" != "null" && "$current_rev" != "v$version" ]]; then
(cd "$NIXPKGS_PATH" && update-source-version repath-studio --source-key="passthru.$src_attr" --rev="v$version" --ignore-same-version)
fi
}
update_pyodide_dep jedi jediSrc
update_pyodide_dep parso parsoSrc
# clojure home
dummy_hash="sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="

View File

@@ -0,0 +1,34 @@
--- a/src/build/fetch-pyodide-wheels.mjs
+++ b/src/build/fetch-pyodide-wheels.mjs
@@ -39,7 +39,8 @@ const wheelNames = new Set([...needed.values()].map((p) => p.file_name));
await mkdir(pyodideDir, { recursive: true });
for (const [name, pkg] of needed) {
const dest = path.join(pyodideDir, pkg.file_name);
- if (existsSync(dest) && sha256(await readFile(dest)) === pkg.sha256) {
+ if (existsSync(dest)) {
+ pkg.sha256 = sha256(await readFile(dest));
console.log(`up to date: ${pkg.file_name}`);
continue;
}
@@ -57,6 +58,11 @@ for (const [name, pkg] of needed) {
console.log(`downloaded: ${pkg.file_name}`);
}
+await writeFile(
+ path.join(pyodideDir, "pyodide-lock.json"),
+ JSON.stringify(lock, null, 2)
+);
+
// Drop wheels left over from older pyodide versions.
for (const file of await readdir(pyodideDir)) {
if (file.endsWith(".whl") && !wheelNames.has(file)) {
--- a/src/renderer/shell/impl/python.cljs
+++ b/src/renderer/shell/impl/python.cljs
@@ -151,7 +151,7 @@
(defn load-pyodide
[{:keys [on-success on-error]}]
- (-> (js/loadPyodide)
+ (-> (js/loadPyodide #js {:indexURL "pyodide/"})
(.then (fn [^js pyodide]
(aset js/window "pyodide" pyodide)