Skip to content

Commit

Permalink
Windows updates, packaging tweaks, translation tools
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Bowman committed May 6, 2010
1 parent 40bc994 commit efac3ca
Show file tree
Hide file tree
Showing 32 changed files with 2,037 additions and 412 deletions.
17 changes: 17 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
2010-05-05 #################### PortaBase 2.0b1 ####################

2010-05-05 JMB Windows updates, packaging tweaks, translation tools

Updated the Windows-specific parts of portabase.pro. Fixed a bug in
imageselector.cpp that broke compiling with MinGW. Updated the application
icon for Windows and the Inno Setup installer script. Created a couple of
batch scripts to automate compilation and creation of the installer.
Updated the INSTALL file with current instructions for building on Windows.
Made some minor packaging fixes for Debian and Maemo.

There's now a trio of environment variables that can be used to test out
PortaBase UI and help file translations: PORTABASE_QM, PORTABASE_QT_QM, and
PORTABASE_HELP. I'll document their usage fully on the web site with the
notes on doing translations. Clarified the encoding (UTF-8) of the
existing help files and updated the UI translation files while I was at it.

2010-05-02 JMB Help file update, more Maemo and usability improvements

Updated the English help file to match the current state of the code.
Expand Down
51 changes: 30 additions & 21 deletions INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@ need the following:
- Windows XP, Vista, or 7
- A recent version of Qt 4 (http://qt.nokia.com/downloads). It's easiest to
get started with a version that comes with the MinGW compiler, since I
haven't tested the latest code with Visual Studio.
haven't tested the latest code with Visual Studio. Add both the "bin"
directory and the "mingw\bin" directory that come with it to your "Path"
environment variable.
- MSYS 1.0.11 (http://sourceforge.net/projects/mingw/files/MSYS%20Base%20System/msys-1.0.11/MSYS-1.0.11.exe/download).
This emulates a basic UNIX system on Windows, and is the easiest way to
compile Metakit with MinGW. Newer versions are available, but lack a
convenient installer; this one should work fine.
- Inno Setup, if you wish to create the PortaBase installer; available from:
http://www.jrsoftware.org/isinfo.php

Expand Down Expand Up @@ -50,11 +56,19 @@ the Metakit README file) inside the appropriate Scratchbox environment. You'll
want to pass the "--enable-threads" and "--disable-shared" parameters to the
configure script.

To compile Metakit for Windows, follow the instructions in Metakit's README
file; be sure to build the static library version (mklib). To compile
Metakit for use in Linux or Mac OS X desktop PortaBase, just follow the
README directions (the "UNIX" instructions in both cases); you'll want to use
the same configure script parameters mentioned above for Maemo development.
To compile Metakit for use in Linux or Mac OS X desktop PortaBase, just follow
the README directions (the "UNIX" instructions in both cases); you'll want to
use the same configure script parameters mentioned above for Maemo development.

To compile Metakit for Windows, first install Qt in order to get the MinGW
compiler. Then install MSYS as mentioned above; in the postinstallation
script, you'll be asked for the path of the MinGW installation that came with
Qt. Start MSYS from the installed shortcut, and change to the metakit/builds
directory that is included with the PortaBase source code. Note that you use
"cd" to change directories, use "/" as the directory separator, and the C:
drive is located at "/c". From the metakit/builds directory, run
"../unix/configure --enable-threads --disable-shared". Once that finishes, run
"make". You should now have a libmk4.a static library file in that directory.

PortaBase for Maemo Compilation
--------------------------------
Expand All @@ -64,21 +78,16 @@ documentation for more information.

PortaBase for Windows Compilation, Packaging
--------------------------------------------
- Install a recent version of Qt 4 and configure it (make sure the "bin"
directory is in your path and that the QTDIR and QMAKESPEC environment
variables are set correctly).
- Adjust the value of INCLUDEPATH in portabase.pro as needed to locate the
library header files on your system.
- Run "qmake -t vcapp -o portabase.dsp portabase.pro"
- Copy mk4vc60s.lib to the PortaBase source directory.
- Open the generated portabase.dsp file in Visual C++, and from
"Build->Set Active Configuration..." select "portabase - Win32 Release".
- Execute the build.
- Copy qt-mtnc321.dll from Qt's "lib" directory to the Release subdirectory
created by Visual C++.
- Copy msvcrt.dll to the PortaBase source directory.
- Run "lrelease portabase.pro" to generate the UI translation files.
- Open portabase.iss with Inno Setup and choose "Compile"
- Compile Metakit as described above.
- Open a command prompt, and change to the root directory of the downloaded
PortaBase source code. If this isn't at "C:\portabase", you'll have to
change the paths for "LIBS" and "INCLUDEPATH" in portabase.pro.
- From that directory run "packaging\windows\build.bat"; this will generate a
working PortaBase.exe file in the "build" directory.
- If you want to create an installer for PortaBase, first install Inno Setup.
Then run "packaging\windows\installer.bat"; you may need to edit it first
in order to adjust the paths to Qt and/or Inno Setup. This will generate an
executable installer in the "build/windows" directory.

Debian Package Building
-----------------------
Expand Down
2 changes: 1 addition & 1 deletion image/imageselector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
#include <QPushButton>
#include "../database.h"
#include "../factory.h"
#include "../importdialog.h"
#include "imageeditor.h"
#include "imageselector.h"
#include "imageutils.h"
#include "imageviewer.h"
#include "importdialog.h"

/**
* Constructor.
Expand Down
32 changes: 28 additions & 4 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

#include <QApplication>
#include <QIcon>
#include <QProcess>
#include <QRegExp>
#include <QTranslator>
#include "commandline.h"
#include "eventfilter.h"
Expand All @@ -41,13 +43,35 @@ int main(int argc, char **argv) {
app.setOrganizationDomain("sourceforge.net");
app.setApplicationName("PortaBase");
app.setWindowIcon(QIcon(":/appicon/PortaBase.png"));
// can't use QProcessEnvironment because Diablo doesn't have it yet
QStringList env = QProcess::systemEnvironment();
int qmIndex = env.indexOf(QRegExp("PORTABASE_QM=.*"));
int qtQmIndex = env.indexOf(QRegExp("PORTABASE_QT_QM=.*"));
QTranslator qtTranslator;
if (qtTranslator.load(QString(":/i18n/Qt.qm"))) {
app.installTranslator(&qtTranslator);
if (qtQmIndex != -1) {
QString path = env[qtQmIndex];
path = path.right(path.length() - 16);
if (qtTranslator.load(path)) {
app.installTranslator(&qtTranslator);
}
}
else {
if (qtTranslator.load(QString(":/i18n/Qt.qm"))) {
app.installTranslator(&qtTranslator);
}
}
QTranslator translator;
if (translator.load(QString(":/i18n/PortaBase.qm"))) {
app.installTranslator(&translator);
if (qmIndex != -1) {
QString path = env[qmIndex];
path = path.right(path.length() - 13);
if (translator.load(path)) {
app.installTranslator(&translator);
}
}
else {
if (translator.load(QString(":/i18n/PortaBase.qm"))) {
app.installTranslator(&translator);
}
}
QStringList args = app.arguments();
if ((args.count() > 1 && args[1].startsWith("-")) || args.count() > 2) {
Expand Down
2 changes: 1 addition & 1 deletion packaging/linux/debian.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

VERSION=2.0
VERSION=2.0~beta1
DEST=build/debian/portabase-$VERSION

rm -rf build/debian
Expand Down
2 changes: 2 additions & 0 deletions packaging/mac/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ rm -f build/PortaBase.app
rm -f build/PortaBase.dmg
qmake -spec macx-g++40 portabase.pro
make clean
lrelease portabase.pro
lrelease resources/translations/qt*.ts
make
cd build
macdeployqt PortaBase.app
Expand Down
6 changes: 6 additions & 0 deletions packaging/maemo/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
portabase (2.0~beta1-2) unstable; urgency=low

* Declare the debug package in the control file

-- Jeremy Bowman <jmbowman@alum.mit.edu> Wed, 05 May 2010 13:49:03 +0100

portabase (2.0~beta1-1) unstable; urgency=low

* Initial Maemo Release.
Expand Down
8 changes: 7 additions & 1 deletion packaging/maemo/debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Standards-Version: 3.7.2

Package: portabase
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, hildon-application-manager
Depends: ${shlibs:Depends}, hildon-application-manager
Description: An easy-to-use personal database application
PortaBase is a program for conveniently managing one-table database files.
It is available for many platforms, including Linux, Mac OS X, Windows,
Expand Down Expand Up @@ -71,3 +71,9 @@ XB-Maemo-Icon-26:
IAXKcs6zjLFMrzYzxmSaR5xSyjcDcM6ZFEClK7bWdqy1URrbbWttK/0u0VqbXsO61djnc40kKaWM
McbTJSilPetzQkgvL3qbqF5l64WQcc7p1BPGWmtc90C867///w+iNyjsMjIXAQAAAABJRU5ErkJg
gg==

Package: portabase-dbg
Section: devel
Architecture: any
Depends: portabase (= ${Source-Version})
Description: Debug symbols for PortaBase
3 changes: 2 additions & 1 deletion packaging/maemo/diablo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ cp src/packaging/maemo/portabase.pro portabase.pro
cp -R src/packaging/maemo/debian .
cp src/packaging/maemo/diablo_control debian/control
cp src/packaging/maemo/diablo_postinst debian/postinst
dpkg-buildpackage -rfakeroot -uc -us -sa
dpkg-buildpackage -rfakeroot -sa -S
#dpkg-buildpackage -rfakeroot -uc -us -sa
6 changes: 6 additions & 0 deletions packaging/maemo/diablo_control
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,9 @@ XB-Maemo-Icon-26:
hRBCSllyHKfqOM6zUsop13XHXdetOI5T5px7jDGHEMLx8MJN0jTVSZIEWutOFEXNKIq2lFKbWut/
tNYNpZRvjDF933VCCC6EcHK5nCeEKHDOC5zz/D6I7YPSfVCYJEnXGNON4zgwxmhjHvtDAvgXDRHA
N2eaZkMAAAAASUVORK5CYII=

Package: portabase-dbg
Section: devel
Architecture: any
Depends: portabase (= ${Source-Version})
Description: Debug symbols for PortaBase
5 changes: 3 additions & 2 deletions packaging/maemo/fremantle.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#!/bin/sh

VERSION=2.0~beta1
DEST=build/diablo/portabase-$VERSION
DEST=build/fremantle/portabase-$VERSION

rm -rf build/fremantle
packaging/copy_source.sh $DEST/src
cd $DEST
mv src/portabase.pro src/src.pro
cp src/packaging/maemo/portabase.pro portabase.pro
cp -R src/packaging/maemo/debian .
dpkg-buildpackage -rfakeroot -uc -us -sa
dpkg-buildpackage -rfakeroot -sa -S
#dpkg-buildpackage -rfakeroot -uc -us -sa
Loading

0 comments on commit efac3ca

Please sign in to comment.