internal/rosa/jdk: incomplete gnu classpath 0.93 artifact

This commit is contained in:
mae
2026-05-23 14:22:26 -05:00
parent 486180c11f
commit b4348a3db3
6 changed files with 532 additions and 36 deletions

View File

@@ -45,6 +45,7 @@ const (
Binutils
Bison
Bzip2
Cairo
CMake
Connman
Coreutils
@@ -56,27 +57,31 @@ const (
Fakeroot
Findutils
Flex
FontConfig
FontUtil
Freetype
Fribidi
Fuse
Gconf
GMP
GLib
Gawk
GdkPixbuf
GenInitCPIO
Gettext
Git
Glslang
GnuTLS
Go
GObjectIntrospection
Gperf
Grep
Gzip
Hakurei
HakureiDist
HarfBuzz
Hwdata
IPTables
JVM
JDK
Kmod
LIT
LibX11
@@ -85,6 +90,7 @@ const (
LibXext
LibXfixes
LibXfont2
LibXft
LibXi
LibXrandr
LibXrender
@@ -94,6 +100,7 @@ const (
Libbsd
Libcap
Libconfig
Libdatrie
LibdisplayInfo
Libdrm
Libepoxy
@@ -113,6 +120,7 @@ const (
Libpsl
Libseccomp
Libtasn1
Libthai
Libtirpc
Libtool
Libucontext
@@ -147,6 +155,7 @@ const (
OpenSSL
P11Kit
PCRE2
Pango
Parallel
Patch
Perl
@@ -211,6 +220,7 @@ const (
XkeyboardConfig
XorgProto
Xserver
Zip
Zlib
Zstd

196
internal/rosa/fontstack.go Normal file
View File

@@ -0,0 +1,196 @@
package rosa
import "hakurei.app/internal/pkg"
func (t Toolchain) newFontConfig() (pkg.Artifact, string) {
const (
version = "2.15.0"
checksum = "rvlTL_zn-RwVkTBFdsOacUmEdLmwa3whTkuTzV8JH7kKbsFmnbG2qof3hN9ghr9d"
)
return t.NewPackage("fontconfig", version, newFromGitLab("gitlab.freedesktop.org", "fontconfig/fontconfig", version, checksum),
nil,
(*MesonHelper)(nil),
Gperf,
Freetype,
Libexpat,
Python,
), version
}
func init() {
artifactsM[FontConfig] = Metadata{
f: Toolchain.newFontConfig,
Name: "fontconfig",
Description: "freedesktop font discovery",
Website: "https://fontconfig.pages.freedesktop.org/fontconfig/fontconfig-user.html",
ID: 827,
}
}
func (t Toolchain) newCairo() (pkg.Artifact, string) {
const (
version = "1.18.4"
checksum = "_Ztw0ttmYLIiElqS27x2Iu4EneXOMNHp2or6bJA6suLeF3NRvORzUMPPQy9Wr5gT"
)
return t.NewPackage("cairo", version, newFromGitLab("gitlab.freedesktop.org", "cairo/cairo", version, checksum),
nil,
&MesonHelper{
SkipTest: true,
Setup: []KV{{"Dfreetype", "enabled"}, {"Dfontconfig", "enabled"}},
},
Automake,
Libtool,
Libpng,
PkgConfig,
FontConfig,
Libexpat,
Freetype,
Pixman,
Gawk,
), version
}
func init() {
artifactsM[Cairo] = Metadata{
f: Toolchain.newCairo,
Name: "cairo",
Description: "freedesktop 2d rendering library",
Website: "https://cairographics.org",
ID: 247,
}
}
func (t Toolchain) newHarfbuzz() (pkg.Artifact, string) {
const (
version = "14.2.0"
checksum = "2VgjUmcPeIbleafZaGk5l7iGnag2qj0HTqrJ5770GzivebryZ2pbwVIha5j_24PH"
)
return t.NewPackage("harfbuzz", version, newFromGitHub("harfbuzz/harfbuzz", version, checksum),
nil,
(*MesonHelper)(nil),
Freetype,
GLib,
Cairo,
), version
}
func init() {
artifactsM[HarfBuzz] = Metadata{
f: Toolchain.newHarfbuzz,
Name: "harfbuzz",
Description: "text shaping library",
Website: "https://harfbuzz.github.io",
ID: 1299,
}
}
func (t Toolchain) newFribidi() (pkg.Artifact, string) {
const (
version = "1.0.16"
checksum = "Sn9hwdgViXW9_MOi8ovAcBgQy6s6o4cc0o260k76nqCRzxmxxD1-B37GVkJ2EoMy"
)
return t.NewPackage("fribidi", version, newFromGitHub("fribidi/fribidi", "v"+version, checksum),
nil,
&MesonHelper{
Setup: []KV{[2]string{"Ddocs", "false"}},
},
PkgConfig,
), version
}
func init() {
artifactsM[Fribidi] = Metadata{
f: Toolchain.newFribidi,
Name: "fribidi",
Description: "bidirectional text library",
Website: "https://www.gnu.org/software/fribidi/",
ID: 857,
}
}
func (t Toolchain) newLibdatrie() (pkg.Artifact, string) {
const (
version = "0.2.14"
checksum = "JnJBEFrA8xYscXOSRJNGb1ZyRqrdsfP1_sdRIQeeSujdcsxmYT5Yl9m4byTsLozp"
)
return t.NewPackage("libdatrie", version, newFromGitHub("tlwg/libdatrie", "v"+version, checksum),
nil,
&MakeHelper{
Generate: "sh autogen.sh",
},
Libtool,
Automake,
M4,
), version
}
func init() {
artifactsM[Libdatrie] = Metadata{
f: Toolchain.newLibdatrie,
Name: "libdatrie",
Description: "double-array trie library",
Website: "https://linux.thai.net/~thep/datrie/datrie.html",
ID: 7342,
}
}
func (t Toolchain) newLibThai() (pkg.Artifact, string) {
const (
version = "0.1.30"
checksum = "jQxUviF-lSiVrnqXebc4kROp0hrIeQbke2gvaeTfkCDp-wHkpxb3xP18fsNOF_F-"
)
return t.NewPackage("libthai", version, newFromGitHub("tlwg/libthai", "v"+version, checksum),
nil,
&MakeHelper{
Generate: "sh autogen.sh",
},
Libtool,
Automake,
M4,
Libdatrie,
PkgConfig,
), version
}
func init() {
artifactsM[Libthai] = Metadata{
f: Toolchain.newLibThai,
Name: "libthai",
Description: "thai language handling library",
Website: "https://linux.thai.net/",
ID: 1737,
}
}
func (t Toolchain) newPango() (pkg.Artifact, string) {
const (
version = "1.56.3"
checksum = "O73sc8axQyjIFpW4XkV7wi4HVSvmdUnx1uTn-HtbewXgrCVWX9Du-pssL5BK7rf1"
)
return t.NewPackage("pango", version, newFromGitLab("gitlab.gnome.org", "GNOME/pango", version, checksum),
nil,
&MesonHelper{
SkipTest: true,
},
GLib,
GObjectIntrospection,
Freetype,
PkgConfig,
FontConfig,
HarfBuzz,
Fribidi,
Cairo,
Pixman,
Libpng,
Libexpat,
Libdatrie,
Libthai,
Libtool,
LibX11,
LibXrender,
LibXft,
Diffutils,
), version
}
func init() {
artifactsM[Pango] = Metadata{
f: Toolchain.newPango,
Name: "pango",
Description: "text rendering library",
Website: "https://pango.org",
ID: 11783,
}
}

View File

@@ -83,51 +83,66 @@ func init() {
Name: "shared-mime-info",
Description: "xdg MIME repository",
Website: "https://www.freedesktop.org/wiki/Software/shared-mime-info/",
Dependencies: P{
GLib,
Meson,
Libxml2,
Gettext,
Libpng,
Libjpeg,
},
ID: 5524,
ID: 5524,
}
}
func (t Toolchain) newGdkPixbuf() (pkg.Artifact, string) {
func (t Toolchain) newGobjectIntrospection() (pkg.Artifact, string) {
const (
version = "2.42.12"
checksum = "yXAcUwFzo96Seo9FG2xvHJzMpl53ahMFU_aEZzxP7V0BwFaQWRfCWKeu1LVBHF6k"
version = "1.86.0"
checksum = "M-eq1kEEX215x0VMfTIfJXNfVnZwiC41QK33tlCeK0_GDwGUILQm0SqvRSySNoka"
)
return t.NewPackage("gdk-pixbuf", version, newFromGitLab("gitlab.gnome.org", "GNOME/gdk-pixbuf", version, checksum),
nil,
return t.NewPackage("gobject-introspection", version, t.NewViaGit("https://gitlab.gnome.org/GNOME/gobject-introspection.git", version, mustDecode(checksum)),
&PackageAttr{
Writable: true,
},
&MesonHelper{
Setup: []KV{[2]string{"Dman", "false"}, [2]string{"Dtests", "false"}}, //TODO(mae) fix failing tests
SkipTest: true,
},
GLib,
PythonSetuptools,
Flex,
Bison,
Cairo,
Libffi,
Libpng,
Meson,
Python,
SharedMimeInfo,
M4,
PythonMako,
Pixman,
), version
}
func init() {
artifactsM[GdkPixbuf] = Metadata{
f: Toolchain.newGdkPixbuf,
Name: "gdk-pixbuf",
Description: "gtk image loading library",
Website: "https://developer.gnome.org/gtk-pixbuf",
Dependencies: P{
GLib,
Libpng,
Meson,
Python,
SharedMimeInfo,
},
ID: 9533,
artifactsM[GObjectIntrospection] = Metadata{
f: Toolchain.newGobjectIntrospection,
Name: "gobject-introspection",
Description: "introspection toolkit",
Website: "https://gi.readthedocs.io/",
ID: 1223,
}
}
func (t Toolchain) newGconf() (pkg.Artifact, string) {
const (
version = "3.2.6"
checksum = "oSoPCk8J4Xd1gF1RLPqzdvHQfEn2eOE9qpLoT2CyDwnkUERgg2990dHN_AKhVgJp"
)
return t.NewPackage("gconf", version, newFromGitLab("gitlab.gnome.org", "Archive/gconf", version, checksum),
nil,
&MakeHelper{
Configure: []KV{{"disable-orbit"}, {"disable-introspection"}},
Generate: "autoreconf -if",
},
Automake,
Libtool,
GLib,
), version
}
func init() {
artifactsM[Gconf] = Metadata{
f: Toolchain.newGconf,
Name: "gconf",
Description: "outdated configuration database library",
Website: "http://projects.gnome.org/gconf/",
ID: 8423,
}
}

139
internal/rosa/jdk.go Normal file
View File

@@ -0,0 +1,139 @@
package rosa
import (
"slices"
"hakurei.app/internal/pkg"
)
func (t Toolchain) newJikes() pkg.Artifact {
const (
version = "1.22"
checksum = "qb5Pf6P7RBrXRVLNEwfGxqhb05WW-MjJyJw7O-fYKizNGDNJEpsttbmOsFge0MO1"
)
return t.NewPackage("jikes", version,
newTar("https://sourceforge.net/projects/jikes/files/Jikes/"+version+"/jikes-"+version+".tar.bz2/download",
checksum, pkg.TarBzip2),
&PackageAttr{},
&MakeHelper{
Generate: "autoreconf -if",
Make: []string{
"CXXFLAGS='-std=c++03'",
},
},
Automake,
)
}
func (t Toolchain) newClasspath(version, checksum string, extra ...pkg.Artifact) pkg.Artifact {
attr := &PackageAttr{
Patches: []KV{{"classpath0.93-include-stdlib",
`diff --git a/native/fdlibm/dtoa.c b/native/fdlibm/dtoa.c
index 5fb6aae..e710d96 100644
--- a/native/fdlibm/dtoa.c
+++ b/native/fdlibm/dtoa.c
@@ -28,6 +28,7 @@
#include "mprec.h"
#include <string.h>
+#include <stdlib.h>
static int
_DEFUN (quorem,
`}},
}
helper := &MakeHelper{
SkipCheck: true,
Generate: "autoreconf -if",
Configure: []KV{{"with-jikes"}, {"disable-gtk-peer"}, {"disable-gconf-peer"}, {"disable-Werror"}, {"disable-plugin"}},
}
script := attr.ScriptEarly
script += helper.scriptEarly()
source := newTar(
"https://ftp.gnu.org/gnu/classpath/classpath-"+version+".tar.gz",
checksum,
pkg.TarGzip,
)
wantsChmod, wantsWrite := helper.wantsChmod(), helper.wantsWrite()
pExtra := []PArtifact{Automake, Libtool, LibX11, LibXtst, LibXi, PkgConfig, Gzip, GLib, Findutils, Unzip}
extraRes := make([]pkg.Artifact, 0, 1<<3+len(pExtra))
{
pv := paGet()
for _, p := range helper.extra(attr.Flag) {
extraRes = t.appendPreset(extraRes, pv, p)
}
for _, p := range pExtra {
extraRes = t.appendPreset(extraRes, pv, p)
}
paPut(pv)
}
var (
scriptEarly string
sourceSuffix string
)
if _, ok := source.(pkg.FileArtifact); ok {
if attr.Writable || attr.Chmod ||
wantsChmod || wantsWrite ||
len(attr.Patches) > 0 {
panic("source processing requested on a xz-compressed tarball")
}
sourceSuffix = ".tar.xz"
scriptEarly += `
tar -C /usr/src/ -xf '/usr/src/` + "classpath" + `.tar.xz'
mv '/usr/src/` + "classpath" + `-` + version + `' '/usr/src/` + "classpath" + `'
`
}
dir := helper.wantsDir()
helperScriptEarly := helper.scriptEarly()
if attr.EnterSource ||
dir == "" ||
attr.ScriptEarly != "" ||
helperScriptEarly != "" {
scriptEarly += `
cd '/usr/src/` + "classpath" + `/'
`
}
scriptEarly += attr.ScriptEarly + helperScriptEarly
if dir != "" && dir != helperInPlace {
if helper.createDir() {
scriptEarly += "\nmkdir -p " + dir
}
scriptEarly += "\ncd " + dir + "\n"
} else if !attr.EnterSource && attr.ScriptEarly == "" {
panic("cannot remain in root")
}
return t.New(
"classpath"+"-"+version,
attr.Flag,
slices.Concat(extra, extraRes),
attr.KnownChecksum,
attr.Env,
scriptEarly+helper.script("classpath"),
slices.Concat(attr.Paths, []pkg.ExecPath{
pkg.Path(AbsUsrSrc.Append(
"classpath"+sourceSuffix,
), attr.Writable || wantsWrite, t.NewPatchedSource(
"classpath", version, source, !attr.Chmod && !wantsChmod, attr.Patches...,
)),
})...,
)
}
func (t Toolchain) newLatestJdk() (pkg.Artifact, string) {
jikes := t.newJikes()
classpath093 := t.newClasspath("0.93", "WKsqDegi4rVCdQ2uJc3BOPuMnovU_cbiQy7nAzvYYtYnw75V6--sZFyRKnfiwGg9", jikes)
return classpath093, "0.93"
}
func init() {
artifactsM[JDK] = Metadata{
f: Toolchain.newLatestJdk,
Name: "jdk",
Description: "java toolchain",
Website: "https://jikes.sourceforge.net/",
}
}

View File

@@ -581,6 +581,42 @@ func init() {
}
}
func (t Toolchain) newLibxft() (pkg.Artifact, string) {
const (
version = "2.3.9"
checksum = "uHJtVwC4G9SnUSE8_KMnUR6SxSfLxEaausYSexZ0I8p4tgdxOqjKMuX_rKzfJR79"
)
return t.NewPackage("libxft", version, newFromGitLab(
"gitlab.freedesktop.org",
"xorg/lib/libxft",
"libXft-"+version,
checksum),
nil,
&MakeHelper{
Generate: "NOCONFIGURE=1 ./autogen.sh",
},
Automake,
Libtool,
PkgConfig,
Freetype,
FontConfig,
utilMacros,
LibX11,
LibXext,
LibXrender,
Libexpat,
), version
}
func init() {
artifactsM[LibXft] = Metadata{
f: Toolchain.newLibxft,
Name: "libxft",
Description: "Xorg font library",
Website: "https://www.freedesktop.org/wiki/Software/Xft/",
ID: 1777,
}
}
func (t Toolchain) newLibxshmfence() (pkg.Artifact, string) {
const (
version = "1.3.3"

100
internal/rosa/zip.go Normal file
View File

@@ -0,0 +1,100 @@
package rosa
import (
"strings"
"hakurei.app/internal/pkg"
)
func (t Toolchain) newZip() (pkg.Artifact, string) {
const (
version = "3.0"
checksum = "4-fw0fXSm7qMvJ6FyRs9VRsURdkJ_1A8f8ihjxXWtj2ulEL-Io6ouKXTn0cE0wtT"
)
return t.New("zip-"+version, 0, t.AppendPresets(nil,
Make,
Coreutils,
Unzip,
), nil, nil, `
cd /usr/src/zip/
chmod +x unix/configure
unix/configure
make -f unix/Makefile generic
mkdir -p /work/system/bin/
mv zip /work/system/bin/
`, pkg.Path(AbsUsrSrc.Append("zip"), true, t.NewPatchedSource(
"zip", version, newTar(
"https://downloads.sourceforge.net/project/infozip/"+
"Zip%203.x%20%28latest%29/"+version+"/"+
"zip"+strings.ReplaceAll(version, ".", "")+".tar.gz",
checksum,
pkg.TarGzip,
), false,
KV{"zip-gentoo-patch",
`https://bugs.gentoo.org/869203
See also OE's variant: https://cgit.openembedded.org/openembedded-core/commit/?id=f898db2607ba3837f81292af92bc8cb605b96cb3
--- a/unix/configure
+++ b/unix/configure
@@ -507,18 +507,18 @@ $CC $CFLAGS -c conftest.c >/dev/null 2>/
# add NO_'function_name' to flags if missing
for func in rmdir strchr strrchr rename mktemp mktime mkstemp
do
echo Check for $func
- echo "int main(){ $func(); return 0; }" > conftest.c
+ echo "char $func(); int main(){ return $func(); }" > conftest.c
$CC $BFLAG -o conftest conftest.c >/dev/null 2>/dev/null
[ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNO_` + "`echo $func | tr '[a-z]' '[A-Z]'`" + `
done
echo Check for memset
-echo "int main(){ char k; memset(&k,0,0); return 0; }" > conftest.c
+echo "int main(){ char memset(); return memset(); }" > conftest.c
$CC -o conftest conftest.c >/dev/null 2>/dev/null
[ $? -ne 0 ] && CFLAGS="${CFLAGS} -DZMEM"
echo Check for memmove
@@ -551,11 +551,11 @@ $CC $CFLAGS -c conftest.c >/dev/null 2>/
[ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNO_ERRNO"
echo Check for directory libraries
cat > conftest.c << _EOF_
-int main() { return closedir(opendir(".")); }
+int main() { char closedir(); char opendir(); return closedir(opendir()); }
_EOF_
$CC -o conftest conftest.c >/dev/null 2>/dev/null
if [ $? -ne 0 ]; then
OPT=""
@@ -573,11 +573,11 @@ fi
# Dynix/ptx 1.3 needed this
echo Check for readlink
-echo "int main(){ return readlink(); }" > conftest.c
+echo "int main(){ char readlink(); return readlink(); }" > conftest.c
$CC -o conftest conftest.c >/dev/null 2>/dev/null
if [ $? -ne 0 ]; then
$CC -o conftest conftest.c -lseq >/dev/null 2>/dev/null
[ $? -eq 0 ] && LFLAGS2="${LFLAGS2} -lseq"
fi
`}))), version
}
func init() {
artifactsM[Zip] = Metadata{
f: Toolchain.newZip,
Name: "zip",
Description: "portable compression/archiver utilities",
Website: "https://infozip.sourceforge.net/",
ID: 10080,
}
}