Till Wegmüller
2024-03-07 f199b00119366381f1e8a8a89fc4daabe6c56a53
commit | author | age
c448de 1 #
NP 2 # This file and its contents are supplied under the terms of the
3 # Common Development and Distribution License ("CDDL"), version 1.0.
4 # You may only use this file in accordance with the terms of version
5 # 1.0 of the CDDL.
6 #
7 # A full copy of the text of the CDDL should have accompanied this
8 # source.  A copy of the CDDL is also available via the Internet at
9 # http://www.illumos.org/license/CDDL.
10 #
11
12 #
13 # Copyright 2016 Alexander Pyhalov
14 # Copyright 2019 Michal Nowak
15 # Copyright 2021 Andreas Grueninger, Grueninger GmbH, (grueni). All rights reserved.
7184c7 16 # Copyright 2023-2024 Niklas Poslovski
c448de 17 #
NP 18
19 include ../../../make-rules/shared-macros.mk
20
21 OPENJDK_VERSION=    22
7184c7 22 OPENJDK_PATCH=    33
c448de 23 COMPONENT_NAME=        openjdk
NP 24 COMPONENT_VERSION=    $(OPENJDK_VERSION)
f199b0 25 COMPONENT_REVISION= 1
c448de 26 COMPONENT_FMRI=    runtime/java/$(COMPONENT_NAME)$(OPENJDK_VERSION)
NP 27 COMPONENT_SUMMARY=    Open-source implementation of the Java Platform, Standard Edition
7184c7 28 COMPONENT_SRC=    jdk22u-jdk-$(OPENJDK_VERSION)-$(OPENJDK_PATCH)
c448de 29 COMPONENT_ARCHIVE=    jdk-$(OPENJDK_VERSION)+$(OPENJDK_PATCH).tar.gz
NP 30 COMPONENT_ARCHIVE_HASH= \
7184c7 31     sha256:3e9f1a3b414e3cc33446a38deb4c8adab5237080d2ac057dc4b53c3638f5dc0a
c448de 32 COMPONENT_ARCHIVE_URL= \
7184c7 33     https://github.com/openjdk/jdk$(OPENJDK_VERSION)u/archive/$(COMPONENT_ARCHIVE)
c448de 34 COMPONENT_PROJECT_URL=    https://openjdk.java.net/
NP 35 COMPONENT_CLASSIFICATION=    Development/Java
36 COMPONENT_LICENSE=    GPLv2 with Classpath Exception
37
38 OPENJDK_INSTANCE=    openjdk$(COMPONENT_VERSION)
39 CACERTS_STORE=    cacerts.out
40
41 include $(WS_MAKE_RULES)/common.mk
42
43 PKG_MACROS  += OPENJDK_INSTANCE=$(OPENJDK_INSTANCE)
44 PKG_MACROS  += OPENJDK_VERSION=$(OPENJDK_VERSION)
45
46 CLEAN_PATHS += $(BUILD_DIR)
47 CLEAN_PATHS += $(CACERTS_STORE)
48 CLEAN_PATHS += $(COMPONENT_SRC_1)
49
50 # read the number of jobs from the arguments for make
51 JOBS=$(patsubst -j%,%,$(filter -j%,$(MAKEFLAGS)))
52
53 CFLAGS += -c99
54
55 CONFIGURE_OPTIONS+=        --with-jobs=$(JOBS)
56 CONFIGURE_OPTIONS+=        --x-includes=$(USRDIR)
57 CONFIGURE_OPTIONS+=        --x-libraries=$(USRLIBDIR64)
58 CONFIGURE_OPTIONS+=        --with-version-pre=
59 CONFIGURE_OPTIONS+=        --with-conf-name=oi
60 CONFIGURE_OPTIONS+=        --with-boot-jdk=/usr/jdk/openjdk21/
61 CONFIGURE_OPTIONS+=        --with-freetype=system
62 CONFIGURE_OPTIONS+=        --with-giflib=system
63 CONFIGURE_OPTIONS+=        --with-harfbuzz=system
64 CONFIGURE_OPTIONS+=        --with-lcms=bundled
65 CONFIGURE_OPTIONS+=        --with-libjpeg=system
66 CONFIGURE_OPTIONS+=        --with-libpng=system
67 CONFIGURE_OPTIONS+=        --with-zlib=system
68 CONFIGURE_OPTIONS+=        --with-x=yes
69 CONFIGURE_OPTIONS+=        --with-native-debug-symbols=none
70 CONFIGURE_OPTIONS+=        --with-jvm-variants=server
71 CONFIGURE_OPTIONS+=        --with-debug-level=release
72 CONFIGURE_OPTIONS+=        --with-toolchain-type=gcc
73 CONFIGURE_OPTIONS+=        --with-source-date=current
74 CONFIGURE_OPTIONS+=        --with-extra-cxxflags="$(CXXFLAGS)"
75 CONFIGURE_OPTIONS+=        --with-extra-ldflags="-m64"
76 CONFIGURE_OPTIONS+=        --with-cups=$(USRDIR)
77 CONFIGURE_OPTIONS+=        --with-fontconfig=$(USRDIR)
78 CONFIGURE_OPTIONS+=        --enable-unlimited-crypto
79 CONFIGURE_OPTIONS+=        --disable-dtrace
80 CONFIGURE_OPTIONS+=        --disable-hotspot-gtest
81 CONFIGURE_OPTIONS+=        --disable-warnings-as-errors
82 CONFIGURE_OPTIONS+=        --disable-precompiled-headers
83 CONFIGURE_OPTIONS+=        --disable-ccache
84 CONFIGURE_OPTIONS+=        --disable-option-checking
85 CONFIGURE_OPTIONS+=        --enable-deprecated-ports=yes
86 CONFIGURE_OPTIONS+=        DATE=/usr/bin/gdate
87
88 CONFIGURE_ENV+= LD=/usr/bin/gld
89 COMPONENT_BUILD_ENV+= LD=/usr/bin/gld
90
91 COMPONENT_POST_BUILD_ACTION=    ($(LN) -s server/libjvm.so $(@D)/images/jdk/lib/libjvm.so)
92
93 COMPONENT_BUILD_TARGETS = images
94
95 # reset arguments from Jenkins
96 COMPONENT_BUILD_ARGS=
97
98 CACERTS_DIR=$(WS_TOP)/components/openindiana/ca-certificates
99 CACERTS_INSTALLED=$(CACERTS_DIR)/build/$(MACH32)/.installed
100 CACERTS_PROTO_DIR=$(CACERTS_DIR)/build/prototype/$(MACH)
101
102 $(CACERTS_INSTALLED):
103     gmake -C $(CACERTS_DIR) install
104
105 $(CACERTS_STORE): $(BUILD_DIR_64)/.built $(CACERTS_INSTALLED)
106     $(RM) $@
107     for cert in $(CACERTS_PROTO_DIR)/etc/certs/CA/*.pem; do              \
108                 LC_ALL=en_US.UTF-8  $(BUILD_DIR_64)/images/jdk/bin/keytool \
109                   -noprompt                                                       \
110                   -importcert                                          \
111                   -keystore $@                                         \
112                   -alias `echo $$cert | $(GSED) -e 's,.*/\\([^/]*\\)\\.pem,\\1,'` \
113                   -file $$cert                                         \
114                   -storetype jks                                       \
115                   -storepass changeit;                                 \
116         done
117
118 build:        $(BUILD_64)
119
120 install: $(BUILD_DIR_64)/.built    $(CACERTS_STORE)
121     $(RM) -r $(PROTO_DIR)/usr/jdk/instances/$(OPENJDK_INSTANCE)
122     $(MKDIR) $(PROTO_DIR)/usr/jdk/instances/$(OPENJDK_INSTANCE)
123     $(CP) -a $(BUILD_DIR_64)/images/jdk/* $(PROTO_DIR)/usr/jdk/instances/$(OPENJDK_INSTANCE)
124     $(CHMOD) +x $(PROTO_DIR)/usr/jdk/instances/$(OPENJDK_INSTANCE)/lib/jspawnhelper
125     $(CP) $(CACERTS_STORE) $(PROTO_DIR)/usr/jdk/instances/$(OPENJDK_INSTANCE)/lib/security/cacerts
126     $(TOUCH) $@
127
128 test:        $(NO_TESTS)
129
130 # manually added to support audio
131 REQUIRED_PACKAGES += system/header/header-audio
132 REQUIRED_PACKAGES += system/library/c++/sunpro
133
134 # Manually added boot JDK
135 REQUIRED_PACKAGES += runtime/java/openjdk21
136
137 # Auto-generated dependencies
138 REQUIRED_PACKAGES += $(GCC_RUNTIME_PKG)
139 REQUIRED_PACKAGES += $(GXX_RUNTIME_PKG)
f199b0 140 REQUIRED_PACKAGES += $(JPEG_IMPLEM_PKG)
TW 141 REQUIRED_PACKAGES += image/library/libjpeg-turbo
c448de 142 REQUIRED_PACKAGES += image/library/libpng16
NP 143 REQUIRED_PACKAGES += library/c++/harfbuzz
144 REQUIRED_PACKAGES += library/giflib
145 REQUIRED_PACKAGES += library/zlib
146 REQUIRED_PACKAGES += system/library
147 REQUIRED_PACKAGES += system/library/freetype-2
148 REQUIRED_PACKAGES += system/library/math
149 REQUIRED_PACKAGES += x11/library/libx11
150 REQUIRED_PACKAGES += x11/library/libxext
151 REQUIRED_PACKAGES += x11/library/libxi
152 REQUIRED_PACKAGES += x11/library/libxrender
153 REQUIRED_PACKAGES += x11/library/libxtst