DSFML icon indicating copy to clipboard operation
DSFML copied to clipboard

Installing on OSX with DUB tutorials

Open joelcnz opened this issue 9 years ago • 7 comments

I haven't been able to install it properly. Neither has my brother who does programming for a living.

joelcnz avatar Feb 05 '16 22:02 joelcnz

Can you tell me what you two have tried? It might help me with writing the tutorial.

Jebbs avatar Feb 05 '16 22:02 Jebbs

I can't remember what I did with the C/C++ side of the story.

I think I used GIT hub and then DUB.

I used 'export DYLD_LIBRARY_PATH=libs' when running programs.

I actually don't remember much.

joelcnz avatar Feb 05 '16 23:02 joelcnz

So, I'm in the middle of this atm - and it mostly works fine.

Installing it on OSX has been pretty easy - I've just installed all dependencies using brew (Including autotools and cmake).

As far as I remember, I believe all the brews you'll need to install is:

brew install sfml csfml autoconf cmake dub gcc

Incase the above isn't enough, here's the complete list of brews I have installed. Obviously all the ruby brews can be ignored, and probably most of the rest too. Just said I'd put em here to cross reference with the above if something goes wrong.

brew list
autoconf                gdbm                    libmpc                  rbenv
byobu                   gettext                 libogg                  rbenv-bundle-exec
cmake                   glew                   libpng                  rbenv-bundler
coreutils               gmp                     libvorbis               ruby-build
csfml                   gnu-sed                 mpfr                    s-lang
dub                     isl                     newt                    sfml
flac                    jpeg                    openssl                 tmux
freetype                ldc                     pcre                    wget
fswatch                 libconfig               pkg-config              zsh
gcc                     libevent                popt                    zsh-completions

From then, following the Posix install instructions for DSFMLC will get you to the point you can compile a dsfml D project with dub.

These are exactly what I followed:

git clone -b 2.1 --depth 1 https://github.com/Jebbs/DSFMLC.git
cd DSFMLC
cmake .
make
sudo make install

Then it should be plain sailing!

dub init myTestProject dsfml
cd myTestProject
dub build

The following doesn't matter anymore as has been fixed. Please ignore!

~~One caveat - dsfml:audio won't compile with dmd 2071 (the newest one at time of writing), with following errors:~~

⇒  dub build
Performing "debug" build using dmd for x86_64.
dsfml:system 2.1.0: target for configuration "library" is up to date.
dsfml:audio 2.1.0: building configuration "library"...
../../.dub/packages/dsfml-2.1.0/src/dsfml/audio/soundbuffer.d(63,21): Error: function object.Object.toString () is not callable using argument types (const(char)*)
../../.dub/packages/dsfml-2.1.0/src/dsfml/audio/soundbuffer.d(148,22): Error: function object.Object.toString () is not callable using argument types (const(char)*)
../../.dub/packages/dsfml-2.1.0/src/dsfml/audio/soundbuffer.d(172,22): Error: function object.Object.toString () is not callable using argument types (const(char)*)
../../.dub/packages/dsfml-2.1.0/src/dsfml/audio/soundbuffer.d(196,22): Error: function object.Object.toString () is not callable using argument types (const(char)*)
../../.dub/packages/dsfml-2.1.0/src/dsfml/audio/soundbuffer.d(222,22): Error: function object.Object.toString () is not callable using argument types (const(char)*)
../../.dub/packages/dsfml-2.1.0/src/dsfml/audio/soundbuffer.d(247,22): Error: function object.Object.toString () is not callable using argument types (const(char)*)
../../.dub/packages/dsfml-2.1.0/src/dsfml/audio/soundrecorder.d(61,21): Error: function object.Object.toString () is not callable using argument types (const(char)*)
../../.dub/packages/dsfml-2.1.0/src/dsfml/audio/soundrecorder.d(92,21): Error: function object.Object.toString () is not callable using argument types (const(char)*)
../../.dub/packages/dsfml-2.1.0/src/dsfml/audio/soundstream.d(82,21): Error: function object.Object.toString () is not callable using argument types (const(char)*)
../../.dub/packages/dsfml-2.1.0/src/dsfml/audio/soundstream.d(278,21): Error: function object.Object.toString () is not callable using argument types (const(char)*)
dmd failed with exit code 1.

Complete the above with either ldc or an older version of dmd (or gdc, but I didn't check that!) Have opened #223 for this.

grogancolin avatar Apr 27 '16 10:04 grogancolin

Yes! It worked, thank you very much, grogancolin!

I didn't see your reply, till now.

joelcnz avatar Dec 30 '16 02:12 joelcnz

brew gcc took about 2 hours to install. Is there some thing wrong?

Also, I got the following with brew update && brew upgrade && brew cleanup

==> Upgrading gcc Warning: Building gcc from source: The bottle needs the Xcode CLT to be installed.

joelcnz avatar Jan 15 '17 21:01 joelcnz

This is the rest of the brew/gcc stuff (wait forever!):

==> Upgrading gcc Warning: Building gcc from source: The bottle needs the Xcode CLT to be installed. ==> Downloading https://ftpmirror.gnu.org/gcc/gcc-6.3.0/gcc-6.3.0.tar.bz2 Already downloaded: /Users/joelchristensen/Library/Caches/Homebrew/gcc-6.3.0.tar.bz2 ==> Downloading https://raw.githubusercontent.com/Homebrew/formula-patches/e9e0e Already downloaded: /Users/joelchristensen/Library/Caches/Homebrew/gcc--patch-863957f90a934ee8f89707980473769cff47ca0663c3906992da6afb242fb220.patch ==> Patching ==> Applying 6.1.0-jit.patch patching file gcc/jit/Make-lang.in ==> ../configure --build=x86_64-apple-darwin16.1.0 --prefix=/usr/local/Cellar/gc ==> make bootstrap

joelcnz avatar Jan 15 '17 21:01 joelcnz

Taking for ever to update home brew stuff isn't very good. Can I do any thing about it? Do I just install Xcode CLT?

joelcnz avatar Feb 06 '17 04:02 joelcnz