Before doing anything else, make sure that you have Xcode installed.
Install the xa (xa65) open-source 6502 cross compiler. Download the source code. Then extract the file, cd into the directory, then:
tar xvf xa-2.3.9.tar.gz cd xa-2.3.9 make make install
Install Simple DirectMedia Layer (SDL2). Download the source code. Extract the file, cd into the directory, then:
tar xvf SDL2-2.0.10.tar.gz cd SDL2-2.0.10 ./configure make make install
Download the VICE source code. Extract the file, cd into the directory, then:
tar xvf vice-3.3.tar.gz cd vice-3.3 ./configure --enable-sdlui2 --disable-bundle make install
To run the C64 emulator, run the following:
x64sc