Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 lib, 3 stdenv, 4 fetchurl, 5 cctools, 6 disablePosixThreads ? false, 7}: 8 9stdenv.mkDerivation (finalAttrs: { 10 pname = "libmcrypt"; 11 version = "2.5.8"; 12 13 src = fetchurl { 14 url = "mirror://sourceforge/mcrypt/Libmcrypt/${finalAttrs.version}/libmcrypt-${finalAttrs.version}.tar.gz"; 15 hash = "sha256-5OtsB0u6sWisR7lHwZX/jO+dUaIRzdGMqcnvNNJ6Nz4="; 16 }; 17 18 buildInputs = lib.optional stdenv.hostPlatform.isDarwin cctools; 19 20 configureFlags = 21 lib.optionals disablePosixThreads [ "--disable-posix-threads" ] 22 ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ 23 # AC_FUNC_MALLOC is broken on cross builds. 24 "ac_cv_func_malloc_0_nonnull=yes" 25 "ac_cv_func_realloc_0_nonnull=yes" 26 ]; 27 28 env.NIX_CFLAGS_COMPILE = toString [ 29 "-Wno-implicit-function-declaration" 30 "-Wno-implicit-int" 31 ]; 32 33 meta = { 34 description = "Replacement for the old crypt() package and crypt(1) command, with extensions"; 35 mainProgram = "libmcrypt-config"; 36 homepage = "https://mcrypt.sourceforge.net"; 37 license = lib.licenses.lgpl21Plus; 38 platforms = lib.platforms.all; 39 }; 40})