2023-05-21 16:05:31 +02:00
|
|
|
{ buildFHSEnv
|
2022-11-22 14:59:09 +01:00
|
|
|
, symlinkJoin
|
|
|
|
, bottles-unwrapped
|
|
|
|
, extraPkgs ? pkgs: [ ]
|
|
|
|
, extraLibraries ? pkgs: [ ]
|
|
|
|
}:
|
|
|
|
|
|
|
|
let fhsEnv = {
|
2023-07-01 12:02:15 +02:00
|
|
|
# Many WINE games need 32bit
|
|
|
|
multiArch = true;
|
|
|
|
|
2022-11-22 14:59:09 +01:00
|
|
|
targetPkgs = pkgs: with pkgs; [
|
|
|
|
bottles-unwrapped
|
2022-12-20 14:11:54 +01:00
|
|
|
# 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
|
2022-11-22 14:59:09 +01:00
|
|
|
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
|
|
|
|
];
|
2023-09-21 10:07:26 +02:00
|
|
|
gstreamerDeps = pkgs: with pkgs.gst_all_1; [
|
|
|
|
gstreamer
|
|
|
|
gst-plugins-base
|
|
|
|
gst-plugins-good
|
|
|
|
gst-plugins-ugly
|
|
|
|
gst-plugins-bad
|
|
|
|
gst-libav
|
|
|
|
];
|
2022-11-22 14:59:09 +01:00
|
|
|
in
|
|
|
|
pkgs: with pkgs; [
|
|
|
|
# https://wiki.winehq.org/Building_Wine
|
|
|
|
alsa-lib
|
|
|
|
cups
|
|
|
|
dbus
|
|
|
|
fontconfig
|
|
|
|
freetype
|
|
|
|
glib
|
|
|
|
gnutls
|
|
|
|
libglvnd
|
|
|
|
gsm
|
|
|
|
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
|
2023-09-21 10:07:26 +02:00
|
|
|
++ gstreamerDeps pkgs
|
2022-11-22 14:59:09 +01:00
|
|
|
++ extraLibraries pkgs;
|
|
|
|
};
|
|
|
|
in
|
|
|
|
symlinkJoin {
|
|
|
|
name = "bottles";
|
|
|
|
paths = [
|
2023-04-11 15:59:32 +02:00
|
|
|
(buildFHSEnv (fhsEnv // { name = "bottles"; runScript = "bottles"; }))
|
|
|
|
(buildFHSEnv (fhsEnv // { name = "bottles-cli"; runScript = "bottles-cli"; }))
|
2022-11-22 14:59:09 +01:00
|
|
|
];
|
|
|
|
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;
|
|
|
|
}
|