Merge pull request #104104 from starcraft66/obs-move-transition

obs-move-transition: init at 2.0.2
This commit is contained in:
Guillaume Girol 2020-11-20 20:29:16 +00:00 committed by GitHub
commit bfbfe33fd6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 96 additions and 0 deletions

View File

@ -0,0 +1,60 @@
{ lib
, stdenv
, fetchFromGitHub
, fetchpatch
, fetchurl
, cmake
, obs-studio
}:
stdenv.mkDerivation rec {
pname = "obs-move-transition";
version = "2.0.2";
src = fetchFromGitHub {
owner = "exeldro";
repo = "obs-move-transition";
rev = version;
sha256 = "0kr868lxlanq0y98f2hb70y92ac2nla8khsj879kjf3z6dqdpd66";
};
nativeBuildInputs = [ cmake ];
buildInputs = [ obs-studio ];
cmakeFlags = with lib; [
"-DLIBOBS_INCLUDE_DIR=${obs-studio.src}/libobs"
"-Wno-dev"
];
preConfigure = ''
cp ${obs-studio.src}/cmake/external/FindLibobs.cmake FindLibobs.cmake
'';
patches = [ ./rename-obs-move-transition-cmake.patch ];
postPatch = ''
substituteInPlace move-source-filter.c --replace '<../UI/obs-frontend-api/obs-frontend-api.h>' '<obs-frontend-api.h>'
substituteInPlace move-value-filter.c --replace '<../UI/obs-frontend-api/obs-frontend-api.h>' '<obs-frontend-api.h>'
substituteInPlace move-transition.c --replace '<../UI/obs-frontend-api/obs-frontend-api.h>' '<obs-frontend-api.h>'
'';
# obs-studio expects the shared object to be located in bin/32bit or bin/64bit
# https://github.com/obsproject/obs-studio/blob/d60c736cb0ec0491013293c8a483d3a6573165cb/libobs/obs-nix.c#L48
postInstall = let
pluginPath = {
i686-linux = "bin/32bit";
x86_64-linux = "bin/64bit";
}.${stdenv.targetPlatform.system} or (throw "Unsupported system: ${stdenv.targetPlatform.system}");
in ''
mkdir -p $out/share/obs/obs-plugins/move-transition/${pluginPath}
ln -s $out/lib/obs-plugins/move-transition.so $out/share/obs/obs-plugins/move-transition/${pluginPath}
'';
meta = with lib; {
description = "Plugin for OBS Studio to move source to a new position during scene transition";
homepage = "https://github.com/exeldro/obs-move-transition";
maintainers = with maintainers; [ starcraft66 ];
license = licenses.gpl2Plus;
platforms = [ "x86_64-linux" "i686-linux" ];
};
}

View File

@ -0,0 +1,34 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d116619..a1366ce 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,17 @@
+if (POLICY CMP0048)
+ cmake_policy(SET CMP0048 NEW)
+endif (POLICY CMP0048)
+
project(move-transition VERSION 2.0.2)
set(PROJECT_FULL_NAME "Move Transition")
+include(FindLibobs.cmake)
+find_package(LibObs REQUIRED)
+
+include_directories(
+ "${LIBOBS_INCLUDE_DIR}/../plugins/obs-transitions"
+ "${LIBOBS_INCLUDE_DIR}/../UI/obs-frontend-api")
+
set(move-transition_HEADERS
move-transition.h
easing.h)
@@ -34,4 +45,10 @@ target_link_libraries(move-transition
libobs)
set_target_properties(move-transition PROPERTIES FOLDER "plugins/exeldro")
-install_obs_plugin_with_data(move-transition data)
+set_target_properties(move-transition PROPERTIES PREFIX "")
+
+install(TARGETS move-transition
+ LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/obs-plugins)
+
+install(DIRECTORY data/locale/
+ DESTINATION "${CMAKE_INSTALL_PREFIX}/share/obs/obs-plugins/move-transition/locale")

View File

@ -22851,6 +22851,8 @@ in
obs-wlrobs = callPackage ../applications/video/obs-studio/wlrobs.nix { };
obs-move-transition = callPackage ../applications/video/obs-studio/obs-move-transition.nix { };
obs-v4l2sink = libsForQt514.callPackage ../applications/video/obs-studio/v4l2sink.nix { };
obs-ndi = libsForQt514.callPackage ../applications/video/obs-studio/obs-ndi.nix { };