1 |
commit: cf58dfea3eb65e157aa56bc11cc795b49c629c1c |
2 |
Author: Aaron W. Swenson <titanofold <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Feb 18 19:03:37 2020 +0000 |
4 |
Commit: Aaron W. Swenson <titanofold <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Feb 18 19:03:44 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cf58dfea |
7 |
|
8 |
dev-db/pgagent: Fix pthread linking |
9 |
|
10 |
Bug: https://bugs.gentoo.org/688472 |
11 |
Package-Manager: Portage-2.3.84, Repoman-2.3.16 |
12 |
Signed-off-by: Aaron W. Swenson <titanofold <AT> gentoo.org> |
13 |
|
14 |
.../files/pgagent-4.0.0-pthreads-linking.patch | 33 +++++++++++++ |
15 |
dev-db/pgagent/pgagent-4.0.0-r1.ebuild | 55 ++++++++++++++++++++++ |
16 |
2 files changed, 88 insertions(+) |
17 |
|
18 |
diff --git a/dev-db/pgagent/files/pgagent-4.0.0-pthreads-linking.patch b/dev-db/pgagent/files/pgagent-4.0.0-pthreads-linking.patch |
19 |
new file mode 100644 |
20 |
index 00000000000..95f8e998f58 |
21 |
--- /dev/null |
22 |
+++ b/dev-db/pgagent/files/pgagent-4.0.0-pthreads-linking.patch |
23 |
@@ -0,0 +1,33 @@ |
24 |
+From 5b79460bdda286ca988b39e93e446176e8a781d1 Mon Sep 17 00:00:00 2001 |
25 |
+From: Neel Patel <neel.patel@××××××××××××.com> |
26 |
+Date: Fri, 20 Jul 2018 13:35:35 +0100 |
27 |
+Subject: [PATCH] Link with pthreads on non-Windows and non-macOS platforms. |
28 |
+ |
29 |
+Patch based on feedback and initial work by Christoph Berg. |
30 |
+--- |
31 |
+ CMakeLists.txt | 6 ++++++ |
32 |
+ 1 file changed, 6 insertions(+) |
33 |
+ |
34 |
+diff --git a/CMakeLists.txt b/CMakeLists.txt |
35 |
+index 1be24da..6f1eaa0 100755 |
36 |
+--- a/CMakeLists.txt |
37 |
++++ b/CMakeLists.txt |
38 |
+@@ -134,9 +134,15 @@ IF(WIN32) |
39 |
+ ENDIF(WIN32) |
40 |
+ |
41 |
+ ADD_EXECUTABLE(pgagent ${_srcs}) |
42 |
++IF(UNIX AND NOT APPLE) |
43 |
++TARGET_LINK_LIBRARIES( |
44 |
++ pgagent ${PG_LIBRARIES} ${Boost_LIBRARIES} -pthread |
45 |
++) |
46 |
++ELSE() |
47 |
+ TARGET_LINK_LIBRARIES( |
48 |
+ pgagent ${PG_LIBRARIES} ${Boost_LIBRARIES} |
49 |
+ ) |
50 |
++ENDIF() |
51 |
+ |
52 |
+ # Installation |
53 |
+ IF (WIN32) |
54 |
+-- |
55 |
+2.24.1 |
56 |
+ |
57 |
|
58 |
diff --git a/dev-db/pgagent/pgagent-4.0.0-r1.ebuild b/dev-db/pgagent/pgagent-4.0.0-r1.ebuild |
59 |
new file mode 100644 |
60 |
index 00000000000..fe9014a136f |
61 |
--- /dev/null |
62 |
+++ b/dev-db/pgagent/pgagent-4.0.0-r1.ebuild |
63 |
@@ -0,0 +1,55 @@ |
64 |
+# Copyright 1999-2020 Gentoo Authors |
65 |
+# Distributed under the terms of the GNU General Public License v2 |
66 |
+ |
67 |
+EAPI=7 |
68 |
+CMAKE_IN_SOURCE_BUILD=1 |
69 |
+ |
70 |
+inherit cmake-utils user |
71 |
+ |
72 |
+MY_PN=${PN/a/A} |
73 |
+ |
74 |
+KEYWORDS="~amd64 ~x86" |
75 |
+ |
76 |
+DESCRIPTION="${MY_PN} is a job scheduler for PostgreSQL" |
77 |
+HOMEPAGE="https://www.pgadmin.org/download/pgagent-source-code/" |
78 |
+SRC_URI="https://ftp.postgresql.org/pub/pgadmin/${PN}/${MY_PN}-${PV}-Source.tar.gz" |
79 |
+ |
80 |
+LICENSE="POSTGRESQL GPL-2" |
81 |
+SLOT="0" |
82 |
+ |
83 |
+RDEPEND="dev-db/postgresql:* |
84 |
+ dev-libs/boost |
85 |
+" |
86 |
+DEPEND="${RDEPEND}" |
87 |
+ |
88 |
+S="${WORKDIR}/${MY_PN}-${PV}-Source" |
89 |
+ |
90 |
+PATCHES=( "${FILESDIR}"/pgagent-4.0.0-pthreads-linking.patch ) |
91 |
+ |
92 |
+src_prepare() { |
93 |
+ cmake-utils_src_prepare |
94 |
+ |
95 |
+ sed -e "s:share):share/${P}):" \ |
96 |
+ -i CMakeLists.txt || die "failed to patch CMakeLists.txt" |
97 |
+} |
98 |
+ |
99 |
+src_configure() { |
100 |
+ mycmakeargs=( "-DSTATIC_BUILD:BOOLEAN=FALSE" |
101 |
+ ) |
102 |
+ cmake-utils_src_configure |
103 |
+} |
104 |
+ |
105 |
+src_install() { |
106 |
+ cmake-utils_src_install |
107 |
+ |
108 |
+ newinitd "${FILESDIR}/pgagent.initd-r1" "${PN}" |
109 |
+ newconfd "${FILESDIR}/pgagent.confd" "${PN}" |
110 |
+ |
111 |
+ rm "${ED}"/usr/{LICENSE,README} || die "failed to remove useless docs" |
112 |
+} |
113 |
+ |
114 |
+pkg_preinst() { |
115 |
+ # This user needs a real shell, and the daemon will use the |
116 |
+ # ~/.pgpass file from its home directory. |
117 |
+ enewuser pgagent -1 /bin/bash /home/pgagent |
118 |
+} |