Gentoo Archives: gentoo-commits

From: Michael Haubenwallner <haubi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/pthreads4w/
Date: Mon, 09 Mar 2020 14:56:17
Message-Id: 1583765727.b78bd34e77ae5d95572423c0cb121c6aae4cda95.haubi@gentoo
1 commit: b78bd34e77ae5d95572423c0cb121c6aae4cda95
2 Author: Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
3 AuthorDate: Mon Mar 9 14:40:15 2020 +0000
4 Commit: Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
5 CommitDate: Mon Mar 9 14:55:27 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b78bd34e
7
8 dev-libs/pthreads4w: new: pthreads for native Win32
9
10 Package-Manager: Portage-2.3.84, Repoman-2.3.20
11 Signed-off-by: Michael Haubenwallner <haubi <AT> gentoo.org>
12
13 dev-libs/pthreads4w/Manifest | 1 +
14 dev-libs/pthreads4w/metadata.xml | 12 +++++
15 dev-libs/pthreads4w/pthreads4w-3.0.0.ebuild | 69 +++++++++++++++++++++++++++++
16 3 files changed, 82 insertions(+)
17
18 diff --git a/dev-libs/pthreads4w/Manifest b/dev-libs/pthreads4w/Manifest
19 new file mode 100644
20 index 00000000000..b6ffdf2e885
21 --- /dev/null
22 +++ b/dev-libs/pthreads4w/Manifest
23 @@ -0,0 +1 @@
24 +DIST pthreads4w-code-v3.0.0.zip 862409 BLAKE2B cd23103c92f8eaa2088fdd68cfc94655771d44c365ca32180395cdb8645b570c2f65620d3c2969671a48c6ac45889bc439f3490dc7ec2497dfeca9f758cda6cd SHA512 49e541b66c26ddaf812edb07b61d0553e2a5816ab002edc53a38a897db8ada6d0a096c98a9af73a8f40c94283df53094f76b429b09ac49862465d8697ed20013
25
26 diff --git a/dev-libs/pthreads4w/metadata.xml b/dev-libs/pthreads4w/metadata.xml
27 new file mode 100644
28 index 00000000000..30aaf1fdc57
29 --- /dev/null
30 +++ b/dev-libs/pthreads4w/metadata.xml
31 @@ -0,0 +1,12 @@
32 +<?xml version="1.0" encoding="UTF-8"?>
33 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
34 +<pkgmetadata>
35 + <maintainer type="person">
36 + <email>haubi@g.o</email>
37 + <name>Michael Haubenwallner</name>
38 + </maintainer>
39 + <longdescription lang="en">
40 + Also known as "pthreads-win32", POSIX Threads for Windows implements a large
41 + subset of the threads related API from the Single Unix Specification Version 3.
42 + </longdescription>
43 +</pkgmetadata>
44
45 diff --git a/dev-libs/pthreads4w/pthreads4w-3.0.0.ebuild b/dev-libs/pthreads4w/pthreads4w-3.0.0.ebuild
46 new file mode 100644
47 index 00000000000..3403767ab1f
48 --- /dev/null
49 +++ b/dev-libs/pthreads4w/pthreads4w-3.0.0.ebuild
50 @@ -0,0 +1,69 @@
51 +# Copyright 2019-2020 Gentoo Authors
52 +# Distributed under the terms of the GNU General Public License v2
53 +
54 +EAPI=7
55 +
56 +DESCRIPTION="POSIX Threads for Windows"
57 +HOMEPAGE="http://pthreads4w.sourceforge.net/"
58 +SRC_URI="mirror://sourceforge/${PN}/${PN}-code-v${PV}.zip"
59 +
60 +LICENSE="LGPL-2"
61 +SLOT="0"
62 +KEYWORDS="~x86-winnt"
63 +IUSE=""
64 +
65 +DEPEND=""
66 +RDEPEND="${DEPEND}"
67 +BDEPEND="sys-devel/parity"
68 +
69 +S=${WORKDIR}/${PN}-code-07053a521b0a9deb6db2a649cde1f828f2eb1f4f
70 +
71 +src_compile() {
72 + # from pthreads.h:
73 + # Note: Unless the build explicitly defines one of the following, then
74 + # we default to standard C style cleanup. This style uses setjmp/longjmp
75 + # in the cancellation and thread exit implementations and therefore won't
76 + # do stack unwinding if linked to applications that have it (e.g.
77 + # C++ apps). This is currently consistent with most/all commercial Unix
78 + # POSIX threads implementations.
79 + local variant="VC" # C style cleanup
80 +
81 + case ${CHOST} in
82 + *-libcmtd*) variant+="-static-debug" ;;
83 + *-libcmt*) variant+="-static" ;;
84 + *-msvcd*) variant+="-debug" ;;
85 + *-msvc*) ;;
86 + esac
87 +
88 + case ${CHOST} in
89 + x86_64-*) variant+=" TARGET_CPU=x64" ;;
90 + i?86-*) variant+=" TARGET_CPU=x86" ;;
91 + esac
92 +
93 + ${CHOST}-nmake -f Makefile ${variant} || die
94 +}
95 +
96 +src_install() {
97 + local V=$(ver_cut 1)
98 + case ${CHOST} in
99 + *-libcmtd*|*-msvcd*) V+="d" ;; # debug CRT
100 + esac
101 + case ${CHOST} in
102 + *-libcmt*) # static CRT
103 + dolib.so libpthreadVC${V}.lib
104 + newlib.so libpthreadVC${V}.lib libpthread.lib # for -lpthread
105 + ;;
106 + *-msvc*) # dynamic CRT
107 + dobin pthreadVC${V}.dll
108 + dolib.so pthreadVC${V}.lib
109 + newlib.so pthreadVC${V}.lib pthread.lib # for -lpthread
110 + ;;
111 + esac
112 + insinto /usr/include
113 + doins {pthread,sched,semaphore,_ptw32}.h
114 + einstalldocs
115 +}
116 +
117 +src_test() {
118 + ${CHOST}-nmake -DEXHAUSTIVE all-tests || die
119 +}