Skip to content

Commit

Permalink
chore: update licenses of bundled dependencies (apache#235)
Browse files Browse the repository at this point in the history
Fixes apache#233.

Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
  • Loading branch information
lidavidm and kou authored Dec 11, 2022
1 parent d67320d commit d6ba29d
Show file tree
Hide file tree
Showing 15 changed files with 54 additions and 2,185 deletions.
2,136 changes: 39 additions & 2,097 deletions LICENSE.txt

Large diffs are not rendered by default.

6 changes: 0 additions & 6 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,3 @@ Copyright 2022 The Apache Software Foundation

This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).

This product includes software from the miniver project (CC0).
https://github.com/jbweston/miniver

This product includes software from the vcpkg project (MIT).
Copyright (c) Microsoft Corporation
78 changes: 0 additions & 78 deletions c/cmake_modules/BuildUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -73,84 +73,6 @@ function(REUSE_PRECOMPILED_HEADER_LIB TARGET_NAME LIB_NAME)
endif()
endfunction()

# Based on MIT-licensed
# https://gist.github.com/cristianadam/ef920342939a89fae3e8a85ca9459b49
function(create_merged_static_lib output_target)
set(options)
set(one_value_args NAME ROOT)
set(multi_value_args TO_MERGE)
cmake_parse_arguments(ARG
"${options}"
"${one_value_args}"
"${multi_value_args}"
${ARGN})
if(ARG_UNPARSED_ARGUMENTS)
message(SEND_ERROR "Error: unrecognized arguments: ${ARG_UNPARSED_ARGUMENTS}")
endif()

set(output_lib_path
${BUILD_OUTPUT_ROOT_DIRECTORY}${CMAKE_STATIC_LIBRARY_PREFIX}${ARG_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}
)

set(all_library_paths $<TARGET_FILE:${ARG_ROOT}>)
foreach(lib ${ARG_TO_MERGE})
list(APPEND all_library_paths $<TARGET_FILE:${lib}>)
endforeach()

if(APPLE)
set(BUNDLE_COMMAND "libtool" "-no_warning_for_no_symbols" "-static" "-o"
${output_lib_path} ${all_library_paths})
elseif(CMAKE_CXX_COMPILER_ID MATCHES "^(Clang|GNU|Intel)$")
set(ar_script_path ${CMAKE_BINARY_DIR}/${ARG_NAME}.ar)

file(WRITE ${ar_script_path}.in "CREATE ${output_lib_path}\n")
file(APPEND ${ar_script_path}.in "ADDLIB $<TARGET_FILE:${ARG_ROOT}>\n")

foreach(lib ${ARG_TO_MERGE})
file(APPEND ${ar_script_path}.in "ADDLIB $<TARGET_FILE:${lib}>\n")
endforeach()

file(APPEND ${ar_script_path}.in "SAVE\nEND\n")
file(GENERATE
OUTPUT ${ar_script_path}
INPUT ${ar_script_path}.in)
set(ar_tool ${CMAKE_AR})

if(CMAKE_INTERPROCEDURAL_OPTIMIZATION)
set(ar_tool ${CMAKE_CXX_COMPILER_AR})
endif()

set(BUNDLE_COMMAND ${ar_tool} -M < ${ar_script_path})

elseif(MSVC)
if(NOT CMAKE_LIBTOOL)
find_program(lib_tool lib HINTS "${CMAKE_CXX_COMPILER}/..")
if("${lib_tool}" STREQUAL "lib_tool-NOTFOUND")
message(FATAL_ERROR "Cannot locate libtool to bundle libraries")
endif()
else()
set(${lib_tool} ${CMAKE_LIBTOOL})
endif()
set(BUNDLE_TOOL ${lib_tool})
set(BUNDLE_COMMAND ${BUNDLE_TOOL} /NOLOGO /OUT:${output_lib_path}
${all_library_paths})
else()
message(FATAL_ERROR "Unknown bundle scenario!")
endif()

add_custom_command(COMMAND ${BUNDLE_COMMAND}
OUTPUT ${output_lib_path}
COMMENT "Bundling ${output_lib_path}"
VERBATIM)

message(STATUS "Creating bundled static library target ${output_target} at ${output_lib_path}"
)

add_custom_target(${output_target} ALL DEPENDS ${output_lib_path})
add_dependencies(${output_target} ${ARG_ROOT} ${ARG_TO_MERGE})
install(FILES ${output_lib_path} DESTINATION ${CMAKE_INSTALL_LIBDIR})
endfunction()

function(arrow_install_cmake_package PACKAGE_NAME EXPORT_NAME)
set(CONFIG_CMAKE "${PACKAGE_NAME}Config.cmake")
set(BUILT_CONFIG_CMAKE "${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_CMAKE}")
Expand Down
4 changes: 2 additions & 2 deletions ci/scripts/python_util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function build_drivers {
-DVCPKG_OVERLAY_TRIPLETS="${VCPKG_OVERLAY_TRIPLETS}" \
-DVCPKG_TARGET_TRIPLET="${VCPKG_DEFAULT_TRIPLET}" \
${source_dir}/c/driver/postgres
cmake --build . --target install -j
cmake --build . --target install --verbose -j
popd

echo "=== Building driver/sqlite ==="
Expand All @@ -99,7 +99,7 @@ function build_drivers {
-DVCPKG_OVERLAY_TRIPLETS="${VCPKG_OVERLAY_TRIPLETS}" \
-DVCPKG_TARGET_TRIPLET="${VCPKG_DEFAULT_TRIPLET}" \
${source_dir}/c/driver/sqlite
cmake --build . --target install -j
cmake --build . --target install --verbose -j
popd
}

Expand Down
4 changes: 2 additions & 2 deletions ci/scripts/python_wheel_windows_build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ cmake ^
-DCMAKE_UNITY_BUILD=%CMAKE_UNITY_BUILD% ^
-DVCPKG_TARGET_TRIPLET=%VCPKG_TARGET_TRIPLET% ^
%source_dir%\c\driver\postgres || exit /B 1
cmake --build . --config %CMAKE_BUILD_TYPE% --target install -j || exit /B 1
cmake --build . --config %CMAKE_BUILD_TYPE% --target install --verbose -j || exit /B 1

@REM XXX: CMake installs it to bin instead of lib for some reason
set ADBC_POSTGRES_LIBRARY=%build_dir%\bin\adbc_driver_postgres.dll
Expand All @@ -65,7 +65,7 @@ cmake ^
-DCMAKE_UNITY_BUILD=%CMAKE_UNITY_BUILD% ^
-DVCPKG_TARGET_TRIPLET=%VCPKG_TARGET_TRIPLET% ^
%source_dir%\c\driver\sqlite || exit /B 1
cmake --build . --config %CMAKE_BUILD_TYPE% --target install -j || exit /B 1
cmake --build . --config %CMAKE_BUILD_TYPE% --target install --verbose -j || exit /B 1

@REM XXX: CMake installs it to bin instead of lib for some reason
set ADBC_SQLITE_LIBRARY=%build_dir%\bin\adbc_driver_sqlite.dll
Expand Down
1 change: 1 addition & 0 deletions python/adbc_driver_manager/LICENSE.txt
2 changes: 2 additions & 0 deletions python/adbc_driver_manager/MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

# setuptools manifest

include LICENSE.txt
include NOTICE.txt
include adbc_driver_manager/adbc.h
include adbc_driver_manager/adbc_driver_manager.cc
include adbc_driver_manager/adbc_driver_manager.h
1 change: 1 addition & 0 deletions python/adbc_driver_manager/NOTICE.txt
1 change: 1 addition & 0 deletions python/adbc_driver_manager/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,6 @@ markers = [
]

[tool.setuptools]
license-files = ["LICENSE.txt", "NOTICE.txt"]
packages = ["adbc_driver_manager"]
py-modules = ["adbc_driver_manager"]
1 change: 1 addition & 0 deletions python/adbc_driver_postgres/LICENSE.txt
1 change: 1 addition & 0 deletions python/adbc_driver_postgres/NOTICE.txt
1 change: 1 addition & 0 deletions python/adbc_driver_postgres/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@ build-backend = "setuptools.build_meta"

[tool.setuptools]
include-package-data = true
license-files = ["LICENSE.txt", "NOTICE.txt"]
packages = ["adbc_driver_postgres"]
py-modules = ["adbc_driver_postgres"]
1 change: 1 addition & 0 deletions python/adbc_driver_sqlite/LICENSE.txt
1 change: 1 addition & 0 deletions python/adbc_driver_sqlite/NOTICE.txt
1 change: 1 addition & 0 deletions python/adbc_driver_sqlite/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@ build-backend = "setuptools.build_meta"

[tool.setuptools]
include-package-data = true
license-files = ["LICENSE.txt", "NOTICE.txt"]
packages = ["adbc_driver_sqlite"]
py-modules = ["adbc_driver_sqlite"]

0 comments on commit d6ba29d

Please sign in to comment.