[Vm-dev] [commit] r2480 - Modify Newspeak MacOS vm to answer
Resources directory for primVMPath so that
commits at squeakvm.org
commits at squeakvm.org
Sat Jul 30 20:45:12 UTC 2011
Author: eliot
Date: 2011-07-30 13:45:12 -0700 (Sat, 30 Jul 2011)
New Revision: 2480
Modified:
branches/Cog/nscogbuild/macbuild/installer/LayoutDiskImage.applescript.in
branches/Cog/nscogbuild/macbuild/installer/Makefile
branches/Cog/nscogbuild/macbuild/installer/branding.gmk
branches/Cog/nscogbuild/macbuild/installer/installer-Darwin.gmk
branches/Cog/platforms/Cross/vm/sqSCCSVersion.h
branches/Cog/platforms/Mac OS/vm/sqMacImageIO.c
Log:
Modify Newspeak MacOS vm to answer Resources directory for primVMPath so that
the sources file can be included in the Resources directory (which makes for a
neater install). Modify the MacOS dmg installer a) to put the sources in the
Resources directory and b) to include the YY.WW.REV version in the dmg name.
Modified: branches/Cog/nscogbuild/macbuild/installer/LayoutDiskImage.applescript.in
===================================================================
--- branches/Cog/nscogbuild/macbuild/installer/LayoutDiskImage.applescript.in 2011-07-30 00:26:10 UTC (rev 2479)
+++ branches/Cog/nscogbuild/macbuild/installer/LayoutDiskImage.applescript.in 2011-07-30 20:45:12 UTC (rev 2480)
@@ -16,7 +16,6 @@
end tell
set position of item "Applications" to {370, 91}
set position of item "@@VM_LOCALIZED_NAME@@.app" to {130, 91}
- set position of item "@@SOURCEFILENAME1@@" to {130, 266}
eject
end tell
end tell
Modified: branches/Cog/nscogbuild/macbuild/installer/Makefile
===================================================================
--- branches/Cog/nscogbuild/macbuild/installer/Makefile 2011-07-30 00:26:10 UTC (rev 2479)
+++ branches/Cog/nscogbuild/macbuild/installer/Makefile 2011-07-30 20:45:12 UTC (rev 2480)
@@ -5,6 +5,7 @@
# edit and run ./links to get .app and sources, then run make
SOURCES := yes
+SOURCEFILENAME1 := $(shell echo ~/Squeak/SqueakV41.sources)
DOCUMENTATION_DIR := doc
include branding.gmk
@@ -20,9 +21,9 @@
$(VM_LOCALIZED_NAME_ESC).app:
rm -rf $(VM_LOCALIZED_NAME_ESC).app
cp -R ../Fast.app $(VM_LOCALIZED_NAME_ESC).app
+ ln $(SOURCEFILENAME1) $(VM_LOCALIZED_NAME_ESC).app/Contents/Resources
# Cab contents:
VM_BUNDLE := $(VM_LOCALIZED_NAME_ESC).app
-SOURCEFILENAME1 := SqueakV41.sources
include installer-Darwin.gmk
Modified: branches/Cog/nscogbuild/macbuild/installer/branding.gmk
===================================================================
--- branches/Cog/nscogbuild/macbuild/installer/branding.gmk 2011-07-30 00:26:10 UTC (rev 2479)
+++ branches/Cog/nscogbuild/macbuild/installer/branding.gmk 2011-07-30 20:45:12 UTC (rev 2480)
@@ -1,7 +1,11 @@
# Version should follow the Windows convention (0-255.0-255.0-65535)
# For the prototype, use YY.MM.DDNN (NN should come from the image
# name, e.g., nsboot-20YY-MM-DD.NN.image)
-#VERSION := 07.11.0101
+# For Cog would like to use YY.MMDD.SVN where SVN is the Subversion checkin
+# id taken from platforms/Cross/vm/sqSCCSVersion.h. But that doesn't fit
+# the 0-255 field. So use YY.WW.SVN where WW is the week number.
+SVNREV := $(shell grep '\$Rev: ' ../../../platforms/Cross/vm/sqSCCSVersion.h | sed 's/.*$Rev: \([0-9][0-9]*\).*/\1/' )
+VERSION := $(shell date +%g.%U.$(SVNREV))
# Base name of the executable (.exe is appended on Windows)
ifndef VM_BASE_NAME
Modified: branches/Cog/nscogbuild/macbuild/installer/installer-Darwin.gmk
===================================================================
--- branches/Cog/nscogbuild/macbuild/installer/installer-Darwin.gmk 2011-07-30 00:26:10 UTC (rev 2479)
+++ branches/Cog/nscogbuild/macbuild/installer/installer-Darwin.gmk 2011-07-30 20:45:12 UTC (rev 2480)
@@ -1,4 +1,4 @@
-VM_DMG := $(VM_LOCALIZED_NAME_ESC).dmg
+VM_DMG := $(VM_LOCALIZED_NAME_ESC)-$(VERSION).dmg
$(VM_DMG): $(VM_BUNDLE) $(INSTALLER_BACKGROUND).png LayoutDiskImage.applescript $(INSTALLER_ICON).icns
-hdiutil eject '/Volumes/$(PRODUCT_NAME)'
@@ -9,7 +9,6 @@
cp -p '$(INSTALLER_BACKGROUND).png' '/Volumes/$(PRODUCT_NAME)/.background'
ln -s /Applications '/Volumes/$(PRODUCT_NAME)/.'
ditto $(VM_BUNDLE) '/Volumes/$(PRODUCT_NAME)/$(VM_LOCALIZED_NAME).app'
- ditto $(SOURCEFILENAME1) '/Volumes/$(PRODUCT_NAME)/$(SOURCEFILENAME1)'
bless --folder '/Volumes/$(PRODUCT_NAME)' --openfolder '/Volumes/$(PRODUCT_NAME)'
cp '$(INSTALLER_ICON).icns' '/Volumes/$(PRODUCT_NAME)/.VolumeIcon.icns'
/Developer/Tools/SetFile -a C '/Volumes/$(PRODUCT_NAME)'
Property changes on: branches/Cog/platforms/Cross/vm/sqSCCSVersion.h
___________________________________________________________________
Modified: checkindate
- Fri Jul 29 12:58:01 PDT 2011
+ Sat Jul 30 13:44:56 PDT 2011
Modified: branches/Cog/platforms/Mac OS/vm/sqMacImageIO.c
===================================================================
--- branches/Cog/platforms/Mac OS/vm/sqMacImageIO.c 2011-07-30 00:26:10 UTC (rev 2479)
+++ branches/Cog/platforms/Mac OS/vm/sqMacImageIO.c 2011-07-30 20:45:12 UTC (rev 2480)
@@ -22,22 +22,44 @@
#include "sqMacEncoding.h"
+/* On Newspeak we want to answer the Resources directory for vmPathGetLength/
+ * primitiveVMPath/primVMPath since this allows us to put the sources file
+ * in the Resources directory.
+ */
+#if NewspeakVM
+static void
+getVMResourcesDirectory(char *path)
+{
+extern char **argVec;
+ ux2sqPath(argVec[0], strlen(argVec[0]), path, VMPATH_SIZE,1);
+ strcpy(strstr(path,"MacOS/"),"Resources");
+}
+#endif /* NewspeakVM */
+
/*** VM Home Directory Path ***/
int vmPathSize(void) {
- char path[VMPATH_SIZE + 1];
-
- getVMPathWithEncoding(path,gCurrentVMEncoding);
+ char path[VMPATH_SIZE + 1];
+
+#if NewspeakVM
+ getVMResourcesDirectory(path);
+#else
+ getVMPathWithEncoding(path,gCurrentVMEncoding);
+#endif
return strlen(path);
}
int vmPathGetLength(sqInt sqVMPathIndex, int length) {
char *stVMPath = (char *) sqVMPathIndex;
int count, i;
- char path[VMPATH_SIZE + 1];
+ char path[VMPATH_SIZE + 1];
- getVMPathWithEncoding(path,gCurrentVMEncoding);
+#if NewspeakVM
+ getVMResourcesDirectory(path);
+#else
+ getVMPathWithEncoding(path,gCurrentVMEncoding);
+#endif
count = strlen(path);
count = (length < count) ? length : count;
More information about the Vm-dev
mailing list