diff --git a/lib/default.nix b/lib/default.nix index cb9a9b0bd4d08..547abce9dc0e6 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -24,10 +24,12 @@ let licenses = import ./licenses.nix; platforms = import ./platforms.nix; systems = import ./systems.nix; + releases = import ./releases.nix; # misc debug = import ./debug.nix; misc = import ./deprecated.nix; + deprecate = import ./deprecate.nix; # domain-specific sandbox = import ./sandbox.nix; @@ -38,8 +40,8 @@ in attrsets lists strings stringsWithDeps customisation maintainers meta sources modules options types - licenses platforms systems - debug misc + licenses platforms systems releases + debug misc deprecate sandbox fetchers; } # !!! don't include everything at top-level; perhaps only the most diff --git a/lib/deprecate.nix b/lib/deprecate.nix new file mode 100644 index 0000000000000..37b4244e4c8c7 --- /dev/null +++ b/lib/deprecate.nix @@ -0,0 +1,19 @@ +# deprecation functions + +let + releases = import ./releases.nix; + trivial = import ./trivial.nix; + +in +{ + warnRenamed = { + oldName + , newName + , reason + , removedAt ? releases.next + }: trivial.warn '' + "${oldName}" has been renamed to "${newName}". + It will be removed in ${releases.asString removedAt}. + Reason: ${reason} + ''; +} diff --git a/lib/releases.nix b/lib/releases.nix new file mode 100644 index 0000000000000..c7f9334007b0f --- /dev/null +++ b/lib/releases.nix @@ -0,0 +1,22 @@ +# nixpkgs/nixos release information +rec { + + # formatting releases + asString = { + name + , releaseDate + }: "${name} (release date ${releaseDate})"; + + next = nixos-17-first; + + nixos-17-first = { + name = "NixOS 17.?"; + releaseDate = "early 2017"; + }; + + "nixos-16.09" = { + name = "NixOS 16.09"; + releaseDate = "2016-10-03"; + }; + +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b10ef48212848..77395fddf705a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -13838,7 +13838,13 @@ in opusfile = callPackage ../applications/audio/opusfile { }; - opusTools = callPackage ../applications/audio/opus-tools { }; + opusTools = lib.deprecate.warnRenamed { + oldName = "opusTools"; + newName = "opus-tools"; + removedAt = lib.releases.next; + reason = "Consistency with vorbis-tools"; + } opus-tools; + opus-tools = callPackage ../applications/audio/opus-tools { }; orpie = callPackage ../applications/misc/orpie { gsl = gsl_1; };