mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 15:03:28 +00:00
{micro-full,micro-with-wl-clipboard,micro-with-xclip}: "init" (#339368)
This commit is contained in:
commit
e3232bf075
@ -1,26 +1,14 @@
|
||||
{
|
||||
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,22 +58,12 @@ 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;
|
||||
directory = ./tests;
|
||||
};
|
||||
wrapper = callPackage ./wrapper.nix { micro = self; };
|
||||
};
|
||||
|
||||
meta = {
|
||||
@ -114,4 +89,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
|
||||
|
33
pkgs/by-name/mi/micro/wrapper.nix
Normal file
33
pkgs/by-name/mi/micro/wrapper.nix
Normal file
@ -0,0 +1,33 @@
|
||||
{
|
||||
lib,
|
||||
micro,
|
||||
makeWrapper,
|
||||
symlinkJoin,
|
||||
# configurable options
|
||||
extraPackages ? [ ],
|
||||
}:
|
||||
|
||||
symlinkJoin {
|
||||
name = "micro-wrapped-${micro.version}";
|
||||
inherit (micro) pname version outputs;
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
|
||||
paths = [ micro ];
|
||||
|
||||
postBuild = ''
|
||||
${lib.concatMapStringsSep "\n" (
|
||||
output: "ln --verbose --symbolic --no-target-directory ${micro.${output}} \$${output}"
|
||||
) (lib.remove "out" micro.outputs)}
|
||||
|
||||
pushd $out/bin
|
||||
for f in *; do
|
||||
rm $f
|
||||
makeWrapper ${micro}/bin/$f $f \
|
||||
--prefix PATH ":" "${lib.makeBinPath extraPackages}"
|
||||
done
|
||||
popd
|
||||
'';
|
||||
|
||||
meta = micro.meta;
|
||||
}
|
@ -25097,6 +25097,25 @@ with pkgs;
|
||||
|
||||
meteor = callPackage ../servers/meteor { };
|
||||
|
||||
micro-full = micro.wrapper.override {
|
||||
extraPackages = [
|
||||
wl-clipboard
|
||||
xclip
|
||||
];
|
||||
};
|
||||
|
||||
micro-with-wl-clipboard = micro.wrapper.override {
|
||||
extraPackages = [
|
||||
wl-clipboard
|
||||
];
|
||||
};
|
||||
|
||||
micro-with-xclip = micro.wrapper.override {
|
||||
extraPackages = [
|
||||
xclip
|
||||
];
|
||||
};
|
||||
|
||||
micronaut = callPackage ../development/tools/micronaut { };
|
||||
|
||||
minio = callPackage ../servers/minio { };
|
||||
|
Loading…
Reference in New Issue
Block a user