Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

losslesscut-bin: init at 3.33.1 #108512

Merged
merged 1 commit into from Apr 18, 2021
Merged

Conversation

ShamrockLee
Copy link
Contributor

@ShamrockLee ShamrockLee commented Jan 5, 2021

Add binary package for

  • Linux (AppImage)
  • Mac (dmg, x86_64 version)
  • Windows (zip)
Motivation for this change

If applied, LosslessCut -- a convenient video editor -- will be available in nixpkgs for Linux, Mac and Windows users.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Copy link
Contributor

@Mindavi Mindavi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't looked too closely to the package definition, but building and running on Linux NixOS works. Cutting out a simple video also works.

I wonder; is there a reason as to not build the electron app from source?

pkgs/applications/video/lossless-cut-bin/linuxbin.nix Outdated Show resolved Hide resolved
@ShamrockLee
Copy link
Contributor Author

Thanks for review and reply.

I wonder; is there a reason as to not build the electron app from source?

It would be wonderful to build from source, and that's what I have tried at first (#91683).

Firstly, I personally have never succeeded in the source-build of any electron project.
They requires development dependencies to work, which means an electron node package will be downloaded and installed by the package manager. The problem is that it always want to download something at build phase as part of the "installation" of the electron package.

Secondly, the author of LosslessCut decided to bundle statically-build ffmpeg and ffprobe libreary instead of relying on the one provided by the package manager ar the environment, and the bundle will be downloaded during installation. We need to hack on the code to make it use the one downloaded by fetchurl or the one linked from the nixpkgs derivation.

It would be great to get some advice on how to build them.

@ShamrockLee ShamrockLee force-pushed the lossless-cut-bin branch 2 times, most recently from a79fd6e to f756475 Compare January 10, 2021 17:41
@Mindavi
Copy link
Contributor

Mindavi commented Jan 12, 2021

I understand. I've never built an electron package before, so I can't really give any guidance on that.

IMO this can be merged (I don't have commit rights).

Some MacOS / Windows (not sure if anyone's still on that) testing would be nice.

@ShamrockLee
Copy link
Contributor Author

ShamrockLee commented Jan 13, 2021

Just performed some modifications:

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/480

Copy link
Member

@veprbl veprbl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Runs on macOS

@ShamrockLee ShamrockLee force-pushed the lossless-cut-bin branch 2 times, most recently from a176c35 to 69cf681 Compare March 25, 2021 14:45
@ShamrockLee
Copy link
Contributor Author

Rebase onto recent Nixpkgs master and upgrade to 3.33.1

@SuperSandro2000 SuperSandro2000 removed their request for review March 26, 2021 17:03
@SuperSandro2000
Copy link
Member

No idea if this is a bit overengineered.

@veprbl
Copy link
Member

veprbl commented Mar 26, 2021

No idea if this is a bit overengineered.

I think it could use some refactoring, but I would not say it's terribly complicated.

Copy link
Member

@veprbl veprbl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to just merge this, but taking pkgs as attribute is not very acceptable.

@@ -0,0 +1,31 @@
{ pkgs, stdenvNoCC, lib }:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{ pkgs, stdenvNoCC, lib }:
{ stdenv, callPackage, lib }:

Comment on lines 13 to 16
description = "The swiss army knife of lossless video/audio editing";
homepage = "https://mifi.no/losslesscut/";
license = licenses.mit;
maintainers = with maintainers; [ ShamrockLee ];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description = "The swiss army knife of lossless video/audio editing";
homepage = "https://mifi.no/losslesscut/";
license = licenses.mit;
maintainers = with maintainers; [ ShamrockLee ];
description = "The swiss army knife of lossless video/audio editing";
homepage = "https://mifi.no/losslesscut/";
license = licenses.mit;
maintainers = with maintainers; [ ShamrockLee ];

Why not put these into the override below, get rid of callBin

maintainers = with maintainers; [ ShamrockLee ];
};
in (
if stdenvNoCC.isDarwin then passthru.dmg
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if stdenvNoCC.isDarwin then passthru.dmg
if stdenvNoCC.isDarwin then callPackage ./dmg.nix { inherit version }

and so on

@veprbl
Copy link
Member

veprbl commented Mar 26, 2021

Also, why do you call the package "lossless-cut" if its "losslesscut"

@veprbl
Copy link
Member

veprbl commented Mar 26, 2021

@ShamrockLee
Copy link
Contributor Author

Also, why do you call the package "lossless-cut" if its "losslesscut"

It's just because the source repo is named "lossless-cut", and the manual suggests that the attribute be identical to the project name. (or do I misunderstand something?)

losslesscut sounds better, and is also the name of the command to get it start.

Add binary package for
* Linux (AppImage)
* Mac (dmg, x86_64 version)
* Windows (zip)

Use lib.meta as per NixOS#108938
@ShamrockLee
Copy link
Contributor Author

Apply the suggestions and rename

@ShamrockLee ShamrockLee changed the title lossless-cut-bin: init at 3.30.0 losslesscut-bin: init at 3.33.1 Mar 30, 2021
@Mindavi
Copy link
Contributor

Mindavi commented Mar 30, 2021

I'd suggest merging this, most or all comments are addressed and it's been open for a long time now. Subsequent updates can incorporate any minor improvements that are needed.

@ryneeverett
Copy link
Contributor

Seems like calling the per-platform files in a let-expression makes them impossible to override (AFAIK).

@ShamrockLee
Copy link
Contributor Author

Seems like calling the per-platform files in a let-expression makes them impossible to override (AFAIK).

@ryneeverett Would it be better for the three of them be visible in all-packages.nix or should I put them in the passthru?

@ryneeverett
Copy link
Contributor

@ShamrockLee I'm not the person to ask but I would think passthru would be acceptable.

@veprbl veprbl merged commit 56a4d98 into NixOS:master Apr 18, 2021
@ShamrockLee ShamrockLee deleted the lossless-cut-bin branch January 11, 2022 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants