Port GIMP

This commit is contained in:
Wildan M 2026-10-08 10:24:17 +02:00
parent ec2ec281d8
commit 4a1d58323a
No known key found for this signature in database
GPG Key ID: 01AC53185C679C79
27 changed files with 936 additions and 55 deletions

View File

@ -3,4 +3,14 @@ tar = "https://libarchive.org/downloads/libarchive-3.8.7.tar.xz"
blake3 = "6b7f744132368a53ecf98a4586af09c255f81cebf37687edd857528a1bfd3bd3"
[build]
template = "configure"
template = "cmake"
cmakeflags = [
"-DENABLE_TEST=OFF"
]
dependencies = [
"openssl3",
"libxml2",
"bzip2",
"zlib",
"zstd",
]

View File

@ -11,5 +11,5 @@ configureflags = [
[package]
dependencies = [
"sed",
"uutils-sed",
]

View File

@ -30,9 +30,6 @@ DYNAMIC_INIT
# Netsurf does not currently support out-of-tree builds :(
rsync -av --delete "${COOKBOOK_SOURCE}/" ./
# obscure crash from sccache if jobs number is too much
COOKBOOK_MAKE_JOBS="$(( ${COOKBOOK_MAKE_JOBS} > 8 ? 8 : ${COOKBOOK_MAKE_JOBS} ))"
export TARGET="framebuffer"
export CFLAGS="-I${PWD}/inst-${TARGET}/include"
export LDFLAGS="${LDFLAGS} -L${COOKBOOK_SYSROOT}/lib -L${PWD}/inst-${TARGET}/lib -Wl,--allow-multiple-definition -Wl,-rpath-link,${COOKBOOK_SYSROOT}/lib"

View File

@ -2,4 +2,4 @@
[source]
tar = "https://poppler.freedesktop.org/poppler-data-0.4.12.tar.gz"
[build]
template = "custom"
template = "cmake"

View File

@ -7,6 +7,7 @@ template = "custom"
script = """
mkdir -pv "${COOKBOOK_STAGE}"/usr/share/fonts/Noto
for f in "${COOKBOOK_SOURCE}"/fonts/*; do
echo cp -rv "${f}/full/ttf/* "${COOKBOOK_STAGE}/usr/share/fonts/Noto/$(basename ${f})/"
mkdir "${COOKBOOK_STAGE}/usr/share/fonts/Noto/$(basename ${f})/"
cp -rv "${f}/googlefonts/ttf"/* "${COOKBOOK_STAGE}/usr/share/fonts/Noto/$(basename ${f})/" || true
done
"""

View File

@ -1,36 +1,40 @@
#TODO not compiled or tested
#TODO discover minimum dependencies from meson log
#TODO compiled but not tested
# build instructions: https://developer.gimp.org/core/setup/build/3.0/INSTALL
# all build options: https://gitlab.gnome.org/GNOME/gimp/-/blob/master/meson_options.txt?ref_type=heads
[source]
tar = "https://download.gimp.org/gimp/v3.2/gimp-3.2.4.tar.xz"
[build]
template = "meson"
mesonflags = [
"-Dcheck-update=no",
"-Dlibbacktrace=false",
"-Dlibunwind=false",
"-Dprint=false",
template = "custom"
script = """
DYNAMIC_INIT
rsync -a -v ${COOKBOOK_SYSROOT}/usr/share/pkgconfig/*.pc ${COOKBOOK_SYSROOT}/lib/pkgconfig/
COOKBOOK_MESON_FLAGS+=(
-Denable-default-bin=enabled
-Denable-console-bin=true
-Dcheck-update=no
-Dlibbacktrace=false
-Dlibunwind=false
-Dprint=false
-Dshmem-type=posix
)
cookbook_meson
"""
dependencies = [
"appstream",
"atk",
"babl",
"gtk3",
"gegl",
"gexiv2",
"libarchive",
"liblcms",
"libmypaint",
"librsvg",
"mypaint-brushes",
"libpoppler",
"poppler-data",
"shared-mime-info",
]
dev-dependencies = [
"host:libxml2"
]
# dependencies = [
# "gtk3",
# "gobject-introspection",
# "glib",
# "cairo",
# "pango",
# "liblcms",
# "libmypaint",
# "gexiv2",
# "gegl",
# "babl",
# "librsvg",
# "libtiff",
# "libjpeg",
# "libpng",
# "fontconfig",
# "freetype2",
# "atk",
# "harfbuzz",
# "bzip2",
# "zlib",
# ]

View File

@ -0,0 +1,472 @@
diff -ruwN source/app/widgets/gimpdashboard.c source-new/app/widgets/gimpdashboard.c
--- source/app/widgets/gimpdashboard.c 2026-04-17 08:37:38.000000000 +0000
+++ source-new/app/widgets/gimpdashboard.c 2026-10-08 08:12:01.951143761 +0000
@@ -2243,7 +2243,7 @@
clock_t curr_usage;
struct tms tms;
- curr_clock = times (&tms);
+ curr_clock = (clock_t) -1;//times (&tms);
if (curr_clock == (clock_t) -1)
{
diff -ruwN source/desktop/meson.build source-new/desktop/meson.build
--- source/desktop/meson.build 2026-04-17 08:37:38.000000000 +0000
+++ source-new/desktop/meson.build 2026-10-08 06:34:47.957042051 +0000
@@ -5,7 +5,7 @@
desktop_conf.set('GIMP_VERSION', gimp_version)
desktop_conf.set('GIMP_APP_VERSION', gimp_app_version)
desktop_conf.set('GIMP_DESKTOP_NAME', gimp_desktop_name)
-desktop_conf.set('MIME_TYPES', 'image/x-xcf;' + MIMEtypes_dep.get_variable('MIMEtypes'))
+desktop_conf.set('MIME_TYPES', 'image/x-xcf;')
desktop_conf.set('BUG_REPORT_URL', bug_report_url)
desktopfilein = configure_file(
diff -ruwN source/gimp-data/meson.build source-new/gimp-data/meson.build
--- source/gimp-data/meson.build 2026-04-07 19:54:05.000000000 +0000
+++ source-new/gimp-data/meson.build 2026-10-08 06:34:28.962938109 +0000
@@ -1,9 +1,5 @@
## Tools ##
-native_glib_minver = '2.2.0'
-native_glib = dependency('glib-2.0', version: '>='+native_glib_minver, native: true)
-native_rsvg = dependency('librsvg-2.0', version: '>='+rsvg_minver, native: true)
-
subdir('tools')
## Data ##
diff -ruwN source/gimp-data/tools/colorsvg2png.c source-new/gimp-data/tools/colorsvg2png.c
--- source/gimp-data/tools/colorsvg2png.c 2026-04-07 19:54:05.000000000 +0000
+++ source-new/gimp-data/tools/colorsvg2png.c 2026-10-08 06:34:20.069421216 +0000
@@ -15,80 +15,52 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-#include <glib/gprintf.h>
-#include <librsvg/rsvg.h>
+#include <stdio.h>
+#include <stdlib.h>
+// Stubbed to avoid compiling native glib/librsvg
int
main (int argc, char **argv)
{
- GError *error = NULL;
- RsvgHandle *handle;
- cairo_surface_t *surface;
- cairo_t *cr;
-#if LIBRSVG_CHECK_VERSION(2, 46, 0)
- RsvgRectangle target_rect;
-#endif
-
- gchar *input;
- gchar *output;
- gint dim;
- gint retval = 0;
+ FILE *in_file;
+ FILE *out_file;
+ size_t bytes_read;
+ char buffer[8192];
if (argc != 4)
{
- g_fprintf (stderr, "Usage: colorsvg2png svg-image png-output size\n");
+ fprintf (stderr, "Usage: colorsvg2png svg-image png-output size\n");
return 1;
}
- input = argv[1];
- output = argv[2];
- dim = (gint) g_ascii_strtoull (argv[3], NULL, 10);
- if (dim < 1)
+ in_file = fopen (argv[1], "rb");
+ if (!in_file)
{
- g_fprintf (stderr, "Usage: invalid dimension %d\n", dim);
+ fprintf (stderr, "Error: failed to open input file '%s'\n", argv[1]);
return 1;
}
- handle = rsvg_handle_new_from_file (input, &error);
- if (! handle)
+ out_file = fopen (argv[2], "wb");
+ if (!out_file)
{
- g_fprintf (stderr,
- "Error: failed to load '%s' as SVG: %s\n",
- input, error->message);
- g_error_free (error);
+ fprintf (stderr, "Error: failed to open output file '%s'\n", argv[2]);
+ fclose (in_file);
return 1;
}
- surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, dim, dim);
- cr = cairo_create (surface);
-
-#if LIBRSVG_CHECK_VERSION(2, 46, 0)
- target_rect.x = target_rect.y = 0;
- target_rect.width = target_rect.height = dim;
-
- if (! rsvg_handle_render_document (handle, cr, &target_rect, NULL))
-#else
- if (! rsvg_handle_render_cairo (handle, cr))
-#endif
+ while ((bytes_read = fread (buffer, 1, sizeof(buffer), in_file)) > 0)
{
- g_fprintf (stderr,
- "Error: failed to render '%s'\n",
- input);
- retval = 1;
- }
-
- if (retval == 0 &&
- cairo_surface_write_to_png (surface, output) != CAIRO_STATUS_SUCCESS)
+ if (fwrite (buffer, 1, bytes_read, out_file) != bytes_read)
{
- g_fprintf (stderr,
- "Error: failed to write '%s'\n",
- output);
- retval = 1;
+ fprintf (stderr, "Error: failed to write to '%s'\n", argv[2]);
+ fclose (in_file);
+ fclose (out_file);
+ return 1;
+ }
}
- cairo_surface_destroy (surface);
- cairo_destroy (cr);
- g_object_unref (handle);
+ fclose (in_file);
+ fclose (out_file);
- return retval;
+ return 0;
}
diff -ruwN source/gimp-data/tools/meson.build source-new/gimp-data/tools/meson.build
--- source/gimp-data/tools/meson.build 2026-04-07 19:54:05.000000000 +0000
+++ source-new/gimp-data/tools/meson.build 2026-10-08 06:34:25.152716659 +0000
@@ -2,8 +2,6 @@
'colorsvg2png.c',
native: true,
dependencies: [
- native_glib,
- native_rsvg
],
# In case b_sanitize was set, we don't really care if the tool has issues (in
# particular we experienced some memory leaks with b_sanitize=address, within
diff -ruwN source/libgimp/gimpplugin.c source-new/libgimp/gimpplugin.c
--- source/libgimp/gimpplugin.c 2026-04-17 08:37:38.000000000 +0000
+++ source-new/libgimp/gimpplugin.c 2026-10-08 07:14:34.086664710 +0000
@@ -24,6 +24,7 @@
#include <errno.h>
#include <libintl.h>
#include <string.h>
+#include <sys/select.h>
#include "gimp.h"
diff -ruwN source/libgimp/meson.build source-new/libgimp/meson.build
--- source/libgimp/meson.build 2026-04-17 08:37:38.000000000 +0000
+++ source-new/libgimp/meson.build 2026-10-08 08:06:39.354346391 +0000
@@ -637,40 +637,3 @@
)
endif
endif
-
-if not platform_osx and host_cpu_family != 'x86'
- nm = find_program('nm', required: false)
-
- # Verify .def files for Windows linking.
- # We check this on non-Windows platform (Debian) on CI, and on Windows itself.
- custom_target('check-def-files',
- input: [
- '../libgimpbase/gimpbase.def',
- '../libgimpcolor/gimpcolor.def',
- '../libgimpconfig/gimpconfig.def',
- '../libgimp/gimp.def',
- '../libgimp/gimpui.def',
- '../libgimpmath/gimpmath.def',
- '../libgimpmodule/gimpmodule.def',
- '../libgimpthumb/gimpthumb.def',
- '../libgimpwidgets/gimpwidgets.def',
- ],
- depends: [
- libgimpbase,
- libgimpcolor,
- libgimpconfig,
- libgimp,
- libgimpui,
- libgimpmath,
- libgimpmodule,
- libgimpthumb,
- libgimpwidgets
- ],
- env: nm.found() ? { 'NM': nm.full_path() } : {},
- output: [ 'check-def-files', ],
- command: [
- python, meson.project_source_root() / 'tools' / 'defcheck.py', meson.project_source_root(),
- ],
- build_by_default: true,
- )
-endif
diff -ruwN source/libgimpbase/meson.build source-new/libgimpbase/meson.build
--- source/libgimpbase/meson.build 2026-04-17 08:37:38.000000000 +0000
+++ source-new/libgimpbase/meson.build 2026-10-08 06:37:40.002041333 +0000
@@ -135,20 +135,3 @@
libgimpbase_headers,
subdir: gimp_api_name / 'libgimpbase',
)
-
-# Test program, not installed
-executable('test-cpu-accel',
- 'test-cpu-accel.c',
- include_directories: rootInclude,
- dependencies: [
- glib,
- ],
- c_args: [
- '-DG_LOG_DOMAIN="LibGimpBase"',
- '-DGIMP_BASE_COMPILATION',
- ],
- link_with: [
- libgimpbase,
- ],
- install: false,
-)
diff -ruwN source/meson.build source-new/meson.build
--- source/meson.build 2026-04-17 08:37:38.000000000 +0000
+++ source-new/meson.build 2026-10-08 07:11:16.124158097 +0000
@@ -486,8 +486,6 @@
# minimum requirement.
add_project_arguments('-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_76', language: 'c')
-gi = dependency('gobject-introspection-1.0')
-
gobject = dependency('gobject-2.0', version: '>='+glib_minver)
gmodule = dependency('gmodule-no-export-2.0')
@@ -573,38 +571,6 @@
pangoft2 = dependency('pangoft2', version: '>='+pango_minver)
endif
-if cc.run('''
- #include <pango/pango.h>
- #include <string.h>
- #include <stdlib.h>
-
- int main () {
- const char *text = "ภาษาไทย";
- int char_count = 7;
- int byte_len = strlen(text);
- int breaks_found = 0;
-
- PangoLogAttr *attrs = (PangoLogAttr *) calloc(char_count + 1, sizeof(PangoLogAttr));
-
- pango_get_log_attrs (text, byte_len, -1, pango_language_from_string("th"), attrs, char_count + 1);
- for (int i = 1; i < char_count; i++) {
- if (attrs[i].is_line_break)
- breaks_found++;
- }
-
- if (breaks_found > 0)
- return 0;
- else
- return 1;
- }
- ''',
- name: 'pango is built with libthai support',
- dependencies: [pango]).returncode() != 0
- thai_warning = 'Pango was not built with libthai support. Line breaking on Text tool may be incorrect on Thai language.'
- warning(thai_warning)
- warnings += thai_warning
-endif
-
conf.set('PANGO_DISABLE_DEPRECATED',pangocairo.version().version_compare('<1.43'))
# Check if Pango is built with a recent fontconfig
@@ -801,7 +767,7 @@
################################################################################
# Check for x11 support
-x11_target = gtk3.get_variable(pkgconfig: 'targets').contains('x11')
+x11_target = false
x11 = x11_target ? dependency('x11') : no_dep
xmu = x11_target ? dependency('xmu') : no_dep
@@ -1200,45 +1166,7 @@
py_candidates += ['python3.' + i.to_string()]
endforeach
-python = disabler()
-pygobject_found = ''
-pygobject_gexiv2_found = false
-foreach py : py_candidates
- #Check if PyGobject installation have pycairo (#13105)
- python_tmp = pythonmod.find_installation(py, modules: ['gi', 'cairo'], required: false)
- if python_tmp.found() and python_tmp.language_version().version_compare(python3_minver)
- python = python_tmp
- #Check if PyGObject installation have minimum version
- pygobject_found = run_command(python_tmp, '-c',
- '\n'.join([
- '''import gi''',
- '''print(".".join(map(str, gi.version_info)))''']),
- check: false)
- #Check if PyGObject installation have gexiv2 (#15179)
- #(This is specially important on MacPorts where gexiv2 have many python variants)
- pygobject_gexiv2_found = run_command(python_tmp, '-c',
- '\n'.join([
- '''import sys, gi''',
- '''try:''',
- ''' import gi.repository.GExiv2''',
- '''except (ImportError):''',
- ''' sys.exit(1)''']),
- check: false).returncode() == 0
- if pygobject_found.returncode() == 0 and pygobject_found.stdout().strip().version_compare(pygobject_minver) and pygobject_gexiv2_found
- break
- endif
- endif
-endforeach
-
-if not python.found() or not python.language_version().version_compare(python3_minver)
- error('No suitable Python installation (with cairo and gi modules) found. Minimum supported version: @0@'.format(python3_minver))
-endif
-message('Found Python @0@'.format(python.language_version()))
-
-if pygobject_found.returncode() != 0 or not pygobject_found.stdout().strip().version_compare(pygobject_minver) or not pygobject_gexiv2_found
- error('No suitable PyGObject (with GExiv2 submodule) found. Minimum supported version: @0@'.format(pygobject_minver))
-endif
-message('Found PyGObject: @0@'.format(pygobject_found.stdout().strip()))
+python = pythonmod.find_installation('python3')
## Javascript
@@ -1756,49 +1684,7 @@
).returncode() == 0
generate_version_h = is_git_repository or not has_version_h
-if generate_version_h
- gitversion_h1 = vcs_tag(
- input : 'app/git-version.h.in',
- output: 'git-version.h.in.1',
- command: [ 'git', 'describe', '--always', ],
- replace_string: '@GIMP_GIT_VERSION@',
- fallback: 'unknown (unsupported)',
- )
- gitversion_h2 = vcs_tag(
- input : gitversion_h1,
- output: 'git-version.h.in.2',
- command: [ 'git', 'rev-parse', '--short', 'HEAD', ],
- replace_string: '@GIMP_GIT_VERSION_ABBREV@',
- fallback: 'unknown (unsupported)',
- )
- gitversion_h = vcs_tag(
- input : gitversion_h2,
- output: 'git-version.h',
- command: [ 'git', 'log', '-n1', '--date=format:%Y', '--pretty=%cd', ],
- replace_string: '@GIMP_GIT_LAST_COMMIT_YEAR@',
- fallback: 'unknown (unsupported)',
- )
-
- git = find_program('git', required: false)
- if not is_git_repository or not git.found()
- # We create git-version.h but know it will be useless because we are
- # not in a git repository. Output a warning.
- git_warning = '''
-
- UNSUPPORTED BUILD!
-
- This is not a distribution tarball (git-version.h missing) and
- we could not establish the corresponding commit (either this is
- not a git repository or git command is missing). Therefore
- we have no reference for debugging.
- Please either use release tarballs or build from the repository.
- '''
- warning(git_warning)
- warnings += git_warning
- endif
-else
gitversion_h = files('git-version.h')
-endif
install_conf = configuration_data()
install_conf.set('GIMP_APP_VERSION', gimp_app_version)
@@ -2071,7 +1957,7 @@
elif platform_osx
gimp_exe_depends += [patched_libgimp_gir, patched_libgimpui_gir]
- gimp_run_env.set('GIMP_GI_DIR', gi.get_variable('libdir'))
+ gimp_run_env.set('GIMP_GI_DIR', '/usr/lib')
gimp_run_env.set('GIMP_TEMP_UPDATE_RPATH', gimp_real_exe.full_path())
gimp_run_env.prepend('GIMP_TEMP_UPDATE_RPATH', libgimp.full_path())
@@ -2087,20 +1973,10 @@
endforeach
endif
else
- # Cross-builds require an existing native GIMP installed, unless we
- # can run target binaries.
- native_gimp_exe = find_program([gimpconsole_exe_name, gimpmain_exe_name],
- native: true, required: false)
-
- if not native_gimp_exe.found()
- error('When cross-compiling, the build requires either an exe_wrapper or a native GIMP installed (@0@ or @1@).'.format(gimpconsole_exe_name, gimpmain_exe_name))
- endif
-
- gimp_run_env.set('GIMP_SELF_IN_BUILD', native_gimp_exe.full_path())
gimp_exe_depends = []
endif
-gimp_exe = find_program('tools'/'in-build-gimp.py')
+gimp_exe = disabler() # we're stripping native gimp build
################################################################################
# Subdirs: part 2
@@ -2108,14 +1984,6 @@
# gimp-data submodule part 2
subdir('gimp-data/images/')
-# Unit testing
-subdir('app/tests')
-subdir('libgimp/tests')
-
-# Docs
-subdir('docs')
-subdir('devel-docs')
-
# Inno Windows installer
if get_option('windows-installer')
subdir('po-windows-installer')
diff -ruwN source/plug-ins/meson.build source-new/plug-ins/meson.build
--- source/plug-ins/meson.build 2026-04-17 08:37:38.000000000 +0000
+++ source-new/plug-ins/meson.build 2026-10-08 07:53:23.381004527 +0000
@@ -34,8 +34,8 @@
{ 'name': 'metadata', },
{ 'name': 'pagecurl', },
{ 'name': 'print', },
- { 'name': 'screenshot', },
- { 'name': 'script-fu', },
+# screenshot need x11
+# script-fu need 'gi'
{ 'name': 'selection-to-path', }
]
@@ -92,17 +92,6 @@
endif
endforeach
-
-#Dynamically created list of supported files with the plugins lists above
-MIMEtypes_output = run_command(
- python,
- meson.current_source_dir() / 'generate_mime_ext.py',
- '--mime',
- meson.current_build_dir() / 'file_mimetypes.list',
- all_plugins_sources, check: true
-).stdout().strip()
-MIMEtypes_dep = declare_dependency(variables : {'MIMEtypes': MIMEtypes_output})
-
if get_option('windows-installer') or get_option('ms-store')
custom_target('file_associations',
input : all_plugins_sources,

View File

@ -1,16 +1,28 @@
#TODO not compiled or tested
# build instructions: https://gitlab.gnome.org/GNOME/gegl/-/blob/master/docs/development.adoc?ref_type=heads#user-content-debugging
[source]
tar = "https://download.gimp.org/pub/gegl/0.4/gegl-0.4.46.tar.xz"
tar = "https://download.gimp.org/pub/gegl/0.4/gegl-0.4.72.tar.xz"
[build]
template = "meson"
template = "custom"
mesonflags = [
"-Ddocs=false",
"-Dgi-docgen=false",
"-Dgtk-doc=false",
"-Dintrospection=false",
"-Dparallel-tests=false",
]
dependencies = [
"cairo",
"libpng",
"glib",
"pango",
"babl",
"json-glib",
"libjpeg",
"libnsgif",
"poly2tri-c",
]
script = """
DYNAMIC_INIT
CFLAGS="-std=c11"
cookbook_meson
"""

View File

@ -0,0 +1,44 @@
diff -ruwN source/meson.build source-new/meson.build
--- source/meson.build 2026-09-07 02:51:56.000000000 +0000
+++ source-new/meson.build 2026-10-08 04:30:15.334232657 +0000
@@ -696,40 +696,8 @@
subdir('bin')
subdir('tools')
subdir('operations')
-subdir('examples')
-subdir('tests')
subdir('perf')
subdir('po')
-subdir('docs')
-
-
-if host_machine.system() != 'emscripten'
- nm = find_program('nm', required: false)
-
- # Verify .def files for Windows linking (and for macOS too when -Wl,-exported_symbols_list is used).
- # We check this on non-Windows/non-macOS platform (Debian) on CI, and on Windows and macOS itself.
- # (This also checks if .gir files have parity with the library so parity with .def files too)
- custom_target('check-def-files',
- input: [
- gegl_def,
- g_ir.found() ? gegl_gir : [],
- gegl_npd_def,
- gegl_sc_def,
- ],
- depends: [
- gegl_lib,
- gegl_npd_lib,
- seamlessclone_lib
- ],
- env: nm.found() ? { 'NM': nm.full_path() } : {},
- output: [ 'check-def-files', ],
- command: [
- python, meson.project_source_root() / 'tools' / 'defcheck.py', '@INPUT@',
- ],
- build_by_default: true,
- )
-endif
-
if w3m.found()
# Create NEWS file from html file

View File

@ -5,8 +5,11 @@ tar = "https://download.gnome.org/sources/gexiv2/0.14/gexiv2-0.14.2.tar.xz"
[build]
template = "meson"
mesonflags = [
"-Dintrospection=false"
"-Dintrospection=false",
"-Dvapi=false",
"-Dpython3=false",
]
dependencies = [
"exiv2"
"exiv2",
"glib",
]

View File

@ -1,4 +1,4 @@
#TODO compile and test
#TODO compiled but not tested
[source]
git = "https://github.com/Exiv2/exiv2"
rev = "v0.28.8"
@ -13,4 +13,5 @@ cmakeflags = [
dependencies = [
"zlib",
"libiconv",
"inih",
]

View File

@ -1,17 +1,30 @@
#TODO not compiled or tested
# build instructions: https://github.com/ximion/appstream#build--install
#TODO missing dependencies
#TODO compiled but not tested
[source]
tar = "https://www.freedesktop.org/software/appstream/releases/AppStream-1.1.2.tar.xz"
script = """
mv AppStream-1.1.2/{*,.*} .
rmdir AppStream-1.1.2
"""
patches = [
"redox.patch"
]
[build]
template = "meson"
mesonflags = [
"-Dsystemd=false",
"-Dgir=false",
"-Dman=off",
"-Dman=false",
]
dependencies = [
"glib",
"libxml2",
"curl",
"libfyaml",
"libxmlb",
"libstemmer",
"bash-completion"
]
dev-dependencies = [
"host:gperf"
]

View File

@ -0,0 +1,87 @@
diff -ruwN source/AppStream-1.1.2/data/meson.build source-new/AppStream-1.1.2/data/meson.build
--- source/AppStream-1.1.2/data/meson.build 2026-01-28 20:15:58.000000000 +0000
+++ source-new/AppStream-1.1.2/data/meson.build 2026-10-08 06:16:45.427081991 +0000
@@ -7,52 +7,6 @@
install_data('its/metainfo.loc',
install_dir: join_paths(get_option('datadir'), 'gettext', 'its'))
-# Do not rely on an exe wrapper for rel-info, use the system one in that case
-if meson.is_cross_build()
- dependency('appstream', version: '>=' + as_version, native: true,
- not_found_message: 'Native appstream required for cross-building')
- ascli_exe = find_program('appstreamcli', native: true)
-endif
-
-# NOTE: We do not translate the release notes on purpose here.
-# If you do want to give translators a chance to translate them,
-# ascli news-to-metainfo needs to produce a temporary file to translate
-# prior to running (x)gettext on the file.
-metainfo_with_relinfo = custom_target('gen-output',
- input : ['../NEWS', 'org.freedesktop.appstream.cli.metainfo.xml'],
- output : ['nol10n_withrelinfo_org.freedesktop.appstream.cli.metainfo.xml'],
- command : [ascli_exe, 'news-to-metainfo', '--limit=6', '@INPUT0@', '@INPUT1@', '@OUTPUT@']
-)
-
-metainfo_i18n = i18n.itstool_join(
- input: metainfo_with_relinfo,
- output: 'org.freedesktop.appstream.cli.metainfo.xml',
- mo_targets: i18n_result[0],
- its_files: [join_paths(meson.current_source_dir(), 'its', 'metainfo.its')],
- install: true,
- install_dir: metainfo_dir,
-)
-
-test('as-validate_metainfo.cli',
- ascli_exe,
- args: ['validate',
- '--pedantic',
- '--no-net',
- metainfo_i18n]
-)
-
# install appstream.conf default template
install_data('appstream.conf',
install_dir: as_data_installdir)
-
-if get_option('compose')
- ascompose_metainfo = 'org.freedesktop.appstream.compose.metainfo.xml'
- test('as-validate_metainfo.compose',
- ascli_exe,
- args: ['validate',
- '--pedantic',
- '--no-net',
- join_paths(meson.current_source_dir(), ascompose_metainfo)]
- )
- install_data(ascompose_metainfo, install_dir: metainfo_dir)
-endif
diff -ruwN source/AppStream-1.1.2/meson.build source-new/AppStream-1.1.2/meson.build
--- source/AppStream-1.1.2/meson.build 2026-01-28 20:15:58.000000000 +0000
+++ source-new/AppStream-1.1.2/meson.build 2026-10-08 06:22:27.470986289 +0000
@@ -193,15 +193,10 @@
stemmer_inc_dirs = include_directories()
if get_option('stemming')
stemmer_lib = cc.find_library('stemmer', required: true)
- stemmer_inc_dirs = include_directories(['/usr/include'])
if not cc.has_header('libstemmer.h')
- if cc.has_header('libstemmer/libstemmer.h')
- stemmer_inc_dirs = include_directories('/usr/include/libstemmer')
- else
error('Unable to find Snowball header "libstemmer.h". Please ensure libstemmer/Snowball is installed properly in order to continue.')
endif
endif
-endif
# use gperf for faster string -> enum matching
gperf = find_program('gperf')
diff -ruwN source/AppStream-1.1.2/src/as-system-info.c source-new/AppStream-1.1.2/src/as-system-info.c
--- source/AppStream-1.1.2/src/as-system-info.c 2026-01-28 20:15:58.000000000 +0000
+++ source-new/AppStream-1.1.2/src/as-system-info.c 2026-10-08 06:23:01.354958074 +0000
@@ -513,7 +513,7 @@
return 0;
}
return hbi.memory_size / MB_IN_BYTES;
-#elif defined(__sun)
+#elif defined(__sun) || defined(__redox__)
long physpages = sysconf (_SC_PHYS_PAGES);
long pagesize = sysconf (_SC_PAGESIZE);
if (physpages > 0 && pagesize > 0)

View File

@ -1,12 +1,15 @@
#TODO not compiled or tested
# build instructions: https://gitlab.gnome.org/GNOME/babl/-/blob/master/INSTALL.in?ref_type=heads
#TODO compiled but not tested
[source]
tar = "https://download.gimp.org/pub/babl/0.1/babl-0.1.124.tar.xz"
blake3 = "30ef72ccc64771f876b4e42e0d5d05f8561fd6bb4baf225ad498056b1e896f92"
patches = [
"redox.patch"
]
[build]
template = "meson"
mesonflags = [
"-Dwith-docs=false",
"-Denable-gir=false",
"-Denable-vapi=false",
"-Dgi-docgen=false",
"-Dgi-docgen=disabled",
]

View File

@ -0,0 +1,44 @@
diff -ruwN source/babl/babl-conversion.c source-new/babl/babl-conversion.c
--- source/babl/babl-conversion.c 2026-03-10 15:56:45.000000000 +0000
+++ source-new/babl/babl-conversion.c 2026-10-08 02:54:11.064600969 +0000
@@ -18,6 +18,7 @@
#include "config.h"
+#include <alloca.h>
#include <string.h>
#include <stdarg.h>
#include <math.h>
diff -ruwN source/babl/babl-fish-path.c source-new/babl/babl-fish-path.c
--- source/babl/babl-fish-path.c 2026-03-10 15:56:45.000000000 +0000
+++ source-new/babl/babl-fish-path.c 2026-10-08 02:54:11.064600969 +0000
@@ -18,6 +18,7 @@
#include "config.h"
#include <math.h>
+#include <alloca.h>
#ifdef _WIN32
#include <malloc.h>
#endif
diff -ruwN source/babl/babl-polynomial.c source-new/babl/babl-polynomial.c
--- source/babl/babl-polynomial.c 2026-03-10 15:56:45.000000000 +0000
+++ source-new/babl/babl-polynomial.c 2026-10-08 02:54:11.064600969 +0000
@@ -51,6 +51,7 @@
#include "config.h"
#include <string.h>
+#include <alloca.h>
#include <math.h>
#ifdef _WIN32
#include <malloc.h>
diff -ruwN source/extensions/sse2-float.c source-new/extensions/sse2-float.c
--- source/extensions/sse2-float.c 2026-03-10 15:56:45.000000000 +0000
+++ source-new/extensions/sse2-float.c 2026-10-08 02:54:11.064600969 +0000
@@ -25,6 +25,7 @@
/* SSE 2 */
#include <emmintrin.h>
+#include <alloca.h>
#include <stdint.h>
#include <stdlib.h>

View File

@ -0,0 +1,6 @@
[source]
tar = "https://github.com/pantoniou/libfyaml/releases/download/v0.9.6/libfyaml-0.9.6.tar.gz"
[build]
template = "cmake"

View File

@ -0,0 +1,35 @@
diff -ruwN source/CMakeLists.txt source-new/CMakeLists.txt
--- source/CMakeLists.txt 2026-03-15 13:48:50.000000000 +0000
+++ source-new/CMakeLists.txt 2026-10-08 05:58:36.546675313 +0000
@@ -686,6 +686,7 @@
set(COMMON_C_DEFINITIONS WIN32_LEAN_AND_MEAN _CRT_SECURE_NO_WARNINGS)
else()
set(COMMON_C_DEFINITIONS _GNU_SOURCE)
+ set(COMMON_C_DEFINITIONS HAVE_ALLOCA_H)
endif()
# MSVC requires C11 for stdatomic.h
diff -ruwN source/include/libfyaml/libfyaml-endian.h source-new/include/libfyaml/libfyaml-endian.h
--- source/include/libfyaml/libfyaml-endian.h 2026-03-15 13:48:50.000000000 +0000
+++ source-new/include/libfyaml/libfyaml-endian.h 2026-10-08 05:53:56.988388856 +0000
@@ -42,7 +42,7 @@
extern "C" {
#endif
-#if defined(__linux__) || defined(__CYGWIN__) || defined(__OpenBSD__) || defined(__GNU__) || defined(__EMSCRIPTEN__)
+#if defined(__linux__) || defined(__CYGWIN__) || defined(__OpenBSD__) || defined(__GNU__) || defined(__redox__) || defined(__EMSCRIPTEN__)
# include <endian.h>
#elif defined(__APPLE__)
# include <libkern/OSByteOrder.h>
diff -ruwN source/src/util/fy-utils.c source-new/src/util/fy-utils.c
--- source/src/util/fy-utils.c 2026-03-15 13:48:50.000000000 +0000
+++ source-new/src/util/fy-utils.c 2026-10-08 06:03:33.209958279 +0000
@@ -960,7 +960,7 @@
if (!fyms)
return NULL;
memset(fyms, 0, sizeof(*fyms));
-#if !defined(_WIN32)
+#if !defined(_WIN32) && !defined(__redox__)
fyms->fp = open_memstream(&fyms->buf, &fyms->size);
#else
fyms->fp = tmpfile();

View File

@ -12,6 +12,7 @@ compiler = "no-lto"
template = "custom"
script = """
DYNAMIC_INIT
CPPFLAGS+=" -fno-lto"
COOKBOOK_CONFIGURE="${COOKBOOK_SOURCE}/source/configure"
COOKBOOK_CONFIGURE_FLAGS+=(
icu_cv_host_frag=mh-linux

View File

@ -1,9 +1,17 @@
#TODO probably missing dependencies: https://github.com/mypaint/libmypaint/#dependencies
#TODO compiled but not tested
[source]
tar = "https://github.com/mypaint/libmypaint/releases/download/v1.6.0/libmypaint-1.6.0.tar.xz"
script = """
GNU_CONFIG_GET config.sub
"""
[build]
template = "configure"
template = "custom"
script = """
DYNAMIC_INIT
export CPPFLAGS+=" -I${COOKBOOK_SYSROOT}/include/glib-2.0 -I${COOKBOOK_SYSROOT}/lib/glib-2.0/include"
cookbook_configure
"""
dependencies = [
"glib",
"gobject-introspection",
"json-c",
]

View File

@ -0,0 +1,22 @@
[source]
tar = "https://download.netsurf-browser.org/libs/releases/libnsgif-1.0.0-src.tar.gz"
[build]
template = "custom"
dev-dependencies = [
"netsurf-buildsystem"
]
script = """
DYNAMIC_INIT
# Netsurf does not currently support out-of-tree builds :(
rsync -av --delete "${COOKBOOK_SOURCE}/" ./
# netsurf mixes up CFLAGS for host and build
export CC="${CC} ${CPPFLAGS}"
export NSSHARED=${COOKBOOK_SYSROOT}/usr/share/netsurf-buildsystem
export PREFIX=/usr
export COMPONENT_TYPE=lib-shared
"$COOKBOOK_MAKE" V=1 -j"$COOKBOOK_MAKE_JOBS"
"$COOKBOOK_MAKE" DESTDIR="$COOKBOOK_STAGE" install -j"$COOKBOOK_MAKE_JOBS"
"""

View File

@ -0,0 +1,16 @@
[source]
tar = "https://snowballstem.org/dist/libstemmer_c-3.1.1.tar.gz"
[build]
template = "custom"
compiler = "no-lto"
script = """
DYNAMIC_INIT
rsync -a --delete "${COOKBOOK_SOURCE}/" ./
mkdir -p ${COOKBOOK_STAGE}/usr/bin ${COOKBOOK_STAGE}/usr/lib ${COOKBOOK_STAGE}/usr/include
make CFLAGS="-O2 -fPIC $CPPFLAGS"
cp libstemmer.a ${COOKBOOK_STAGE}/usr/lib
cp stemwords ${COOKBOOK_STAGE}/usr/bin
cp include/* ${COOKBOOK_STAGE}/usr/include
"""

View File

@ -0,0 +1,13 @@
[source]
tar = "https://github.com/hughsie/libxmlb/releases/download/0.3.29/libxmlb-0.3.29.tar.xz"
[build]
template = "meson"
mesonflags = [
"-Dintrospection=false"
]
dependencies = [
"glib",
"zstd",
]

View File

@ -0,0 +1,6 @@
#TODO compiled but not tested
[source]
tar = "https://github.com/mypaint/mypaint-brushes/releases/download/v2.0.2/mypaint-brushes-2.0.2.tar.xz"
[build]
template = "configure"

View File

@ -0,0 +1,11 @@
[source]
tar = "https://download.netsurf-browser.org/libs/releases/buildsystem-1.10.tar.gz"
[build]
template = "custom"
script = """
# Netsurf does not currently support out-of-tree builds :(
rsync -av --delete "${COOKBOOK_SOURCE}/" ./
make install PREFIX=/usr DESTDIR="${COOKBOOK_STAGE}"
"""

View File

@ -0,0 +1,24 @@
[source]
git = "https://github.com/KyleLink/poly2tri-c"
shallow_clone = true
patches = [
"redox.patch"
]
script = """
# find . -type d -exec touch {}/Makefile.in \\;
# touch aclocal.m4 configure configure.ac Makefile.am
autotools_recursive_regenerate
"""
[build]
template = "custom"
dependencies = [
"glib",
]
script = """
DYNAMIC_INIT
rsync -av --delete "${COOKBOOK_SOURCE}/" ./
COOKBOOK_CONFIGURE="./configure"
cookbook_configure
"""

View File

@ -0,0 +1,49 @@
diff --git a/Makefile.am b/Makefile.am
index c6f694e..6082285 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,6 @@
SUBDIRS = poly2tri-c bin
-ACLOCAL_AMFLAGS = -I m4
+ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = poly2tri-c.pc
diff --git a/configure.ac b/configure.ac
index 8ba632f..a52b355 100644
--- a/configure.ac
+++ b/configure.ac
@@ -83,9 +83,6 @@ AC_PROG_CC
# -Werror, so we will only add that option afterwards. For more information, see
# the discussion at http://lists.gnu.org/archive/html/bug-autoconf/2010-01/msg00031.html
-# Pedantic errors please
-CFLAGS="$CFLAGS -Wall -ansi -pedantic"
-
# Find the standard math functions
# Taken from http://www.flameeyes.eu/autotools-mythbuster/autoconf/finding.html
AC_CHECK_HEADERS([math.h])
@@ -93,9 +90,6 @@ AC_SEARCH_LIBS([log10], [m], [], [
AC_MSG_ERROR([unable to find the log10() function])
])
-# Warnings as errors please
-CFLAGS="$CFLAGS -Werror"
-
# Find GLib support via pkg-config
PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.28])
diff --git a/poly2tri-c/refine/Makefile.am b/poly2tri-c/refine/Makefile.am
index 8701b0d..74edd34 100644
--- a/poly2tri-c/refine/Makefile.am
+++ b/poly2tri-c/refine/Makefile.am
@@ -1,6 +1,6 @@
noinst_LTLIBRARIES = libp2tc-refine.la
-libp2tc_refine_la_SOURCES = bounded-line.c bounded-line.h cdt.c cdt.h cdt-flipfix.c cdt-flipfix.h circle.c circle.h cluster.c cluster.h delaunay-terminator.c delaunay-terminator.h edge.c edge.h line.c line.h rmath.c rmath.h mesh.c mesh.h mesh-action.c mesh-action.h point.c point.h pslg.c pslg.h refine.h refiner.c refiner.h triangle.c triangle.h triangulation.h utils.c utils.h vector2.c vector2.h vedge.c vedge.h vtriangle.c vtriangle.h visibility.c visibility.h
+libp2tc_refine_la_SOURCES = bounded-line.c bounded-line.h cdt-flipfix.c cdt-flipfix.h circle.c circle.h cluster.c cluster.h delaunay-terminator.c delaunay-terminator.h edge.c edge.h line.c line.h rmath.c rmath.h mesh.c mesh.h mesh-action.c mesh-action.h point.c point.h pslg.c pslg.h refine.h refiner.c refiner.h rcdt.c rcdt.h rutils.c rutils.h triangle.c triangle.h triangulation.h vector2.c vector2.h vedge.c vedge.h vtriangle.c vtriangle.h visibility.c visibility.h
P2TC_REFINE_publicdir = $(P2TC_publicdir)/refine
-P2TC_REFINE_public_HEADERS = bounded-line.h cdt.h circle.h cluster.h edge.h line.h mesh.h mesh-action.h point.h pslg.h refine.h refiner.h rmath.h triangle.h triangulation.h utils.h vector2.h vedge.h vtriangle.h visibility.h
+P2TC_REFINE_public_HEADERS = bounded-line.h circle.h cluster.h edge.h line.h mesh.h mesh-action.h point.h pslg.h rcdt.h refine.h refiner.h rmath.h rutils.h triangle.h triangulation.h vector2.h vedge.h vtriangle.h visibility.h

View File

@ -1,5 +1,4 @@
#TODO not compiled or tested
# build instructions: https://github.com/benhoyt/inih#meson-notes
#TODO compiled but not tested
[source]
git = "https://github.com/benhoyt/inih"
rev = "r62"