Re: arch triplet: "-" <> "_"

2019-03-03 Thread Andreas Hasenack
On Thu, Feb 28, 2019 at 9:53 PM Colin Watson  wrote:

> This seems OK.  If you wanted to be more precise, then you could
> calculate the appropriate respelling of the architecture name in
> debian/rules, stash it in an environment variable, and substitute that
> using dh-exec (see dh-exec-subst(1)).  But it's probably not worth it.

Right, later I saw this being used in another package:
override_dh_install:
DEB_PY2_INCDIR=$(shell python-config --includes | sed
's,^-I\([^ ]*\).*,\1,') \
DEB_PY3_INCDIR=$(shell python3-config --includes | sed
's,^-I\([^ ]*\).*,\1,') \
dh_install --list-missing

And then in the install files:
#! /usr/bin/dh-exec
usr/include/pytalloc.h ${DEB_PY2_INCDIR}

and
#! /usr/bin/dh-exec
usr/include/pytalloc.h ${DEB_PY3_INCDIR}

Handy trick for when more elaborate var expanstions are needed.




>
> --
> Colin Watson[cjwat...@canonical.com]

-- 
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: arch triplet: "-" <> "_"

2019-03-01 Thread Dmitry Shachnev
On Thu, Feb 28, 2019 at 03:11:35PM -0800, Steve Langasek wrote:
> No, since x86-64-linux-gnu is not a standard name for the architecture.  I
> would suggest that you instead simply use the dh-exec substitution for the
> first part of the path, and a glob for the second:
>
>   usr/lib/${DEB_HOST_MULTIARCH}/libpytalloc-util.cpython-37m-*.so.*
>
> That should minimize any false-positive matches of the glob.

I would suggest a correction that does not hardcode Python version (37m):

  usr/lib/${DEB_HOST_MULTIARCH}/libpytalloc-util.cpython-3*.so.*

--
Dmitry Shachnev


signature.asc
Description: PGP signature
-- 
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: arch triplet: "-" <> "_"

2019-02-28 Thread Colin Watson
On Thu, Feb 28, 2019 at 03:11:35PM -0800, Steve Langasek wrote:
> On Wed, Feb 27, 2019 at 02:08:29PM -0300, Andreas Hasenack wrote:
> > So I thought about using dh-exec, just like
> > https://wiki.debian.org/Multiarch/Implementation#Dynamic_debian.2F.2A_files
> > suggests, but that didn't work.
> 
> > The silly problem is that the triplet x86_64-linux-gnu as a directory
> > is not the same triplet used in the filename: x86_64-linux-gnu !=
> > x86-64-linux-gnu ("-" vs "_")
> 
> > Is there a neat solution to this, other than using "*" for the architecture?
> 
> No, since x86-64-linux-gnu is not a standard name for the architecture.  I
> would suggest that you instead simply use the dh-exec substitution for the
> first part of the path, and a glob for the second:
> 
>   usr/lib/${DEB_HOST_MULTIARCH}/libpytalloc-util.cpython-37m-*.so.*
> 
> That should minimize any false-positive matches of the glob.

This seems OK.  If you wanted to be more precise, then you could
calculate the appropriate respelling of the architecture name in
debian/rules, stash it in an environment variable, and substitute that
using dh-exec (see dh-exec-subst(1)).  But it's probably not worth it.

-- 
Colin Watson[cjwat...@canonical.com]

-- 
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


Re: arch triplet: "-" <> "_"

2019-02-28 Thread Steve Langasek
Hi Andreas,

On Wed, Feb 27, 2019 at 02:08:29PM -0300, Andreas Hasenack wrote:
> I'm working on the talloc package, and it installs this file when
> building python3 bindings:

> usr/lib/x86_64-linux-gnu/libpytalloc-util.cpython-37m-x86-64-linux-gnu.so.2.1.16

> I can't put that literally in a d/.install file, because of the
> architecture. The path component after usr/lib can be replaced by "*",
> but using "*" for the bit in the filename seems it could match
> something else by mistake:

> usr/lib/*/libpytalloc-util.cpython-37m-*.so.*

> So I thought about using dh-exec, just like
> https://wiki.debian.org/Multiarch/Implementation#Dynamic_debian.2F.2A_files
> suggests, but that didn't work.

> The silly problem is that the triplet x86_64-linux-gnu as a directory
> is not the same triplet used in the filename: x86_64-linux-gnu !=
> x86-64-linux-gnu ("-" vs "_")

> Is there a neat solution to this, other than using "*" for the architecture?

No, since x86-64-linux-gnu is not a standard name for the architecture.  I
would suggest that you instead simply use the dh-exec substitution for the
first part of the path, and a glob for the second:

  usr/lib/${DEB_HOST_MULTIARCH}/libpytalloc-util.cpython-37m-*.so.*

That should minimize any false-positive matches of the glob.

-- 
Steve Langasek   Give me a lever long enough and a Free OS
Debian Developer   to set it on, and I can move the world.
Ubuntu Developer   https://www.debian.org/
slanga...@ubuntu.com vor...@debian.org


signature.asc
Description: PGP signature
-- 
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel


arch triplet: "-" <> "_"

2019-02-27 Thread Andreas Hasenack
Hi,

I'm working on the talloc package, and it installs this file when
building python3 bindings:

usr/lib/x86_64-linux-gnu/libpytalloc-util.cpython-37m-x86-64-linux-gnu.so.2.1.16

I can't put that literally in a d/.install file, because of the
architecture. The path component after usr/lib can be replaced by "*",
but using "*" for the bit in the filename seems it could match
something else by mistake:

usr/lib/*/libpytalloc-util.cpython-37m-*.so.*

So I thought about using dh-exec, just like
https://wiki.debian.org/Multiarch/Implementation#Dynamic_debian.2F.2A_files
suggests, but that didn't work.

The silly problem is that the triplet x86_64-linux-gnu as a directory
is not the same triplet used in the filename: x86_64-linux-gnu !=
x86-64-linux-gnu ("-" vs "_")

Is there a neat solution to this, other than using "*" for the architecture?

-- 
ubuntu-devel mailing list
ubuntu-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel