From faadc334fd77bc965eb7be7c9034c4db5141b9f0 Mon Sep 17 00:00:00 2001 From: Bruno Date: Mon, 13 Apr 2026 23:03:54 -0300 Subject: [PATCH] [libmypaint] Add Windows support (#51147) --- ports/libmypaint/disable_tests.diff | 23 +++++++++++++++++++++ ports/libmypaint/fix_i18n.diff | 10 ++++++++++ ports/libmypaint/portfile.cmake | 5 +++++ ports/libmypaint/vcpkg.json | 3 +-- ports/libmypaint/win_math.patch | 31 +++++++++++++++++++++++++++++ versions/baseline.json | 2 +- versions/l-/libmypaint.json | 5 +++++ 7 files changed, 76 insertions(+), 3 deletions(-) create mode 100644 ports/libmypaint/disable_tests.diff create mode 100644 ports/libmypaint/fix_i18n.diff create mode 100644 ports/libmypaint/win_math.patch diff --git a/ports/libmypaint/disable_tests.diff b/ports/libmypaint/disable_tests.diff new file mode 100644 index 0000000000..289616e1b1 --- /dev/null +++ b/ports/libmypaint/disable_tests.diff @@ -0,0 +1,23 @@ +diff --git a/Makefile.am b/Makefile.am +index 144a5ac..7c0c2d9 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -154,5 +154,4 @@ SUBDIRS = \ + . \ + doc \ + gegl \ +- tests \ + $(PODIRS) +diff --git a/configure.ac b/configure.ac +index 86e586b..dfd69c0 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -313,8 +313,6 @@ AC_CONFIG_FILES([ + libmypaint.pc:libmypaint.pc.in + Makefile + po/Makefile.in +- tests/Makefile +- tests/gegl/Makefile + ]) + + AC_OUTPUT diff --git a/ports/libmypaint/fix_i18n.diff b/ports/libmypaint/fix_i18n.diff new file mode 100644 index 0000000000..f6c03527c2 --- /dev/null +++ b/ports/libmypaint/fix_i18n.diff @@ -0,0 +1,10 @@ +diff --git a/configure.ac b/configure.ac +index 86e586b..7a500f1 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1,3 +1,5 @@ ++m4_pattern_allow([AM_GLIB_GNU_GETTEXT]) ++ + # AC_OPENMP requires autoconf >= 2.62. + AC_PREREQ(2.62) + diff --git a/ports/libmypaint/portfile.cmake b/ports/libmypaint/portfile.cmake index 51b60271fb..9571ff5388 100644 --- a/ports/libmypaint/portfile.cmake +++ b/ports/libmypaint/portfile.cmake @@ -7,10 +7,15 @@ vcpkg_download_distfile(ARCHIVE vcpkg_extract_source_archive( SOURCE_PATH ARCHIVE "${ARCHIVE}" + PATCHES + fix_i18n.diff + win_math.patch + disable_tests.diff ) vcpkg_make_configure( SOURCE_PATH "${SOURCE_PATH}" + AUTORECONF OPTIONS --disable-i18n --disable-introspection diff --git a/ports/libmypaint/vcpkg.json b/ports/libmypaint/vcpkg.json index 692f6c8a97..27a2ea280e 100644 --- a/ports/libmypaint/vcpkg.json +++ b/ports/libmypaint/vcpkg.json @@ -1,11 +1,10 @@ { "name": "libmypaint", "version": "1.6.1", - "port-version": 2, + "port-version": 3, "description": "Brush library used by MyPaint", "homepage": "https://github.com/mypaint/libmypaint", "license": "ISC", - "supports": "!windows | mingw", "dependencies": [ "glib", "json-c", diff --git a/ports/libmypaint/win_math.patch b/ports/libmypaint/win_math.patch new file mode 100644 index 0000000000..5fbf01f6b9 --- /dev/null +++ b/ports/libmypaint/win_math.patch @@ -0,0 +1,31 @@ +From a5d28fb2d13fb9cd01fcba9f9a88aaa8ecca0e15 Mon Sep 17 00:00:00 2001 +From: Bruno Lopes +Date: Sun, 12 Apr 2026 21:04:24 -0300 +Subject: [PATCH] configure: Do not check for math library functions on Windows + +--- + configure.ac | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +diff --git a/configure.ac b/configure.ac +index b6e1e0603ef1351549851425a6386fb46d05f817..b10b1d7e2e1ac0fc8a2572372bb049d1e7d4666c 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -218,10 +218,13 @@ AC_SUBST(JSON_LIBS) + AC_SUBST(JSON_CFLAGS) + + ## Standard maths functions ## +-AC_SEARCH_LIBS([floorf], [m], [], AC_MSG_ERROR([no floorf])) +-AC_SEARCH_LIBS([powf], [m], [], AC_MSG_ERROR([no powf])) +-AC_SEARCH_LIBS([expf], [m], [], AC_MSG_ERROR([no expf])) +-AC_SEARCH_LIBS([fabsf], [m], [], AC_MSG_ERROR([no fabsf])) ++## On Windows, they are provided by the C library (msvcrt or ucrt) ## ++if test "x$platform_win32" != "xyes"; then ++ AC_SEARCH_LIBS([floorf], [m], [], AC_MSG_ERROR([no floorf])) ++ AC_SEARCH_LIBS([powf], [m], [], AC_MSG_ERROR([no powf])) ++ AC_SEARCH_LIBS([expf], [m], [], AC_MSG_ERROR([no expf])) ++ AC_SEARCH_LIBS([fabsf], [m], [], AC_MSG_ERROR([no fabsf])) ++fi + + ## Additional compile flags ## + diff --git a/versions/baseline.json b/versions/baseline.json index bc9fe09fa1..8936742878 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -5290,7 +5290,7 @@ }, "libmypaint": { "baseline": "1.6.1", - "port-version": 2 + "port-version": 3 }, "libmysofa": { "baseline": "1.3.4", diff --git a/versions/l-/libmypaint.json b/versions/l-/libmypaint.json index 1f707e3d2d..8b9f00a31a 100644 --- a/versions/l-/libmypaint.json +++ b/versions/l-/libmypaint.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "465ae952f699c62a05162a277b734bafd4073088", + "version": "1.6.1", + "port-version": 3 + }, { "git-tree": "0834136ddd7d0bbbc963915b18ef1cde2ef44093", "version": "1.6.1",