Warning, /graphics/krita/3rdparty/ext_mypaint/0001-Add-cmake-build-system.patch is written in an unsupported language. File is not indexed.
0001 From 62838fc9791a9fbe807b1cc4f90f802af91b39a5 Mon Sep 17 00:00:00 2001 0002 From: Boudewijn Rempt <boud@valdyas.org> 0003 Date: Tue, 17 Nov 2020 12:47:55 +0100 0004 Subject: [PATCH 1/5] Add cmake build system 0005 0006 --- 0007 CMakeLists.txt | 64 ++++++++++++++++++++++++++++++++++++++++++++++++ 0008 FindJsonC.cmake | 31 +++++++++++++++++++++++ 0009 config.h | 4 +-- 0010 mypaint-brush-settings.c | 12 ++++----- 0011 4 files changed, 103 insertions(+), 8 deletions(-) 0012 create mode 100644 CMakeLists.txt 0013 create mode 100644 FindJsonC.cmake 0014 0015 diff --git a/CMakeLists.txt b/CMakeLists.txt 0016 new file mode 100644 0017 index 0000000..d93309d 0018 --- /dev/null 0019 +++ b/CMakeLists.txt 0020 @@ -0,0 +1,64 @@ 0021 +cmake_minimum_required(VERSION 3.0.0 FATAL_ERROR) 0022 + 0023 +set (project libmypaint) 0024 + 0025 +LIST (APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}") 0026 + 0027 +find_package(ECM 5.22 REQUIRED NOMODULE) 0028 +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) 0029 +include(CMakePackageConfigHelpers) 0030 + 0031 +find_package(JsonC) 0032 + 0033 +include_directories(SYSTEM ${JSONC_INCLUDE_DIRS}) 0034 + 0035 +set(mypaint_SOURCES 0036 + ${CMAKE_CURRENT_SOURCE_DIR}/mypaint.c 0037 + ${CMAKE_CURRENT_SOURCE_DIR}/mypaint-brush-settings.c 0038 + ${CMAKE_CURRENT_SOURCE_DIR}/mypaint-symmetry.c 0039 + ${CMAKE_CURRENT_SOURCE_DIR}/fifo.c 0040 + ${CMAKE_CURRENT_SOURCE_DIR}/helpers.c 0041 + ${CMAKE_CURRENT_SOURCE_DIR}/tilemap.c 0042 + ${CMAKE_CURRENT_SOURCE_DIR}/operationqueue.c 0043 + ${CMAKE_CURRENT_SOURCE_DIR}/mypaint-rectangle.c 0044 + ${CMAKE_CURRENT_SOURCE_DIR}/mypaint-fixed-tiled-surface.c 0045 + ${CMAKE_CURRENT_SOURCE_DIR}/mypaint-mapping.c 0046 + ${CMAKE_CURRENT_SOURCE_DIR}/rng-double.c 0047 + ${CMAKE_CURRENT_SOURCE_DIR}/mypaint-brush.c 0048 + ${CMAKE_CURRENT_SOURCE_DIR}/mypaint-surface.c 0049 + ${CMAKE_CURRENT_SOURCE_DIR}/brushmodes.c 0050 + ${CMAKE_CURRENT_SOURCE_DIR}/mypaint-matrix.c 0051 + ${CMAKE_CURRENT_SOURCE_DIR}/mypaint-tiled-surface.c 0052 +) 0053 + 0054 +set(mypaint_HEADERS 0055 + ${CMAKE_CURRENT_SOURCE_DIR}/mypaint-brush.h 0056 + ${CMAKE_CURRENT_SOURCE_DIR}/tiled-surface-private.h 0057 + ${CMAKE_CURRENT_SOURCE_DIR}/mypaint.h 0058 + ${CMAKE_CURRENT_SOURCE_DIR}/fifo.h 0059 + ${CMAKE_CURRENT_SOURCE_DIR}/rng-double.h 0060 + ${CMAKE_CURRENT_SOURCE_DIR}/mypaint-rectangle.h 0061 + ${CMAKE_CURRENT_SOURCE_DIR}/mypaint-config.h 0062 + ${CMAKE_CURRENT_SOURCE_DIR}/mypaint-tiled-surface.h 0063 + ${CMAKE_CURRENT_SOURCE_DIR}/config.h 0064 + ${CMAKE_CURRENT_SOURCE_DIR}/mypaint-mapping.h 0065 + ${CMAKE_CURRENT_SOURCE_DIR}/brushsettings-gen.h 0066 + ${CMAKE_CURRENT_SOURCE_DIR}/mypaint-symmetry.h 0067 + ${CMAKE_CURRENT_SOURCE_DIR}/tilemap.h 0068 + ${CMAKE_CURRENT_SOURCE_DIR}/operationqueue.h 0069 + ${CMAKE_CURRENT_SOURCE_DIR}/mypaint-matrix.h 0070 + ${CMAKE_CURRENT_SOURCE_DIR}/helpers.h 0071 + ${CMAKE_CURRENT_SOURCE_DIR}/mypaint-brush-settings-gen.h 0072 + ${CMAKE_CURRENT_SOURCE_DIR}/mypaint-glib-compat.h 0073 + ${CMAKE_CURRENT_SOURCE_DIR}/brushmodes.h 0074 + ${CMAKE_CURRENT_SOURCE_DIR}/mypaint-fixed-tiled-surface.h 0075 + ${CMAKE_CURRENT_SOURCE_DIR}/mypaint-brush-settings.h 0076 + ${CMAKE_CURRENT_SOURCE_DIR}/mypaint-surface.h 0077 +) 0078 + 0079 + 0080 +add_library(mypaint SHARED ${mypaint_SOURCES} ${mypaint_HEADERS}) 0081 +target_link_libraries(mypaint PRIVATE ${JSONC_LIBRARIES}) 0082 +set_property(TARGET mypaint PROPERTY C_STANDARD 11) 0083 +install(TARGETS mypaint RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) 0084 +install(FILES ${mypaint_HEADERS} DESTINATION include) 0085 diff --git a/FindJsonC.cmake b/FindJsonC.cmake 0086 new file mode 100644 0087 index 0000000..17464df 0088 --- /dev/null 0089 +++ b/FindJsonC.cmake 0090 @@ -0,0 +1,31 @@ 0091 +#For finding JsonC library in the system 0092 + 0093 + 0094 +find_path(LIBJSONC_INCLUDE_DIR 0095 + NAMES json_config.h 0096 + /usr/include 0097 + /usr/local/include 0098 + /sw/include 0099 + /opt/local/include 0100 + ${MYPAINT_PKGCONF_INCLUDE_DIRS} 0101 + ${MYPAINT_PKGCONF_INCLUDEDIR} 0102 + PATH_SUFFIXES json-c 0103 +) 0104 + 0105 +#message("XXXX" ${LIBJSONC_INCLUDE_DIR}) 0106 + 0107 +find_library(LIBJSONC_LIBRARY 0108 + NAMES libjson-c json-c 0109 + HINTS ${JSONC_PKGCONF_LIBRARY_DIRS} ${JSONC_PKGCONF_LIBDIR} 0110 + DOC "Libraries to link against for json support" 0111 +) 0112 + 0113 +#message("YYYY" ${LIBJSONC_LIBRARY}) 0114 + 0115 +string(REGEX MATCH "(.*)/libjson.so" LIBJSONC_LIBRARIES ${LIBJSONC_LIBRARY}) 0116 + 0117 +set(JSONC_LIBRARIES ${LIBJSONC_LIBRARY}) 0118 +set(JSONC_INCLUDE_DIRS ${LIBJSONC_INCLUDE_DIR}) 0119 +set(JSONC_FOUND ${JSONC_PKGCONF_FOUND}) 0120 +set(JSONC_VERSION ${JSONCl_PKGCONF_VERSION}) 0121 + 0122 diff --git a/config.h b/config.h 0123 index a44118b..c70f205 100644 0124 --- a/config.h 0125 +++ b/config.h 0126 @@ -17,7 +17,7 @@ 0127 #define HAVE_DLFCN_H 1 0128 0129 /* Define if the GNU gettext() function is already present or preinstalled. */ 0130 -#define HAVE_GETTEXT 1 0131 +#define HAVE_GETTEXT 0 0132 0133 /* Define to 1 if you have the <inttypes.h> header file. */ 0134 #define HAVE_INTTYPES_H 1 0135 @@ -56,7 +56,7 @@ 0136 #define LT_OBJDIR ".libs/" 0137 0138 /* Define to 1 if glib is used */ 0139 -#define MYPAINT_CONFIG_USE_GLIB 1 0140 +#define MYPAINT_CONFIG_USE_GLIB 0 0141 0142 /* Define to the address where bug reports for this package should be sent. */ 0143 #define PACKAGE_BUGREPORT "https://github.com/mypaint/libmypaint/issues" 0144 diff --git a/mypaint-brush-settings.c b/mypaint-brush-settings.c 0145 index b352cec..2e3b1fe 100644 0146 --- a/mypaint-brush-settings.c 0147 +++ b/mypaint-brush-settings.c 0148 @@ -21,15 +21,15 @@ 0149 #include <string.h> 0150 #include <assert.h> 0151 0152 -#ifdef HAVE_GETTEXT 0153 - #include <libintl.h> 0154 - #define N_(String) (String) 0155 - #define _(String) gettext (String) 0156 -#else 0157 +//#ifdef HAVE_GETTEXT 0158 +// #include <libintl.h> 0159 +// #define N_(String) (String) 0160 +// #define _(String) gettext (String) 0161 +//#else 0162 #define dgettext(Domain,String) (String) 0163 #define N_(String) (String) 0164 #define _(String) (String) 0165 -#endif // HAVE_GETTEXT 0166 +//#endif // HAVE_GETTEXT 0167 0168 #include <float.h> 0169 0170 -- 0171 2.13.2.windows.1 0172