This commit is contained in:
Shelvacu
2025-08-16 20:16:05 -07:00
committed by Shelvacu on fw
parent 4ea9388566
commit 3846b473e3

View File

@@ -126,22 +126,11 @@ stdenv.mkDerivation (finalAttrs: {
doBuild = false;
dontWrapQtApps = true;
installPhase = ''
# declare xdg_data_dirs=""
# for buildInput in $buildInputs; do
# schemas_dirs="$(echo "$buildInput"/share/gsettings-schemas/*)"
# for schema_dir in $schema_dirs; do
# if [[ -d "$schema_dir/glib-2.0/schemas" ]]; then
# xdg_data_dirs="$xdg_data_dirs''${xdg_data_dirs:+:}$schema_dir"
# fi
# done
# done
mainDir="$out"/share/stm32cubeide
mkdir -p "$mainDir"
tar -xf *.tar.gz -C "$mainDir"
mkdir -p "$out"/share/applications
bash ./desktop_shortcut.sh ${lib.escapeShellArg (finalAttrs.version + "-nix")} "$mainDir" "$out"share/applications/st-stm32cubeide-${finalAttrs.version}.desktop
echo "-Djava.util.prefs.systemRoot=/home/shelvacu/.local/share/stm32cubeide-nix/system-prefs" >> "$mainDir"/stm32cubeide.ini
echo "-Djava.util.prefs.userRoot=/home/shelvacu/.local/share/stm32cubeide-nix/user-prefs" >> "$mainDir"/stm32cubeide.ini
binDir="$out"/bin
mkdir -p "$binDir"
@@ -151,8 +140,11 @@ stdenv.mkDerivation (finalAttrs: {
--argv0 "$mainDir/stm32cubeide"
--set GDK_BACKEND x11
--prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH"
# --run 'mkdir -p $HOME/.local/share/stm32cubeide-nix/{system,user}-prefs'
# --add-flags '-Djava.util.prefs.systemRoot=$HOME/.local/share/stm32cubeide-nix/system-prefs -Djava.util.prefs.userRoot=$HOME/.local/share/stm32cubeide-nix/user-prefs'
--run 'xdgConfigDir="''${XDG_CONFIG_HOME:-"$HOME"/.config}"'
--run 'cubeConfigDir="$xdgConfigDir/stm32cubeide-nix"'
--run 'mkdir -p "$cubeConfigDir"/{system/.systemPrefs,user}'
--run 'touch "$cubeConfigDir/system/.systemPrefs/.system.lock"'
--run 'export JAVA_TOOL_OPTIONS="''${JAVA_TOOL_OPTIONS:-} -Djava.util.prefs.systemRoot=$cubeConfigDir/system -Djava.util.prefs.userRoot=$cubeConfigDir/user -Dswt.library.path=${swt}/lib"'
)
"''${cmd[@]}"
unset cmd