Seregon/ShadPKG

A tool for deriving PKG packet encryption keys for ps4 written in c++

C++/47.3 KB/No license
build_linux.sh
ShadPKG / build_linux.sh
1#!/bin/bash
2set -e
3 
4# Add ~/.local/bin to PATH for conan
5export PATH=$PATH:$HOME/.local/bin
6 
7# Check if conan is available
8if ! command -v conan &> /dev/null; then
9 echo "Conan not found in PATH. Trying default location..."
10 export PATH=$PATH:$HOME/.local/bin
11 if ! command -v conan &> /dev/null; then
12 echo "Conan could not be found. Please install it."
13 exit 1
14 fi
15fi
16 
17echo "Using Conan version: $(conan --version)"
18 
19# Detect profile if not exists
20if [ ! -f ~/.conan2/profiles/default ]; then
21 echo "Detecting default Conan profile..."
22 conan profile detect --force
23fi
24 
25# Build directory
26BUILD_DIR="build_linux"
27mkdir -p $BUILD_DIR
28 
29# Install dependencies
30echo "Installing dependencies with Conan..."
31conan install . --output-folder=$BUILD_DIR --build=missing -s build_type=Release
32 
33# Find toolchain
34TOOLCHAIN_FILE="$BUILD_DIR/build/Release/generators/conan_toolchain.cmake"
35 
36if [ ! -f "$TOOLCHAIN_FILE" ]; then
37 echo "Toolchain file not found at $TOOLCHAIN_FILE"
38 exit 1
39fi
40 
41# Configure CMake
42echo "Configuring CMake..."
43cmake -S . -B $BUILD_DIR -DCMAKE_TOOLCHAIN_FILE="$TOOLCHAIN_FILE" -DCMAKE_BUILD_TYPE=Release
44 
45# Build
46echo "Building..."
47cmake --build $BUILD_DIR --config=Release
48 
49echo "Build complete. Executable should be in $BUILD_DIR"
50