Skip to content

Commit

Permalink
[vcpkg] Improve make builds (#10402)
Browse files Browse the repository at this point in the history
* update all 16 configure_make ports

* add make wrappers for msvc

* improve make builds

* fix relativ path errors on linux (and osx?)

* revisit all 16 portfiles again

* remove trace from install

* fix relative build path issues.

* bump control of the 16 configure ports

* never forget .... real linux is case sensitive ....

* Revert "bump control of the 16 configure ports"

This reverts commit 40d6d81.

* Revert "Revert "bump control of the 16 configure ports""

This reverts commit 9c9851d.

* bump control again for real ci rebuild

* add copy_source

* remove message

* pass parameters to vcpkg_build_make

* fix healpix build.

* fix libmagic regression

* fix libwandio regression

* pfring changes regression fix? (cannot test in wsl)

* ws change to retrigger CI

* fix libpq regression

* fix libudns regression

* add share/pkgconfig to PKG_CONFIG_PATH

* cleanup of deprecated options

* cleanup docs

* Revert "bump control again for real ci rebuild"

This reverts commit b4bc18e.

* shared binaries on linux should stay in lib. Only dlls are mvoed to bin

* move pkgconfig check and add message about missing system packages

* added autopoint as a build requirement

* fix prerun shell working dir.

* a few fixes from the x windows pr
- add libpath setting
- fixed pkgconfig search on windows platforms
- fixed autopoint msys package on windows

* fix release prefix

* minimal cleanup and ws changes to trigger true CI rebuild

* fix tcl by upgrading

* remove unnecessary rename

* fix pfring? can't test in WSL. Linux kernel headers required.

* fix lowercase in patch

* fix libwandio

* remove x264 from fail list

* replace wrappers with wrappers from automake

* update make ports

* remove unnecessary message

* refactor vcpkg_configure_make

* [tcl] remove stray ?

* [farmhash] fix build

* [freexl] ws change to retrigger ci build

* [x264] add pthread as a dependency

* [vcpkg/scripts] add ignore flag correctly

* [sdl] fix vcpkg_fixup_pkgconfig call

* [farmhash/freexl] delete configure and recreate it.

* [libudns] remove trailing ?

* [freexl] use empty build target

* [freexl] add system library; remove previous change

* Update ports/x264/portfile.cmake

Co-authored-by: Jack·Boos·Yu <[email protected]>

* [libwandio] remove unncessary comment

Co-authored-by: dan-shaw <[email protected]>
Co-authored-by: Jack·Boos·Yu <[email protected]>
  • Loading branch information
3 people authored May 21, 2020
1 parent f6dd5ae commit 27c6c94
Show file tree
Hide file tree
Showing 39 changed files with 882 additions and 463 deletions.
3 changes: 2 additions & 1 deletion ports/farmhash/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Source: farmhash
Version: 1.1
Version: 1.1-1
Homepage: https://github.com/google/farmhash
Description: FarmHash, a family of hash functions.
Supports: !arm
12 changes: 6 additions & 6 deletions ports/farmhash/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
vcpkg_fail_port_install(ON_ARCH "arm" "arm64" ON_TARGET "UWP" "Windows")
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
#Requires a compiler which understands '__builtin_unreachable':
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
Expand All @@ -9,12 +9,12 @@ vcpkg_from_github(
HEAD_REF master
)

set(FLAGS "-g -mavx -maes -O3")
if((VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_OSX) AND NOT ENV{CXX_FLAGS}) # This should be a compiler check
set(ENV{CXXFLAGS} "-maes -msse4.2")
endif()
file(REMOVE_RECURSE "${SOURCE_PATH}/configure")
vcpkg_configure_make(
SOURCE_PATH ${SOURCE_PATH}
AUTOCONFIG
OPTIONS
CXXFLAGS=${FLAGS}
)

vcpkg_install_make()
Expand Down
2 changes: 1 addition & 1 deletion ports/freexl/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: freexl
Version: 1.0.4-8
Version: 1.0.4-9
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
7 changes: 3 additions & 4 deletions ports/freexl/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
include(vcpkg_common_functions)
set(FREEXL_VERSION_STR "1.0.4")

vcpkg_download_distfile(ARCHIVE
Expand Down Expand Up @@ -36,8 +35,7 @@ if (VCPKG_TARGET_IS_WINDOWS)
INSTALLED_ROOT="${CURRENT_INSTALLED_DIR}"
INST_DIR="${CURRENT_PACKAGES_DIR}"
"LINK_FLAGS="
"LIBS_ALL=${LIBS_ALL_REL}"

"LIBS_ALL=${LIBS_ALL_REL}"
)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/freexl RENAME copyright)
Expand All @@ -64,7 +62,7 @@ elseif (CMAKE_HOST_UNIX OR CMAKE_HOST_APPLE) # Build in UNIX
ARCHIVE ${ARCHIVE}
OUT_SOURCE_PATH SOURCE_PATH
)

file(REMOVE_RECURSE "${SOURCE_PATH}/configure")
vcpkg_configure_make(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS_DEBUG
Expand All @@ -80,6 +78,7 @@ elseif (CMAKE_HOST_UNIX OR CMAKE_HOST_APPLE) # Build in UNIX
)

vcpkg_install_make()
vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES m)

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/freexl RENAME copyright)
Expand Down
2 changes: 1 addition & 1 deletion ports/healpix/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: healpix
Version: 1.12.10
Version: 1.12.10-1
Homepage: http://healpix.sourceforge.net/
Description: HEALPix is an acronym for Hierarchical Equal Area isoLatitude Pixelation of a sphere.
Build-Depends: cfitsio
Expand Down
24 changes: 14 additions & 10 deletions ports/healpix/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
vcpkg_fail_port_install(ON_TARGET "Windows" "OSX")

set(HEALPIX_VER 3.50)
set(HEALPIX_PACK_NAME ${HEALPIX_VER}_2018Dec10)

Expand All @@ -17,25 +15,31 @@ vcpkg_extract_source_archive_ex(
vcpkg_configure_make(
SOURCE_PATH ${SOURCE_PATH}
PROJECT_SUBPATH src/cxx
AUTOCONFIG
NO_DEBUG
COPY_SOURCE
OPTIONS
--with-libcfitsio-include=${CURRENT_INSTALLED_DIR}/include/cfitsio
--with-libcfitsio-lib=${CURRENT_INSTALLED_DIR}/lib
)

vcpkg_build_make()
vcpkg_build_make(BUILD_TARGET compile_all)
#vcpkg_fixup_pkgconfig()

# Install manually
set(OBJ_DIR ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/src/cxx/auto)
# Install manually because healpix has no install target
set(OBJ_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/auto")
file(GLOB_RECURSE HEALPIX_LIBS ${OBJ_DIR}/lib/*)
file(INSTALL ${HEALPIX_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/lib)
file(INSTALL ${HEALPIX_LIBS} DESTINATION "${CURRENT_PACKAGES_DIR}/lib")

file(GLOB_RECURSE HEALPIX_INCLUDES ${OBJ_DIR}/include/*)
file(INSTALL ${HEALPIX_INCLUDES} DESTINATION ${CURRENT_PACKAGES_DIR}/include)
file(INSTALL ${HEALPIX_INCLUDES} DESTINATION "${CURRENT_PACKAGES_DIR}/include")

file(GLOB_RECURSE HEALPIX_TOOLS ${OBJ_DIR}/bin/*)
file(INSTALL ${HEALPIX_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools)
file(INSTALL ${HEALPIX_TOOLS} DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}")

if(EXISTS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/")
set(OBJ_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/auto")
file(GLOB_RECURSE HEALPIX_LIBS ${OBJ_DIR}/lib/*)
file(INSTALL ${HEALPIX_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib)
endif()

# Handle copyright
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
2 changes: 1 addition & 1 deletion ports/libb2/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: libb2
Version: 0.98.1
Version: 0.98.1-1
Homepage: https://github.com/BLAKE2/libb2
Description: C library providing BLAKE2b, BLAKE2s, BLAKE2bp, BLAKE2sp
12 changes: 8 additions & 4 deletions ports/libb2/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
vcpkg_fail_port_install(MESSAGE "${PORT} currently only supports Linux platform" ON_TARGET "Windows" "OSX")

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO BLAKE2/libb2
Expand All @@ -8,12 +6,18 @@ vcpkg_from_github(
HEAD_REF master
)

set(OPTIONS)
if(CMAKE_HOST_WIN32)
set(OPTIONS --disable-native) # requires cpuid
endif()

vcpkg_configure_make(
SOURCE_PATH ${SOURCE_PATH}
AUTOCONFIG
OPTIONS ${OPTIONS}
)

vcpkg_install_make()
vcpkg_fixup_pkgconfig()


file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)

Expand Down
2 changes: 1 addition & 1 deletion ports/libcrafter/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: libcrafter
Version: 0.3
Version: 0.3-1
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
5 changes: 1 addition & 4 deletions ports/libcrafter/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
vcpkg_fail_port_install(MESSAGE "${PORT} currently only supports Linux platforms" ON_TARGET "Windows" "OSX")

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO pellegre/libcrafter
Expand All @@ -11,10 +9,9 @@ vcpkg_from_github(

vcpkg_configure_make(
SOURCE_PATH ${SOURCE_PATH}
AUTOCONFIG
PROJECT_SUBPATH libcrafter
OPTIONS
--with-libpcap=${CURRENT_INSTALLED_DIR}
"--with-libpcap=${CURRENT_INSTALLED_DIR}"
)

vcpkg_install_make()
Expand Down
2 changes: 1 addition & 1 deletion ports/libmagic/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: libmagic
Version: 5.37
Version: 5.37-1
Homepage: https://github.com/file/file
Description: This library can be used to classify files according to magic number tests.
7 changes: 1 addition & 6 deletions ports/libmagic/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
vcpkg_fail_port_install(MESSAGE "${PORT} currently only supports Linux and Mac platform" ON_TARGET "Windows")

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO file/file
Expand All @@ -10,11 +8,8 @@ vcpkg_from_github(

vcpkg_configure_make(
SOURCE_PATH ${SOURCE_PATH}
AUTOCONFIG
)

vcpkg_install_make()

vcpkg_copy_pdbs()

if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
Expand All @@ -23,7 +18,7 @@ endif()

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/man/man5)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/man5)

# Handle copyright
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
2 changes: 1 addition & 1 deletion ports/libmesh/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: libmesh
Version: 1.5.0
Version: 1.5.0-1
Homepage: https://github.com/libMesh/libmesh
Description: The libMesh library provides a framework for the numerical simulation of partial differential equations using arbitrary unstructured discretizations on serial and parallel platforms. A major goal of the library is to provide support for adaptive mesh refinement (AMR) computations in parallel while allowing a research scientist to focus on the physics they are modeling.
13 changes: 10 additions & 3 deletions ports/libmesh/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
vcpkg_fail_port_install(MESSAGE "${PORT} currently only supports Linux platform" ON_TARGET "Windows")

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO libMesh/libmesh
Expand All @@ -8,9 +6,18 @@ vcpkg_from_github(
HEAD_REF master
)

if(VCPKG_TARGET_IS_WINDOWS)
set(OPTIONS --disable-qhull )
endif()
# There a lot of configure options in this port which are not yet correctly handled by VCPKG
# To only mention two:
# --enable-vtk-required Error if VTK is not detected by configure
# --enable-capnp-required Error if Cap'n Proto support is not detected by
# but there are a lot more which need to be checked/fixed
# So this port can only be considered a Work In Progress
vcpkg_configure_make(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS ${OPTIONS}
)

vcpkg_install_make()
Expand Down
5 changes: 3 additions & 2 deletions ports/libosip2/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Source: libosip2
Version: 5.1.0-3
Version: 5.1.0-4
Homepage: https://www.gnu.org/software/osip/
Description: oSIP is an LGPL implementation of SIP. It's stable, portable, flexible and compliant! -may be more-! It is used mostly with eXosip2 stack (GPL) which provides simpler API for User-Agent implementation.
Supports: !(windows|uwp)
Build-Depends: pthread
Supports: !(windows|uwp)
20 changes: 6 additions & 14 deletions ports/libosip2/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
vcpkg_fail_port_install(MESSAGE "${PORT} only supports Unix currently." ON_TARGET "Windows")

set(LIBOSIP2_VER "5.1.0")

vcpkg_download_distfile(ARCHIVE
Expand All @@ -13,24 +11,18 @@ vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH
)

if(VCPKG_TARGET_IS_WINDOWS)
set(OPTIONS --enable-mt=no)
endif()
vcpkg_configure_make(
SOURCE_PATH ${SOURCE_PATH}
NO_DEBUG
AUTO_HOST
AUTO_DST
PRERUN_SHELL autogen.sh
OPTIONS ${OPTIONS}
)

vcpkg_install_make()

vcpkg_fixup_pkgconfig()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(GLOB_RECURSE LIBOSIP2_BINARIES ${CURRENT_PACKAGES_DIR}/lib *.so)
foreach(LIBOSIP2_BINARY LIBOSIP2_BINARIES)
if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
file(COPY ${LIBOSIP2_BINARY} DESTINATION ${CURRENT_PACKAGES_DIR}/bin)
endif()
file(REMOVE ${LIBOSIP2_BINARY})
endforeach()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)

# Handle copyright
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
9 changes: 3 additions & 6 deletions ports/libpq/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,7 @@ if(VCPKG_TARGET_IS_WINDOWS)
else()
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT})
endif()
#file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/${PORT}/)
#vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT})

message(STATUS "Cleanup libpq ${TARGET_TRIPLET}... - done")
else()
if("${FEATURES}" MATCHES "openssl")
Expand All @@ -262,21 +261,19 @@ else()
endif()
vcpkg_configure_make(
SOURCE_PATH ${SOURCE_PATH}
COPY_SOURCE
OPTIONS
${BUILD_OPTS}
--with-includes=${CURRENT_INSTALLED_DIR}/include
OPTIONS_RELEASE
--exec-prefix=${CURRENT_PACKAGES_DIR}/tools/${PORT}
--datarootdir=${CURRENT_PACKAGES_DIR}/share/${PORT}
--with-libraries=${CURRENT_INSTALLED_DIR}/lib
OPTIONS_DEBUG
--exec-prefix=${CURRENT_PACKAGES_DIR}/debug/tools/${PORT}
--datarootdir=${CURRENT_PACKAGES_DIR}/debug/share/${PORT}
--with-libraries=${CURRENT_INSTALLED_DIR}/debug/lib
--enable-debug
)

vcpkg_install_make()

# instead?
# make -C src/include install
# make -C src/interfaces install
Expand Down
2 changes: 1 addition & 1 deletion ports/libudns/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: libudns
Version: 0.4-1
Version: 0.4-2
Homepage: https://github.com/ortclib/udns
Description: The DNS library, udns, implements thread-safe stub DNS resolver functionality, which may be used both traditional, syncronous way and asyncronously, with application-supplied event loop.
26 changes: 26 additions & 0 deletions ports/libudns/ignore_unknown_options.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/configure b/configure
index dda98b3ab..6f5f8a3c8 100644
--- a/configure
+++ b/configure
@@ -25,10 +25,9 @@ fi
enable() {
opt=`echo "$1" | sed 's/^--[^-]*-//'`
case "$opt" in
- ipv6) ;;
- *) echo "configure: unrecognized option \`$1'" >&2; exit 1;;
+ ipv6) eval enable_$opt=$2 ;;
+ *) echo "configure: unrecognized option \`$1'" >&2;;
esac
- eval enable_$opt=$2
}

while [ $# -gt 0 ]; do
@@ -50,7 +49,7 @@ Optional features (all enabled by default if system supports a feature):
EOF
exit 0
;;
- *) echo "configure: unknown option \`$1'" >&2; exit 1 ;;
+ *) echo "configure: unknown option \`$1'" >&2;;
esac
shift
done
7 changes: 4 additions & 3 deletions ports/libudns/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
vcpkg_fail_port_install(MESSAGE "${PORT} currently only supports Linux platform" ON_TARGET "Windows" "OSX")
vcpkg_fail_port_install(MESSAGE "${PORT} currently only supports Linux platform" ON_TARGET "Windows" "OSX")

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO ortclib/udns
REF udns_0_4
SHA512 4df8def718c75872536d42a757237d6c8e0afce8a53aedd7fea73814dc5cf8b5d6c9ae8f01a8cfc76864aa8293c172f08953a6750a66749ba19a3721bb4cf2ec
HEAD_REF master
PATCHES ignore_unknown_options.patch
)

vcpkg_configure_make(
SOURCE_PATH ${SOURCE_PATH}
DISABLE_AUTO_DST
COPY_SOURCE
)

vcpkg_build_make()

vcpkg_fixup_pkgconfig()
# Install
if(NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL debug)
file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/libudns.a DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib)
Expand Down
5 changes: 3 additions & 2 deletions ports/libwandio/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Source: libwandio
Version: 4.2.1
Version: 4.2.1-2
Homepage: https://github.com/wanduow/wandio
Description: C library for simple and efficient file IO.
Description: C library for simple and efficient file IO.
Build-Depends: zlib, zstd, liblzma, lz4, curl, pthread, bzip2
Loading

0 comments on commit 27c6c94

Please sign in to comment.