Skip to content

Commit

Permalink
Merge pull request #7 from muttleyxd/deb-builder
Browse files Browse the repository at this point in the history
Deb builder
  • Loading branch information
muttleyxd authored Apr 3, 2017
2 parents f31790f + 6321f4d commit 4bb538e
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 4 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 3.1)
cmake_minimum_required (VERSION 2.8.12)
project (arma3-unix-launcher)

set (CMAKE_CXX_STANDARD 11)
Expand All @@ -12,6 +12,7 @@ link_directories (${GTKMM_LIBRARY_DIRS})
#build executable
add_executable (arma3-unix-launcher main.cpp Filesystem.cpp Logger.cpp MainWindow.cpp Mod.cpp Settings.cpp Utils.cpp VDF.cpp VDFKey.cpp)
target_link_libraries (arma3-unix-launcher ${GTKMM_LIBRARIES} pthread)
set (CMAKE_CXX_FLAGS "--std=gnu++11 ${CMAKE_CXX_FLAGS}")

if(APPLE)
add_custom_command (TARGET arma3-unix-launcher POST_BUILD COMMAND mkdir arma3-unix-launcher.app && cd arma3-unix-launcher.app && mkdir Contents && cd Contents && mkdir MacOS)
Expand Down
4 changes: 2 additions & 2 deletions Filesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ namespace Filesystem
std::string SteamPath = "/.steam/steam";
std::string LauncherSettingsDirectory = "/.config/a3unixlauncher";
#endif
std::string HomeDirectory = getenv("HOME");

std::string SteamConfigFile = LocalSharePrefix + "/Steam/config/config.vdf";
std::string SteamConfigFileNeon = HomeDirectory + "/.steam/steam/config/config.vdf";
std::string SteamAppsArmaPath = "/steamapps/common/Arma 3";
std::string SteamAppsModWorkshopPath = "/steamapps/workshop/content/107410";

std::string HomeDirectory = getenv("HOME");

std::string LauncherSettingsFilename = "/settings.conf";

std::string ArmaDirWorkshop = "/!workshop";
Expand Down
2 changes: 1 addition & 1 deletion MainForm.glade
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.20.0 -->
<interface>
<requires lib="gtk+" version="3.18"/>
<requires lib="gtk+" version="3.14"/>
<object class="GtkAdjustment" id="adjCpuCount">
<property name="lower">1</property>
<property name="upper">32</property>
Expand Down
44 changes: 44 additions & 0 deletions build-deb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash

cat /etc/*-release | grep debian > /dev/null
if [ $? -ne 0 ]; then
echo "You are not Debian-based distro!"
exit 1
fi

shortCommitHash=`git rev-parse --verify HEAD | cut -c -7`
branchName=`git branch | grep "*" | cut -c 3-`
commitCount=`git rev-list HEAD --count`
distroName=`cat /etc/*-release | grep "^ID=.*" | cut -c 4-`
architecture=`arch`

if [ $architecture == "x86_64" ]; then
debConfigArchitecture="amd64";
else
debConfigArchitecture="i386";
fi

dirName="arma3-unix-launcher_$branchName-$commitCount-$shortCommitHash-$distroName-$architecture"

rm -rf build-deb-pkg/
mkdir build-deb-pkg/
cd build-deb-pkg

cmake ..
make -j
make install DESTDIR="$(pwd)/$dirName"

cd $dirName
mkdir DEBIAN

echo "Package: arma3-unix-launcher" > DEBIAN/control
echo "Version: $commitCount-$shortCommitHash" >> DEBIAN/control
echo "Section: base" >> DEBIAN/control
echo "Priority: optional" >> DEBIAN/control
echo "Architecture: $debConfigArchitecture" >> DEBIAN/control
echo "Depends: libgtkmm-3.0-dev (>= 3.14.0)" >> DEBIAN/control
echo "Maintainer: Muttley <muttdini@gmail.com>" >> DEBIAN/control
echo "Description: Advanced launcher Linux and Mac ArmA 3" >> DEBIAN/control

cd ..
dpkg-deb --build $dirName

0 comments on commit 4bb538e

Please sign in to comment.