Skip to content

herbe: init at 1.0.0#107892

Merged
AndersonTorres merged 1 commit into
NixOS:masterfrom
wishfort36:herbe
Dec 31, 2020
Merged

herbe: init at 1.0.0#107892
AndersonTorres merged 1 commit into
NixOS:masterfrom
wishfort36:herbe

Conversation

@wishfort36

Copy link
Copy Markdown
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.

@ofborg ofborg Bot added 8.has: package (new) This PR adds a new package 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. labels Dec 29, 2020
@reedrw

reedrw commented Dec 29, 2020

Copy link
Copy Markdown
Contributor

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

1 package built:
  • herbe

Comment thread pkgs/applications/misc/herbe/default.nix Outdated
Comment thread pkgs/applications/misc/herbe/default.nix Outdated
Comment thread pkgs/applications/misc/herbe/default.nix Outdated
@SuperSandro2000

Copy link
Copy Markdown
Member

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

1 package built:
  • herbe

@SuperSandro2000

Copy link
Copy Markdown
Member

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

@wishfort36

Copy link
Copy Markdown
Contributor Author

Done, and squashed.

@wishfort36

Copy link
Copy Markdown
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
Copy Markdown
Contributor

Result of nixpkgs-review pr 107892 1

1 package built:
  • herbe

@nixos-discourse

Copy link
Copy Markdown

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
Copy Markdown
Member

@wishfort36 can you add support to patches?

Comment thread pkgs/applications/misc/herbe/default.nix Outdated
Comment thread pkgs/applications/misc/herbe/default.nix Outdated
@wishfort36 wishfort36 force-pushed the herbe branch 2 times, most recently from 1205094 to 459e234 Compare December 31, 2020 15:10
@wishfort36

wishfort36 commented Dec 31, 2020

Copy link
Copy Markdown
Contributor Author

@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
Copy Markdown
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

AndersonTorres commented Dec 31, 2020

Copy link
Copy Markdown
Member

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
Copy Markdown
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

thiagokokada commented Dec 31, 2020

Copy link
Copy Markdown
Contributor

@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
Copy Markdown
Contributor Author

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

@thiagokokada

Copy link
Copy Markdown
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

Labels

8.has: package (new) This PR adds a new package 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants