forgejo-lts: 7.0.10 -> 7.0.11
[NixPkgs.git] / pkgs / development / libraries / apr / default.nix
blob7d127f9367c0fa3311459e1b1ba7c3bc00cfd4bb
1 { lib, stdenv, fetchurl, buildPackages, autoreconfHook }:
3 stdenv.mkDerivation rec {
4   pname = "apr";
5   version = "1.7.5";
7   src = fetchurl {
8     url = "mirror://apache/apr/${pname}-${version}.tar.bz2";
9     hash = "sha256-zQ9dUrmrFwTHIWDF7j7V09TKLfSn+KtWTjyzUrZyMvI=";
10   };
12   patches = [
13     ./cross-assume-dev-zero-mmappable.patch
14   ];
16   # This test needs the net
17   postPatch = ''
18     rm test/testsock.*
19   '';
21   outputs = [ "out" "dev" ];
22   outputBin = "dev";
24   preConfigure =
25     ''
26       configureFlagsArray+=("--with-installbuilddir=$dev/share/build")
27     '';
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"
40     "apr_cv_epoll=yes"
41     "apr_cv_epoll_create1=yes"
42     "apr_cv_dup3=yes"
43     "apr_cv_accept4=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"
56   ];
58   # - Update libtool for macOS 11 support
59   # - Regenerate for cross fix patch
60   nativeBuildInputs = [ autoreconfHook ];
62   doCheck = true;
64   enableParallelBuilding = true;
66   meta = with lib; {
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;
72     maintainers = [ ];
73   };