Skip to content
This repository was archived by the owner on Oct 15, 2019. It is now read-only.

Commit

Permalink
Make it possible to build installer on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
gladhorn committed Jul 5, 2013
1 parent db03aa6 commit 90f70ef
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 15 deletions.
17 changes: 17 additions & 0 deletions dist/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Building installers the long way...

Note that building the installer does NOT work when Qt is configured with -developer-build.
It is recommended to use the official Qt sdk packages (http://qt-project.org/downloads).

Linux:
qtbase, qttools, qtscript

./configure -nomake examples -nomake tests -static -release -opensource -confirm-license -prefix `pwd`/../qt-install -qt-libpng -qt-libjpeg -qt-zlib -no-cups -no-icu

actually install all of them!

installer-framework (master branch)
qtbase-static/bin/qmake
make

Run the python script with the desired target qt version and the installer-framework/bin in path.
30 changes: 19 additions & 11 deletions dist/create_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,15 @@
import os
import shutil
import subprocess
import sys

# Qt
qmake = "qmake"
jom = "jom"

make = "make"
if sys.platform == "win32":
make = "jom"


# from the installer framework
binarycreator = "binarycreator"
Expand Down Expand Up @@ -51,16 +56,20 @@
except ImportError:
DEVNULL = open(os.devnull, 'wb')

subprocess.check_call([jom,], stdout=DEVNULL)
subprocess.check_call(["nmake", "docs"])
subprocess.check_call([make,], stdout=DEVNULL)

if sys.platform == "win32": # bug with jom subtargets
subprocess.check_call(["nmake", "docs"])
else:
subprocess.check_call([make, "docs"])

# Copy files around
os.chdir("../..")

packages = {
"com.digia.enginio": ["include", "lib", "qml", "doc/enginio-qt.qch", ],
"com.digia.enginio": ["include", "lib", "qml", ], #"doc/enginio-qt.qch", ],
"com.digia.enginioExamples": ["examples",],
"com.digia.enginioDocumentation": ["doc/enginio-qt",],
#"com.digia.enginioDocumentation": ["doc/enginio-qt",],
"com.digia.enginioSources": ["src",],
}

Expand Down Expand Up @@ -95,8 +104,7 @@
import glob
allHeaders = glob.glob("src/*/*.h")
for header in allHeaders:
# FIXME this is windows-only
fileName = header[header.rindex("\\"):]
fileName = header[header.rindex(os.sep):]
if header.endswith("_p.h"):
print("Copy ", header, " to ", privateHeaderPath + fileName)
shutil.copyfile(header, privateHeaderPath + fileName)
Expand All @@ -110,12 +118,12 @@


# the Module .pri file is special - take the one from mkspecs/modules_inst
modulesPath = "packages/com.digia.enginio/data/mkspecs/modules/"
os.mkdir(modulesPath + "..")
modulesPath = "packages/com.digia.enginio/data/mkspecs/modules"
os.mkdir("packages/com.digia.enginio/data/mkspecs")
os.mkdir(modulesPath)
shutil.copyfile("build/mkspecs/modules-inst/qt_lib_enginio.pri", modulesPath + "qt_lib_enginio.pri")
shutil.copyfile("build/mkspecs/modules-inst/qt_lib_enginio.pri", modulesPath + "/qt_lib_enginio.pri")


subprocess.check_call([binarycreator, "-c", "config\config.xml", "-p", "packages", "EnginioInstaller"])
subprocess.check_call([binarycreator, "-c", "config" + os.sep + "config.xml", "-p", "packages", "EnginioInstaller"])

print("Installer created.")
18 changes: 14 additions & 4 deletions dist/packages/com.digia.enginio/meta/installscript.qs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ function Component()
{
installer.addWizardPage(component, "QtSelectionPage", QInstaller.ComponentSelection);
component.userInterface("QtSelectionPage").complete = false;
component.userInterface("QtSelectionPage").qmakePathLineEdit.text = "C:\\Qt\\";
if (installer.value("os") == "win") {
component.userInterface("QtSelectionPage").qmakePathLineEdit.text = "C:\\Qt\\";
} else {
component.userInterface("QtSelectionPage").qmakePathLineEdit.text = "/";
}
component.userInterface("QtSelectionPage").qmakePathLineEdit.textChanged.connect(checkQmakePath);
component.userInterface("QtSelectionPage").browseButton.clicked.connect(showFileDialog);
}
Expand All @@ -63,9 +67,15 @@ checkQmakePath = function()
showFileDialog = function()
{
try {
path = QFileDialog.getExistingDirectory("Select qmake.exe path", "c:\\qt\\");
path = path.replace(/\//g, "\\");
component.userInterface("QtSelectionPage").qmakePathLineEdit.text = path;
if (installer.value("os") == "win") {
path = QFileDialog.getExistingDirectory("Select Qt path (the directory containing bin\\qmake.exe)", "c:\\qt\\");
path = path.replace(/\//g, "\\");
component.userInterface("QtSelectionPage").qmakePathLineEdit.text = path;
} else {
// FIXME on linux the prefixes might be different (bin/lib etc in different places)
path = QFileDialog.getExistingDirectory("Select qt path", "");
component.userInterface("QtSelectionPage").qmakePathLineEdit.text = path;
}
} catch (e) {
QMessageBox.warning("", "Error Installing Enginio", e);
}
Expand Down

0 comments on commit 90f70ef

Please sign in to comment.