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

android-file-transfer: init at 3.4 #44017

Merged
merged 1 commit into from Jul 28, 2018
Merged

android-file-transfer: init at 3.4 #44017

merged 1 commit into from Jul 28, 2018

Conversation

xaverdh
Copy link
Contributor

@xaverdh xaverdh commented Jul 23, 2018

Motivation for this change

This adds the android-file-transfer (Android File Transfer For Linux) package.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option 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/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

Copy link
Member

@ryantm ryantm left a comment

Choose a reason for hiding this comment

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

Please also squash your commits into one commit.

'';
meta = with stdenv.lib; {
description = "Reliable MTP client with minimalistic UI";
longDescription = ''
Copy link
Member

Choose a reason for hiding this comment

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

Please either add a longDescription or remove this.

description = "Reliable MTP client with minimalistic UI";
longDescription = ''
'';
homepage = "http://whoozle.github.io/android-file-transfer-linux/";
Copy link
Member

Choose a reason for hiding this comment

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

Quotes are not necessary around URLs.

@xaverdh
Copy link
Contributor Author

xaverdh commented Jul 27, 2018

Ok, I fixed those issues. Any other suggestions?
Also it is possbile to build this with a graphical qt frontend.
Should that be an option to this package, or should I put it in a seperate package
(named e.g. android-file-transfer-qt)?

@ryantm
Copy link
Member

ryantm commented Jul 27, 2018

It looks like it is pretty rare for a package repository to have something called "android-file-transfer-qt". Generally we try to respect the defaults of the upstream software, so in this case, it looks like the default is to provide the graphical program, so I'd recommend having it turned on. But, it would also be okay to plan to add that later if it is much harder to package it.

Keep in mind people can reuse or override this expression later, so providing optional arguments to the package isn't necessary.

@ryantm
Copy link
Member

ryantm commented Jul 27, 2018

@GrahamcOfBorg build android-file-transfer

@GrahamcOfBorg
Copy link

No attempt on x86_64-darwin (full log)

The following builds were skipped because they don't evaluate on x86_64-darwin: android-file-transfer

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: android-file-transfer

Partial log (click to expand)

-- Installing: /nix/store/bl5kbhmcjxx9il6i4pasxj5p9kgsxv2a-android-file-transfer-3.4/bin/aft-mtp-mount
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/bl5kbhmcjxx9il6i4pasxj5p9kgsxv2a-android-file-transfer-3.4
shrinking /nix/store/bl5kbhmcjxx9il6i4pasxj5p9kgsxv2a-android-file-transfer-3.4/bin/aft-mtp-mount
shrinking /nix/store/bl5kbhmcjxx9il6i4pasxj5p9kgsxv2a-android-file-transfer-3.4/bin/aft-mtp-cli
strip is /nix/store/a3nk8z2i7m7wa3jdckgv710n7j3yx4b5-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/bl5kbhmcjxx9il6i4pasxj5p9kgsxv2a-android-file-transfer-3.4/lib  /nix/store/bl5kbhmcjxx9il6i4pasxj5p9kgsxv2a-android-file-transfer-3.4/bin
patching script interpreter paths in /nix/store/bl5kbhmcjxx9il6i4pasxj5p9kgsxv2a-android-file-transfer-3.4
checking for references to /build in /nix/store/bl5kbhmcjxx9il6i4pasxj5p9kgsxv2a-android-file-transfer-3.4...
/nix/store/bl5kbhmcjxx9il6i4pasxj5p9kgsxv2a-android-file-transfer-3.4

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: android-file-transfer

Partial log (click to expand)

-- Installing: /nix/store/b50hswmx58i4r455crgz7wvy2snmjm96-android-file-transfer-3.4/bin/aft-mtp-mount
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/b50hswmx58i4r455crgz7wvy2snmjm96-android-file-transfer-3.4
shrinking /nix/store/b50hswmx58i4r455crgz7wvy2snmjm96-android-file-transfer-3.4/bin/aft-mtp-mount
shrinking /nix/store/b50hswmx58i4r455crgz7wvy2snmjm96-android-file-transfer-3.4/bin/aft-mtp-cli
strip is /nix/store/a245zacjzf3qw0davhvlfarihcy2yyrc-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/b50hswmx58i4r455crgz7wvy2snmjm96-android-file-transfer-3.4/lib  /nix/store/b50hswmx58i4r455crgz7wvy2snmjm96-android-file-transfer-3.4/bin
patching script interpreter paths in /nix/store/b50hswmx58i4r455crgz7wvy2snmjm96-android-file-transfer-3.4
checking for references to /build in /nix/store/b50hswmx58i4r455crgz7wvy2snmjm96-android-file-transfer-3.4...
/nix/store/b50hswmx58i4r455crgz7wvy2snmjm96-android-file-transfer-3.4

@xaverdh
Copy link
Contributor Author

xaverdh commented Jul 27, 2018

Getting it to build with Qt was straightforward.

I still think its a good idea to have a knob there for people to easily turn the Qt part off. Qt is a huge dependency.
nix path-info -S gives me 56637032 for the non-Qt version and 391204728 for the Qt version.
If I read that correctly, that's ~57MB vs ~391MB.

I implemented a version in a seperate branch, which makes Qt optional:
https://github.com/xaverdh/nixpkgs/blob/aft-qt-optional/pkgs/tools/filesystems/android-file-transfer/default.nix
From there, we could either add both versions to all-packages.nix. Or we could just add the version with Qt turned on, and leave the knob there for people to override it?

Still if you think it's too much trouble, I can just add the Qt bits to this pull request.

By the way, with or without Qt, this might build on darwin (at least according to upstream).
But I don't have a darwin box, and am totally unfamiliar with packaging for darwin, so I marked it as linux only atm.

@ryantm
Copy link
Member

ryantm commented Jul 27, 2018

From there, we could either add both versions to all-packages.nix. Or we could just add the version with Qt turned on, and leave the knob there for people to override it?

I prefer to have only one version with Qt turned on.

I think you shouldn't put the option into nixpkgs unless it is going to be used somewhere in nixpkgs. Someone who wants to reduce the size and use Qt, can fairly easily do it themselves.

By the way, with or without Qt, this might build on darwin (at least according to upstream).
But I don't have a darwin box, and am totally unfamiliar with packaging for darwin, so I marked it as linux only atm.

If you think it might build on Darwin, change the platforms to "unix" and we'll see if OfBorg builds it!

@xaverdh
Copy link
Contributor Author

xaverdh commented Jul 27, 2018

Ok, I pushed the necessary changes for building with Qt. Also set platforms to unix.

@ryantm
Copy link
Member

ryantm commented Jul 27, 2018

@GrahamcOfBorg build android-file-transfer

@GrahamcOfBorg
Copy link

No attempt on x86_64-darwin (full log)

The following builds were skipped because they don't evaluate on x86_64-darwin: android-file-transfer

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: android-file-transfer

Partial log (click to expand)

shrinking RPATHs of ELF executables and libraries in /nix/store/g36kkjw3wacbgqykdfrjba61js6nmh0m-android-file-transfer-3.4
shrinking /nix/store/g36kkjw3wacbgqykdfrjba61js6nmh0m-android-file-transfer-3.4/bin/aft-mtp-mount
shrinking /nix/store/g36kkjw3wacbgqykdfrjba61js6nmh0m-android-file-transfer-3.4/bin/android-file-transfer
shrinking /nix/store/g36kkjw3wacbgqykdfrjba61js6nmh0m-android-file-transfer-3.4/bin/aft-mtp-cli
strip is /nix/store/a3nk8z2i7m7wa3jdckgv710n7j3yx4b5-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/g36kkjw3wacbgqykdfrjba61js6nmh0m-android-file-transfer-3.4/lib  /nix/store/g36kkjw3wacbgqykdfrjba61js6nmh0m-android-file-transfer-3.4/bin
patching script interpreter paths in /nix/store/g36kkjw3wacbgqykdfrjba61js6nmh0m-android-file-transfer-3.4
checking for references to /build in /nix/store/g36kkjw3wacbgqykdfrjba61js6nmh0m-android-file-transfer-3.4...
postPatchMkspecs
/nix/store/g36kkjw3wacbgqykdfrjba61js6nmh0m-android-file-transfer-3.4

@ryantm
Copy link
Member

ryantm commented Jul 27, 2018

Darwin failed because fuse doesn't work on it.

@ryantm
Copy link
Member

ryantm commented Jul 27, 2018

Based on the comments here #36346 osxfuse is not available yet, so we should probably limit this to linux.

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: android-file-transfer

Partial log (click to expand)

shrinking RPATHs of ELF executables and libraries in /nix/store/8jbn7da6anwazr3dpn28hqim7mgcb4x5-android-file-transfer-3.4
shrinking /nix/store/8jbn7da6anwazr3dpn28hqim7mgcb4x5-android-file-transfer-3.4/bin/android-file-transfer
shrinking /nix/store/8jbn7da6anwazr3dpn28hqim7mgcb4x5-android-file-transfer-3.4/bin/aft-mtp-mount
shrinking /nix/store/8jbn7da6anwazr3dpn28hqim7mgcb4x5-android-file-transfer-3.4/bin/aft-mtp-cli
strip is /nix/store/a245zacjzf3qw0davhvlfarihcy2yyrc-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/8jbn7da6anwazr3dpn28hqim7mgcb4x5-android-file-transfer-3.4/lib  /nix/store/8jbn7da6anwazr3dpn28hqim7mgcb4x5-android-file-transfer-3.4/bin
patching script interpreter paths in /nix/store/8jbn7da6anwazr3dpn28hqim7mgcb4x5-android-file-transfer-3.4
checking for references to /build in /nix/store/8jbn7da6anwazr3dpn28hqim7mgcb4x5-android-file-transfer-3.4...
postPatchMkspecs
/nix/store/8jbn7da6anwazr3dpn28hqim7mgcb4x5-android-file-transfer-3.4

@xaverdh
Copy link
Contributor Author

xaverdh commented Jul 27, 2018

Ok, linux only then for now.

@ryantm
Copy link
Member

ryantm commented Jul 27, 2018

@GrahamcOfBorg build android-file-transfer

@GrahamcOfBorg
Copy link

No attempt on x86_64-darwin (full log)

The following builds were skipped because they don't evaluate on x86_64-darwin: android-file-transfer

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: android-file-transfer

Partial log (click to expand)

/nix/store/8jbn7da6anwazr3dpn28hqim7mgcb4x5-android-file-transfer-3.4

@xaverdh
Copy link
Contributor Author

xaverdh commented Jul 27, 2018

I changed platforms back to linux. Feel free to merge, when you are satisfied with the code.

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: android-file-transfer

Partial log (click to expand)

shrinking RPATHs of ELF executables and libraries in /nix/store/g36kkjw3wacbgqykdfrjba61js6nmh0m-android-file-transfer-3.4
shrinking /nix/store/g36kkjw3wacbgqykdfrjba61js6nmh0m-android-file-transfer-3.4/bin/aft-mtp-mount
shrinking /nix/store/g36kkjw3wacbgqykdfrjba61js6nmh0m-android-file-transfer-3.4/bin/aft-mtp-cli
shrinking /nix/store/g36kkjw3wacbgqykdfrjba61js6nmh0m-android-file-transfer-3.4/bin/android-file-transfer
strip is /nix/store/a3nk8z2i7m7wa3jdckgv710n7j3yx4b5-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/g36kkjw3wacbgqykdfrjba61js6nmh0m-android-file-transfer-3.4/lib  /nix/store/g36kkjw3wacbgqykdfrjba61js6nmh0m-android-file-transfer-3.4/bin
patching script interpreter paths in /nix/store/g36kkjw3wacbgqykdfrjba61js6nmh0m-android-file-transfer-3.4
checking for references to /build in /nix/store/g36kkjw3wacbgqykdfrjba61js6nmh0m-android-file-transfer-3.4...
postPatchMkspecs
/nix/store/g36kkjw3wacbgqykdfrjba61js6nmh0m-android-file-transfer-3.4

@ryantm ryantm merged commit 6613fea into NixOS:master Jul 28, 2018
@ryantm
Copy link
Member

ryantm commented Jul 28, 2018

thanks!

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