I am trying to package GitHub - philippe44/AirConnect: Use AirPlay to stream to UPnP/Sonos & Chromecast devices .
It seems to contain the source to build two binaries, both written in C: aircast
and airupnp
.
I am expecting to build both as part of the buildPhase
, and I had to start somewhere: I am trying to build aircast
.
Dependencies
As per its Makefile
, it needs the sources of its dependencies to be located at ../..
.
That’s okay, I added the following attrset to the derivation:
requirements = {
jansson = fetchFromGitHub {
repo = "jansson";
owner = "akheron";
rev = "v2.13.1";
sha256 = "sha256-41QQ3PxNnvQQmX2cLBZgAVCJVZofDb6a/i5WpsG6lHo=";
};
... # rest omitted for brevity
};
and I use it to replace parts of the Makefile
content to point the right place leveraging the patchPhase
.
Some dependencies need extra elbow grease
That’s where things get complicated: some dependencies do not have the libraries to be included directly available in their source!
For example GitHub - akheron/jansson: C library for encoding, decoding and manipulating JSON data requires to perform:
autoreconf -i
./configure
to create jansson_config.h
(which is include
d by aircast
).
My effort
I tried to use autoconf
and automake
“manually” on jansson
as part of the buildPhase
, but autom4te
fails to create its necessary autom4te.cache
.
I stumbled upon autoreconHook
in the nixpkgs
documentation, and naively tried to add runHook autoreconf
in the buildPhase
, but nothing happened (I suspect this automagically works on the derivation’s source, not the folder I was in - ${requirements.jansson}/
).
My questions
If I am on the right path, how can I ./configure
on sources that are not the main sources of my derivation (jansson
and not aircast
) to create the necessary ${requirements.jansson}/src/jansson_config.h}
?
Am I going too hard agains’t the flow, and there is a nix way to handle these cases (other sources required with different configuration systems) elegantly?