Skip to content

Commit

Permalink
change directory structure for Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
sorayuki committed Dec 2, 2023
1 parent 511deff commit d0db508
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 9 deletions.
13 changes: 8 additions & 5 deletions .github/scripts/.package.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,10 @@ ${_usage_host:-}"
local -a cmake_args=()
if (( _loglevel > 1 )) cmake_args+=(--verbose)
log_group "Creating source tarball for ${product_name}..."
pushd ${project_root}
cmake --build build_${target##*-} --config ${config} -t package_source ${cmake_args}
popd
# log_group "Creating source tarball for ${product_name}..."
# pushd ${project_root}
# cmake --build build_${target##*-} --config ${config} -t package_source ${cmake_args}
# popd
if (( package )) {
log_group "Packaging ${product_name}..."
Expand All @@ -259,7 +259,10 @@ ${_usage_host:-}"
if (( _loglevel > 1 || ${+CI} )) _tarflags="v${_tarflags}"
pushd ${project_root}/release/${config}
XZ_OPT=-T0 tar "-${_tarflags}" ${project_root}/release/${output_name}.tar.xz (lib|share)
# XZ_OPT=-T0 tar "-${_tarflags}" ${project_root}/release/${output_name}.tar.xz (lib|share)
XZ_OPT=-T0 tar --transform='s#dist#.var/app/com.obsproject.Studio/config#' "-${_tarflags}" ${project_root}/release/${output_name}-flatpak.tar.xz dist
XZ_OPT=-T0 tar --transform='s#dist#.config#' "-${_tarflags}" ${project_root}/release/${output_name}.tar.xz dist
popd
}
log_group
Expand Down
30 changes: 26 additions & 4 deletions cmake/linux/helpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ include_guard(GLOBAL)

include(helpers_common)

set(DIST_ROOT_IN_CONFIG obs-studio/plugins/${CMAKE_PROJECT_NAME})

# set_target_properties_plugin: Set target properties for use in obs-studio
function(set_target_properties_plugin target)
set(options "")
Expand All @@ -24,10 +26,23 @@ function(set_target_properties_plugin target)
SOVERSION ${PLUGIN_VERSION}
PREFIX "")

# install(
# TARGETS ${target}
# RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
# LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/obs-plugins)

if (${CMAKE_SIZEOF_VOID_P} EQUAL 4)
set(OBSARCHNAME "32bit")
elseif (${CMAKE_SIZEOF_VOID_P} EQUAL 8)
set(OBSARCHNAME "64bit")
else ()
message(FATAL_ERROR "Unsupport architecture")
endif()

install(
TARGETS ${target}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/obs-plugins)
RUNTIME DESTINATION dist/${DIST_ROOT_IN_CONFIG}/bin/${OBSARCHNAME}
LIBRARY DESTINATION dist/${DIST_ROOT_IN_CONFIG}/bin/${OBSARCHNAME})

if(TARGET plugin-support)
target_link_libraries(${target} PRIVATE plugin-support)
Expand Down Expand Up @@ -57,9 +72,14 @@ function(target_install_resources target)
source_group("Resources/${relative_path}" FILES "${data_file}")
endforeach()

# install(
# DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/data/"
# DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/obs/obs-plugins/${target}
# USE_SOURCE_PERMISSIONS)

install(
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/data/"
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/obs/obs-plugins/${target}
DESTINATION dist/${DIST_ROOT_IN_CONFIG}/data
USE_SOURCE_PERMISSIONS)
endif()
endfunction()
Expand All @@ -68,7 +88,9 @@ endfunction()
function(target_add_resource target resource)
message(DEBUG "Add resource '${resource}' to target ${target} at destination '${target_destination}'...")

install(FILES "${resource}" DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/obs/obs-plugins/${target})
# install(FILES "${resource}" DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/obs/obs-plugins/${target})

install(FILES "${resource}" DESTINATION dist/${DIST_ROOT_IN_CONFIG}/data)

source_group("Resources" FILES "${resource}")
endfunction()

0 comments on commit d0db508

Please sign in to comment.