Hello experts,
I am trying to compile the project on mac x86-64 for mac aarch64 and getting the error:
make[2]: Entering directory '/private/tmp/nix-build-libidn2-aarch64-apple-darwin-2.3.4.drv-0/libidn2-2.3.4/doc'
/nix/store/7kc331g8kcpbrkaqyx7rnqd1mnkk08fm-bash-5.2-p15/bin/bash '/private/tmp/nix-build-libidn2-aarch64-apple-darwin-2.3.4.drv-0/libidn2-2.3.4/build-aux/missing' help2man --include=./idn2.h2m \
--output=idn2.1 ../src/idn2
help2man: can't get `--help' info from ../src/idn2
Try `--no-discard-stderr' if option outputs to stderr
make[2]: *** [Makefile:2277: idn2.1] Error 126
make[2]: Leaving directory '/private/tmp/nix-build-libidn2-aarch64-apple-darwin-2.3.4.drv-0/libidn2-2.3.4/doc'
make[1]: *** [Makefile:1657: all-recursive] Error 1
make[1]: Leaving directory '/private/tmp/nix-build-libidn2-aarch64-apple-darwin-2.3.4.drv-0/libidn2-2.3.4'
make: *** [Makefile:1565: all] Error 2
I have included help2man
and also libidn2.dev
.
I am not sure that the script is fine, but the one with the same logic works fine when compiling to aarch64 on x86-64 linux.
let
nixpkgs = fetchTarball "https://github.com/nixOS/nixpkgs/archive/23.05.tar.gz";
pkgs = (import nixpkgs {}).pkgsCross.aarch64-darwin;
in
pkgs.callPackage (
{ mkShell, cmake, ninja, git, pkg-config, help2man, automake }:
pkgs.llvmPackages_14.stdenv.mkDerivation {
pname = "prj";
version = "dev-bin";
src = ./.;
nativeBuildInputs = with pkgs;
[ cmake ninja git pkg-config help2man automake ];
buildInputs = with pkgs;
lib.forEach [
secp256k1 libsodium.dev libmicrohttpd.dev gmp.dev nettle.dev
libtasn1.dev
libidn2.dev
libunistring.dev gettext (gnutls.override { withP11-kit = false; }).dev
]
(x: x.overrideAttrs(oldAttrs: rec { configureFlags = (oldAttrs.configureFlags or []) ++ [ "--enable-static" "--disable-shared" "--disable-tests" ]; dontDisableStatic = true; }))
++ [
darwin.apple_sdk.frameworks.CoreFoundation
(openssl.override { static = true; }).dev
(zlib.override { shared = false; }).dev
(libiconv.override { enableStatic = true; enableShared = false; })
];
dontAddStaticConfigureFlags = true;
makeStatic = true;
configureFlags = [];
LDFLAGS = [
"-static-libstdc++"
"-framework CoreFoundation"
];
postInstall = ''
moveToOutput bin "$bin"
'';
outputs = [ "bin" "out" ];
}
) {}
Appreciate any advice on how to proceed. Thank you.