Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions ports/cairo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,13 @@ file(GLOB SOURCES
"cairo-ft-font.c"
)

# OSX
file(GLOB PLATFORM_SOURCES_OSX
"cairo-quartz-font.c"
"cairo-quartz-image-surface.c"
"cairo-quartz-surface.c"
)

# win32
file(GLOB PLATFORM_SOURCES_WIN32
"win32/cairo-win32-debug.c"
Expand All @@ -154,6 +161,10 @@ file(GLOB PLATFORM_SOURCES_WIN32
"win32/cairo-win32-font.c"
)

if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
list(APPEND SOURCES ${PLATFORM_SOURCES_OSX})
endif()

if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
list(APPEND SOURCES ${PLATFORM_SOURCES_WIN32})
endif()
Expand Down
4 changes: 2 additions & 2 deletions ports/cairo/CONTROL
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Source: cairo
Version: 1.16.0-2
Version: 1.16.0-3
Homepage: https://cairographics.org
Description: Cairo is a 2D graphics library with support for multiple output devices. Currently supported output targets include the X Window System (via both Xlib and XCB), Quartz, Win32, image buffers, PostScript, PDF, and SVG file output. Experimental backends include OpenGL, BeOS, OS/2, and DirectFB.
Build-Depends: zlib, libpng, pixman, glib, freetype, fontconfig

Feature: x11
Description: build with x11 support
Description: build with x11 support
35 changes: 15 additions & 20 deletions ports/cairo/cairo-features.h
Original file line number Diff line number Diff line change
@@ -1,38 +1,33 @@
#ifndef CAIRO_FEATURES_H
#define CAIRO_FEATURES_H
/* Chosen from the various possible defines in "../build/Makefile.win32.features.h""
guided by "../build/Makefile.win32.features". Modify at your own risk.
*/

/* Always for Win32 */
#ifdef _WIN32
#define CAIRO_HAS_WIN32_SURFACE 1
#define CAIRO_HAS_WIN32_FONT 1
#endif

/* Require libpng */
#define CAIRO_HAS_PNG_FUNCTIONS 1
#define CAIRO_HAS_PS_SURFACE 1
#define CAIRO_HAS_PDF_SURFACE 1

// Likely available
#define CAIRO_HAS_SCRIPT_SURFACE 1
#define CAIRO_HAS_SVG_SURFACE 1

/* Always available */
#define CAIRO_HAS_IMAGE_SURFACE 1
#define CAIRO_HAS_MIME_SURFACE 1
#define CAIRO_HAS_RECORDING_SURFACE 1
#define CAIRO_HAS_OBSERVER_SURFACE 1
#define CAIRO_HAS_USER_FONT 1

/* Require GObject */
#define CAIRO_HAS_GOBJECT_FUNCTIONS 1

/* Require FreeType */
#define CAIRO_HAS_FT_FONT 1

/* Require FontConfig */
#define CAIRO_HAS_FC_FONT 1

#ifdef _WIN32
#define CAIRO_HAS_WIN32_SURFACE 1
#define CAIRO_HAS_WIN32_FONT 1
#endif

#ifdef __APPLE__
#define CAIRO_HAS_QUARTZ_FONT 1
#define CAIRO_HAS_QUARTZ_SURFACE 1
#define CAIRO_HAS_QUARTZ_IMAGE_SURFACE 1
#define CAIRO_HAS_XCB_SHM_FUNCTIONS 1
#define CAIRO_HAS_XCB_SURFACE 1
#define CAIRO_HAS_XLIB_SURFACE 1
#define CAIRO_HAS_XLIB_XRENDER_SURFACE 1
#endif

#endif
12 changes: 9 additions & 3 deletions ports/cairo/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
include(vcpkg_common_functions)
set(CAIRO_VERSION 1.16.0)

vcpkg_download_distfile(ARCHIVE
Expand Down Expand Up @@ -41,16 +40,23 @@ vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-cairo TARGET_PATH share/u

# Copy the appropriate header files.
foreach(FILE
"${SOURCE_PATH}/cairo-version.h"
"${SOURCE_PATH}/util/cairo-gobject/cairo-gobject.h"
"${SOURCE_PATH}/src/cairo.h"
"${SOURCE_PATH}/src/cairo-deprecated.h"
"${SOURCE_PATH}/src/cairo-features.h"
"${SOURCE_PATH}/src/cairo-pdf.h"
"${SOURCE_PATH}/src/cairo-ps.h"
"${SOURCE_PATH}/src/cairo-script.h"
"${SOURCE_PATH}/src/cairo-svg.h"
"${SOURCE_PATH}/cairo-version.h"
"${SOURCE_PATH}/src/cairo-tee.h"
"${SOURCE_PATH}/src/cairo-xcb.h"
"${SOURCE_PATH}/src/cairo-xlib.h"
"${SOURCE_PATH}/src/cairo-xlib-xrender.h"
"${SOURCE_PATH}/src/cairo-xml.h"
"${SOURCE_PATH}/src/cairo-win32.h"
"${SOURCE_PATH}/util/cairo-gobject/cairo-gobject.h"
"${SOURCE_PATH}/src/cairo-quartz.h"
"${SOURCE_PATH}/src/cairo-quartz-image.h"
"${SOURCE_PATH}/src/cairo-ft.h")
file(COPY ${FILE} DESTINATION ${CURRENT_PACKAGES_DIR}/include)
file(COPY ${FILE} DESTINATION ${CURRENT_PACKAGES_DIR}/include/cairo)
Expand Down
6 changes: 5 additions & 1 deletion ports/fltk/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
Source: fltk
Version: 1.3.5-1
Version: 1.4-2
Homepage: https://www.fltk.org/
Description: FLTK (pronounced fulltick) is a cross-platform C++ GUI toolkit for UNIX/Linux (X11), Microsoft Windows, and MacOS X. FLTK provides modern GUI functionality without the bloat and supports 3D graphics via OpenGL and its built-in GLUT emulation.
Build-Depends: zlib, libpng, libjpeg-turbo

Feature: cairo
Description: build with cairo support
Build-Depends: cairo
6 changes: 3 additions & 3 deletions ports/fltk/add-link-libraries.patch
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
diff --git a/CMake/macros.cmake b/CMake/macros.cmake
index 4def62d..27b4901 100644
index e54d984..09e515f 100644
--- a/CMake/macros.cmake
+++ b/CMake/macros.cmake
@@ -67,6 +67,8 @@ macro(FL_ADD_LIBRARY LIBNAME LIBTYPE LIBFILES)
@@ -97,6 +97,8 @@ macro(FL_ADD_LIBRARY LIBNAME LIBTYPE LIBFILES)
COMPILE_DEFINITIONS "FL_DLL"
)
endif (${LIBTYPE} STREQUAL "SHARED")
+
+ target_link_libraries(${LIBRARY_NAME} gdi32 gdiplus user32 advapi32 ole32 shell32 comdlg32)
+ target_link_libraries(${LIBRARY_NAME} gdi32 gdiplus user32 advapi32 ole32 shell32 comdlg32)
endif (MSVC)

install(TARGETS ${LIBRARY_NAME}
60 changes: 60 additions & 0 deletions ports/fltk/find-lib-cairo.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
diff --git a/CMake/options.cmake b/CMake/options.cmake
index 3784314..ae0b48f 100644
--- a/CMake/options.cmake
+++ b/CMake/options.cmake
@@ -157,37 +157,33 @@ if(OPTION_BUILD_HTML_DOCUMENTATION OR OPTION_BUILD_PDF_DOCUMENTATION)
endif(OPTION_BUILD_HTML_DOCUMENTATION OR OPTION_BUILD_PDF_DOCUMENTATION)

#######################################################################
-include(FindPkgConfig)

option(OPTION_CAIRO "use lib Cairo" OFF)
option(OPTION_CAIROEXT
"use FLTK code instrumentation for Cairo extended use" OFF
)

-if ((OPTION_CAIRO OR OPTION_CAIROEXT) AND LIB_CAIRO)
- pkg_search_module(PKG_CAIRO cairo)
-endif ((OPTION_CAIRO OR OPTION_CAIROEXT) AND LIB_CAIRO)
-
-if (PKG_CAIRO_FOUND)
+if (OPTION_CAIRO OR OPTION_CAIROEXT)
+ # find_library(LIB_CAIRO cairo) in resources.cmake
+ if (NOT LIB_CAIRO)
+ message(STATUS "*** Cairo was requested but not found - please install Cairo ...")
+ message(STATUS "*** or disable options OPTION_CAIRO and OPTION_CAIRO_EXT")
+ message(FATAL_ERROR "*** Terminating: missing Cairo libs or headers")
+ endif (NOT LIB_CAIRO)
set (FLTK_HAVE_CAIRO 1)
add_subdirectory(cairo)
- list(APPEND FLTK_LDLIBS -lcairo -lpixman-1)
- include_directories(${PKG_CAIRO_INCLUDE_DIRS})
- string(REPLACE ";" " " CAIROFLAGS "${PKG_CAIRO_CFLAGS}")
-
+# list(APPEND FLTK_LDLIBS -lcairo -lpixman-1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you delete these three lines instead of commenting them out?

Thanks.

+# include_directories(${PKG_CAIRO_INCLUDE_DIRS})
+# string(REPLACE ";" " " CAIROFLAGS "${PKG_CAIRO_CFLAGS}")
if (LIB_CAIRO AND OPTION_CAIROEXT)
- set(FLTK_USE_CAIRO 1)
- set(FLTK_CAIRO_FOUND TRUE)
- else ()
- set(FLTK_CAIRO_FOUND FALSE)
- endif (LIB_CAIRO AND OPTION_CAIROEXT)
-else ()
- if (OPTION_CAIRO OR OPTION_CAIROEXT)
- message(STATUS "*** Cairo was requested but not found - please check your cairo installation")
- message(STATUS "*** or disable options OPTION_CAIRO and OPTION_CAIRO_EXT.")
- message(FATAL_ERROR "*** Terminating: missing Cairo libs or headers.")
- endif (OPTION_CAIRO OR OPTION_CAIROEXT)
-endif (PKG_CAIRO_FOUND)
+ set(FLTK_USE_CAIRO 1)
+ set(FLTK_CAIRO_FOUND TRUE)
+ else()
+ set(FLTK_CAIRO_FOUND FALSE)
+ endif()
+else()
+ set(FLTK_CAIRO_FOUND FALSE)
+endif (OPTION_CAIRO OR OPTION_CAIROEXT)

#######################################################################
option(OPTION_USE_NANOSVG "support SVG images" ON)
49 changes: 49 additions & 0 deletions ports/fltk/find-lib-png.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
diff --git a/CMake/resources.cmake b/CMake/resources.cmake
index 3676d3b..3e9cc1d 100644
--- a/CMake/resources.cmake
+++ b/CMake/resources.cmake
@@ -63,15 +63,25 @@ endmacro (fl_find_header)
fl_find_header (HAVE_ALSA_ASOUNDLIB_H alsa/asoundlib.h)
fl_find_header (HAVE_DLFCN_H dlfcn.h)
fl_find_header (HAVE_GL_GLU_H GL/glu.h)
-fl_find_header (HAVE_LIBPNG_PNG_H libpng/png.h)
+#fl_find_header (HAVE_LIBPNG_PNG_H libpng/png.h)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you delete these three lines instead of commenting them out?

Thanks.

fl_find_header (HAVE_LOCALE_H locale.h)
fl_find_header (HAVE_OPENGL_GLU_H OpenGL/glu.h)
-fl_find_header (HAVE_PNG_H png.h)
+#fl_find_header (HAVE_PNG_H png.h)
fl_find_header (HAVE_STDIO_H stdio.h)
fl_find_header (HAVE_STRINGS_H strings.h)
fl_find_header (HAVE_SYS_SELECT_H sys/select.h)
fl_find_header (HAVE_SYS_STDTYPES_H sys/stdtypes.h)

+find_package(PNG REQUIRED)
+if(PNG_FOUND)
+ set(LIB_png ${PNG_LIBRARIES})
+ set(HAVE_PNG_H ${PNG_FOUND})
+endif()
+find_package(ZLIB REQUIRED)
+if(ZLIB_FOUND)
+ set(LIB_zlib ${ZLIB_LIBRARIES})
+endif()
+
if (USE_FIND_FILE)
fl_find_header (HAVE_X11_XREGION_H "X11/Xregion.h")
fl_find_header (HAVE_XDBE_H "X11/extensions/Xdbe.h")
@@ -184,12 +194,13 @@ find_library(LIB_freetype freetype)
find_library(LIB_GL GL)
find_library(LIB_MesaGL MesaGL)
find_library(LIB_jpeg jpeg)
-find_library(LIB_png png)
-find_library(LIB_zlib z)
+#find_library(LIB_png png)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above.

+#find_library(LIB_zlib z)

mark_as_advanced(LIB_CAIRO LIB_dl LIB_fontconfig LIB_freetype)
mark_as_advanced(LIB_GL LIB_MesaGL)
-mark_as_advanced(LIB_jpeg LIB_png LIB_zlib)
+#mark_as_advanced(LIB_jpeg LIB_png LIB_zlib)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above.

+mark_as_advanced(LIB_jpeg)

#######################################################################
# functions
51 changes: 0 additions & 51 deletions ports/fltk/findlibsfix.patch

This file was deleted.

71 changes: 71 additions & 0 deletions ports/fltk/fluid-group-relative.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
diff --git a/fluid/Fl_Widget_Type.cxx b/fluid/Fl_Widget_Type.cxx
index 655aa72..0cf83ba 100644
--- a/fluid/Fl_Widget_Type.cxx
+++ b/fluid/Fl_Widget_Type.cxx
@@ -46,6 +46,8 @@ extern const char* i18n_include;
extern const char* i18n_function;
extern const char* i18n_file;
extern const char* i18n_set;
+extern int varused_test, varused;
+extern bool fl_curr_write_once;

int Fl_Widget_Type::default_size = FL_NORMAL_SIZE;

@@ -2093,8 +2095,6 @@ const char *Fl_Type::callback_name() {
return unique_id(this, "cb", name(), label());
}

-extern int varused_test, varused;
-
void Fl_Widget_Type::write_code1() {
const char* t = subclassname(this);
const char *c = array_name(this);
@@ -2153,6 +2153,16 @@ void Fl_Widget_Type::write_code1() {
}
}

+ if(fl_curr_write_once) {
+ write_c("%s#ifndef fl_curr_x\n", indent());
+ write_c("%s#define fl_curr_x() 0\n", indent());
+ write_c("%s#endif\n", indent());
+ write_c("%s#ifndef fl_curr_y\n", indent());
+ write_c("%s#define fl_curr_y() 0\n", indent());
+ write_c("%s#endif\n", indent());
+ fl_curr_write_once = false;
+ }
+
write_c("%s{ ", indent());
write_comment_inline_c();
if (varused) write_c("%s* o = ", t);
@@ -2163,9 +2173,9 @@ void Fl_Widget_Type::write_code1() {
if (!strstr(t, "Window"))
write_c("new %s(0, 0, %d, %d", t, o->w(), o->h());
else
- write_c("new %s(%d, %d", t, o->w(), o->h());
+ write_c("new %s(fl_curr_x()+%d, fl_curr_y()+%d", t, o->w(), o->h());
} else {
- write_c("new %s(%d, %d, %d, %d", t, o->x(), o->y(), o->w(), o->h());
+ write_c("new %s(fl_curr_x()+%d, fl_curr_y()+%d, %d, %d", t, o->x(), o->y(), o->w(), o->h());
}
if (label() && *label()) {
write_c(", ");
diff --git a/fluid/code.cxx b/fluid/code.cxx
index 50e5d70..8dd1f82 100644
--- a/fluid/code.cxx
+++ b/fluid/code.cxx
@@ -149,6 +149,7 @@ int write_declare(const char *format, ...) {
// anything, but set a variable if it looks like the variable "o" is used:
int varused_test;
int varused;
+bool fl_curr_write_once;

// write an array of C characters (adds a null):
void write_cstring(const char *s, int length) {
@@ -364,6 +365,7 @@ int write_code(const char *s, const char *t) {
indentation = 0;
current_class = 0L;
current_widget_class = 0L;
+ fl_curr_write_once = true;
if (!s) code_file = stdout;
else {
FILE *f = fl_fopen(s, filemode);
Loading