liburing: Fix references between outputs issue

Experienced in:
https://github.com/NixOS/nixpkgs/pull/98869#discussion_r495492213

Set configure flags properly, don't override configurePhase, per:
https://github.com/jtojnar/nixpkgs-hammering/blob/master/explanations/explicit-phases.md

Use different output names - use $bin for examples, and $out for
libraries which expectedly should be referenced by reverse deps.
This commit is contained in:
Doron Behar 2020-09-27 12:35:07 +03:00
parent 7c1ce3b1e6
commit ac5e22734c

View File

@ -14,24 +14,32 @@ stdenv.mkDerivation rec {
separateDebugInfo = true; separateDebugInfo = true;
enableParallelBuilding = true; enableParallelBuilding = true;
# Upstream's configure script is not autoconf generated, but a hand written one.
outputs = [ "out" "lib" "dev" "man" ]; setOutputFlags = false;
preConfigure =
configurePhase = '' # We cannot use configureFlags or configureFlagsArray directly, since we
./configure \ # don't have structuredAttrs yet and using placeholder causes permissions
--prefix=$out \ # denied errors. Using $dev / $man in configureFlags causes bash evaluation
--includedir=$dev/include \ # errors
--libdir=$lib/lib \ ''
--mandir=$man/share/man \ configureFlagsArray+=(
"--includedir=$dev/include"
"--mandir=$man/share/man"
)
''; '';
# Copy the examples into $out. outputs = [ "out" "bin" "dev" "man" ];
postInstall = ''
mkdir -p $out/bin postInstall =
cp ./examples/io_uring-cp examples/io_uring-test $out/bin # Copy the examples into $bin. Most reverse dependency of this package should
cp ./examples/link-cp $out/bin/io_uring-link-cp # reference only the $out output
cp ./examples/ucontext-cp $out/bin/io_uring-ucontext-cp ''
''; mkdir -p $bin/bin
cp ./examples/io_uring-cp examples/io_uring-test $bin/bin
cp ./examples/link-cp $bin/bin/io_uring-link-cp
cp ./examples/ucontext-cp $bin/bin/io_uring-ucontext-cp
''
;
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "Userspace library for the Linux io_uring API"; description = "Userspace library for the Linux io_uring API";