libcdio: make manpages optional

manpages fail to cross compile
This commit is contained in:
jopejoe1
2025-05-04 11:40:46 +02:00
parent 05d05a92fa
commit be3845b696

View File

@@ -11,6 +11,7 @@
ncurses,
help2man,
libiconv,
withMan ? stdenv.buildPlatform.canExecute stdenv.hostPlatform,
}:
stdenv.mkDerivation (finalAttrs: {
@@ -28,26 +29,38 @@ stdenv.mkDerivation (finalAttrs: {
NIX_CFLAGS_COMPILE = "-D_LARGEFILE64_SOURCE";
};
postPatch = ''
patchShebangs .
echo "
@set UPDATED 1 January 1970
@set UPDATED-MONTH January 1970
@set EDITION ${finalAttrs.version}
@set VERSION ${finalAttrs.version}
" > doc/version.texi
'';
postPatch =
''
patchShebangs .
echo "
@set UPDATED 1 January 1970
@set UPDATED-MONTH January 1970
@set EDITION ${finalAttrs.version}
@set VERSION ${finalAttrs.version}
" > doc/version.texi
''
+ lib.optionalString (!withMan) ''
substituteInPlace src/Makefile.am \
--replace-fail 'man_cd_drive = cd-drive.1' "" \
--replace-fail 'man_cd_info = cd-info.1' "" \
--replace-fail 'man_cd_read = cd-read.1' "" \
--replace-fail 'man_iso_info = iso-info.1' "" \
--replace-fail 'man_iso_read = iso-read.1' ""
'';
configureFlags = [
(lib.enableFeature true "maintainer-mode")
(lib.enableFeature withMan "maintainer-mode")
];
nativeBuildInputs = [
pkg-config
help2man
autoreconfHook
texinfo
];
nativeBuildInputs =
[
pkg-config
autoreconfHook
texinfo
]
++ lib.optionals withMan [
help2man
];
buildInputs = [
libcddb
@@ -59,13 +72,16 @@ stdenv.mkDerivation (finalAttrs: {
doCheck = !stdenv.hostPlatform.isDarwin;
outputs = [
"out"
"lib"
"dev"
"info"
"man"
];
outputs =
[
"out"
"lib"
"dev"
"info"
]
++ lib.optionals withMan [
"man"
];
passthru = {
tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;