Skip to content

Commit

Permalink
himalaya: 1.0.0-beta.4 -> 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
soywod committed Jan 11, 2025
1 parent 0a85603 commit 76df726
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 31 deletions.
2 changes: 2 additions & 0 deletions nixos/doc/manual/release-notes/rl-2505.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@

- `nodePackages.copy-webpack-plugin` has been removed, as it should be installed in projects that use it instead.

- `himalaya` has been updated from `v1.0.0-beta.4` to `v1.1.0`, which introduces breaking changes. Check out the [release notes](https://github.com/pimalaya/himalaya/releases) for details.

- `linuxPackages.nvidiaPackages.dc_520` has been removed since it is marked broken and there are better newer alternatives.

- `programs.less.lessopen` is now null by default. To restore the previous behaviour, set it to `''|${lib.getExe' pkgs.lesspipe "lesspipe.sh"} %s''`.
Expand Down
79 changes: 48 additions & 31 deletions pkgs/by-name/hi/himalaya/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,65 +2,82 @@
, rustPlatform
, fetchFromGitHub
, stdenv
, buildPackages
, pkg-config
, darwin
, apple-sdk
, installShellFiles
, installShellCompletions ? stdenv.buildPlatform.canExecute stdenv.hostPlatform
, installManPages ? stdenv.buildPlatform.canExecute stdenv.hostPlatform
, notmuch
, gpgme
, buildNoDefaultFeatures ? false
, buildFeatures ? []
}:
, withNoDefaultFeatures ? buildNoDefaultFeatures
, withFeatures ? buildFeatures
}@args:

rustPlatform.buildRustPackage rec {
# Learn more about available cargo features at:
# - <https://pimalaya.org/himalaya/cli/latest/installation.html#cargo>
inherit buildNoDefaultFeatures buildFeatures;
let
version = "1.1.0";
hash = "sha256-gdrhzyhxRHZkALB3SG/aWOdA5iMYkel3Cjk5VBy3E4M=";
cargoHash = "sha256-MLPXcPA90YZY55jwC7XUZ6KVJf4Pn8w19iT5E2HqZV0=";

noDefaultFeatures = lib.warnIf
(args ? buildNoDefaultFeatures)
"buildNoDefaultFeatures is deprecated in favour of withNoDefaultFeatures and will be removed in the next release"
withNoDefaultFeatures;

features = lib.warnIf
(args ? buildFeatures)
"buildFeatures is deprecated in favour of withFeatures and will be removed in the next release"
withFeatures;
in

rustPlatform.buildRustPackage {
inherit version cargoHash;

pname = "himalaya";
version = "1.0.0-beta.4";

src = fetchFromGitHub {
owner = "soywod";
repo = pname;
inherit hash;
owner = "pimalaya";
repo = "himalaya";
rev = "v${version}";
hash = "sha256-NrWBg0sjaz/uLsNs8/T4MkUgHOUvAWRix1O5usKsw6o=";
};

cargoHash = "sha256-YS8IamapvmdrOPptQh2Ef9Yold0IK1XIeGs0kDIQ5b8=";

NIX_LDFLAGS = lib.optionals stdenv.hostPlatform.isDarwin [
"-F${darwin.apple_sdk.frameworks.AppKit}/Library/Frameworks"
"-framework"
"AppKit"
];
buildNoDefaultFeatures = noDefaultFeatures;
buildFeatures = features;

nativeBuildInputs = [ pkg-config ]
++ lib.optional (builtins.elem "pgp-gpg" buildFeatures) pkg-config
++ lib.optional (installManPages || installShellCompletions) installShellFiles;

buildInputs = [ ]
++ lib.optionals stdenv.hostPlatform.isDarwin (with darwin.apple_sdk.frameworks; [ AppKit Cocoa Security ])
++ lib.optional (builtins.elem "notmuch" buildFeatures) notmuch
++ lib.optional (builtins.elem "pgp-gpg" buildFeatures) gpgme;
++ lib.optional stdenv.hostPlatform.isDarwin apple-sdk
++ lib.optional (builtins.elem "notmuch" withFeatures) notmuch
++ lib.optional (builtins.elem "pgp-gpg" withFeatures) gpgme;

# most of the tests are lib side
doCheck = false;

postInstall = lib.optionalString installManPages ''
mkdir -p $out/man
$out/bin/himalaya man $out/man
installManPage $out/man/*
postInstall = let emulator = stdenv.hostPlatform.emulator buildPackages; in ''
mkdir -p $out/share/{applications,completions,man}
cp assets/himalaya.desktop "$out"/share/applications/
${emulator} "$out"/bin/himalaya man "$out"/share/man
${emulator} "$out"/bin/himalaya completion bash > "$out"/share/completions/himalaya.bash
${emulator} "$out"/bin/himalaya completion elvish > "$out"/share/completions/himalaya.elvish
${emulator} "$out"/bin/himalaya completion fish > "$out"/share/completions/himalaya.fish
${emulator} "$out"/bin/himalaya completion powershell > "$out"/share/completions/himalaya.powershell
${emulator} "$out"/bin/himalaya completion zsh > "$out"/share/completions/himalaya.zsh
'' + lib.optionalString installManPages ''
installManPage "$out"/share/man/*
'' + lib.optionalString installShellCompletions ''
installShellCompletion --cmd himalaya \
--bash <($out/bin/himalaya completion bash) \
--fish <($out/bin/himalaya completion fish) \
--zsh <($out/bin/himalaya completion zsh)
installShellCompletion "$out"/share/completions/himalaya.{bash,fish,zsh}
'';

meta = with lib; {
description = "CLI to manage emails";
mainProgram = "himalaya";
homepage = "https://pimalaya.org/himalaya/cli/latest/";
changelog = "https://github.com/soywod/himalaya/blob/v${version}/CHANGELOG.md";
homepage = "https://github.com/pimalaya/himalaya";
changelog = "https://github.com/pimalaya/himalaya/blob/v${version}/CHANGELOG.md";
license = licenses.mit;
maintainers = with maintainers; [ soywod toastal yanganto ];
};
Expand Down

0 comments on commit 76df726

Please sign in to comment.