Interrupt / systemshock

Shockolate - A minimalist and cross platform System Shock source port.
GNU General Public License v3.0
801 stars 62 forks source link

How i can compile under Slackware64 14.2? #368

Closed inukaze closed 4 years ago

inukaze commented 4 years ago

Hi there when i try to compile i got this output :

cmake -DENABLE_SDL2=ON -DENABLE_SOUND=ON -DENABLE_FLUIDSYNTH=ON -DENABLE_OPENGL=ON -DCMAKE_INSTALL_PREFIX=. ..
-- The C compiler identification is GNU 5.5.0
-- The CXX compiler identification is GNU 5.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenGL: /usr/lib64/libGL.so   
-- SDL2 found: /usr/local/include/SDL2 -L/usr/local/lib -Wl,-rpath,/usr/local/lib -Wl,--enable-new-dtags -lSDL2
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.2") 
-- Checking for module 'SDL2_mixer>=2.0.4'
--   Requested 'SDL2_mixer >= 2.0.4' but version of SDL2_mixer is 2.0.2
CMake Error at /usr/share/cmake-3.16/Modules/FindPkgConfig.cmake:463 (message):
  A required package was not found
Call Stack (most recent call first):
  /usr/share/cmake-3.16/Modules/FindPkgConfig.cmake:643 (_pkg_check_modules_internal)
  CMakeLists.txt:76 (pkg_check_modules)

-- Configuring incomplete, errors occurred!
See also "/media/Slack32/tmp/shockolate/build/CMakeFiles/CMakeOutput.log".

The thing is the follow : SDL2=$(whereis -B "/usr/sbin" "/usr/local/sbin" "/sbin" "/usr/bin" "/usr/local/bin" "/bin" -b sdl2-config | grep -i "sdl2-config" | cut -d " " -f02 | cut -c10-20) SDL2=$($SDL2 --version) echo "$SDL2" 2.0.10

Becuase i before i had download, compile and install SDL2 2.0.10, near year ago i wrote a bash script with a function for detect and install SDL2, but well the part of detect the latest version on web SDL2 not working right now

Here i has wrote in the past for my own script :

function sdl2()
{
#Detectar la version de SDL2 [Requiere 2.0.6 como minimo]
#Nota : Tambien requiere SDL2-image en su version 2.0.5 como minimo y SDL2-ttf en su version 
SDL2=$(whereis -B "/usr/sbin" "/usr/local/sbin" "/sbin" "/usr/bin" "/usr/local/bin" "/bin" -b sdl2-config | grep -i "sdl2-config" | cut -d " " -f02 | cut -c10-20)
SDL2=$($SDL2 --version)
SDL2N=$(curl -s https://www.libsdl.org/release/ | grep -Po "SDL2-[1-9].[0-9].+[0-9].tar.gz" | sort -Vr | head -1 | cut -c25-35)
SDL2N="$SDL2N"

if (( $(awk 'BEGIN {print ("'2.0.6'" > "'$SDL2'")}') )); then
    echo 'SDL2 Version : "$SDL2"'
    echo 'Version minima requerida o superior NO Encontrada'
    echo 'Si intentara descargar, compilar e instalar SDL2 Version : '"$SDL2N.tar.gz"''
    mkdir -p "/tmp/cdf" ; cd "/tmp/cdf"
    wget -c "https://www.libsdl.org/release/$SDL2N.tar.gz"
    tar xfvz "$SDL2N.tar.gz"
    cd "$SDL2N"
    ./autogen.sh
    ./configure --prefix=/usr/local
    if [ "$Arquitectura" = "x64" ]; then
    CFLAGS='-O2 -fPIC -march=native -mtune=native -pipe'
    CXXFLAGS='-O2 -fPIC -march=native -mtune=native -pipe'
    export {C,CXX}FLAGS='-O2 -fPIC -march=native -mtune=native -pipe'
    export OPTFLAGS='-O2 -fPIC -march=native -mtune=native -pipe'
    fi
    if [ "$Arquitectura" = "x32" ]; then
        CFLAGS='-O2 -march=native -mtune=native -pipe'
    CXXFLAGS='-O2 -march=native -mtune=native -pipe'
    export {C,CXX}FLAGS='-O2 -march=native -mtune=native -pipe'
    export OPTFLAGS='-O2 -march=native -mtune=native -pipe'
    fi
    make
    su -c "make install" root
    cd ..
    #SDL2-Image :
    SDL2I=$(curl -s https://www.libsdl.org/projects/SDL_image/release/ | grep -Po "SDL2_image-[1-9].[0-9].+[0-9].tar.gz" | sort -Vr | head -1 | cut -c30-45)
    wget -c "https://www.libsdl.org/projects/SDL_image/release/$SDL2I.tar.gz"
    tar xfvz "$SDL2I".tar.gz
    cd "$SDL2I"
    ./autogen.sh
    ./configure --prefix=/usr/local
    if [ "$Arquitectura" = "x64" ]; then
    CFLAGS='-O2 -fPIC -march=native -mtune=native -pipe'
    CXXFLAGS='-O2 -fPIC -march=native -mtune=native -pipe'
    export {C,CXX}FLAGS='-O2 -fPIC -march=native -mtune=native -pipe'
    export OPTFLAGS='-O2 -fPIC -march=native -mtune=native -pipe'
    fi
    if [ "$Arquitectura" = "x32" ]; then
        CFLAGS='-O2 -march=native -mtune=native -pipe'
    CXXFLAGS='-O2 -march=native -mtune=native -pipe'
    export {C,CXX}FLAGS='-O2 -march=native -mtune=native -pipe'
    export OPTFLAGS='-O2 -march=native -mtune=native -pipe'
    fi
    make
    su -c "make install" root
    cd ..
    #SDL2-TTF :    
    SDL2T=$(curl -s https://www.libsdl.org/projects/SDL_ttf/release/ | grep -Po "SDL2_ttf-[1-9].[0-9].+[0-9].tar.gz" | sort -Vr | head -1 | cut -c29-43)
    wget -c "https://www.libsdl.org/projects/SDL_ttf/release/$SDL2T.tar.gz"
    tar xfvz "$SDL2T".tar.gz
    cd "$SDL2T"
    ./autogen.sh
    ./configure --prefix=/usr/local
    if [ "$Arquitectura" = "x64" ]; then
    CFLAGS='-O2 -fPIC -march=native -mtune=native -pipe'
    CXXFLAGS='-O2 -fPIC -march=native -mtune=native -pipe'
    export {C,CXX}FLAGS='-O2 -fPIC -march=native -mtune=native -pipe'
    export OPTFLAGS='-O2 -fPIC -march=native -mtune=native -pipe'
    fi
    if [ "$Arquitectura" = "x32" ]; then
        CFLAGS='-O2 -march=native -mtune=native -pipe'
    CXXFLAGS='-O2 -march=native -mtune=native -pipe'
    export {C,CXX}FLAGS='-O2 -march=native -mtune=native -pipe'
    export OPTFLAGS='-O2 -march=native -mtune=native -pipe'
    fi
    make
    su -c "make install" root
    cd ..
else 
    echo 'SDL2 Version : "$SDL2"'
    echo 'Version minima requerida o superior encontrada'
fi
}

From where that value is taken ? becuase if i run /usr/bin/pkg-config --modversion sdl2

i got : 2.0.9

farmboy0 commented 4 years ago

This is not about SDL2 this error talks about sdl2-mixer, a different library.

inukaze commented 4 years ago

i forgot paste the part of mixer xD. well better i write the what i do, better i do again and take screenshots :

su
cd /tmp
wget -c https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.4.tar.gz
tar xfz SDL2_mixer-2.0.4.tar.gz
cd SDL2_mixer-2.0.4

001

./autogen.sh

002

./configure.sh --prefix=/usr/local

003 004 005 006

Well i forgot install the opusfile dependency :

slkpkg -s sbo --rebuild --reinstall opusfile

007

CFLAGS='-O2 -fPIC -march=native -mtune=native -pipe'
CXXFLAGS='-O2 -fPIC -march=native -mtune=native -pipe'
export {C,CXX}FLAGS='-O2 -fPIC -march=native -mtune=native -pipe'
export OPTFLAGS='-O2 -fPIC -march=native -mtune=native -pipe'
./configure --prefix=/usr/local

008

make ; make install ; ldconfig

009

cd /media/Slack32/tmp/shockolate
cd build

010

reset
rm -rf *
cmake -DENABLE_SDL2=ON -DENABLE_SOUND=ON -DENABLE_FLUIDSYNTH=ON -DENABLE_OPENGL=ON -DCMAKE_INSTALL_PREFIX=. ..

Output :

-- The C compiler identification is GNU 5.5.0
-- The CXX compiler identification is GNU 5.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenGL: /usr/lib64/libGL.so   
-- SDL2 found: /usr/local/include/SDL2 -L/usr/local/lib -Wl,-rpath,/usr/local/lib -Wl,--enable-new-dtags -lSDL2
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.2") 
-- Checking for module 'SDL2_mixer>=2.0.4'
--   Requested 'SDL2_mixer >= 2.0.4' but version of SDL2_mixer is 2.0.2
CMake Error at /usr/share/cmake-3.16/Modules/FindPkgConfig.cmake:463 (message):
  A required package was not found
Call Stack (most recent call first):
  /usr/share/cmake-3.16/Modules/FindPkgConfig.cmake:643 (_pkg_check_modules_internal)
  CMakeLists.txt:76 (pkg_check_modules)

-- Configuring incomplete, errors occurred!
See also "/media/Slack32/tmp/shockolate/build/CMakeFiles/CMakeOutput.log".

011

Well i hope with the screenshots can be more clear the source code can't detect the SDL_Mixer 2.0.4 installed on /usr/local automatically detect and select the SDL2 mixer of /usr instead.

Some method to indicate just search the SDL2 libraries inside the /usr/local prefix and exclude the search of SDL2 in /usr for avoid this conflict ?

farmboy0 commented 4 years ago

As the cmake output shows pgk-config is used to find the library. You need to set the folder for the pgk-config files correctly.

inukaze commented 4 years ago

Well i had compile finally, but i don't had music, from where i can get the xmi files ? becauase the music playback don't work with FluidSynth or Timidity

winterheart commented 4 years ago

Hello. First, isn't Slackware don't have sdl2-mixer 2.0.4 in repositories? You probably should try them. Second, do you have XMI files under res/sound/sblaster or res/sound/genmidi?

inukaze commented 4 years ago

Slackware have SDL2-Mixer 2.0.12 in the repositories two or three days ago i post this, i compile it and i found the xmi files on my steam version of game.