about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/lua-modules/magick.patch
blob: 41b5ed98c7f0c5e8da32e6378f1373387b5ea97f (plain) (blame)
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
diff --git a/magick/wand/lib.lua b/magick/wand/lib.lua
index 21940a0..0d103dc 100644
--- a/magick/wand/lib.lua
+++ b/magick/wand/lib.lua
@@ -134,15 +134,6 @@ get_filters = function()
   local prefixes = {
     "/usr/include/ImageMagick",
     "/usr/local/include/ImageMagick",
-    unpack((function()
-      local _accum_0 = { }
-      local _len_0 = 1
-      for p in get_flags():gmatch("-I([^%s]+)") do
-        _accum_0[_len_0] = p
-        _len_0 = _len_0 + 1
-      end
-      return _accum_0
-    end)())
   }
   for _index_0 = 1, #prefixes do
     local p = prefixes[_index_0]
@@ -204,12 +195,7 @@ try_to_load = function(...)
           break
         end
       end
-      if pcall(function()
-        out = ffi.load(name)
-      end) then
-        return out
-      end
-      _continue_0 = true
+      return ffi.load(name)
     until true
     if not _continue_0 then
       break
@@ -217,17 +203,7 @@ try_to_load = function(...)
   end
   return error("Failed to load ImageMagick (" .. tostring(...) .. ")")
 end
-lib = try_to_load("MagickWand", function()
-  local lname = get_flags():match("-l(MagickWand[^%s]*)")
-  local suffix
-  if ffi.os == "OSX" then
-    suffix = ".dylib"
-  elseif ffi.os == "Windows" then
-    suffix = ".dll"
-  else
-    suffix = ".so"
-  end
-  return lname and "lib" .. lname .. suffix
+lib = try_to_load("@nix_wand@", function()
 end)
 return {
   lib = lib,