-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
[lhasa] add new port #32793
base: master
Are you sure you want to change the base?
[lhasa] add new port #32793
Conversation
8d11b2f
to
bf37a1b
Compare
So why don't we use it? |
@Ghabry As #32793 (comment) said, we support |
ooh. My last port contribution was a long time ago so I wasn't aware of the autotools support. 😅 will make it a draft until I resolve this. |
97bd3e0
to
87f5d1f
Compare
@FrankXie05 migrated to autotools. macos builder looks stuck though. |
ports/lhasa/portfile.cmake
Outdated
set(LHASA_VERSION 0.4.0) | ||
vcpkg_download_distfile(ARCHIVE | ||
URLS "https://github.com/fragglet/lhasa/releases/download/v0.4.0/lhasa-${LHASA_VERSION}.tar.gz" | ||
FILENAME "lhasa-${LHASA_VERSION}.tar.gz" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set(LHASA_VERSION 0.4.0) | |
vcpkg_download_distfile(ARCHIVE | |
URLS "https://github.com/fragglet/lhasa/releases/download/v0.4.0/lhasa-${LHASA_VERSION}.tar.gz" | |
FILENAME "lhasa-${LHASA_VERSION}.tar.gz" | |
vcpkg_download_distfile(ARCHIVE | |
URLS "https://github.com/fragglet/lhasa/releases/download/v0.4.0/lhasa-${VERSION}.tar.gz" | |
FILENAME "lhasa-${VERSION}.tar.gz" |
You can use ${VERSION}
directly, it reads the "version" field in vcpkg.json.
ports/lhasa/portfile.cmake
Outdated
vcpkg_install_copyright( | ||
COMMENT "lhasa is under ISC license." | ||
FILE_LIST | ||
"${SOURCE_PATH}/COPYING" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vcpkg_install_copyright( | |
COMMENT "lhasa is under ISC license." | |
FILE_LIST | |
"${SOURCE_PATH}/COPYING" | |
) | |
vcpkg_install_copyright( FILE_LIST "${SOURCE_PATH}/COPYING") |
ports/lhasa/vcpkg.json
Outdated
{ | ||
"name": "lhasa", | ||
"version-semver": "0.4.0", | ||
"port-version": 1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"port-version": 1, |
Note: I will be converting your PR to draft status. When you respond, please revert to "ready for review". |
sorry for the delay. Was on vacation and didn't notice the build failure because the usage file was not installed. :/ Now resolved. |
"version": "0.4.0", | ||
"description": "LZH/LHA archive library", | ||
"homepage": "https://fragglet.github.io/lhasa/", | ||
"license": "ISC" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"license": "ISC" | |
"license": "ISC", | |
"dependencies": [ | |
{ | |
"name": "pkgconf", | |
"host": true, | |
"default-features": false | |
} | |
] |
Please add the dependencies to use the pkg-config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@FrankXie05 Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the usage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For using this port? (I have pkg-config.)
Or for building this port? (Don't we we still use vcpkg_find_acquire_program(PKGCONFG)
?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course this method can be used, what I mean is that this port requires pkgconfg
to be installed. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course this method can be used, what I mean is that this port requires
pkgconfg
to be installed. :)
I don't see why it requires port pkgconf
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or add vcpkg_find_acquire_program(PKGCONFIG)
to portfile.cmake
.
Hey this was approved 3 weeks ago. Is there anything else missing before merging? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be possible to drop the patch (unless upstreamed) and just pass COPY_SOURCE
to vcpkg_configure_make
.
ports/lhasa/portfile.cmake
Outdated
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") | ||
# fixes error: libtool: can't build x86_64-pc-mingw32 shared library unless -no-undefined is specified | ||
list(APPEND OPTIONS "LDFLAGS=-no-undefined") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") | |
# fixes error: libtool: can't build x86_64-pc-mingw32 shared library unless -no-undefined is specified | |
list(APPEND OPTIONS "LDFLAGS=-no-undefined") | |
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic" AND VCPKG_TARGET_IS_MINGW) | |
# fixes error: libtool: can't build x86_64-pc-mingw32 shared library unless -no-undefined is specified | |
list(APPEND OPTIONS "LDFLAGS=\$LDFLAGS -no-undefined") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This patch did not compile. I had to use
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic" AND VCPKG_TARGET_IS_WINDOWS)
instead of
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic" AND VCPKG_TARGET_IS_MINGW)
Now is all green.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is strange. CI doesn't even test mingw. And no other port needs to tell mingw about this flag. Does libtool convert it to some MSVC flag?
that patch is directly taken from an upstream commit. There is just no new release since that fix was commited. |
Test the usage on
|
I was told by @dg0yt to remove the pkg-config dependency. 🤔 Technically pkg-config is not a dependency for the library. You can e.g. manually link it through a makefile. |
You need vcpkg_find_acquire_program(PKGCONFIG)
vcpkg_cmake_configure(
...
OPTIONS
...
"-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}" |
I use |
I think @dg0yt was speaking to @FrankXie05 ? |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
hm, maybe an ugly corner. I guess the ports with It only confirms that the new port doesn't need a |
ports/lhasa/usage
Outdated
The package lhasa can be imported via CMake FindPkgConfig module: | ||
|
||
find_package(PkgConfig) | ||
pkg_check_modules(LHASA REQUIRED IMPORTED_TARGET liblhasa) | ||
|
||
target_link_libraries(main PRIVATE PkgConfig::LHASA) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may want to review the heuristically output which is shown when no usage
file gets installed. Formatting and wording were changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, despite the name 'info:reviewed' here I just set it to make sure I looked at it after confirmation that the merge succeeded build since I resurrected a PR that is a year old
* Update usage text * Use the patch from upstream
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like @dg0yt 's question #32793 (comment) answered before merging
find_package
calls are REQUIRED, are satisfied byvcpkg.json
's declared dependencies, or disabled with CMAKE_DISABLE_FIND_PACKAGE_Xxxvcpkg.json
matches what upstream says.vcpkg.json
matches what upstream says../vcpkg x-add-version --all
and committing the result.The library uses autotools. I created a CMakeLists based on the one from bzip2 available here in vcpkg.
I'm unsure about the "usage text". Am I required to create a
unofficial::lhasa
target that a few other libraries offer?