mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
Add zlib. General clean up. Set versions to 5.0.0 consistently.
This commit is contained in:
parent
9a0bcfe2c6
commit
ed9ade92a2
5 changed files with 105 additions and 14 deletions
|
@ -2,7 +2,7 @@
|
||||||
<feature
|
<feature
|
||||||
id="org.eclipse.cdt.p2"
|
id="org.eclipse.cdt.p2"
|
||||||
label="%featureName"
|
label="%featureName"
|
||||||
version="1.0.0.qualifier"
|
version="5.0.0.qualifier"
|
||||||
provider-name="%providerName"
|
provider-name="%providerName"
|
||||||
plugin="org.eclipse.cdt.p2">
|
plugin="org.eclipse.cdt.p2">
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
||||||
Bundle-ManifestVersion: 2
|
Bundle-ManifestVersion: 2
|
||||||
Bundle-Name: Generator Plug-in
|
Bundle-Name: Generator Plug-in
|
||||||
Bundle-SymbolicName: org.eclipse.cdt.p2.generator;singleton:=true
|
Bundle-SymbolicName: org.eclipse.cdt.p2.generator;singleton:=true
|
||||||
Bundle-Version: 1.0.0
|
Bundle-Version: 5.0.0.qualifier
|
||||||
Bundle-Activator: org.eclipse.cdt.p2.generator.Activator
|
Bundle-Activator: org.eclipse.cdt.p2.generator.Activator
|
||||||
Require-Bundle: org.eclipse.core.runtime,
|
Require-Bundle: org.eclipse.core.runtime,
|
||||||
org.eclipse.cdt.p2;bundle-version="5.0.0",
|
org.eclipse.cdt.p2;bundle-version="5.0.0",
|
||||||
|
|
|
@ -71,6 +71,7 @@ public class MinGWGenerator implements IApplication {
|
||||||
License publicDomainLic = MetadataFactory.createLicense(null, publicDomain);
|
License publicDomainLic = MetadataFactory.createLicense(null, publicDomain);
|
||||||
License gplLic = MetadataFactory.createLicense(gplURL, gpl);
|
License gplLic = MetadataFactory.createLicense(gplURL, gpl);
|
||||||
License lgplLic = MetadataFactory.createLicense(lgplURL, lgpl);
|
License lgplLic = MetadataFactory.createLicense(lgplURL, lgpl);
|
||||||
|
License zlibLic = MetadataFactory.createLicense(zlibLicURL, zlibLicText);
|
||||||
|
|
||||||
Version wascanaVersion = new Version("1.0.0");
|
Version wascanaVersion = new Version("1.0.0");
|
||||||
String mingwSubdir = "mingw";
|
String mingwSubdir = "mingw";
|
||||||
|
@ -78,7 +79,7 @@ public class MinGWGenerator implements IApplication {
|
||||||
// MinGW Runtime
|
// MinGW Runtime
|
||||||
String runtimeId = "wascana.mingw.mingwrt";
|
String runtimeId = "wascana.mingw.mingwrt";
|
||||||
Version runtimeVersion = new Version("4.15.1");
|
Version runtimeVersion = new Version("4.15.1");
|
||||||
InstallableUnitDescription runtimeIUDesc = createIUDesc(runtimeId, runtimeVersion, "MinGW Runtime Library", publicDomainLic);
|
InstallableUnitDescription runtimeIUDesc = createIUDesc(runtimeId, runtimeVersion, "Wascana MinGW Runtime Library", publicDomainLic);
|
||||||
IInstallableUnit runtimeIU = createIU(runtimeIUDesc, runtimeId, runtimeVersion,
|
IInstallableUnit runtimeIU = createIU(runtimeIUDesc, runtimeId, runtimeVersion,
|
||||||
"http://downloads.sourceforge.net/mingw/mingwrt-3.15.1-mingw32.tar.gz",
|
"http://downloads.sourceforge.net/mingw/mingwrt-3.15.1-mingw32.tar.gz",
|
||||||
mingwSubdir,
|
mingwSubdir,
|
||||||
|
@ -87,7 +88,7 @@ public class MinGWGenerator implements IApplication {
|
||||||
// w32api
|
// w32api
|
||||||
String w32apiId = "wascana.mingw.w32api";
|
String w32apiId = "wascana.mingw.w32api";
|
||||||
Version w32apiVersion = new Version("3.13");
|
Version w32apiVersion = new Version("3.13");
|
||||||
InstallableUnitDescription w32apiIUDesc = createIUDesc(w32apiId, w32apiVersion, "MinGW Windows Library", publicDomainLic);
|
InstallableUnitDescription w32apiIUDesc = createIUDesc(w32apiId, w32apiVersion, "Wascana MinGW Windows Library", publicDomainLic);
|
||||||
IInstallableUnit w32apiIU = createIU(w32apiIUDesc, w32apiId, w32apiVersion,
|
IInstallableUnit w32apiIU = createIU(w32apiIUDesc, w32apiId, w32apiVersion,
|
||||||
"http://downloads.sourceforge.net/mingw/w32api-3.13-mingw32-dev.tar.gz",
|
"http://downloads.sourceforge.net/mingw/w32api-3.13-mingw32-dev.tar.gz",
|
||||||
mingwSubdir,
|
mingwSubdir,
|
||||||
|
@ -96,7 +97,7 @@ public class MinGWGenerator implements IApplication {
|
||||||
// binutils
|
// binutils
|
||||||
String binutilsId = "wascana.mingw.binutils";
|
String binutilsId = "wascana.mingw.binutils";
|
||||||
Version binutilsVersion = new Version("2.19");
|
Version binutilsVersion = new Version("2.19");
|
||||||
InstallableUnitDescription binutilsIUDesc = createIUDesc(binutilsId, binutilsVersion, "MinGW binutils", gplLic);
|
InstallableUnitDescription binutilsIUDesc = createIUDesc(binutilsId, binutilsVersion, "Wascana MinGW binutils", gplLic);
|
||||||
IInstallableUnit binutilsIU = createIU(binutilsIUDesc, binutilsId, binutilsVersion,
|
IInstallableUnit binutilsIU = createIU(binutilsIUDesc, binutilsId, binutilsVersion,
|
||||||
"http://downloads.sourceforge.net/mingw/binutils-2.19-mingw32-bin.tar.gz",
|
"http://downloads.sourceforge.net/mingw/binutils-2.19-mingw32-bin.tar.gz",
|
||||||
mingwSubdir,
|
mingwSubdir,
|
||||||
|
@ -105,7 +106,7 @@ public class MinGWGenerator implements IApplication {
|
||||||
// gcc-4 core
|
// gcc-4 core
|
||||||
String gcc4coreId = "wascana.mingw.gcc4.core";
|
String gcc4coreId = "wascana.mingw.gcc4.core";
|
||||||
Version gcc4Version = new Version("4.3.2.tdm-1");
|
Version gcc4Version = new Version("4.3.2.tdm-1");
|
||||||
InstallableUnitDescription gcc4coreIUDesc = createIUDesc(gcc4coreId, gcc4Version, "MinGW gcc-4 core", gplLic);
|
InstallableUnitDescription gcc4coreIUDesc = createIUDesc(gcc4coreId, gcc4Version, "Wascana MinGW gcc-4 core", gplLic);
|
||||||
RequiredCapability[] gcc4coreReqs = new RequiredCapability[] {
|
RequiredCapability[] gcc4coreReqs = new RequiredCapability[] {
|
||||||
MetadataFactory.createRequiredCapability(
|
MetadataFactory.createRequiredCapability(
|
||||||
IInstallableUnit.NAMESPACE_IU_ID,
|
IInstallableUnit.NAMESPACE_IU_ID,
|
||||||
|
@ -125,7 +126,7 @@ public class MinGWGenerator implements IApplication {
|
||||||
|
|
||||||
// gcc-4 g++
|
// gcc-4 g++
|
||||||
String gcc4gppId = "wascana.mingw.gcc4.g++";
|
String gcc4gppId = "wascana.mingw.gcc4.g++";
|
||||||
InstallableUnitDescription gcc4gppIUDesc = createIUDesc(gcc4gppId, gcc4Version, "MinGW gcc-4 g++", gplLic);
|
InstallableUnitDescription gcc4gppIUDesc = createIUDesc(gcc4gppId, gcc4Version, "Wascana MinGW gcc-4 g++", gplLic);
|
||||||
gcc4gppIUDesc.setLicense(gplLic);
|
gcc4gppIUDesc.setLicense(gplLic);
|
||||||
RequiredCapability[] gcc4gppReqs = new RequiredCapability[] {
|
RequiredCapability[] gcc4gppReqs = new RequiredCapability[] {
|
||||||
MetadataFactory.createRequiredCapability(
|
MetadataFactory.createRequiredCapability(
|
||||||
|
@ -141,7 +142,7 @@ public class MinGWGenerator implements IApplication {
|
||||||
// gdb
|
// gdb
|
||||||
String gdbId = "wascana.mingw.gdb";
|
String gdbId = "wascana.mingw.gdb";
|
||||||
Version gdbVersion = new Version("6.8.0.4");
|
Version gdbVersion = new Version("6.8.0.4");
|
||||||
InstallableUnitDescription gdbIUDesc = createIUDesc(gdbId, gdbVersion, "MinGW gdb", gplLic);
|
InstallableUnitDescription gdbIUDesc = createIUDesc(gdbId, gdbVersion, "Wascana MinGW gdb", gplLic);
|
||||||
IInstallableUnit gdbIU = createIU(gdbIUDesc, gdbId, gdbVersion,
|
IInstallableUnit gdbIU = createIU(gdbIUDesc, gdbId, gdbVersion,
|
||||||
"http://downloads.sourceforge.net/mingw/gdb-6.8-mingw-3.tar.bz2",
|
"http://downloads.sourceforge.net/mingw/gdb-6.8-mingw-3.tar.bz2",
|
||||||
mingwSubdir,
|
mingwSubdir,
|
||||||
|
@ -150,7 +151,7 @@ public class MinGWGenerator implements IApplication {
|
||||||
// msys
|
// msys
|
||||||
String msysId = "wascana.msys.core";
|
String msysId = "wascana.msys.core";
|
||||||
Version msysVersion = new Version("1.0.11.20080826");
|
Version msysVersion = new Version("1.0.11.20080826");
|
||||||
InstallableUnitDescription msysIUDesc = createIUDesc(msysId, msysVersion, "MSYS Build System", gplLic);
|
InstallableUnitDescription msysIUDesc = createIUDesc(msysId, msysVersion, "Wascana MSYS Build System", gplLic);
|
||||||
IInstallableUnit msysIU = createIU(msysIUDesc, msysId, msysVersion,
|
IInstallableUnit msysIU = createIU(msysIUDesc, msysId, msysVersion,
|
||||||
"http://downloads.sourceforge.net/mingw/msysCORE-1.0.11-20080826.tar.gz",
|
"http://downloads.sourceforge.net/mingw/msysCORE-1.0.11-20080826.tar.gz",
|
||||||
"msys",
|
"msys",
|
||||||
|
@ -185,10 +186,19 @@ public class MinGWGenerator implements IApplication {
|
||||||
mingwToolchainDesc.setRequiredCapabilities(mingwToolchainReqs);
|
mingwToolchainDesc.setRequiredCapabilities(mingwToolchainReqs);
|
||||||
IInstallableUnit mingwToolchainIU = MetadataFactory.createInstallableUnit(mingwToolchainDesc);
|
IInstallableUnit mingwToolchainIU = MetadataFactory.createInstallableUnit(mingwToolchainDesc);
|
||||||
|
|
||||||
|
// zlib
|
||||||
|
String zlibId = "wascana.zlib";
|
||||||
|
Version zlibVersion = new Version("1.2.3");
|
||||||
|
InstallableUnitDescription zlibIUDesc = createIUDesc(zlibId, zlibVersion, "Wascana zlib Library", zlibLic);
|
||||||
|
IInstallableUnit zlibIU = createIU(zlibIUDesc, zlibId, zlibVersion,
|
||||||
|
"http://downloads.sourceforge.net/wascana/zlib-mingw-1.2.3.zip",
|
||||||
|
mingwSubdir,
|
||||||
|
InstallArtifactRepository.ZIP_COMPRESSION);
|
||||||
|
|
||||||
// SDL
|
// SDL
|
||||||
String sdlId = "wascana.sdl";
|
String sdlId = "wascana.sdl";
|
||||||
Version sdlVersion = new Version("1.2.13");
|
Version sdlVersion = new Version("1.2.13");
|
||||||
InstallableUnitDescription sdlIUDesc = createIUDesc(sdlId, sdlVersion, "SDL (Simple Directmedia Layer) Library", lgplLic);
|
InstallableUnitDescription sdlIUDesc = createIUDesc(sdlId, sdlVersion, "Wascana SDL (Simple Directmedia Layer) Library", lgplLic);
|
||||||
IInstallableUnit sdlIU = createIU(sdlIUDesc, sdlId, sdlVersion,
|
IInstallableUnit sdlIU = createIU(sdlIUDesc, sdlId, sdlVersion,
|
||||||
"http://www.libsdl.org/release/SDL-devel-1.2.13-mingw32.tar.gz",
|
"http://www.libsdl.org/release/SDL-devel-1.2.13-mingw32.tar.gz",
|
||||||
mingwSubdir,
|
mingwSubdir,
|
||||||
|
@ -200,7 +210,7 @@ public class MinGWGenerator implements IApplication {
|
||||||
RequiredCapability[] libsReqs = new RequiredCapability[] {
|
RequiredCapability[] libsReqs = new RequiredCapability[] {
|
||||||
MetadataFactory.createRequiredCapability(
|
MetadataFactory.createRequiredCapability(
|
||||||
IInstallableUnit.NAMESPACE_IU_ID,
|
IInstallableUnit.NAMESPACE_IU_ID,
|
||||||
sdlIU.getId(), new VersionRange(null), null, false, false),
|
zlibIU.getId(), new VersionRange(null), null, false, false),
|
||||||
};
|
};
|
||||||
libsIUDesc.setRequiredCapabilities(libsReqs);
|
libsIUDesc.setRequiredCapabilities(libsReqs);
|
||||||
IInstallableUnit libsIU = MetadataFactory.createInstallableUnit(libsIUDesc);
|
IInstallableUnit libsIU = MetadataFactory.createInstallableUnit(libsIUDesc);
|
||||||
|
@ -215,8 +225,8 @@ public class MinGWGenerator implements IApplication {
|
||||||
msysIU,
|
msysIU,
|
||||||
mingwToolchainIU,
|
mingwToolchainIU,
|
||||||
|
|
||||||
// sdlIU,
|
zlibIU,
|
||||||
// libsIU
|
libsIU
|
||||||
});
|
});
|
||||||
|
|
||||||
System.out.println("done");
|
System.out.println("done");
|
||||||
|
@ -269,4 +279,7 @@ public class MinGWGenerator implements IApplication {
|
||||||
|
|
||||||
public static final String lgpl = "GNU LESSER GENERAL PUBLIC LICENSE\n" + lgplURL;
|
public static final String lgpl = "GNU LESSER GENERAL PUBLIC LICENSE\n" + lgplURL;
|
||||||
|
|
||||||
|
public static final String zlibLicURL = "http://www.zlib.net/zlib_license.html";
|
||||||
|
|
||||||
|
public static final String zlibLicText = "http://www.zlib.net/zlib_license.html";
|
||||||
}
|
}
|
||||||
|
|
|
@ -232,7 +232,9 @@ public class InstallArtifactRepository extends AbstractArtifactRepository {
|
||||||
PipedInputStream in = new PipedInputStream(out);
|
PipedInputStream in = new PipedInputStream(out);
|
||||||
String compression = descriptor.getProperty(COMPRESSION);
|
String compression = descriptor.getProperty(COMPRESSION);
|
||||||
if (ZIP_COMPRESSION.equals(compression)) {
|
if (ZIP_COMPRESSION.equals(compression)) {
|
||||||
// TODO a zip extractor
|
ZipExtractor extractor = new ZipExtractor(in, installDir,
|
||||||
|
new FileListWriter(getFileListFile(descriptor.getArtifactKey().getId())));
|
||||||
|
extractor.start();
|
||||||
} else {
|
} else {
|
||||||
TarExtractor extractor = new TarExtractor(in, installDir,
|
TarExtractor extractor = new TarExtractor(in, installDir,
|
||||||
new FileListWriter(getFileListFile(descriptor.getArtifactKey().getId())),
|
new FileListWriter(getFileListFile(descriptor.getArtifactKey().getId())),
|
||||||
|
|
|
@ -0,0 +1,76 @@
|
||||||
|
package org.eclipse.cdt.p2.internal.repo.artifact;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.io.OutputStream;
|
||||||
|
import java.util.zip.ZipEntry;
|
||||||
|
import java.util.zip.ZipInputStream;
|
||||||
|
|
||||||
|
public class ZipExtractor extends Thread {
|
||||||
|
|
||||||
|
private final InputStream in;
|
||||||
|
private final File installDir;
|
||||||
|
private final FileListWriter fileListWriter;
|
||||||
|
|
||||||
|
public ZipExtractor(InputStream in, File installDir, FileListWriter fileListWriter) {
|
||||||
|
this.in = in;
|
||||||
|
this.installDir = installDir;
|
||||||
|
this.fileListWriter = fileListWriter;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
ZipInputStream zipIn = new ZipInputStream(in);
|
||||||
|
for (ZipEntry zipEntry = zipIn.getNextEntry(); zipEntry != null; zipEntry = zipIn.getNextEntry()) {
|
||||||
|
File outFile = new File(installDir, zipEntry.getName());
|
||||||
|
if (zipEntry.isDirectory()) {
|
||||||
|
outFile.mkdirs();
|
||||||
|
} else {
|
||||||
|
if (outFile.exists())
|
||||||
|
outFile.delete();
|
||||||
|
else
|
||||||
|
outFile.getParentFile().mkdirs();
|
||||||
|
FileOutputStream outStream = new FileOutputStream(outFile);
|
||||||
|
copyStream(zipIn, false, outStream, true);
|
||||||
|
long lastModified = zipEntry.getTime();
|
||||||
|
outFile.setLastModified(lastModified);
|
||||||
|
fileListWriter.addFile(new InstalledFile(outFile, lastModified));
|
||||||
|
}
|
||||||
|
zipIn.closeEntry();
|
||||||
|
}
|
||||||
|
zipIn.close();
|
||||||
|
fileListWriter.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private static int copyStream(InputStream in, boolean closeIn, OutputStream out, boolean closeOut) throws IOException {
|
||||||
|
try {
|
||||||
|
int written = 0;
|
||||||
|
byte[] buffer = new byte[1024];
|
||||||
|
int len;
|
||||||
|
while ((len = in.read(buffer)) != -1) {
|
||||||
|
out.write(buffer, 0, len);
|
||||||
|
written += len;
|
||||||
|
}
|
||||||
|
return written;
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
if (closeIn) {
|
||||||
|
in.close();
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
if (closeOut) {
|
||||||
|
out.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue