To reproduce:
$ nix run nixpkgs/3b32825de172d0bc85664f495edb096b10862524#ast-grep \
-- scan --update-all --inline-rules '
id: nix-x86_64-darwin
language: nix
rule:
any:
- pattern: "\"x86_64-darwin\""
kind: list_expression > string_expression
- pattern:
context: "{ \"x86_64-darwin\" = $EXPR; }"
selector: binding
- pattern:
context: "{ x86_64-darwin = $EXPR; }"
selector: binding
fix:
template: ""
' pkgs
$ nix run nixpkgs/3b32825de172d0bc85664f495edb096b10862524#ast-grep \
-- scan --update-all --inline-rules '
id: json-first-x86_64-darwin
language: json
rule:
kind: object > pair:nth-child(1)
has:
pattern: "\"x86_64-darwin\""
field: key
fix:
template: ""
expandEnd: { regex: "," }
' pkgs
$ nix run nixpkgs/3b32825de172d0bc85664f495edb096b10862524#ast-grep \
-- scan --update-all --inline-rules '
id: json-x86_64-darwin
language: json
rule:
kind: object > pair
has:
pattern: "\"x86_64-darwin\""
field: key
fix:
template: ""
expandStart: { regex: "," }
' pkgs
$ git restore pkgs/by-name/om/omnix/package.nix
$ git diff --name-only -z \
| nix shell nixpkgs/3b32825de172d0bc85664f495edb096b10862524#gnused \
-c xargs -0 sed -i '/^$/N; /^\n\? \+$/d'
$ treefmt
153 lines
3.3 KiB
Nix
153 lines
3.3 KiB
Nix
{
|
|
stdenv_32bit,
|
|
lib,
|
|
pkgs,
|
|
pkgsi686Linux,
|
|
pkgsCross,
|
|
callPackage,
|
|
replaceVars,
|
|
moltenvk,
|
|
src,
|
|
pnameSuffix ? "",
|
|
useStaging ? false,
|
|
# Staging native build deps
|
|
autoconf,
|
|
hexdump,
|
|
perl,
|
|
python3,
|
|
gitMinimal,
|
|
...
|
|
}@args:
|
|
|
|
let
|
|
inherit (src)
|
|
version
|
|
patches
|
|
gecko32
|
|
gecko64
|
|
mono
|
|
;
|
|
|
|
llvm-mingw = callPackage ./llvm-mingw.nix { };
|
|
|
|
# Args to pass through to base.nix (support flags, etc.)
|
|
baseArgs = removeAttrs args [
|
|
"stdenv_32bit"
|
|
"lib"
|
|
"pkgs"
|
|
"pkgsi686Linux"
|
|
"pkgsCross"
|
|
"callPackage"
|
|
"replaceVars"
|
|
];
|
|
in
|
|
{
|
|
wine32 = pkgsi686Linux.callPackage ./base.nix (
|
|
baseArgs
|
|
// {
|
|
pname = "wine";
|
|
inherit version patches;
|
|
# Forcing these `nativeBuildInputs` used in the `staging` to come
|
|
# from ambient `pkgs`, rather than being provided by
|
|
# `pkgsi686Linux.callPackage` for that platform.
|
|
inherit
|
|
autoconf
|
|
hexdump
|
|
perl
|
|
python3
|
|
gitMinimal
|
|
;
|
|
pkgArches = [ pkgsi686Linux ];
|
|
geckos = [ gecko32 ];
|
|
mingwGccs = with pkgsCross; [ mingw32.buildPackages.gcc ];
|
|
monos = [ mono ];
|
|
platforms = [
|
|
"i686-linux"
|
|
"x86_64-linux"
|
|
];
|
|
}
|
|
);
|
|
wine64 = callPackage ./base.nix (
|
|
baseArgs
|
|
// {
|
|
pname = "wine64";
|
|
inherit version patches;
|
|
pkgArches = [ pkgs ];
|
|
mingwGccs =
|
|
if pkgs.stdenv.hostPlatform.isAarch64 then
|
|
[ llvm-mingw ]
|
|
else
|
|
with pkgsCross; [ mingwW64.buildPackages.gcc ];
|
|
geckos = [ gecko64 ];
|
|
monos = [ mono ];
|
|
configureFlags =
|
|
if pkgs.stdenv.hostPlatform.isAarch64 then [ "--enable-archs=aarch64" ] else [ "--enable-win64" ];
|
|
platforms = [
|
|
"x86_64-linux"
|
|
"aarch64-linux"
|
|
];
|
|
mainProgram = "wine";
|
|
}
|
|
);
|
|
wineWow = callPackage ./base.nix (
|
|
baseArgs
|
|
// {
|
|
pname = "wine-wow";
|
|
inherit version patches;
|
|
stdenv = stdenv_32bit;
|
|
pkgArches = [
|
|
pkgs
|
|
pkgsi686Linux
|
|
];
|
|
geckos = [
|
|
gecko32
|
|
gecko64
|
|
];
|
|
mingwGccs = with pkgsCross; [
|
|
mingw32.buildPackages.gcc
|
|
mingwW64.buildPackages.gcc
|
|
];
|
|
monos = [ mono ];
|
|
buildScript = replaceVars ./builder-wow.sh {
|
|
# pkgconfig has trouble picking the right architecture
|
|
pkgconfig64remove = lib.makeSearchPathOutput "dev" "lib/pkgconfig" [
|
|
pkgs.glib
|
|
pkgs.gst_all_1.gstreamer
|
|
];
|
|
};
|
|
platforms = [ "x86_64-linux" ];
|
|
mainProgram = "wine";
|
|
}
|
|
);
|
|
wineWow64 = callPackage ./base.nix (
|
|
baseArgs
|
|
// {
|
|
pname = "wine-wow64";
|
|
inherit version patches;
|
|
mingwSupport = true; # Required because we request "--enable-archs=x86_64"
|
|
pkgArches = [ pkgs ];
|
|
mingwGccs =
|
|
if pkgs.stdenv.hostPlatform.isAarch64 then
|
|
[ llvm-mingw ]
|
|
else
|
|
with pkgsCross;
|
|
[
|
|
mingw32.buildPackages.gcc
|
|
mingwW64.buildPackages.gcc
|
|
];
|
|
geckos = [ gecko64 ];
|
|
monos = [ mono ];
|
|
configureFlags =
|
|
if pkgs.stdenv.hostPlatform.isAarch64 then
|
|
[ "--enable-archs=aarch64,x86_64,i386" ]
|
|
else
|
|
[ "--enable-archs=x86_64,i386" ];
|
|
platforms = [
|
|
"x86_64-linux"
|
|
"aarch64-linux"
|
|
];
|
|
mainProgram = "wine";
|
|
}
|
|
);
|
|
}
|