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

Create deb package #2

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Create deb package #2

wants to merge 3 commits into from

Conversation

Beanavil
Copy link
Member

Adds a CMake module with the packaging configuration and "Package" and "Consume" steps to GitHub actions to check that it works as it should.

@Beanavil Beanavil self-assigned this Jun 15, 2023
@Beanavil Beanavil force-pushed the 58-create-deb-package branch from 457b5c4 to c395633 Compare June 15, 2023 12:45
@Beanavil Beanavil requested review from MathiasMagnus and mfep June 15, 2023 12:46
@Beanavil Beanavil force-pushed the 58-create-deb-package branch from c395633 to 5130a09 Compare June 15, 2023 12:49
Copy link

@MathiasMagnus MathiasMagnus left a comment

Choose a reason for hiding this comment

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

This is a good start, but this implementation has a fundamental shortcoming: it packages the source tree, not the install tree. It uses CPackSourceConfig.cmake instead of CPackConfig.cmake and it's missing some of the critical components that are only present in the install tree, such as pkg-config and CMake Package Config files.

Please look into packaging the install tree.

endif()

if(NOT CPACK_SOURCE_IGNORE_FILES)
set(CPACK_SOURCE_IGNORE_FILES="/.github/;/build/")

Choose a reason for hiding this comment

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

minimally add /.git/;/.gitignore;/install/;/package/ as well. I would consider removing it alltogether and letting the distro maintainers deal with this. It's a 3-liner here, but a 1-liner in CI.

Copy link
Member Author

Choose a reason for hiding this comment

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

Removed :)

Comment on lines 23 to 25
# Get Debian package name from project name
string(TOLOWER ${PROJECT_NAME} DEBIAN_PACKAGE_NAME)
string(REPLACE "opencl" "opencl-" DEBIAN_PACKAGE_NAME ${DEBIAN_PACKAGE_NAME})

Choose a reason for hiding this comment

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

There's no need in being smart about it. If the project name changes, this fragment will very likely have to change too. Then just hardcode the result.

Suggested change
# Get Debian package name from project name
string(TOLOWER ${PROJECT_NAME} DEBIAN_PACKAGE_NAME)
string(REPLACE "opencl" "opencl-" DEBIAN_PACKAGE_NAME ${DEBIAN_PACKAGE_NAME})
set(DEBIAN_PACKAGE_NAME "opencl-headers")

Copy link
Member Author

Choose a reason for hiding this comment

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

Done!


# Version number [epoch:]upstream_version[-debian_revision]
set(CPACK_DEBIAN_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION}) # upstream_version
set(CPACK_DEBIAN_PACKAGE_RELEASE "1") # devian_revision (because this is a

Choose a reason for hiding this comment

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

Spanish typo

Suggested change
set(CPACK_DEBIAN_PACKAGE_RELEASE "1") # devian_revision (because this is a
set(CPACK_DEBIAN_PACKAGE_RELEASE "1") # debian_revision (because this is a

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed 🇪🇸!

@Beanavil Beanavil force-pushed the 58-create-deb-package branch 9 times, most recently from 2f7a29a to 06d47f1 Compare June 16, 2023 15:56
@Beanavil Beanavil force-pushed the 58-create-deb-package branch from 06d47f1 to bc4615e Compare June 28, 2023 15:22
@Beanavil Beanavil force-pushed the 58-create-deb-package branch 6 times, most recently from 04c30c8 to b2b5a15 Compare August 1, 2023 09:54
@Beanavil Beanavil force-pushed the 58-create-deb-package branch from b2b5a15 to f5893a8 Compare August 1, 2023 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants