nixpkgs/pkgs/development/python-modules/freetype-py/library-paths.patch
2020-05-07 07:58:38 -05:00

38 lines
1.3 KiB
Diff

diff --git a/freetype/raw.py b/freetype/raw.py
index ff3bea3..78c68ab 100644
--- a/freetype/raw.py
+++ b/freetype/raw.py
@@ -19,31 +19,7 @@ from freetype.ft_enums import *
from freetype.ft_errors import *
from freetype.ft_structs import *
-# First, look for a bundled FreeType shared object on the top-level of the
-# installed freetype-py module.
-system = platform.system()
-if system == 'Windows':
- library_name = 'libfreetype.dll'
-elif system == 'Darwin':
- library_name = 'libfreetype.dylib'
-else:
- library_name = 'libfreetype.so'
-
-filename = os.path.join(os.path.dirname(freetype.__file__), library_name)
-
-# If no bundled shared object is found, look for a system-wide installed one.
-if not os.path.exists(filename):
- # on windows all ctypes does when checking for the library
- # is to append .dll to the end and look for an exact match
- # within any entry in PATH.
- filename = ctypes.util.find_library('freetype')
-
- if filename is None:
- if platform.system() == 'Windows':
- # Check current working directory for dll as ctypes fails to do so
- filename = os.path.join(os.path.realpath('.'), "freetype.dll")
- else:
- filename = library_name
+filename = "@freetype@"
try:
_lib = ctypes.CDLL(filename)