Commit 18c85fb8 authored by Vivien Kraus's avatar Vivien Kraus
Browse files

Set up nsis

parent ba57bcd3
Pipeline #130011 passed with stages
in 13 minutes and 19 seconds
image: debian:latest
image: debian
stages:
- dist
......@@ -17,6 +17,11 @@ check:
stage: check
script: "./ci/check.sh"
mingw:
image: fedora
stage: check
script: "./ci/mingw.sh"
pages:
stage: manual
script: "./ci/pages.sh"
......
......@@ -42,6 +42,7 @@ include games/Makefile.am
include icon/Makefile.am
include gnulib.am
include screenshots/Makefile.am
include nsi/Makefile.am
AM_CPPFLAGS += \
-DLOCALEDIR="\"$(localedir)\"" \
......
......@@ -19,4 +19,5 @@
EXTRA_DIST += \
%reldir%/dist.sh \
%reldir%/pages.sh \
%reldir%/check.sh
%reldir%/check.sh \
%reldir%/mingw.sh
#!/bin/sh
yum update -y || exit 1
yum install -y \
mingw64-gcc \
mingw64-readline \
mingw64-nettle \
mingw64-libxml2 \
mingw64-glib2 \
mingw64-cairo \
mingw64-gtk3 \
mingw64-hicolor-icon-theme \
\
make \
wget \
ImageMagick \
\
mingw32-nsis.x86_64 \
|| exit 1
mkdir -p public || exit 1
echo "Build tarot"
VERSION=$(cat dist/version)
cp dist/tarot-$VERSION.tar.gz . || exit 1
tar xf tarot-$VERSION.tar.gz || exit 1
cd tarot-$VERSION
mingw64-configure \
--prefix="/" \
--exec-prefix="/" \
--bindir="/bin" \
--sysconfdir="/etc" \
--libdir="/lib" \
--includedir="/include" \
--datarootdir="/share" \
--datadir="/share" \
--infodir="/share/info" \
--mandir="/share/man" \
--enable-runtime-prefix='TAROT_PREFIX' \
--with-static-program-name=yes \
HOST_SYSROOT="/usr/x86_64-w64-mingw32/sys-root/mingw" \
|| exit 1
make -j 8 nsi || exit 1
cp tarot-setup.exe ../public/
make -j distclean || exit 1
cd ..
......@@ -57,6 +57,10 @@ AM_MISSING_PROG([FDP], [fdp])
AM_MISSING_PROG([HELP2MAN], [help2man])
AM_MISSING_PROG([GLIB_COMPILE_RESOURCES], [glib-compile-resources])
AM_MISSING_PROG([APPSTREAM_UTIL], [appstream-util])
AM_MISSING_PROG([MAKENSIS], [makensis])
AC_ARG_VAR([HOST_SYSROOT], [Where to steal the windows DLLs for gtk+ and friends. On Fedora it is /usr/x86_64-w64-mingw32/sys-root/mingw])
AC_CHECK_TOOL([WINDRES], [windres], [no])
AM_CONDITIONAL([HAVE_WINDRES], [test "x$WINDRES" != "xno"])
# Checks for libraries.
gl_INIT
......
# nsi/Makefile.am
#
# Copyright (C) 2019 Vivien Kraus <vivien@planete-kraus.eu>
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see
# <http://www.gnu.org/licenses/>.
EXTRA_DIST += %reldir%/tarot.ico %reldir%/tarot.rc %reldir%/setup.nsi
MAINTAINERCLEANFILES += %reldir%/tarot.ico
windres_verbose = $(windres_verbose_@AM_V@)
windres_verbose_ = $(windres_verbose_@AM_DEFAULT_V@)
windres_verbose_0 = @echo " WINDRES $@";
if HAVE_WINDRES
if ENABLE_PROGRAM
src_tarot_app_tarot_SOURCES += %reldir%/tarot.rc
.rc.o:
$(windres_verbose) $(WINDRES) -O coff -o $@-t $<
@mv $@-t $@
endif # ENABLE_PROGRAM
endif # HAVE_WINDRES
convert_verbose = $(convert_verbose_@AM_V@)
convert_verbose_ = $(convert_verbose_@AM_DEFAULT_V@)
convert_verbose_0 = @echo " CONVERT $@";
nsi_verbose = $(nsi_verbose_@AM_V@)
nsi_verbose_ = $(nsi_verbose_@AM_DEFAULT_V@)
nsi_verbose_0 = @echo " MAKENSIS $@";
.PHONY: nsi
$(srcdir)/%reldir%/tarot.ico: icon/256x256/eu.planete_kraus.Tarot.png \
icon/48x48/eu.planete_kraus.Tarot.png \
icon/32x32/eu.planete_kraus.Tarot.png \
icon/22x22/eu.planete_kraus.Tarot.png
$(convert_verbose) $(CONVERT) \
$(srcdir)/icon/256x256/eu.planete_kraus.Tarot.png \
$(srcdir)/icon/48x48/eu.planete_kraus.Tarot.png \
$(srcdir)/icon/32x32/eu.planete_kraus.Tarot.png \
$(srcdir)/icon/22x22/eu.planete_kraus.Tarot.png \
$(srcdir)/%reldir%/tarot.ico
$(srcdir)/%reldir%/tarot.rc: %reldir%/tarot.ico
clean-local:
rm -rf %reldir%/bin %reldir%/share %reldir%/include %reldir%/lib
nsi:
$(MAKE) $(AM_MAKEFLAGS) DESTDIR=$(abs_top_srcdir)/%reldir% install
for file in $(HOST_SYSROOT)/bin/*.dll ; do cp $$file %reldir%/bin/ ; done
cp -R $(HOST_SYSROOT)/share/fontconfig %reldir%/share/
cp -R $(HOST_SYSROOT)/share/icons/hicolor %reldir%/share/icons
$(nsi_verbose) (cd %reldir% && $(MAKENSIS) $(abs_top_srcdir)/%reldir%/setup.nsi)
@mv %reldir%/tarot-setup.exe .
name "Tarot"
!define MUI_ICON "tarot.ico"
OutFile "tarot-setup.exe"
InstallDir $PROGRAMFILES\Tarot
; Registry key to check for directory (so if you install again, it will
; overwrite the old one automatically)
InstallDirRegKey HKLM "System\CurrentControlSet\Control\Session Manager\Environment" "TAROT_PREFIX"
!include WinMessages.nsh
!define MUI_COMPONENTSPAGE_NODESC
!include "MUI2.nsh"
Var SMDir
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_STARTMENU 0 $SMDir
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "French"
UninstPage uninstConfirm
UninstPage instfiles
Section "Tarot Program"
SetOutPath $INSTDIR
File /r "bin"
File /r /x share/gir-1.0 /x share/girepository-1.0 /x share/vala "share"
File tarot.ico
WriteRegStr HKLM "System\CurrentControlSet\Control\Session Manager\Environment" "TAROT_PREFIX" "$INSTDIR"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tarot" "DisplayName" "Tarot"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tarot" "UninstallString" '"$INSTDIR\uninstall.exe"'
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tarot" "NoModify" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tarot" "NoRepair" 1
SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
WriteUninstaller "$INSTDIR\uninstall.exe"
SectionEnd
Section /o "Tarot Development files"
SetOutPath $INSTDIR
File /r "include"
File /r "lib"
File /r /x share/locale "share"
WriteRegStr HKLM "System\CurrentControlSet\Control\Session Manager\Environment" "TAROT_PREFIX" "$INSTDIR"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tarot" "DisplayName" "Tarot"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tarot" "UninstallString" '"$INSTDIR\uninstall.exe"'
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tarot" "NoModify" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tarot" "NoRepair" 1
SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
WriteUninstaller "$INSTDIR\uninstall.exe"
SectionEnd
Section -StartMenu
!insertmacro MUI_STARTMENU_WRITE_BEGIN 0 ;This macro sets $SMDir and skips to MUI_STARTMENU_WRITE_END if the "Don't create shortcuts" checkbox is checked...
CreateDirectory "$SMPrograms\$SMDir"
CreateShortCut "$SMPROGRAMS\$SMDir\Tarot.lnk" "$INSTDIR\bin\tarot.exe" "" "$INSTDIR\tarot.ico"
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd
Section "Desktop Shortcut"
CreateShortCut "$DESKTOP\Tarot.lnk" "$INSTDIR\bin\tarot.exe" "" "$INSTDIR\tarot.ico"
SectionEnd
Section "Uninstall"
; Remove registry keys
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tarot"
DeleteRegValue HKLM "System\CurrentControlSet\Control\Session Manager\Environment" "TAROT_PREFIX"
SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
; Remove files and uninstaller
RmDir /r $INSTDIR\bin
RmDir /r $INSTDIR\include
RmDir /r $INSTDIR\lib
RmDir /r $INSTDIR\share
RmDir /r "$SMPrograms\$SMDir"
Delete $INSTDIR\uninstall.exe
Delete $INSTDIR\tarot.ico
Delete $DESKTOP\Tarot.lnk
; Remove directories used
RMDir "$SMPROGRAMS\Tarot"
RMDir "$INSTDIR"
SectionEnd
id ICON "tarot.ico"
\ No newline at end of file
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tarot 0.4.2.83-ebdc-dirty\n"
"Report-Msgid-Bugs-To: vivien@planete-kraus.eu\n"
"POT-Creation-Date: 2019-04-24 19:16+0200\n"
"POT-Creation-Date: 2019-04-25 20:21+0200\n"
"PO-Revision-Date: 2019-04-22 15:59+0200\n"
"Last-Translator: Vivien Kraus <vivien@planete-kraus.eu>\n"
"Language-Team: French\n"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment