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

dduper: init at 0.04 #110393

Closed
wants to merge 2 commits into from
Closed

dduper: init at 0.04 #110393

wants to merge 2 commits into from

Conversation

viric
Copy link
Member

@viric viric commented Jan 21, 2021

Motivation for this change

Add dduper package

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.


let
our-btrfs-progs = btrfs-progs.override {
patches = [ patch ];
Copy link
Member

Choose a reason for hiding this comment

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

Can you overwrite the package instead of adding an optional input?

Copy link
Member Author

Choose a reason for hiding this comment

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

Isn't that dirtier?

Copy link
Member

Choose a reason for hiding this comment

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

Having to many options which are not strictly required make the package more complex. I think overwrite is a good option here.

Comment on lines +21 to +22

phases = [ "unpackPhase" "installPhase" ];
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
phases = [ "unpackPhase" "installPhase" ];

Please disable the phases not needed.

Comment on lines +36 to +38
pythonPath = [ python3Packages.python
python3Packages.numpy
python3Packages.ptable ];
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
pythonPath = [ python3Packages.python
python3Packages.numpy
python3Packages.ptable ];
pythonPath = with python3Packages; [
python
numpy
ptable
];

python3Packages.ptable ];

prePatch = ''
sed -i 's,/usr/sbin/btrfs\.static,'${our-btrfs-progs}/bin/btrfs, dduper
Copy link
Member

Choose a reason for hiding this comment

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

sed is not ideal because it silently fails.

Copy link
Member Author

Choose a reason for hiding this comment

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

good point. What would you use?

Copy link
Member

Choose a reason for hiding this comment

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

you can either use substituteInPlace (which prints a warning if nothing is replace) or use a full blown patch (which fails loudly to apply in case upstream changes the corresponding lines) like in https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/graphics/gimp/default.nix#L67-L70

pkgs/tools/filesystems/dduper/default.nix Outdated Show resolved Hide resolved
meta = with stdenv.lib; {
description = "Block-level out-of-band BTRFS dedupe tool";
homepage = "https://github.com/Lakshmipathi/dduper";
license = licenses.gpl2;
Copy link
Member

Choose a reason for hiding this comment

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

gpl2Only or gpl2Plus?

wrapPythonPrograms
'';

meta = with stdenv.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
meta = with stdenv.lib; {
meta = with lib; {

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
@symphorien
Copy link
Member

Fails to build because the patch does not apply.

@viric
Copy link
Member Author

viric commented Feb 1, 2021

I'll wait for a dduper release.

@viric viric closed this Feb 1, 2021
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

3 participants