htmldoc: fix darwin build (#178725)

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
This commit is contained in:
Chen 2022-07-24 03:16:47 +08:00 committed by GitHub
parent 241a178eda
commit ac4755181f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,4 @@
{ lib, stdenv, fetchFromGitHub, zlib, libpng, libjpeg, SystemConfiguration, Foundation, pkg-config }:
{ lib, stdenv, testers, fetchFromGitHub, zlib, libpng, libjpeg, SystemConfiguration, Foundation, pkg-config, htmldoc }:
stdenv.mkDerivation rec {
pname = "htmldoc";
@ -14,8 +14,18 @@ stdenv.mkDerivation rec {
buildInputs = [ zlib libpng libjpeg ]
++ lib.optionals stdenv.isDarwin [ Foundation SystemConfiguration ];
# do not generate universal binary on Darwin
# because it is not supported by Nix's clang
postPatch = ''
substituteInPlace configure --replace "-arch x86_64 -arch arm64" ""
'';
passthru.tests = testers.testVersion {
package = htmldoc;
command = "htmldoc --version";
};
meta = with lib; {
broken = stdenv.isDarwin;
description = "Converts HTML files to PostScript and PDF";
homepage = "https://michaelrsweet.github.io/htmldoc";
changelog = "https://github.com/michaelrsweet/htmldoc/releases/tag/v${version}";