Bug 239358 - java/openjdk8 fails to build due to patch fail
Summary: java/openjdk8 fails to build due to patch fail
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-java mailing list
URL:
Keywords:
: 239316 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-07-21 04:55 UTC by gja822
Modified: 2019-07-26 05:42 UTC (History)
6 users (show)

See Also:
bugzilla: maintainer-feedback? (java)


Attachments
java/openjdk8: fix build with FONTCONFIG enabled (1.48 KB, patch)
2019-07-22 11:07 UTC, Dima Panov
no flags Details | Diff
[patch] fix fontconfig patch after jdk8u222 + remove unnecessary shebangfix (4.58 KB, patch)
2019-07-23 14:45 UTC, John Hein
jcfyecrayz: maintainer-approval? (frebsd-java)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description gja822 2019-07-21 04:55:09 UTC
Here's the output.

/usr/ports/java/openjdk8# make
===>  License GPLv2 accepted by the user
===>   openjdk8-8.222.10.1 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by openjdk8-8.222.10.1 for building
===>  Extracting for openjdk8-8.222.10.1
=> SHA256 Checksum OK for battleblow-openjdk-jdk8u-8.222.10.1-jdk8u222-b10.1_GH0.tar.gz.
===>  Patching for openjdk8-8.222.10.1
===>  Applying FreeBSD patches for openjdk8-8.222.10.1
No such line 970 in input file, ignoring
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- jdk/src/share/native/sun/font/freetypeScaler.c.orig	2017-01-20 17:04:07 UTC
|+++ jdk/src/share/native/sun/font/freetypeScaler.c
--------------------------
Patching file jdk/src/share/native/sun/font/freetypeScaler.c using Plan A...
Hunk #1 succeeded at 38.
Hunk #2 succeeded at 667 (offset -28 lines).
Hunk #3 failed at 822.
Hunk #4 succeeded at 876 (offset -1 lines).
Hunk #5 succeeded at 1078 (offset -28 lines).
1 out of 5 hunks failed--saving rejects to jdk/src/share/native/sun/font/freetypeScaler.c.rej
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- jdk/make/lib/Awt2dLibraries.gmk.orig	2015-07-18 14:30:01.000000000 -0700
|+++ jdk/make/lib/Awt2dLibraries.gmk	2015-07-18 14:30:08.000000000 -0700
--------------------------
Patching file jdk/make/lib/Awt2dLibraries.gmk using Plan A...
Hunk #1 succeeded at 939 (offset -4 lines).
done
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/java/openjdk8
*** Error code 1

Stop.
make: stopped in /usr/ports/java/openjdk8
Comment 1 Dima Panov freebsd_committer 2019-07-22 11:07:32 UTC
Created attachment 205991 [details]
java/openjdk8: fix build with FONTCONFIG enabled

Fix fontconfig.patch
Comment 2 rkoberman 2019-07-23 05:37:46 UTC
Comment on attachment 205991 [details]
java/openjdk8: fix build with FONTCONFIG enabled

The patch fixes this for me.
Comment 3 John Hein 2019-07-23 13:10:10 UTC
See also bug 239316
Comment 4 John Hein 2019-07-23 14:45:15 UTC
Created attachment 206010 [details]
[patch] fix fontconfig patch after jdk8u222 + remove unnecessary shebangfix

Regen patch using makepatch-like patch generation.
Set fontconfig patch via EXTRA_PATCHES instead of creating a special target that does the same thing.

While here, remove unnecessary shebangfix.
Comment 5 Rainer Hurling 2019-07-23 14:59:57 UTC
And as far as I can see, files/patch-common-autoconf-toolchain.m4 is obsolete, because it is already handled via Makefile:l237, isn't it?
Comment 6 Greg Lewis freebsd_committer 2019-07-24 23:37:42 UTC
*** Bug 239316 has been marked as a duplicate of this bug. ***
Comment 7 commit-hook freebsd_committer 2019-07-24 23:37:51 UTC
A commit references this bug:

Author: glewis
Date: Wed Jul 24 23:37:06 UTC 2019
New revision: 507306
URL: https://svnweb.freebsd.org/changeset/ports/507306

Log:
  Fix the build for the FONTCONFIG option

  * Updated the fontconfig.patch file
  * Simplified FONTCONFIG to use EXTRA_PATCHES rather than a separate target

  PR:		239358
  Submitted by:	John Hein <jcfyecrayz@liamekaens.com>, fluffy

Changes:
  head/java/openjdk8/Makefile
  head/java/openjdk8/files/fontconfig.patch
Comment 8 John Hein 2019-07-25 23:12:33 UTC
(In reply to Rainer Hurling from comment #5)
Rainer, no it's not obsolete.  The patch inserts %%LOCALBASE%% (replacing hard-coded /usr/local).  Then post-patch replaces %%LOCALBASE%% with ${LOCALBASE} (for cases where LOCALBASE is defined != /usr/local).
Comment 9 Rainer Hurling 2019-07-26 05:42:15 UTC
(In reply to John Hein from comment #8)
Many thanks, John, for the clarification. Of course, you are right.

I was misleaded, because before r507306 on my HEAD boxes, 'make patch' was not able to apply files/patch-common-autoconf-toolchain.m4 for some unknown reason.

Sorry for the noise.