kiss-flatpak

Flatpak for KISS Linux.
git clone https://git.stjo.hn/kiss-flatpak
Log | Files | Refs | README | LICENSE

flatpak-alsa.patch (6910B)


      1 diff --git a/common/flatpak-context-private.h b/common/flatpak-context-private.h
      2 index 8a56537..61b5cda 100644
      3 --- a/common/flatpak-context-private.h
      4 +++ b/common/flatpak-context-private.h
      5 @@ -50,6 +50,7 @@ typedef enum {
      6    FLATPAK_CONTEXT_DEVICE_ALL         = 1 << 1,
      7    FLATPAK_CONTEXT_DEVICE_KVM         = 1 << 2,
      8    FLATPAK_CONTEXT_DEVICE_SHM         = 1 << 3,
      9 +  FLATPAK_CONTEXT_DEVICE_SND         = 1 << 4,
     10  } FlatpakContextDevices;
     11  
     12  typedef enum {
     13 diff --git a/common/flatpak-context.c b/common/flatpak-context.c
     14 index 34510c1..f3dafec 100644
     15 --- a/common/flatpak-context.c
     16 +++ b/common/flatpak-context.c
     17 @@ -70,6 +70,7 @@ const char *flatpak_context_devices[] = {
     18    "all",
     19    "kvm",
     20    "shm",
     21 +  "snd",
     22    NULL
     23  };
     24  
     25 diff --git a/common/flatpak-run.c b/common/flatpak-run.c
     26 index 7d916eb..7b932fc 100644
     27 --- a/common/flatpak-run.c
     28 +++ b/common/flatpak-run.c
     29 @@ -1718,6 +1718,13 @@ flatpak_run_add_environment_args (FlatpakBwrap    *bwrap,
     30                                    "--bind", shared_dev_shm, "/dev/shm",
     31                                    NULL);
     32          }
     33 +
     34 +      if (context->devices & FLATPAK_CONTEXT_DEVICE_SND)
     35 +        {
     36 +          g_debug ("Allowing snd access");
     37 +          if (g_file_test ("/dev/snd", G_FILE_TEST_IS_DIR))
     38 +            flatpak_bwrap_add_args (bwrap, "--dev-bind", "/dev/snd", "/dev/snd", NULL);
     39 +        }
     40      }
     41  
     42    exports = flatpak_context_get_exports_full (context,
     43 diff --git a/doc/flatpak-build-finish.xml b/doc/flatpak-build-finish.xml
     44 index b2b138f..454f3d8 100644
     45 --- a/doc/flatpak-build-finish.xml
     46 +++ b/doc/flatpak-build-finish.xml
     47 @@ -162,7 +162,7 @@
     48                  <listitem><para>
     49                      Expose a device to the application. This updates
     50                      the [Context] group in the metadata.
     51 -                    DEVICE must be one of: dri, kvm, shm, all.
     52 +                    DEVICE must be one of: dri, kvm, shm, snd, all.
     53                      This option can be used multiple times.
     54                  </para></listitem>
     55              </varlistentry>
     56 @@ -173,7 +173,7 @@
     57                  <listitem><para>
     58                      Don't expose a device to the application. This updates
     59                      the [Context] group in the metadata.
     60 -                    DEVICE must be one of: dri, kvm, shm, all.
     61 +                    DEVICE must be one of: dri, kvm, shm, snd, all.
     62                      This option can be used multiple times.
     63                  </para></listitem>
     64              </varlistentry>
     65 diff --git a/doc/flatpak-build.xml b/doc/flatpak-build.xml
     66 index a48e2ac..1e1aece 100644
     67 --- a/doc/flatpak-build.xml
     68 +++ b/doc/flatpak-build.xml
     69 @@ -172,7 +172,7 @@
     70                  <listitem><para>
     71                      Expose a device to the application. This overrides to
     72                      the Context section from the application metadata.
     73 -                    <arg choice="plain">DEVICE</arg> must be one of: dri, kvm, shm, all.
     74 +                    <arg choice="plain">DEVICE</arg> must be one of: dri, kvm, shm, snd, all.
     75                      This option can be used multiple times.
     76                  </para></listitem>
     77              </varlistentry>
     78 @@ -183,7 +183,7 @@
     79                  <listitem><para>
     80                      Don't expose a device to the application. This overrides to
     81                      the Context section from the application metadata.
     82 -                    <arg choice="plain">DEVICE</arg> must be one of: dri, kvm, shm, all.
     83 +                    <arg choice="plain">DEVICE</arg> must be one of: dri, kvm, shm, snd, all.
     84                      This option can be used multiple times.
     85                  </para></listitem>
     86              </varlistentry>
     87 diff --git a/doc/flatpak-metadata.xml b/doc/flatpak-metadata.xml
     88 index 2d853ad..b83118d 100644
     89 --- a/doc/flatpak-metadata.xml
     90 +++ b/doc/flatpak-metadata.xml
     91 @@ -182,6 +182,13 @@
     92                                  Available since 0.6.12.
     93                              </para></listitem></varlistentry>
     94  
     95 +                            <varlistentry><term><option>snd</option></term>
     96 +                            <listitem><para>
     97 +                                Sound
     98 +                                (<filename>/dev/snd</filename>).
     99 +                                Available since 1.6.2.
    100 +                            </para></listitem></varlistentry>
    101 +
    102                              <varlistentry><term><option>all</option></term>
    103                              <listitem><para>
    104                                  All device nodes in <filename>/dev</filename>, but not /dev/shm (which is separately specified).
    105 diff --git a/doc/flatpak-override.xml b/doc/flatpak-override.xml
    106 index ed1ba52..aa14efb 100644
    107 --- a/doc/flatpak-override.xml
    108 +++ b/doc/flatpak-override.xml
    109 @@ -154,7 +154,7 @@
    110                  <listitem><para>
    111                      Expose a device to the application. This overrides to
    112                      the Context section from the application metadata.
    113 -                    <arg choice="plain">DEVICE</arg> must be one of: dri, kvm, shm, all.
    114 +                    <arg choice="plain">DEVICE</arg> must be one of: dri, kvm, shm, snd, all.
    115                      This option can be used multiple times.
    116                  </para></listitem>
    117              </varlistentry>
    118 @@ -165,7 +165,7 @@
    119                  <listitem><para>
    120                      Don't expose a device to the application. This overrides to
    121                      the Context section from the application metadata.
    122 -                    <arg choice="plain">DEVICE</arg> must be one of: dri, kvm, shm, all.
    123 +                    <arg choice="plain">DEVICE</arg> must be one of: dri, kvm, shm, snd, all.
    124                      This option can be used multiple times.
    125                  </para></listitem>
    126              </varlistentry>
    127 diff --git a/doc/flatpak-run.xml b/doc/flatpak-run.xml
    128 index 90df07e..90d34ab 100644
    129 --- a/doc/flatpak-run.xml
    130 +++ b/doc/flatpak-run.xml
    131 @@ -301,7 +301,7 @@
    132                  <listitem><para>
    133                      Expose a device to the application. This overrides to
    134                      the Context section from the application metadata.
    135 -                    <arg choice="plain">DEVICE</arg> must be one of: dri, kvm, shm, all.
    136 +                    <arg choice="plain">DEVICE</arg> must be one of: dri, kvm, shm, snd, all.
    137                      This option can be used multiple times.
    138                  </para></listitem>
    139              </varlistentry>
    140 @@ -312,7 +312,7 @@
    141                  <listitem><para>
    142                      Don't expose a device to the application. This overrides to
    143                      the Context section from the application metadata.
    144 -                    <arg choice="plain">DEVICE</arg> must be one of: dri, kvm, shm, all.
    145 +                    <arg choice="plain">DEVICE</arg> must be one of: dri, kvm, shm, snd, all.
    146                      This option can be used multiple times.
    147                  </para></listitem>
    148              </varlistentry>