2020-06-05 10:08:28 +01:00
|
|
|
{ stdenv, lib, fetchFromGitHub, rustPlatform, libiconv, llvmPackages, v8 }:
|
2016-12-03 22:36:48 +00:00
|
|
|
|
2020-01-08 14:01:08 +00:00
|
|
|
rustPlatform.buildRustPackage rec {
|
2019-08-31 12:41:23 +01:00
|
|
|
pname = "rq";
|
2020-01-08 14:01:08 +00:00
|
|
|
version = "1.0.2";
|
2016-12-03 22:36:48 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "dflemstr";
|
2020-01-08 14:01:08 +00:00
|
|
|
repo = pname;
|
2016-12-03 22:36:48 +00:00
|
|
|
rev = "v${version}";
|
2020-01-08 14:01:08 +00:00
|
|
|
sha256 = "0km9d751jr6c5qy4af6ks7nv3xfn13iqi03wq59a1c73rnf0zinp";
|
2016-12-03 22:36:48 +00:00
|
|
|
};
|
|
|
|
|
2021-05-07 12:00:49 +01:00
|
|
|
cargoSha256 = "0071q08f75qrxdkbx1b9phqpbj15r79jbh391y32acifi7hr35hj";
|
2016-12-03 22:36:48 +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 09:23:57 +01:00
|
|
|
buildInputs = [ llvmPackages.libclang v8 ]
|
2020-06-05 10:08:28 +01:00
|
|
|
++ lib.optionals stdenv.isDarwin [ libiconv ];
|
2016-12-03 22:36:48 +00:00
|
|
|
|
2021-05-02 21:30:41 +01:00
|
|
|
postPatch = ''
|
|
|
|
# Remove #[deny(warnings)] which is equivalent to -Werror in C.
|
|
|
|
# Prevents build failures when upgrading rustc, which may give more warnings.
|
|
|
|
substituteInPlace src/lib.rs \
|
|
|
|
--replace "#![deny(warnings)]" ""
|
|
|
|
'';
|
|
|
|
|
2016-12-03 22:36:48 +00:00
|
|
|
configurePhase = ''
|
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 09:23:57 +01:00
|
|
|
export LIBCLANG_PATH="${llvmPackages.libclang.lib}/lib"
|
2016-12-03 22:36:48 +00:00
|
|
|
export V8_SOURCE="${v8}"
|
|
|
|
'';
|
|
|
|
|
2020-01-08 14:01:08 +00:00
|
|
|
meta = with lib; {
|
2016-12-03 22:36:48 +00:00
|
|
|
description = "A tool for doing record analysis and transformation";
|
2020-01-08 14:01:08 +00:00
|
|
|
homepage = "https://github.com/dflemstr/rq";
|
2016-12-03 22:36:48 +00:00
|
|
|
license = with licenses; [ asl20 ];
|
2020-11-17 11:02:06 +00:00
|
|
|
maintainers = with maintainers; [ aristid Br1ght0ne ];
|
2016-12-03 22:36:48 +00:00
|
|
|
};
|
|
|
|
}
|