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

How can I build from source? #12

Open
christianbundy opened this issue Nov 25, 2020 · 4 comments
Open

How can I build from source? #12

christianbundy opened this issue Nov 25, 2020 · 4 comments

Comments

@christianbundy
Copy link

Hi! I'd like to use a slightly different .rpmacros file, but when I try to build from source from the info in NOTES.md I'm seeing failures because the patches don't exist. Example:

#14 72.90 error: File /home/mockbuild/rpmbuild/SOURCES/0001-Fix-assertion-failure-in-the-freetype-backend.patch: No such file or directory
#14 72.90 error: File /home/mockbuild/rpmbuild/SOURCES/0001-Revert-Correctly-decode-Adobe-CMYK-JPEGs-in-PDF-expo.patch: No such file or directory
#14 72.90 error: File /home/mockbuild/rpmbuild/SOURCES/cairo-multilib.patch: No such file or directory
#14 72.90 error: File /home/mockbuild/rpmbuild/SOURCES/cairo-1.15.12.tar.xz: No such file or directory

I'd like to build a zip that can be uploaded to a lambda without its own layer, so I need to change the prefix from /opt/ to /var/task. Are there any docs on how to do that, or does the above error look familiar? Thanks!

@mhart
Copy link
Member

mhart commented Nov 25, 2020

First I'd just try unpacking everything in /var/task and seeing if it works.

The RPMs have been built to be relocatable, so just try passing the --prefix /var/task to rpm install. See here for more info on what that means: http://ftp.rpm.org/api/4.4.2.2/relocatable.html

In terms of building, those patches should be part of the source RPMs, which should unpack when you do rpm -ivh *.src.rpm. It might be that they're unpacking in another directory?

@christianbundy
Copy link
Author

Thanks for the quick response!

First I'd just try unpacking everything in /var/task and seeing if it works.

This worked surprisingly well, but I had problems with GdkPixbuf complaining about being broken -- which led me down this rabbit hole.

The RPMs have been built to be relocatable

Oh, awesome. I was trying to do that in yumda:2 but I can't yum install yum-util to get yumdownloader, so I couldn't get the rpms, which is why I went one level deeper and tried to build them from specs.

It might be that they're unpacking in another directory?

I'll check it again and share my Dockerfile if I can reproduce the problem, thanks!

@christianbundy
Copy link
Author

Here's a Dockerfile that's showing the failure I'm seeing:

FROM lambci/yumda:build-2

COPY yumda/amazon-linux-2/build/specs/lambda2 /tmp/

RUN sudo yum-builddep -y /tmp/cairo.spec && \
  rpmbuild -ba --nocheck /tmp/cairo.spec

@mhart
Copy link
Member

mhart commented Nov 25, 2020

In your example, rpmbuild has no source files to build from. You can either pull the source RPMs from yumda, or from the original source. Technically you should get them from yumda in case there are modified source files – but with most packages I only needed to modify the spec, so this should work:

yumdownloader --source cairo && \
  rpm -ivh *.src.rpm

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

No branches or pull requests

2 participants