about summary refs log tree commit diff
path: root/pkgs/development/haskell-modules/patches/portmidi-alsa-plugins.patch
blob: 13860b7cfb7f3a12da5c9fd2205acf7acf0ff6bc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
diff -Naurd PortMidi-0.2.0.0/portmidi/pm_linux/pmlinuxalsa.c PortMidi-0.2.0.0-alsafix/portmidi/pm_linux/pmlinuxalsa.c
--- PortMidi-0.2.0.0/portmidi/pm_linux/pmlinuxalsa.c	2023-12-13 11:35:12.517413022 +0000
+++ PortMidi-0.2.0.0-alsafix/portmidi/pm_linux/pmlinuxalsa.c	2023-12-13 11:35:12.565413037 +0000
@@ -719,6 +719,18 @@
 }
 
 
+static void set_alsa_plugin_path( void )
+{
+    char *existing;
+
+    existing = getenv("ALSA_PLUGIN_DIR");
+    if (NULL != existing) {
+        return;
+    }
+    setenv("ALSA_PLUGIN_DIR", "@alsa_plugin_dir@", 0);
+}
+
+
 PmError pm_linuxalsa_init( void )
 {
     int  err;
@@ -726,6 +738,8 @@
     snd_seq_port_info_t *pinfo;
     unsigned int caps;
 
+    set_alsa_plugin_path();
+
     /* Previously, the last parameter was SND_SEQ_NONBLOCK, but this 
      * would cause messages to be dropped if the ALSA buffer fills up.
      * The correct behavior is for writes to block until there is