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

feat: add package input to install packages #23

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

tjallingt
Copy link

@tjallingt tjallingt commented Aug 14, 2024

fixes #21

Tried to reuse the existing install_apt_packages function to install the packages.
I'd like to also support newlines in the packages input but i'm not sure what would be the best way to handle those.

This will need to be added to the changelog and the readme.

@tjallingt
Copy link
Author

tjallingt commented Aug 14, 2024

Unfortunately when using this to attempt to build my code I get another error:

thread 'main' panicked at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libudev-sys-0.1.4/build.rs:38:41:
  called `Result::unwrap()` on an `Err` value: "pkg-config has not been configured to support cross-compilation.\n\nInstall a sysroot for the target platform and configure it via\nPKG_CONFIG_SYSROOT_DIR and PKG_CONFIG_PATH, or install a\ncross-compiling wrapper for pkg-config and set it via\nPKG_CONFIG environment variable."

When building for aarch64-unknown-linux-gnu

I'm not quite sure how to fix this. Other than that this change does appear to work as the extra packages are being installed.

EDIT: looking into this and the PKG_CONFIG_PATH should be set, if i understand correctly. Maybe a problem with this PR after all?

main.sh Outdated Show resolved Hide resolved
Co-authored-by: Taiki Endo <te316e89@gmail.com>
main.sh Outdated Show resolved Hide resolved
main.sh Outdated Show resolved Hide resolved
@tjallingt tjallingt marked this pull request as draft August 14, 2024 13:42
Comment on lines +769 to +790
case "${target}" in
aarch64* | arm64*) dpkg_arch=arm64 ;;
arm* | thumb*) dpkg_arch=arm ;;
i?86-*) dpkg_arch=i386 ;;
hexagon-*) dpkg_arch=hexagon ;;
loongarch64-*) dpkg_arch=loongarch64 ;;
m68k-*) dpkg_arch=m68k ;;
mips-* | mipsel-*) dpkg_arch="${target%%-*}" ;;
mips64-* | mips64el-*) dpkg_arch="${target%%-*}" ;;
mipsisa32r6-* | mipsisa32r6el-*) dpkg_arch="${target%%-*}" ;;
mipsisa64r6-* | mipsisa64r6el-*) dpkg_arch="${target%%-*}" ;;
powerpc-*spe) dpkg_arch=ppc ;;
powerpc-*) dpkg_arch=ppc ;;
powerpc64-* | powerpc64le-*) dpkg_arch="${target%%-*}" ;;
riscv32*) dpkg_arch=riscv32 ;;
riscv64*) dpkg_arch=riscv64 ;;
s390x-*) dpkg_arch=s390x ;;
sparc-*) dpkg_arch=sparc ;;
sparc64-* | sparcv9-*) dpkg_arch=sparc64 ;;
x86_64*) dpkg_arch=amd64 ;;
*) bail "unrecognized target '${target}'" ;;
esac
Copy link
Author

Choose a reason for hiding this comment

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

I don't actually know what the dpkg_arch should be for most of these... Not sure if this is the right strategy even.

@tjallingt
Copy link
Author

After trying to add the dpkg arch im seeing errors like

Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package libgbm-dev:arm64
E: Unable to locate package libxkbcommon-dev:arm64
E: Unable to locate package libinput-dev:arm64
E: Unable to locate package libudev-dev:arm64
E: Unable to locate package libseat-dev:arm64

despite adding _sudo dpkg --add-architecture arm64

@taiki-e
Copy link
Owner

taiki-e commented Oct 1, 2024

After trying to add the dpkg arch im seeing errors like

I think this is the GitHub-hosted runner issue mentioned in #21 (comment). In a container the current one might work as is.

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.

installing required library headers
2 participants