pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/pkgtools/pkgin
Module Name: pkgsrc
Committed By: riastradh
Date: Mon May 27 23:27:10 UTC 2024
Modified Files:
pkgsrc/pkgtools/pkgin: Makefile distinfo
Added Files:
pkgsrc/pkgtools/pkgin/patches: patch-configure.ac
Log Message:
pkgtools/pkgin: Fix header file checks in configure.
https://github.com/NetBSDfr/pkgin/issues/133
configure.ac wrongly checks for header files in build environment
When configuring with --with-libarchive=/usr/pkg, pkgin's configure
script tests whether /usr/pkg and /usr/pkg/include/archive.h exist.
This is wrong -- it doesn't matter whether
/usr/pkg/include/archive.h exists; what matters is whether the
compiler can resolve #include <archive.h>, which it might be doing
relative to a sysroot like
/home/riastradh/netbsd/current/obj.evbarm64/destdir.evbarm.
configure.ac should use AC_CHECK_HEADER instead to check whether
#include <archive.h> works, and AC_CHECK_LIB to check whether
linking with -larchive works; similarly for libfetch, openssl, and
sqlite3. It should also provide a way to specify other arguments
than just CPPFLAGS=-I/prefix/include LDFLAGS=-L/prefix/lib
LIBS=-lwhatever, e.g. in principle some environments may need
LDFLAGS=-L/sdk/prefix/lib\ -Wl,-R/opt/prefix/lib or LIBS=-lfetch
-lssl -lcrypto.
The result of the status quo is that pkgin can't currently be
reasonably cross-compiled.
To generate a diff of this commit:
cvs rdiff -u -r1.129 -r1.130 pkgsrc/pkgtools/pkgin/Makefile
cvs rdiff -u -r1.79 -r1.80 pkgsrc/pkgtools/pkgin/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/pkgtools/pkgin/patches/patch-configure.ac
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/pkgtools/pkgin/Makefile
diff -u pkgsrc/pkgtools/pkgin/Makefile:1.129 pkgsrc/pkgtools/pkgin/Makefile:1.130
--- pkgsrc/pkgtools/pkgin/Makefile:1.129 Wed Jan 3 12:32:59 2024
+++ pkgsrc/pkgtools/pkgin/Makefile Mon May 27 23:27:10 2024
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.129 2024/01/03 12:32:59 gdt Exp $
+# $NetBSD: Makefile,v 1.130 2024/05/27 23:27:10 riastradh Exp $
DISTNAME= pkgin-23.8.1
-PKGREVISION= 3
+PKGREVISION= 4
CATEGORIES= pkgtools
MASTER_SITES= ${MASTER_SITE_GITHUB:=NetBSDfr/}
GITHUB_TAG= v${PKGVERSION_NOREV}
@@ -50,6 +50,12 @@ DEPENDS+= pkg_install>=20200701:../../p
.include "options.mk"
+USE_TOOLS+= autoconf automake
+
+pre-configure:
+ @${STEP_MSG} Regenerating configure
+ ${RUN}cd ${WRKSRC} && autoreconf -fiv
+
# those have official repositories
.if !empty(PKGIN_REPOSITORY_URL)
pre-install:
Index: pkgsrc/pkgtools/pkgin/distinfo
diff -u pkgsrc/pkgtools/pkgin/distinfo:1.79 pkgsrc/pkgtools/pkgin/distinfo:1.80
--- pkgsrc/pkgtools/pkgin/distinfo:1.79 Tue Aug 22 07:14:18 2023
+++ pkgsrc/pkgtools/pkgin/distinfo Mon May 27 23:27:10 2024
@@ -1,5 +1,6 @@
-$NetBSD: distinfo,v 1.79 2023/08/22 07:14:18 jperkin Exp $
+$NetBSD: distinfo,v 1.80 2024/05/27 23:27:10 riastradh Exp $
BLAKE2s (pkgin-23.8.1.tar.gz) = eb0f008ba9801a3c0a35de3e2b2503edd554c3cb17235b347bb8274a18794eb7
SHA512 (pkgin-23.8.1.tar.gz) = 2561d9e4b28a9a77c3c798612ec489dd67dd9a93c61344937095b0683fa89d8432a9ab8e600d0e2995d954888ac2e75a407bab08aa1e8198e375c99d2999f233
Size (pkgin-23.8.1.tar.gz) = 267029 bytes
+SHA1 (patch-configure.ac) = 53f56351fb602d9fdce2c1ed266d65919a369086
Added files:
Index: pkgsrc/pkgtools/pkgin/patches/patch-configure.ac
diff -u /dev/null pkgsrc/pkgtools/pkgin/patches/patch-configure.ac:1.1
--- /dev/null Mon May 27 23:27:10 2024
+++ pkgsrc/pkgtools/pkgin/patches/patch-configure.ac Mon May 27 23:27:10 2024
@@ -0,0 +1,167 @@
+$NetBSD: patch-configure.ac,v 1.1 2024/05/27 23:27:10 riastradh Exp $
+
+Fix cross-build.
+https://github.com/NetBSDfr/pkgin/issues/133
+https://github.com/NetBSDfr/pkgin/issues/134
+
+--- configure.ac.orig 2023-08-22 07:12:21.000000000 +0000
++++ configure.ac
+@@ -42,22 +42,20 @@ AC_ARG_WITH([libarchive],
+ [AS_HELP_STRING([--with-libarchive=DIR],
+ [Root libarchive directory (e.g. /usr/local)])],
+ [
+- AS_IF([test "x$withval" = "x" || ! test -d "$withval"],
+- AC_MSG_ERROR([Invalid --with-libarchive directory]))
+- AC_MSG_CHECKING([for $withval/include/archive.h])
+- AS_IF([test -f "$withval/include/archive.h"], [
+- LIBARCHIVE_INCLUDES="-I$withval/include"
+- LIBARCHIVE_LDFLAGS="-L$withval/lib"
+- LIBARCHIVE_LIBS="-larchive"
+- AC_MSG_RESULT([yes])
+- ],[
+- AC_MSG_RESULT([not found])
+- AC_MSG_ERROR([Could not find libarchive])
+- ])
+- ],[
+- AC_MSG_ERROR([--with-libarchive is mandatory])
++ LIBARCHIVE_INCLUDES="-I$withval/include"
++ LIBARCHIVE_LDFLAGS="-L$withval/lib"
++ LIBARCHIVE_LIBS="-larchive"
+ ]
+ )
++CPPFLAGS_save=$CPPFLAGS; CPPFLAGS="$CPPFLAGS $LIBARCHIVE_INCLUDES"
++LDFLAGS_save=$LDFLAGS; LDFLAGS="$LDFLAGS $LIBARCHIVE_LDFLAGS"
++LIBS_save=$LIBS; LIBS="$LIBS $LIBARCHIVE_LIBS"
++AC_CHECK_HEADER([archive.h],[],[AC_MSG_FAILURE([can't find archive.h])])
++AC_CHECK_LIB([archive],[archive_read_new],[],
++ [AC_MSG_FAILURE([can't find libarchive])])
++CPPFLAGS=$CPPFLAGS_save
++LDFLAGS=$LDFLAGS_save
++LIBS=$LIBS_save
+ AC_SUBST([LIBARCHIVE_INCLUDES])
+ AC_SUBST([LIBARCHIVE_LDFLAGS])
+ AC_SUBST([LIBARCHIVE_LIBS])
+@@ -66,22 +64,20 @@ AC_ARG_WITH([libfetch],
+ [AS_HELP_STRING([--with-libfetch=DIR],
+ [Root libfetch directory (e.g. /usr/local)])],
+ [
+- AS_IF([test "x$withval" = "x" || ! test -d "$withval"],
+- AC_MSG_ERROR([Invalid --with-libfetch directory]))
+- AC_MSG_CHECKING([for $withval/include/fetch.h])
+- AS_IF([test -f "$withval/include/fetch.h"], [
+- LIBFETCH_INCLUDES="-I$withval/include"
+- LIBFETCH_LDFLAGS="-L$withval/lib"
+- LIBFETCH_LIBS="-lfetch"
+- AC_MSG_RESULT([yes])
+- ],[
+- AC_MSG_RESULT([no])
+- AC_MSG_ERROR([Could not find libfetch])
+- ])
+- ],[
+- AC_MSG_ERROR([--with-libfetch is mandatory])
++ LIBFETCH_INCLUDES="-I$withval/include"
++ LIBFETCH_LDFLAGS="-L$withval/lib"
++ LIBFETCH_LIBS="-lfetch"
+ ]
+ )
++CPPFLAGS_save=$CPPFLAGS; CPPFLAGS="$CPPFLAGS $LIBFETCH_INCLUDES"
++LDFLAGS_save=$LDFLAGS; LDFLAGS="$LDFLAGS $LIBFETCH_LDFLAGS"
++LIBS_save=$LIBS; LIBS="$LIBS $LIBFETCH_LIBS"
++AC_CHECK_HEADER([fetch.h],[],[AC_MSG_FAILURE([can't find fetch.h])])
++AC_CHECK_LIB([fetch],[fetchMakeURL],[],
++ [AC_MSG_FAILURE([can't find libfetch])])
++CPPFLAGS=$CPPFLAGS_save
++LDFLAGS=$LDFLAGS_save
++LIBS=$LIBS_save
+ AC_SUBST([LIBFETCH_INCLUDES])
+ AC_SUBST([LIBFETCH_LDFLAGS])
+ AC_SUBST([LIBFETCH_LIBS])
+@@ -90,22 +86,21 @@ AC_ARG_WITH([openssl],
+ [AS_HELP_STRING([--with-openssl=DIR],
+ [Root openssl directory (e.g. /usr/local)])],
+ [
+- AS_IF([test "x$withval" = "x" || ! test -d "$withval"],
+- AC_MSG_ERROR([Invalid --with-openssl directory]))
+- AC_MSG_CHECKING([for $withval/include/openssl/ssl.h])
+- AS_IF([test -f "$withval/include/openssl/ssl.h"], [
+- OPENSSL_INCLUDES="-I$withval/include"
+- OPENSSL_LDFLAGS="-L$withval/lib"
+- OPENSSL_LIBS="-lssl -lcrypto"
+- AC_MSG_RESULT([yes])
+- ],[
+- AC_MSG_RESULT([no])
+- AC_MSG_ERROR([Could not find openssl])
+- ])
+- ],[
+- AC_MSG_ERROR([--with-openssl is mandatory])
++ OPENSSL_INCLUDES="-I$withval/include"
++ OPENSSL_LDFLAGS="-L$withval/lib"
++ OPENSSL_LIBS="-lssl -lcrypto"
+ ]
+ )
++CPPFLAGS_save=$CPPFLAGS; CPPFLAGS="$CPPFLAGS $OPENSSL_INCLUDES"
++LDFLAGS_save=$LDFLAGS; LDFLAGS="$LDFLAGS $OPENSSL_LDFLAGS"
++LIBS_save=$LIBS; LIBS="$LIBS $OPENSSL_LIBS"
++AC_CHECK_HEADER([openssl/ssl.h],[],
++ [AC_MSG_FAILURE([can't find openssl/ssl.h])])
++AC_CHECK_LIB([ssl],[SSL_CTX_new],[],
++ [AC_MSG_FAILURE([can't find libssl])])
++CPPFLAGS=$CPPFLAGS_save
++LDFLAGS=$LDFLAGS_save
++LIBS=$LIBS_save
+ AC_SUBST([OPENSSL_INCLUDES])
+ AC_SUBST([OPENSSL_LDFLAGS])
+ AC_SUBST([OPENSSL_LIBS])
+@@ -114,22 +109,20 @@ AC_ARG_WITH([sqlite3],
+ [AS_HELP_STRING([--with-sqlite3=DIR],
+ [Root sqlite3 directory (e.g. /usr/local)])],
+ [
+- AS_IF([test "x$withval" = "x" || ! test -d "$withval"],
+- AC_MSG_ERROR([Invalid --with-sqlite3 directory]))
+- AC_MSG_CHECKING([for $withval/include/sqlite3.h])
+- AS_IF([test -f "$withval/include/sqlite3.h"], [
+- SQLITE3_INCLUDES="-I$withval/include"
+- SQLITE3_LDFLAGS="-L$withval/lib"
+- SQLITE3_LIBS="-lsqlite3"
+- AC_MSG_RESULT([yes])
+- ],[
+- AC_MSG_RESULT([no])
+- AC_MSG_ERROR([Could not find sqlite3])
+- ])
+- ],[
+- AC_MSG_ERROR([--with-sqlite3 is mandatory])
++ SQLITE3_INCLUDES="-I$withval/include"
++ SQLITE3_LDFLAGS="-L$withval/lib"
++ SQLITE3_LIBS="-lsqlite3"
+ ]
+ )
++CPPFLAGS_save=$CPPFLAGS; CPPFLAGS="$CPPFLAGS $SQLITE3_INCLUDES"
++LDFLAGS_save=$LDFLAGS; LDFLAGS="$LDFLAGS $SQLITE3_LDFLAGS"
++LIBS_save=$LIBS; LIBS="$LIBS $SQLITE3_LIBS"
++AC_CHECK_HEADER([sqlite3.h],[],[AC_MSG_FAILURE([can't find sqlite3.h])])
++AC_CHECK_LIB([sqlite3],[sqlite3_open_v2],[],
++ [AC_MSG_FAILURE([can't find libsqlite3])])
++CPPFLAGS=$CPPFLAGS_save
++LDFLAGS=$LDFLAGS_save
++LIBS=$LIBS_save
+ AC_SUBST([SQLITE3_INCLUDES])
+ AC_SUBST([SQLITE3_LDFLAGS])
+ AC_SUBST([SQLITE3_LIBS])
+@@ -152,16 +145,7 @@ AC_ARG_WITH([pkg-install],
+ [AS_HELP_STRING([--with-pkg-install=DIR],
+ [Path to pkg_install commands (e.g. /usr/pkg/sbin)])],
+ [
+- AS_IF([test "x$withval" = "x" || ! test -d "$withval"],
+- AC_MSG_ERROR([Invalid --with-pkg-install directory]))
+- AC_MSG_CHECKING([for $withval/pkg_admin])
+- AS_IF([test -x "$withval/pkg_admin"], [
+- PKG_INSTALL_DIR="$withval"
+- AC_MSG_RESULT([yes])
+- ],[
+- AC_MSG_RESULT([no])
+- AC_MSG_ERROR([Could not find pkg_install])
+- ])
++ PKG_INSTALL_DIR="$withval"
+ ],[
+ AC_MSG_ERROR([--with-pkg-install is mandatory])
+ ]
Home |
Main Index |
Thread Index |
Old Index