From 6b45d2a1d2c68a437b28b2a0bdfc28dcd7ae4485 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Sun, 21 Aug 2022 13:11:15 +0300 Subject: [PATCH] video-trimmer: init at 0.7.1 --- .../video/video-trimmer/default.nix | 93 +++++++++++++++++++ .../remove-screenshot-metainfo.diff | 17 ++++ pkgs/top-level/all-packages.nix | 2 + 3 files changed, 112 insertions(+) create mode 100644 pkgs/applications/video/video-trimmer/default.nix create mode 100644 pkgs/applications/video/video-trimmer/remove-screenshot-metainfo.diff diff --git a/pkgs/applications/video/video-trimmer/default.nix b/pkgs/applications/video/video-trimmer/default.nix new file mode 100644 index 000000000000..25cb52220266 --- /dev/null +++ b/pkgs/applications/video/video-trimmer/default.nix @@ -0,0 +1,93 @@ +{ stdenv +, lib +, fetchFromGitLab +, rustPlatform +, gnome +, pkg-config +, meson +, wrapGAppsHook4 +, appstream-glib +, desktop-file-utils +, blueprint-compiler +, ninja +, python3 +, gtk3-x11 +, glib +, gobject-introspection +, gtk4 +, libadwaita +, gst_all_1 +}: + +stdenv.mkDerivation rec { + pname = "video-trimmer"; + version = "0.7.1"; + + src = fetchFromGitLab { + domain = "gitlab.gnome.org"; + owner = "YaLTeR"; + repo = "video-trimmer"; + rev = "v${version}"; + sha256 = "sha256-D7wjJkdqqjjwwYEUZnNr7hFQK59wfTnaCLXCy+SK8Jo="; + }; + cargoDeps = rustPlatform.fetchCargoTarball { + inherit src; + name = "${pname}-${version}"; + hash = "sha256-cB5dVrEbISvHrOb87uVZSkT694VKtPtyk+c1tYNCTp0="; + }; + + patches = [ + # The metainfo.xml file has a URL to a screenshot of the application, + # unaccessible in the build's sandbox. We don't need the screenshot, so + # it's best to remove it. + ./remove-screenshot-metainfo.diff + ]; + + postPatch = '' + patchShebangs \ + build-aux/meson/postinstall.py \ + build-aux/cargo.sh \ + build-aux/dist-vendor.sh + ''; + + nativeBuildInputs = [ + pkg-config + meson + wrapGAppsHook4 + appstream-glib + desktop-file-utils + blueprint-compiler + ninja + # For post-install.py + python3 + gtk3-x11 # For gtk-update-icon-cache + glib # For glib-compile-schemas + ] ++ (with rustPlatform; [ + cargoSetupHook + rust.cargo + rust.rustc + ]); + + buildInputs = [ + gobject-introspection + gtk4 + libadwaita + gst_all_1.gstreamer + gst_all_1.gst-plugins-base + gst_all_1.gst-plugins-bad + ]; + + doCheck = true; + + passthru.updateScript = gnome.updateScript { + packageName = pname; + }; + + meta = with lib; { + homepage = "https://gitlab.gnome.org/YaLTeR/video-trimmer"; + description = "Trim videos quickly"; + maintainers = with maintainers; [ doronbehar ]; + license = licenses.gpl3Plus; + platforms = platforms.linux; + }; +} diff --git a/pkgs/applications/video/video-trimmer/remove-screenshot-metainfo.diff b/pkgs/applications/video/video-trimmer/remove-screenshot-metainfo.diff new file mode 100644 index 000000000000..2d8741998d14 --- /dev/null +++ b/pkgs/applications/video/video-trimmer/remove-screenshot-metainfo.diff @@ -0,0 +1,17 @@ +diff --git i/data/org.gnome.gitlab.YaLTeR.VideoTrimmer.metainfo.xml.in.in w/data/org.gnome.gitlab.YaLTeR.VideoTrimmer.metainfo.xml.in.in +index 9bd25b6..c627369 100644 +--- i/data/org.gnome.gitlab.YaLTeR.VideoTrimmer.metainfo.xml.in.in ++++ w/data/org.gnome.gitlab.YaLTeR.VideoTrimmer.metainfo.xml.in.in +@@ -19,12 +19,6 @@ + Video Trimmer cuts out a fragment of a video given the start and end timestamps. The video is never re-encoded, so the process is very fast and does not reduce the video quality. +

+ +- +- +- https://gitlab.gnome.org/YaLTeR/video-trimmer/uploads/e840fa093439348448007197d07c8033/image.png +- Main Window +- +- + + + diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 95fdb4978bc2..fce2ac5ace4a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -11742,6 +11742,8 @@ with pkgs; pythonPackages = python3Packages; }; + video-trimmer = callPackage ../applications/video/video-trimmer { }; + via = callPackage ../tools/misc/via {}; vial = callPackage ../tools/misc/vial {};