From 86e2b3485d13ab383a76483ec2b35d59d2399f9d Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Wed, 23 Aug 2023 16:44:24 -0700 Subject: [PATCH] Fix an issue where enchant 2 uses a different directory (in MacPorts) --- news/636.update.rst | 1 + .../hooks/stdhooks/hook-enchant.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 news/636.update.rst diff --git a/news/636.update.rst b/news/636.update.rst new file mode 100644 index 000000000..c496da39c --- /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 2c026c771..bc9111560 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'))