mirror of
https://github.com/soywod/himalaya.git
synced 2025-04-16 22:33:36 +00:00
build(nix): fix darwin x86_64 build
Also re-format nix codes with nixfmt-rfc-style. Refs: #538
This commit is contained in:
parent
9d773e947b
commit
0f6217e6e5
4 changed files with 81 additions and 56 deletions
|
@ -17,17 +17,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
Since logs are sent to `stderr`, warnings can be easily discarded by prepending commands with `RUST_LOG=off` or by appending commands with `2>/dev/null`.
|
||||
|
||||
- Changed `message.send.save-copy` default to `true` when omitted. [#536]
|
||||
- Changed `message.send.save-copy` default to `true`. [#536]
|
||||
|
||||
- Changed default downloads directory. [core#1]
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed permissions issues when using `install.sh`. [#515]
|
||||
|
||||
- Fixed de/serialization issues of backends' `none` variant. [#523]
|
||||
|
||||
- Fixed list envelopes out of bound error when empty result. [#535]
|
||||
- Fixed macOS x86_64 builds. [#538]
|
||||
|
||||
## [1.0.0] - 2024-12-09
|
||||
|
||||
|
@ -965,6 +964,7 @@ Few major concepts changed:
|
|||
[#523]: https://github.com/pimalaya/himalaya/issues/523
|
||||
[#535]: https://github.com/pimalaya/himalaya/issues/535
|
||||
[#536]: https://github.com/pimalaya/himalaya/issues/536
|
||||
[#538]: https://github.com/pimalaya/himalaya/issues/538
|
||||
|
||||
[core#1]: https://github.com/pimalaya/core/issues/1
|
||||
[core#10]: https://github.com/pimalaya/core/issues/10
|
||||
|
|
43
default.nix
43
default.nix
|
@ -1,16 +1,29 @@
|
|||
{ pimalaya ? import (fetchTarball "https://github.com/pimalaya/nix/archive/master.tar.gz")
|
||||
, ...
|
||||
} @args:
|
||||
{
|
||||
pimalaya ? import (fetchTarball "https://github.com/pimalaya/nix/archive/master.tar.gz"),
|
||||
...
|
||||
}@args:
|
||||
|
||||
pimalaya.mkDefault ({
|
||||
src = ./.;
|
||||
version = "1.0.0";
|
||||
mkPackage = ({ lib, pkgs, rustPlatform, defaultFeatures, features }: pkgs.callPackage ./package.nix {
|
||||
inherit lib rustPlatform;
|
||||
apple-sdk = if pkgs.hostPlatform.isx86_64 then pkgs.apple-sdk_13 else pkgs.apple-sdk_14;
|
||||
installShellCompletions = false;
|
||||
installManPages = false;
|
||||
buildNoDefaultFeatures = !defaultFeatures;
|
||||
buildFeatures = lib.splitString "," features;
|
||||
});
|
||||
} // removeAttrs args [ "pimalaya" ])
|
||||
pimalaya.mkDefault (
|
||||
{
|
||||
src = ./.;
|
||||
version = "1.0.0";
|
||||
mkPackage = (
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
rustPlatform,
|
||||
defaultFeatures,
|
||||
features,
|
||||
}:
|
||||
pkgs.callPackage ./package.nix {
|
||||
inherit lib rustPlatform;
|
||||
apple-sdk = pkgs.apple-sdk;
|
||||
installShellCompletions = false;
|
||||
installManPages = false;
|
||||
buildNoDefaultFeatures = !defaultFeatures;
|
||||
buildFeatures = lib.splitString "," features;
|
||||
}
|
||||
);
|
||||
}
|
||||
// removeAttrs args [ "pimalaya" ]
|
||||
)
|
||||
|
|
78
package.nix
78
package.nix
|
@ -1,19 +1,20 @@
|
|||
# TODO: move this to nixpkgs
|
||||
# This file aims to be a replacement for the nixpkgs derivation.
|
||||
|
||||
{ lib
|
||||
, pkg-config
|
||||
, rustPlatform
|
||||
, fetchFromGitHub
|
||||
, stdenv
|
||||
, apple-sdk
|
||||
, installShellFiles
|
||||
, installShellCompletions ? stdenv.buildPlatform.canExecute stdenv.hostPlatform
|
||||
, installManPages ? stdenv.buildPlatform.canExecute stdenv.hostPlatform
|
||||
, notmuch
|
||||
, gpgme
|
||||
, buildNoDefaultFeatures ? false
|
||||
, buildFeatures ? [ ]
|
||||
{
|
||||
lib,
|
||||
pkg-config,
|
||||
rustPlatform,
|
||||
fetchFromGitHub,
|
||||
stdenv,
|
||||
apple-sdk,
|
||||
installShellFiles,
|
||||
installShellCompletions ? stdenv.buildPlatform.canExecute stdenv.hostPlatform,
|
||||
installManPages ? stdenv.buildPlatform.canExecute stdenv.hostPlatform,
|
||||
notmuch,
|
||||
gpgme,
|
||||
buildNoDefaultFeatures ? false,
|
||||
buildFeatures ? [ ],
|
||||
}:
|
||||
|
||||
let
|
||||
|
@ -35,10 +36,12 @@ rustPlatform.buildRustPackage rec {
|
|||
rev = "v${version}";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ pkg-config ]
|
||||
++ lib.optional (installManPages || installShellCompletions) installShellFiles;
|
||||
nativeBuildInputs = [
|
||||
pkg-config
|
||||
] ++ lib.optional (installManPages || installShellCompletions) installShellFiles;
|
||||
|
||||
buildInputs = [ ]
|
||||
buildInputs =
|
||||
[ ]
|
||||
++ lib.optional stdenv.hostPlatform.isDarwin apple-sdk
|
||||
++ lib.optional (builtins.elem "notmuch" buildFeatures) notmuch
|
||||
++ lib.optional (builtins.elem "pgp-gpg" buildFeatures) gpgme;
|
||||
|
@ -49,22 +52,27 @@ rustPlatform.buildRustPackage rec {
|
|||
# unit tests only
|
||||
cargoTestFlags = [ "--lib" ];
|
||||
|
||||
postInstall = ''
|
||||
mkdir -p $out/share/{applications,completions,man}
|
||||
cp assets/himalaya.desktop "$out"/share/applications/
|
||||
'' + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
||||
"$out"/bin/himalaya man "$out"/share/man
|
||||
'' + lib.optionalString installManPages ''
|
||||
installManPage "$out"/share/man/*
|
||||
'' + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
||||
"$out"/bin/himalaya completion bash > "$out"/share/completions/himalaya.bash
|
||||
"$out"/bin/himalaya completion elvish > "$out"/share/completions/himalaya.elvish
|
||||
"$out"/bin/himalaya completion fish > "$out"/share/completions/himalaya.fish
|
||||
"$out"/bin/himalaya completion powershell > "$out"/share/completions/himalaya.powershell
|
||||
"$out"/bin/himalaya completion zsh > "$out"/share/completions/himalaya.zsh
|
||||
'' + lib.optionalString installShellCompletions ''
|
||||
installShellCompletion "$out"/share/completions/himalaya.{bash,fish,zsh}
|
||||
'';
|
||||
postInstall =
|
||||
''
|
||||
mkdir -p $out/share/{applications,completions,man}
|
||||
cp assets/himalaya.desktop "$out"/share/applications/
|
||||
''
|
||||
+ lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
||||
"$out"/bin/himalaya man "$out"/share/man
|
||||
''
|
||||
+ lib.optionalString installManPages ''
|
||||
installManPage "$out"/share/man/*
|
||||
''
|
||||
+ lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
||||
"$out"/bin/himalaya completion bash > "$out"/share/completions/himalaya.bash
|
||||
"$out"/bin/himalaya completion elvish > "$out"/share/completions/himalaya.elvish
|
||||
"$out"/bin/himalaya completion fish > "$out"/share/completions/himalaya.fish
|
||||
"$out"/bin/himalaya completion powershell > "$out"/share/completions/himalaya.powershell
|
||||
"$out"/bin/himalaya completion zsh > "$out"/share/completions/himalaya.zsh
|
||||
''
|
||||
+ lib.optionalString installShellCompletions ''
|
||||
installShellCompletion "$out"/share/completions/himalaya.{bash,fish,zsh}
|
||||
'';
|
||||
|
||||
meta = rec {
|
||||
description = "CLI to manage emails";
|
||||
|
@ -72,6 +80,10 @@ rustPlatform.buildRustPackage rec {
|
|||
homepage = "https://github.com/pimalaya/himalaya";
|
||||
changelog = "${homepage}/blob/v${version}/CHANGELOG.md";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [ soywod toastal yanganto ];
|
||||
maintainers = with lib.maintainers; [
|
||||
soywod
|
||||
toastal
|
||||
yanganto
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
10
shell.nix
10
shell.nix
|
@ -1,6 +1,6 @@
|
|||
{ pimalaya ? import (fetchTarball "https://github.com/pimalaya/nix/archive/master.tar.gz")
|
||||
, ...
|
||||
} @args:
|
||||
{
|
||||
pimalaya ? import (fetchTarball "https://github.com/pimalaya/nix/archive/master.tar.gz"),
|
||||
...
|
||||
}@args:
|
||||
|
||||
pimalaya.mkShell ({ rustToolchainFile = ./rust-toolchain.toml; }
|
||||
// removeAttrs args [ "pimalaya" ])
|
||||
pimalaya.mkShell ({ rustToolchainFile = ./rust-toolchain.toml; } // removeAttrs args [ "pimalaya" ])
|
||||
|
|
Loading…
Add table
Reference in a new issue