openjdk8: 8u222 -> 8u242

This commit is contained in:
Benjamin Asbach 2020-02-12 23:50:05 +01:00
parent 48704fbd4f
commit 36c53f703b
3 changed files with 18 additions and 297 deletions

View File

@ -1,14 +0,0 @@
This patch was downloaded from https://aur.archlinux.org/cgit/aur.git/tree/?h=java8-openjdk
More info can be found at http://www.infinality.net/forum/viewtopic.php?f=2&t=275
diff -ur a/jdk/make/lib/Awt2dLibraries.gmk b/jdk/make/lib/Awt2dLibraries.gmk
--- a/jdk/make/lib/Awt2dLibraries.gmk 2015-07-13 20:50:59.000000000 +0300
+++ b/jdk/make/lib/Awt2dLibraries.gmk 2015-08-24 12:12:22.930330643 +0300
@@ -824,7 +824,7 @@
LDFLAGS := $(subst -Xlinker -z -Xlinker defs,,$(LDFLAGS_JDKLIB)) $(LDFLAGS_CXX_JDK) \
$(call SET_SHARED_LIBRARY_ORIGIN), \
LDFLAGS_SUFFIX := $(BUILD_LIBFONTMANAGER_FONTLIB), \
- LDFLAGS_SUFFIX_linux := -lawt $(LIBM) $(LIBCXX) -ljava -ljvm -lc, \
+ LDFLAGS_SUFFIX_linux := -lfontconfig -lawt $(LIBM) $(LIBCXX) -ljava -ljvm -lc, \
LDFLAGS_SUFFIX_solaris := -lawt -lawt_headless -lc $(LIBM) $(LIBCXX) -ljava -ljvm, \
LDFLAGS_SUFFIX_aix := -lawt -lawt_headless $(LIBM) $(LIBCXX) -ljava -ljvm,\
LDFLAGS_SUFFIX_macosx := -lawt $(LIBM) $(LIBCXX) -undefined dynamic_lookup \

View File

@ -1,260 +0,0 @@
This patch was downloaded from https://aur.archlinux.org/cgit/aur.git/tree/?h=java8-openjdk
More info can be found at http://www.infinality.net/forum/viewtopic.php?f=2&t=275
diff -ur a/jdk/src/share/native/sun/font/freetypeScaler.c b/jdk/src/share/native/sun/font/freetypeScaler.c
--- a/jdk/src/share/native/sun/font/freetypeScaler.c 2014-09-14 16:28:06.108295959 +0200
+++ b/jdk/src/share/native/sun/font/freetypeScaler.c 2014-09-14 16:28:45.569693174 +0200
@@ -23,6 +23,9 @@
* questions.
*/
+/* Use Infinality patches as default */
+#define INFINALITY
+
#include "jni.h"
#include "jni_util.h"
#include "jlong.h"
@@ -38,6 +41,10 @@
#include FT_SIZES_H
#include FT_OUTLINE_H
#include FT_SYNTHESIS_H
+#ifdef INFINALITY
+#include FT_LCD_FILTER_H
+#include <fontconfig/fontconfig.h>
+#endif
#include "fontscaler.h"
@@ -676,6 +683,147 @@ static void CopyFTSubpixelVToSubpixel(co
}
}
+#ifdef INFINALITY
+typedef struct {
+ FT_Render_Mode ftRenderMode;
+ int ftLoadFlags;
+ FT_LcdFilter ftLcdFilter;
+} RenderingProperties;
+
+static FcPattern* matchedPattern(const FcChar8* family, double ptSize) {
+ /*
+ we will create pattern to find our family and size in
+ fontconfig configuration, and then will return it's
+ properties:
+ */
+ FcPattern* fcPattern = 0;
+ fcPattern = FcPatternCreate();
+ FcValue fcValue;
+ fcValue.type = FcTypeString;
+ fcValue.u.s = family;
+ FcPatternAdd(fcPattern, FC_FAMILY, fcValue, FcTrue);
+ FcPatternAddBool(fcPattern, FC_SCALABLE, FcTrue);
+ FcPatternAddDouble(fcPattern, FC_SIZE, ptSize);
+ // TODO FcPatternAddInteger(pattern, FC_WEIGHT, weight_value);
+ // TODO FcPatternAddInteger(pattern, FC_SLANT, slant_value);
+ // TODO FcPatternAddDouble(pattern, FC_PIXEL_SIZE, size_value);
+ // TODO FcPatternAddInteger(pattern, FC_WIDTH, stretch); 100 in most cases
+ FcConfigSubstitute(0, fcPattern, FcMatchPattern);
+ FcConfigSubstitute(0, fcPattern, FcMatchFont);
+ FcDefaultSubstitute(fcPattern);
+ FcResult res;
+
+ FcPattern *pattern = 0;
+ pattern = FcFontMatch(0, fcPattern, &res);
+ FcPatternDestroy(fcPattern);
+ return pattern;
+}
+
+static void readFontconfig(const FcChar8* family, double ptSize, jint aaType, RenderingProperties* rp) {
+
+ FcPattern *pattern = matchedPattern(family, ptSize);
+
+ int ftLoadFalgs = FT_LOAD_DEFAULT;
+ FT_Render_Mode ftRenderMode;
+ FT_LcdFilter ftLcdFilter;
+ char horizontal = 1;
+ FcBool b;
+
+ // subpixel order:
+ if (aaType == TEXT_AA_ON)
+ ftRenderMode = FT_RENDER_MODE_NORMAL;
+ else if (aaType == TEXT_AA_OFF)
+ ftRenderMode = FT_RENDER_MODE_MONO;
+ else if (FcPatternGetBool(pattern, FC_ANTIALIAS, 0, &b) == FcResultMatch)
+ if (b) {
+ int subpixel = FC_RGBA_UNKNOWN;
+ FcPatternGetInteger(pattern, FC_RGBA, 0, &subpixel);
+ if (subpixel == FC_RGBA_UNKNOWN)
+ subpixel = FC_RGBA_NONE;
+ switch (subpixel) {
+ case FC_RGBA_NONE:
+ ftRenderMode = FT_RENDER_MODE_NORMAL;
+ break;
+ case FC_RGBA_RGB:
+ case FC_RGBA_BGR:
+ ftRenderMode = FT_RENDER_MODE_LCD;
+ horizontal = 1;
+ break;
+ case FC_RGBA_VRGB:
+ case FC_RGBA_VBGR:
+ ftRenderMode = FT_RENDER_MODE_LCD_V;
+ horizontal = 0;
+ break;
+ default:
+ break;
+ }
+ } else {
+ ftRenderMode = FT_RENDER_MODE_NORMAL;
+ }
+
+ // loading mode:
+ if (aaType == TEXT_AA_OFF)
+ ftLoadFalgs |= FT_LOAD_TARGET_MONO;
+ else {
+ int hint_style = FC_HINT_NONE;
+ FcPatternGetInteger(pattern, FC_HINT_STYLE, 0, &hint_style);
+ switch (hint_style) {
+ case FC_HINT_NONE:
+ ftLoadFalgs |= FT_LOAD_NO_HINTING;
+ break;
+ case FC_HINT_SLIGHT:
+ ftLoadFalgs |= FT_LOAD_TARGET_LIGHT;
+ break;
+ case FC_HINT_MEDIUM:
+ ftLoadFalgs |= FT_LOAD_TARGET_NORMAL;
+ break;
+ case FC_HINT_FULL:
+ if (aaType == TEXT_AA_ON)
+ ftLoadFalgs |= FT_LOAD_TARGET_NORMAL;
+ else
+ ftLoadFalgs |= horizontal ? FT_LOAD_TARGET_LCD : FT_LOAD_TARGET_LCD_V;
+ break;
+ default:
+ // what else to use as default?
+ ftLoadFalgs |= FT_LOAD_TARGET_NORMAL;
+ break;
+ }
+ }
+
+ // autohinting:
+ if (FcPatternGetBool(pattern, FC_AUTOHINT, 0, &b) == FcResultMatch)
+ if (b)
+ ftLoadFalgs |= FT_LOAD_FORCE_AUTOHINT;
+
+ // LCD filter:
+ int filter = FC_LCD_DEFAULT;
+ FcPatternGetInteger(pattern, FC_LCD_FILTER, 0, &filter);
+ switch (filter) {
+ case FC_LCD_NONE:
+ ftLcdFilter = FT_LCD_FILTER_NONE;
+ break;
+ case FC_LCD_DEFAULT:
+ ftLcdFilter = FT_LCD_FILTER_DEFAULT;
+ break;
+ case FC_LCD_LIGHT:
+ ftLcdFilter = FT_LCD_FILTER_LIGHT;
+ break;
+ case FC_LCD_LEGACY:
+ ftLcdFilter = FT_LCD_FILTER_LEGACY;
+ break;
+ default:
+ // new unknown lcd filter type?! will use default one:
+ ftLcdFilter = FT_LCD_FILTER_DEFAULT;
+ break;
+ }
+
+ FcPatternDestroy(pattern);
+
+ rp->ftRenderMode = ftRenderMode;
+ rp->ftLoadFlags = ftLoadFalgs;
+ rp->ftLcdFilter = ftLcdFilter;
+}
+#endif
/*
* Class: sun_font_FreetypeFontScaler
@@ -691,7 +839,9 @@ Java_sun_font_FreetypeFontScaler_getGlyp
UInt16 width, height;
GlyphInfo *glyphInfo;
int glyph_index;
+#ifndef INFINALITY
int renderFlags = FT_LOAD_RENDER, target;
+#endif
FT_GlyphSlot ftglyph;
FTScalerContext* context =
@@ -709,5 +859,10 @@ Java_sun_font_FreetypeFontScaler_getGlyp
return ptr_to_jlong(getNullGlyphImage());
}
+#ifdef INFINALITY
+ RenderingProperties renderingProperties;
+ readFontconfig((const FcChar8 *) scalerInfo->face->family_name,
+ context->ptsz, context->aaType, &renderingProperties);
+#else
if (!context->useSbits) {
renderFlags |= FT_LOAD_NO_BITMAP;
@@ -731,10 +886,17 @@ Java_sun_font_FreetypeFontScaler_getGlyp
target = FT_LOAD_TARGET_LCD_V;
}
renderFlags |= target;
+#endif
glyph_index = FT_Get_Char_Index(scalerInfo->face, glyphCode);
+#ifdef INFINALITY
+ FT_Library_SetLcdFilter(scalerInfo->library, renderingProperties.ftLcdFilter);
+ error = FT_Load_Glyph(scalerInfo->face, glyphCode, renderingProperties.ftLoadFlags);
+#else
error = FT_Load_Glyph(scalerInfo->face, glyphCode, renderFlags);
+#endif
+
if (error) {
//do not destroy scaler yet.
//this can be problem of particular context (e.g. with bad transform)
@@ -753,9 +915,13 @@ Java_sun_font_FreetypeFontScaler_getGlyp
/* generate bitmap if it is not done yet
e.g. if algorithmic styling is performed and style was added to outline */
+#ifdef INFINALITY
+ FT_Render_Glyph(ftglyph, renderingProperties.ftRenderMode);
+#else
if (ftglyph->format == FT_GLYPH_FORMAT_OUTLINE) {
FT_Render_Glyph(ftglyph, FT_LOAD_TARGET_MODE(target));
}
+#endif
width = (UInt16) ftglyph->bitmap.width;
height = (UInt16) ftglyph->bitmap.rows;
@@ -969,7 +1135,9 @@ Java_sun_font_FreetypeFontScaler_getGlyp
static FT_Outline* getFTOutline(JNIEnv* env, jobject font2D,
FTScalerContext *context, FTScalerInfo* scalerInfo,
jint glyphCode, jfloat xpos, jfloat ypos) {
+#ifndef INFINALITY
int renderFlags;
+#endif
int glyph_index;
FT_Error error;
FT_GlyphSlot ftglyph;
@@ -984,11 +1152,22 @@ static FT_Outline* getFTOutline(JNIEnv*
return NULL;
}
+#ifdef INFINALITY
+ RenderingProperties renderingProperties;
+ readFontconfig((const FcChar8 *) scalerInfo->face->family_name,
+ context->ptsz, context->aaType, &renderingProperties);
+#else
renderFlags = FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP;
+#endif
glyph_index = FT_Get_Char_Index(scalerInfo->face, glyphCode);
+#ifdef INFINALITY
+ error = FT_Load_Glyph(scalerInfo->face, glyphCode, renderingProperties.ftLoadFlags);
+#else
error = FT_Load_Glyph(scalerInfo->face, glyphCode, renderFlags);
+#endif
+
if (error) {
return NULL;
}

View File

@ -5,7 +5,6 @@
, openjdk8-bootstrap
, setJavaClassPath
, headless ? false
, enableInfinality ? true # font rendering patch
, enableGnome2 ? true, gtk2, gnome_vfs, glib, GConf
}:
@ -20,9 +19,8 @@ let
aarch64-linux = "aarch64";
}.${stdenv.system} or (throw "Unsupported platform");
update = "222";
build = if stdenv.isAarch64 then "b10"
else "ga";
update = "242";
build = "b08";
baseurl = if stdenv.isAarch64 then "https://hg.openjdk.java.net/aarch64-port/jdk8u-shenandoah"
else "https://hg.openjdk.java.net/jdk8u/jdk8u";
repover = lib.optionalString stdenv.isAarch64 "aarch64-shenandoah-"
@ -31,50 +29,50 @@ let
jdk8 = fetchurl {
name = "jdk8-${repover}.tar.gz";
url = "${baseurl}/archive/${repover}.tar.gz";
sha256 = if stdenv.isAarch64 then "1h19zpmc76f8v4s0mfvqxmxvv8imdwq92z5dmgi19y4xnl978qq8"
else "19dyqayn8n2y08p08g34xxnf0dkm6bfjxkp7633m7dx50mjcpxnj";
sha256 = if stdenv.isAarch64 then "ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb"
else "1crs4hmzmgm6fkwfq0d3xz9lph0nd33fngrqv2rz1mkkqcrjx18z";
};
langtools = fetchurl {
name = "langtools-${repover}.tar.gz";
url = "${baseurl}/langtools/archive/${repover}.tar.gz";
sha256 = if stdenv.isAarch64 then "09phy2izw2yyp3hnw7jmb7lp559dgnp2a0rymx1k3q97anfz3bzj"
else "11nibmqnf7nap10sydk57gimgwpxqk5mn12dyg6fzg4s2fxf0y1q";
sha256 = if stdenv.isAarch64 then "ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb"
else "1aaxd1rl7dlk4kxdivvqvripsbn0d5vny0jvjksycsm97vrfiry4";
};
hotspot = fetchurl {
name = "hotspot-${repover}.tar.gz";
url = "${baseurl}/hotspot/archive/${repover}.tar.gz";
sha256 = if stdenv.isAarch64 then "1dqrzg2af94pjam6jg9nq8ydaibn4bsjv7ai6m7m3r2ph2fml80s"
else "1g512xrrxvnrk5szg7wqqz00x4gv53dx3yffk5im2zfcalyka2q7";
sha256 = if stdenv.isAarch64 then "ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb"
else "18i4if16zikgda9k5bgqyx0p2104db23zlnclq512178z0p9yycb";
};
corba = fetchurl {
name = "corba-${repover}.tar.gz";
url = "${baseurl}/corba/archive/${repover}.tar.gz";
sha256 = if stdenv.isAarch64 then "15l1ccvk2slx8wf5gilzjvhc428hl57gg1knbma1jqgs3ymnqwpr"
else "0h8nprfzpy21mfl39fxxzfa420skwmaaji4r31j7lj3g8c1wp62r";
sha256 = if stdenv.isAarch64 then "ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb"
else "1298k8p2dsj7xc4h2ayk5nl4ssrcgncn06ysyqrmnwrb8gj8s1w4";
};
jdk = fetchurl {
name = "jdk-${repover}.tar.gz";
url = "${baseurl}/jdk/archive/${repover}.tar.gz";
sha256 = if stdenv.isAarch64 then "179ij3rs1ahl6dh3n64k4xp2prv413ckqk7sj1g5lw48rj7bjh83"
else "1sb38h0rckgkr2y0kfzav6mb74nv5whb9l8m842mv1jpavxrdv6k";
sha256 = if stdenv.isAarch64 then "ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb"
else "0vqlbks3cy3cnmnrnhbjkqinvp8bcy2h96xvx81cvlza4s2hszvz";
};
jaxws = fetchurl {
name = "jaxws-${repover}.tar.gz";
url = "${baseurl}/jaxws/archive/${repover}.tar.gz";
sha256 = if stdenv.isAarch64 then "16bayw7c4vzm9s0ixhw2dv6pan6wywyiddh9a8dss35660dnhrm0"
else "0akn5zapff5m32ibgm3f4lhgq96bsqx74g4xl38xmivvxddsd6kz";
sha256 = if stdenv.isAarch64 then "ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb"
else "1wg9fbiz09arj0llavnzrmbhw8nx0dw8dcjkrzxw78rj1cadflzc";
};
jaxp = fetchurl {
name = "jaxp-${repover}.tar.gz";
url = "${baseurl}/jaxp/archive/${repover}.tar.gz";
sha256 = if stdenv.isAarch64 then "176db7pi2irc7q87c273cjm5nrlj5g973fjmh24m6a1jxanrrm9x"
else "0bw4q8yhmrl8hqlimy1ijnarav4r91dj73lpr7axba77rqlr41c8";
sha256 = if stdenv.isAarch64 then "ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb"
else "1i5xrk8r8pcgnc68zrgp3hd1a1nzcm99swpmdnlb424qlg5nnrcf";
};
nashorn = fetchurl {
name = "nashorn-${repover}.tar.gz";
url = "${baseurl}/nashorn/archive/${repover}.tar.gz";
sha256 = if stdenv.isAarch64 then "0vi3kbsqfpdjxc08ayxk2c87zycd7z0qbqw9xka1vc59iyv97n62"
else "0bfcf3iv2lr0xlp6sclxq7zz7b9ahajl008hz5rasjnrnr993qja";
sha256 = if stdenv.isAarch64 then "ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb"
else "0qlxaz7sriy709vcyzz48s2v4p5h4d31my33whip018c4j5gkfqq";
};
openjdk8 = stdenv.mkDerivation {
pname = "openjdk" + lib.optionalString headless "-headless";
@ -108,9 +106,6 @@ let
./fix-java-home-jdk8.patch
./read-truststore-from-env-jdk8.patch
./currency-date-range-jdk8.patch
] ++ lib.optionals (!headless && enableInfinality) [
./004_add-fontconfig.patch
./005_enable-infinality.patch
] ++ lib.optionals (!headless && enableGnome2) [
./swing-use-gtk-jdk8.patch
];