nixpkgs/pkgs/applications/misc/bottles/fhsenv.nix
Martino Fontana e19d87d2ec bottles: fix GStreamer on 32 bit apps
Because of the gst_all_1 input, 64 bit GStreamer was sneaking into the 32 bit libs.

Basically:
```nix
{ buildFHSEnv
, gst_all_1 # Because of this input...
}:
buildFHSEnv {
  multiPkgs = pkgs: with pkgs; {
    # This is both 32 bit and 64 bit
    hello

    # ...this is target arch only (bcause the `with pkgs;` doesn't apply in this case)
    gst_all_1.gst-plugins-base
  };
}
```

This commit removes the `gst_all_1` input to correct that.

Also removes setting `GST_PLUGIN_PATH`, as it doesn't seem necessary anymore.
(That env is the reason why I added the `gst_all_1` input and accidentally causing the issue in the first place. Ugh...)

Closes #207641.
2023-09-21 10:21:53 +02:00

110 lines
2.2 KiB
Nix

{ buildFHSEnv
, symlinkJoin
, bottles-unwrapped
, extraPkgs ? pkgs: [ ]
, extraLibraries ? pkgs: [ ]
}:
let fhsEnv = {
# Many WINE games need 32bit
multiArch = true;
targetPkgs = pkgs: with pkgs; [
bottles-unwrapped
# This only allows to enable the toggle, vkBasalt won't work if not installed with environment.systemPackages (or nix-env)
# See https://github.com/bottlesdevs/Bottles/issues/2401
vkbasalt
] ++ extraPkgs pkgs;
multiPkgs =
let
xorgDeps = pkgs: with pkgs.xorg; [
libpthreadstubs
libSM
libX11
libXaw
libxcb
libXcomposite
libXcursor
libXdmcp
libXext
libXi
libXinerama
libXmu
libXrandr
libXrender
libXv
libXxf86vm
];
in
pkgs: with pkgs; [
# https://wiki.winehq.org/Building_Wine
alsa-lib
cups
dbus
fontconfig
freetype
glib
gnutls
libglvnd
gsm
gst_all_1.gstreamer
gst_all_1.gst-plugins-base
gst_all_1.gst-plugins-good
gst_all_1.gst-plugins-ugly
gst_all_1.gst-plugins-bad
gst_all_1.gst-libav
libgphoto2
libjpeg_turbo
libkrb5
libpcap
libpng
libpulseaudio
libtiff
libunwind
libusb1
libv4l
libxml2
mpg123
ocl-icd
openldap
samba4
sane-backends
SDL2
udev
vulkan-loader
# https://www.gloriouseggroll.tv/how-to-get-out-of-wine-dependency-hell/
alsa-plugins
dosbox
giflib
gtk3
libva
libxslt
ncurses
openal
# Steam runtime
libgcrypt
libgpg-error
p11-kit
zlib # Freetype
] ++ xorgDeps pkgs
++ extraLibraries pkgs;
};
in
symlinkJoin {
name = "bottles";
paths = [
(buildFHSEnv (fhsEnv // { name = "bottles"; runScript = "bottles"; }))
(buildFHSEnv (fhsEnv // { name = "bottles-cli"; runScript = "bottles-cli"; }))
];
postBuild = ''
mkdir -p $out/share
ln -s ${bottles-unwrapped}/share/applications $out/share
ln -s ${bottles-unwrapped}/share/icons $out/share
'';
inherit (bottles-unwrapped) meta;
}