Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[jemalloc|vcpkg_configure_make] update and some script fixes #25009

Merged
merged 20 commits into from
Aug 19, 2022
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion docs/maintainers/vcpkg_configure_make.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Configure configure for Debug and Release builds of a project.
vcpkg_configure_make(
SOURCE_PATH <${SOURCE_PATH}>
[AUTOCONFIG]
[USE_WRAPPERS]
[USE_WRAPPERS] [NO_WRAPPERS]
[DETERMINE_BUILD_TRIPLET]
[BUILD_TRIPLET "--host=x64 --build=i686-unknown-pc"]
[NO_ADDITIONAL_PATHS]
Expand Down Expand Up @@ -42,6 +42,9 @@ Skip configure process
### USE_WRAPPERS
Use autotools ar-lib and compile wrappers (only applies to windows cl and lib)

### NO_WRAPPERS
Deactivate the use of autotools ar-lib and compile wrappers (only applies to windows cl and lib)

### BUILD_TRIPLET
Used to pass custom --build/--target/--host to configure. Can be globally overwritten by VCPKG_MAKE_BUILD_TRIPLET

Expand Down
67 changes: 0 additions & 67 deletions ports/jemalloc/fix-cmakelists.patch

This file was deleted.

13 changes: 13 additions & 0 deletions ports/jemalloc/fix-configure-ac.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/configure.ac b/configure.ac
index f6d25f334..3115504e2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1592,7 +1592,7 @@ fi
[enable_uaf_detection="0"]
)
if test "x$enable_uaf_detection" = "x1" ; then
- AC_DEFINE([JEMALLOC_UAF_DETECTION], [ ])
+ AC_DEFINE([JEMALLOC_UAF_DETECTION], [ ], ["enable UAF"])
fi
AC_SUBST([enable_uaf_detection])

25 changes: 0 additions & 25 deletions ports/jemalloc/fix-static-build.patch

This file was deleted.

30 changes: 0 additions & 30 deletions ports/jemalloc/fix-utilities.patch

This file was deleted.

63 changes: 41 additions & 22 deletions ports/jemalloc/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,35 +1,54 @@
vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO jemalloc/jemalloc-cmake
REF jemalloc-cmake.4.3.1
SHA512 e94b62ec3a53acc0ab5acb247d7646bc172108e80f592bb41c2dd50d181cbbeb33d623adf28415ffc0a0e2de3818af2dfe4c04af75ac891ef5042bc5bb186886
REPO jemalloc/jemalloc
JackBoosY marked this conversation as resolved.
Show resolved Hide resolved
REF 54eaed1d8b56b1aa528be3bdd1877e59c56fa90c
SHA512 527bfbf5db9a5c2b7b04df4785b6ae9d445cff8cb17298bf3e550c88890d2bd7953642d8efaa417580610508279b527d3a3b9e227d17394fd2013c88cb7ae75a
HEAD_REF master
PATCHES
fix-cmakelists.patch
fix-utilities.patch
fix-static-build.patch
fix-configure-ac.patch
preprocessor.patch
)

if (VCPKG_CRT_LINKAGE STREQUAL "dynamic")
set(BUILD_STATIC_LIBRARY OFF)
else()
set(BUILD_STATIC_LIBRARY ON)
if(VCPKG_TARGET_IS_WINDOWS)
set(opts "ac_cv_search_log=none required" "--without-private-namespace")
Neumann-A marked this conversation as resolved.
Show resolved Hide resolved
endif()
vcpkg_configure_cmake(
DISABLE_PARALLEL_CONFIGURE
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS -DGIT_FOUND=OFF -DCMAKE_DISABLE_FIND_PACKAGE_Git=ON -Dwithout-export=${BUILD_STATIC_LIBRARY}

vcpkg_configure_make(
SOURCE_PATH "${SOURCE_PATH}"
AUTOCONFIG
NO_WRAPPERS
OPTIONS ${opts}
)

vcpkg_install_cmake()
vcpkg_install_make()

if(VCPKG_TARGET_IS_WINDOWS)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/lib/jemalloc.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/lib")
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/bin")
file(RENAME "${CURRENT_PACKAGES_DIR}/lib/jemalloc.dll" "${CURRENT_PACKAGES_DIR}/bin/jemalloc.dll")
endif()
if(NOT VCPKG_BUILD_TYPE)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/lib/jemalloc.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib")
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/bin")
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/jemalloc.dll" "${CURRENT_PACKAGES_DIR}/debug/bin/jemalloc.dll")
endif()
endif()
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/jemalloc.pc" "install_suffix=" "install_suffix=_s")
if(NOT VCPKG_BUILD_TYPE)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/jemalloc.pc" "install_suffix=" "install_suffix=_s")
endif()
endif()
endif()

vcpkg_fixup_pkgconfig()

vcpkg_copy_pdbs()

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/tools")

# Handle copyright
file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/jemalloc)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/jemalloc/COPYING ${CURRENT_PACKAGES_DIR}/share/jemalloc/copyright)
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
12 changes: 12 additions & 0 deletions ports/jemalloc/preprocessor.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/configure.ac b/configure.ac
index 3115504e2..ffb504b08 100644
--- a/configure.ac
+++ b/configure.ac
@@ -749,6 +749,7 @@ case "${host}" in
so="dll"
if test "x$je_cv_msvc" = "xyes" ; then
importlib="lib"
+ JE_APPEND_VS(CPPFLAGS, -DJEMALLOC_NO_PRIVATE_NAMESPACE)
DSO_LDFLAGS="-LD"
EXTRA_LDFLAGS="-link -DEBUG"
CTARGET='-Fo$@'
6 changes: 3 additions & 3 deletions ports/jemalloc/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "jemalloc",
"version-string": "4.3.1",
"port-version": 5,
"version": "5.3.0",
"description": "jemalloc is a general purpose malloc(3) implementation that emphasizes fragmentation avoidance and scalable concurrency support",
"homepage": "https://github.com/jemalloc/jemalloc-cmake"
"homepage": "https://jemalloc.net/",
"license": "BSD-2-Clause"
}
Loading