2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv
|
2020-05-27 12:14:36 +00:00
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, llvmPackages
|
|
|
|
, openssl
|
|
|
|
, pkg-config
|
|
|
|
, installShellFiles
|
|
|
|
, Security
|
|
|
|
, gitMinimal
|
2020-11-24 15:29:28 +00:00
|
|
|
, util-linuxMinimal
|
2020-05-27 12:14:36 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
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 ]
|
2021-01-15 05:42:41 +00:00
|
|
|
++ lib.optional stdenv.isDarwin Security;
|
2020-11-24 15:29:28 +00:00
|
|
|
checkInputs = [ gitMinimal util-linuxMinimal ];
|
2020-05-27 12:14:36 +00:00
|
|
|
|
llvmPackages: Multuple outputs for everythting
Also begin to start work on cross compilation, though that will have to
be finished later.
The patches are based on the first version of
https://reviews.llvm.org/D99484. It's very annoying to do the
back-porting but the review has uncovered nothing super major so I'm
fine sticking with what I've got.
Beyond making the outputs work, I also strove to re-sync the packages,
as they have been drifting pointlessly apart for some time.
----
Other misc notes, highly incomplete
- lvm-config-native and llvm-config are put in `dev` because they are
tools just for build time.
- Clang no longer has an lld dep. That was introduced in
db29857eb391ed002046090851a44c452b80bdbd, but if clang needs help
finding lld when it is used we should just pass it flags / put in the
resource dir. Providing it at build time increases critical path
length for no good reason.
----
A note on `nativeCC`:
`stdenv` takes tools from the previous stage, so:
1. `pkgsBuildBuild`: `(?1, x, x)`
2. `pkgsBuildBuild.stdenv.cc`: `(?0, ?1, x)`
while:
1. `pkgsBuildBuild`: `(?1, x, x)`
2. `pkgsBuildBuild.targetPackages`: `(x, x, ?2)`
3. `pkgsBuildBuild.targetPackages.stdenv.cc`: `(?1, x, x)`
2020-10-15 08:23:57 +00:00
|
|
|
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
|
2020-05-27 12:14:36 +00:00
|
|
|
|
2021-05-07 11:00:49 +00:00
|
|
|
cargoSha256 = "1vnrc72g2271i2p847z30kplxmdpi60n3dzpw0s7dahg33g14ai6";
|
2020-05-27 12:14:36 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-05-27 12:14:36 +00:00
|
|
|
description = "Commandline personal information management suite";
|
|
|
|
homepage = "https://imag-pim.org/";
|
|
|
|
license = licenses.lgpl21;
|
2020-11-17 11:02:06 +00:00
|
|
|
maintainers = with maintainers; [ Br1ght0ne minijackson ];
|
2020-05-27 12:14:36 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|