1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-22 05:31:22 +00:00
nixpkgs/pkgs/applications/misc/imag/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

64 lines
1.6 KiB
Nix

{ lib, stdenv
, rustPlatform
, fetchFromGitHub
, llvmPackages
, openssl
, pkg-config
, installShellFiles
, Security
, gitMinimal
, util-linuxMinimal
}:
rustPlatform.buildRustPackage rec {
pname = "imag";
version = "0.10.1";
src = fetchFromGitHub {
owner = "matthiasbeyer";
repo = pname;
rev = "v${version}";
sha256 = "0f9915f083z5qqcxyavj0w6m973c8m1x7kfb89pah5agryy5mkaq";
};
nativeBuildInputs = [ installShellFiles pkg-config ];
buildInputs = [ openssl ]
++ stdenv.lib.optional stdenv.isDarwin Security;
checkInputs = [ gitMinimal util-linuxMinimal ];
LIBCLANG_PATH = "${llvmPackages.libclang}/lib";
cargoSha256 = "0n8cw70qh8g4hfwfaxwwxbrrx5hm2z037z8kdhvdpqkxljl9189x";
checkPhase = ''
export HOME=$TMPDIR
git config --global user.email "nobody@example.com"
git config --global user.name "Nobody"
# UI tests uses executables directly, so we need to build them before
# launching the tests
cargo build
'' + (
# CLI uses the presence of a controlling TTY to check if arguments are
# passed in stdin, or in the command-line, so we use script to create
# a PTY for us.
if !stdenv.isDarwin then ''
script -qfec "cargo test --workspace"
'' else ''
script -q "cargo test --workspace"
''
);
postInstall = ''
installShellCompletion target/imag.{bash,fish} --zsh target/_imag
'';
meta = with lib; {
description = "Commandline personal information management suite";
homepage = "https://imag-pim.org/";
license = licenses.lgpl21;
maintainers = with maintainers; [ Br1ght0ne minijackson ];
platforms = platforms.unix;
};
}