Commit bc448e7f authored by Anderson Torres's avatar Anderson Torres
Browse files

micro: tidy up the package

Basically, removing all references to clipboard things.
The idea is to wrap them later in another derivation.
parent 03a8d4ed
Loading
Loading
Loading
Loading
+14 −33
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  buildGoModule,
  callPackage,
  fetchFromGitHub,
  installShellFiles,
  callPackage,
  wl-clipboard,
  xclip,
  makeWrapper,
  # Boolean flags
  withXclip ? stdenv.isLinux,
  withWlClipboard ?
    if withWlclip != null then
      lib.warn ''
        withWlclip is deprecated and will be removed;
        use withWlClipboard instead.
      '' withWlclip
    else
      stdenv.isLinux,
  stdenv,
  # Deprecated options
  # Remove them before or right after next version update from Nixpkgs or this
  # package itself
  # Remove them as soon as possible
  withXclip ? null,
  withWlClipboard ? null,
  withWlclip ? null,
}:

@@ -38,10 +26,7 @@ let

    vendorHash = "sha256-ePhObvm3m/nT+7IyT0W6K+y+9UNkfd2kYjle2ffAd9Y=";

    nativeBuildInputs = [
      installShellFiles
      makeWrapper
    ];
    nativeBuildInputs = [ installShellFiles ];

    outputs = [
      "out"
@@ -73,17 +58,6 @@ let
      install -Dm644 assets/micro-logo-mark.svg $out/share/icons/hicolor/scalable/apps/micro.svg
    '';

    postFixup =
      let
        clipboardPackages =
          lib.optionals withXclip [ xclip ]
          ++ lib.optionals withWlClipboard [ wl-clipboard ];
      in
      lib.optionalString (withXclip || withWlClipboard) ''
        wrapProgram "$out/bin/micro" \
                  --prefix PATH : "${lib.makeBinPath clipboardPackages}"
      '';

    passthru = {
      tests = lib.packagesFromDirectoryRecursive {
        inherit callPackage;
@@ -114,4 +88,11 @@ let
    };
  };
in
self
lib.warnIf (withXclip != null || withWlClipboard != null || withWlclip != null) ''
  The options `withXclip`, `withWlClipboard`, `withWlclip` were removed. If
  you are seeking for clipboard support, please consider the following
  packages:
  - `micro-with-wl-clipboard`
  - `micro-with-xclip`
  - `micro-full`
'' self