myscripts/build-synergy-fedora-39.sh

107 lines
3.2 KiB
Bash
Raw Normal View History

#!/bin/bash
####################################################################################
# build-synergy-fedora-39.sh #
####################################################################################
# This script is just meant to show how to compile synergy-core manually, in the #
# case someone doesn't want to pay for the license to download an installer. #
# #
# Understand that even if you do compile it here you will need a license to access #
# many of the advanced features (however it will still let you use the software). #
# #
# Note as well, this is the older version of the software (synergy 1). To get #
# Synergy 3.x you will need to purchase the license to use it. Otherwise, I #
# haven't been able to find that repo (unless I'm overlooking something) #
# #
2023-11-26 20:40:14 +00:00
# If you find an error in this let me know via my contact info in the README of my #
# journal repo (https://git.arcanium.tech/tristan/journal). If I've overlooked a #
# step I'll update this script. #
# #
2023-11-26 20:42:15 +00:00
# NOTE: #
# This script will likely work on fedora 36 -> 39, as I don't believe dependencies #
# have changed from then. #
# #
####################################################################################
# BEGIN: Variables
declare -a NEEDED_PACKAGES=(
# Cmake Deps
cmake
## Well...for git and stuff
git
# Compiler dependencies
libX11-devel
libXtst-devel
glib2-devel
gdk-pixbuf2-devel
libnotify-devel
libXinerama-devel
## For qt5_add_translation macro
qt5-qttools-devel
## For X11/extensions/XKBrules.h
libxkbfile-devel
)
## URL to git repo
REPO_URL='https://github.com/symless/synergy-core'
## Getting REPO name for later use
REPO_NAME="${REPO_URL##*\/}"
# END: Variables
# BEGIN: Pre-Work Check
## Clean cache
sudo dnf clean all
## Make package manager cache any new changes to repo (to ensure that all packages are accurate)
sudo dnf makecache
## I could do an elegant check for each individual package, but this is much easier
sudo dnf install -y ${NEEDED_PACKAGES[@]}
if [[ $? -ne 0 ]]; then
echo "Package install exited uncleanly, please address and run again"
exit 0
fi
# END: Pre-Work Check
# BEGIN: Work
## Move to downloads dir, to clone the repo and do work
cd ~/Downloads
## Clone repo
git clone $REPO_URL
## Moving to git repo
cd $REPO_NAME
## INIT-ing and updating submodules (needed to build)
git submodule init && git submodule update
## Make and cd into the directory that you're building the project in
mkdir build && cd build
## Making the buildfile and preparing for the build
cmake ..
2023-11-26 20:40:14 +00:00
## Build & install the project
make && make install
# END: Work