Skip to content

Commit

Permalink
[vcpkg/scripts/make] trying to iron out some issues (#11836)
Browse files Browse the repository at this point in the history
* take changes from fontconfig pr

* [farmhash] add autoconf

* [freexl] add autoconf

* [healpix] add autoconf

* [libb2] add autoconf

* [libwandio] add autoconf and patch

* more autoconf

* [x264] fix windows build issues

* minimal cleanup

* [libwandio] some fixes

* [vcpkg/scripts/make] add include to C/CXX flags correctly set machine flags for linker

* remove unnecessary comments part 1

* cleanup part 2

* cleanup

* remove unnecessary code

* [pbc] fix osx regressions

* [lzokay] format manifest

* try to copy sources to fix build issues

* add autoconfig to force updated configure scripts

* bump port versions of openmpi and ocilib

* added lib paths back into vcpkg_build_make because they are probably required

* Use CPP flags
add quotes around restoring of ENV
add LIB and LIBPATH correctly

* Apply suggestions from code review

Co-authored-by: ras0219 <[email protected]>

* Apply more changes forom CR
- remove mingw make
- add doc for missing options
- introduce two new macros for backup/restore of env vars

* fix wrong variables.

* use the list macro instead of the single var macro

* also use it at the top

Co-authored-by: Jack·Boos·Yu <[email protected]>
Co-authored-by: Nicole Mazzuca <[email protected]>
Co-authored-by: ras0219 <[email protected]>
  • Loading branch information
4 people authored Aug 13, 2020
1 parent 3ee1283 commit 4935f12
Show file tree
Hide file tree
Showing 27 changed files with 432 additions and 316 deletions.
3 changes: 2 additions & 1 deletion ports/farmhash/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Source: farmhash
Version: 1.1-1
Version: 1.1
Port-Version: 2
Homepage: https://github.com/google/farmhash
Description: FarmHash, a family of hash functions.
Supports: !arm
1 change: 1 addition & 0 deletions ports/farmhash/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ if((VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_OSX) AND NOT ENV{CXX_FLAGS}) # This
endif()
file(REMOVE_RECURSE "${SOURCE_PATH}/configure")
vcpkg_configure_make(
AUTOCONFIG
SOURCE_PATH ${SOURCE_PATH}
)

Expand Down
3 changes: 2 additions & 1 deletion ports/freexl/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Source: freexl
Version: 1.0.4-9
Version: 1.0.4
Port-Version: 10
Homepage: https://www.gaia-gis.it/gaia-sins/freexl-sources
Description: FreeXL is an open source library to extract valid data from within an Excel (.xls) spreadsheet
Build-Depends: libiconv
1 change: 1 addition & 0 deletions ports/freexl/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ elseif (CMAKE_HOST_UNIX OR CMAKE_HOST_APPLE) # Build in UNIX
)
file(REMOVE_RECURSE "${SOURCE_PATH}/configure")
vcpkg_configure_make(
AUTOCONFIG
SOURCE_PATH ${SOURCE_PATH}
OPTIONS_DEBUG
INSTALLED_ROOT="${CURRENT_INSTALLED_DIR}"
Expand Down
3 changes: 2 additions & 1 deletion ports/healpix/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Source: healpix
Version: 1.12.10-5
Version: 1.12.10
Port-Version: 6
Homepage: http://healpix.sourceforge.net/
Description: HEALPix is an acronym for Hierarchical Equal Area isoLatitude Pixelation of a sphere.
Build-Depends: cfitsio
Expand Down
1 change: 1 addition & 0 deletions ports/healpix/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ vcpkg_from_sourceforge(
)

vcpkg_configure_make(
AUTOCONFIG
SOURCE_PATH ${SOURCE_PATH}
PROJECT_SUBPATH src/cxx
COPY_SOURCE
Expand Down
1 change: 1 addition & 0 deletions ports/libb2/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ if(CMAKE_HOST_WIN32)
endif()

vcpkg_configure_make(
AUTOCONFIG
SOURCE_PATH ${SOURCE_PATH}
OPTIONS ${OPTIONS}
)
Expand Down
2 changes: 1 addition & 1 deletion ports/libb2/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "libb2",
"version-string": "0.98.1",
"port-version": 3,
"port-version": 4,
"description": "C library providing BLAKE2b, BLAKE2s, BLAKE2bp, BLAKE2sp",
"homepage": "https://github.com/BLAKE2/libb2",
"supports": "!windows"
Expand Down
5 changes: 3 additions & 2 deletions ports/libcrafter/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Source: libcrafter
Version: 0.3-1
Version: 0.3
Port-Version: 2
Homepage: https://github.com/pellegre/libcrafter
Description: Libcrafter is a high level library for C++ designed to create and decode network packets.
Build-Depends: libpcap
Build-Depends: libpcap
1 change: 1 addition & 0 deletions ports/libcrafter/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ vcpkg_from_github(
)

vcpkg_configure_make(
AUTOCONFIG
SOURCE_PATH ${SOURCE_PATH}
PROJECT_SUBPATH libcrafter
OPTIONS
Expand Down
5 changes: 3 additions & 2 deletions ports/libmagic/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Source: libmagic
Version: 5.37-1
Version: 5.37
Port-Version: 2
Homepage: https://github.com/file/file
Description: This library can be used to classify files according to magic number tests.
Description: This library can be used to classify files according to magic number tests.
1 change: 1 addition & 0 deletions ports/libmagic/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ vcpkg_from_github(
)

vcpkg_configure_make(
AUTOCONFIG
SOURCE_PATH ${SOURCE_PATH}
)
vcpkg_install_make()
Expand Down
6 changes: 4 additions & 2 deletions ports/libwandio/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
Source: libwandio
Version: 4.2.1-2
Version: 4.2.1
Port-Version: 3
Homepage: https://github.com/wanduow/wandio
Description: C library for simple and efficient file IO.
Build-Depends: zlib, zstd, liblzma, lz4, curl, pthread, bzip2
Build-Depends: zlib, zstd, liblzma, lzo, lz4, curl, pthread, bzip2
Supports: !windows
18 changes: 0 additions & 18 deletions ports/libwandio/configure.lib.patch
Original file line number Diff line number Diff line change
Expand Up @@ -120,21 +120,3 @@ index 4579fbb3d..f6be008c8 100644
fi
AC_DEFINE(HAVE_LIBLZ4S, 1, "Compiled with lz4 stream support")
with_lz4=streamapi
@@ -296,12 +304,14 @@ AC_ARG_WITH([http],
AS_IF([test "x$with_http" != "xno"],
[
# we need curl_easy_pause which was added in 7.18.0
- AC_CHECK_LIB(curl, curl_easy_pause, have_curl=yes, have_curl=no)
+ AC_SEARCH_LIBS(curl_easy_pause, [curl curl-d], have_curl=yes, have_curl=no, [-lssl -lcrypto $ac_cv_search_pthread_create -ldl])
+ # AC_CHECK_LIB(curl, curl_easy_pause, have_curl=yes, have_curl=no)
], [have_curl=no])

AS_IF([test "x$have_curl" = "xyes"], [
- if test "$ac_cv_lib_curl_curl_easy_pause" != "none required"; then
- LIBWANDIO_LIBS="$LIBWANDIO_LIBS -lcurl"
+ if test "$ac_cv_search_curl_easy_pause" != "none required"; then
+ LIBWANDIO_LIBS="$LIBWANDIO_LIBS $ac_cv_search_curl_easy_pause -lssl -lcrypto $ac_cv_search_pthread_create -ldl"
+ LIBS="$LIBS -lssl -lcrypto $ac_cv_search_pthread_create -ldl"
fi
AC_DEFINE(HAVE_HTTP, 1, "Compiled with http support")
with_http=yes],
14 changes: 14 additions & 0 deletions ports/libwandio/configure.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/configure.ac b/configure.ac
index e250c0c31..0465120ba 100644
--- a/configure.ac
+++ b/configure.ac
@@ -83,7 +83,7 @@ ADD_INCLS=""
ADD_LDFLAGS="$ADD_LDFLAGS -L\$(abs_top_srcdir)/lib"
LIBWANDIO_LIBS=""

-CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wextra -DLT_BUILDING_DLL=1"
+CFLAGS="$CFLAGS -Wall -DLT_BUILDING_DLL=1 -DNOMINMAX"
-CXXFLAGS="$CXXFLAGS -Wall -DLT_BUILDING_DLL=1"
+CXXFLAGS="$CXXFLAGS -Wall -DLT_BUILDING_DLL=1 -DNOMINMAX"

# Check for -fvisibility
22 changes: 22 additions & 0 deletions ports/libwandio/curl.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
diff --git a/configure.ac b/configure.ac
index 4579fbb3d..f6be008c8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -296,12 +304,14 @@ AC_ARG_WITH([http],
AS_IF([test "x$with_http" != "xno"],
[
# we need curl_easy_pause which was added in 7.18.0
- AC_CHECK_LIB(curl, curl_easy_pause, have_curl=yes, have_curl=no)
+ AC_SEARCH_LIBS(curl_easy_pause, [curl curl-d libcurl libcurl-d], have_curl=yes, have_curl=no, [-lCrypt32 -lWldap32 -lWs2_32 -ladvapi32])
+ # AC_CHECK_LIB(curl, curl_easy_pause, have_curl=yes, have_curl=no)
], [have_curl=no])

AS_IF([test "x$have_curl" = "xyes"], [
- if test "$ac_cv_lib_curl_curl_easy_pause" != "none required"; then
- LIBWANDIO_LIBS="$LIBWANDIO_LIBS -lcurl"
+ if test "$ac_cv_search_curl_easy_pause" != "none required"; then
+ LIBWANDIO_LIBS="$LIBWANDIO_LIBS -lCrypt32 -lWldap32 -lWs2_32 -ladvapi32 $ac_cv_search_curl_easy_pause"
+ LIBS="$LIBS"
fi
AC_DEFINE(HAVE_HTTP, 1, "Compiled with http support")
with_http=yes],
22 changes: 22 additions & 0 deletions ports/libwandio/openssl.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
diff --git a/configure.ac b/configure.ac
index 4579fbb3d..f6be008c8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -296,12 +304,14 @@ AC_ARG_WITH([http],
AS_IF([test "x$with_http" != "xno"],
[
# we need curl_easy_pause which was added in 7.18.0
- AC_CHECK_LIB(curl, curl_easy_pause, have_curl=yes, have_curl=no)
+ AC_SEARCH_LIBS(curl_easy_pause, [curl curl-d], have_curl=yes, have_curl=no, [-lssl -lcrypto $ac_cv_search_pthread_create -ldl])
+ # AC_CHECK_LIB(curl, curl_easy_pause, have_curl=yes, have_curl=no)
], [have_curl=no])

AS_IF([test "x$have_curl" = "xyes"], [
- if test "$ac_cv_lib_curl_curl_easy_pause" != "none required"; then
- LIBWANDIO_LIBS="$LIBWANDIO_LIBS -lcurl"
+ if test "$ac_cv_search_curl_easy_pause" != "none required"; then
+ LIBWANDIO_LIBS="$LIBWANDIO_LIBS $ac_cv_search_curl_easy_pause -lssl -lcrypto $ac_cv_search_pthread_create -ldl"
+ LIBS="$LIBS -lssl -lcrypto $ac_cv_search_pthread_create -ldl"
fi
AC_DEFINE(HAVE_HTTP, 1, "Compiled with http support")
with_http=yes],
11 changes: 11 additions & 0 deletions ports/libwandio/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
if(VCPKG_TARGET_IS_WINDOWS)
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
set(PATCHES curl.patch)
#TODO: Still does not work. Requires proper "signal" support and "unistd"
else()
set(PATCHES openssl.patch) # needed if curl is using openssl
endif()

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO wanduow/wandio
REF 012b646e7ba7ab191a5a2206488adfac493fcdc6
SHA512 e94a82038902c34933c4256f8bd4d7ef3f2cf32fea46f8e31a25df34cc90d3a275ff56d3bc9892aca0c85e6d875e696f96a836cc1444fe165db8364331e6e77d
HEAD_REF master
PATCHES configure.lib.patch # This is how configure.ac files with dependencies get fixed.
configure.patch
${PATCHES}
)

vcpkg_configure_make(
AUTOCONFIG
SOURCE_PATH ${SOURCE_PATH}
COPY_SOURCE
)
Expand Down
3 changes: 2 additions & 1 deletion ports/ocilib/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Source: ocilib
Version: 4.6.4-1
Version: 4.6.4
Port-Version: 2
Homepage: https://vrogier.github.io/ocilib/
Description: OCILIB is an open source and cross platform Oracle Driver that delivers efficient access to Oracle databases.
Supports: !(arm|uwp)
74 changes: 38 additions & 36 deletions ports/ocilib/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,62 +1,64 @@
vcpkg_fail_port_install(ON_ARCH "arm" ON_TARGET "uwp")

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO vrogier/ocilib
REF v4.6.4
SHA512 83f5614a23c8fb4ab02517dec95d8b490c5ef472302735d5cc4cf483cc51513cc81ae2e1b4618c7c73fb5b071efe422e463b46fa79492ccb4775b511a943295a
HEAD_REF master
PATCHES
out_of_source_build_version_file_configure.patch
OUT_SOURCE_PATH SOURCE_PATH
REPO vrogier/ocilib
REF v4.6.4
SHA512 83f5614a23c8fb4ab02517dec95d8b490c5ef472302735d5cc4cf483cc51513cc81ae2e1b4618c7c73fb5b071efe422e463b46fa79492ccb4775b511a943295a
HEAD_REF master
PATCHES
out_of_source_build_version_file_configure.patch
)

if(VCPKG_TARGET_IS_WINDOWS)
if(VCPKG_PLATFORM_TOOLSET MATCHES "v142")
if(VCPKG_PLATFORM_TOOLSET MATCHES "v142")
set(SOLUTION_TYPE vs2019)
set(OCILIB_ARCH_X86 x86)
set(OCILIB_ARCH_X64 x64)
elseif(VCPKG_PLATFORM_TOOLSET MATCHES "v141")
elseif(VCPKG_PLATFORM_TOOLSET MATCHES "v141")
set(SOLUTION_TYPE vs2017)
set(OCILIB_ARCH_X86 Win32)
set(OCILIB_ARCH_X64 Win64)
else()
else()
set(SOLUTION_TYPE vs2015)
set(OCILIB_ARCH_X86 Win32)
set(OCILIB_ARCH_X64 Win64)
endif()
endif()

if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
set(PLATFORM ${OCILIB_ARCH_X86})
else()
set(PLATFORM ${OCILIB_ARCH_X64})
endif()
# There is no debug configuration
# As it is a C library, build the release configuration and copy its output to the debug folder
set(VCPKG_BUILD_TYPE release)
vcpkg_install_msbuild(
SOURCE_PATH ${SOURCE_PATH}
PROJECT_SUBPATH proj/dll/ocilib_dll_${SOLUTION_TYPE}.sln
INCLUDES_SUBPATH include
LICENSE_SUBPATH LICENSE
RELEASE_CONFIGURATION "Release - ANSI"
PLATFORM ${PLATFORM}
USE_VCPKG_INTEGRATION
ALLOW_ROOT_INCLUDES)
# There is no debug configuration
# As it is a C library, build the release configuration and copy its output to the debug folder
set(VCPKG_BUILD_TYPE release)
vcpkg_install_msbuild(
SOURCE_PATH ${SOURCE_PATH}
PROJECT_SUBPATH proj/dll/ocilib_dll_${SOLUTION_TYPE}.sln
INCLUDES_SUBPATH include
LICENSE_SUBPATH LICENSE
RELEASE_CONFIGURATION "Release - ANSI"
PLATFORM ${PLATFORM}
USE_VCPKG_INTEGRATION
ALLOW_ROOT_INCLUDES)

file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug)
file(COPY ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug)
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug)
file(COPY ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug)
else()
vcpkg_configure_make(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS
--with-oracle-import=runtime
)
vcpkg_configure_make(
COPY_SOURCE
AUTOCONFIG
SOURCE_PATH ${SOURCE_PATH}
OPTIONS
--with-oracle-import=runtime
)

vcpkg_install_make()
vcpkg_install_make()

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/doc/${PORT} ${CURRENT_PACKAGES_DIR}/share/${PORT})
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/doc)
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/doc/${PORT} ${CURRENT_PACKAGES_DIR}/share/${PORT})
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/doc)
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
endif()
1 change: 1 addition & 0 deletions ports/openmpi/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Source: openmpi
Version: 4.0.3
Port-Version: 2
Homepage: https://www.open-mpi.org/
Description: The Open MPI Project is an open source Message Passing Interface implementation that is developed and maintained by a consortium of academic, research, and industry partners. Open MPI is therefore able to combine the expertise, technologies, and resources from all across the High Performance Computing community in order to build the best MPI library available. Open MPI offers advantages for system and software vendors, application developers and computer science researchers.
Supports: !(windows|uwp)
1 change: 1 addition & 0 deletions ports/openmpi/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ get_filename_component(PERL_PATH ${PERL} DIRECTORY)
vcpkg_add_to_path(${PERL_PATH})

vcpkg_configure_make(
COPY_SOURCE
SOURCE_PATH ${SOURCE_PATH}
OPTIONS
--with-hwloc=internal
Expand Down
4 changes: 2 additions & 2 deletions ports/pbc/CONTROL
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Source: pbc
Version: 0.5.14
Port-Version: 3
Build-Depends: mpir (windows), gmp(!windows)
Port-Version: 4
Build-Depends: mpir (windows), gmp (!windows)
Homepage: https://crypto.stanford.edu/pbc
Description: Pairing-Based Crypto library provides low-level routines for pairing-based cryptosystems.
Supports: !uwp
5 changes: 3 additions & 2 deletions ports/x264/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Source: x264
Version: 157-303c484ec828ed0-8
Version: 157-303c484ec828ed0
Port-Version: 9
Homepage: https://github.com/mirror/x264
Description: x264 is a free software library and application for encoding video streams into the H.264/MPEG-4 AVC compression format
Build-Depends: pthread (linux&osx)
Build-Depends: pthread (linux&osx)
Loading

0 comments on commit 4935f12

Please sign in to comment.