diff --git a/news/636.update.rst b/news/636.update.rst new file mode 100644 index 00000000..c496da39 --- /dev/null +++ b/news/636.update.rst @@ -0,0 +1 @@ +Fix an issue with enchant 2 using a different directory (in MacPorts) diff --git a/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-enchant.py b/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-enchant.py index 2c026c77..bc911156 100644 --- a/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-enchant.py +++ b/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-enchant.py @@ -59,4 +59,7 @@ # In Macports are available mostly hunspell (myspell) and aspell dictionaries. libdir = os.path.dirname(libenchant) # e.g. /opt/local/lib sharedir = os.path.join(os.path.dirname(libdir), 'share') # e.g. /opt/local/share - datas.append((os.path.join(sharedir, 'enchant'), 'enchant/share/enchant')) + if os.path.exists(os.path.join(sharedir, 'enchant')): + datas.append((os.path.join(sharedir, 'enchant'), 'enchant/share/enchant')) + if os.path.exists(os.path.join(sharedir, 'enchant-2')): + datas.append((os.path.join(sharedir, 'enchant-2'), 'enchant/share/enchant-2'))