From 1e53fa691949998dfa711878ecb7863814f085ee Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 18 Jul 2019 16:56:35 +0300 Subject: Upgrade to 1.6.3 --- .gitmodules | 2 +- README-DEV | 37 ++++++--------- libpkgconf/README | 8 ++-- libpkgconf/README-DEV | 26 +++++------ libpkgconf/build/root.build | 2 + libpkgconf/libpkgconf/.gitignore | 4 +- libpkgconf/libpkgconf/buildfile | 68 +++++++++++++--------------- libpkgconf/libpkgconf/config.h | 56 ----------------------- libpkgconf/libpkgconf/config.h.cmake.in.orig | 1 - libpkgconf/libpkgconf/config.h.in | 53 ++++++++++++++++++++++ libpkgconf/libpkgconf/config.h.meson.orig | 1 + libpkgconf/libpkgconf/version.h.in | 10 ---- libpkgconf/manifest | 6 +-- upstream | 2 +- 14 files changed, 124 insertions(+), 152 deletions(-) delete mode 100644 libpkgconf/libpkgconf/config.h delete mode 120000 libpkgconf/libpkgconf/config.h.cmake.in.orig create mode 100644 libpkgconf/libpkgconf/config.h.in create mode 120000 libpkgconf/libpkgconf/config.h.meson.orig delete mode 100644 libpkgconf/libpkgconf/version.h.in diff --git a/.gitmodules b/.gitmodules index e3a7a2c..39c5dff 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,4 @@ [submodule "upstream"] path = upstream - url = https://git.dereferenced.org/pkgconf/pkgconf.git + url = https://git.sr.ht/~kaniini/pkgconf ignore = untracked diff --git a/README-DEV b/README-DEV index 1a713f6..2a196aa 100644 --- a/README-DEV +++ b/README-DEV @@ -20,14 +20,14 @@ directly. We also add the `ignore = untracked` configuration option into .gitmodules to make sure that git ignores the intermediate build files under upstream/ subdirectory. -Normally, when packaging an autoconf/cmake-based project, we try to deduce the -source file and compilation/linking option sets analyzing the configure.ac, -CMakeLists.txt, and .cmake files. In practice, however, that can be uneasy and -error prone, so you may also need to refer to make/configuration files -produced by the configure script/cmake or, as a last resort, to see the -actual compiler and linker command lines in the build log. If that's the case, -you can configure/build the upstream package on the platform of interest -running the following commands in the project root directory. +Normally, when packaging an autoconf/meson-based project, we try to deduce the +source file and compilation/linking option sets analyzing the configure.ac and +meson* files. In practice, however, that can be uneasy and error prone, so you +may also need to refer to make/configuration files produced by the configure +script/meson or, as a last resort, to see the actual compiler and linker +command lines in the build log. If that's the case, you can configure/build +the upstream package on the platform of interest running the following +commands in the project root directory. On POSIX and in MinGW shell on Windows: @@ -37,23 +37,16 @@ $ cd build $ ../configure >build.log 2>&1 $ make AM_DEFAULT_VERBOSITY=1 >>build.log 2>&1 -Note: 1.6.1 fails to build pkgconf utility with MinGW GCC (see issue #37 for -details). - With MSVC on Windows: -Run Visual Studio and change the settings: - -Tools > - Options > - Projects and Solutions > - Build and Run > - MSBuild project build output verbosity: Detailed - -> mkdir build +> meson -Dtests=false > cd build -> cmake .. >build.log 2>&1 -> devenv pkgconf.sln /build >>build.log 2>&1 +> ninja + +Note that you cannot see the build command options running ninja in the +verbose mode (-v) as it passes them to the compiler and linker via temporary +option files. However, you can see them in the meson-generated build.ninja +file. When the packaging is complete, build all the project packages in source tree and make sure that all the preprocessor include directives reference the diff --git a/libpkgconf/README b/libpkgconf/README index 8c29a43..49b30cd 100644 --- a/libpkgconf/README +++ b/libpkgconf/README @@ -1,8 +1,8 @@ libpkgconf is a C library which helps to configure compiler and linker flags -for development frameworks. It provids most of the pkgconf's functionality, +for development frameworks. It provides most of the pkgconf's functionality, which itself is similar to pkg-config. For more information see: -https://git.dereferenced.org/pkgconf/pkgconf +https://git.sr.ht/~kaniini/pkgconf This package contains the original libpkgconf library source code overlaid with the build2-based build system and packaged for the build2 package manager @@ -11,8 +11,8 @@ the build2-based build system and packaged for the build2 package manager See the INSTALL file for the prerequisites and installation instructions. Post questions, bug reports, or any other feedback about the library itself at -https://git.dereferenced.org/pkgconf/pkgconf/issues. Send build system and -packaging-related feedback to the packaging@build2.org mailing list (see +https://todo.sr.ht/~kaniini/pkgconf. Send build system and packaging-related +feedback to the packaging@build2.org mailing list (see https://lists.build2.org for posting guidelines, etc). The packaging of libpkgconf for build2 is tracked in a Git repository at: diff --git a/libpkgconf/README-DEV b/libpkgconf/README-DEV index 5188ab1..0a63eb9 100644 --- a/libpkgconf/README-DEV +++ b/libpkgconf/README-DEV @@ -2,34 +2,30 @@ This document describes how libpkgconf was packaged for build2. In particular, this understanding will be useful when upgrading to a new upstream version. See ../README-DEV for general notes on pkgconf packaging. -Symlink the required upstream files and directories and provide our own -implementations for auto-generated headers: +Symlink the required upstream files and provide our own implementation for +auto-generated config.h: $ ln -s ../upstream/{AUTHORS,COPYING} ./ - -$ ln -s ../../upstream/libpkgconf/config.h.cmake.in \ - libpkgconf/config.h.cmake.in.orig - +$ ln -s ../../upstream/libpkgconf/config.h.meson libpkgconf/config.h.meson.orig $ cd libpkgconf && ln -s ../../upstream/libpkgconf/*.{c,h} ./ -Use libpkgconf/config.h.cmake.in.orig for creating libpkgconf/config.h and -libpkgconf/version.h.in, defining/undefining macros introduced with -#cmakedefine. +Use libpkgconf/config.h.meson.orig for creating libpkgconf/config.h.in, +defining/undefining macros introduced with #mesondefine. -Re-creating libpkgconf/config.h from scratch every time we upgrade to a new +Re-creating libpkgconf/config.h.in from scratch every time we upgrade to a new upstream version would be a real pain. Instead we can only (un)define the newly introduced macros, comparing the already defined and currently used macro sets: -$ for m in `cat libpkgconf/config.h.cmake.in.orig | \ - sed -n 's/.*#\s*cmakedefine\s\{1,\}\([_a-zA-Z0-9]\{1,\}\)\(\s.*\)\{0,1\}$/\1/p' | sort -u`; do - if grep -q -e "\b$m\b" `find -L . -name '*.h' -a ! -name config.h -a ! -name version.h -o -name '*.c'`; then +$ for m in `cat libpkgconf/config.h.meson.orig | \ + sed -n 's/.*#\s*mesondefine\s\{1,\}\([_a-zA-Z0-9]\{1,\}\)\(\s.*\)\{0,1\}$/\1/p' | sort -u`; do + if grep -q -e "\b$m\b" `find -L . -name '*.h' -a ! -name config.h -o -name '*.c'`; then echo "$m" fi done >used-macros -$ cat libpkgconf/config.h | +$ cat libpkgconf/config.h.in | sed -n 's/#\s*\(define\|undef\)\s\{1,\}\([_a-zA-Z0-9]\{1,\}\)\(\s.*\)\{0,1\}$/\2/p' | sort -u >defined-macros -$ diff defined-macros used-macros >diff-macros +$ diff defined-macros used-macros diff --git a/libpkgconf/build/root.build b/libpkgconf/build/root.build index 7e73ef0..5536426 100644 --- a/libpkgconf/build/root.build +++ b/libpkgconf/build/root.build @@ -2,6 +2,8 @@ # copyright : Copyright (c) 2016-2019 Code Synthesis Ltd # license : ISC; see accompanying COPYING file +using in + c.std = 99 using c diff --git a/libpkgconf/libpkgconf/.gitignore b/libpkgconf/libpkgconf/.gitignore index 620b4c8..d4cefd7 100644 --- a/libpkgconf/libpkgconf/.gitignore +++ b/libpkgconf/libpkgconf/.gitignore @@ -1,3 +1,3 @@ -# Generated version.h. +# Generated config.h. # -version.h +config.h diff --git a/libpkgconf/libpkgconf/buildfile b/libpkgconf/libpkgconf/buildfile index 5131874..0296e64 100644 --- a/libpkgconf/libpkgconf/buildfile +++ b/libpkgconf/libpkgconf/buildfile @@ -2,7 +2,7 @@ # copyright : Copyright (c) 2016-2019 Code Synthesis Ltd # license : ISC; see accompanying COPYING file -lib{pkgconf}: {h c}{* -version} {h}{version} +lib{pkgconf}: {h c}{* -config} {h}{config} tclass = $c.target.class @@ -12,21 +12,9 @@ windows = ($tclass == 'windows') msvc = ($c.class == 'msvc') -# The version file is internal (it is only included from the internal -# config.h) so we don't distribute nor install it (see below). -# -h{version}: in{version} $src_root/manifest - -# Build options. -# -# Note that we have to add "-I$src_root" for the headers auto-generating -# machinery to work properly. -# -c.poptions =+ "-I$out_root" "-I$src_root" - -# Define the PKG_DEFAULT_PATH, SYSTEM_INCLUDEDIR and SYSTEM_LIBDIR macros. -# The whole idea feels utterly broken (hello cross-compilation) so we will -# just do bare minimum and wait and see. +# Assign variables for the PKG_DEFAULT_PATH, SYSTEM_INCLUDEDIR, and +# SYSTEM_LIBDIR macro definitions. The whole idea feels utterly broken (hello +# cross-compilation) so we will just do bare minimum and wait and see. # # There is also PERSONALITY_PATH macro added in 1.5.1. It looks like the # personality files are invented to fix cross-compilation but are unlikely to @@ -66,21 +54,39 @@ else # # So we keep the macros empty. # - def_paths = "" + def_dirs = "" personality_dirs = "" } -c.poptions += -DPKG_DEFAULT_PATH=\"$def_dirs\" \ - -DSYSTEM_INCLUDEDIR=\"$inc_dirs\" \ - -DSYSTEM_LIBDIR=\"$lib_dirs\" \ - -DPERSONALITY_PATH=\"$personality_dirs\" +# The config header is internal (is only included from C files), so we don't +# distribute nor install it (see below). +# +h{config}: in{config} +{ + PACKAGE_VERSION = "$version.project_id" + + # Escape backslashes and quotes in the directory paths prior to representing + # them as C string literals. + # + SYSTEM_INCLUDEDIR = $regex.replace($inc_dirs, '(\\|")', '\\\1') + SYSTEM_LIBDIR = $regex.replace($lib_dirs, '(\\|")', '\\\1') + PKG_DEFAULT_PATH = $regex.replace($def_dirs, '(\\|")', '\\\1') + PERSONALITY_PATH = $regex.replace($personality_dirs, '(\\|")', '\\\1') +} + +# Build options. +# +# Note that we have to add "-I$src_root" for the headers auto-generating +# machinery to work properly. +# +c.poptions =+ "-I$out_root" "-I$src_root" # Disable warnings. # if $msvc c.coptions += /wd4996 /wd4267 -# Note: this should go last as it adds obj target-specific options. +# Note: this should go last as it adds obj target-specific poptions. # if! $windows { @@ -109,11 +115,6 @@ if! $windows } else { - cc.poptions += -DWIN32 -D_WINDOWS -D_MBCS - - if $msvc - cc.coptions += /GS /fp:precise /Zc:wchar_t /Zc:forScope - # See libpkgconf-api.h for details. # objs{*}: c.poptions += -DLIBPKGCONF_EXPORT @@ -140,16 +141,9 @@ else h{*}: install = include/libpkgconf/ install.include = $install.include/pkgconf/ -# Internal auto-generated header (see above). -# -h{version}: install = false - # Implementation details. # -# The upstream's config.h is generated during the configuration phase. We -# distribute a custom one with a minimal set of macro definitions required to -# build the project. Note that the file is internal (is only included from C -# files) and so is not installed. -# -for h: config stdinc win-dirent +h{config}: install = false + +for h: stdinc win-dirent h{$h}@./: install = false diff --git a/libpkgconf/libpkgconf/config.h b/libpkgconf/libpkgconf/config.h deleted file mode 100644 index c8d5cd5..0000000 --- a/libpkgconf/libpkgconf/config.h +++ /dev/null @@ -1,56 +0,0 @@ -/* file : libpkgconf/config.h -*- C -*- - * copyright : Copyright (c) 2016-2019 Code Synthesis Ltd - * license : ISC; see accompanying COPYING file - */ -#ifndef LIBPKGCONF_CONFIG_H -#define LIBPKGCONF_CONFIG_H - -/* - * For the semantics of the following macros refer to config.h.cmake.in.orig - * and upstream's CMakeList.txt. - * - * Note that we will explicitly undefine macros that are present in the - * libpkgconf source code but should not be defined. While this is not - * technically required, it simplifies the change tracking (see README-DEV). - * As a bonus we also make sure that they are not get eventually defined by - * some system headers. - */ - -/* - * Auto-generated. Defines the following configuration macros: - -#define PACKAGE_VERSION - - * Keep all the macros listed (in this exact form) for the change tracking - * (see README-DEV). - */ -#include - -/* - * strndup() is not present on Windows, for gcc and clang if compile with - * -std=C99, except for FreeBSD and MacOS. - * - * strl*() are only present on FreeBSD and MacOS. - */ -#if defined(__FreeBSD__) || defined(__APPLE__) -# define HAVE_STRNDUP 1 -# define HAVE_STRLCPY 1 -# define HAVE_STRLCAT 1 -#endif - -/* - * Let's assume cygwin_conv_path() is always available if compile with MSYS - * gcc. - */ -#if defined(__MSYS__) -# define HAVE_CYGWIN_CONV_PATH 1 -#endif - -/* - * We don't consider such an outdated environments. - */ -#define HAVE_SYS_STAT_H 1 - -#define PACKAGE_BUGREPORT "https://git.dereferenced.org/pkgconf/pkgconf/issues" - -#endif /* LIBPKGCONF_CONFIG_H */ diff --git a/libpkgconf/libpkgconf/config.h.cmake.in.orig b/libpkgconf/libpkgconf/config.h.cmake.in.orig deleted file mode 120000 index e991bcb..0000000 --- a/libpkgconf/libpkgconf/config.h.cmake.in.orig +++ /dev/null @@ -1 +0,0 @@ -../../upstream/libpkgconf/config.h.cmake.in \ No newline at end of file diff --git a/libpkgconf/libpkgconf/config.h.in b/libpkgconf/libpkgconf/config.h.in new file mode 100644 index 0000000..ac5b1fa --- /dev/null +++ b/libpkgconf/libpkgconf/config.h.in @@ -0,0 +1,53 @@ +/* file : libpkgconf/config.h.in -*- C -*- + * copyright : Copyright (c) 2016-2019 Code Synthesis Ltd + * license : ISC; see accompanying COPYING file + */ +#ifndef LIBPKGCONF_CONFIG_H +#define LIBPKGCONF_CONFIG_H + +/* + * For the semantics of the following macros refer to config.h.meson.orig + * and upstream's meson.build. + * + * Note that we will explicitly undefine macros that are present in the + * libpkgconf source code but should not be defined. While this is not + * technically required, it simplifies the change tracking (see README-DEV). + * As a bonus we also make sure that they are not get eventually defined by + * some system headers. + */ + +#define PACKAGE_VERSION "$PACKAGE_VERSION$" + +/* + * strndup() is not present on Windows, for gcc and clang if compile with + * -std=C99, except for FreeBSD and MacOS. + * + * strl*() are only present on FreeBSD and MacOS. + */ +#if defined(__FreeBSD__) || defined(__APPLE__) +# define HAVE_STRNDUP 1 +# define HAVE_STRLCPY 1 +# define HAVE_STRLCAT 1 +#endif + +/* + * Let's assume cygwin_conv_path() is always available if compile with MSYS + * gcc. + */ +#if defined(__MSYS__) +# define HAVE_CYGWIN_CONV_PATH 1 +#endif + +/* + * We don't consider such an outdated environments. + */ +#define HAVE_SYS_STAT_H 1 + +#define PACKAGE_BUGREPORT "https://todo.sr.ht/~kaniini/pkgconf" + +#define PKG_DEFAULT_PATH "$PKG_DEFAULT_PATH$" +#define PERSONALITY_PATH "$PERSONALITY_PATH$" +#define SYSTEM_INCLUDEDIR "$SYSTEM_INCLUDEDIR$" +#define SYSTEM_LIBDIR "$SYSTEM_LIBDIR$" + +#endif /* LIBPKGCONF_CONFIG_H */ diff --git a/libpkgconf/libpkgconf/config.h.meson.orig b/libpkgconf/libpkgconf/config.h.meson.orig new file mode 120000 index 0000000..db3eaf0 --- /dev/null +++ b/libpkgconf/libpkgconf/config.h.meson.orig @@ -0,0 +1 @@ +../../upstream/libpkgconf/config.h.meson \ No newline at end of file diff --git a/libpkgconf/libpkgconf/version.h.in b/libpkgconf/libpkgconf/version.h.in deleted file mode 100644 index 6b30948..0000000 --- a/libpkgconf/libpkgconf/version.h.in +++ /dev/null @@ -1,10 +0,0 @@ -/* file : libpkgconf/version.h.in -*- C -*- - * copyright : Copyright (c) 2016-2019 Code Synthesis Ltd - * license : ISC; see accompanying COPYING file - */ - -#ifndef PACKAGE_VERSION /* Note: using the version macro itself. */ - -#define PACKAGE_VERSION "$libpkgconf.version.project_id$" - -#endif /* PACKAGE_VERSION */ diff --git a/libpkgconf/manifest b/libpkgconf/manifest index 7f73729..6611d02 100644 --- a/libpkgconf/manifest +++ b/libpkgconf/manifest @@ -1,16 +1,16 @@ : 1 name: libpkgconf -version: 1.6.1-a.0.z +version: 1.6.3-a.0.z project: pkgconf summary: C library for retriving pkg-config compiler and linker flags license: ISC, MIT ; ISC for the most of original files. topics: C, build system, build toolchain description-file: README -url: https://git.dereferenced.org/pkgconf/pkgconf +url: https://git.sr.ht/~kaniini/pkgconf doc-url: http://pkgconf.readthedocs.io/en/latest/?badge=latest src-url: https://git.build2.org/cgit/packaging/pkgconf/pkgconf/tree/libpkgconf/ package-url: https://git.build2.org/cgit/packaging/pkgconf/ -email: packaging@build2.org ; Report issues at https://git.dereferenced.org/pkgconf/pkgconf/issues. +email: packaging@build2.org ; Report issues at https://todo.sr.ht/~kaniini/pkgconf. package-email: packaging@build2.org ; Mailing list. build-email: builds@build2.org builds: all diff --git a/upstream b/upstream index be60112..c862e03 160000 --- a/upstream +++ b/upstream @@ -1 +1 @@ -Subproject commit be6011222b52db362d2a4fdf602b4e4928b5317b +Subproject commit c862e030cf83447f679e4f49876f5298f0fc9691 -- cgit v1.1