about summary refs log tree commit diff
path: root/pkgs/applications/video/video-trimmer
diff options
context:
space:
mode:
authorDoron Behar <doron.behar@gmail.com>2022-08-21 13:11:15 +0300
committerDoron Behar <doron.behar@gmail.com>2022-08-21 22:09:11 +0300
commit6b45d2a1d2c68a437b28b2a0bdfc28dcd7ae4485 (patch)
tree06f08802e2c46f92a766700f5e526c2338b33dfa /pkgs/applications/video/video-trimmer
parenta07dae92cbc280080ac17ece325e2a56bb91b654 (diff)
video-trimmer: init at 0.7.1
Diffstat (limited to 'pkgs/applications/video/video-trimmer')
-rw-r--r--pkgs/applications/video/video-trimmer/default.nix93
-rw-r--r--pkgs/applications/video/video-trimmer/remove-screenshot-metainfo.diff17
2 files changed, 110 insertions, 0 deletions
diff --git a/pkgs/applications/video/video-trimmer/default.nix b/pkgs/applications/video/video-trimmer/default.nix
new file mode 100644
index 0000000000000..25cb522202661
--- /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 0000000000000..2d8741998d14c
--- /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.
+ 		</p>
+ 	</description>
+-	<screenshots>
+-		<screenshot type="default">
+-			<image>https://gitlab.gnome.org/YaLTeR/video-trimmer/uploads/e840fa093439348448007197d07c8033/image.png</image>
+-			<caption>Main Window</caption>
+-		</screenshot>
+-	</screenshots>
+ 	<releases>
+ 		<release version="0.7.1" date="2022-03-23">
+ 			<description>