nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at python-updates 65 lines 1.3 kB view raw
1{ 2 lib, 3 stdenv, 4 fetchFromGitHub, 5 cmake, 6 doxygen, 7}: 8 9stdenv.mkDerivation (finalAttrs: { 10 pname = "uri"; 11 version = "1.1.0"; 12 13 src = fetchFromGitHub { 14 owner = "cpp-netlib"; 15 repo = "uri"; 16 rev = "v${finalAttrs.version}"; 17 sha256 = "148361pixrm94q6v04k13s1msa04bx9yc3djb0lxpa7dlw19vhcd"; 18 }; 19 20 env.NIX_CFLAGS_COMPILE = toString ( 21 [ 22 "-Wno-error=parentheses" 23 # Needed with GCC 12 24 "-Wno-error=deprecated-declarations" 25 "-Wno-error=nonnull" 26 ] 27 ++ lib.optionals stdenv.cc.isClang [ 28 # Needed with Clang 16 29 "-Wno-error=deprecated-builtins" 30 ] 31 ); 32 33 nativeBuildInputs = [ 34 cmake 35 doxygen 36 ]; 37 38 cmakeFlags = [ 39 "-DUri_BUILD_TESTS=OFF" 40 "-DUri_BUILD_DOCS=ON" 41 "-DBUILD_SHARED_LIBS=ON" 42 ]; 43 44 # CMake 2.8 is deprecated and is no longer supported by CMake > 4 45 # https://github.com/NixOS/nixpkgs/issues/445447 46 postPatch = '' 47 substituteInPlace CMakeLists.txt --replace-fail \ 48 "cmake_minimum_required(VERSION 2.8)" \ 49 "cmake_minimum_required(VERSION 3.10)" 50 ''; 51 52 postBuild = "make doc"; 53 54 postInstall = '' 55 install -vd $out/share/doc 56 cp -vR html $out/share/doc 57 ''; 58 59 meta = { 60 description = "C++ URI library"; 61 homepage = "https://cpp-netlib.org"; 62 license = lib.licenses.boost; 63 platforms = lib.platforms.all; 64 }; 65})