Skip to content

Commit

Permalink
python3 -> python
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick-Hall committed Aug 9, 2023
1 parent 330f130 commit f9c6ed4
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 160 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/gramps-ci-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ jobs:
run: |
cd aio
./build.sh
# - name: Run unit test suite
# run: |
# python3 setup.py test
- uses: actions/upload-artifact@v3
with:
name: GrampsAIO
path: D:\a\gramps\gramps\aio\mingw64\src\GrampsAIO-*.exe
retention-days: 7
67 changes: 38 additions & 29 deletions aio/build.sh
Original file line number Diff line number Diff line change
@@ -1,34 +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
# install prerequisites
## prerequisites in msys packages
pacman -S --needed --noconfirm git mingw-w64-x86_64-python mingw-w64-x86_64-python-pip mingw-w64-x86_64-gexiv2 mingw-w64-x86_64-ghostscript mingw-w64-x86_64-python-cairo mingw-w64-x86_64-python-gobject mingw-w64-x86_64-python-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-python-lxml mingw-w64-x86_64-python-jsonschema mingw-w64-x86_64-gspell mingw-w64-x86_64-geocode-glib mingw-w64-x86_64-python-pillow git mingw-w64-x86_64-graphviz mingw-w64-x86_64-goocanvas mingw-w64-x86_64-osm-gps-map base-devel subversion 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-python-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-python-nose mingw-w64-x86_64-python-wheel
pacman -S --needed --noconfirm mingw-w64-x86_64-toolchain

wget https://github.com/bpisoj/MINGW-packages/releases/download/v5.0/mingw-w64-x86_64-db-6.0.30-1-any.pkg.tar.xz
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
pacman -Udd --noconfirm https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-python-bsddb3-6.2.9-4-any.pkg.tar.zst
cp -R /mingw64/include/python3.10/bsddb3 /mingw64/include/python3.11/bsddb3
cp -R /mingw64/lib/python3.10/site-packages/bsddb3 /mingw64/lib/python3.11/site-packages/bsddb3

## prerequisites in pip packages
python -m pip install --upgrade pip
pip install --upgrade pydot pydotplus requests asyncio pygraphviz

## create a directory structure for icons
mkdir /mingw64/share/icons/gnome
mkdir /mingw64/share/icons/gnome/48x48
mkdir /mingw64/share/icons/gnome/48x48/mimetypes
mkdir /mingw64/share/icons/gnome/scalable
mkdir /mingw64/share/icons/gnome/scalable/mimetypes
mkdir /mingw64/share/icons/gnome/scalable/places

# build gramps
cd ..
cp images/gramps.png /mingw64/share/icons
cd images/hicolor/48x48/mimetypes
for f in *.png
do
cp $f /mingw64/share/icons/gnome/48x48/mimetypes/gnome-mime-$f
done
cd ../../scalable/mimetypes
for f in *.svg
do
cp $f /mingw64/share/icons/gnome/scalable/mimetypes/gnome-mime-$f
done
cd ../../../..
cp /mingw64/share/icons/hicolor/scalable/places/*.svg /mingw64/share/icons/gnome/scalable/places

# build gramps
rm -rf dist aio/dist
python3 setup.py bdist_wheel
python 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
Expand All @@ -37,8 +47,7 @@ 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
python setup.py build_exe --no-compress
# build installer
makensis mingw64/src/grampsaio64.nsi
# result is in mingw64/src

120 changes: 0 additions & 120 deletions aio/grampsaio64.nsi.template
Original file line number Diff line number Diff line change
Expand Up @@ -188,88 +188,6 @@ Section "Gramps" Section1
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\"
Expand Down Expand Up @@ -425,28 +343,6 @@ 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"
Expand Down Expand Up @@ -496,75 +392,59 @@ Function sel_langs
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
Expand Down
27 changes: 19 additions & 8 deletions aio/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@
"": 0,
}


def normalize(version):
version = version.replace("-", "")
version = version.replace("alpha", "a")
version = version.replace("beta", "b")
return version


FULL_VERSION = ".".join(map(str, VERSION_TUPLE)) + VERSION_QUALIFIER
NORMALIZED_VERSION = normalize(FULL_VERSION)

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
Expand Down Expand Up @@ -103,7 +114,7 @@
]
MISSING_DLL = [
"libgtk-3-0.dll",
"libgtkspell3-3-0.dll",
"libgspell-1-2.dll",
"libgexiv2-2.dll",
"libgoocanvas-3.0-9.dll",
"libosmgpsmap-1.0-1.dll",
Expand Down Expand Up @@ -166,14 +177,14 @@
"share/hunspell",
]
ADWAITA = [
"8x8",
# "8x8",
"16x16",
"22x22",
"24x24",
# "22x22",
# "24x24",
"32x32",
"48x48",
"64x64",
"96x96",
# "48x48",
# "64x64",
# "96x96",
"cursors",
]
for adw in ADWAITA:
Expand All @@ -188,7 +199,7 @@

INCLUDE_FILES.append("dist/gramps")
INCLUDE_FILES.append(
("dist/gramps-" + ".".join(map(str, VERSION_TUPLE)) + ".data/data/share", "share")
("dist/gramps-" + NORMALIZED_VERSION + ".data/data/share", "share")
)
EXECUTABLES = [
cx_Freeze.Executable(
Expand Down
Binary file removed aio/share.tgz
Binary file not shown.

0 comments on commit f9c6ed4

Please sign in to comment.