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

[libdwarf] New port #34382

Merged
merged 47 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
9a28f97
Try to add libdwarf
jeremy-rifkin Oct 9, 2023
bf266e7
Has
jeremy-rifkin Oct 9, 2023
131b550
fix
jeremy-rifkin Oct 9, 2023
8c7c5b8
hash
jeremy-rifkin Oct 9, 2023
5bf8b33
fixes
jeremy-rifkin Oct 9, 2023
4039882
hash
jeremy-rifkin Oct 9, 2023
c34f657
Fixes
jeremy-rifkin Oct 9, 2023
539977b
bump hash
jeremy-rifkin Oct 9, 2023
b4fde2a
zlib fix
jeremy-rifkin Oct 9, 2023
5190170
bump hash
jeremy-rifkin Oct 9, 2023
2a509aa
fix
jeremy-rifkin Oct 9, 2023
8f9ab02
bump hash
jeremy-rifkin Oct 9, 2023
3ee7d2a
fixes
jeremy-rifkin Oct 10, 2023
207a499
Bump hash
jeremy-rifkin Oct 10, 2023
18e4f27
fix
jeremy-rifkin Oct 10, 2023
5cbfb95
bump
jeremy-rifkin Oct 10, 2023
b5c1e12
x
jeremy-rifkin Oct 10, 2023
4d79dbf
bump
jeremy-rifkin Oct 10, 2023
eac00ac
fix
jeremy-rifkin Oct 10, 2023
a644e53
bump
jeremy-rifkin Oct 10, 2023
3074522
fix
jeremy-rifkin Oct 10, 2023
38f7766
bump
jeremy-rifkin Oct 10, 2023
e64d603
fix
jeremy-rifkin Oct 10, 2023
152ea75
bump
jeremy-rifkin Oct 10, 2023
46607ed
fix
jeremy-rifkin Oct 10, 2023
747b4f1
bump
jeremy-rifkin Oct 10, 2023
dad31fc
fix
jeremy-rifkin Oct 10, 2023
05a1a9a
bump
jeremy-rifkin Oct 10, 2023
60830ae
Try this
jeremy-rifkin Oct 21, 2023
13fd06f
bump
jeremy-rifkin Oct 21, 2023
a2ccab2
cleanup
jeremy-rifkin Oct 21, 2023
deb7eb5
bump
jeremy-rifkin Oct 21, 2023
69040be
Update patches
jeremy-rifkin Oct 23, 2023
5d81996
bump hash
jeremy-rifkin Oct 23, 2023
303c83c
fix whitespace
jeremy-rifkin Oct 23, 2023
b89e54b
bump
jeremy-rifkin Oct 23, 2023
f5eb916
Update usage
jeremy-rifkin Oct 28, 2023
12a48c3
Bump
jeremy-rifkin Oct 28, 2023
7811b9e
Update portfile and patches (#1)
dg0yt Oct 30, 2023
0d0ca15
Re-introduce off_t patch
jeremy-rifkin Oct 31, 2023
2b1973a
Bump
jeremy-rifkin Oct 31, 2023
d398751
Fix patch
jeremy-rifkin Oct 31, 2023
cb24352
Bump
jeremy-rifkin Oct 31, 2023
54b32d1
Usage is now correct
jeremy-rifkin Oct 31, 2023
5035393
Bump
jeremy-rifkin Oct 31, 2023
5504ce0
Revert "Usage is now correct"
jeremy-rifkin Oct 31, 2023
8c4e78a
Bump
jeremy-rifkin Oct 31, 2023
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
33 changes: 33 additions & 0 deletions ports/libdwarf/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO davea42/libdwarf-code
REF "v${VERSION}"
SHA512 3117c69cc77d5a1189aeb1ea7e74d917dedfb84e9e9e98e3df7fec930f8183d12f55bb12e4871ed3746cdb19a29aba924bc73d6334b23bbb6413a1f4be67d499
HEAD_REF main
PATCHES v0.8.0-patches.patch
)

vcpkg_list(SET options)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
vcpkg_list(APPEND options -DBUILD_NON_SHARED=Off)
else()
vcpkg_list(APPEND options -DBUILD_NON_SHARED=On)
endif()

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS ${options}
)

vcpkg_cmake_install()
vcpkg_cmake_config_fixup(
PACKAGE_NAME "libdwarf"
CONFIG_PATH "lib/cmake/libdwarf"
)

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib/pkgconfig")
#file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
165 changes: 165 additions & 0 deletions ports/libdwarf/v0.8.0-patches.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 28076ee4..4ebc3a4c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -193,77 +193,80 @@ check_c_source_compiles([=[
}]=] HAVE_STDAFX_H)
#message(STATUS "Checking have windows stdafx.h... ${HAVE_STDAFX_H}")

-set(CMAKE_REQUIRED_LIBRARIES z)
jeremy-rifkin marked this conversation as resolved.
Show resolved Hide resolved
-check_c_source_compiles( [=[
- #include "zlib.h"
- int main()
- {
- Bytef dest[100];
- uLongf destlen = 100;
- Bytef *src = 0;
- uLong srclen = 3;
- int res = uncompress(dest,&destlen,src,srclen);
- if (res == Z_OK) {
- /* ALL IS WELL */
- }
- return 0;
- } ]=] HAVE_ZLIB )
-check_c_source_compiles( [=[
- #include "zlib.h"
- int main()
- {
- Bytef dest[100];
- uLongf destlen = 100;
- Bytef *src = 0;
- uLong srclen = 3;
- int res = uncompress(dest,&destlen,src,srclen);
- if (res == Z_OK) {
- /* ALL IS WELL */
- }
- return 0;
- } ]=] HAVE_ZLIB_H )
-set(CMAKE_REQUIRED_LIBRARIES)
-if (HAVE_ZLIB)
- # For linking in libz
- set(DW_FZLIB "z")
-endif()
-
-set(CMAKE_REQUIRED_LIBRARIES zstd )
jeremy-rifkin marked this conversation as resolved.
Show resolved Hide resolved
-check_c_source_compiles( [=[
- #include "zstd.h"
- int main()
- {
- char * dest[100];
- size_t destlen = 100;
- char *src = 0;
- size_t srclen = 3;
- size_t res = ZSTD_decompress(dest,destlen,src,srclen);
- if (res == destlen) {
- /* ALL IS WELL */
- }
- return 0;
- } ]=] HAVE_ZSTD )
-check_c_source_compiles( [=[
- #include "zstd.h"
- int main()
- {
- char * dest[100];
- size_t destlen = 100;
- char *src = 0;
- size_t srclen = 3;
- size_t res = ZSTD_decompress(dest,destlen,src,srclen);
- if (res == destlen) {
- /* ALL IS WELL */
- }
- return 0;
- } ]=] HAVE_ZSTD_H )
-set(CMAKE_REQUIRED_LIBRARIES)
-if (HAVE_ZSTD)
- # For linking in libzstd
- set(DW_FZSTD "zstd")
-endif()
-
-
+# set(CMAKE_REQUIRED_LIBRARIES z)
+# check_c_source_compiles( [=[
+# #include "zlib.h"
+# int main()
+# {
+# Bytef dest[100];
+# uLongf destlen = 100;
+# Bytef *src = 0;
+# uLong srclen = 3;
+# int res = uncompress(dest,&destlen,src,srclen);
+# if (res == Z_OK) {
+# /* ALL IS WELL */
+# }
+# return 0;
+# } ]=] HAVE_ZLIB )
+# check_c_source_compiles( [=[
+# #include "zlib.h"
+# int main()
+# {
+# Bytef dest[100];
+# uLongf destlen = 100;
+# Bytef *src = 0;
+# uLong srclen = 3;
+# int res = uncompress(dest,&destlen,src,srclen);
+# if (res == Z_OK) {
+# /* ALL IS WELL */
+# }
+# return 0;
+# } ]=] HAVE_ZLIB_H )
+# set(CMAKE_REQUIRED_LIBRARIES)
+# if (HAVE_ZLIB)
+# # For linking in libz
+# set(DW_FZLIB "z")
+# endif()
+
+# set(CMAKE_REQUIRED_LIBRARIES zstd )
+# check_c_source_compiles( [=[
+# #include "zstd.h"
+# int main()
+# {
+# char * dest[100];
+# size_t destlen = 100;
+# char *src = 0;
+# size_t srclen = 3;
+# size_t res = ZSTD_decompress(dest,destlen,src,srclen);
+# if (res == destlen) {
+# /* ALL IS WELL */
+# }
+# return 0;
+# } ]=] HAVE_ZSTD )
+# check_c_source_compiles( [=[
+# #include "zstd.h"
+# int main()
+# {
+# char * dest[100];
+# size_t destlen = 100;
+# char *src = 0;
+# size_t srclen = 3;
+# size_t res = ZSTD_decompress(dest,destlen,src,srclen);
+# if (res == destlen) {
+# /* ALL IS WELL */
+# }
+# return 0;
+# } ]=] HAVE_ZSTD_H )
+# set(CMAKE_REQUIRED_LIBRARIES)
+# if (HAVE_ZSTD)
+# # For linking in libzstd
+# set(DW_FZSTD "zstd")
+# endif()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To reduce the length of the patch, please use if (0) and endif() to disable those lines.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, that's much better

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, could we simply pass the check results as cmake options...

+
+find_package(ZLIB REQUIRED)
+set(DW_FZLIB "z")
+set(HAVE_ZLIB TRUE)
+set(HAVE_ZLIB_H TRUE)

check_c_source_compiles([=[
#include <stdint.h>
@@ -333,7 +336,7 @@ else()
endif()

add_subdirectory(src/lib/libdwarf)
-add_subdirectory(src/bin/dwarfdump)
+# add_subdirectory(src/bin/dwarfdump)

if ( BUILD_DWARFEXAMPLE )
add_subdirectory(src/bin/dwarfexample)
19 changes: 19 additions & 0 deletions ports/libdwarf/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "libdwarf",
"version": "0.8.0",
"description": "A library for reading DWARF2 and later DWARF.",
"homepage": "https://github.com/davea42/libdwarf-code",
"license": "LGPL-2.1-only",
"supports": "!uwp",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
},
"zlib"
]
}
4 changes: 4 additions & 0 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -4088,6 +4088,10 @@
"baseline": "0.6.0",
"port-version": 3
},
"libdwarf": {
"baseline": "0.8.0",
"port-version": 0
},
"libe57": {
"baseline": "1.1.332",
"port-version": 4
Expand Down
9 changes: 9 additions & 0 deletions versions/l-/libdwarf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "edcc23beb373bd0bb246513d319d85f09e8a9974",
"version": "0.8.0",
"port-version": 0
}
]
}
Loading