Ticket #494: slv2-haiku.patch

File slv2-haiku.patch, 933 bytes (added by zanga.mail@…, 12 years ago)

Default path on Haiku

  • src/world.c

    diff -Naur slv2.old/src/world.c slv2/src/world.c
    old new  
    3333#include <dlfcn.h>
    3434#endif
    3535
     36#ifdef __HAIKU__
     37#include <FindDirectory.h>
     38#include <fs_info.h>
     39#endif
    3640
    3741/* private */
    3842static SLV2World
     
    588592#ifdef __APPLE__
    589593            const char* const suffix = "/Library/Audio/Plug-Ins/LV2:/Library/Audio/Plug-Ins/LV2"
    590594                ":/usr/local/lib/lv2:/usr/lib/lv2";
     595#elif defined(__HAIKU__)
     596
     597#define LV2_HAIKU_SYSTEM_DIR    "/boot/common/add-ons/lv2"
     598
     599            char suffix[B_PATH_NAME_LENGTH + B_FILE_NAME_LENGTH + sizeof("/.lv2") + 1 + sizeof(LV2_HAIKU_SYSTEM_DIR) + 1];
     600            find_directory(B_USER_DIRECTORY, 0, false, suffix, B_PATH_NAME_LENGTH + B_FILE_NAME_LENGTH);
     601            strcat(suffix, "/.lv2:" LV2_HAIKU_SYSTEM_DIR);
    591602#else
    592603            const char* const suffix = "/.lv2:/usr/local/lib/lv2:/usr/lib/lv2";
    593604#endif