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

rapid-photo-downloader: init at 0.9.9 #36621

Merged
merged 6 commits into from Jul 30, 2018

Conversation

jfrankenau
Copy link
Member

Motivation for this change

Rapid Photo Downloader is a quick and simple to use photo importer.

Things done

Add a few python packages needed for rapid-photo-downloader.

Currently, libgudev is manually overridden for rapid-photo-downloader to be built with gobjectIntrospection. It's probably better to wait for #35335 to be merged.

  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • 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 nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.


postPatch = ''
substituteInPlace pymediainfo/__init__.py \
--replace 'CDLL("libmediainfo.so.0")' 'CDLL("${libmediainfo}/lib/libmediainfo.so.0")' \
Copy link
Member

Choose a reason for hiding this comment

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

${stdenv.hostPlatform.extensions.sharedLibrary} instead of .so

Copy link
Member Author

Choose a reason for hiding this comment

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

Done. I've also replaced the library references for Darwin.


buildInputs = [
gobjectIntrospection
(libgudev.overrideAttrs (oldAttrs: rec {
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 add a comment explaining why this is needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, no problem.

}:

python3Packages.buildPythonApplication rec {
name = "rapid-photo-downloader-${version}";
Copy link
Member

Choose a reason for hiding this comment

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

The name attribute is added by buildPython* and should therefore be removed. Instead, use

pname = "rapid-photo-downloader";

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, forget to do it for the main package as well. This detail could use some documentation in the Nixpkgs manual.

@jfrankenau jfrankenau force-pushed the init-rapid-photo-downloader branch 4 times, most recently from e1f03e6 to d2a3621 Compare March 10, 2018 15:16
nativeBuildInputs = [ file intltool ];

buildInputs = [
gobjectIntrospection
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this go into nativeBuildInputs?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, you are right.

@dotlambda
Copy link
Member

@GrahamcOfBorg build python2.pkgs.pymediainfo python3.pkgs.pymediainfo python2.pkgs.pyprind python3.pkgs.pyprind python2.pkgs.rawkit python3.pkgs.rawkit python2.pkgs.gphoto2 python3.pkgs.gphoto2

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: python2.pkgs.pymediainfo, python3.pkgs.pymediainfo, python2.pkgs.pyprind, python3.pkgs.pyprind, python2.pkgs.rawkit, python3.pkgs.rawkit, python2.pkgs.gphoto2, python3.pkgs.gphoto2

Partial log (click to expand)


========================== 53 passed in 0.99 seconds ===========================
/nix/store/crgpwajsqp9x5qkmzlszs8d0m04ac16z-python2.7-pymediainfo-2.2.1
/nix/store/2c1gca8w5f25950xw7qzb79mb5jszpwd-python3.6-pymediainfo-2.2.1
/nix/store/76gy7vna0lgwy25i6ivpl2ppxva2i96k-python2.7-PyPrind-2.11.2
/nix/store/2wxhwh47h4vwybyi55adzrdx5wav3cz0-python3.6-PyPrind-2.11.2
/nix/store/g13xsvlm0pdshk3gvmdhhrcdxq39470n-python2.7-rawkit-0.6.0
/nix/store/kba356l4zkvqnhxk1gxyyw2b1pwxx83w-python3.6-rawkit-0.6.0
/nix/store/1d9rbd2gxcq9rxpr1aanj6z5xfhq3g1v-python2.7-gphoto2-1.8.2
/nix/store/163mnfbsxqwasgcklfjxhbdydglfg1xa-python3.6-gphoto2-1.8.2

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: python2.pkgs.pymediainfo, python3.pkgs.pymediainfo, python2.pkgs.pyprind, python3.pkgs.pyprind, python2.pkgs.rawkit, python3.pkgs.rawkit, python2.pkgs.gphoto2, python3.pkgs.gphoto2

Partial log (click to expand)

/nix/store/37xd6gqvcah3qzm62s9yxgkvr21grw8i-python3.6-gphoto2-1.8.2/share/python-gphoto2/examples/set-camera-clock.py: interpreter directive changed from "/usr/bin/env python" to "/nix/store/143hazf8s5236kvprxlrgw9fdgzkrg0v-python3-3.6.4/bin/python"
checking for references to /build in /nix/store/37xd6gqvcah3qzm62s9yxgkvr21grw8i-python3.6-gphoto2-1.8.2...
/nix/store/175in3mq84vcbpb27zsna571pnrvn14r-python2.7-pymediainfo-2.2.1
/nix/store/1hyazmgnmcq3p4nwf59xdrkf1grm88zq-python3.6-pymediainfo-2.2.1
/nix/store/m2zj7wx5kgiwq60vpqqj732s1sxycbsk-python2.7-PyPrind-2.11.2
/nix/store/llzww59l9dmr8w6plrf2kibz3cmv1330-python3.6-PyPrind-2.11.2
/nix/store/1rkkkl2az8qa1w51xcymsm0zmkfv5gks-python2.7-rawkit-0.6.0
/nix/store/bla9rdkhqvawb99s98ip62lpfprrmmya-python3.6-rawkit-0.6.0
/nix/store/rc39xr7zcjlgf00l7zx40xjy4mday08n-python2.7-gphoto2-1.8.2
/nix/store/37xd6gqvcah3qzm62s9yxgkvr21grw8i-python3.6-gphoto2-1.8.2

'CDLL("${libmediainfo}/lib/libmediainfo${stdenv.hostPlatform.extensions.sharedLibrary}.0")'
'';

buildInputs = [ libmediainfo glibcLocales ];
Copy link
Member

Choose a reason for hiding this comment

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

libmediainfo should not be necessary here because it is referenced in postPatch. glibcLocales can go into checkInputs.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done. The latter should also be corrected in the Nixpkgs Manual if I am not mistaken.

Copy link
Member

@dotlambda dotlambda left a comment

Choose a reason for hiding this comment

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

If you know how to run the tests in https://bazaar.launchpad.net/~dlynch3/rapid/zeromq_pyqt/files/head:/raphodo/tests/, that would be nice to have in checkPhase. But overall, seems fine.

--replace 'CDLL("libmediainfo.dylib")' \
'CDLL("${libmediainfo}/lib/libmediainfo${stdenv.hostPlatform.extensions.sharedLibrary}")' \
--replace 'CDLL("libmediainfo.so.0")' \
'CDLL("${libmediainfo}/lib/libmediainfo${stdenv.hostPlatform.extensions.sharedLibrary}.0")'
Copy link
Member

Choose a reason for hiding this comment

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

Is .0 necessary?

Copy link
Member Author

Choose a reason for hiding this comment

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

AFAIK this indicates the version number of the library which will be incremented on breaking changes. Thus I assume that this makes a difference.


makeWrapperArgs = [
"--set GI_TYPELIB_PATH \"$GI_TYPELIB_PATH\""
"--set PYTHONPATH \"$PYTHONPATH\""
Copy link
Member

Choose a reason for hiding this comment

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

this will add build-time dependencies as run-time dependencies. Is the default wrapper not sufficient?

Copy link
Member Author

Choose a reason for hiding this comment

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

This was the only way I was able to make it work.

Copy link
Member

Choose a reason for hiding this comment

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

Makes sense, because the Python packages you've added are not included in propagatedBuildInputs. We use that attribute also for indicating they're run-time dependencies.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've tried that before but then some modules like zmq cannot be found.

@jfrankenau
Copy link
Member Author

@dotlambda, seeing as the tests are not included in the tarball, I believe those are not intended to be used downstream.

@FRidh
Copy link
Member

FRidh commented Mar 20, 2018

@jfrankenau in my experience the average maintainer does not consider downstream distributors at all, so I would not dare making that assumption. Instead, I would say that, if upstream maintainers believe downstream distributors should not use their tests, that we should not package the software because of potential low quality.

@jfrankenau
Copy link
Member Author

So, I've had a look at the tests and they seem to be outdated or need to be run interactively with some test data. I will see if I can get upstream to update those tests.

@jfrankenau
Copy link
Member Author

@FRidh, so according to upstream the tests are not automated:

They are are a mix of transient tests used for only particular stages of development and benchmarking.

I've been using this PR without any problems so far and would be happy to see this merged. The override for libgudev has been resolved and I have updated the PR accordingly.

@bjornfor
Copy link
Contributor

@FRidh: It seems all your comments have been adressed. I'm merging.

@bjornfor bjornfor merged commit 09fcfb6 into NixOS:master Jul 30, 2018
@jfrankenau jfrankenau deleted the init-rapid-photo-downloader branch July 31, 2018 06:53
@orivej
Copy link
Contributor

orivej commented Sep 25, 2018

pymediainfo was broken by #46255

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