anvil-editor: init at 0.4
[NixPkgs.git] / pkgs / applications / misc / bottles / fhsenv.nix
blob1bd476a136c64197c72b1ef06f0ad7eb7044f9d5
2   buildFHSEnv,
3   symlinkJoin,
4   bottles-unwrapped,
5   extraPkgs ? pkgs: [ ],
6   extraLibraries ? pkgs: [ ],
7 }:
9 let
10   fhsEnv = {
11     # Many WINE games need 32bit
12     multiArch = true;
14     targetPkgs =
15       pkgs:
16       with pkgs;
17       [
18         bottles-unwrapped
19         # This only allows to enable the toggle, vkBasalt won't work if not installed with environment.systemPackages (or nix-env)
20         # See https://github.com/bottlesdevs/Bottles/issues/2401
21         vkbasalt
22       ]
23       ++ extraPkgs pkgs;
25     multiPkgs =
26       let
27         xorgDeps =
28           pkgs: with pkgs.xorg; [
29             libpthreadstubs
30             libSM
31             libX11
32             libXaw
33             libxcb
34             libXcomposite
35             libXcursor
36             libXdmcp
37             libXext
38             libXi
39             libXinerama
40             libXmu
41             libXrandr
42             libXrender
43             libXv
44             libXxf86vm
45           ];
46         gstreamerDeps =
47           pkgs: with pkgs.gst_all_1; [
48             gstreamer
49             gst-plugins-base
50             gst-plugins-good
51             gst-plugins-ugly
52             gst-plugins-bad
53             gst-libav
54           ];
55       in
56       pkgs:
57       with pkgs;
58       [
59         # https://wiki.winehq.org/Building_Wine
60         alsa-lib
61         cups
62         dbus
63         fontconfig
64         freetype
65         glib
66         gnutls
67         libglvnd
68         gsm
69         libgphoto2
70         libjpeg_turbo
71         libkrb5
72         libpcap
73         libpng
74         libpulseaudio
75         libtiff
76         libunwind
77         libusb1
78         libv4l
79         libxml2
80         mpg123
81         ocl-icd
82         openldap
83         samba4
84         sane-backends
85         SDL2
86         udev
87         vulkan-loader
89         # https://www.gloriouseggroll.tv/how-to-get-out-of-wine-dependency-hell/
90         alsa-plugins
91         dosbox
92         giflib
93         gtk3
94         libva
95         libxslt
96         ncurses
97         openal
99         # Steam runtime
100         libgcrypt
101         libgpg-error
102         p11-kit
103         zlib # Freetype
104       ]
105       ++ xorgDeps pkgs
106       ++ gstreamerDeps pkgs
107       ++ extraLibraries pkgs;
108   };
110 symlinkJoin {
111   name = "bottles";
112   paths = [
113     (buildFHSEnv (
114       fhsEnv
115       // {
116         name = "bottles";
117         runScript = "bottles";
118       }
119     ))
120     (buildFHSEnv (
121       fhsEnv
122       // {
123         name = "bottles-cli";
124         runScript = "bottles-cli";
125       }
126     ))
127   ];
128   postBuild = ''
129     mkdir -p $out/share
130     ln -s ${bottles-unwrapped}/share/applications $out/share
131     ln -s ${bottles-unwrapped}/share/icons $out/share
132   '';
134   inherit (bottles-unwrapped) meta;