parent
d93848fac8
commit
7d88956cc7
6 changed files with 167 additions and 4 deletions
@ -0,0 +1,51 @@ |
||||
diff --git a/DevIL/src-IL/src/il_jp2.cpp b/DevIL/src-IL/src/il_jp2.cpp
|
||||
--- a/DevIL/src-IL/src/il_jp2.cpp
|
||||
+++ b/DevIL/src-IL/src/il_jp2.cpp
|
||||
@@ -313,20 +313,31 @@ ILboolean iLoadJp2Internal(jas_stream_t *Stream, ILimage *Image)
|
||||
}
|
||||
|
||||
|
||||
-
|
||||
-static int iJp2_file_read(jas_stream_obj_t *obj, char *buf, int cnt)
|
||||
+#ifdef __APPLE__
|
||||
+static int iJp2_file_read(void *obj, char *buf, unsigned int cnt)
|
||||
+#else
|
||||
+static int iJp2_file_read(jas_stream_obj_t *obj, char *buf, unsigned int cnt)
|
||||
+#endif
|
||||
{
|
||||
obj;
|
||||
- return iread(buf, 1, cnt);
|
||||
+ return iread((void*)buf, 1, cnt);
|
||||
}
|
||||
|
||||
-static int iJp2_file_write(jas_stream_obj_t *obj, char *buf, int cnt)
|
||||
+#ifdef __APPLE__
|
||||
+static int iJp2_file_write(void *obj, const char *buf, unsigned int cnt)
|
||||
+#else
|
||||
+static int iJp2_file_write(jas_stream_obj_t *obj, const char *buf, unsigned int cnt)
|
||||
+#endif
|
||||
{
|
||||
obj;
|
||||
return iwrite(buf, 1, cnt);
|
||||
}
|
||||
|
||||
+#ifdef __APPLE__
|
||||
static long iJp2_file_seek(jas_stream_obj_t *obj, long offset, int origin)
|
||||
+#else
|
||||
+static long iJp2_file_seek(void *obj, long offset, int origin)
|
||||
+#endif
|
||||
{
|
||||
obj;
|
||||
|
||||
@@ -343,7 +354,11 @@ static long iJp2_file_seek(jas_stream_obj_t *obj, long offset, int origin)
|
||||
return 0; // Failed
|
||||
}
|
||||
|
||||
+#ifdef __APPLE__
|
||||
+static int iJp2_file_close(void *obj)
|
||||
+#else
|
||||
static int iJp2_file_close(jas_stream_obj_t *obj)
|
||||
+#endif
|
||||
{
|
||||
obj;
|
||||
return 0; // We choose when we want to close the file.
|
@ -0,0 +1,24 @@ |
||||
diff --git a/DevIL/src-ILU/CMakeLists.txt b/DevIL/src-ILU/CMakeLists.txt
|
||||
--- a/DevIL/src-ILU/CMakeLists.txt
|
||||
+++ b/DevIL/src-ILU/CMakeLists.txt
|
||||
@@ -43,7 +43,7 @@ source_group("Header Files" FILES ${ILU_INC} )
|
||||
source_group("Resource Files" FILES ${ILU_RSRC} )
|
||||
|
||||
# Remove SHARED to create a static library
|
||||
-add_library(ILU SHARED ${ILU_SRCS} ${ILU_INC} ${ILU_RSRC})
|
||||
+add_library(ILU ${ILU_SRCS} ${ILU_INC} ${ILU_RSRC})
|
||||
|
||||
|
||||
## ILU requires IL
|
||||
diff --git a/DevIL/src-ILUT/CMakeLists.txt b/DevIL/src-ILUT/CMakeLists.txt
|
||||
--- a/DevIL/src-ILUT/CMakeLists.txt
|
||||
+++ b/DevIL/src-ILUT/CMakeLists.txt
|
||||
@@ -43,7 +43,7 @@ source_group("Header Files" FILES ${ILUT_INC} )
|
||||
source_group("Resource Files" FILES ${ILUT_RSRC} )
|
||||
|
||||
# Remove SHARED to create a static library
|
||||
-add_library(ILUT SHARED ${ILUT_SRCS} ${ILUT_INC} ${ILUT_RSRC})
|
||||
+add_library(ILUT ${ILUT_SRCS} ${ILUT_INC} ${ILUT_RSRC})
|
||||
|
||||
## add link sub library info
|
||||
target_link_libraries(ILUT
|
@ -0,0 +1,51 @@ |
||||
package("devil") |
||||
|
||||
set_homepage("https://sourceforge.net/projects/openil/") |
||||
set_description("Developer's Image Library (DevIL) is a cross-platform image library utilizing a simple syntax to load, save, convert, manipulate, filter and display a variety of images with ease.") |
||||
set_license("LGPL-2.1") |
||||
|
||||
add_urls("https://sourceforge.net/projects/openil/files/DevIL/$(version)/DevIL-$(version).zip") |
||||
add_versions("1.8.0", "451337f392c65bfb83698a781370534dc63d7bafca21e9b37178df0518f7e895") |
||||
|
||||
add_patches("1.8.0", path.join(os.scriptdir(), "patches", "1.8.0", "jp2.patch"), "cbee7e2a42b1a687fe7a2e6397611088fc2c16f897076e39db4a2be87fba5c51") |
||||
add_patches("1.8.0", path.join(os.scriptdir(), "patches", "1.8.0", "static.patch"), "28a4fc42e9cc735a3291d87a1cb818ea9ed07f27afa2b52353d5a1d15fc8a6f5") |
||||
|
||||
add_deps("cmake") |
||||
local configdepopts = {png = {"libpng", "PNG"}, |
||||
tiff = {"libtiff", "TIFF"}, |
||||
jpeg = {"libjpeg-turbo", "JPEG"}, |
||||
jasper = {"jasper", "Jasper"}, |
||||
squish = {"libsquish", "libSquish"}, |
||||
openexr = {"openexr", "OpenEXR"}, |
||||
lcms = {"lcms", "LCMS2"}, |
||||
mng = {"libmng", "MNG"}} |
||||
for config, depopt in pairs(configdepopts) do |
||||
add_configs(config, {description = "Build with " .. depopt[2] .. " support.", default = true, type = "boolean"}) |
||||
end |
||||
|
||||
on_load("windows", "macosx", "linux", function (package) |
||||
if package:is_plat("windows") and not package:config("shared") then |
||||
package:add("defines", "IL_STATIC_LIB") |
||||
end |
||||
for config, depopt in pairs(configdepopts) do |
||||
if package:config(config) then |
||||
package:add("deps", depopt[1]) |
||||
end |
||||
end |
||||
end) |
||||
|
||||
on_install("windows", "macosx", "linux", function (package) |
||||
os.cd("DevIL") |
||||
local configs = {"-DIL_USE_DXTC_NVIDIA=OFF"} |
||||
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) |
||||
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) |
||||
for config, depopt in pairs(configdepopts) do |
||||
table.insert(configs, "-DCMAKE_DISABLE_FIND_PACKAGE_" .. depopt[2] .. "=" .. (package:config(config) and "OFF" or "ON")) |
||||
end |
||||
import("package.tools.cmake").install(package, configs) |
||||
print(os.files(package:installdir("**"))) |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
assert(package:has_cfuncs("ilInit", {includes = "IL/il.h"})) |
||||
end) |
@ -0,0 +1,29 @@ |
||||
package("libmng") |
||||
|
||||
set_homepage("https://libmng.com/") |
||||
set_description("libmng - The reference library for reading, displaying, writing and examining Multiple-Image Network Graphics.") |
||||
|
||||
add_urls("https://sourceforge.net/projects/libmng/files/libmng-devel/$(version)/libmng-$(version).tar.gz") |
||||
add_versions("2.0.3", "cf112a1fb02f5b1c0fce5cab11ea8243852c139e669c44014125874b14b7dfaa") |
||||
|
||||
add_deps("cmake") |
||||
add_deps("zlib", "libjpeg-turbo", "lcms 2.x") |
||||
on_load("windows", function (package) |
||||
if package:config("shared") then |
||||
package:add("defines", "MNG_USE_DLL") |
||||
end |
||||
package:add("defines", "WIN32") |
||||
end) |
||||
|
||||
on_install("windows", "macosx", "linux", function (package) |
||||
os.rm("config.h") |
||||
local configs = {"-DMNG_INSTALL_LIB_DIR=lib"} |
||||
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) |
||||
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) |
||||
table.insert(configs, "-DBUILD_STATIC_LIBS=" .. (package:config("shared") and "OFF" or "ON")) |
||||
import("package.tools.cmake").install(package, configs) |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
assert(package:has_cfuncs("mng_initialize", {includes = "libmng.h"})) |
||||
end) |
Loading…
Reference in new issue