GNOME Bugzilla – Bug 789725
Allow building tracker as a subproject of tracker-miners
Last modified: 2017-12-16 14:02:07 UTC
This branch (sam/meson-subproject) set lets us build tracker core as part of tracker-miners using Meson. The tricky part is that we can't have two targets called 'libtracker-common' in a combined build, so I've renamed the library to 'libtracker-miners-common' in the tracker-miners repo. I haven't updated the Autotools build system for this, but am happy to look at that if needed.
Created attachment 362672 [details] [review] meson: Add tracker core as a subproject This allows building tracker-miners and tracker core with a single invocation of Meson and Ninja. It also allows apps to embed their own copy of Tracker just by adding tracker-miners as a subproject in their Meson buildsystem.
Created attachment 362673 [details] [review] Rename libtracker-common to libtracker-miners-common We made a big compromise when splitting tracker core from tracker-miners in that the common code that was needed by both parts would end up duplicated. It's ugly but it works fine at the moment and allows us to keep all of the common code private. I had an issue when trying to embed tracker core into tracker-miners as a Meson subproject though. Having two targets named tracker-common caused confusion as duplicate targets aren't allowed, but they are not quite equivalent so we can't just pick one or the other. To work around this, I've renamed the copy in this repo to tracker-miners-common. This only affects the target names, not the actual function names.
Created attachment 364907 [details] [review] Rename libtracker-common to libtracker-miners-common We made a big compromise when splitting tracker core from tracker-miners in that the common code that was needed by both parts would end up duplicated. It's ugly but it works fine at the moment and allows us to keep all of the common code private. I had an issue when trying to embed tracker core into tracker-miners as a Meson subproject though. Having two targets named tracker-common caused confusion as duplicate targets aren't allowed, but they are not quite equivalent so we can't just pick one or the other. To work around this, I've renamed the copy in this repo to tracker-miners-common. This only affects the target names, not the actual function names.
Created attachment 364908 [details] [review] meson: Add tracker core as a subproject This allows building tracker-miners and tracker core with a single invocation of Meson and Ninja. It also allows apps to embed their own copy of Tracker just by adding tracker-miners as a subproject in their Meson buildsystem.
Comment on attachment 364907 [details] [review] Rename libtracker-common to libtracker-miners-common Looks good! I already see some candidates for cleanup (eg. the vapi file is unused), but it's not within the scope of this patch :). I guess this means commit 9afd9afc67a2ccbe4d8eee59a4b9be796e794f2d in the tracker repo can be reverted?
Comment on attachment 364908 [details] [review] meson: Add tracker core as a subproject Neat :). I find subproject() vs false somewhat odd... is the else path any essential?
The else path is from an old version of the patch, it can be removed. And yes, 9afd9afc67a2ccbe4d8eee59a4b9be796e794f2d can be reverted now -- I'll do that after the merge.