Commit Graph

61 Commits

Author SHA1 Message Date
Reno Dakota
52bf1163fa
treewide: use getLib when accessing clang / libclang / stdenv.cc.cc
In preparation to eliminate the lib output for the unwrapped clang, use
`lib.getLib` to access the `lib` output.
2024-11-07 10:27:41 +00:00
Artturin
e0464e4788 treewide: replace stdenv.is with stdenv.hostPlatform.is
In preparation for the deprecation of `stdenv.isX`.

These shorthands are not conducive to cross-compilation because they
hide the platforms.

Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way

One example of why this is bad and especially affects compiler packages
https://www.github.com/NixOS/nixpkgs/pull/343059

There are too many files to go through manually but a treewide should
get users thinking when they see a `hostPlatform.isX` in a place where it
doesn't make sense.

```
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is"
fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is"
```
2024-09-25 00:04:37 +03:00
Adam Joseph
bbb42450c5 default-crate-overrides: proc-macro-crate assumes env::var("CARGO")
Since version 2.0.0, proc-macro-crate has assumed it can exec()
`env::var("CARGO")` in order to run `cargo locate-project`.

This commit adds a crate override to proc-macro-crate which simply writes the
path to buildPlatform.cargo into the proc-macro-crate sources.

This way we don't need to set `env.CARGO` for every build that depends on
proc-macro-crate -- if we do that, the $CARGO environment variable would be
visible to the entire build.  This could potentially lead to incredibly
hard-to-troubleshoot heisenbugs if there is some other crate that expects
`env::var("CARGO")` to exist -- that other crate would mysteriously work only
in projects that use proc-macro-crate but not anywhere else!
2024-08-23 09:36:47 +03:00
Florian Klink
9e3825de8d defaultCrateOverrides: add extraLinkFlags to zlib
These libraries need zlib, and otherwise cause a linker error when
linking the final crate of a tauri/wry project.
2024-07-09 18:12:38 +03:00
Florian Klink
0c00ad14ac defaultCrateOverrides: fix some gtk dependencies
- gobject-sys and gio-sys need pkg-config
 - add gtkx11-sys
 - add javascriptcore-rs-sys
 - add soup3-sys
 - add webkit2gtk-sys
2024-07-06 00:05:43 +03:00
Ilan Joselevich
b561a29e4d
defaultCrateOverrides: add missing protobuf to crates 2024-06-21 18:21:39 +03:00
Adam Joseph
2ea678ed48 default-crate-overrides: add libseat-sys
This is needed for building `cosmic-comp` using `crate2nix` instead
of `buildRustPackage` (like
https://github.com/NixOS/nixpkgs/pull/251365/ does).
2023-08-26 01:08:29 -07:00
Artturin
9999bf7a21 treewide: gobject-introspection from buildInputs to nativeBuildInputs
gobject-introspection should be in nativeBuildInputs for cross to work
properly (so propagations and hook work properly)
2023-06-28 22:33:40 +03:00
Artturi
5fd9ce4fa7
Merge pull request #190610 from amjoseph-nixpkgs/pr/build-rust-crate/gdk3 2023-04-22 15:45:56 +03:00
Adam Joseph
579b812b0e https://github.com/NixOS/nixpkgs/pull/224893#pullrequestreview-1375521876 2023-04-06 13:43:22 -07:00
Adam Joseph
482b61e142 default-crate-overrides.nix: prevent git fetch
The build.rs script shipped with evdev-sys attempts to detect cross
compilation and uses a completely different codepath which does a
`git fetch` inside the build script.  This doesn't work in nixpkgs.

This PR adds a `touch libevdev/.git` to trick the `build.rs` into
thinking that it is not necessary to do a `git fetch`.

Thanks to @figsoda for finding this more-elegant solution to the
problem (my original solution needed to patch `build.rs`):

  https://github.com/NixOS/nixpkgs/pull/224893#pullrequestreview-1373809617

Tested on:
- [x] `aarch64-linux` (cross from `x86_64-linux`)
2023-04-06 13:05:07 -07:00
Adam Joseph
476fde08af default-crate-overrides.nix: prost-build needs protobuf 2023-04-05 15:40:17 -07:00
Adam Joseph
f1bce90517 default-crate-overrides.nix: add gtk-sys (gtk3) 2023-01-15 15:43:47 -08:00
Adam Joseph
9297b5382f
default-crate-overrides.nix: add graphene-sys 2023-01-13 16:43:39 +00:00
Adam Joseph
e40de94c42 default-crate-overrides: add pkg-config to evdev-sys 2023-01-13 16:31:15 +00:00
Adam Joseph
62d571148a default-crate-overrides: servo-fontconfig-sys needs fontconfig 2023-01-13 16:18:27 +00:00
Artturi
f93a244d7c
Merge pull request #190613 from amjoseph-nixpkgs/pr/build-rust-crate/atk 2022-12-27 19:49:40 +02:00
Artturi
c584919520
Merge pull request #190614 from amjoseph-nixpkgs/pr/build-rust-crate/pangocairo 2022-12-27 19:48:23 +02:00
Artturi
3cb4b5cac4
Merge pull request #190603 from amjoseph-nixpkgs/pr/build-rust-crate/g_k4 2022-12-27 19:37:35 +02:00
Adam Joseph
b1a9bf530c
default-crate-overrides.nix: add pango-sys (#190604) 2022-12-27 19:36:30 +02:00
Artturi
88eb7d5d3f
Merge pull request #186761 from amjoseph-nixpkgs/pr/rust/default-crate-overrides/fix 2022-12-27 19:35:06 +02:00
Artturi
c1deac22a5
Merge pull request #190602 from amjoseph-nixpkgs/pr/build-rust-crate/cairo-sys-rs 2022-12-27 19:32:13 +02:00
Amneesh Singh
74de121572
default-crate-overrides: add alsa-lib for alsa-sys crate
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
2022-10-18 00:03:14 +05:30
Adam Joseph
31e5930b57 default-crate-overrides.nix: add pangocairo-sys 2022-09-10 02:06:30 -07:00
Adam Joseph
2ab5cfe7ce default-crate-overrides.nix: import pango 2022-09-10 02:06:29 -07:00
Adam Joseph
02de33cacd default-crate-overrides.nix: add atk-sys 2022-09-09 19:51:43 -07:00
Adam Joseph
c804cea71d default-crate-overrides.nix: add {gtk4,gdk4,gsk4}-sys 2022-09-09 18:58:59 -07:00
Adam Joseph
4ceec72751 default-crate-overrides.nix: add cairo-sys-rs 2022-09-09 18:58:21 -07:00
Adam Joseph
6d9a490980 default-crate-overrides.nix: remove unnecessary attrs from previous commit
Sorry, I should have removed these before submitting https://github.com/NixOS/nixpkgs/pull/186748
2022-08-15 01:08:13 -07:00
Adam Joseph
58e5bd56d6 default-crate-overrides.nix: add libevdev for evdev-rs 2022-08-14 21:20:55 -07:00
Yusuf Bera Ertan
e2a3a3c690
default-crate-overrides: only add Security to propagatedBuildInputs on darwin for security-framework-sys 2022-04-28 21:24:46 +03:00
Kerstin Humm
5df2d4d345
default-crate-overrides: remove two crates that are probably irrelevant 2021-10-27 22:29:10 +02:00
Kerstin Humm
f1bacf5b07 default-crate-overrides: expat-sys, glib-sys, libudev-sys, sdl2-sys, servo-fontconfig, skia-bindings 2021-10-28 03:07:33 +09:00
Bruno Bigras
c426b46aee defaultCrateOverrides: add rdkafka-sys 2021-09-21 12:07:25 -04:00
happysalada
c9f0c6f115 build-rust-crate: add global libiconv darwin buildInputs 2021-09-04 12:03:36 +09:00
happysalada
0e8d59e3cb default-crate-overrides: nixpkgs-fmt 2021-09-04 12:03:36 +09:00
tekeri
2419ea4aff rust: fix build of pam-sys package 2021-08-15 15:55:20 +09:00
Andrew Childs
7869d16545 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
  db29857eb3, 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)`
2021-04-30 05:41:00 +00:00
Pavol Rusnak
90f7338112
treewide: stdenv.lib -> lib 2021-01-24 01:49:49 +01:00
Justin Humm
9038cc62fd
defaultCrateOverrides: override crates necessary for building sequoia
See https://git.sr.ht/~erictapen/sequoia for a flake using these
overrides.
2021-01-08 17:27:43 +01:00
Justin Humm
9df8a98fac
defaultCrateOverrides: pkgconfig -> pkg-config 2021-01-08 17:26:05 +01:00
Ben Wolsieffer
a0e7613509 defaultCrateOverrides: move pkgconfig to nativeBuildInputs
This fixes cross-compiling.
2020-09-28 19:47:52 -04:00
Mario Rodas
aed74e8284
cargo-vendor: drop
Cargo 1.37 imported `cargo-vendor` as built-in command [1]

[1] https://github.com/rust-lang/cargo/pull/6869
2019-09-22 20:20:20 -05:00
worldofpeace
b1bc0645ea gdk-pixbuf: rename from gdk_pixbuf 2019-07-22 18:50:57 -04:00
Andreas Rammhold
1bb989ca70 cargo-vendor: fix build on Darwin
This is supposedly fixing the build of the cargo crate on Drawin [1].

[1] https://github.com/NixOS/nixpkgs/pull/57017#pullrequestreview-228868016
2019-04-21 12:11:54 +02:00
Andreas Rammhold
2e2f7cba90 cargo: fix build on Darwin
This is supposedly fixing the build of the cargo crate on Drawin [1].

[1] https://github.com/NixOS/nixpkgs/pull/57017#pullrequestreview-228868016
2019-04-21 12:11:54 +02:00
Alexander Krupenkin
a4902a33bf cargo-vendor: 0.1.13 -> 0.1.23 2019-04-21 12:11:54 +02:00
Austin Seipp
04a543b3a0 defaultCrateOverrides: foundationdb native dependencies
Signed-off-by: Austin Seipp <aseipp@pobox.com>
2018-11-17 19:28:48 -06:00
Jörg Thalheim
96c627b3f6
defaultCrateOverrides: add serde_derive 2018-10-28 21:59:19 +00:00
Jörg Thalheim
e0a5689528
defaultCrateOverrides: order alphabetically 2018-10-28 21:55:26 +00:00