Improved packaging for Windows

This commit adds an install-cross-windows target to the Makefile that
creates a staging directory for us under packaging/windows that contains
the required .mo files. This currently fails for the Norwegian translation
because of the no_NO.UTF-8 vs nb issue - right now we just use the first
component of our own localization filename to find the matching Windows
localization and that fails.

The subsurface.nsi file is updated accordingly and this now appears to
create working installers with sane paths for the localization files.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2012-10-16 04:04:37 -07:00
parent 5bf6723d26
commit a9f3655d1a
4 changed files with 17 additions and 5 deletions

View file

@ -108,6 +108,8 @@ else ifeq ($(UNAME), darwin)
else
OSSUPPORT = windows
OSSUPPORT_CFLAGS = $(GTK2CFLAGS)
WINDOWSSTAGING = ./packaging/windows
WINMSGDIRS=$(addprefix locale/,$(shell ls po/*.po | sed -e 's/po\/\(..\)_.*/\1\/LC_MESSAGES/'))
endif
ifneq ($(strip $(LIBXSLT)),)
@ -160,6 +162,17 @@ install-macosx: $(NAME)
install $$MSG $(MACOSXINSTALL)/Contents/Resources/$$MSG;\
done
install-cross-windows: $(NAME)
$(INSTALL) -d -m 755 $(WINDOWSSTAGING)/share/locale
for MSG in $(WINMSGDIRS); do\
$(INSTALL) -d -m 755 $(WINDOWSSTAGING)/share/$$MSG;\
$(INSTALL) $(CROSS_LOCALE_PATH)/$$MSG/* $(WINDOWSSTAGING)/share/$$MSG;\
done
for MSG in $(MSGOBJS); do\
$(INSTALL) -d -m 755 $$(dirname $(WINDOWSSTAGING)/share/$$MSG);\
$(INSTALL) $$MSG $(WINDOWSSTAGING)/share/$$MSG;\
done
file.o: file.c dive.h file.h
$(CC) $(CFLAGS) $(GLIB2CFLAGS) $(XML2CFLAGS) $(XSLT) $(ZIP) -c file.c

View file

@ -9,6 +9,7 @@
export PATH=/usr/i686-w64-mingw32/sys-root/mingw/bin:$PATH
make CC=i686-w64-mingw32-gcc \
PKGCONFIG=i686-w64-mingw32-pkg-config \
PKG_CONFIG_PATH=/usr/i686-w64-mingw32/sys-root/i686-w64-mingw32/lib/pkgconfig/ \
PKG_CONFIG_PATH=/usr/i686-w64-mingw32/sys-root/mingw/lib/pkgconfig/ \
CROSS_LOCALE_PATH=/usr/i686-w64-mingw32/sys-root/mingw/share/ \
XSLTCONFIG=/usr/i686-w64-mingw32/sys-root/mingw/bin/xslt-config \
XML2CONFIG=/usr/i686-w64-mingw32/sys-root/mingw/bin/xml2-config NAME=subsurface.exe
XML2CONFIG=/usr/i686-w64-mingw32/sys-root/mingw/bin/xml2-config NAME=subsurface.exe install-cross-windows

View file

@ -136,7 +136,6 @@ Section
File dll\pthreadGC2.dll
File dll\zlib1.dll
File subsurface.ico
File /r ..\..\locale
File /r share
# Store installation folder in registry
@ -169,7 +168,6 @@ Section "Uninstall"
Delete "$INSTDIR\subsurface.svg"
Delete "$INSTDIR\Uninstall.exe"
RMDir /r "$INSTDIR\share"
RMDir /r "$INSTDIR\locale"
RMDir "$INSTDIR"
# Remove shortcuts

View file

@ -156,7 +156,7 @@ const char *subsurface_gettext_domainpath()
char buffer[80];
snprintf(buffer, sizeof(buffer), "LANGUAGE=%s.UTF-8", g_win32_getlocale());
putenv(buffer);
return "./locale";
return "./share/locale";
}
void subsurface_ui_setup(GtkSettings *settings, GtkWidget *menubar,