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

Remove conflicting and outdated CPack licensing. #5000

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all 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
28 changes: 26 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ include(CheckIncludeFile)
include(CheckIncludeFileCXX)
include(CheckFunctionExists)
include(FindPythonModule)
include(CPack)
# TODO: Remove this deprecated include eventually.
include(UnifiedBuild)

Expand Down Expand Up @@ -636,11 +635,36 @@ if (ENABLE_DOCS AND DOXYGEN_FOUND)
DESTINATION ${P4C_ARTIFACTS_OUTPUT_DIRECTORY}/docs)
endif()

# Packaging:
######################################## Packaging BEGIN ########################################
SET(CPACK_SOURCE_GENERATOR "TXZ")
SET(CPACK_SOURCE_PACKAGE_FILE_NAME
"p4c-${P4C_SEM_VERSION_STRING}")
SET(CPACK_SOURCE_IGNORE_FILES
"${PROJECT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}-*;${PROJECT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}_*;/build/;/.git/;/config.log;/CMakeFiles/;CMakeCache.txt$;.tar.gz$;/_CPack_Packages;/Makefile$;~$;/build-deb;/clean-deb;/filter-empty-entries;/make-symbols;/make-ppa;/make-deb;/debian.conf;/make-rpm;/rpm.conf;${CPACK_SOURCE_IGNORE_FILES}")

ADD_CUSTOM_TARGET(dist COMMAND ${CMAKE_MAKE_PROGRAM} clean package_source)


set (CPACK_RESOURCE_FILE_LICENSE "${P4C_SOURCE_DIR}/LICENSE")
# set (THIRD_PARTY_LICENSES "${P4C_SOURCE_DIR}/LICENSES.txt")
# install (FILES ${CPACK_RESOURCE_FILE_LICENSE}
# ${THIRD_PARTY_LICENSES}
# DESTINATION share/p4c
# )

set (CPACK_GENERATOR "TBZ2")
set (CPACK_PACKAGE_NAME "p4c")
set (CPACK_PACKAGE_VERSION_MAJOR ${P4C_VERSION_MAJOR})
set (CPACK_PACKAGE_VERSION_MINOR ${P4C_VERSION_MINOR})
set (CPACK_PACKAGE_VERSION_PATCH ${P4C_VERSION_PATCH})
set (CPACK_PACKAGE_VERSION "${P4C_VERSION}")
set (CPACK_PACKAGE_CONTACT "P4 Language Organization <info@p4.org>")
set (CPACK_PACKAGE_VENDOR "P4 Language Organization")
set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "P4C compilers for P4_14 and P4_16")
set (CPACK_PACKAGE_DESCRIPTION "P4C compilers")
set (CPACK_PROJECT_CONFIG_FILE "${P4C_SOURCE_DIR}/CPackOptions.cmake")
set (CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
set (CPACK_STRIP_FILES TRUE)

include (CPack)
######################################## Packaging End ########################################
24 changes: 1 addition & 23 deletions backends/tofino/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -180,31 +180,9 @@ if (ENABLE_DOXYGEN)
endif()
endif()

# Generate the LICENSE file. Do this before generating the build system so
# that CPack detects that the file exists.
# Generate the LICENSE file.
execute_process(COMMAND "${BFN_P4C_SOURCE_DIR}/scripts/generate-license.sh")

set (CPACK_RESOURCE_FILE_LICENSE "${BFN_P4C_SOURCE_DIR}/LICENSE")
set (THIRD_PARTY_LICENSES "${BFN_P4C_SOURCE_DIR}/LICENSES.txt")
install (FILES ${CPACK_RESOURCE_FILE_LICENSE}
${THIRD_PARTY_LICENSES}
DESTINATION share/p4c)

set (CPACK_GENERATOR "TBZ2")
set (CPACK_PACKAGE_NAME "p4c")
set (CPACK_PACKAGE_VERSION_MAJOR ${BFN_P4C_VERSION_MAJOR})
set (CPACK_PACKAGE_VERSION_MINOR ${BFN_P4C_VERSION_MINOR})
set (CPACK_PACKAGE_VERSION_PATCH ${BFN_P4C_VERSION_PATCH})
set (CPACK_PACKAGE_VERSION "${BFN_P4C_VERSION}")
set (CPACK_PACKAGE_CONTACT "Barefoot Networks, Inc. <p4c@barefootnetworks.com>")
set (CPACK_PACKAGE_VENDOR "Barefoot Networks, Inc.")
set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "P4C compilers for P4_14 and P4_16")
set (CPACK_PACKAGE_DESCRIPTION "P4C compilers for the Barefoot Networks Tofino architecture")
set (CPACK_PROJECT_CONFIG_FILE "${BFN_P4C_SOURCE_DIR}/CPackOptions.cmake")
set (CPACK_STRIP_FILES TRUE)

include (CPack)

set (BF_P4C_IR_DEF_FILES
${CMAKE_CURRENT_SOURCE_DIR}/bf-p4c/ir/tofino.def
${CMAKE_CURRENT_SOURCE_DIR}/bf-p4c/ir/arch.def
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@ if (CPACK_GENERATOR MATCHES "DEB")
set (CPACK_DEBIAN_PACKAGE_ARCHITECTURE "i386")
endif()

set (CPACK_DEBIAN_PACKAGE_DEPENDS "cpp (>= 4.8), libboost-iostreams1.58.0, libgmp10, libgmpxx4ldbl, libgc1c2, libstdc++6, libc6, libbz2-1.0, libssl1.0.0, python (>= 2.7)")
endif()
Loading