From 35ea33f20be3ef4f0f2a65a5da956c2c8c417521 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Fri, 11 Oct 2024 06:58:31 +0100 Subject: [PATCH] wine: restore the eval on linux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without the change the instantiation in `linux` fails as: $ nix-instantiate -A wine error: … while calling the 'derivationStrict' builtin at :34:12: 33| 34| strict = derivationStrict drvAttrs; | ^ 35| … while evaluating derivation 'wine-9.0' whose name attribute is located at /tmp/z/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:336:7 … while evaluating attribute 'NIX_LDFLAGS' of derivation 'wine-9.0' at /tmp/z/nixpkgs/pkgs/applications/emulators/wine/base.nix:121:3: 120| # LD_LIBRARY_PATH. 121| NIX_LDFLAGS = toString (map (path: "-rpath " + path) ( | ^ 122| map (x: "${lib.getLib x}/lib") ([ stdenv.cc.cc ] (stack trace truncated; use '--show-trace' to show the full, detailed trace) error: Package ‘apple-sdk-14.4’ in /tmp/z/nixpkgs/pkgs/by-name/ap/apple-sdk/package.nix:111 is not available on the requested hostPlatform: hostPlatform.config = "i686-unknown-linux-gnu" package.meta.platforms = [ "x86_64-darwin" "i686-darwin" "aarch64-darwin" "armv7a-darwin" ] package.meta.badPlatforms = [ { cpu = { bits = 32; }; } ] , refusing to evaluate. a) To temporarily allow packages that are unsupported for this system, you can use an environment variable for a single invocation of the nix tools. $ export NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1 Note: When using `nix shell`, `nix build`, `nix develop`, etc with a flake, then pass `--impure` in order to allow use of environment variables. b) For `nixos-rebuild` you can set { nixpkgs.config.allowUnsupportedSystem = true; } in configuration.nix to override this. c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add { allowUnsupportedSystem = true; } to ~/.config/nixpkgs/config.nix. --- pkgs/applications/emulators/wine/base.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/emulators/wine/base.nix b/pkgs/applications/emulators/wine/base.nix index 7c4ca01acb59..a5f45b2e13e7 100644 --- a/pkgs/applications/emulators/wine/base.nix +++ b/pkgs/applications/emulators/wine/base.nix @@ -25,7 +25,7 @@ let # Using the 14.4 SDK allows Wine to use `os_sync_wait_on_address` for its futex implementation on Darwin. # It does an availability check, so older systems will still work. - darwinFrameworks = toBuildInputs pkgArches (pkgs: [ pkgs.apple-sdk_14 ]); + darwinFrameworks = lib.optionals stdenv.hostPlatform.isDarwin (toBuildInputs pkgArches (pkgs: [ pkgs.apple-sdk_14 ])); # Building Wine with these flags isn’t supported on Darwin. Using any of them will result in an evaluation failures # because they will put Darwin in `meta.badPlatforms`.