Skip to content

Commit

Permalink
chore: Update libarchive to version 3.7.4, add bzip2 dependency, and …
Browse files Browse the repository at this point in the history
…install openssl library
  • Loading branch information
royshil committed Jun 24, 2024
1 parent 486fd35 commit bcfc731
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
22 changes: 14 additions & 8 deletions cmake/BuildLibarchive.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ if(WIN32)
target_include_directories(libbzip2 INTERFACE ${bzip2_SOURCE_DIR})
set_property(TARGET libbzip2 PROPERTY IMPORTED_LOCATION ${bzip2_SOURCE_DIR}/libbz2-static.lib)

# get openssl precompiled from https://wiki.overbyte.eu/arch/openssl-1.1.1w-win64.zip
FetchContent_Declare(openssl URL "https://wiki.overbyte.eu/arch/openssl-1.1.1w-win64.zip")
FetchContent_MakeAvailable(openssl)

set(LIBARCHIVE_VERSION 3.7.4)
set(LIBARCHIVE_URL
"https://github.com/libarchive/libarchive/releases/download/v${LIBARCHIVE_VERSION}/libarchive-v${LIBARCHIVE_VERSION}-amd64.zip"
Expand All @@ -31,14 +35,16 @@ if(WIN32)
PROPERTY IMPORTED_LOCATION
${libarchive-build_SOURCE_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}archive${CMAKE_SHARED_LIBRARY_SUFFIX})
add_dependencies(libarchive::libarchive libarchive-build)
if(WIN32)
set_property(
TARGET libarchive::libarchive
PROPERTY IMPORTED_IMPLIB
${libarchive-build_SOURCE_DIR}/lib/${CMAKE_IMPORT_LIBRARY_PREFIX}archive${CMAKE_IMPORT_LIBRARY_SUFFIX})
install(FILES ${libarchive-build_SOURCE_DIR}/bin/${CMAKE_SHARED_LIBRARY_PREFIX}archive${CMAKE_SHARED_LIBRARY_SUFFIX}
DESTINATION ${CMAKE_SOURCE_DIR}/release/$<CONFIG>/obs-plugins/64bit)
endif()

set_property(
TARGET libarchive::libarchive
PROPERTY IMPORTED_IMPLIB
${libarchive-build_SOURCE_DIR}/lib/${CMAKE_IMPORT_LIBRARY_PREFIX}archive${CMAKE_IMPORT_LIBRARY_SUFFIX})

install(FILES ${libarchive-build_SOURCE_DIR}/bin/${CMAKE_SHARED_LIBRARY_PREFIX}archive${CMAKE_SHARED_LIBRARY_SUFFIX}
DESTINATION ${CMAKE_SOURCE_DIR}/release/$<CONFIG>/obs-plugins/64bit)
install(FILES ${openssl_SOURCE_DIR}/libcrypto-1_1-x64${CMAKE_SHARED_LIBRARY_SUFFIX}
DESTINATION ${CMAKE_SOURCE_DIR}/release/$<CONFIG>/obs-plugins/64bit)

target_link_libraries(libarchive INTERFACE libarchive::libarchive libbzip2)
else()
Expand Down
5 changes: 5 additions & 0 deletions src/squawk-source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,11 @@ obs_properties_t *squawk_source_properties(void *data)
// add boolean propery for enabling phonetic transcription
obs_properties_add_bool(ppts, "phonetic_transcription", "Phonetic Transcription");

// add plugin info
char small_info[256];
snprintf(small_info, sizeof(small_info), PLUGIN_INFO_TEMPLATE, PLUGIN_VERSION);
obs_properties_add_text(ppts, "plugin_info", small_info, OBS_TEXT_INFO);

return ppts;
}

Expand Down
5 changes: 5 additions & 0 deletions src/squawk-source.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ void squawk_source_deactivate(void *data);
void squawk_source_show(void *data);
void squawk_source_hide(void *data);

const char *const PLUGIN_INFO_TEMPLATE =
"<a href=\"https://github.com/occ-ai/obs-squawk/\">Squawk</a> (%s) by "
"<a href=\"https://github.com/occ-ai\">OCC AI</a> ❤️ "
"<a href=\"https://www.patreon.com/RoyShilkrot\">Support & Follow</a>";

#ifdef __cplusplus
}
#endif

0 comments on commit bcfc731

Please sign in to comment.