From 783d2679e5bb16b2c0f356349df90075a02b1e8e Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 1 Mar 2022 11:39:32 +0100 Subject: [PATCH 1/2] treewide: rename name to pname&version --- pkgs/data/soundfonts/fluid/default.nix | 3 ++- pkgs/data/soundfonts/ydp-grand/default.nix | 2 +- pkgs/data/themes/gnome-breeze/default.nix | 3 ++- pkgs/desktops/cdesktopenv/default.nix | 4 ++-- .../pantheon/apps/switchboard/wrapper.nix | 3 ++- .../pantheon/desktop/wingpanel/wrapper.nix | 3 ++- .../compilers/bs-platform/ocaml.nix | 2 +- .../compilers/ios-cross-compile/9.2.nix | 2 +- .../compilers/mit-scheme/default.nix | 3 ++- pkgs/development/compilers/openjdk/jre.nix | 2 +- pkgs/development/compilers/osl/default.nix | 2 +- pkgs/development/compilers/rust/clippy.nix | 2 +- pkgs/development/compilers/scala/dotty.nix | 3 ++- pkgs/development/compilers/swift/default.nix | 3 ++- pkgs/development/compilers/urn/default.nix | 3 ++- .../interpreters/chibi/default.nix | 24 +++++++++---------- .../interpreters/elixir/generic-builder.nix | 2 +- .../interpreters/racket/minimal.nix | 5 ++-- pkgs/development/java-modules/m2install.nix | 6 ++--- pkgs/development/libraries/CGAL/4.nix | 2 +- 20 files changed, 43 insertions(+), 36 deletions(-) diff --git a/pkgs/data/soundfonts/fluid/default.nix b/pkgs/data/soundfonts/fluid/default.nix index 1f84a6fd1eef..193c9a60b9fc 100644 --- a/pkgs/data/soundfonts/fluid/default.nix +++ b/pkgs/data/soundfonts/fluid/default.nix @@ -1,7 +1,8 @@ { lib, stdenv, fetchurl }: stdenv.mkDerivation { - name = "Fluid-3"; + pname = "Fluid"; + version = "3"; src = fetchurl { url = "https://ftp.osuosl.org/pub/musescore/soundfont/fluid-soundfont.tar.gz"; diff --git a/pkgs/data/soundfonts/ydp-grand/default.nix b/pkgs/data/soundfonts/ydp-grand/default.nix index 3b44b712139e..635b445f6115 100644 --- a/pkgs/data/soundfonts/ydp-grand/default.nix +++ b/pkgs/data/soundfonts/ydp-grand/default.nix @@ -1,7 +1,7 @@ { lib, stdenv, fetchurl }: stdenv.mkDerivation { - name = "ydp-grand"; + pname = "ydp-grand"; version = "unstable-2016-08-04"; src = fetchurl { diff --git a/pkgs/data/themes/gnome-breeze/default.nix b/pkgs/data/themes/gnome-breeze/default.nix index 09f9ecd197a8..f3eff34e9e6f 100644 --- a/pkgs/data/themes/gnome-breeze/default.nix +++ b/pkgs/data/themes/gnome-breeze/default.nix @@ -1,7 +1,8 @@ { lib, stdenv, fetchgit }: stdenv.mkDerivation { - name = "gnome-breeze-20160526"; + pname = "gnome-breeze"; + version = "unstable-2016-05-26"; src = fetchgit { url = "https://github.com/dirruk1/gnome-breeze"; sha256 = "0hkk0gqlnrs1m4rb5r84f5y96qfamrbiwm09z89yc32124x1a1lm"; diff --git a/pkgs/desktops/cdesktopenv/default.nix b/pkgs/desktops/cdesktopenv/default.nix index 71b661f1265b..77650e71ebe9 100644 --- a/pkgs/desktops/cdesktopenv/default.nix +++ b/pkgs/desktops/cdesktopenv/default.nix @@ -18,10 +18,10 @@ let }; in stdenv.mkDerivation rec { version = "2.3.2"; - name = "cde-${version}"; + pname = "cde"; src = fetchurl { - url = "mirror://sourceforge/cdesktopenv/${name}.tar.gz"; + url = "mirror://sourceforge/cdesktopenv/cde-${version}.tar.gz"; sha256 = "029rljhi5r483x8rzdpl8625z0wx8r7k2m0364nbw66h5pig9lbx"; }; diff --git a/pkgs/desktops/pantheon/apps/switchboard/wrapper.nix b/pkgs/desktops/pantheon/apps/switchboard/wrapper.nix index 7953105951c6..e42df9bee060 100644 --- a/pkgs/desktops/pantheon/apps/switchboard/wrapper.nix +++ b/pkgs/desktops/pantheon/apps/switchboard/wrapper.nix @@ -19,7 +19,8 @@ let testingName = lib.optionalString (testName != null) "${testName}-"; in stdenv.mkDerivation rec { - name = "${testingName}${switchboard.name}-with-plugs"; + pname = "${testingName}${switchboard.pname}-with-plugs"; + inherit (switchboard) version; src = null; diff --git a/pkgs/desktops/pantheon/desktop/wingpanel/wrapper.nix b/pkgs/desktops/pantheon/desktop/wingpanel/wrapper.nix index ca887d45dc39..89a359a4c9d2 100644 --- a/pkgs/desktops/pantheon/desktop/wingpanel/wrapper.nix +++ b/pkgs/desktops/pantheon/desktop/wingpanel/wrapper.nix @@ -17,7 +17,8 @@ let else indicators ++ (lib.optionals useDefaultIndicators wingpanelIndicators); in stdenv.mkDerivation rec { - name = "${wingpanel.name}-with-indicators"; + pname = "${wingpanel.pname}-with-indicators"; + inherit (wingpanel) version; src = null; diff --git a/pkgs/development/compilers/bs-platform/ocaml.nix b/pkgs/development/compilers/bs-platform/ocaml.nix index d650d767a8d8..05fb8b6b17ea 100644 --- a/pkgs/development/compilers/bs-platform/ocaml.nix +++ b/pkgs/development/compilers/bs-platform/ocaml.nix @@ -1,7 +1,7 @@ { lib, stdenv, src, version }: stdenv.mkDerivation rec { inherit src version; - name = "ocaml-${version}+bs"; + pname = "ocaml-bs"; configurePhase = '' ./configure -prefix $out ''; diff --git a/pkgs/development/compilers/ios-cross-compile/9.2.nix b/pkgs/development/compilers/ios-cross-compile/9.2.nix index 688ca15177a8..ea1af60993f9 100644 --- a/pkgs/development/compilers/ios-cross-compile/9.2.nix +++ b/pkgs/development/compilers/ios-cross-compile/9.2.nix @@ -4,7 +4,7 @@ automake, autoconf, libtool, clangStdenv } : clangStdenv.mkDerivation rec { - name = "ios-cross-compile-${version}"; + pname = "ios-cross-compile"; version = "9.2"; sdk = "iPhoneOS9.2.sdk"; cctools_port = fetchFromGitHub { diff --git a/pkgs/development/compilers/mit-scheme/default.nix b/pkgs/development/compilers/mit-scheme/default.nix index c67f8d2f72ff..75b3d1128e45 100644 --- a/pkgs/development/compilers/mit-scheme/default.nix +++ b/pkgs/development/compilers/mit-scheme/default.nix @@ -12,7 +12,8 @@ let "-x86-64"; in stdenv.mkDerivation { - name = if enableX11 then "mit-scheme-x11-${version}" else "mit-scheme-${version}"; + pname = "mit-scheme" + lib.optionalString enableX11 "-x11"; + inherit version; # MIT/GNU Scheme is not bootstrappable, so it's recommended to compile from # the platform-specific tarballs, which contain pre-built binaries. It diff --git a/pkgs/development/compilers/openjdk/jre.nix b/pkgs/development/compilers/openjdk/jre.nix index 78dec7885d93..02f6da928cdd 100644 --- a/pkgs/development/compilers/openjdk/jre.nix +++ b/pkgs/development/compilers/openjdk/jre.nix @@ -7,7 +7,7 @@ let jre = stdenv.mkDerivation { - name = "${jdk.name}-minimal-jre"; + pname = "${jdk.pname}-minimal-jre"; version = jdk.version; buildInputs = [ jdk ]; diff --git a/pkgs/development/compilers/osl/default.nix b/pkgs/development/compilers/osl/default.nix index 736a9d3c34c6..53b05c16d9ab 100644 --- a/pkgs/development/compilers/osl/default.nix +++ b/pkgs/development/compilers/osl/default.nix @@ -7,7 +7,7 @@ let boost_static = boost165.override { enableStatic = true; }; in clangStdenv.mkDerivation rec { # In theory this could use GCC + Clang rather than just Clang, # but https://github.com/NixOS/nixpkgs/issues/29877 stops this - name = "openshadinglanguage-${version}"; + pname = "openshadinglanguage"; version = "1.10.9"; src = fetchFromGitHub { diff --git a/pkgs/development/compilers/rust/clippy.nix b/pkgs/development/compilers/rust/clippy.nix index a3597e9febf7..23b8e7effe12 100644 --- a/pkgs/development/compilers/rust/clippy.nix +++ b/pkgs/development/compilers/rust/clippy.nix @@ -1,6 +1,6 @@ { stdenv, lib, rustPlatform, rustc, Security, patchelf }: rustPlatform.buildRustPackage { - name = "clippy-${rustc.version}"; + pname = "clippy"; inherit (rustc) version src; # the rust source tarball already has all the dependencies vendored, no need to fetch them again diff --git a/pkgs/development/compilers/scala/dotty.nix b/pkgs/development/compilers/scala/dotty.nix index c99ed24c2149..1cd187f2e540 100644 --- a/pkgs/development/compilers/scala/dotty.nix +++ b/pkgs/development/compilers/scala/dotty.nix @@ -7,7 +7,8 @@ let in stdenv.mkDerivation { - name = "dotty-${dotty-bare.version}"; + pname = "dotty"; + inherit (dotty-bare) version; dontUnpack = true; diff --git a/pkgs/development/compilers/swift/default.nix b/pkgs/development/compilers/swift/default.nix index e3a9aa2b486c..f47d4cd818f3 100644 --- a/pkgs/development/compilers/swift/default.nix +++ b/pkgs/development/compilers/swift/default.nix @@ -182,7 +182,8 @@ let in stdenv.mkDerivation { - name = "swift-${versions.swift}"; + pname = "swift"; + version = versions.swift; nativeBuildInputs = [ autoconf diff --git a/pkgs/development/compilers/urn/default.nix b/pkgs/development/compilers/urn/default.nix index 7381e7c89fec..66f1bda6d5f9 100644 --- a/pkgs/development/compilers/urn/default.nix +++ b/pkgs/development/compilers/urn/default.nix @@ -21,7 +21,8 @@ let in stdenv.mkDerivation { - name = "urn-${optionalString (extraLibraries != []) "with-libraries-"}${version}"; + pname = "urn${optionalString (extraLibraries != []) "-with-libraries"}"; + inherit version; src = fetchFromGitLab { owner = "urn"; diff --git a/pkgs/development/interpreters/chibi/default.nix b/pkgs/development/interpreters/chibi/default.nix index c0ee8988c094..4a8b639071ab 100644 --- a/pkgs/development/interpreters/chibi/default.nix +++ b/pkgs/development/interpreters/chibi/default.nix @@ -1,18 +1,8 @@ { lib, stdenv, fetchFromGitHub, makeWrapper }: -let - version = "0.10"; - name = "chibi-scheme-${version}"; -in -stdenv.mkDerivation { - inherit name; - meta = { - homepage = "https://github.com/ashinn/chibi-scheme"; - description = "Small Footprint Scheme for use as a C Extension Language"; - platforms = lib.platforms.all; - license = lib.licenses.bsd3; - maintainers = [ lib.maintainers.DerGuteMoritz ]; - }; +stdenv.mkDerivation rec { + version = "0.10"; + pname = "chibi-scheme"; src = fetchFromGitHub { owner = "ashinn"; @@ -36,4 +26,12 @@ stdenv.mkDerivation { --replace "/usr/bin/env chibi-scheme" "$out/bin/chibi-scheme" done ''; + + meta = { + homepage = "https://github.com/ashinn/chibi-scheme"; + description = "Small Footprint Scheme for use as a C Extension Language"; + platforms = lib.platforms.all; + license = lib.licenses.bsd3; + maintainers = [ lib.maintainers.DerGuteMoritz ]; + }; } diff --git a/pkgs/development/interpreters/elixir/generic-builder.nix b/pkgs/development/interpreters/elixir/generic-builder.nix index 646fd70ff8f9..5f08386c9f51 100644 --- a/pkgs/development/interpreters/elixir/generic-builder.nix +++ b/pkgs/development/interpreters/elixir/generic-builder.nix @@ -25,7 +25,7 @@ in assert versionAtLeast (getVersion erlang) minimumOTPVersion; stdenv.mkDerivation ({ - name = "${baseName}-${version}"; + pname = "${baseName}"; inherit src version debugInfo; diff --git a/pkgs/development/interpreters/racket/minimal.nix b/pkgs/development/interpreters/racket/minimal.nix index e56945ed651d..b73cdaff5d3e 100644 --- a/pkgs/development/interpreters/racket/minimal.nix +++ b/pkgs/development/interpreters/racket/minimal.nix @@ -2,9 +2,10 @@ }: racket.overrideAttrs (oldAttrs: rec { - name = "racket-minimal-${oldAttrs.version}"; + pname = "racket-minimal"; + version = oldAttrs.version; src = oldAttrs.src.override { - inherit name; + name = "${pname}-${version}"; sha256 = "sha256-FZlUWvjtioe4S8gPetj7vdneVX6jEFguJo4j2wJsKAw="; }; diff --git a/pkgs/development/java-modules/m2install.nix b/pkgs/development/java-modules/m2install.nix index d0a13f62520f..f223e205220d 100644 --- a/pkgs/development/java-modules/m2install.nix +++ b/pkgs/development/java-modules/m2install.nix @@ -2,15 +2,15 @@ { version, artifactId, groupId, sha512, type ? "jar", suffix ? "" }: let - name = "${artifactId}-${version}"; m2Path = "${builtins.replaceStrings ["."] ["/"] groupId}/${artifactId}/${version}"; - m2File = "${name}${suffix}.${type}"; + m2File = "${artifactId}-${version}${suffix}.${type}"; src = fetchurl { inherit sha512; url = "mirror://maven/${m2Path}/${m2File}"; }; in stdenv.mkDerivation { - inherit name m2Path m2File src; + inherit version m2Path m2File src; + pname = artifactId; dontUnpack = true; diff --git a/pkgs/development/libraries/CGAL/4.nix b/pkgs/development/libraries/CGAL/4.nix index a1d3c183b8e2..7380a85248fe 100644 --- a/pkgs/development/libraries/CGAL/4.nix +++ b/pkgs/development/libraries/CGAL/4.nix @@ -2,7 +2,7 @@ stdenv.mkDerivation rec { version = "4.14.2"; - name = "cgal-" + version; + pname = "cgal"; src = fetchFromGitHub { owner = "CGAL"; From a65471fb258eac5101a7226d686040276d44eadf Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Mon, 7 Mar 2022 18:01:47 +0100 Subject: [PATCH 2/2] gnome-breeze: switch to fetchFromGitHub --- pkgs/data/themes/gnome-breeze/default.nix | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/pkgs/data/themes/gnome-breeze/default.nix b/pkgs/data/themes/gnome-breeze/default.nix index f3eff34e9e6f..38733590a34e 100644 --- a/pkgs/data/themes/gnome-breeze/default.nix +++ b/pkgs/data/themes/gnome-breeze/default.nix @@ -1,13 +1,16 @@ -{ lib, stdenv, fetchgit }: +{ lib, stdenv, fetchFromGitHub }: stdenv.mkDerivation { pname = "gnome-breeze"; version = "unstable-2016-05-26"; - src = fetchgit { - url = "https://github.com/dirruk1/gnome-breeze"; - sha256 = "0hkk0gqlnrs1m4rb5r84f5y96qfamrbiwm09z89yc32124x1a1lm"; + + src = fetchFromGitHub { + owner = "dirruk1"; + repo = "gnome-breeze"; rev = "49a5cd67a270e13a4c04a4b904f126ef728e9221"; + sha256 = "sha256-lQYVOhFBDOYT+glUHleuymGTfHEE5bIyqUFnS/EDc0I="; }; + installPhase = '' mkdir -p $out/share/themes cp -r Breeze* $out/share/themes @@ -15,12 +18,12 @@ stdenv.mkDerivation { preferLocalBuild = true; - meta = { + meta = with lib; { description = "A GTK theme built to match KDE's breeze theme"; homepage = "https://github.com/dirruk1/gnome-breeze"; - license = lib.licenses.lgpl2; - maintainers = with lib.maintainers; [ bennofs ]; - platforms = lib.platforms.all; + license = licenses.lgpl2; + maintainers = with maintainers; [ bennofs ]; + platforms = platforms.all; hydraPlatforms = []; }; }