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

herbe: init at 1.0.0 #107892

Merged
merged 1 commit into from Dec 31, 2020
Merged

herbe: init at 1.0.0 #107892

merged 1 commit into from Dec 31, 2020

Conversation

wishfort36
Copy link
Contributor

Motivation for this change

This program displays notifications without including a daemon or the whole D-Bus dependency tree.

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 (Arch)
  • 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.

@reedrw
Copy link
Contributor

reedrw commented Dec 29, 2020

Result of nixpkgs-review pr 107892 run on x86_64-linux 1

1 package built:
  • herbe

@SuperSandro2000
Copy link
Member

Result of nixpkgs-review pr 107892 run on x86_64-linux 1

1 package built:
  • herbe

@SuperSandro2000
Copy link
Member

Result of nixpkgs-review pr 107892 run on x86_64-darwin 1

@wishfort36
Copy link
Contributor Author

Done, and squashed.

@wishfort36
Copy link
Contributor Author

It looks like "PREFIX=$(out)" is the preferred way of making makefiles install to the nix store, so I've changed it to that, from having it set both PREFIX and DESTDIR.

@thiagokokada
Copy link
Contributor

Result of nixpkgs-review pr 107892 1

1 package built:
  • herbe

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-already-reviewed/2617/317

@AndersonTorres
Copy link
Member

@wishfort36 can you add support to patches?

@wishfort36
Copy link
Contributor Author

wishfort36 commented Dec 31, 2020

@AndersonTorres: Consider it done.

I'm looking at st's default.nix and am thinking. Could it be a good idea to have an extraLibs as well? Some patches will probably require more build dependencies. This one does, for example. I could get it building anyways by just overriding the buildInputs:

{
  packageOverrides = pkgs: rec {
    herbe = pkgs.herbe.overrideAttrs (attrs: {
      patches = attrs.patches ++ [ /home/wishfort36/21.diff ];
      buildInputs = attrs.buildInputs ++ [ pkgs.xorg.libXrandr ];
    });
  };
}

and rebuilding, but it doesn't exactly feel "correct" per se. I guess the same would go for overriding the prePatch or postPatch to get your own config file handled by Nix (for example to set a systemwide colourscheme in Nix), but having a patches feels like it would go hand in hand with an extraLibs.

@thiagokokada
Copy link
Contributor

IMO, if the common way to extend this program is using patches, I think adding an extraLibs is also fine. Anything more than this would probably be better done using overrideAttrs, since we can consider them "strange user cases".

@AndersonTorres
Copy link
Member

AndersonTorres commented Dec 31, 2020

It's a good idea to me. This is a "standard" approach to softwares configured by patches, indeed.
Can you implement it?

@wishfort36
Copy link
Contributor Author

I've been under the impression that this:

{ stdenv, lib, fetchFromGitHub, libX11, libXft, freetype, patches ? [ ],
  extraLibs ? [ ] }:

stdenv.mkDerivation rec {
  # (...)

  buildInputs = [ libX11 libXft freetype ] ++ extraLibs;

  # (...)

}

would be sufficient, but if I do that and modify my ~/.config/nixpkgs/nix to this:

{
  packageOverrides = pkgs: rec {
    herbe = pkgs.herbe.overrideAttrs (attrs: {
      patches = attrs.patches ++ [ /home/wishfort36/21.diff ];
      extraLibs = with pkgs; [ xorg.libXrandr ];
#      buildInputs = attrs.buildInputs ++ [ pkgs.xorg.libXrandr ];
    });
  };
}

then compilation fails, complaining that it can't "find" the xrandr header file, as if libXrandr isn't present. It compiles fine if i comment out the extraLibs line and uncomment the buildInputs line. Might you know why? I'm at a loss.

@thiagokokada
Copy link
Contributor

thiagokokada commented Dec 31, 2020

@wishfort36 If you're using { stdenv, lib, fetchFromGitHub, libX11, libXft, freetype, patches ? [ ], extraLibs ? [ ] }: you need to use override and not overrideAttrs. overrideAttrs is for those cases when you want to modify the derivation itself, not the input parameters.

In this case you want to (sorry if this is wrong, I am doing it by head, I may forgetting something):

{
  packageOverrides = pkgs: rec {
    herbe = pkgs.herbe.override ({
      patches = [ /home/wishfort36/21.diff ];
      extraLibs = with pkgs; [ xorg.libXrandr ];
    });
  };
}

@wishfort36
Copy link
Contributor Author

Thanks! That worked. I've also pushed the extraLibs change.

@thiagokokada
Copy link
Contributor

Result of nixpkgs-review pr 107892 1

1 package built:
  • herbe

@AndersonTorres AndersonTorres merged commit d50923a into NixOS:master Dec 31, 2020
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