1 |
commit: 9a5e23a882489d5ada36690e05a77382e630b398 |
2 |
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Nov 29 07:49:33 2016 +0000 |
4 |
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Nov 29 07:49:33 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9a5e23a8 |
7 |
|
8 |
dev-ruby/facter: fix icedtea compile. |
9 |
|
10 |
Package-Manager: portage-2.3.2 |
11 |
|
12 |
dev-ruby/facter/facter-3.5.0.ebuild | 1 + |
13 |
dev-ruby/facter/facter-9999.ebuild | 1 + |
14 |
dev-ruby/facter/files/facter-3.5.0-jar.patch | 34 ++++++++++++++++++++++++++++ |
15 |
3 files changed, 36 insertions(+) |
16 |
|
17 |
diff --git a/dev-ruby/facter/facter-3.5.0.ebuild b/dev-ruby/facter/facter-3.5.0.ebuild |
18 |
index 693d798..2e5cfca 100644 |
19 |
--- a/dev-ruby/facter/facter-3.5.0.ebuild |
20 |
+++ b/dev-ruby/facter/facter-3.5.0.ebuild |
21 |
@@ -41,6 +41,7 @@ src_prepare() { |
22 |
sed -i "s/lib\")/$(get_libdir)\")/g" CMakeLists.txt || die |
23 |
# patches |
24 |
epatch "${FILESDIR}/facter-3.5.0-collection-fix.patch" |
25 |
+ epatch "${FILESDIR}/facter-3.5.0-jar.patch" |
26 |
} |
27 |
|
28 |
src_configure() { |
29 |
|
30 |
diff --git a/dev-ruby/facter/facter-9999.ebuild b/dev-ruby/facter/facter-9999.ebuild |
31 |
index a313d53..08f66b7 100644 |
32 |
--- a/dev-ruby/facter/facter-9999.ebuild |
33 |
+++ b/dev-ruby/facter/facter-9999.ebuild |
34 |
@@ -43,6 +43,7 @@ src_prepare() { |
35 |
sed -i "s/\ lib)/\ $(get_libdir))/g" lib/CMakeLists.txt || die |
36 |
sed -i "s/lib\")/$(get_libdir)\")/g" CMakeLists.txt || die |
37 |
default |
38 |
+ epatch "${FILESDIR}/facter-3.5.0-jar.patch" |
39 |
} |
40 |
|
41 |
src_configure() { |
42 |
|
43 |
diff --git a/dev-ruby/facter/files/facter-3.5.0-jar.patch b/dev-ruby/facter/files/facter-3.5.0-jar.patch |
44 |
new file mode 100644 |
45 |
index 00000000..36b5279 |
46 |
--- /dev/null |
47 |
+++ b/dev-ruby/facter/files/facter-3.5.0-jar.patch |
48 |
@@ -0,0 +1,34 @@ |
49 |
+Fix javah for strict javah & ordering. |
50 |
+ |
51 |
+* javah on some JDKs is strict about sourcing, and no classpath entry |
52 |
+ referencing the jar was present for the javah command, either as an argument |
53 |
+ or in the environment. |
54 |
+* javah was chained as a post-build of the jar creation. This caused breakage |
55 |
+ if src/java/*.cc tried to use the javah-generated .h file before it was |
56 |
+ generated. |
57 |
+ |
58 |
+Fixes: https://tickets.puppetlabs.com/browse/FACT-1541 |
59 |
+Fixes: https://bugs.gentoo.org/show_bug.cgi?id=600942 |
60 |
+Signed-off-by: Robin H. Johnson <robbat2@g.o> |
61 |
+ |
62 |
+diff -Nuar facter-9999.orig/lib/CMakeLists.txt facter-9999/lib/CMakeLists.txt |
63 |
+--- facter-9999.orig/lib/CMakeLists.txt 2016-11-28 22:18:29.366271544 -0800 |
64 |
++++ facter-9999/lib/CMakeLists.txt 2016-11-28 22:28:36.244894899 -0800 |
65 |
+@@ -267,7 +267,15 @@ |
66 |
+ include(UseJava) |
67 |
+- add_jar(facter-jruby "${CMAKE_BINARY_DIR}/lib/com/puppetlabs/Facter.java" OUTPUT_NAME facter OUTPUT_DIR "${CMAKE_BINARY_DIR}/lib" ENTRY_POINT com/puppetlabs/Facter) |
68 |
++ add_jar(facter-jruby-jar "${CMAKE_BINARY_DIR}/lib/com/puppetlabs/Facter.java" OUTPUT_NAME facter OUTPUT_DIR "${CMAKE_BINARY_DIR}/lib" ENTRY_POINT com/puppetlabs/Facter) |
69 |
+ |
70 |
+- add_custom_command(TARGET facter-jruby POST_BUILD COMMAND javah ARGS -d "${CMAKE_CURRENT_LIST_DIR}/src/java" com.puppetlabs.Facter WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/lib") |
71 |
++ # javah does not atomically write the header file, so parallel builds can |
72 |
++ # read it before it finishes writing if not careful. |
73 |
++ add_custom_command(OUTPUT "${CMAKE_CURRENT_LIST_DIR}/src/java/com_puppetlabs_Facter.h" |
74 |
++ COMMAND javah ARGS -classpath facter.jar -d "${CMAKE_CURRENT_LIST_DIR}/src/java" com.puppetlabs.Facter |
75 |
++ WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/lib" |
76 |
++ DEPENDS facter-jruby-jar) |
77 |
++ # Anything that depends on facter-jruby wants both the jar AND the completely written header. |
78 |
++ add_custom_target(facter-jruby DEPENDS facter-jruby-jar "${CMAKE_CURRENT_LIST_DIR}/src/java/com_puppetlabs_Facter.h") |
79 |
++ set(LIBFACTER_COMMON_SOURCES ${LIBFACTER_COMMON_SOURCES} src/java/com_puppetlabs_Facter.h) |
80 |
+ endif() |
81 |
+ |
82 |
+ # Set include directories |