X-Original-To: alpine-devel@lists.alpinelinux.org Received: from mail-qt0-f194.google.com (mail-qt0-f194.google.com [209.85.216.194]) by lists.alpinelinux.org (Postfix) with ESMTP id EC3385C5EA3 for ; Wed, 16 May 2018 04:13:03 +0000 (GMT) Received: by mail-qt0-f194.google.com with SMTP id h2-v6so3352544qtp.7 for ; Tue, 15 May 2018 21:13:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dereferenced-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=i4ntYJ0XWlq7RCC5AxpjHPCSGp+or9YhXBXXMTDh9Pc=; b=ZLcsULQP2YwwiBMMBiDj8nPZm3qc1kl/VlCh9rvYy0b37Rg5QgiNijB1Q/j2UxFjjN R47TvHOgpX8Az6pvA0u5eT3dkVP308nraa38zS4JTxN4Lvxcyatz69w0E+uwiKxUjqhl Vu88sVeRZflNG7gfUuUAlp0MiCPSIa4AZdOYAEHbgue0LP2aMHMYVhjaN3XRb5TmTq1/ /nhqoAaxZUoWVPjYKbIRNaTSxDi+jNnMTQYguFn5c9HpEEEXuLlO2HrFZEZuug4XU66x RuK9mTFVG3RlVJ8V8ETuGoNz/mtL8ib0T3bflQFMVLqlUllm88x7fSlDLRQ+6ESjhgWJ wbmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=i4ntYJ0XWlq7RCC5AxpjHPCSGp+or9YhXBXXMTDh9Pc=; b=p3YLR1Fhz18PrHg6LU34ssrfq5dphakPVIGpm+W9JqJcUWrSZbDU09P6CFY6L0BPD4 FJXaJt9ba0kormp5j3huAJAb3M/3BX9kgQOqpCbij6oNxBCGIwIJ9PMjgjNw4bCT5PHt 2rJ4ekMx58w6o6iSDowl9AUPLfJcGzeosfkbUE9aQ5VFHQCHCN7rs32X8YUBwij7wopS ph1Pj/YYbytZIyNOOIOPmfWNNWfwQh61J5VnahwVO9kOQB6ACqR86sRr6YD3+xslN/Bz 6nKLSrMfwOxs7zv3GpcZVpVwuWgO98LrYI8VgUeu4eEpSjQdglJ/dSIAZMfi8rRSdsY2 5Ivg== X-Gm-Message-State: ALKqPwdlflssil8Fc1/sCyj99+68AGhpuCpTXbkWvSX11ao7EOi+/OtG kLx6TcwYe3ADe5JrAWOrxm4rEFdMo1aVgJRwjdh35Q== X-Google-Smtp-Source: AB8JxZrV7xhOC915mlvZH7kcqhokqrcfRf6bTtS0UR6HkXhdsnVhxLdIBurZVRoCDlyi5k44J9J9iSguS1b/IXHrXcw= X-Received: by 2002:a0c:e78a:: with SMTP id x10-v6mr16135461qvn.13.1526443983337; Tue, 15 May 2018 21:13:03 -0700 (PDT) X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: MIME-Version: 1.0 Received: by 2002:ac8:1d12:0:0:0:0:0 with HTTP; Tue, 15 May 2018 21:13:02 -0700 (PDT) In-Reply-To: References: <5ad90a46-8c78-ebdd-e022-a94fe7937805@bitmessage.ch> From: William Pitcock Date: Tue, 15 May 2018 23:13:02 -0500 Message-ID: Subject: Re: [alpine-devel] apk and libraries that optionally replace others To: Oliver Smith Cc: alpine-dev Content-Type: text/plain; charset="UTF-8" Hello, On Tue, May 15, 2018 at 11:08 PM, William Pitcock wrote: > Hello, > > On Tue, May 15, 2018 at 3:57 PM, Oliver Smith > wrote: >> Hey folks, >> >> in Alpine based postmarketOS we have hit the following use case quite a >> few times by now, and we're wondering how to solve it properly: >> Packaging "testlib-b" as a _optional_ replacement for "testlib-a". >> >> Both "testlib-a" and "testlib-b" provide the same soname, which means >> abuild will automatically make both binary packages provide >> "so:libtestlib.so.1". > > By default this means that both packages will provide > so:libtestlib.so.1 with provider_priority 0. When provider_priority > is 0, it means to skip automatically resolving the provider. Provider > selection is based on a combination of priority and overall "cost" of > choosing that provider. apk will prefer the highest priority provider > with the lowest cost (dependency chain length) that can yield a > satiable solution. > >> Now there is a "testapp" package, which has "testlib-a" in makedepends >> and links against "libtestlib.so.1". Therefore abuild puts >> "so:libtestlib.so.1" in the depends of "testapp". What we would like to >> achieve is, that whenever installing "testapp", it pulls in "testlib-a". >> But when "testlib-b" is already installed, it uses "testlib-b" instead >> of "testlib-a". > > testlib-b (libdrm) should have provider_priority 1, testlib-a > (libdrm-grate) should have provider_priority greater than 1. The > provides field itself should be left alone. The key is to set a > priority on both providers, otherwise APK will treat it as a collision > and behave as you describe. For what it's worth, I am open to adding provider_priority=1 to libdrm. But it's not my package, so I prefer to hear from ncopa who maintains it first. Otherwise, you will need to rebuild the package. William --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---