From 279dfc31f537760da7e2c17e3e72826a2cb70f2f Mon Sep 17 00:00:00 2001 From: slava Date: Wed, 29 Mar 2006 06:34:26 +0000 Subject: [PATCH] .app now includes sources, .dmg is built automatically --- Makefile | 32 +++++++++++++++++++++++++++----- TODO.FACTOR.txt | 1 + cp_dir | 4 ++++ doc/UI_HOWTO.txt | 35 ----------------------------------- 4 files changed, 32 insertions(+), 40 deletions(-) create mode 100644 cp_dir delete mode 100644 doc/UI_HOWTO.txt diff --git a/Makefile b/Makefile index ed44e1bc76..040a8042fe 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,10 @@ CC = gcc -CP = cp BINARY = f IMAGE = factor.image BUNDLE = Factor.app -BUNDLE_BINARY = $(BUNDLE)/Contents/MacOS/Factor -BUNDLE_IMAGE = $(BUNDLE)/Contents/Resources/factor.image +DISK_IMAGE_DIR = Factor-0.81 +DISK_IMAGE = Factor-0.81.dmg ifdef DEBUG DEFAULT_CFLAGS = -g @@ -83,6 +82,9 @@ default: @echo "solaris" @echo "windows" @echo "" + @echo "On Unix, pass NO_UI=1 if you don't want to link with the" + @echo "X11 and OpenGL libraries." + @echo @echo "Also, you might want to set the SITE_CFLAGS environment" @echo "variable to enable some CPU-specific optimizations; this" @echo "can make a huge difference. Eg:" @@ -102,8 +104,21 @@ macosx: MACOSX=y macosx.app: - $(CP) $(BINARY) $(BUNDLE_BINARY) - $(CP) $(IMAGE) $(BUNDLE_IMAGE) + cp $(BINARY) $(BUNDLE)/Contents/MacOS/Factor + + rm -rf $(BUNDLE)/Contents/Resources/ + mkdir -p $(BUNDLE)/Contents/Resources/fonts/ + cp -R fonts/*.ttf $(BUNDLE)/Contents/Resources/fonts/ + + find doc library contrib \( -name '*.factor' \ + -o -name '*.facts' \ + -o -name '*.txt' \ + -o -name '*.html' \ + -o -name '*.js' \) \ + -exec ./cp_dir {} $(BUNDLE)/Contents/Resources/{} \; + + cp $(IMAGE) $(BUNDLE)/Contents/Resources/factor.image + install_name_tool \ -id @executable_path/../Frameworks/libfreetype.6.dylib \ Factor.app/Contents/Frameworks/libfreetype.6.dylib @@ -112,6 +127,13 @@ macosx.app: @executable_path/../Frameworks/libfreetype.6.dylib \ Factor.app/Contents/MacOS/Factor +macosx.dmg: + rm -rf $(DISK_IMAGE_DIR) + mkdir $(DISK_IMAGE_DIR) + cp -R $(BUNDLE) $(DISK_IMAGE_DIR)/$(BUNDLE) + hdiutil create -srcfolder "$(DISK_IMAGE_DIR)" -fs HFS+ \ + -volname "$(DISK_IMAGE_DIR)" "$(DISK_IMAGE)" + linux linux-x86 linux-amd64: $(MAKE) $(BINARY) \ CFLAGS="$(DEFAULT_CFLAGS) -export-dynamic" \ diff --git a/TODO.FACTOR.txt b/TODO.FACTOR.txt index 55045e37cf..5b5503e16a 100644 --- a/TODO.FACTOR.txt +++ b/TODO.FACTOR.txt @@ -3,6 +3,7 @@ - x11 title bars are funny - amd64 %box-struct - automate .dmg build, put sources there +- defining methods returning structs in objc + portability: diff --git a/cp_dir b/cp_dir new file mode 100644 index 0000000000..ef0e5f73f2 --- /dev/null +++ b/cp_dir @@ -0,0 +1,4 @@ +#!/bin/sh + +mkdir -p `dirname $2` +cp -v $1 $2 diff --git a/doc/UI_HOWTO.txt b/doc/UI_HOWTO.txt deleted file mode 100644 index d45a771909..0000000000 --- a/doc/UI_HOWTO.txt +++ /dev/null @@ -1,35 +0,0 @@ -How To Set up Factor's UI on Linux -by Daniel Ehrenberg - -On the ideal system, Factor's UI works all by itself after bootstrapping. To -get to the REPL, just run - ./f factor.image -shell=ui -But on many Linux systems, that doesn't work properly the whole time. The -problem may be an underlying issue with Factor; to test that, try doing just - ./f factor.image -and make sure a console REPL sucessfully appears. But it also may be that the -libraries needed to make the UI work aren't properly in place. You'll need four -libraries: libGL, libGLU, libfreetype, and libSDL. If you are missing any of these, -download them. But remember that on any linux system with X11, you should already -have these already. Once you've downloaded these, start - ./f factor.image -and type in the following commands: - "gl" load-library drop - "glu" load-library drop - "sdl" load-library drop - "freetype" load-library drop -See which ones of these fail. Each one that failed is a library that isn't on -your computer or is in the wrong place. To fix this, you need to first double -check that you have the library, and then, if you do, get it in the right place. -The directory the libraries should be in varies by the system, but it's usually -/usr/lib or /usr/local/lib. Find one most libraries seem to be in on your system. -Next, you need to use the right name for the file. For your OpenGL library, the -name is libGL.so.1. For GLU, it's libGLU.so.1. For SDL, the name is libSDL.so. -For FreeType, the name is libfreetype.so.6. Make a symbolic link from the current -location of the misplaced library to this new location, under the proper name in -the proper folder. You can do this with the command - ln -s oldlocation newlocation -The old file stays there and the new file mirrors the old one, reflecting all -future changes. Once this link is set up, rebootstrap and all should be well. -If things still do not work, don't hesitate to ask us at #concatenative on -freenode.net.