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

udiskie: 1.4.8 -> 1.5.1 #18396

Merged
merged 3 commits into from
Sep 12, 2016
Merged

udiskie: 1.4.8 -> 1.5.1 #18396

merged 3 commits into from
Sep 12, 2016

Conversation

rycee
Copy link
Member

@rycee rycee commented Sep 7, 2016

Motivation for this change

Version bump and use of GApps wrapper and icon hooks. Unfortunately, despite the use of gapps wrapper I still get some missing icons in the tray menu.

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
    • OS X
    • 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.

Also switch to `fetchFromGitHub` and do minor formatting.
@mention-bot
Copy link

@rycee, thanks for your PR! By analyzing the annotation information on this pull request, we identified @FRidh to be a potential reviewer

@rycee
Copy link
Member Author

rycee commented Sep 7, 2016

CC @AndersonTorres

@FRidh FRidh self-assigned this Sep 7, 2016
@@ -27121,13 +27121,15 @@ in modules // {
};
};

udiskie = buildPythonPackage rec {
version = "1.4.8";
udiskie = buildPythonApplication rec {
Copy link
Member

Choose a reason for hiding this comment

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

this is indeed an application. As such, this expression should be moved outside of python-packages.nix and put somewhere else in nixpkgs, since python-packages.nix is only intended for libraries or packages that need to be available for Python versions.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added a commit that moves the package to applications/misc/udiskie. I kept a reference in pythonPackages for backwards compatibility. I'm not sure whether that is necessary, though…

@FRidh FRidh added 6.topic: python 8.has: package (update) This PR updates a package to a newer version 2.status: work-in-progress This PR isn't done labels Sep 10, 2016
};

preConfigure = ''
export XDG_RUNTIME_DIR=/tmp
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 set environment variables outside of the phases. Just passing XDG_RUNTIME_DIR=/tmp; is sufficient.

Copy link
Contributor

Choose a reason for hiding this comment

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

you can set environment variables outside of the phases. Just passing XDG_RUNTIME_DIR=/tmp; is sufficient.

I know this feature is used all over the place, but I always felt that was weird/wrong. Like a leaky abstraction.

Copy link
Member Author

@rycee rycee Sep 10, 2016

Choose a reason for hiding this comment

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

As far as I can tell the XDG_RUNTIME_DIR variable doesn't matter at all in the udiskie build. The package builds and runs just fine without it. I removed it and force-pushed.

It might be used by the test suite but that is disabled anyway…

Copy link
Member

Choose a reason for hiding this comment

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

@bjornfor could you explain why you think it is weird or wrong? I can imagine it is strange to set something outside of a phase, and so it might not be clear when exactly these env vars are set.

Copy link
Contributor

Choose a reason for hiding this comment

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

On 12 September 2016 at 11:07, Frederik Rietdijk
notifications@github.com wrote:

In pkgs/applications/misc/udiskie/default.nix:

+, gobjectIntrospection, gtk3, hicolor_icon_theme, libnotify
+, pythonPackages, udisks2, wrapGAppsHook }:
+
+pythonPackages.buildPythonApplication rec {

  • name = "udiskie-${version}";
  • version = "1.5.1";
  • src = fetchFromGitHub {
  • owner = "coldfix";
  • repo = "udiskie";
  • rev = version;
  • sha256 = "01x5fvllb262x6r3547l23z7p6hr7ddz034bkhmj2cqmf83sxwxd";
  • };
  • preConfigure = ''
  • export XDG_RUNTIME_DIR=/tmp

@bjornfor could you explain why you think it is weird or wrong? I can imagine it is strange to set something outside of a phase, and so it might not be clear when exactly these env vars are set.

Why I think it's weird:

  • No clear distinction between Nix value and Shell value. It's just
    "all the same".
  • A very "global" scope. No way to set an envvar for just configure phase.

I think something like this would be cleaner (inspired by Buildroot):

builderEnv = { MYVAR = "VALUE"; };    # this will be set for all

processes spawned in a build
configureEnv = { MYVAR = "VALUE"; }; # just when invoking ./configure

I guess it all comes down to ones perception of the
stdenv.mkDerivation function. Mine is probably wrong :-)

Copy link
Member

Choose a reason for hiding this comment

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

Yes I agree that would be much nicer. We should build wrappers in such a way as well I think.

But for the case here, since at this point the state is inherited from one phase to another, there is no difference between using export X=y; or X=y; except if you want to export the var after a certain phase.

This is an application, not a python library and should therefore be in
its own package.
@FRidh FRidh removed the 2.status: work-in-progress This PR isn't done label Sep 12, 2016
@FRidh FRidh removed their assignment Sep 12, 2016
@FRidh FRidh merged commit 29f00f9 into NixOS:master Sep 12, 2016
@rycee rycee deleted the fix/udiskie branch September 12, 2016 09:06
@rycee
Copy link
Member Author

rycee commented Sep 12, 2016

Thanks for the review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: python 8.has: package (update) This PR updates a package to a newer version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants