Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#80034 - [docopt] static lib is not included in the package but cmake requires it

Attached to Project: Arch Linux
Opened by Techmeology (Techmeology) - Friday, 20 October 2023, 21:32 GMT
Last edited by Alexander F. Rødseth (xyproto) - Friday, 10 November 2023, 16:21 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Alexander F. Rødseth (xyproto)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

The static library, `libdocopt.a`, is not included in the `docopt` package, but its CMake configure script requires it. Note that when the upstream package is built in Release mode, it generates both the static library and shared library. The `PKGBUILD` for this package installed both when I built it locally, too. But the package that's available in the Arch repository does not include it.

Additional info:
* package version(s): docopt 0.6.3-3

Steps to reproduce:

1. Run `sudo pacman -S docopt`.
2. Run `echo find_package(docopt REQUIRED) > CMakeLists.txt`.
3. Run `cmake`

You'll get an error message like this:

```
CMake Error at /usr/lib/cmake/docopt/docopt-targets.cmake:96 (message):
The imported target "docopt_s" references the file

"/usr/lib/libdocopt.a"

but this file does not exist. Possible reasons include:

* The file was deleted, renamed, or moved to another location.

* An install or uninstall procedure did not complete successfully.

* The installation package was faulty and contained

"/usr/lib/cmake/docopt/docopt-targets.cmake"

but not all the files it references.

Call Stack (most recent call first):
/usr/lib/cmake/docopt/docopt-config.cmake:1 (include)
CMakeLists.txt:1 (find_package)
```
This task depends upon

Closed by  Alexander F. Rødseth (xyproto)
Friday, 10 November 2023, 16:21 GMT
Reason for closing:  Fixed
Comment by Toolybird (Toolybird) - Friday, 20 October 2023, 21:57 GMT
This is a recurring theme. Arch policy generally is don't ship static libs (for security reasons, but of course with exceptions). Even if built they are rm'd by makepkg unless 'options=(staticlibs)' is added to PKGBUILD.

Please see  FS#78687   FS#72726   FS#72720   FS#72315  for some recent examples.

Ideally, the upstream CMake files need to cater to building without static libs.

Edit: please also see  FS#60208 . If no response from PM, this ticket will be marked as a dupe of that one.
Comment by loqs (loqs) - Friday, 20 October 2023, 22:20 GMT
Please try the attached diff that applies [1] and sets BUILD_SHARED_LIBS=ON.

[1] https://github.com/docopt/docopt.cpp/commit/6d3b803d2b0e4bf8703bbfa51a67f378d6bd59f6
Comment by Techmeology (Techmeology) - Saturday, 21 October 2023, 04:55 GMT
I can confirm that the diff attached by loqs fixes the problem.

Loading...