From 7d7ac5d164d58aca402657e1a02aae0ec9630f6b Mon Sep 17 00:00:00 2001 From: Matt McHenry Date: Sat, 5 Apr 2025 11:48:17 -0400 Subject: [PATCH] eclipses: standardize name/version attributes * set pname rather than name in the generateEclipse function * use the standard 'version' attribute name rather than the ad-hoc 'productVersion' attribute when calling buildEclipseUnversioned * pass 'pname' and 'version' through to mkDerivation, and let it derive 'name', per standard convention * update generation of the '-configuration' argument to use 'version' fixes: The derivation has no version attribute, so do not know how to figure out the version while doing an updateScript update ... during automated update process introduced in 5bb31f951854 --- pkgs/applications/editors/eclipse/build-eclipse.nix | 8 ++++---- pkgs/applications/editors/eclipse/default.nix | 6 ++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/pkgs/applications/editors/eclipse/build-eclipse.nix b/pkgs/applications/editors/eclipse/build-eclipse.nix index 829ab15e622c..1b42cc2311fe 100644 --- a/pkgs/applications/editors/eclipse/build-eclipse.nix +++ b/pkgs/applications/editors/eclipse/build-eclipse.nix @@ -21,15 +21,15 @@ }: { - name, + pname, src ? builtins.getAttr stdenv.hostPlatform.system sources, sources ? null, description, - productVersion, + version, }: stdenv.mkDerivation rec { - inherit name src; + inherit pname version src; desktopItem = makeDesktopItem { name = "Eclipse"; @@ -98,7 +98,7 @@ stdenv.mkDerivation rec { } \ --prefix GIO_EXTRA_MODULES : "${glib-networking}/lib/gio/modules" \ --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH" \ - --add-flags "-configuration \$HOME/.eclipse/''${productId}_${productVersion}/configuration" + --add-flags "-configuration \$HOME/.eclipse/''${productId}_${version}/configuration" # Create desktop item. mkdir -p $out/share/applications diff --git a/pkgs/applications/editors/eclipse/default.nix b/pkgs/applications/editors/eclipse/default.nix index db85c9ccfb4c..d84e0b0e42bd 100644 --- a/pkgs/applications/editors/eclipse/default.nix +++ b/pkgs/applications/editors/eclipse/default.nix @@ -70,9 +70,7 @@ let }; buildEclipse = eclipseData: - buildEclipseUnversioned ( - eclipseData // { productVersion = "${platform_major}.${platform_minor}"; } - ); + buildEclipseUnversioned (eclipseData // { version = "${platform_major}.${platform_minor}"; }); generateEclipse = id: @@ -85,7 +83,7 @@ let { name = "eclipse-${lib.strings.toLower id}"; value = buildEclipse { - name = "eclipse-${lib.strings.toLower id}-${platform_major}.${platform_minor}"; + pname = "eclipse-${lib.strings.toLower id}"; inherit description; src = fetchurl { url =