Skip to content

Commit

Permalink
Merge pull request NixOS#270726 from atorres1985-contrib/openshot
Browse files Browse the repository at this point in the history
openshot-qt: 3.0.0 -> 3.1.1
  • Loading branch information
pbsds authored Dec 6, 2023
2 parents 9a75197 + 355e631 commit 2bea1bc
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 51 deletions.
33 changes: 19 additions & 14 deletions pkgs/applications/video/openshot-qt/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
, stdenv
, mkDerivationWith
, fetchFromGitHub
, fetchpatch
, doxygen
, gtk3
, libopenshot
Expand All @@ -12,16 +11,20 @@
, wrapGAppsHook
}:

mkDerivationWith python3.pkgs.buildPythonApplication rec {
let
pname = "openshot-qt";
version = "3.0.0";

version = "3.1.1";
src = fetchFromGitHub {
owner = "OpenShot";
repo = "openshot-qt";
rev = "v${version}";
hash = "sha256-h4R2txi038m6tzdKYiXIB8CiqWt2MFFRNerp1CFP5as=";
hash = "sha256-kEz1APBitWLlnIbyloYMsqNrwC9RqU04kyyWzm5klYc=";
};
in
mkDerivationWith python3.pkgs.buildPythonApplication {
inherit pname version src;

outputs = [ "out" ]; # "lib" can't be split

nativeBuildInputs = [
doxygen
Expand All @@ -41,8 +44,10 @@ mkDerivationWith python3.pkgs.buildPythonApplication rec {
sip_4
];

strictDeps = true;

preConfigure = ''
# tries to create caching directories during install
# the builder tries to create caching directories during install
export HOME=$(mktemp -d)
'';

Expand All @@ -67,19 +72,19 @@ mkDerivationWith python3.pkgs.buildPythonApplication rec {
inherit (libopenshot) libopenshot-audio;
};

meta = with lib; {
meta = {
homepage = "http://openshot.org/";
description = "Free, open-source video editor";
longDescription = ''
OpenShot Video Editor is a free, open-source video editor for Linux.
OpenShot can take your videos, photos, and music files and help you
create the film you have always dreamed of. Easily add sub-titles,
transitions, and effects, and then export your film to DVD, YouTube,
Vimeo, Xbox 360, and many other common formats.
OpenShot can take your videos, photos, and music files and help you create
the film you have always dreamed of. Easily add sub-titles, transitions,
and effects, and then export your film to DVD, YouTube, Vimeo, Xbox 360,
and many other common formats.
'';
license = with licenses; gpl3Plus;
maintainers = with maintainers; [ AndersonTorres ];
platforms = with platforms; unix;
license = with lib.licenses; [ gpl3Plus ];
mainProgram = "openshot-qt";
maintainers = with lib.maintainers; [ AndersonTorres ];
platforms = lib.platforms.unix;
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@
, Foundation
}:

stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "libopenshot-audio";
version = "0.3.2";

src = fetchFromGitHub {
owner = "OpenShot";
repo = "libopenshot-audio";
rev = "v${version}";
sha256 = "sha256-PLpB9sy9xehipN5S9okCHm1mPm5MaZMVaFqCBvFUiTw=";
rev = "v${finalAttrs.version}";
hash = "sha256-PLpB9sy9xehipN5S9okCHm1mPm5MaZMVaFqCBvFUiTw=";
};

patches = [
# https://forum.juce.com/t/juce-and-macos-11-arm/40285/24
./undef-fpret-on-aarch64-darwin.patch
./0001-undef-fpret-on-aarch64-darwin.patch
];

nativeBuildInputs = [
Expand All @@ -58,18 +58,20 @@ stdenv.mkDerivation rec {
libXrandr
]);

doCheck = false;
strictDeps = true;

meta = with lib; {
doCheck = true;

meta = {
homepage = "http://openshot.org/";
description = "High-quality sound editing library";
longDescription = ''
OpenShot Audio Library (libopenshot-audio) is a program that allows the
high-quality editing and playback of audio, and is based on the amazing
JUCE library.
'';
license = with licenses; gpl3Plus;
maintainers = with maintainers; [ AndersonTorres ];
platforms = with platforms; unix;
license = with lib.licenses; [ gpl3Plus ];
maintainers = with lib.maintainers; [ AndersonTorres ];
platforms = lib.platforms.unix;
};
}
})
12 changes: 12 additions & 0 deletions pkgs/development/libraries/libopenshot/0001-link-magickcore.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff -Naur source/src/CMakeLists.txt source-new/src/CMakeLists.txt
--- source/src/CMakeLists.txt 1969-12-31 21:00:01.000000000 -0300
+++ source-new/src/CMakeLists.txt 2023-11-30 09:39:45.442332463 -0300
@@ -231,7 +231,7 @@
target_compile_definitions(openshot PUBLIC USE_IMAGEMAGICK=1)

# Link with ImageMagick library
- target_link_libraries(openshot PUBLIC ImageMagick::Magick++)
+ target_link_libraries(openshot PUBLIC ImageMagick::Magick++ ImageMagick::MagickCore)

set(HAVE_IMAGEMAGICK TRUE CACHE BOOL "Building with ImageMagick support" FORCE)
mark_as_advanced(HAVE_IMAGEMAGICK)
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,23 @@
, zeromq
}:

stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "libopenshot";
version = "0.3.2";

src = fetchFromGitHub {
owner = "OpenShot";
repo = "libopenshot";
rev = "v${version}";
sha256 = "sha256-axFGNq+Kg8atlaSlG8EKvxj/FwLfpDR8/e4otmnyosM=";
rev = "v${finalAttrs.version}";
hash = "sha256-axFGNq+Kg8atlaSlG8EKvxj/FwLfpDR8/e4otmnyosM=";
};

postPatch = ''
sed -i 's/{UNITTEST++_INCLUDE_DIR}/ENV{UNITTEST++_INCLUDE_DIR}/g' tests/CMakeLists.txt
'' + lib.optionalString stdenv.isDarwin ''
# Darwin requires both Magick++ and MagickCore or it will fail to link.
substituteInPlace src/CMakeLists.txt \
--replace 'target_link_libraries(openshot PUBLIC ImageMagick::Magick++)' 'target_link_libraries(openshot PUBLIC ImageMagick::Magick++ ImageMagick::MagickCore)'
'';
patches = lib.optionals stdenv.isDarwin [
# Darwin requires both Magick++ and MagickCore for a successful linkage
./0001-link-magickcore.diff
];

nativeBuildInputs = lib.optionals stdenv.isLinux [
alsa-lib
] ++ [
nativeBuildInputs = [
cmake
doxygen
pkg-config
Expand All @@ -56,33 +51,37 @@ stdenv.mkDerivation rec {
qtbase
qtmultimedia
zeromq
] ++ lib.optionals stdenv.isLinux [
alsa-lib
] ++ lib.optionals stdenv.isDarwin [
llvmPackages.openmp
];

strictDeps = true;

dontWrapQtApps = true;

doCheck = false;
doCheck = true;

cmakeFlags = [
"-DENABLE_RUBY=OFF"
"-DPYTHON_MODULE_PATH=${python3.sitePackages}"
(lib.cmakeBool "ENABLE_RUBY" false)
(lib.cmakeOptionType "filepath" "PYTHON_MODULE_PATH" python3.sitePackages)
];

meta = with lib; {
passthru = {
inherit libopenshot-audio;
};

meta = {
homepage = "http://openshot.org/";
description = "Free, open-source video editor library";
longDescription = ''
OpenShot Library (libopenshot) is an open-source project dedicated to
delivering high quality video editing, animation, and playback solutions
to the world. API currently supports C++, Python, and Ruby.
'';
license = licenses.gpl3Plus;
maintainers = with maintainers; [ AndersonTorres ];
platforms = platforms.unix;
};

passthru = {
inherit libopenshot-audio;
license = with lib.licenses; [ gpl3Plus ];
maintainers = with lib.maintainers; [ AndersonTorres ];
platforms = lib.platforms.unix;
};
}
})
4 changes: 2 additions & 2 deletions pkgs/top-level/qt5-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,13 @@ in (noExtraAttrs (kdeFrameworks // plasmaMobileGear // plasma5 // plasma5.thirdP

liblastfm = callPackage ../development/libraries/liblastfm { };

libopenshot = callPackage ../applications/video/openshot-qt/libopenshot.nix {
libopenshot = callPackage ../development/libraries/libopenshot {
stdenv = if pkgs.stdenv.isDarwin then pkgs.overrideSDK pkgs.stdenv "11.0" else pkgs.stdenv;
};

packagekit-qt = callPackage ../tools/package-management/packagekit/qt.nix { };

libopenshot-audio = callPackage ../applications/video/openshot-qt/libopenshot-audio.nix {
libopenshot-audio = callPackage ../development/libraries/libopenshot-audio {
inherit (pkgs.darwin.apple_sdk.frameworks) Accelerate AGL Cocoa Foundation;
};

Expand Down

0 comments on commit 2bea1bc

Please sign in to comment.