Bug 239108 - databases/akonadi: Builds and links against database that are installed, even when disabled in OPTIONS
Summary: databases/akonadi: Builds and links against database that are installed, even...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-kde (group)
URL:
Keywords: needs-patch, needs-qa
Depends on:
Blocks:
 
Reported: 2019-07-10 09:52 UTC by Lapo Luchini
Modified: 2020-01-01 19:00 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (kde)
koobs: merge-quarterly?


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lapo Luchini 2019-07-10 09:52:50 UTC
Akonadi port seems to compile against MySQL (and using it as default backend) even if explicitly de-selected from the OPTIONS if it is found on the system:

┌──────────────────────────── akonadi-19.04.2_1 ───────────────────────────────┐
│ ┌──────────────────────────────────────────────────────────────────────────┐ │
│ │ [ ] DOCS    Build and/or install documentation                           │ │
│ │──────────────────────────────────── DB ──────────────────────────────────│ │
│ │ [ ] MYSQL   Install MySQL Qt plugin and server                           │ │
│ │ [ ] PGSQL   Install PostgreSQL Qt plugin                                 │ │
│ │ [x] SQLITE  Enable SQLite backend                                        │ │
│ └──────────────────────────────────────────────────────────────────────────┘ │
├──────────────────────────────────────────────────────────────────────────────┤
│                       <  OK  >            <Cancel>                           │
└──────────────────────────────────────────────────────────────────────────────┘

-- MySQL Server found: /usr/local/libexec/mysqld
-- PostgreSQL wasn't found. it is required to use the Postgres backend.
-- Found PkgConfig: /usr/local/bin/pkg-config (found version "1.6.1") 
-- Checking for module 'sqlite3'
--   Found sqlite3, version 3.28.0

[166/560] /usr/bin/c++  -DAKONADI_DATABASE_BACKEND=\"QMYSQL\"
Comment 1 Lapo Luchini 2019-07-10 09:53:39 UTC
If not found on the system, the output changes like this (it seems that it doesn't compile it… but still is the default backend):

-- MySQL Server wasn't found. it is required to use the MySQL backend.
-- PostgreSQL wasn't found. it is required to use the Postgres backend.
-- Found PkgConfig: /usr/local/bin/pkg-config (found version "1.6.1") 
-- Checking for module 'sqlite3'
--   Found sqlite3, version 3.28.0
-- Found Sqlite: /usr/local/include (Required is at least version "3.6.23") 
-- Looking for include file unistd.h
-- Looking for include file unistd.h - found
-- Using default db backend QMYSQL
Comment 2 Adriaan de Groot freebsd_committer freebsd_triage 2019-08-12 09:41:45 UTC
The backend issue -- it does not match the available backends if MySQL isn't available -- should be reported upstream; basically in akonadi/CMakeLists.txt

     set(DATABASE_BACKEND "MYSQL" CACHE STRING "The default database backend to use for Akonadi. Can be either MYSQL, POSTGRES or SQLITE")

that should account for the available backends (or, if you're changing the backends around, would could set DATABASE_BACKEND by hand).

At the ports level, the DB is a multiple-selection item, so we can't really set DATABASE_BACKEND based on the selection there (it'd be simpler if there were a radio button).
Comment 3 commit-hook freebsd_committer freebsd_triage 2020-01-01 18:56:13 UTC
A commit references this bug:

Author: adridg
Date: Wed Jan  1 18:55:32 UTC 2020
New revision: 521759
URL: https://svnweb.freebsd.org/changeset/ports/521759

Log:
  Massage databases/akonadi OPTIONS

   - Tidy use of CMake helpers
   - Shuffle bits around some
   - Make the default backend match the selected / enabled backends. For
     users of the default configuration this doesn't matter (builds MySQL,
     defaults to MySQL) but SQLite users who switch off MySQL still got
     MySQL as the backend.

  PR:		239108
  Reported by:	Lapo Luchini
  Reviewed by:	tcberner

Changes:
  head/databases/akonadi/Makefile