1 { lib, stdenv, fetchurl, buildPackages, autoreconfHook }:
3 stdenv.mkDerivation rec {
8 url = "mirror://apache/apr/${pname}-${version}.tar.bz2";
9 hash = "sha256-zQ9dUrmrFwTHIWDF7j7V09TKLfSn+KtWTjyzUrZyMvI=";
13 ./cross-assume-dev-zero-mmappable.patch
16 # This test needs the net
21 outputs = [ "out" "dev" ];
26 configureFlagsArray+=("--with-installbuilddir=$dev/share/build")
29 configureFlags = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
30 # For cross builds, provide answers to the configure time tests.
31 # These answers are valid on x86_64-linux and aarch64-linux.
32 "ac_cv_file__dev_zero=yes"
33 "ac_cv_func_setpgrp_void=yes"
34 "apr_cv_tcp_nodelay_with_cork=yes"
35 "ac_cv_define_PTHREAD_PROCESS_SHARED=yes"
36 "apr_cv_process_shared_works=yes"
37 "apr_cv_mutex_robust_shared=yes"
38 "ap_cv_atomic_builtins=yes"
39 "apr_cv_mutex_recursive=yes"
41 "apr_cv_epoll_create1=yes"
44 "apr_cv_sock_cloexec=yes"
45 "ac_cv_struct_rlimit=yes"
46 "ac_cv_func_sem_open=yes"
47 "ac_cv_negative_eai=yes"
48 "apr_cv_gai_addrconfig=yes"
49 "ac_cv_o_nonblock_inherited=no"
50 "apr_cv_pthreads_lib=-lpthread"
51 "CC_FOR_BUILD=${buildPackages.stdenv.cc}/bin/cc"
52 ] ++ lib.optionals (stdenv.hostPlatform.system == "i686-cygwin") [
53 # Including the Windows headers breaks unistd.h.
54 # Based on ftp://sourceware.org/pub/cygwin/release/libapr1/libapr1-1.3.8-2-src.tar.bz2
55 "ac_cv_header_windows_h=no"
58 # - Update libtool for macOS 11 support
59 # - Regenerate for cross fix patch
60 nativeBuildInputs = [ autoreconfHook ];
64 enableParallelBuilding = true;
67 homepage = "https://apr.apache.org/";
68 description = "Apache Portable Runtime library";
69 mainProgram = "apr-1-config";
70 platforms = platforms.all;
71 license = licenses.asl20;