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

Add AppImage build script #739

Merged
merged 1 commit into from
Jan 18, 2022
Merged

Conversation

TheAssassin
Copy link
Contributor

Thanks for submitting a pull request! Please provide enough information so that others can review your pull request. Additionally, make sure you've done all of these things:

PR Description

What type of PR is this? (Check one of the boxes below)

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement (non-breaking change which does not add functionality nor fixes a bug but improves Natron in some way)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • My change requires a change to the documentation
    • I have updated the documentation accordingly
  • New type of packaging

What does this pull request do?

See #318.

Adds an AppImage build script that converts an extracted Natron tarball into a functional AppImage.

NatronRenderer has not been exposed yet, but this is a trivial change that can be added at any time.

Have you tested your changes (if applicable)? If so, how?

The built AppImage works very well.

@devernay devernay self-requested a review January 6, 2022 22:25
Copy link
Member

@devernay devernay left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution, it's very useful!
I will add that to the standard build process as soon as it's finalized.
Feel free to answer my comments.

elif [[ ! -d "$1" ]]; then
echo "Error: $1 is not a directory"
show_usage_and_exit
fi
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a check that verifies that the script is being executed on the right OS (I guess this is linux-only?) and architecture (x86_64 - we may support more in the future)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd rather require an $ARCH env var to be set instead, which can be evaluated in the last lines (where appimagetool is called). Detecting the architecture is horribly hard. In a CI script, one can easily add that environment variable manually, though. It's not subject to future changes.

The script can be run on any unix that can execute appimagetool (this includes FreeBSD with the linuxulator, I think). Limiting this to Linux does not make any sense to me. Could you please state how such a check would help you?

tools/appimage/make-appimage.sh Outdated Show resolved Hide resolved
export VERSION

# create AppRun
[[ ! -f AppRun ]] && ln -s Natron AppRun
Copy link
Member

Choose a reason for hiding this comment

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

As you suggested, the script should also expose NatronRenderer, how easy is it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Depends on how you want it to work. I think some graphics utility evaluated a --executable parameter, others use environment variables. Do you have a UX in mind?

Copy link
Member

Choose a reason for hiding this comment

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

I never used appimage. Can NatronRenderer be in the user PATH?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Anything is possible. For instance, you could have a wrapper that calls the AppImage.

Think of an AppImage as a filesystem image with a runtime that FUSE mounts that image and executes a defined entrypoint.


show_usage_and_exit() {
echo "Usage: $0 <dir>"
exit 2
Copy link
Member

Choose a reason for hiding this comment

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

Please say in the help that

should be the result of... extracting the no-installer linux binary distribution?
Actually, I would like it better if the script would even take care of extracting that distribution from a downloaded file into a temp dir, and cleanup the mess at the end

Copy link
Contributor Author

@TheAssassin TheAssassin Jan 6, 2022

Choose a reason for hiding this comment

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

This comment seems broken, please revise.

Copy link
Member

Choose a reason for hiding this comment

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

Please say in the help that <dir> should be the result of... extracting the no-installer linux binary distribution(?).

Actually, the script could even take care of extracting that distribution from a downloaded file into a temp dir, and cleanup the mess at the end.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It could, but that doesn't make sense to me, really. It might make sense in your build infrastructure, though. I do not know how you plan to integrate this.

If you need such a script, you could add it as a second script which implements the downloading, extraction etc., and then calls this script. This script follows the Unix spirit, where there should be one tool for one job, and it should do that job well.

Copy link
Member

@devernay devernay Jan 8, 2022

Choose a reason for hiding this comment

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

Yes you're right, we should run this script at the same time we build the tarball.
What I don't understand is that there seem to be a usr/ hierarchy in the tarball, but you leave most stuff out of it.

Shouldn't everything be moved inside usr/, rather than live in bin/ docs/ etc? What's the rule for AppImage?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry for not replying in time. Feel free to move everything to a usr/ subdirectory. It's common for AppImages, maybe even "best practice", but not a requirement technically. I'll send a follow-up PR.

@devernay devernay merged commit 653cf63 into NatronGitHub:RB-2.5 Jan 18, 2022
devernay pushed a commit that referenced this pull request Jan 18, 2022
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