diff --git a/makefile b/makefile index 17ce2096..975fd2f6 100644 --- a/makefile +++ b/makefile @@ -51,9 +51,6 @@ RES_DIR=res OUT_DIR=bin TARGET = $(OUT_DIR)/$(OUT_NAME) -LIBGLEZ=libglez/bin32/libglez.so -LIBXOVERLAY=libxoverlay/bin32/libxoverlay.so - INCLUDES=-I. -Iinclude -Iucccccp -isystem/usr/include/c++/6.3.1 -isystem$(SSDK_DIR)/public -isystem$(SSDK_DIR)/mathlib -isystem$(SSDK_DIR)/common -isystem$(SSDK_DIR)/public/tier1 -isystem$(SSDK_DIR)/public/tier0 -isystem$(SSDK_DIR) LDLIBS=-static -l:libc.so.6 -l:libstdc++.so.6 -l:libtier0.so -l:libvstdlib.so LDFLAGS=-shared -L$(realpath $(LIB_DIR)) @@ -165,12 +162,6 @@ src/sdk/utlbuffer.o : CXXFLAGS+=-w # end of 3rd party sources -$(LIBGLEZ): - $(MAKE) -C libglez -e ARCH=32 - -$(LIBXOVERLAY): - $(MAKE) -C libxoverlay -e ARCH=32 - .cpp.o: @echo Compiling $< $(CXX) $(CXXFLAGS) -c $< -o $@ @@ -182,7 +173,7 @@ $(LIBXOVERLAY): %.d: %.cpp @$(CXX) -M $(CXXFLAGS) $< > $@ -$(TARGET): $(OBJECTS) $(LIBGLEZ) $(LIBXOVERLAY) +$(TARGET): $(OBJECTS) @echo Building cathook $(LD) -o $@ $(LDFLAGS) $(OBJECTS) $(LDLIBS) ifndef BUILD_DEBUG diff --git a/scripts/catlibs b/scripts/catlibs new file mode 100755 index 00000000..30459f9b --- /dev/null +++ b/scripts/catlibs @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +. common + +$DIALOG --title "Install?" --backtitle "Installing catlibs" --yesno "This script will ask you for superuser password to install xoverlay and glez." 9 78 +if [ $? == 1 ]; then exit; fi + +SU=gksu + +if ! command -v gksu; then + SU=sudo + exit +fi + +pushd ../libxoverlay +if ! make -e ARCH=32 >/tmp/buildxoverlay.log; then + $DIALOG --title "Build failed" --msgbox "Failed to build libxoverlay. See /tmp/buildxoverlay.log for more info." 9 78 + exit +fi +$SU make install +popd + +pushd ../libglez +if ! make -e ARCH=32 >/tmp/buildglez.log; then + $DIALOG --title "Build failed" --msgbox "Failed to build libglez. See /tmp/buildglez.log for more info." 9 78 + exit +fi +$SU make install +popd \ No newline at end of file diff --git a/scripts/depends b/scripts/depends index 59e0768d..e55fbb2b 100755 --- a/scripts/depends +++ b/scripts/depends @@ -4,6 +4,6 @@ # do not depend on graphical libraries if compiling for textmode # do not depend on X libraries if Xoverlay is disabled -DEPENDS_LIBRARIES=(ssl m rt GL freetype GLEW png X11 Xext pthread Xfixes); +DEPENDS_LIBRARIES=(ssl m rt GL freetype GLEW png X11 Xext pthread Xfixes xoverlay glez); DEPENDS_HEADERS=("SDL2/SDL.h" "freetype2/freetype/config/ftheader.h" "openssl/err.h" "GL/gl.h" "GL/glew.h"); DEPENDS_PACKAGES=("gcc-6" "g++-6" "gcc-6-multilib" "g++-6-multilib" "libssl-dev:i386" "libsdl2-dev" "libfreetype6-dev" "libfreetype6-dev:i386" "libglew-dev" "libglew-dev:i386" "libpng-dev" "libpng-dev:i386"); \ No newline at end of file diff --git a/scripts/menu b/scripts/menu index 2af5c504..ba32d635 100755 --- a/scripts/menu +++ b/scripts/menu @@ -10,8 +10,9 @@ While cathook can work on most distros, most helper scripts can work incorrectly If you have trouble, you can visit cathook's official telegram channel and ask for help from other users of your distro there." 15 50 fi -USER=$($DIALOG --title "Main Menu (WIP)" --menu "What do you want to do?" 20 60 11 \ +USER=$($DIALOG --title "Main Menu (WIP)" --menu "What do you want to do?" 20 60 12 \ "DEP" "| Check requirements (Ubuntu)" \ + "CAT" "| Install libglez and libxoverlay" \ "INS" "| Install libraries (Ubuntu)" \ "BLD" "| Build" \ "INJ" "| Inject" \ @@ -24,10 +25,14 @@ USER=$($DIALOG --title "Main Menu (WIP)" --menu "What do you want to do?" 20 60 "UPD" "| Update" 3>&1 1>&2 2>&3) case "$USER" in - "CHK") + "DEP") . depcheck exit ;; + "CAT") + . catlibs + exit + ;; "INS") . depinstall exit