From 7a961cf06f8b0c7aaf8af693123ce3f926a295d7 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Wed, 13 Feb 2019 10:50:28 +0100 Subject: osquery: fix build We use `dpkg` 1.19.2 since 23661254e45d6eb47acad16a174637803637917a. This version dropped pkg_db_reset` in `` which broke compilation with the following errors: ``` /build/source/osquery/tables/system/linux/deb_packages.cpp: In function 'void osquery::tables::dpkg_setup(pkg_array*)': /build/source/osquery/tables/system/linux/deb_packages.cpp:83:3: error: 'pkg_array_init_from_db' was not declared in this scope pkg_array_init_from_db(packages); ^~~~~~~~~~~~~~~~~~~~~~ /build/source/osquery/tables/system/linux/deb_packages.cpp:83:3: note: suggested alternative: 'pkg_array_init_from_hash' pkg_array_init_from_db(packages); ^~~~~~~~~~~~~~~~~~~~~~ pkg_array_init_from_hash /build/source/osquery/tables/system/linux/deb_packages.cpp: In function 'void osquery::tables::dpkg_teardown(pkg_array*)': /build/source/osquery/tables/system/linux/deb_packages.cpp:93:3: error: 'pkg_db_reset' was not declared in this scope pkg_db_reset(); ^~~~~~~~~~~~ /build/source/osquery/tables/system/linux/deb_packages.cpp:93:3: note: suggested alternative: 'pkg_hash_reset' pkg_db_reset(); ^~~~~~~~~~~~ pkg_hash_reset make[2]: *** [osquery/tables/CMakeFiles/osquery_system_tables.dir/build.make:115: osquery/tables/CMakeFiles/osquery_system_tables.dir/system/linux/deb_packages.cpp.o] Error 1 ``` As there's currently no upstream fix, it's better to use an older version of `dpkg` for now. --- pkgs/tools/system/osquery/default.nix | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'pkgs/tools/system/osquery') diff --git a/pkgs/tools/system/osquery/default.nix b/pkgs/tools/system/osquery/default.nix index 32c085e2ec5f5..1e2882e1f1feb 100644 --- a/pkgs/tools/system/osquery/default.nix +++ b/pkgs/tools/system/osquery/default.nix @@ -4,7 +4,7 @@ , beecrypt, augeas, libxml2, sleuthkit, yara, lldpd, google-gflags , thrift, boost, rocksdb_lite, glog, gbenchmark, snappy , openssl, file, doxygen -, gtest, sqlite, fpm, zstd, rdkafka, rapidjson, fetchgit +, gtest, sqlite, fpm, zstd, rdkafka, rapidjson, fetchgit, fetchurl }: let @@ -61,6 +61,16 @@ stdenv.mkDerivation rec { sha256 = "1ny3srcsxd6kj59zq1cman5myj8kzw010wbyc6mrpk4kp823r5nx"; }; }); + + # dpkg 1.19.2 dropped api in `` which breaks compilation. + dpkg' = dpkg.overrideAttrs (old: rec { + name = "dpkg-${version}"; + version = "1.19.0.5"; + src = fetchurl { + url = "mirror://debian/pool/main/d/dpkg/dpkg_${version}.tar.xz"; + sha256 = "1dc5kp3fqy1k66fly6jfxkkg7w6d0jy8szddpfyc2xvzga94d041"; + }; + }); in [ udev audit @@ -69,7 +79,7 @@ stdenv.mkDerivation rec { customMemoryManagement = false; }) - lvm2' libgcrypt libarchive libgpgerror libuuid iptables dpkg + lvm2' libgcrypt libarchive libgpgerror libuuid iptables dpkg' lzma bzip2 rpm beecrypt augeas libxml2 sleuthkit yara lldpd gflags' thrift boost glog gbenchmark snappy openssl -- cgit 1.4.1