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

new cross: libarchive #6073

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

Conversation

dotysan
Copy link
Contributor

@dotysan dotysan commented Apr 15, 2024

Description

This is my first attempt at packaging. Please help me fix the bugs I don't know that I've created yet. ;-)

Checklist

  • Build rule all-supported completed successfully
  • New installation of package completed successfully
  • Package upgrade completed successfully (Manually install the package again)
  • Package functionality was tested
  • Any needed documentation is updated/created

Type of change

  • Bug fix
  • New Package
  • Package update
  • Includes small framework changes
  • This change requires a documentation update (e.g. Wiki)

@hgy59
Copy link
Contributor

hgy59 commented Apr 16, 2024

@dotysan welcome, and thanks for your contribution

Since I'm away from my development environment I can't test the binaries, but here are some suggestions:

  1. what is the motivation to have bsdtar command line utility on DSM?
    it already has the tar and zip utilities
  2. synocli-file
    for small command line utilities we have created "synocli" packages and a file compression/decompression tool would best fit to synocli-file.
    for most of the synocli tools, we have a makefile in the diyspk folder (do it yourself spk).
    This helps for new tools and updates of existing to build an spk package with a single tool (and not need to build the whole package while development).
    Todo so, just move all files from spk/libarchive folder to diyspk/libarchive.
  3. Main suggestions (some might lack documentation)
    • cross/libarchive/Makefile
      with PKG_DIST_NAME = v$(PKG_VERS).$(PKG_EXT) you have to define PKG_DIST_FILE too and recreate the digests file.
      downloaded (source archive) files are cached in the distrib folder.
      If the filename is not unique over the files of all sources, there will be conflicts (i.e. files with the same version will get overwritten).
      You have to define PKG_DIST_FILE = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT) to solve this
      To recreate the digests file just call make clean and make digests in the folder spksrc/cross/libarchive.
    • dependencies
      you have defined BUILD_DEPENDS = cross/openssl3 but my guess is you need DEPENDS = cross/openssl3
      If bsdtar is dynamically linked to openssl, this is a real dependency that must be available at runtime.
      BUILD_DEPENDS is meant for tools like Assembler that are requierd only to build the binaries.
      To check the dependencies you can use readelf -d on the files listed in cross/libarchive/PLIST.
      If any of those depends on libssl or libcrypto it needs openssl at runtime (you might need a build for x64 for this check).
    • avoid the PRE_CONFIGURE_TARGET
      you run autogen.sh as custom target to generate the configure file.
      I propose to use libarchive-3.7.3.tar.xz that contains the configure file to fix this (and not v3.7.3.tar.gz).
      github releases always contain the source as archive (.tar.gz and .zip) that are snapshots of the repository.
      Most github projects provide the "pre-configured" source for download to build. Unfortunately it is not possible to remove the files generated by github.
      So always take the source files provided by the repository owner.
    • add SPK_COMMANDS
      With SPK_COMMANDS = bin/bsdcat bin/bsdcpio bin/bsdtar bin/bsdunzip in the spk (diyspk) Makefile,
      the package installation will add links to the commands (in /usr/local/bin) to have those available in the path.

@dotysan
Copy link
Contributor Author

dotysan commented Apr 16, 2024

@dotysan welcome, and thanks for your contribution

Thx for the thorough feedback, @hgy59!

  1. what is the motivation to have bsdtar command line utility on DSM?
    it already has the tar and zip utilities

I saw those too. Prolly should disable if they are redundant. I'm only looking for libarchive.so for another package I'm working on pixz.

  1. synocli-file
    for small command line utilities we have created "synocli" packages and a file compression/decompression tool would best fit to synocli-file.
    for most of the synocli tools, we have a makefile in the diyspk folder (do it yourself spk).
    This helps for new tools and updates of existing to build an spk package with a single tool (and not need to build the whole package while development).
    Todo so, just move all files from spk/libarchive folder to diyspk/libarchive.

Aha! I was starting down this path last night, but didn't understand the plumbing. I do now!

  1. Main suggestions (some might lack documentation)

Awesome stuff! I'd figured out the DEPENDS & SPK_COMMANDS stuff last night. But got muddled in the learning curve an didn't commit/push.

I'll do that shortly. But leave this PR as draft expecting to close it if the idea below pans out.

The idea of simple adding pixz and libarchive.so to synocli-file seems much more elegant than creating at least 2 new packages. Especially since it appears to already have the libcrypto.so needed by libarchive.so!

 - build from pre-configured tarball instead of raw source
 - which seems to support GNU configure
 - libcrytpo is runtime dependency
 - don't include bsd* cli; just shared object only
@dotysan dotysan changed the title new package: libarchive new cross: libarchive Apr 16, 2024
I have no idea why. But spk/synocli-file would not build pixz. However,
cross/libarchive and diyspk/pigz both built standalone just fine.

Also documenting some other strange and no-determininistic artifacts
linked to build enviornment.
Copy link
Contributor Author

@dotysan dotysan left a comment

Choose a reason for hiding this comment

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

I meant diyspk/pixz not pigz, doh!

@dotysan dotysan mentioned this pull request Apr 16, 2024
10 tasks
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