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

cut-the-crap: init at 1.0.0 #75794

Closed
wants to merge 208 commits into from
Closed

Conversation

jappeace
Copy link
Contributor

@jappeace jappeace commented Dec 16, 2019

Motivation for this change

Adds a useful automated video editing tool for streamers.

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 nix-review --run "nix-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.
Notify maintainers

I think I'm the maintainer of this package

cc @

@jappeace jappeace changed the title cut-the-crap: Add automated video editing for streamers at 1.0.0 cut-the-crap: init at 1.0.0 Dec 19, 2019
@cdepillabout
Copy link
Member

@jappeace Would you consider releasing this to Hackage?

That way, it would get updates automatically here in nixpkgs whenever you released a new version.

@jappeace
Copy link
Contributor Author

Hi @cdepillabout I uploaded it to hackage.
It still needs ffmpeg as a runtime dependency, how does one add that?

@cdepillabout
Copy link
Member

cdepillabout commented Jan 14, 2020

@jappeace Thanks!

Next time the hackage packages are updated on the haskell-updates branch, you should be able to see cut-the-crap. You'll be able to try to build it with a command like nix-build -A haskellPackages.cut-the-crap.

It still needs ffmpeg as a runtime dependency, how does one add that?

You should be able to add that with a wrapper script. Here's an example:

in overrideCabal (addBuildTool super.futhark makeWrapper) (_drv: {
postInstall = ''
wrapProgram $out/bin/futhark \
--prefix PATH : "${path}" \
--set NIX_CC_WRAPPER_x86_64_unknown_linux_gnu_TARGET_HOST 1 \
--set NIX_CFLAGS_COMPILE "-I${opencl-headers}/include" \
--set NIX_CFLAGS_LINK "-L${ocl-icd}/lib"
'';
});

For cut-the-crap, it might look something like this:

  cut-the-crap =
    let path = stdenv.lib.makeBinPath [ ffmpeg ];
    in overrideCabal (addBuildTool super.cut-the-crap makeWrapper) (_drv: {
      postInstall = ''
        wrapProgram $out/bin/cut-the-crap \
          --prefix PATH : "${path}"
      '';
    });

system-filepath temporary text unliftio-core
];
prePatch = "hpack";
license = stdenv.lib.licenses.mit;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is there no meta as with any regular derivation? Maybe I'm just not familiar with the Haskell ecosystem...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is generated, but at the moment I'm waiting for haskellPackages to be updated so I can just do cdepillabout's suggestion.

src = fetchgit {
url = "https://github.com/jappeace/cut-the-crap";
sha256 = "1z4s0zan421q4722k32p0n33bsh7di1m6pbbdzqi7j87lfd9i7nk";
rev = "0ea8a0a0fd3e8d85f44337f13ef2445d22d1bf97";
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I made this before that debian thing. I wouldn't know how to use tags, or do you just mean the same commit as that tag?

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe that's also automatically generated... I'll leave this review to someone else more familiar with Haskell :)

@turion
Copy link
Contributor

turion commented Apr 16, 2020

@cdepillabout didn't you mean stackage, not hackage?

@cdepillabout
Copy link
Member

cdepillabout commented Apr 16, 2020

@turion What are you referring to?

cut-the-crap was originally not uploaded to Hackage, so it didn't automatically appear in the Haskell package set here in nixpkgs.

However, it appears that @jappeace has since uploaded to Hackage, so now it should be easy to just use haskellPackages.cut-the-crap.

Although you're right that uploading to Stackage (in addition to Hackage) would make it easier to make sure cut-the-crap builds here in nixpkgs.

@turion
Copy link
Contributor

turion commented Apr 16, 2020

@cdepillabout Thanks for the clarification! I can never remember how, in which files, and in which workflow either hackage or stackage are crawled. (Wish this was documented.)

@cdepillabout
Copy link
Member

@turion Yeah, I definitely sympathize!

A (very short) explanation is that Haskell packages are updated from Hackage automatically on a daily basis in this file:

https://github.com/NixOS/nixpkgs/blob/16477d764f375ef7b81acbfd13189299ff67f233/pkgs/development/haskell-modules/hackage-packages.nix

The packages in the stackage resolver are specified here:

# This is a list of packages with versions from the latest Stackage LTS release.
#
# The packages and versions in this list cause the `hackage2nix` tool to
# generate the package at the given version.
#
# For instance, with a line like the following:
#
# - aeson ==1.4.6.0
#
# `hackage2nix` will generate the `aeson` package at version 1.4.6.0 in the
# ./hackage-packages.nix file.
#
# Since the packages in the LTS package set are sometimes older than the latest
# on Hackage, `hackage2nix` is smart enough to also generate the latest version
# of a given package.
#
# In the above example with aeson, if there was version 1.5.0.0 of aeson
# available on Hackage, `hackage2nix` would generate two packages, `aeson`
# at version 1.4.6.0 and `aeson_1_5_0_0` at version 1.5.0.0.
#
# WARNING: This list is generated semiautomatically based on the most recent
# LTS package set. If you want to add entries to it, you must do so before the
# comment saying "# LTS Haskell x.y". Any changes after that commend will be
# lost the next time `update-stackage.sh` runs.
default-package-overrides:
# This was only intended for ghc-7.0.4, and has very old deps, one hidden behind a flag
- MissingH ==1.4.2.0
# gi-gdkx11-4.x requires gtk-4.x, which is still under development and
# not yet available in Nixpkgs
- gi-gdkx11 < 4
# LTS Haskell 15.7
- abstract-deque ==0.3
- abstract-par ==0.3.3
- AC-Angle ==1.0
- accuerr ==0.2.0.2
- ace ==0.6

This list is updated once a week or so by peti. I believe he does it semi-automatically.

That file also has a bunch of other settings for special things to do when updating packages from Hackage.

@jappeace
Copy link
Contributor Author

jappeace commented Apr 16, 2020

I'll fix this up right now as discussed above (eg use haskellPackages)

@jappeace
Copy link
Contributor Author

Ok nice, that's a lot less code and it makes updating this as simple as re-uploading to hackage. Thanks for all the help @cdepillabout

@cdepillabout
Copy link
Member

@jappeace One more thing. Could you rebase this on the haskell-updates branch, and change the base branch for this PR here on GitHub to haskell-updates?

We like to have most Haskell-related changes going to the haskell-updates branch.

andir and others added 5 commits April 17, 2020 11:58
This is really essential thing that everyone should be doing.
A few extra notifications won't hurt anyone, and we should be tracking issues
to connect them to the best people who can handle them.

Co-Authored-By: Cole Helbling <cole.e.helbling@outlook.com>
@jappeace
Copy link
Contributor Author

lol, that upsets github quite a bit @cdepillabout

@jappeace
Copy link
Contributor Author

jappeace commented Apr 17, 2020

I kindly refer you to #85438

Sorry for everyone else who got tagged. I didn't expect github to be so un-intelligent.

@jappeace jappeace closed this Apr 17, 2020
@doronbehar
Copy link
Contributor

@jappeace please mind your language 🙏 . It's 1 thing we add here a program that has "crap" in it's name - it doesn't mean we have to use such words when we deal with them.

@jappeace
Copy link
Contributor Author

@doronbehar I already self censored. You probably had a tab open or something.

@doronbehar
Copy link
Contributor

I noticed that and I still felt it was necessary to put it. I was subscribed to this issue and I got that by email.

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