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 +#include 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/", } }