cps-org/cps-config

pc files with multiple static libraries

Closed this issue · 2 comments

What do we do about something like this:

{
    "name": "NSPR",
    "cps_version": "0.10.0",
    "version": "4.32.0",
    "description": "The Netscape Portable Runtime",
    "default_components": ["nspr4", "plc4", "plds4"],
    "components": {
        "nspr4": {
            "type": "archive",
            "includes": {"c": ["@prefix@/include/nspr"]},
            "location": "@prefix@/lib/x86_64-linux-gnu/libnspr4.a",
        },
        "plc4": {
            "type": "archive",
            "includes": {"c": ["@prefix@/include/nspr"]},
            "location": "@prefix@/lib/x86_64-linux-gnu/libplc4.a",
        },
        "plds4": {
            "type": "archive",
            "includes": {"c": ["@prefix@/include/nspr"]},
            "location": "@prefix@/lib/x86_64-linux-gnu/libplds4.a",
        }
    }
}

Should the behavior be similar to the multiple-dynamic libraries case, or different somehow?

For context here is the pc file:

prefix=/usr
exec_prefix=${prefix}
libdir=/usr/lib/x86_64-linux-gnu
includedir=${prefix}/include/nspr

Name: NSPR
Description: The Netscape Portable Runtime
Version: 4.32.0
Libs: -L/usr/lib/x86_64-linux-gnu -lplds4 -lplc4 -lnspr4
Cflags: -I${prefix}/include/nspr

Closing as this seems to work and is the recommended approach:

{
    "name": "NSPR",
    "cps_version": "0.10.0",
    "version": "4.32.0",
    "description": "The Netscape Portable Runtime",
    "default_components": ["nspr4"],
    "components": {
        "nspr4": {
            "type": "archive",
            "includes": {"*": ["@prefix@/include/nspr"]},
            "location": "@prefix@/lib/x86_64-linux-gnu/libnspr4.a",
            "requires": [":plc4", ":plds4"],
        },
        "plc4": {
            "type": "archive",
            "location": "@prefix@/lib/x86_64-linux-gnu/libplc4.a",
        },
        "plds4": {
            "type": "archive",
            "location": "@prefix@/lib/x86_64-linux-gnu/libplds4.a",
        }
    }
}