cygport file and patches attached.

The build system has changed from autotools to meson. The former is no longer supported.

I have disabled gobject introspection for reasons explained here:

  https://sourceware.org/pipermail/cygwin-apps/2020-May/040093.html

This represents no change, because Yaakov disabled it (for different reasons) several years ago. I'm hoping to be able to re-enable it at some point.

I went to some trouble, with the help of Jon Turney, to make the html docs build, so I packaged them in a (new) libbabl-doc package. Is there any reason not to do this?

Fedora packages the docs also, in babl-devel-docs.

Ken
--- origsrc/babl-0.1.74/babl/meson.build        2020-01-12 18:26:51.000000000 
-0500
+++ src/babl-0.1.74/babl/meson.build    2020-05-25 10:05:54.387799000 -0400
@@ -38,7 +38,7 @@ elif host_machine.system() == 'darwin' a
 else
   error('Linker doesn\'t support --version-script or -exported_symbols_list')
 endif
-if platform_win32
+if platform_win32 or platform_cygwin
   babl_link_args += '-Wl,--no-undefined'
 endif
 
--- origsrc/babl-0.1.74/extensions/meson.build  2020-01-12 18:26:51.000000000 
-0500
+++ src/babl-0.1.74/extensions/meson.build      2020-05-25 10:05:54.391822000 
-0400
@@ -15,7 +15,7 @@ babl_ext_inc = [
 # Linker arguments
 babl_ext_link_args = [
 ]
-if platform_win32
+if platform_win32 or platform_cygwin
   babl_ext_link_args += '-Wl,--no-undefined'
 endif
 
--- origsrc/babl-0.1.74/meson.build     2020-01-12 18:26:51.000000000 -0500
+++ src/babl-0.1.74/meson.build 2020-05-25 10:08:03.005964600 -0400
@@ -79,6 +79,7 @@ conf.set_quoted('BABL_LIBRARY',
 platform_android = false
 platform_osx = false
 platform_win32 = false
+platform_cygwin = false
 
 host_cpu_family = host_machine.cpu_family()
 message('Host machine cpu family: ' + host_cpu_family)
@@ -104,9 +105,10 @@ host_os = host_machine.system()
 message('Host os: ' + host_os)
 
 platform_win32 = (host_os.startswith('mingw') or
-                  host_os.startswith('cygwin') or
                   host_os.startswith('windows'))
 
+platform_cygwin = host_os.startswith('cygwin')
+
 platform_osx = host_os.startswith('darwin')
 if platform_osx
   if cc.get_id() != 'clang'
@@ -118,7 +120,7 @@ platform_android = host_os.contains('and
 
 path_sep = ( platform_win32 ? ';'     : ':' )
 dirs_sep = ( platform_win32 ? '\\\\'  : '/' )
-if platform_win32
+if platform_win32 or platform_cygwin
   lib_ext = '.dll'
 elif platform_osx
   lib_ext = '.dylib'
@@ -145,7 +147,6 @@ build_os = build_machine.system()
 message('Build os: ' + build_os)
 
 build_platform_win32 = (build_os.startswith('mingw') or
-                        build_os.startswith('cygwin') or
                         build_os.startswith('windows'))
 
 # Only run cross compile objects if we have exe wrapper
--- origsrc/babl-0.1.74/docs/meson.build        2020-01-12 18:26:51.000000000 
-0500
+++ src/babl-0.1.74/docs/meson.build    2020-05-24 22:10:24.081359400 -0400
@@ -54,22 +54,26 @@ index_html = custom_target('index.html',
   build_by_default: true,
 )
 
-Reference_html = custom_target('Reference.html',
+Reference_html_tmp = custom_target('Reference.html.tmp',
   input : [
     'Reference-static.html',
     'toc',
-    index_html_tmp,
   ],
-  output: [ 'Reference.html', ],
+  output: [ 'Reference.html.tmp', ],
   command: [
     env_bin,
     'cp', '@INPUT0@', '@OUTPUT@',
     '&&', xml_insert, '@OUTPUT@', 'TOC', '@INPUT1@',
-    '&&', xml_insert, '@OUTPUT@', 'BablBase', '@INPUT2@',
   ],
-  build_by_default: true,
 )
 
+Reference_html = custom_target('Reference.html',
+  input : [ Reference_html_tmp, index_html_tmp, ],
+  output: [ 'Reference.html', ],
+  command: [ xml_insert, '@INPUT0@', 'BablBase', '@INPUT1@', 'cat_result' ],
+  build_by_default: true,
+  capture: true,
+)
 
 CMYK_html = custom_target('CMYK.html',
   input : [
--- origsrc/babl-0.1.74/docs/tools/xml_insert.sh        2020-01-12 
18:26:51.000000000 -0500
+++ src/babl-0.1.74/docs/tools/xml_insert.sh    2020-05-25 07:54:31.875472500 
-0400
@@ -7,6 +7,9 @@
 #
 # xml_insert.sh bar.xml foo foo.inc
 #
+# If there's a fourth argument, cat the final result.
+#
+#
 # 2005 © Øyvind Kolås
 #
 # FIXME: add argument checking / error handling
@@ -97,6 +100,9 @@ tailno=`expr $numlines - $splitno`
 head -$splitno $tmp_file > $1
 cat $3 >> $1
 tail -$tailno $tmp_file >> $1
+if test -n "$4"; then
+  cat $1
+fi
 
 rm -rf $tmp_dir
 
inherit meson

NAME="babl"
VERSION=0.1.74
RELEASE=1
CATEGORY="Libs"
SUMMARY="Any-to-any pixel format conversion library"
DESCRIPTION="Babl is a dynamic, any to any, pixel format conversion library.
It provides conversions between the myriad of buffer types images can be
stored in. Babl doesn't only help with existing pixel formats, but also
facilitates creation of new and uncommon ones."
HOMEPAGE="http://www.gegl.org/babl/";
SRC_URI="http://download.gimp.org/pub/babl/${VERSION%.*}/babl-${VERSION}.tar.xz";

PATCH_URI="0.1.74-cygwin.patch 0.1.74-docs.patch"

PKG_NAMES="libbabl0.1_0 libbabl-devel" # girepository-Babl0.1 vala-babl0.1"
PKG_NAMES+=" libbabl-doc"
libbabl0_1_0_SUMMARY="${SUMMARY} (runtime)"
libbabl0_1_0_CONTENTS="--exclude=usr/share/doc/babl/html
        usr/bin/*-0.1-0.dll
        usr/lib/babl-0.1/
        usr/share/doc/"
libbabl_devel_SUMMARY="${SUMMARY} (development)"
libbabl_devel_CONTENTS="usr/include/ usr/lib/lib* usr/lib/pkgconfig/"
libbabl_devel_SUMMARY="${SUMMARY} (development)"
libbabl_devel_CONTENTS="usr/include/ usr/lib/lib* usr/lib/pkgconfig/"
libbabl_doc_SUMMARY="${SUMMARY} (documentation)"
libbabl_doc_CONTENTS="usr/share/doc/babl/html/"
girepository_Babl0_1_SUMMARY="${SUMMARY} (GObject Introspection)"
girepository_Babl0_1_CONTENTS="usr/*/gir*/Babl-0.1.*"
vala_babl0_1_SUMMARY="${SUMMARY} (Vala bindings)"
vala_babl0_1_CONTENTS="usr/share/vala/"

src_install() {
        cd ${S}
        meson_install
        docinto html
        cd ${CHOST}/docs
        dodoc graphics *.html *.css
        rm ${D}/usr/share/doc/babl/html/index-static.html
}

CYGMESON_ARGS="-Denable-gir=false"

# Attempting to build with gobject-introspection fails as follows:
# FAILED: babl/Babl-0.1.gir
# /usr/bin/g-ir-scanner -I/usr/include/gobject-introspection-1.0 
-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -D_REENTRANT --no-libtool 
--namespace=Babl --nsversion=0.1 --warn-all --output babl/Babl-0.1.gir 
--c-include=babl.h '--identifier-filter-cmd=/usr/bin/python3 
/home/kbrown/src/cygpackages/babl/babl-0.1.74-1.x86_64/src/babl-0.1.74/babl/identfilter.py'
 -DBABL_IS_BEING_COMPILED 
-I/home/kbrown/src/cygpackages/babl/babl-0.1.74-1.x86_64/src/babl-0.1.74/babl 
-I/home/kbrown/src/cygpackages/babl/babl-0.1.74-1.x86_64/src/babl-0.1.74/x86_64-pc-cygwin/babl
 -I./. -I../. -I./babl/base/. -I../babl/base/. 
--filelist=/home/kbrown/src/cygpackages/babl/babl-0.1.74-1.x86_64/src/babl-0.1.74/x86_64-pc-cygwin/babl/4170c83@@babl-0.1@sha/Babl_0.1_gir_filelist
 --cflags-begin -fno-unsafe-math-optimizations -Wdeclaration-after-statement 
-Winit-self -Wmissing-declarations -Wmissing-prototypes -Wold-style-definition 
-Wpointer-arith -mmmx -msse -mfpmath=sse -I./. -I../. -I./babl/base/. 
-I../babl/base/. --cflags-end --library babl-0.1 
-L/home/kbrown/src/cygpackages/babl/babl-0.1.74-1.x86_64/src/babl-0.1.74/x86_64-pc-cygwin/babl
 --extra-library=m --extra-library=dl --extra-library=lcms2
# g-ir-scanner: link: gcc -o 
/home/kbrown/src/cygpackages/babl/babl-0.1.74-1.x86_64/src/babl-0.1.74/x86_64-pc-cygwin/tmp-introspectG0o9nF/Babl-0.1.exe
 -ggdb -O2 -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 
-fstack-protector-strong --param=ssp-buffer-size=4 
-fdebug-prefix-map=/home/kbrown/src/cygpackages/babl/babl-0.1.74-1.x86_64/build=/usr/src/debug/babl-0.1.74-1
 
-fdebug-prefix-map=/home/kbrown/src/cygpackages/babl/babl-0.1.74-1.x86_64/src/babl-0.1.74=/usr/src/debug/babl-0.1.74-1
 
/home/kbrown/src/cygpackages/babl/babl-0.1.74-1.x86_64/src/babl-0.1.74/x86_64-pc-cygwin/tmp-introspectG0o9nF/Babl-0.1.o
 -L. -lbabl-0.1 -lm -ldl -llcms2 
-L/home/kbrown/src/cygpackages/babl/babl-0.1.74-1.x86_64/src/babl-0.1.74/x86_64-pc-cygwin/babl
 
-Wl,-rpath,/home/kbrown/src/cygpackages/babl/babl-0.1.74-1.x86_64/src/babl-0.1.74/x86_64-pc-cygwin/babl
 -lgio-2.0 -lgobject-2.0 -Wl,--export-all-symbols -lgmodule-2.0 -lglib-2.0 
-lintl
# ERROR: can't resolve libraries to shared libraries: babl-0.1

# The problem is that the executable generated by the above link
# command doesn't depend on the cygbabl DLL b/c the babl library
# doesn't contain any GObject-based types.  See
#
#   
https://github.com/mesonbuild/meson/pull/2880/commits/8a27c08b05e4537d5061d30ddd8aad9dc52cf1c4
  • [ITA] babl Ken Brown via Cygwin-apps

Reply via email to