aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/pkgs/development/python-modules/freetype-py/library-paths.patch
blob: a30c7e7355fa84497a0e5ece8168543412947fb9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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)