diff --git a/CHANGELOG.md b/CHANGELOG.md index bfc8a428..02eef70b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/default.nix b/default.nix index f8add8b6..ab1e81a0 100644 --- a/default.nix +++ b/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" ] +) diff --git a/package.nix b/package.nix index 5a2fede8..92eb3002 100644 --- a/package.nix +++ b/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 + ]; }; } diff --git a/shell.nix b/shell.nix index 5dc322a9..6e10a292 100644 --- a/shell.nix +++ b/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" ])