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

elfutils: Revise the recipe to support Conan V2 and add the latest version 0.189 #17272

Merged
merged 34 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
f5240c7
elfutils: Add the test package for Conan 1.x.
0xFireWolf Apr 27, 2023
95e873b
elfutils: Remove the entry `base_path` from each patch descriptor.
0xFireWolf Apr 27, 2023
e2c173c
elfutils: Make the recipe compatible with Conan 2.x.
0xFireWolf Apr 27, 2023
eef5e26
elfutils: `gettext` is needed otherwise `autopoint` cannot be found.
0xFireWolf Apr 27, 2023
b7b9ce7
elfutils: Fix an issue that the library `bz2` cannot be found.
0xFireWolf Apr 27, 2023
0da7b01
elfutils: Remove unneeded code from the recipe.
0xFireWolf Apr 27, 2023
d77ced8
elfutils: Upgrade the dependency `zlib` to 1.2.13.
0xFireWolf Apr 27, 2023
d8abd01
elfutils: Upgrade the dependency `sqlite3` to 3.41.2.
0xFireWolf Apr 27, 2023
b24080f
elfutils: Upgrade the dependency `xz_utils` to 5.4.2.
0xFireWolf Apr 27, 2023
23eb778
elfutils: Generate pkg-config deps for `libcurl`.
0xFireWolf Apr 27, 2023
60033d7
elfutils: Upgrade the dependency `libcurl` to 8.0.1.
0xFireWolf Apr 27, 2023
305792e
elfutils: Make the test package compatible with Conan 2.x.
0xFireWolf Apr 27, 2023
929fbd5
elfutils: Export the path to the binary folder for Conan 2.x properly.
0xFireWolf Apr 27, 2023
412dbdb
elfutils: Run compiled utilities under the build environment.
0xFireWolf Apr 27, 2023
1bf779e
elfutils: Add the latest version 0.189.
0xFireWolf Apr 27, 2023
8ef8d42
elfutils: Implement the patch in Python for all supported versions.
0xFireWolf Apr 27, 2023
4b23177
elfutils: Use `ConanOutput.warning()` instead of deprecated `ConanOut…
0xFireWolf Apr 27, 2023
2450b04
elfutils: Prevent users from building elfutils on macOS.
0xFireWolf Apr 27, 2023
50021cb
elfutils: Remove version-specific patch files as they are now impleme…
0xFireWolf Apr 27, 2023
a4de48b
elfutils: Add the missing entry for version 0.189 in `config.yml`.
0xFireWolf Apr 27, 2023
ec0a997
elfutils: Set the library search path for the test environment so tha…
0xFireWolf Apr 27, 2023
ead6cdc
elfutils: Add the compiler `Visual Studio` to the blacklist.
0xFireWolf Apr 27, 2023
71790ab
elfutils: Add `dl` to the list of system libs of `libdw`.
0xFireWolf Apr 29, 2023
5df03c0
elfutils: Use `tool_requires` instead of `build_requires`.
0xFireWolf Jun 26, 2023
7102aa4
elfutils: Use `tool_requires` instead of `build_requires`.
0xFireWolf Jun 26, 2023
4f51b7b
elfutils: Upgrade the dependency `sqlite3` to 3.42.0.
0xFireWolf Jun 27, 2023
eb8024c
elfutils: Upgrade the dependency `libcurl` to 8.1.2.
0xFireWolf Jun 27, 2023
fb5ab97
Merge branch 'master' into elfutils-v2
AbrilRBS Aug 10, 2023
1a646ad
Added patches, and package-type. Fixed bad Version import
franramirez688 Oct 31, 2023
a8a8fe8
Removed Visual Studio as valid compiler
franramirez688 Oct 31, 2023
d64ab55
Reverted all the patches
franramirez688 Oct 31, 2023
7041955
typo
franramirez688 Oct 31, 2023
7bcc309
Added is_msvc check
franramirez688 Oct 31, 2023
2e1aaf8
renamed
franramirez688 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
24 changes: 16 additions & 8 deletions recipes/elfutils/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
sources:
"0.189":
url: "https://sourceware.org/elfutils/ftp/0.189/elfutils-0.189.tar.bz2"
sha256: "39bd8f1a338e2b7cd4abc3ff11a0eddc6e690f69578a57478d8179b4148708c8"
"0.186":
url: "https://sourceware.org/elfutils/ftp/0.186/elfutils-0.186.tar.bz2"
sha256: "7f6fb9149b1673d38d9178a0d3e0fb8a1ec4f53a9f4c2ff89469609879641177"
"0.180":
url: "https://sourceware.org/elfutils/ftp/0.180/elfutils-0.180.tar.bz2"
sha256: "b827b6e35c59d188ba97d7cf148fa8dc6f5c68eb6c5981888dfdbb758c0b569d"
patches:
"0.189":
- patch_file: "patches/0001-enable-static-library-building.patch"

Check warning on line 13 in recipes/elfutils/all/conandata.yml

View workflow job for this annotation

GitHub Actions / Lint changed files (YAML files)

conandata.yml schema warning

Schema outlined in https://github.com/conan-io/conan-center-index/blob/master/docs/adding_packages/conandata_yml_format.md#patches-fields is not followed. required key(s) 'patch_description', 'patch_type' not found in - patch_file: patches/0001-ena ... ^ (line: 13)
- patch_file: "patches/0002-disable-werror-flag.patch"
patch_description: "Enable static library building, and disable Werror flag."
patch_type: "conan"
"0.186":
- base_path: "source_subfolder"
patch_file: "patches/0.186-0001-Add-enable-werror-configure-option.patch"
- base_path: "source_subfolder"
patch_file: "patches/0.186-0002-add-enable-static-option-to-configure.patch"
- patch_file: "patches/0001-enable-static-library-building.patch"

Check warning on line 18 in recipes/elfutils/all/conandata.yml

View workflow job for this annotation

GitHub Actions / Lint changed files (YAML files)

conandata.yml schema warning

Schema outlined in https://github.com/conan-io/conan-center-index/blob/master/docs/adding_packages/conandata_yml_format.md#patches-fields is not followed. required key(s) 'patch_description', 'patch_type' not found in - patch_file: patches/0001-ena ... ^ (line: 18)
- patch_file: "patches/0002-disable-werror-flag.patch"
patch_description: "Enable static library building, and disable Werror flag."
patch_type: "conan"
"0.180":
- base_path: "source_subfolder"
patch_file: "patches/0.180-0001-Add-enable-werror-configure-option.patch"
- base_path: "source_subfolder"
patch_file: "patches/0.180-0002-add-enable-static-option-to-configure.patch"
- patch_file: "patches/0001-enable-static-library-building.patch"

Check warning on line 23 in recipes/elfutils/all/conandata.yml

View workflow job for this annotation

GitHub Actions / Lint changed files (YAML files)

conandata.yml schema warning

Schema outlined in https://github.com/conan-io/conan-center-index/blob/master/docs/adding_packages/conandata_yml_format.md#patches-fields is not followed. required key(s) 'patch_description', 'patch_type' not found in - patch_file: patches/0001-ena ... ^ (line: 23)
- patch_file: "patches/0002-disable-werror-flag.patch"
patch_description: "Enable static library building, and disable Werror flag."
patch_type: "conan"
219 changes: 119 additions & 100 deletions recipes/elfutils/all/conanfile.py

Large diffs are not rendered by default.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
--- configure.ac
+++ configure.ac
@@ -393,8 +393,25 @@
diff --git a/configure.ac b/configure.ac
index 6e881fa..3b56d3a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -414,8 +414,26 @@ AS_HELP_STRING([--enable-install-elfh],[install elf.h in include dir]),
[install_elfh=$enableval], [install_elfh=no])
AM_CONDITIONAL(INSTALL_ELFH, test "$install_elfh" = yes)

+
+AC_MSG_CHECKING([whether to build elfutils as a static library])
+AC_ARG_ENABLE([static],
+AS_HELP_STRING([--enable-static],[build elfutils as static libraries]),
Expand All @@ -20,6 +21,8 @@
+ fi
+ AC_MSG_RESULT([no])
+fi
+
+
+
AM_CONDITIONAL(BUILD_STATIC, [dnl
-test "$use_gprof" = yes -o "$use_gcov" = yes])
Expand Down
22 changes: 22 additions & 0 deletions recipes/elfutils/all/patches/0002-disable-werror-flag.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
diff --git a/config/eu.am b/config/eu.am
index e6c241f..fb92465 100644
--- a/config/eu.am
+++ b/config/eu.am
@@ -99,7 +99,7 @@ AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 \
$(LOGICAL_OP_WARNING) $(DUPLICATED_COND_WARNING) \
$(NULL_DEREFERENCE_WARNING) $(IMPLICIT_FALLTHROUGH_WARNING) \
$(USE_AFTER_FREE3_WARNING) \
- $(if $($(*F)_no_Werror),,-Werror) \
+ $(if $($(*F)_no_Werror),,) \
$(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
$(if $($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \
$(if $($(*F)_no_Wpacked_not_aligned),$(NO_PACKED_NOT_ALIGNED_WARNING),) \
@@ -109,7 +109,7 @@ AM_CXXFLAGS = -std=c++11 -Wall -Wshadow \
$(TRAMPOLINES_WARNING) \
$(LOGICAL_OP_WARNING) $(DUPLICATED_COND_WARNING) \
$(NULL_DEREFERENCE_WARNING) $(IMPLICIT_FALLTHROUGH_WARNING) \
- $(if $($(*F)_no_Werror),,-Werror) \
+ $(if $($(*F)_no_Werror),,) \
$(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
$(if $($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \
$(if $($(*F)_no_Wpacked_not_aligned),$(NO_PACKED_NOT_ALIGNED_WARNING),) \
5 changes: 2 additions & 3 deletions recipes/elfutils/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
cmake_minimum_required(VERSION 3.1)
project(test_package C)

include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
find_package(elfutils REQUIRED CONFIG)

add_executable(${PROJECT_NAME} test_package.c)
target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS})
target_link_libraries(${PROJECT_NAME} PRIVATE elfutils::elfutils)
32 changes: 19 additions & 13 deletions recipes/elfutils/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
from conans import ConanFile, CMake, tools
from conan import ConanFile
from conan.tools.build import can_run
from conan.tools.cmake import CMake, cmake_layout
import os


class TestPackageConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake"
settings = "os", "arch", "compiler", "build_type"
generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv"
test_type = "explicit"

def layout(self):
cmake_layout(self)

def requirements(self):
self.requires(self.tested_reference_str)

def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()

def test(self):
self.run("eu-ar --version", run_environment=True)

bin_path = os.path.join("bin", "test_package")
self.run("eu-ar --version", env="conanbuild")
bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package")
archive_path = "archive.a"

self.run("eu-ar r {0} {1}".format(archive_path, bin_path), run_environment=True)
self.run("eu-objdump -d {0}".format(bin_path), run_environment=True)
if not tools.cross_building(self.settings):
self.run("{} {}".format(bin_path, bin_path), run_environment=True)

self.run("{} {}".format(bin_path, archive_path), run_environment=True)
self.run(f"eu-ar r {archive_path} {bin_path}", env="conanbuild")
self.run(f"eu-objdump -d {bin_path}", env="conanbuild")
if can_run(self):
self.run(f"{bin_path} {bin_path}", env="conanrun")
self.run(f"{bin_path} {archive_path}", env="conanrun")
8 changes: 8 additions & 0 deletions recipes/elfutils/all/test_v1_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
cmake_minimum_required(VERSION 3.1)
project(test_package)

include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup(TARGETS)

add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package
${CMAKE_CURRENT_BINARY_DIR}/test_package)
22 changes: 22 additions & 0 deletions recipes/elfutils/all/test_v1_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from conans import ConanFile, CMake, tools
import os


class TestPackageConan(ConanFile):
settings = "os", "arch", "compiler", "build_type"
generators = "cmake", "cmake_find_package_multi"

def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()

def test(self):
self.run("eu-ar --version", run_environment=True)
bin_path = os.path.join("bin", "test_package")
archive_path = "archive.a"
self.run(f"eu-ar r {archive_path} {bin_path}", run_environment=True)
self.run(f"eu-objdump -d {bin_path}", run_environment=True)
if not tools.cross_building(self):
self.run(f"{bin_path} {bin_path}", run_environment=True)
self.run(f"{bin_path} {archive_path}", run_environment=True)
2 changes: 2 additions & 0 deletions recipes/elfutils/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"0.189":
folder: all
"0.186":
folder: all
"0.180":
Expand Down