We use `dpkg` 1.19.2 since 23661254e4.
This version dropped pkg_db_reset` in `<dpkg/dpkg_db.h>` 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.
It seems as without the appropriate linker flag `-lcrypto` the
`libcrypto.sh` can't be found by `ld` which broke one of the linker
processes during compilation.
See also https://hydra.nixos.org/build/87208819
As discussed in #51756, recently packaged versions of `lvm2` miss the
`lvm2app.h` header which breaks the osquery build.
Please note that this simply fixes the build and is not an upgrade. The
CMake patches are fairly diverged in constrast to the current upstream
packaging which requires a lot more effort I can't provide ATM.
cc @markuskowa @hedning
Latest bugfix release with the following notable changes:
* Memory leak resolve for dispatcher
(06d4865445)
* Fix include path on status.h
(5bd4984f2a)
Additionally the patch had to be rebased onto the 3.2.9 branch as it
added XCode support including some CLang flags (namely `-fno-limit-debug-info`)
which are unsupported on GCC.
(see bccc28dd98)
The 3.2.2 build fails ATM on Hydra: https://hydra.nixos.org/build/75998362
Bumping to 3.2.8 and rebasing `osquery/CMakeLists.txt` with `misc.patch`
fixes the issue. Additionally the NixOS test remains functional.
As suggested in https://github.com/NixOS/nixpkgs/pull/39416#discussion_r183845745
the versioning attributes in `lib` should be consistent to
`nixos/version` which implicates the following changes:
* `lib.trivial.version` -> `lib.trivial.release`
* `lib.trivial.suffix` -> `lib.trivial.versionSuffix`
* `lib.nixpkgsVersion` -> `lib.version`
As `lib.nixpkgsVersion` is referenced several times in `NixOS/nixpkgs`,
`NixOS/nix` and probably several user's setups. As the rename will cause
a notable impact it's better to keep `lib.nixpkgsVersion` as alias with
a warning yielded by `builtins.trace`.
The package was originally broken as reported in #38940 and
facebook/osquery#4257. The latest version (3.x) contains several
important fixes for GCC 7, so now we can compile without a much less
complicated patches.
The following changes were needed to fix the derivation:
* Upgrade `osquery/third-party` to the latest rev to be compliant with
osquery 3.
* Keep using an override for the AWS SDK (for a lower closure size and
less compile time), but make the `ec2` API available.
* Added the dependencies `fpm`, `zstd`, `rdkafka`, `rapidjson` to the
build. `linenoise-ng` is obsolete as it's directly bundled with
`osquery/third-party`.
* Fixed the linking issue with `gflags` as recommended in the mailing
list: https://groups.google.com/d/msg/nix-devel/l1blj-mWxtI/J3CwPATBCAAJ
* Dropped the obsolete dependencies `cpp-netlib`, `lz4`, `apt` and
`devicemapper` (thanks @Infinisil).
* Override `OSQUERY_PLATFORM` to provide `nixos:version`
for sandbox and non-NixOS based builds. The `platform-nixos.patch`
file is now obsolete (thanks @flokli).
The patch was rebased against the 3.x branch of `osquery` and contains
mostly old changes. Additionally several testing targets were skipped as
they broke the build.
The functionality has been testing using the following command:
```
mkdir /tmp/osq.log/
./result/bin/osqueryd --pidfile /tmp/osq.pid \
--database_path /tmp/test.db --logger_path /tmp/osq.log
```
With the daemon running the database can be queried easily using
`./result/bin/osqueryi`.
Fixes ticket #38940
See ticket #36453
Further reference can be gathered from the affected Hydra logs for
the master branch: https://hydra.nixos.org/job/nixos/trunk-combined/nixpkgs.osquery.x86_64-linux
* pkgs: refactor needless quoting of homepage meta attribute
A lot of packages are needlessly quoting the homepage meta attribute
(about 1400, 22%), this commit refactors all of those instances.
* pkgs: Fixing some links that were wrongfully unquoted in the previous
commit
* Fixed some instances