[48613] users/toby/objcports

toby at macports.org toby at macports.org
Thu Mar 26 00:32:41 PDT 2009


Revision: 48613
          http://trac.macports.org/changeset/48613
Author:   toby at macports.org
Date:     2009-03-26 00:32:41 -0700 (Thu, 26 Mar 2009)
Log Message:
-----------
misc fixes, and stub out enough junk to parse nearly all ports

Modified Paths:
--------------
    users/toby/objcports/MPParser.m
    users/toby/objcports/MPPort.m
    users/toby/objcports/port.m
    users/toby/objcports/variables.plist

Modified: users/toby/objcports/MPParser.m
===================================================================
--- users/toby/objcports/MPParser.m	2009-03-26 07:16:22 UTC (rev 48612)
+++ users/toby/objcports/MPParser.m	2009-03-26 07:32:41 UTC (rev 48613)
@@ -9,6 +9,7 @@
 static void command_create(Tcl_Interp *interp, const char *cmdName, ClientData clientData);
 static char *variable_read(ClientData clientData, Tcl_Interp *interp, const char *name1, const char *name2, int flags);
 static int _nslog(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
+static int _fake_boolean(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
 
 @implementation MPParser
 
@@ -19,7 +20,7 @@
 	_port = [port retain];
 
 	_interp = Tcl_CreateInterp();
-	Tcl_MakeSafe(_interp); // XXX: should probably remove even more functionality
+	//Tcl_MakeSafe(_interp); // XXX: should probably remove even more functionality
 
 	@try {
 		Tcl_Preserve(_interp);
@@ -48,10 +49,34 @@
 		}
 
 		Tcl_CreateObjCommand(_interp, "nslog", _nslog, NULL, NULL); // XXX: debugging
+
+		// bogus targets
+		Tcl_CreateObjCommand(_interp, "pre-activate", _nslog, NULL, NULL); // XXX: debugging
 		Tcl_CreateObjCommand(_interp, "post-activate", _nslog, NULL, NULL); // XXX: debugging
+		Tcl_CreateObjCommand(_interp, "pre-install", _nslog, NULL, NULL); // XXX: debugging
+		Tcl_CreateObjCommand(_interp, "post-install", _nslog, NULL, NULL); // XXX: debugging
+		Tcl_CreateObjCommand(_interp, "post-pkg", _nslog, NULL, NULL); // XXX: debugging
+		Tcl_CreateObjCommand(_interp, "post-mpkg", _nslog, NULL, NULL); // XXX: debugging
+		Tcl_CreateObjCommand(_interp, "archive", _nslog, NULL, NULL); // XXX: debugging
+		Tcl_CreateObjCommand(_interp, "install", _nslog, NULL, NULL); // XXX: debugging
+		Tcl_CreateObjCommand(_interp, "activate", _nslog, NULL, NULL); // XXX: debugging
+		Tcl_CreateObjCommand(_interp, "unarchive", _nslog, NULL, NULL); // XXX: debugging
+		Tcl_CreateObjCommand(_interp, "post-clean", _nslog, NULL, NULL); // XXX: debugging
 
+		// functions we need to provide (?)
+		Tcl_CreateObjCommand(_interp, "variant_isset", _fake_boolean, NULL, NULL); // XXX: debugging
+		Tcl_CreateObjCommand(_interp, "variant_set", _fake_boolean, NULL, NULL); // XXX: debugging
+		Tcl_CreateObjCommand(_interp, "tbool", _fake_boolean, NULL, NULL); // XXX: debugging
+		Tcl_CreateObjCommand(_interp, "strsed", _nslog, NULL, NULL); // XXX: debugging
+		Tcl_CreateObjCommand(_interp, "suffix", _nslog, NULL, NULL); // XXX: debugging
+		Tcl_CreateObjCommand(_interp, "include", _nslog, NULL, NULL); // XXX: debugging
+
+		// variables that should be constant
+		Tcl_CreateObjCommand(_interp, "prefix", _nslog, NULL, NULL);
+
 		if (Tcl_EvalFile(_interp, [[_port portfile] UTF8String]) != TCL_OK) {
 			NSLog(@"Tcl_EvalFile(): %s", Tcl_GetStringResult(_interp));
+			exit(1);
 		}
 
 		Tcl_Release(_interp);
@@ -173,7 +198,7 @@
 {
 	NSString *var = [(MPPort *)clientData variable:[NSString stringWithUTF8String:name1]];
 	assert(var != nil);
-	Tcl_SetVar2Ex(interp, name1, name2, Tcl_SubstObj(interp, Tcl_NewStringObj([var UTF8String], -1), TCL_SUBST_ALL), 0);
+	Tcl_SetVar2Ex(interp, name1, name2, Tcl_SubstObj(interp, Tcl_NewStringObj([var UTF8String], -1), TCL_SUBST_VARIABLES), 0);
 	return NULL;
 }
 
@@ -187,3 +212,10 @@
 
 	return TCL_OK;
 }
+
+static int
+_fake_boolean(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
+{
+	Tcl_SetObjResult(interp, Tcl_NewBooleanObj(0));
+	return TCL_OK;
+}

Modified: users/toby/objcports/MPPort.m
===================================================================
--- users/toby/objcports/MPPort.m	2009-03-26 07:16:22 UTC (rev 48612)
+++ users/toby/objcports/MPPort.m	2009-03-26 07:32:41 UTC (rev 48613)
@@ -37,12 +37,12 @@
 	for (NSString *command in commands) {
 		[_variableInfo setObject:[NSDictionary dictionary] forKey:[NSString stringWithFormat:@"use_%@", command]];
 		[_variableInfo setObject:[NSDictionary dictionary] forKey:[NSString stringWithFormat:@"%@.dir", command]];
-		[_variableInfo setObject:[NSDictionary dictionary] forKey:[NSString stringWithFormat:@"%@.pre_args", command]];
-		[_variableInfo setObject:[NSDictionary dictionary] forKey:[NSString stringWithFormat:@"%@.args", command]];
-		[_variableInfo setObject:[NSDictionary dictionary] forKey:[NSString stringWithFormat:@"%@.post_args", command]];
+		[_variableInfo setObject:[NSDictionary dictionaryWithObject:[NSNumber numberWithBool:YES] forKey:@"AppendDelete"] forKey:[NSString stringWithFormat:@"%@.pre_args", command]];
+		[_variableInfo setObject:[NSDictionary dictionaryWithObject:[NSNumber numberWithBool:YES] forKey:@"AppendDelete"] forKey:[NSString stringWithFormat:@"%@.args", command]];
+		[_variableInfo setObject:[NSDictionary dictionaryWithObject:[NSNumber numberWithBool:YES] forKey:@"AppendDelete"] forKey:[NSString stringWithFormat:@"%@.post_args", command]];
 		[_variableInfo setObject:[NSDictionary dictionaryWithObject:[NSNumber numberWithBool:YES] forKey:@"AppendDelete"] forKey:[NSString stringWithFormat:@"%@.env", command]];
 		[_variableInfo setObject:[NSDictionary dictionary] forKey:[NSString stringWithFormat:@"%@.type", command]];
-		[_variableInfo setObject:[NSDictionary dictionary] forKey:[NSString stringWithFormat:@"%@.cmd", command]];
+		[_variableInfo setObject:[NSDictionary dictionaryWithObject:[NSNumber numberWithBool:YES] forKey:@"AppendDelete"] forKey:[NSString stringWithFormat:@"%@.cmd", command]];
 	}
 
 	_parser = [[MPParser alloc] initWithPort:self];
@@ -73,10 +73,12 @@
 {
 	return [NSArray arrayWithObjects:
 		@"fetch",
+		@"checksum",
 		@"extract",
 		@"patch",
 		@"configure",
 		@"build",
+		@"test",
 		@"destroot",
 		nil];
 }
@@ -141,12 +143,13 @@
 
 - (void)variable:(NSString *)var append:(NSArray *)value
 {
-	[_variables setObject:[NSString stringWithFormat:@"%@ %@", [_variables objectForKey:var], [value componentsJoinedByString:@" "]] forKey:var];
+	// XXX: this doesn't work quite right when appending to an empty string
+	[_variables setObject:[NSString stringWithFormat:@"%@ %@", [self variable:var], [value componentsJoinedByString:@" "]] forKey:var];
 }
 
 - (void)variable:(NSString *)var delete:(NSArray *)value
 {
-	NSMutableArray *tmp = [[[_variables objectForKey:var] componentsSeparatedByString:@" "] mutableCopy];
+	NSMutableArray *tmp = [[[self variable:var] componentsSeparatedByString:@" "] mutableCopy];
 	for (NSString *v in value) {
 		[tmp removeObject:v];
 	}

Modified: users/toby/objcports/port.m
===================================================================
--- users/toby/objcports/port.m	2009-03-26 07:16:22 UTC (rev 48612)
+++ users/toby/objcports/port.m	2009-03-26 07:32:41 UTC (rev 48613)
@@ -8,23 +8,24 @@
 {
 	NSAutoreleasePool *pool = [NSAutoreleasePool new];
 
-	if (argc != 2)
+	if (argc < 2)
 		exit(1);
 
-	MPPort *port = [[MPPort alloc] initWithPortfile:[NSString stringWithUTF8String:argv[1]] options:nil];
-	NSLog(@"%@ @%@ (%@)", [port variable:@"name"], [port variable:@"version"], [port variable:@"categories"]);
-	NSLog(@"Variants:             %@", [[port definedVariants] componentsJoinedByString:@", "]);
-	NSLog(@"PlatformVariants:     %@", [[port definedPlatforms] componentsJoinedByString:@", "]);
-	NSLog(@"Brief Description:    %@", [port variable:@"description"]);
-	NSLog(@"Description:          %@", [port variable:@"long_description"]);
-	NSLog(@"Homepage:             %@", [port variable:@"homepage"]);
-	NSLog(@"Build Dependencies:   %@", [port variable:@"depends_build"]);
-	NSLog(@"Library Dependencies: %@", [port variable:@"depends_lib"]);
-	NSLog(@"Platforms:            %@", [port variable:@"platforms"]);
-	NSLog(@"Maintainers:          %@", [port variable:@"maintainers"]);
+	while (--argc) {
+		MPPort *port = [[MPPort alloc] initWithPortfile:[NSString stringWithUTF8String:*++argv] options:nil];
+		NSLog(@"%@ @%@ (%@)", [port variable:@"name"], [port variable:@"version"], [port variable:@"categories"]);
+		NSLog(@"Variants:             %@", [[port definedVariants] componentsJoinedByString:@", "]);
+		NSLog(@"PlatformVariants:     %@", [[port definedPlatforms] componentsJoinedByString:@", "]);
+		NSLog(@"Brief Description:    %@", [port variable:@"description"]);
+		NSLog(@"Description:          %@", [port variable:@"long_description"]);
+		NSLog(@"Homepage:             %@", [port variable:@"homepage"]);
+		NSLog(@"Build Dependencies:   %@", [port variable:@"depends_build"]);
+		NSLog(@"Library Dependencies: %@", [port variable:@"depends_lib"]);
+		NSLog(@"Platforms:            %@", [port variable:@"platforms"]);
+		NSLog(@"Maintainers:          %@", [port variable:@"maintainers"]);
+		[port release];
+	}
 
-	[port release];
-
 	[pool release];
 	return 0;
 }

Modified: users/toby/objcports/variables.plist
===================================================================
--- users/toby/objcports/variables.plist	2009-03-26 07:16:22 UTC (rev 48612)
+++ users/toby/objcports/variables.plist	2009-03-26 07:32:41 UTC (rev 48613)
@@ -2,33 +2,141 @@
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <plist version="1.0">
 <dict>
+	<key>applications_dir</key>
+	<dict>
+		<key>Constant</key>
+		<true/>
+	</dict>
+	<key>build.jobs</key>
+	<dict/>
 	<key>build.target</key>
+	<dict>
+		<key>AppendDelete</key>
+		<true/>
+	</dict>
+	<key>buildmakejobs</key>
 	<dict/>
+	<key>buildnicevalue</key>
+	<dict/>
 	<key>categories</key>
-	<dict/>
+	<dict>
+		<key>AppendDelete</key>
+		<true/>
+	</dict>
 	<key>checksums</key>
+	<dict>
+		<key>AppendDelete</key>
+		<true/>
+	</dict>
+	<key>configure.awk</key>
 	<dict/>
+	<key>configure.cc</key>
+	<dict>
+		<key>AppendDelete</key>
+		<true/>
+	</dict>
+	<key>configure.ccache</key>
+	<dict/>
 	<key>configure.cflags</key>
 	<dict>
 		<key>AppendDelete</key>
 		<true/>
 	</dict>
+	<key>configure.compiler</key>
+	<dict/>
+	<key>configure.cpp</key>
+	<dict/>
 	<key>configure.cppflags</key>
 	<dict>
 		<key>AppendDelete</key>
 		<true/>
 	</dict>
+	<key>configure.cxx</key>
+	<dict/>
+	<key>configure.cxxflags</key>
+	<dict>
+		<key>AppendDelete</key>
+		<true/>
+	</dict>
+	<key>configure.distcc</key>
+	<dict/>
+	<key>configure.f77</key>
+	<dict/>
+	<key>configure.f90</key>
+	<dict/>
+	<key>configure.fc</key>
+	<dict/>
+	<key>configure.fcflags</key>
+	<dict>
+		<key>AppendDelete</key>
+		<true/>
+	</dict>
+	<key>configure.install</key>
+	<dict/>
+	<key>configure.javac</key>
+	<dict/>
+	<key>configure.ldflags</key>
+	<dict>
+		<key>AppendDelete</key>
+		<true/>
+	</dict>
+	<key>configure.libs</key>
+	<dict/>
+	<key>configure.perl</key>
+	<dict/>
+	<key>configure.pipe</key>
+	<dict/>
+	<key>configure.pkg_config</key>
+	<dict/>
+	<key>configure.pkg_config_path</key>
+	<dict/>
+	<key>configure.python</key>
+	<dict/>
+	<key>configure.universal_archs</key>
+	<dict>
+		<key>Constant</key>
+		<true/>
+	</dict>
 	<key>configure.universal_args</key>
 	<dict>
 		<key>AppendDelete</key>
 		<true/>
 	</dict>
+	<key>configure.universal_ldflags</key>
+	<dict>
+		<key>AppendDelete</key>
+		<true/>
+	</dict>
+	<key>cvs.date</key>
+	<dict/>
+	<key>cvs.module</key>
+	<dict/>
+	<key>cvs.password</key>
+	<dict/>
+	<key>cvs.root</key>
+	<dict/>
+	<key>cvs.tag</key>
+	<dict/>
+	<key>default_variants</key>
+	<dict>
+		<key>AppendDelete</key>
+		<true/>
+	</dict>
 	<key>depends_build</key>
-	<dict/>
+	<dict>
+		<key>AppendDelete</key>
+		<true/>
+	</dict>
 	<key>depends_lib</key>
-	<dict/>
+	<dict>
+		<key>AppendDelete</key>
+		<true/>
+	</dict>
 	<key>depends_run</key>
-	<dict/>
+	<dict>
+		<key>AppendDelete</key>
+		<true/>
+	</dict>
 	<key>description</key>
 	<dict/>
 	<key>destroot</key>
@@ -37,30 +145,86 @@
 		<true/>
 	</dict>
 	<key>destroot.destdir</key>
+	<dict>
+		<key>AppendDelete</key>
+		<true/>
+	</dict>
+	<key>destroot.keepdirs</key>
 	<dict/>
 	<key>destroot.target</key>
+	<dict>
+		<key>AppendDelete</key>
+		<true/>
+	</dict>
+	<key>destroot.violate_mtree</key>
 	<dict/>
+	<key>dist_subdir</key>
+	<dict/>
+	<key>distfiles</key>
+	<dict>
+		<key>AppendDelete</key>
+		<true/>
+	</dict>
 	<key>distname</key>
 	<dict/>
 	<key>epoch</key>
 	<dict/>
+	<key>extract.mkdir</key>
+	<dict/>
+	<key>extract.only</key>
+	<dict/>
 	<key>extract.suffix</key>
 	<dict/>
+	<key>fetch.ignore_sslcert</key>
+	<dict/>
+	<key>fetch.password</key>
+	<dict/>
 	<key>fetch.type</key>
 	<dict/>
+	<key>fetch.use_epsv</key>
+	<dict/>
+	<key>fetch.user</key>
+	<dict/>
+	<key>filespath</key>
+	<dict>
+		<key>Constant</key>
+		<true/>
+	</dict>
+	<key>frameworks_dir</key>
+	<dict>
+		<key>Constant</key>
+		<true/>
+	</dict>
+	<key>git.url</key>
+	<dict/>
+	<key>haskell.setup</key>
+	<dict/>
 	<key>homepage</key>
 	<dict/>
 	<key>livecheck.check</key>
 	<dict/>
+	<key>livecheck.distname</key>
+	<dict/>
+	<key>livecheck.md5</key>
+	<dict/>
+	<key>livecheck.name</key>
+	<dict/>
 	<key>livecheck.regex</key>
 	<dict/>
 	<key>livecheck.url</key>
 	<dict/>
+	<key>livecheck.version</key>
+	<dict/>
 	<key>long_description</key>
 	<dict/>
 	<key>maintainers</key>
 	<dict/>
 	<key>master_sites</key>
+	<dict>
+		<key>AppendDelete</key>
+		<true/>
+	</dict>
+	<key>master_sites.mirror_subdir</key>
 	<dict/>
 	<key>name</key>
 	<dict/>
@@ -92,27 +256,109 @@
 	<key>patch_sites</key>
 	<dict/>
 	<key>patchfiles</key>
+	<dict>
+		<key>AppendDelete</key>
+		<true/>
+	</dict>
+	<key>perl5.bin</key>
 	<dict/>
+	<key>perl5.lib</key>
+	<dict/>
+	<key>perl5.module</key>
+	<dict/>
+	<key>perl5.setup</key>
+	<dict/>
+	<key>perl5.use_module_build</key>
+	<dict/>
+	<key>perl5.version</key>
+	<dict/>
 	<key>platforms</key>
 	<dict/>
 	<key>prefix</key>
+	<dict>
+		<key>Constant</key>
+		<true/>
+	</dict>
+	<key>python.bin</key>
 	<dict/>
+	<key>python.branch</key>
+	<dict/>
+	<key>python.include</key>
+	<dict/>
+	<key>python.pkgd</key>
+	<dict/>
+	<key>python.prefix</key>
+	<dict/>
 	<key>revision</key>
 	<dict/>
+	<key>ruby.bin</key>
+	<dict/>
+	<key>ruby.filename</key>
+	<dict/>
+	<key>ruby.lib</key>
+	<dict/>
+	<key>ruby.module</key>
+	<dict/>
+	<key>ruby.project</key>
+	<dict/>
+	<key>ruby.setup</key>
+	<dict/>
+	<key>ruby.version</key>
+	<dict/>
+	<key>startupitem.create</key>
+	<dict/>
+	<key>startupitem.executable</key>
+	<dict/>
+	<key>startupitem.init</key>
+	<dict/>
+	<key>startupitem.logfile</key>
+	<dict/>
+	<key>startupitem.name</key>
+	<dict/>
+	<key>startupitem.netchange</key>
+	<dict/>
+	<key>startupitem.pidfile</key>
+	<dict/>
+	<key>startupitem.requires</key>
+	<dict/>
+	<key>startupitem.restart</key>
+	<dict/>
+	<key>startupitem.start</key>
+	<dict/>
+	<key>startupitem.stop</key>
+	<dict/>
+	<key>startupitem.type</key>
+	<dict/>
 	<key>svn.tag</key>
 	<dict/>
 	<key>svn.url</key>
 	<dict/>
+	<key>sysroot</key>
+	<dict>
+		<key>Constant</key>
+		<true/>
+	</dict>
+	<key>test.run</key>
+	<dict/>
+	<key>test.target</key>
+	<dict/>
 	<key>universal_variant</key>
 	<dict/>
 	<key>use_bzip2</key>
 	<dict/>
+	<key>use_lzma</key>
+	<dict/>
 	<key>use_parallel_build</key>
 	<dict/>
 	<key>use_zip</key>
 	<dict/>
 	<key>version</key>
 	<dict/>
+	<key>workpath</key>
+	<dict>
+		<key>Constant</key>
+		<true/>
+	</dict>
 	<key>worksrcdir</key>
 	<dict/>
 	<key>worksrcpath</key>
@@ -120,5 +366,43 @@
 		<key>Constant</key>
 		<true/>
 	</dict>
+	<key>x11font.setup</key>
+	<dict/>
+	<key>x11prefix</key>
+	<dict>
+		<key>Constant</key>
+		<true/>
+	</dict>
+	<key>xcode.build.settings</key>
+	<dict>
+		<key>AppendDelete</key>
+		<true/>
+	</dict>
+	<key>xcode.configuration</key>
+	<dict/>
+	<key>xcode.destroot.path</key>
+	<dict/>
+	<key>xcode.destroot.settings</key>
+	<dict>
+		<key>AppendDelete</key>
+		<true/>
+	</dict>
+	<key>xcode.destroot.type</key>
+	<dict/>
+	<key>xcode.project</key>
+	<dict/>
+	<key>xcode.target</key>
+	<dict/>
+	<key>xcodeversion</key>
+	<dict>
+		<key>Constant</key>
+		<true/>
+	</dict>
+	<key>zope.need_subdir</key>
+	<dict/>
+	<key>zope.product</key>
+	<dict/>
+	<key>zope.setup</key>
+	<dict/>
 </dict>
 </plist>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090326/8870850d/attachment-0001.html>


More information about the macports-changes mailing list