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

poweralertd: init at 0.1.0 #105165

Merged
merged 1 commit into from Apr 7, 2021
Merged

Conversation

ThibautMarty
Copy link
Member

Motivation for this change

poweralertd package from https://git.sr.ht/~kennylevinsen/poweralertd.

Things done

The package ships with a systemd user file which works, although I patched the meson.build file to put the service file in the derivation's output instead or trying to put it in /nix/store/…-systemd-246.6/lib/systemd/user.

Note: depends on #104920 for the maintainer entry.

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

@SuperSandro2000
Copy link
Member

@ofborg eval

Copy link
Contributor

@rmcgibbo rmcgibbo left a comment

Choose a reason for hiding this comment

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

Doesn't build, probably because of #115397

these 3 derivations will be built:
  /nix/store/w2rl7k1iq8cxnsn1i8nkvfqsnkvh0vx1-0.1.0.tar.gz.drv
  /nix/store/bddr62gq5wnyqzn8qr9zfvi9bfgjvnv8-poweralertd-0.1.0.drv
  /nix/store/fcnm0xxp4yjr928y41c7hbxpw63b5854-review-shell.drv
building '/nix/store/w2rl7k1iq8cxnsn1i8nkvfqsnkvh0vx1-0.1.0.tar.gz.drv'...


trying https://git.sr.ht/~kennylevinsen/poweralertd/archive/0.1.0.tar.gz
trying https://git.sr.ht/~kennylevinsen/poweralertd/archive/0.1.0.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
                                 Dload  Upload   Total   Spent    Left  Speed
100 39484    0 39484    0     0   264k      0 --:--:-- --:--:-- --:--:--  264k
100 39484    0 39484    0     0   264k      0 --:--:-- --:--:-- --:--:--  264k
hash mismatch in fixed-output derivation '/nix/store/dalkdaz6rwi9an09q12s0vbv0wijz30l-0.1.0.tar.gz':
  wanted: sha256:11b0lgrp7kyysvc8gh8w37ydig74j2bg0y885ir73w3pym6sy65a
  got:    sha256:16navzl54b42qasvi3ygqgikih3rxh9af0rakwpi7dz6xw646vn2
cannot build derivation '/nix/store/bddr62gq5wnyqzn8qr9zfvi9bfgjvnv8-poweralertd-0.1.0.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/fcnm0xxp4yjr928y41c7hbxpw63b5854-review-shell.drv': 1 dependencies couldn't be built

pkgs/tools/misc/poweralertd/default.nix Outdated Show resolved Hide resolved
@ThibautMarty
Copy link
Member Author

ThibautMarty commented Apr 4, 2021

I fixed the hash and used fetchFromSourcehut.

For the record, note that the package does not cross-compile because of (at least) a broken meson.build.
I did not had the time to fix all issues for now.
The patch should be submitted upstream anyway.

diff --git c/meson.build i/meson.build
index 6a7cb74..d2075aa 100644
--- c/meson.build
+++ i/meson.build
@@ -49,10 +49,11 @@ executable(
 	install: true,
 )
 
-scdoc = dependency('scdoc', required: get_option('man-pages'), version: '>= 1.9.7')
+scdoc = dependency('scdoc', required: get_option('man-pages'), version: '>= 1.9.7', native: true)
 
 if scdoc.found()
-	sh = find_program('sh')
+	scdoc_prog = find_program(scdoc.get_pkgconfig_variable('scdoc'), native: true)
+	sh = find_program('sh', native: true)
 
 	man_pages = ['poweralertd.1.scd']
 
@@ -68,7 +69,7 @@ if scdoc.found()
 			input: src,
 			output: output,
 			command: [
-				sh, '-c', '@0@ < @INPUT@ > @1@'.format(scdoc.get_pkgconfig_variable('scdoc'), output)
+				sh, '-c', '@0@ < @INPUT@ > @1@'.format(scdoc_prog.path(), output)
 			],
 			install: true,
 			install_dir: '@0@/man@1@'.format(mandir, section)

@ThibautMarty
Copy link
Member Author

Note that poweralertd.override { systemd = elogind; } builds as well.

@ThibautMarty
Copy link
Member Author

ThibautMarty commented Apr 5, 2021

I just force-pushed some modifications which make cross-compilation work (with the given patch, #117914 is needed too).
I submitted the patch upstream.

@SuperSandro2000 SuperSandro2000 merged commit a4abe29 into NixOS:master Apr 7, 2021
@ThibautMarty ThibautMarty deleted the poweralertd branch April 7, 2021 08:29
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