2019-06-16 19:59:06 +00:00
|
|
|
{ lib, runCommandCC, skawarePackages }:
|
2019-02-03 15:50:04 +00:00
|
|
|
|
|
|
|
with skawarePackages;
|
|
|
|
|
|
|
|
let
|
|
|
|
# From https://skarnet.org/software/misc/sdnotify-wrapper.c,
|
|
|
|
# which is unversioned.
|
|
|
|
src = ./sdnotify-wrapper.c;
|
|
|
|
|
|
|
|
in runCommandCC "sdnotify-wrapper" {
|
|
|
|
|
|
|
|
outputs = [ "bin" "doc" "out" ];
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "https://skarnet.org/software/misc/sdnotify-wrapper.c";
|
|
|
|
description = "Use systemd sd_notify without having to link against libsystemd";
|
|
|
|
platforms = lib.platforms.all;
|
|
|
|
license = lib.licenses.isc;
|
|
|
|
maintainers = with lib.maintainers; [ Profpatsch ];
|
|
|
|
};
|
|
|
|
|
|
|
|
} ''
|
|
|
|
mkdir -p $bin/bin
|
|
|
|
mkdir $out
|
|
|
|
|
2020-02-10 12:51:50 +00:00
|
|
|
# the -lskarnet has to come at the end to support static builds
|
2019-02-03 15:50:04 +00:00
|
|
|
$CC \
|
|
|
|
-o $bin/bin/sdnotify-wrapper \
|
|
|
|
-I${skalibs.dev}/include \
|
|
|
|
-L${skalibs.lib}/lib \
|
2020-02-10 12:51:50 +00:00
|
|
|
${src} \
|
|
|
|
-lskarnet
|
2019-02-03 15:50:04 +00:00
|
|
|
|
|
|
|
mkdir -p $doc/share/doc/sdnotify-wrapper
|
|
|
|
# copy the documentation comment
|
|
|
|
sed -ne '/Usage:/,/*\//p' ${src} > $doc/share/doc/sdnotify-wrapper/README
|
|
|
|
''
|