Add source files for Windows AIO

This commit is contained in:
jmichault 2023-06-10 15:13:28 +02:00 committed by Nick Hall
parent ac8ea95d24
commit 0f73812b2e
12 changed files with 1012 additions and 0 deletions

View File

@ -10,6 +10,7 @@ include RELEASE_NOTES
include TODO include TODO
include CONTRIBUTING include CONTRIBUTING
include TestPlan.txt include TestPlan.txt
recursive-include aio *
recursive-include data * recursive-include data *
recursive-include debian * recursive-include debian *
recursive-include docs * recursive-include docs *

25
aio/README.md Normal file
View File

@ -0,0 +1,25 @@
The files in this directory are used to build the Windows AIO (All In One) installer.
To build AIO for the master branch :
1. install msys2
* download msys2 from <https://www.msys2.org/> .
* install with default options.
* run "MSYS2 MINGW64"
* upgrade system : ` pacman -Syuu --noconfirm ` (twice if first run close msys2).
2. download sources from github :
```
pacman -S git --noconfirm
git clone https://github.com/gramps-project/gramps.git
```
3. build AIO :
```
cd gramps/aio
./build.sh
```
result is in gramps/aio/mingw64/src

44
aio/build.sh Normal file
View File

@ -0,0 +1,44 @@
# install prerequisites :
## prerequisites in msys packages :
pacman -S --needed --noconfirm mingw-w64-x86_64-python-pip mingw-w64-x86_64-python3-bsddb3 mingw-w64-x86_64-gexiv2 mingw-w64-x86_64-ghostscript mingw-w64-x86_64-python3-cairo mingw-w64-x86_64-python3-gobject mingw-w64-x86_64-python3-icu mingw-w64-x86_64-iso-codes mingw-w64-x86_64-hunspell mingw-w64-x86_64-hunspell-en mingw-w64-x86_64-enchant perl-XML-Parser intltool mingw-w64-x86_64-python3-lxml mingw-w64-x86_64-python3-jsonschema mingw-w64-x86_64-gtkspell3 mingw-w64-x86_64-geocode-glib mingw-w64-x86_64-python3-pillow git mingw-w64-x86_64-graphviz mingw-w64-x86_64-goocanvas mingw-w64-x86_64-osm-gps-map base-devel mingw-w64-x86_64-toolchain subversion mingw-w64-x86_64-db mingw-w64-x86_64-python-bsddb3 mingw-w64-x86_64-graphviz mingw-w64-x86_64-python-graphviz mingw-w64-x86_64-osm-gps-map mingw-w64-x86_64-nsis mingw-w64-x86_64-python-cx-freeze mingw-w64-x86_64-python3-requests mingw-w64-x86_64-enchant mingw-w64-x86_64-adwaita-icon-theme mingw-w64-x86_64-python-networkx mingw-w64-x86_64-python-psycopg2 upx mingw-w64-x86_64-python-packaging unzip mingw-w64-x86_64-python3-nose mingw-w64-x86_64-python-wheel
python3 -m pip install --upgrade pip
## prerequisites in pip packages
pip3 install --upgrade pydot pydotplus requests asyncio
## berkeley db, from sources (6.0.30 wanted, msys2 provides actually 6.0.19)
mkdir ../build
cd ../build
if [ ! -f mingw-w64-x86_64-db-6.0.30-1-any.pkg.tar.xz ] ; then
wget https://github.com/bpisoj/MINGW-packages/releases/download/v5.0/mingw-w64-x86_64-db-6.0.30-1-any.pkg.tar.xz
fi
pacman -U --noconfirm mingw-w64-x86_64-db-6.0.30-1-any.pkg.tar.xz
pacman -S --noconfirm mingw-w64-x86_64-python3-bsddb3
## pygraphviz, from sources
if [ ! -f Pygraphviz-1.4rc1.zip ] ; then
wget https://gramps-project.org/wiki/images/2/2b/Pygraphviz-1.4rc1.zip
fi
mkdir pygraphviz-1.4rc1
cd pygraphviz-1.4rc1
unzip -u ../Pygraphviz-1.4rc1.zip
MINGW_INSTALLS=mingw64 makepkg-mingw -sLf
pacman -U --noconfirm mingw-w64-x86_64-python3-pygraphviz-1.4rc1-0.0-any.pkg.tar.zst
## add some icons and dictionaries not easy to install
cd ../../aio
tar --directory /mingw64/share/ -zxf share.tgz
# build gramps
cd ..
rm -rf dist aio/dist
python3 setup.py bdist_wheel
appbuild="r$(git rev-list --count HEAD)-$(git rev-parse --short HEAD)"
appversion=$(grep "^VERSION_TUPLE" gramps/version.py|sed 's/.*(//;s/, */\./g;s/).*//')
unzip -d aio/dist dist/*.whl
cd aio
# create nsis script
cat grampsaio64.nsi.template|sed "s/yourVersion/$appversion/;s/yourBuild/$appbuild/">grampsaio64.nsi
# build cx_freeze executables
python3 setup.py build_exe --no-compress
# build installer
makensis mingw64/src/grampsaio64.nsi
# result is in mingw64/src

BIN
aio/gramps.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 KiB

View File

@ -0,0 +1,659 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Gramps - a GTK+/GNOME based genealogy program
;
; 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 2 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, write to the Free Software
; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
;
;Copyright (C) 2013-2021 Josip (pisoj), Paul Culley
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
!define APPNAME "GrampsAIO64"
!define APPVERSION "yourVersion"
!define APPBUILD "yourBuild"
!define APPNAMEANDVERSION "${APPNAME} ${APPVERSION}"
!define APP_PUBLISHER "The Gramps project"
!define APP_WEB_SITE "https://gramps-project.org"
BrandingText "Version ${APPVERSION}-${APPBUILD} -- a new maintenance release"
; Main Install settings
Name "${APPNAME}-${APPVERSION}-${APPBUILD}"
OutFile "GrampsAIO-${APPVERSION}-${APPBUILD}_win64.exe"
CRCCheck on
SetCompressor /SOLID /FINAL LZMA
SetCompressorDictSize 32
SetDatablockOptimize on
SetOverwrite try
XPStyle on
;RequestExecutionLevel admin
;AllowRootDirInstall false
!define MULTIUSER_EXECUTIONLEVEL Highest
!define MULTIUSER_MUI
!define MULTIUSER_INSTALLMODE_COMMANDLINE
!define MULTIUSER_USE_PROGRAMFILES64
!define MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_KEY "Software\${APPNAME}\${APPVERSION}"
!define MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME ""
!define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_KEY "Software\${APPNAME}\${APPVERSION}"
!define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUENAME ""
!define MULTIUSER_INSTALLMODE_INSTDIR "${APPNAME}-${APPVERSION}"
!define UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAMEANDVERSION}"
!include MultiUser.nsh
!include MUI2.nsh
!include x64.nsh
!include WinVer.nsh
!include 'LogicLib.nsh'
!include StrFunc.nsh
!define MUI_ICON ".\gramps.ico"
!define MUI_HEADERIMAGE
;!define MUI_HEADERIMAGE_BITMAP ".\grampshd.bmp"
;!define MUI_WELCOMEFINISHPAGE_BITMAP ".\grampsbg.bmp"
;!define MUI_BGCOLOR
;!define MUI_LICENSEPAGE_BGCOLOR
;!define MUI_DIRECTORYPAGE_BGCOLOR
!define MUI_ABORTWARNING
!define MUI_FINISHPAGE_NOAUTOCLOSE
!define MUI_FINISHPAGE_RUN "$INSTDIR\gramps.exe"
;!define MUI_FINISHPAGE_RUN_PARAMETERS "-EO gramps"
;--------- Pages---------------------------------------------------------------
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "..\share\doc\gramps\COPYING"
!insertmacro MULTIUSER_PAGE_INSTALLMODE
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
;!insertmacro MUI_PAGE_STARTMENU
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
;--------- Languages ----------------------------------------------------------
!insertmacro MUI_LANGUAGE English
!insertmacro MUI_LANGUAGE Albanian
!insertmacro MUI_LANGUAGE Arabic
!insertmacro MUI_LANGUAGE Bulgarian
!insertmacro MUI_LANGUAGE Catalan
!insertmacro MUI_LANGUAGE Croatian
!insertmacro MUI_LANGUAGE Czech
!insertmacro MUI_LANGUAGE Danish
!insertmacro MUI_LANGUAGE Dutch
!insertmacro MUI_LANGUAGE Esperanto
!insertmacro MUI_LANGUAGE Finnish
!insertmacro MUI_LANGUAGE French
!insertmacro MUI_LANGUAGE German
!insertmacro MUI_LANGUAGE Greek
!insertmacro MUI_LANGUAGE Hebrew
!insertmacro MUI_LANGUAGE Hungarian
!insertmacro MUI_LANGUAGE Icelandic
!insertmacro MUI_LANGUAGE Italian
!insertmacro MUI_LANGUAGE Japanese
!insertmacro MUI_LANGUAGE Lithuanian
!insertmacro MUI_LANGUAGE Norwegian
!insertmacro MUI_LANGUAGE NorwegianNynorsk
!insertmacro MUI_LANGUAGE Polish
!insertmacro MUI_LANGUAGE Portuguese
!insertmacro MUI_LANGUAGE PortugueseBR
!insertmacro MUI_LANGUAGE Russian
!insertmacro MUI_LANGUAGE Serbian
!insertmacro MUI_LANGUAGE SerbianLatin
!insertmacro MUI_LANGUAGE SimpChinese
!insertmacro MUI_LANGUAGE Slovak
!insertmacro MUI_LANGUAGE Slovenian
!insertmacro MUI_LANGUAGE Spanish
!insertmacro MUI_LANGUAGE SpanishInternational
!insertmacro MUI_LANGUAGE Swedish
!insertmacro MUI_LANGUAGE TradChinese
!insertmacro MUI_LANGUAGE Turkish
!insertmacro MUI_LANGUAGE Ukrainian
!insertmacro MUI_LANGUAGE Vietnamese
;--------- Reserve Files ------------------------------------------------------
!insertmacro MUI_RESERVEFILE_LANGDLL
;ReserveFile "${NSISDIR}\Plugins\x86-ansi\*.dll"
ReserveFile "${NSISDIR}\Plugins\unicode\*.dll"
ShowInstDetails show
Section "Gramps" Section1
SectionIn RO
SetOverwrite on
;;; Set Section Files and Shortcuts
SetOutPath "$INSTDIR\"
File "..\"
SetOutPath "$INSTDIR\lib\"
File /r "..\lib\"
SetOutPath "$INSTDIR\etc\"
File /r "..\etc\"
SetOutPath "$INSTDIR\share\"
File /r "..\share\doc"
File /r "..\share\glib-2.0"
File /r "..\share\gramps"
File /r "..\share\icons"
File /r "..\share\xml"
SetOutPath "$INSTDIR\gramps\"
File /r "..\gramps\"
SetOutPath "$INSTDIR\ssl\"
File /r "..\etc\ssl\"
SetOutPath "$INSTDIR\src\"
File /r ".\"
CreateDirectory "$INSTDIR\var\cache\fontconfig"
SetOutPath "$INSTDIR\"
CreateShortCut "$DESKTOP\${APPNAMEANDVERSION}.lnk" "$INSTDIR\grampsw.exe" "" "" "" "" "" "Gramps"
CreateDirectory "$SMPROGRAMS\${APPNAMEANDVERSION}"
CreateShortCut "$SMPROGRAMS\${APPNAMEANDVERSION}\${APPNAMEANDVERSION}.lnk" "$INSTDIR\grampsw.exe" "" "" "" "" "" "Gramps"
CreateShortCut "$SMPROGRAMS\${APPNAMEANDVERSION}\${APPNAMEANDVERSION}-console.lnk" "$INSTDIR\gramps.exe" "" "" "" "" "" "Gramps (console)"
DetailPrint "Writing resource-path ..."
FileOpen $4 "$INSTDIR\gramps\gen\utils\resource-path" w
FileWrite $4 "share"
FileClose $4
DetailPrint "Writing branding ..."
FileOpen $4 "$INSTDIR\gramps\version.py" a
FileSeek $4 0 END
FileWrite $4 "$\r$\n" ; we write a new line
FileWrite $4 "VERSION = 'AIO64-${APPVERSION}-${APPBUILD}'"
FileWrite $4 "$\r$\n" ; we write an extra line
FileClose $4 ; and close the file
DetailPrint "Compiling GLib schemas ..."
nsExec::ExecToStack '"$INSTDIR\glib-compile-schemas.exe" $INSTDIR\share\glib-2.0\schemas'
DetailPrint "Caching gdk-pixbuf-query-loaders ..."
nsExec::ExecToStack '"$INSTDIR\gdk-pixbuf-query-loaders.exe" --update-cache'
SectionEnd
SectionGroup "Dictionaries" sec_d
Section /o "ca" d_ca
SetOutPath "$INSTDIR\share\enchant\myspell\"
File "..\share\enchant\myspell\ca_ES.*"
SectionEnd
Section /o "cs" d_cs
SetOutPath "$INSTDIR\share\enchant\myspell\"
File "..\share\enchant\myspell\cs_CZ.*"
SectionEnd
Section /o "da" d_da
SetOutPath "$INSTDIR\share\enchant\myspell\"
File "..\share\enchant\myspell\da_DK.*"
SectionEnd
Section /o "de" d_de
SetOutPath "$INSTDIR\share\enchant\myspell\"
File "..\share\enchant\myspell\de_DE.*"
SectionEnd
Section /o "en_AU" d_enau
SetOutPath "$INSTDIR\share\enchant\myspell\"
File "..\share\enchant\myspell\en_AU.*"
SectionEnd
Section "en_GB" d_engb
SectionIn RO
SetOutPath "$INSTDIR\share\enchant\"
File "..\share\enchant\enchant.ordering"
SetOutPath "$INSTDIR\share\enchant\myspell\"
File "..\share\enchant\myspell\en_GB.*"
SectionEnd
Section /o "en_US" d_enus
SetOutPath "$INSTDIR\share\enchant\myspell\"
File "..\share\enchant\myspell\en_US.*"
SectionEnd
Section /o "es_ES" d_es
SetOutPath "$INSTDIR\share\enchant\myspell\"
File "..\share\enchant\myspell\es_ES.*"
SectionEnd
Section /o "fr_FR" d_fr
SetOutPath "$INSTDIR\share\enchant\myspell\"
File "..\share\enchant\myspell\fr_FR.*"
SectionEnd
Section /o "hr_HR" d_hr
SetOutPath "$INSTDIR\share\enchant\myspell\"
File "..\share\enchant\myspell\hr_HR.*"
SectionEnd
Section /o "it_IT" d_it
SetOutPath "$INSTDIR\share\enchant\myspell\"
File "..\share\enchant\myspell\it_IT.*"
SectionEnd
Section /o "nb_NO" d_nb
SetOutPath "$INSTDIR\share\enchant\myspell\"
File "..\share\enchant\myspell\nb_no.*"
SectionEnd
Section /o "nl_NL" d_nl
SetOutPath "$INSTDIR\share\enchant\myspell\"
File "..\share\enchant\myspell\nl_NL.*"
SectionEnd
Section /o "nn_NO" d_nn
SetOutPath "$INSTDIR\share\enchant\myspell\"
File "..\share\enchant\myspell\nn_NO.*"
SectionEnd
Section /o "pl_PL" d_pl
SetOutPath "$INSTDIR\share\enchant\myspell\"
File "..\share\enchant\myspell\pl_PL.*"
SectionEnd
Section /o "ru_RU" d_ru
SetOutPath "$INSTDIR\share\enchant\myspell\"
File "..\share\enchant\myspell\ru_RU.*"
SectionEnd
Section /o "sk_SK" d_sk
SetOutPath "$INSTDIR\share\enchant\myspell\"
File "..\share\enchant\myspell\sk_SK.*"
SectionEnd
Section /o "sl_SI" d_sl
SetOutPath "$INSTDIR\share\enchant\myspell\"
File "..\share\enchant\myspell\sl_SI.*"
SectionEnd
Section /o "sv_SE" d_sv
SetOutPath "$INSTDIR\share\enchant\myspell\"
File "..\share\enchant\myspell\sv_SE.*"
SectionEnd
SectionGroupEnd
SectionGroup "Translations" sec_t
Section /o "ar" ar
SetOutPath "$INSTDIR\share\locale\"
File /r "..\share\locale\ar"
SectionEnd
Section /o "bg" bg
SetOutPath "$INSTDIR\share\locale\"
File /r "..\share\locale\bg"
SectionEnd
Section /o "ca" ca
SetOutPath "$INSTDIR\share\locale\"
File /r "..\share\locale\ca"
SectionEnd
Section /o "cs" cs
SetOutPath "$INSTDIR\share\locale\"
File /r "..\share\locale\cs"
SectionEnd
Section /o "da" da
SetOutPath "$INSTDIR\share\locale\"
File /r "..\share\locale\da"
SectionEnd
Section /o "de" de
SetOutPath "$INSTDIR\share\locale\"
File /r "..\share\locale\de"
SectionEnd
Section /o "el" el
SetOutPath "$INSTDIR\share\locale\"
File /r "..\share\locale\el"
SectionEnd
Section "en_GB" en_GB
SectionIn RO
SetOutPath "$INSTDIR\share\locale\"
File /r "..\share\locale\en_GB"
SectionEnd
Section /o "eo" eo
SetOutPath "$INSTDIR\share\locale\"
File /r "..\share\locale\eo"
SectionEnd
Section /o "es" es
SetOutPath "$INSTDIR\share\locale\"
File /r "..\share\locale\es"
SectionEnd
Section /o "fi" fi
SetOutPath "$INSTDIR\share\locale\"
File /r "..\share\locale\fi"
SectionEnd
Section /o "fr" fr
SetOutPath "$INSTDIR\share\locale\"
File /r "..\share\locale\fr"
SectionEnd
Section /o "he" he
SetOutPath "$INSTDIR\share\locale\"
File /r "..\share\locale\he"
SectionEnd
Section /o "hr" hr
SetOutPath "$INSTDIR\share\locale\"
File /r "..\share\locale\hr"
SectionEnd
Section /o "hu" hu
SetOutPath "$INSTDIR\share\locale\"
File /r "..\share\locale\hu"
SectionEnd
Section /o "is" is
SetOutPath "$INSTDIR\share\locale\"
File /r "..\share\locale\is"
SectionEnd
Section /o "it" it
SetOutPath "$INSTDIR\share\locale\"
File /r "..\share\locale\it"
SectionEnd
Section /o "ja" ja
SetOutPath "$INSTDIR\share\locale\"
File /r "..\share\locale\ja"
SectionEnd
Section /o "lt" lt
SetOutPath "$INSTDIR\share\locale\"
File /r "..\share\locale\lt"
SectionEnd
Section /o "nb" nb
SetOutPath "$INSTDIR\share\locale\"
File /r "..\share\locale\nb"
SectionEnd
Section /o "nl" nl
SetOutPath "$INSTDIR\share\locale\"
File /r "..\share\locale\nl"
SectionEnd
Section /o "nn" nn
SetOutPath "$INSTDIR\share\locale\"
File /r "..\share\locale\nn"
SectionEnd
Section /o "pl" pl
SetOutPath "$INSTDIR\share\locale\"
File /r "..\share\locale\pl"
SectionEnd
Section /o "pt_BR" pt_BR
SetOutPath "$INSTDIR\share\locale\"
File /r "..\share\locale\pt_BR"
SectionEnd
Section /o "pt_PT" pt_PT
SetOutPath "$INSTDIR\share\locale\"
File /r "..\share\locale\pt_PT"
SectionEnd
Section /o "ru" ru
SetOutPath "$INSTDIR\share\locale\"
File /r "..\share\locale\ru"
SectionEnd
Section /o "sk" sk
SetOutPath "$INSTDIR\share\locale\"
File /r "..\share\locale\sk"
SectionEnd
Section /o "sl" sl
SetOutPath "$INSTDIR\share\locale\"
File /r "..\share\locale\sl"
SectionEnd
Section /o "sq" sq
SetOutPath "$INSTDIR\share\locale\"
File /r "..\share\locale\sq"
SectionEnd
Section /o "sr" sr
SetOutPath "$INSTDIR\share\locale\"
File /r "..\share\locale\sr"
SectionEnd
Section /o "sv" sv
SetOutPath "$INSTDIR\share\locale\"
File /r "..\share\locale\sv"
SectionEnd
Section /o "tr" tr
SetOutPath "$INSTDIR\share\locale\"
File /r "..\share\locale\tr"
SectionEnd
Section /o "uk" uk
SetOutPath "$INSTDIR\share\locale\"
File /r "..\share\locale\uk"
SectionEnd
Section /o "vi" vi
SetOutPath "$INSTDIR\share\locale\"
File /r "..\share\locale\vi"
SectionEnd
Section /o "zh_CN" zh_CN
SetOutPath "$INSTDIR\share\locale\"
File /r "..\share\locale\zh_CN"
SectionEnd
Section /o "zh_HK" zh_HK
SetOutPath "$INSTDIR\share\locale\"
File /r "..\share\locale\zh_HK"
SectionEnd
Section /o "zh_TW" zh_TW
SetOutPath "$INSTDIR\share\locale\"
File /r "..\share\locale\zh_TW"
SectionEnd
SectionGroupEnd
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${Section1} "Gramps application with all dependencies"
;; Description of dictionaries
!insertmacro MUI_DESCRIPTION_TEXT ${sec_d} "Dictionaries for various languages"
!insertmacro MUI_DESCRIPTION_TEXT ${d_ca} "Catalan"
!insertmacro MUI_DESCRIPTION_TEXT ${d_cs} "Czech"
!insertmacro MUI_DESCRIPTION_TEXT ${d_da} "Danish"
!insertmacro MUI_DESCRIPTION_TEXT ${d_de} "German"
!insertmacro MUI_DESCRIPTION_TEXT ${d_enau} "English (Australia)"
!insertmacro MUI_DESCRIPTION_TEXT ${d_engb} "English (United Kingdom)"
!insertmacro MUI_DESCRIPTION_TEXT ${d_enus} "English (USA)"
!insertmacro MUI_DESCRIPTION_TEXT ${d_es} "Spanish"
!insertmacro MUI_DESCRIPTION_TEXT ${d_fr} "French"
!insertmacro MUI_DESCRIPTION_TEXT ${d_hr} "Croatian"
!insertmacro MUI_DESCRIPTION_TEXT ${d_it} "Italian"
!insertmacro MUI_DESCRIPTION_TEXT ${d_nb} "Norwegian Bokmal"
!insertmacro MUI_DESCRIPTION_TEXT ${d_nl} "Dutch"
!insertmacro MUI_DESCRIPTION_TEXT ${d_nn} "Norwegian Nynorsk"
!insertmacro MUI_DESCRIPTION_TEXT ${d_pl} "Polish"
!insertmacro MUI_DESCRIPTION_TEXT ${d_ru} "Russian"
!insertmacro MUI_DESCRIPTION_TEXT ${d_sk} "Slovak"
!insertmacro MUI_DESCRIPTION_TEXT ${d_sl} "Slovenian"
!insertmacro MUI_DESCRIPTION_TEXT ${d_sv} "Swedish"
;; Description of translations
!insertmacro MUI_DESCRIPTION_TEXT ${sec_t} "Translation of Gramps in various languages"
!insertmacro MUI_DESCRIPTION_TEXT ${ar} "Arabic"
!insertmacro MUI_DESCRIPTION_TEXT ${bg} "Bulgarian"
!insertmacro MUI_DESCRIPTION_TEXT ${ca} "Catalan"
!insertmacro MUI_DESCRIPTION_TEXT ${cs} "Czech"
!insertmacro MUI_DESCRIPTION_TEXT ${da} "Danish"
!insertmacro MUI_DESCRIPTION_TEXT ${de} "German"
!insertmacro MUI_DESCRIPTION_TEXT ${el} "Greek"
!insertmacro MUI_DESCRIPTION_TEXT ${en_GB} "English (United Kingdom)"
!insertmacro MUI_DESCRIPTION_TEXT ${eo} "Esperanto"
!insertmacro MUI_DESCRIPTION_TEXT ${es} "Spanish"
!insertmacro MUI_DESCRIPTION_TEXT ${fi} "Finnish"
!insertmacro MUI_DESCRIPTION_TEXT ${fr} "French"
!insertmacro MUI_DESCRIPTION_TEXT ${he} "Hebrew"
!insertmacro MUI_DESCRIPTION_TEXT ${hr} "Croatian"
!insertmacro MUI_DESCRIPTION_TEXT ${hu} "Hungarian"
!insertmacro MUI_DESCRIPTION_TEXT ${is} "Icelandic"
!insertmacro MUI_DESCRIPTION_TEXT ${it} "Italian"
!insertmacro MUI_DESCRIPTION_TEXT ${ja} "Japanese"
!insertmacro MUI_DESCRIPTION_TEXT ${lt} "Lithuanian"
;!insertmacro MUI_DESCRIPTION_TEXT ${mk} "Macedonian"
!insertmacro MUI_DESCRIPTION_TEXT ${nb} "Norwegian Bokmal"
!insertmacro MUI_DESCRIPTION_TEXT ${nl} "Dutch"
!insertmacro MUI_DESCRIPTION_TEXT ${nn} "Norwegian Nynorsk"
!insertmacro MUI_DESCRIPTION_TEXT ${pl} "Polish"
!insertmacro MUI_DESCRIPTION_TEXT ${pt_BR} "Portuguese (Brazil)"
!insertmacro MUI_DESCRIPTION_TEXT ${pt_PT} "Portuguese (Portugal)"
!insertmacro MUI_DESCRIPTION_TEXT ${ru} "Russian"
!insertmacro MUI_DESCRIPTION_TEXT ${sk} "Slovak"
!insertmacro MUI_DESCRIPTION_TEXT ${sl} "Slovenian"
!insertmacro MUI_DESCRIPTION_TEXT ${sq} "Albanian"
!insertmacro MUI_DESCRIPTION_TEXT ${sr} "Serbian"
!insertmacro MUI_DESCRIPTION_TEXT ${sv} "Swedish"
!insertmacro MUI_DESCRIPTION_TEXT ${tr} "Turkish"
!insertmacro MUI_DESCRIPTION_TEXT ${uk} "Ukrainian"
!insertmacro MUI_DESCRIPTION_TEXT ${vi} "Vietnamese"
!insertmacro MUI_DESCRIPTION_TEXT ${zh_CN} "Chinese (Simplified)"
!insertmacro MUI_DESCRIPTION_TEXT ${zh_HK} "Chinese (Hong Kong)"
!insertmacro MUI_DESCRIPTION_TEXT ${zh_TW} "Chinese (Traditional)"
!insertmacro MUI_FUNCTION_DESCRIPTION_END
Function sel_langs
StrCmp $LANGUAGE ${LANG_ARABIC} 0 +2
SectionSetFlags ${ar} 1
StrCmp $LANGUAGE ${LANG_BULGARIAN} 0 +2
SectionSetFlags ${bg} 1
StrCmp $LANGUAGE ${LANG_CATALAN} 0 +3
SectionSetFlags ${ca} 1
SectionSetFlags ${d_ca} 1
StrCmp $LANGUAGE ${LANG_CZECH} 0 +3
SectionSetFlags ${cs} 1
SectionSetFlags ${d_cs} 1
StrCmp $LANGUAGE ${LANG_DANISH} 0 +3
SectionSetFlags ${da} 1
SectionSetFlags ${d_da} 1
StrCmp $LANGUAGE ${LANG_GERMAN} 0 +3
SectionSetFlags ${de} 1
SectionSetFlags ${d_de} 1
StrCmp $LANGUAGE ${LANG_GREEK} 0 +2
SectionSetFlags ${el} 1
StrCmp $LANGUAGE ${LANG_ESPERANTO} 0 +2
SectionSetFlags ${eo} 1
StrCmp $LANGUAGE ${LANG_SPANISH} 0 +3
SectionSetFlags ${es} 1
SectionSetFlags ${d_es} 1
StrCmp $LANGUAGE ${LANG_FINNISH} 0 +2
SectionSetFlags ${fi} 1
StrCmp $LANGUAGE ${LANG_FRENCH} 0 +3
SectionSetFlags ${fr} 1
SectionSetFlags ${d_fr} 1
StrCmp $LANGUAGE ${LANG_HEBREW} 0 +2
SectionSetFlags ${he} 1
StrCmp $LANGUAGE ${LANG_CROATIAN} 0 +3
SectionSetFlags ${hr} 1
SectionSetFlags ${d_hr} 1
StrCmp $LANGUAGE ${LANG_HUNGARIAN} 0 +2
SectionSetFlags ${hu} 1
StrCmp $LANGUAGE ${LANG_ICELANDIC} 0 +2
SectionSetFlags ${is} 1
StrCmp $LANGUAGE ${LANG_ITALIAN} 0 +3
SectionSetFlags ${it} 1
SectionSetFlags ${d_it} 1
StrCmp $LANGUAGE ${LANG_JAPANESE} 0 +2
SectionSetFlags ${ja} 1
StrCmp $LANGUAGE ${LANG_LITHUANIAN} 0 +2
SectionSetFlags ${lt} 1
StrCmp $LANGUAGE ${LANG_NORWEGIAN} 0 +5
SectionSetFlags ${nb} 1
SectionSetFlags ${d_nb} 1
SectionSetFlags ${nn} 1
SectionSetFlags ${d_nn} 1
StrCmp $LANGUAGE ${LANG_DUTCH} 0 +3
SectionSetFlags ${nl} 1
SectionSetFlags ${d_nl} 1
StrCmp $LANGUAGE ${LANG_POLISH} 0 +3
SectionSetFlags ${pl} 1
SectionSetFlags ${d_pl} 1
StrCmp $LANGUAGE ${LANG_PORTUGUESEBR} 0 +2
SectionSetFlags ${pt_BR} 1
StrCmp $LANGUAGE ${LANG_PORTUGUESE} 0 +2
SectionSetFlags ${pt_PT} 1
StrCmp $LANGUAGE ${LANG_RUSSIAN} 0 +3
SectionSetFlags ${ru} 1
SectionSetFlags ${d_ru} 1
StrCmp $LANGUAGE ${LANG_SLOVAK} 0 +3
SectionSetFlags ${sk} 1
SectionSetFlags ${d_sk} 1
StrCmp $LANGUAGE ${LANG_SLOVENIAN} 0 +3
SectionSetFlags ${sl} 1
SectionSetFlags ${d_sl} 1
StrCmp $LANGUAGE ${LANG_ALBANIAN} 0 +2
SectionSetFlags ${sq} 1
StrCmp $LANGUAGE ${LANG_SERBIAN} 0 +2
SectionSetFlags ${sr} 1
StrCmp $LANGUAGE ${LANG_SWEDISH} 0 +3
SectionSetFlags ${sv} 1
SectionSetFlags ${d_sv} 1
StrCmp $LANGUAGE ${LANG_TURKISH} 0 +2
SectionSetFlags ${tr} 1
StrCmp $LANGUAGE ${LANG_UKRAINIAN} 0 +2
SectionSetFlags ${uk} 1
StrCmp $LANGUAGE ${LANG_VIETNAMESE} 0 +2
SectionSetFlags ${vi} 1
StrCmp $LANGUAGE ${LANG_SIMPCHINESE} 0 +3
SectionSetFlags ${zh_CN} 1
SectionSetFlags ${zh_HK} 1
StrCmp $LANGUAGE ${LANG_TRADCHINESE} 0 +3
SectionSetFlags ${zh_TW} 1
SectionSetFlags ${zh_HK} 1
FunctionEnd
Section -FinishSection
DetailPrint "Configuring GraphViz Dot..."
ReadEnvStr $R0 "PATH"
StrCpy $R0 "$R0;$INSTDIR\lib"
System::Call 'Kernel32::SetEnvironmentVariable(t, t) i("PATH", R0).r0'
SetOutPath $INSTDIR
nsExec::ExecToLog '"$INSTDIR\lib\dot.exe" -c'
System::Call 'Kernel32::SetEnvironmentVariable(t, t)i ("FC_DEBUG", "128").r0'
DetailPrint "Creating fontconfig cache (might take a while)..."
nsExec::ExecToLog '"$INSTDIR\lib\fc-cache.exe" -fv'
System::Call 'Kernel32::SetEnvironmentVariable(t, n)i ("FC_DEBUG", "").r0'
WriteRegStr SHCTX "${UNINST_KEY}" "DisplayName" "${APPNAME}"
WriteRegStr SHCTX "${UNINST_KEY}" "DisplayVersion" "${APPVERSION}"
WriteRegStr SHCTX "${UNINST_KEY}" "Publisher" "${APP_PUBLISHER}"
WriteRegStr SHCTX "${UNINST_KEY}" "URLInfoAbout" "${APP_WEB_SITE}"
WriteRegStr SHCTX "${UNINST_KEY}" "UninstallString" \
"$\"$INSTDIR\uninstall.exe$\" /$MultiUser.InstallMode"
WriteRegStr SHCTX "${UNINST_KEY}" "QuietUninstallString" \
"$\"$INSTDIR\uninstall.exe$\" /$MultiUser.InstallMode /S"
WriteUninstaller "$INSTDIR\uninstall.exe"
SectionEnd
Section Uninstall
DeleteRegKey SHCTX "${UNINST_KEY}"
Delete "$DESKTOP\${APPNAMEANDVERSION}.lnk"
Delete "$SMPROGRAMS\${APPNAMEANDVERSION}\${APPNAMEANDVERSION}.lnk"
Delete "$SMPROGRAMS\${APPNAMEANDVERSION}\${APPNAMEANDVERSION}-console.lnk"
RMDir "$SMPROGRAMS\${APPNAMEANDVERSION}\"
Delete "$INSTDIR\uninstall.exe"
Delete "$INSTDIR\uninstall.exe"
RMDir /r "$INSTDIR\etc"
RMDir /r "$INSTDIR\lib"
RMDir /r "$INSTDIR\share"
RMDir /r "$INSTDIR\src"
RMDir /r "$INSTDIR\ssl"
RMDir /r "$INSTDIR\gramps"
RMDir /r "$INSTDIR\var"
RMDir /r "$INSTDIR"
SectionEnd
Function .onInit
!insertmacro MULTIUSER_INIT
;; Prevent multiple instances.
System::Call 'kernel32::CreateMutexA(i 0, i 0, t "GrampsInstaller") i .r1 ?e'
Pop $R0
StrCmp $R0 0 +3
MessageBox MB_OK|MB_ICONEXCLAMATION "The GrampsAIO installer is already running."
Abort
${IfNot} ${RunningX64}
MessageBox MB_OK "64bit Windows version required"
Quit
${EndIf}
${If} ${AtMostWinXP}
MessageBox MB_OK "Windows Vista and above required"
Quit
${EndIf}
;StrCpy $LANGUAGE ${LANG_FRENCH}
Call sel_langs
FunctionEnd
Function un.onInit
!insertmacro MULTIUSER_UNINIT
;; MessageBox MB_OK|MB_ICONEXCLAMATION "Gramps will uninstall now"
;; Prevent uninstallation if Gramps is running.
System::Call 'kernel32::CreateMutex(i 0, b 0, t "org.gramps-project.gramps") i .R0 ?e'
Pop $0
;; MessageBox MB_OK|MB_ICONEXCLAMATION "Gramps Mutex Error $0, return $R0"
IntCmpU $0 183 0 notRunning notRunning
System::Call 'kernel32::CloseHandle(i $R0)'
MessageBox MB_OK|MB_ICONEXCLAMATION "Gramps is running. Please close it first"
Abort
notRunning:
FunctionEnd

40
aio/grampsaioc.py Normal file
View File

@ -0,0 +1,40 @@
#!/usr/bin/env python3
import os
from os import environ
from os.path import join
import sys
import site
if getattr(sys, 'frozen', False):
aio = os.path.dirname(sys.executable)
sys.path.insert(1, aio)
sys.path.insert(1, os.path.join(aio,'lib'))
sys.path.insert(1, site.getusersitepackages())
environ['PANGOCAIRO_BACKEND'] = 'fontconfig'
environ['SSL_CERT_FILE'] = join(aio, 'ssl/certs/ca-bundle.trust.crt')
environ['GI_TYPELIB_PATH'] = join(aio, 'lib/girepository-1.0')
environ['G_ENABLE_DIAGNOSTIC'] = '0'
environ['G_PARAM_DEPRECATED'] = '0'
environ['GRAMPS_RESOURCES'] = join(aio, 'share')
environ['PATH'] = aio + ';' + aio +'\lib;' + environ['PATH']
def close():
sys.exit()
import atexit
import ctypes
HANDLE = ctypes.windll.kernel32.CreateMutexW(None, 1, "org.gramps-project.gramps")
ERROR = ctypes.GetLastError()
if ERROR == 183: #ERROR_ALREADY_EXISTS:
print('Gramps is already running!', file=sys.stderr)
close()
atexit.register(ctypes.windll.kernel32.CloseHandle, HANDLE)
atexit.register(ctypes.windll.kernel32.ReleaseMutex, HANDLE)
import warnings
warnings.simplefilter("ignore")
import gramps.grampsapp as app
app.run()

23
aio/grampsaiocd.py Normal file
View File

@ -0,0 +1,23 @@
#!/usr/bin/env python3
import os
from os import environ
from os.path import join
import sys
import site
if getattr(sys, 'frozen', False):
aio = os.path.dirname(sys.executable)
sys.path.insert(1, aio)
sys.path.insert(1, os.path.join(aio,'lib'))
sys.path.insert(1, site.getusersitepackages())
environ['LANG'] = 'en'
environ['PANGOCAIRO_BACKEND'] = 'fontconfig'
environ['SSL_CERT_FILE'] = join(aio, 'ssl/certs/ca-bundle.trust.crt')
environ['GI_TYPELIB_PATH'] = join(aio, 'lib/girepository-1.0')
environ['G_ENABLE_DIAGNOSTIC'] = '0'
environ['G_PARAM_DEPRECATED'] = '0'
environ['GRAMPS_RESOURCES'] = join(aio, 'share')
environ['PATH'] = aio + ';' + aio +'\lib;' + environ['PATH']
import gramps.grampsapp as app
app.run()

39
aio/grampsaiow.py Normal file
View File

@ -0,0 +1,39 @@
#!/usr/bin/env python3
'''
grampsw.exe
'''
import os
from os import environ
from os.path import join
import sys
import site
if getattr(sys, 'frozen', False):
aio = os.path.dirname(sys.executable)
sys.path.insert(1, aio)
sys.path.insert(1, os.path.join(aio,'lib'))
sys.path.insert(1, site.getusersitepackages())
environ['SSL_CERT_FILE'] = join(aio, 'ssl/certs/ca-bundle.trust.crt')
environ['GI_TYPELIB_PATH'] = join(aio, 'lib/girepository-1.0')
environ['G_ENABLE_DIAGNOSTIC'] = '0'
environ['G_PARAM_DEPRECATED'] = '0'
environ['GRAMPS_RESOURCES'] = join(aio, 'share')
environ['PATH'] = aio + ';' + aio +'\lib;' + environ['PATH']
import atexit
import ctypes
def close():
''' Show warning dialog if Gramps is already running'''
sys.exit('Gramps is already running!')
HANDLE = ctypes.windll.kernel32.CreateMutexW(None, 1, "org.gramps-project.gramps")
ERROR = ctypes.GetLastError()
if ERROR == 183: #ERROR_ALREADY_EXISTS:
close()
atexit.register(ctypes.windll.kernel32.CloseHandle, HANDLE)
atexit.register(ctypes.windll.kernel32.ReleaseMutex, HANDLE)
import gramps.grampsapp as app
app.main()

BIN
aio/grampsc.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 KiB

BIN
aio/grampsd.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

181
aio/setup.py Normal file
View File

@ -0,0 +1,181 @@
'''
Use with:
python3 setup.py build_exe --no-compress -O1
'''
import sys
import os
import site
import subprocess
import tempfile
import atexit
import shutil
import zipfile
import cx_Freeze
sys.path.insert(0,'dist')
import gramps
from gramps.version import VERSION_TUPLE
try:
from gramps.version import VERSION_QUALIFIER
except:
VERSION_QUALIFIER = ''
UPX_ALT_PATH = r'UPX'
#import logging
#logging.basicConfig(level=logging.DEBUG)
VQ = {'-alpha1': 10, '-alpha2': 11, '-alpha3': 12,
'-beta1': 21, '-beta2': 22, '-beta3': 23,
'-rc1': 22, '': 0}
VERSION = ('.'.join(map(str, VERSION_TUPLE)) + '.' +
str(VQ.get(VERSION_QUALIFIER, 99)))
COPYRIGHT="Copyright 2020, Gramps developers. GNU General Public License"
# Prepare a temporay directory
TEMP_DIR = tempfile.TemporaryDirectory()
atexit.register(TEMP_DIR.cleanup)
BASE_DIR = os.path.split(sys.prefix)[1]
SETUP_DIR = os.path.dirname(os.path.realpath(__file__))
SETUP_FILES = ['setup.py', 'gramps.ico', 'grampsc.ico', 'grampsd.ico',
'grampsaioc.py', 'grampsaiocd.py', 'grampsaiow.py']
if '32' in BASE_DIR:
SETUP_FILES.append(''.join(('grampsaio', '32', '.nsi')))
else:
SETUP_FILES.append(''.join(('grampsaio', '64', '.nsi')))
INCLUDE_DLL_PATH = os.path.join(sys.exec_prefix, 'bin')
INCLUDE_FILES = []
INCLUDES = ['gi', 'cgi', 'colorsys', 'site']
PACKAGES = ['gi', 'cairo', 'xml', 'bsddb3', 'lxml', 'PIL', 'json', 'csv',
'sqlite3', 'cProfile', 'networkx', 'psycopg2', 'requests', 'logging'
, 'html', 'compileall', 'graphviz', 'pydotplus', 'pygraphviz', 'pydot' ]
EXCLUDES = ['tkinter', 'PyQt5', 'PyQt5.QtCore', 'PyQt5.QtGui', 'pyside'
'PyQt5.QtWidgets', 'sip', 'lib2to3', 'PIL.ImageQt', 'pip', 'distlib'
]
REPLACE_PATHS = [('*', 'AIO/'),
( site.getsitepackages()[0]
+'cx_freeze-5.0-py3.6-mingw.egg/cx_Freeze', 'cx_Freeze/')
]
MISSING_DLL = ['libgtk-3-0.dll', 'libgtkspell3-3-0.dll', 'libgexiv2-2.dll',
'libgoocanvas-3.0-9.dll', 'libosmgpsmap-1.0-1.dll',
'gswin32c.exe', 'dot.exe', 'libgvplugin_core-6.dll',
'libgvplugin_dot_layout-6.dll', 'libgvplugin_gd-6.dll',
'libgvplugin_pango-6.dll', 'libgvplugin_rsvg-6.dll',
'glib-compile-schemas.exe',
'gdk-pixbuf-query-loaders.exe', 'gtk-update-icon-cache-3.0.exe',
'fc-cache.exe', 'fc-match.exe', 'gspawn-win64-helper-console.exe',
'gspawn-win64-helper.exe', 'libgeocode-glib-0.dll'
]
BIN_EXCLUDES = ['Qt5Core.dll', 'gdiplus.dll', 'gdiplus']
from os.path import dirname, basename
import lib2to3
lib23_path = dirname(lib2to3.__file__)
INCLUDE_FILES.append((lib23_path, 'lib/lib2to3'))
import pip
libpip_path = dirname(pip.__file__)
INCLUDE_FILES.append((libpip_path,'lib/pip'))
import distlib
libdistlib_path = dirname(distlib.__file__)
INCLUDE_FILES.append((libdistlib_path,'lib/distlib'))
os.makedirs(os.path.join(BASE_DIR, 'var/cache/fontconfig'), exist_ok=True)
for file in SETUP_FILES:
INCLUDE_FILES.append((os.path.join(SETUP_DIR, file),
os.path.join('src', file)))
for dll in MISSING_DLL:
INCLUDE_FILES.append((os.path.join(INCLUDE_DLL_PATH, dll),
os.path.join('lib',dll)))
MISSING_LIBS = ['lib/enchant-2', 'lib/gdk-pixbuf-2.0', 'lib/girepository-1.0',
'share/enchant', 'share/glib-2.0/schemas',
'share/xml/iso-codes', 'etc/gtk-3.0',
'etc/ssl/certs', 'etc/ssl/cert.pem', 'etc/fonts', 'lib/gio',
'share/icons/gnome',
'share/icons/hicolor', 'share/icons/gramps.png',
'share/icons/Adwaita/icon-theme.cache',
'share/icons/Adwaita/index.theme', 'share/hunspell'
]
ADWAITA = ['8x8', '16x16', '22x22', '24x24', '32x32', '48x48', '64x64',
'96x96', 'cursors'
]
for adw in ADWAITA:
INCLUDE_FILES.append((os.path.join(sys.prefix, 'share/icons/Adwaita', adw),
os.path.join('share/icons/Adwaita', adw)))
for lib in MISSING_LIBS:
INCLUDE_FILES.append((os.path.join(sys.prefix, lib), lib))
INCLUDE_FILES.append('dist/gramps')
INCLUDE_FILES.append(('dist/gramps-' + '.'.join(map(str, VERSION_TUPLE)) + '.data/data/share','share'))
EXECUTABLES = [cx_Freeze.Executable("grampsaioc.py", base="Console",
target_name='gramps.exe',
icon='gramps.ico', copyright=COPYRIGHT),
cx_Freeze.Executable("grampsaiow.py", base="Win32GUI",
target_name='grampsw.exe',
icon='gramps.ico', copyright=COPYRIGHT),
cx_Freeze.Executable("grampsaiocd.py", base="Console",
target_name='grampsd.exe',
icon='grampsd.ico', copyright=COPYRIGHT)
]
BUILD_EXE_OPTIONS = {'packages':PACKAGES,
'includes':INCLUDES,
'excludes':EXCLUDES,
'include_files':INCLUDE_FILES,
'bin_includes':MISSING_DLL,
'zip_include_packages': '*', #ZIP_INCLUDE_PACKAGES,
'zip_exclude_packages':EXCLUDES,
'bin_excludes':BIN_EXCLUDES,
'replace_paths':REPLACE_PATHS,
'build_exe':BASE_DIR,
}
BDIST_MSI_OPTIONS = { #uuid.uuid5(uuid.NAMESPACE_DNS, 'GrampsAIO64-5-trunk')
'upgrade_code': '{fbccc04b-7b2e-56d3-8bb7-94d5f68de822}',
#uuid.uuid5(uuid.NAMESPACE_DNS, 'v5.0.0-alpha1-476-g473d3aa')
'product_code': '{48304362-2945-5a10-ad60-241f233be4d2}',
'add_to_path': False,
#'initial_target_dir': r'[ProgramFilesFolder]\%s\%s' %
#(company_name, product_name),
}
cx_Freeze.setup(
name="GrampsAIO32" if '32' in BASE_DIR else "GrampsAIO64",
options={"build_exe": BUILD_EXE_OPTIONS, 'bdist_msi': BDIST_MSI_OPTIONS},
version=VERSION,
description="Gramps Genealogy software",
long_description=VERSION_QUALIFIER,
executables=EXECUTABLES)
ZIN = zipfile.ZipFile(os.path.join(BASE_DIR, 'lib/library.zip'), 'r')
ZOUT = zipfile.ZipFile(os.path.join(BASE_DIR, 'lib/pythonx.zip'), 'w')
for item in ZIN.infolist():
if not os.path.dirname(item.filename).startswith('gramps'):
#if '/test' in item.filename or 'test/' in item.filename:
# print("Zip Excluded:", item.filename)
#else:
print("Zip Included:", item.filename)
buffer = ZIN.read(item.filename)
ZOUT.writestr(item, buffer)
ZOUT.close()
ZIN.close()
shutil.move(os.path.join(BASE_DIR, 'lib/pythonx.zip'),
os.path.join(BASE_DIR, 'lib/library.zip'))
if os.path.isfile(UPX_ALT_PATH):
UPX = UPX_ALT_PATH
else:
WHICH = 'where' if os.name == 'nt' else 'which'
try:
subprocess.check_call([WHICH, 'UPX'])
except subprocess.CalledProcessError:
UPX = None
else:
UPX = 'upx'
if UPX is not None:
ARGS = [UPX, '-7', '--no-progress']
ARGS.extend(os.path.join(BASE_DIR, filename) for filename in
os.listdir(BASE_DIR) if filename == 'name' or
os.path.splitext(filename)[1].lower() in
('.exe', '.dll', '.pyd', '.so') and
os.path.splitext(filename)[0].lower() not in
('libgcc_s_dw2-1', 'gramps', 'grampsw', 'grampsd',
'libwinpthread-1'))
subprocess.call(ARGS)
else:
print("\nUPX not found")

BIN
aio/share.tgz Normal file

Binary file not shown.