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

Couchpotato: init at 3.0.1 + couchpotato module #21907

Merged
merged 2 commits into from Jan 16, 2017

Conversation

fadenb
Copy link
Contributor

@fadenb fadenb commented Jan 15, 2017

Motivation for this change
Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@mention-bot
Copy link

@fadenb, thanks for your PR! By analyzing the history of the files in this pull request, we identified @edolstra, @joachifm, @offlinehacker and @FRidh to be potential reviewers.

@@ -1178,6 +1178,45 @@ in {
};
};

couchpotato = buildPythonPackage rec {
Copy link
Member

Choose a reason for hiding this comment

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

couchpotato is used as an application and not as a library. Therefore, it doesn't belong in python-packages.nix. Instead, it should fit somewhere else in Nixpkgs tree based on what it is/does.

sha256 = "1xwjis3ijh1rff32mpdsphmsclf0lkpd3phpgxkccrigq1m9r3zh";
};

phases = [ "unpackPhase" "patchPhase" "installPhase" "postInstall" ];
Copy link
Member

Choose a reason for hiding this comment

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

please remove this since there is no need for it

Copy link
Member

Choose a reason for hiding this comment

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

you might want to pass format = "other";. That gives you a buildPythonPackage for non-setuptools installations.

substituteInPlace CouchPotato.py --replace "dirname(os.path.abspath(__file__))" "os.path.join(dirname(os.path.abspath(__file__)), '../${python.sitePackages}')"
'';

installPhase = ''
Copy link
Member

Choose a reason for hiding this comment

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

you're making a proper package out of it. That's good. I wish upstream would do that as well.

cp -r libs/* $out/${python.sitePackages}/
cp -r couchpotato $out/${python.sitePackages}/

cp CouchPotato.py $out/bin/
Copy link
Member

Choose a reason for hiding this comment

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

having a binary with an extension is rather ugly. Maybe we want to rename it instead to couchpotato ?

'';

postInstall = ''
wrapProgram "$out/bin/CouchPotato.py" --prefix PYTHONPATH : "$PYTHONPATH:$out/${python.sitePackages}" \
Copy link
Member

Choose a reason for hiding this comment

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

the wrapping is done in the fixupPhase so this shouldn't be necessary.

description = "Automatic movie downloading via NZBs and torrents";
license = licenses.gpl3;
maintainers = with maintainers; [ fadenb ];
};
Copy link
Member

Choose a reason for hiding this comment

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

homepage?

@fadenb
Copy link
Contributor Author

fadenb commented Jan 15, 2017

@FRidh: Thanks for your input. I tried to address all the issues:

  • homepage: Added to metadata
  • .py extension: Removed and lowercased to 'couchpotato'
  • phases: Did not know about format :)
  • not a library: Moved to the normal package tree
  • fixup/wrapping: The automatic fixup wraps way more than just the CouchPotato.py resulting in errors as the code tries to load the shell wrapper as python. Additionally the automatic wrapper does not add $out/${python.sitePackages} to the $PYTHONPATH so I kept my original wrapper call but moved it to the fixupPhase.

@FRidh
Copy link
Member

FRidh commented Jan 15, 2017

Great. But then at least use set instead of prefix.

@@ -0,0 +1,43 @@
{ stdenv, fetchurl, pythonPackages, pkgs, lib, ... }:
Copy link
Member

Choose a reason for hiding this comment

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

don't pass in pkgs

Copy link
Member

Choose a reason for hiding this comment

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

stdenv isn't needed either, nor are the dots.

@FRidh
Copy link
Member

FRidh commented Jan 15, 2017

phases: Did not know about format :)

That's still undocumented actually.

@globin globin merged commit e5f353d into NixOS:master Jan 16, 2017
@globin globin deleted the couchpotato branch January 16, 2017 11:54
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

5 participants