Skip to content

Commit

Permalink
Merge 5e3e291 into 9de23e1
Browse files Browse the repository at this point in the history
  • Loading branch information
aroquemaurel committed Mar 2, 2015
2 parents 9de23e1 + 5e3e291 commit 5674157
Show file tree
Hide file tree
Showing 5 changed files with 247 additions and 0 deletions.
4 changes: 4 additions & 0 deletions deploy/FactDev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
LD_LIBRARY_PATH=`pwd`
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH
./app
79 changes: 79 additions & 0 deletions deploy/linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#!/bin/bash
# -*- coding: UTF8 -*-

#### CONFIGURATION ####
qt_path="/opt/Qt/5.3/gcc_64"
make_path="make"
build_path="/home/aroquemaurel/projets/qt/build-factdev-release"
repo_path="/home/aroquemaurel/projets/qt/FactDev"
nb_process=3


#### UTILS FUNCTIONS ####
function copy_Qt_lib {
eval "cp -v $qt_path/lib/$1.* $build_path/app/"
}

function copy_Qt_plugin {
eval "cp -rv $qt_path/plugins/$1 $build_path/app/"
}

function mkdir_if_not_exists {
if [ ! -d "$1" ]; then
mkdir $1
fi
}


mkdir_if_not_exists $build_path
cd "$build_path"

#### COMPILATION ####
echo "#### COMPILATION ####"

# QMake execution
echo "--- QMake execution ---"
eval "$qt_path/bin/qmake $repo_path/FactDev.pro -config release -r -spec linux-g++"

echo "--- Make clean ---"
eval "$make_path clean" #Just in case…

# Make
echo "--- Make ---"
eval "$make_path -j$nb_process"

#### Copy files ####
echo "### Copy files and lib"

# Internal files
echo "--- Copy FactDev library ---"
eval "cp $build_path/src/*.so.* $build_path/app"
eval "cp $repo_path/deploy/FactDev.sh $build_path/app"
eval "chmod +x $build_path/app/FactDev.sh"
eval "cp -r $repo_path/src/sql $build_path/app"

# Qt library
echo "--- copy Qt libraries ---"
copy_Qt_lib libicuuc
copy_Qt_lib libicui18n
copy_Qt_lib libicudata
copy_Qt_lib libQt5Core
copy_Qt_lib libQt5Gui
copy_Qt_lib libQt5PrintSupport
copy_Qt_lib libQt5Sql
copy_Qt_lib libQt5Widgets
copy_Qt_lib libQt5DBus

copy_Qt_plugin imageformats
copy_Qt_plugin platforms
copy_Qt_plugin sqldrivers
copy_Qt_plugin printsupport

eval "rm $build_path/app/*prl"
eval "rm $build_path/app/*la"

#### CREATE TARBALL ####
echo "--- Create FactDev tarball FactDev.tar.gz ---"
eval "cd $build_path/"
mv app FactDev
tar -czvf FactDev.tar.gz FactDev
52 changes: 52 additions & 0 deletions deploy/setup.iss
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#define MyAppName "FactDev"
#define MyAppVersion "1.0"
#define MyAppPublisher "Fact Team"
#define MyAppURL "http://www.fact-team.github.io/"
#define MyAppExeName "FactDev.exe"

[Setup]
AppId={{9723FA42-755A-4C59-AF8D-7C0DCE971A0F}}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\FactDev
DefaultGroupName={#MyAppName}
OutputDir=C:\Users\Aroquemaurel\Documents\FactDev
OutputBaseFilename=setup_FactDev
SetupIconFile=C:\Users\Aroquemaurel\Documents\FactDev\images\FACTDev.ico
Compression=lzma
SolidCompression=yes

[Languages]
Name: "french"; MessagesFile: "compiler:Languages\French.isl"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1

[Files]
Source: "C:\Users\Aroquemaurel\Documents\build-FactDev-Desktop_Qt_5_4_1_MinGW_32bit-Release\app\release\FactDev.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\Aroquemaurel\Documents\build-FactDev-Desktop_Qt_5_4_1_MinGW_32bit-Release\app\release\*.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\Aroquemaurel\Documents\build-FactDev-Desktop_Qt_5_4_1_MinGW_32bit-Release\app\release\sql\*sql"; DestDir: "{app}\sql"; Flags: ignoreversion
Source: "C:\Users\Aroquemaurel\Documents\build-FactDev-Desktop_Qt_5_4_1_MinGW_32bit-Release\app\release\platforms\*"; DestDir: "{app}\platforms"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "C:\Users\Aroquemaurel\Documents\build-FactDev-Desktop_Qt_5_4_1_MinGW_32bit-Release\app\release\sqldrivers\*"; DestDir: "{app}\sqldrivers"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "C:\Users\Aroquemaurel\Documents\build-FactDev-Desktop_Qt_5_4_1_MinGW_32bit-Release\app\release\manuel.pdf"; DestDir: "{app}\"; Flags: ignoreversion recursesubdirs createallsubdirs

; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon

[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent

[UninstallDelete]
Type: filesandordirs; Name: "{userappdata}\{#MyAppName}"
112 changes: 112 additions & 0 deletions deploy/windows.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
#### CONFIGURATION ####
## Warning: you must not have space in paths
$qt_path = "C:\Qt\5.4\mingw491_32"
$mingw_path = "C:\Qt\Tools\mingw491_32"
$build_path = "C:\Users\Aroquemaurel\Documents\build-FactDev-Desktop_Qt_5_4_1_MinGW_32bit-Release"
$repo_path = "C:\Users\Aroquemaurel\Documents\FactDev"
$innosetup_path = "& 'C:\Program Files (x86)\Inno Setup 5\ISCC.exe'"

$nb_process = 3



function call
{
iex $args[0]
}

function mkdirIfNotExist
{
$dir = $args[0]
$ret = Test-Path $dir
if (-not $ret) {
mkdir $dir
}
}

function rmdirIfExist
{
$dir = $args[0]
$ret = Test-Path $dir
if ($ret) {
rmdir -r $dir
}
}

function rmIfExist
{
$file = $args[0]
$ret = Test-Path $file
if ($ret) {
rm $file
}
}

function copyPlugin
{
$plugin_name = $args[0]
mkdirIfNotExist $plugin_name
call ("cp "+$qt_path+"\plugins\"+$plugin_name+"\*.dll "+$plugin_name)
call ("rm """+$plugin_name+"/*d.dll""")
}

function copyQtDll
{
$dll_name = $args[0]
call ("cp "+$qt_path+"\bin\"+$dll_name+".dll .")
}



$make_path = $mingw_path + "\bin\mingw32-make.exe"
$qmake_path = $qt_path + "\bin\qmake.exe"
$make_nbprocess = " -j"+$nb_process

cd $build_path

#### COMPILATION ####
## WARNING: We assume that FactDev is already compilled and is work correctly.
# Create build folder
#mkdirIfNotExist build
#cd build

# QMake execution
#call ($qmake_path + " """ +$repo_path + "\FactDev.pro"" -config release -r -spec win32-g++")

# Make clean, just in case
#call ($make_path + " clean")



#### Copy dll files ####
cd app/release
# Copy plugins folders
copyPlugin "imageformats"
copyPlugin "platforms"
copyPlugin "sqldrivers"

# Copy dll
copyQtDll "icudt53"
copyQtDll "icuin53"
copyQtDll "icuuc53"
copyQtDll "libgcc_s_dw2-1"
copyQtDll "libstdc++-6"
copyQtDll "libwinpthread-1"
copyQtDll "Qt5Concurrent"
copyQtDll "Qt5Core"
copyQtDll "Qt5Gui"
copyQtDll "Qt5PrintSupport"
copyQtDll "Qt5Sql"
copyQtDll "Qt5Widgets"

rmdirIfExist sql
call ("cp "+$build_path+"\src\release\FactDev.dll .") # Copy FactDev.dll
call ("cp -Recurse "+$repo_path+"\src\sql .") # Copy sql files
call ("cp "+$repo_path+"\fact-team.github.io\doc\usermanual.pdf manuel.pdf") # Copy sql files
cp app.exe FactDev.exe


# Innosetup execution : creation of installer
call ("cd "+$repo_path+"\deploy")
call ($innosetup_path+" .\setup.iss")

Binary file added images/FACTDev.ico
Binary file not shown.

0 comments on commit 5674157

Please sign in to comment.