about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/poco/default.nix
blob: 029767aaa60824a1bf449af9e3d74472d5231508 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, zlib, pcre2, expat, sqlite, openssl, unixODBC, libmysqlclient }:

stdenv.mkDerivation rec {
  pname = "poco";

  version = "1.13.2";

  src = fetchFromGitHub {
    owner = "pocoproject";
    repo = "poco";
    sha256 = "sha256-GcwkGiui9j9RzMQyEEmqq8dxWzKpv5xWxJgvJpSMdbw=";
    rev = "poco-${version}-release";
  };

  nativeBuildInputs = [ cmake pkg-config ];

  buildInputs = [ unixODBC libmysqlclient ];
  propagatedBuildInputs = [ zlib pcre2 expat sqlite openssl ];

  outputs = [ "out" "dev" ];

  MYSQL_DIR = libmysqlclient;
  MYSQL_INCLUDE_DIR = "${MYSQL_DIR}/include/mysql";

  configureFlags = [
    "--unbundled"
  ];

  postFixup = ''
    grep -rlF INTERFACE_INCLUDE_DIRECTORIES "$dev/lib/cmake/Poco" | while read -r f; do
      substituteInPlace "$f" \
        --replace "$"'{_IMPORT_PREFIX}/include' ""
    done
  '';

  meta = with lib; {
    homepage = "https://pocoproject.org/";
    description = "Cross-platform C++ libraries with a network/internet focus";
    license = licenses.boost;
    maintainers = with maintainers; [ orivej tomodachi94 ];
    platforms = platforms.unix;
  };
}