!ayCRiZriCVtuCUpeLp:nixos.org

Nix Cross Compiling

580 Members
126 Servers

Load older messages


SenderMessageTime
17 Mar 2025
@rhelmot:matrix.orgrhelmotthanks for the hints, after a bit of tentative hacking I have cast qt5 into the shadow realm and am now building with qt607:46:50
@rhelmot:matrix.orgrhelmoton the gtk side, I got pkgsCross.x86_64-freebsd.xfce.xfdesktop to build while on a 14 hours trans-pacific flight...07:48:13
@rhelmot:matrix.orgrhelmot * on the gtk side, I got pkgsCross.x86_64-freebsd.xfce.xfdesktop to build while on a 14 hour trans-pacific flight... 07:48:23
@rhelmot:matrix.orgrhelmotif only gitlab.freedesktop.org were up... this could truly be the year of the freebsd desktop07:48:54
18 Mar 2025
@axman6:matrix.orgAxman6 Is there an easy way to make a wrapper for a binary which executes it using hostPlatform.emulator? 01:03:34
@artturin:matrix.orgArtturin
In reply to @axman6:matrix.org
Is there an easy way to make a wrapper for a binary which executes it using hostPlatform.emulator?

Yes

https://github.com/NixOS/nixpkgs/blob/fcd099251655af6f7c935df9baf72b5963f33e86/pkgs/tools/admin/winbox/default.nix#L50 (here src is a exe)

https://github.com/search?q=repo%3ANixOS%2Fnixpkgs+%2FmakeWrapper.%2Bjre%2F&type=code

01:11:47
@axman6:matrix.orgAxman6 right - so you'd use something makeWrapper ${hostPlatform.emulator buildPackages} --args ${package}/bin/foo? 01:21:41
@artturin:matrix.orgArtturin You're forgetting the destination path, and it's --add-flags 01:28:37
@axman6:matrix.orgAxman6uh, yep - I should've just copied and pasted what I wrote in my derivation =)03:55:04
@fzakaria:one.ems.hostfzakaria joined the room.05:01:17
@fzakaria:one.ems.hostfzakaria 👋
is there a stdenv for musl without using pkgsMusl ?
05:01:34
@rosscomputerguy:matrix.orgTristan Ross No 05:11:42
@rosscomputerguy:matrix.orgTristan RossBut I have plans for things of that nature05:11:50
@rosscomputerguy:matrix.orgTristan Ross It'll be some time but I'm working on decoupling things in a way that allows up to swap out toolchain related things more ad-hoc with {host,build,target}Platform. 05:12:38
@fzakaria:one.ems.hostfzakariaoh thtat's cool; I have some really bad Nix code trying to build some stuff very specifically in musl19:16:06
@fzakaria:one.ems.hostfzakariato avoid "mass rebuilds" -- it's so fragile. I tried moving things to overlay and too much borked19:16:18
19 Mar 2025
@xokdvium:matrix.orgSergei Zimmerman (xokdvium) changed their display name from xokdvium to Sergei Zimmerman (xokdvium).21:12:18
21 Mar 2025
@domenkozar:matrix.orgDomen Kožar changed their profile picture.11:41:12
24 Mar 2025
@rhelmot:matrix.orgrhelmotI'm having trouble parsing the logic behind hostOffset in setup hooks. Is the idea that if I'm currently running for a package that was brought in as a buildInput it'll be 0 and if it's a nativeBuildInput it'll be 1?01:52:53
@Ericson2314:matrix.orgJohn Ericson-1 for native build input iirc?03:09:34
@Ericson2314:matrix.orgJohn EricsonBut I could forget 03:09:38
26 Mar 2025
@rosssmyth:matrix.orgrosssmyth

Is there an example somewhere of where multilib + crosspkgs is broken? From #380325

What would it take to fix it?

18:57:13
@stephen:crabsin.spacen3tcat joined the room.18:57:22
@stephen:crabsin.spacen3tcat 19:00:25
@stephen:crabsin.spacen3tcat 19:01:16
@stephen:crabsin.spacen3tcat

Hello! I'm new to cross-compiling on NixOS. I want to compile C code for my custom M68k computer.

This is what my flake.nix file currently looks like:

{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    flake-utils.url = "github:numtide/flake-utils?ref=main";
  };

  outputs =
    inputs:
    inputs.flake-utils.lib.eachDefaultSystem (
      system:
      let
        pkgs = inputs.nixpkgs.legacyPackages.${system};
      in
        {
          devShells.default = pkgs.mkShell {
            packages = (
              with pkgs; [
                minipro
                gnumake
                pkgsCross.m68k.buildPackages.gcc
                xxd
              ]
            );
          };
        }
    );
}

I think I want to remove the pkgsCross.m68k line and add in crossSystem pointing at this patch from K900: https://github.com/K900/nixpkgs/commit/e8d4e76093cd396805e76c908734a351cc6d1f39
But I'm not really clear on what I'm actually doing (plus I want my other packages to not be cross-compiled as I want to run them on my x86 box)

19:04:42
@k900:0upti.meK900Easiest is probably to just cherry-pick that patch into your own nixpkgs fork19:06:20
@k900:0upti.meK900And then it should work19:06:25
@k900:0upti.meK900I think19:06:26
@stephen:crabsin.spacen3tcatI guess I don't really know what needs to go in the flake.nix file to start, even if I point it at my custom nixpkgs repo19:06:49

Show newer messages


Back to Room ListRoom Version: 6