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

Fail to build python script from nixpkgs as appimage #7

Closed
selfhoster1312 opened this issue Jun 26, 2023 · 2 comments
Closed

Fail to build python script from nixpkgs as appimage #7

selfhoster1312 opened this issue Jun 26, 2023 · 2 comments

Comments

@selfhoster1312
Copy link

selfhoster1312 commented Jun 26, 2023

Hello, i used nix-appimage in the past and it was a joy! However i'm now failing when trying to build a weasyprint appimage. Here's the output:

$ nix bundle --bundler github:ralismark/nix-appimage nixpkgs#python311Packages.weasyprint
error:
       … while calling the 'derivationStrict' builtin

         at //builtin/derivation.nix:9:12: (source not available)

       … while evaluating derivation 'python3.11-weasyprint-59.0-x86_64.AppImage'
         whose name attribute is located at /nix/store/d5c6h5p16jg2rna7db5y4s3y19dmwvx6-source/pkgs/stdenv/generic/make-derivation.nix:278:7

       … while evaluating attribute 'buildCommand' of derivation 'python3.11-weasyprint-59.0-x86_64.AppImage'

         at /nix/store/d5c6h5p16jg2rna7db5y4s3y19dmwvx6-source/pkgs/build-support/trivial-builders.nix:73:14:

           72|     stdenv.mkDerivation ({
           73|       inherit buildCommand name;
             |              ^
           74|       passAsFile = [ "buildCommand" ]

       error: main program /nix/store/1z9djg8r09lfpri1mlzf2cbqi8hsmr19-python3.11-weasyprint-59.0/bin/python3.11-weasyprint does not exist

I guess it's because the executable is called weasyprint and not python3.11-weasyprint. I think it's related to #3. Alternatively, is there something to fix on the package itself to make that possible?

EDIT: Manually creating a symlink in the nix store (yes that's evil!) made it work. I'll use that workaround for the moment but it's not elegant ;)

@ralismark
Copy link
Owner

The least hacky fix right now is to set the package's meta.mainProgram to the right path e.g. "/bin/weasyprint". But also yeah, doing this is annoying and not really possible for some packages, which is why I've been meaning to do #3.

@ralismark
Copy link
Owner

I added ./bundle so this should be possible now:

$ ./bundle python311Packages.weasyprint weasyprint
$ ./weasyprint-x86_64.AppImage --version
WeasyPrint version 58.1

Let me know if this is still an issue.

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