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

mcomix3: init at 20201123 #104908

Merged
merged 2 commits into from Nov 26, 2020
Merged

mcomix3: init at 20201123 #104908

merged 2 commits into from Nov 26, 2020

Conversation

con-f-use
Copy link
Contributor

@con-f-use con-f-use commented Nov 25, 2020

Motivation for this change

The original mcomix used to be in nixpkgs, but became unmaintained and is not Python 3 compatible. It was subsequently removed. Debian, Archlinux, Fedora and others have switched to it's actively maintained Python 3 fork, mcomix3. This PR packages mcomix3 for nixpkgs.

It is @con-f-use first contribution to nixpkgs, so apologies for any errors or breach of protocol.

Closes #75028.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/packaging-mcomix3-python-gtk-missing-gsettings-schemas-issue/10190/4

pkgs/applications/graphics/mcomix3/default.nix Outdated Show resolved Hide resolved
pkgs/applications/graphics/mcomix3/default.nix Outdated Show resolved Hide resolved
pkgs/top-level/aliases.nix Outdated Show resolved Hide resolved
@SuperSandro2000
Copy link
Member

Result of nixpkgs-review pr 104908 run on x86_64-linux 1

1 package built:
  • mcomix3

@SuperSandro2000
Copy link
Member

Result of nixpkgs-review pr 104908 run on x86_64-darwin 1

1 package built:
  • mcomix3

Copy link
Member

@AndersonTorres AndersonTorres left a comment

Choose a reason for hiding this comment

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

Now squash all those small commits to a single commit.

Or, more accurately, two:

  • the first including yourself in the maintainers list
  • the other including all else, namely, the package expression.

@con-f-use
Copy link
Contributor Author

con-f-use commented Nov 25, 2020

Okay, little help with that please, because if I do git branch --set-upstream-to=origin/master; git rebase -i, there is 2000+ commits in that interactive rebase and hundreds of merge conflicts to resolve.

Edit: I think I managed. It was git rebase -i 327338c74a3; git pull; git push -f. Where 327338c74a3 is the last commit before I branched of. I hope that did the trick.

@AndersonTorres
Copy link
Member

Usually I just

  • fetch upstream;
  • rebase upstream/master

After this, the branch is on par with upstream Nixpkgs.

@jtojnar
Copy link
Contributor

jtojnar commented Nov 26, 2020 via email

@con-f-use
Copy link
Contributor Author

con-f-use commented Nov 26, 2020

Okay, I'll look into wrapping. Is there a good way, so it doesn't interfere with the wrapping from buildPythonApplication and wrapGAppsHook?

Edit: So, what I'm planing to do is just add wrapProgram "$out/bin/${pname}" --prefix PATH : ${lib.makeBinPath ([ p7zip lhasa mupdf ] ++ lib.optional (unrarSupport) unrar)} to postInstall and taking the respective packages out of the buildInputs.

which results in wrapping all the things:

-r-xr-xr-x 2 root root 2.0K Jan  1  1970 .comicthump-wrapped
-r-xr-xr-x 2 root root 2.4K Jan  1  1970 .mcomix3-wrapped
-r-xr-xr-x 2 root root  391 Jan  1  1970 .mcomix3-wrapped_
-r-xr-xr-x 2 root root 3.1K Jan  1  1970 ..comicthump-wrapped-wrapped
-r-xr-xr-x 2 root root 2.0K Jan  1  1970 ..mcomix3-wrapped-wrapped
-r-xr-xr-x 2 root root 1.8K Jan  1  1970 ...mcomix3-wrapped-wrapped-wrapped
-r-xr-xr-x 2 root root 2.4K Jan  1  1970 comicthump
-r-xr-xr-x 2 root root 2.4K Jan  1  1970 mcomix3

Is that okay? @jtojnar

@AndersonTorres
Copy link
Member

AndersonTorres commented Nov 26, 2020

I think you will need to wrap the things manually. First, dontWrapGApps = true;

# to prevent double wrapping
dontWrapGApps = true;
preFixup = ''
makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
'';
# there are no tests

@con-f-use
Copy link
Contributor Author

Well, I don't seem to need to, because multiple layers of wrapping are working, the environment variables are all there, once I get to the actual mcomix3 executable, but it would be nicer.

@jtojnar
Copy link
Contributor

jtojnar commented Nov 26, 2020

You can just add stuff to makeWrapperArgs, which will be picked up by the Python wrapper. If you combine it with #104908 (comment), the python wrapper will also take the data from wrapGAppsHook so you will end up with just a single wrapper.

But yeah, it is a trade off between having nested wrappers and slightly more complicated package expressions.

@con-f-use
Copy link
Contributor Author

  dontWrapGApps = true;
  preFixup = ''
    makeWrapperArgs+=(
      "''${gappsWrapperArgs[@]}"
      "--prefix" "PATH" ":" "${lib.makeBinPath ([ p7zip lhasa mupdf ] ++ lib.optional (unrarSupport) unrar)}" 
    )
  '';

The --prefix part doesn't seem to work with the python wrapper. And when I set the attribute directly in the nix expression like so:

   makeWrapperArgs = [ "--prefix PATH : ${lib.makeBinPath ([ p7zip lhasa mupdf ] ++ lib.optional (unrarSupport) unrar)}" ];

Then the arguments from wrapGAppsHook don't get passed anymore. Any pointers here?

@jtojnar
Copy link
Contributor

jtojnar commented Nov 26, 2020

You cannot set makeWrapperArgs in Nix directly, it will get mangled when serialized for bash.

What do you mean the prefix does not work? Is it not appearing in the created wrapper?

@con-f-use
Copy link
Contributor Author

Nevermind, I think, I'm finally there. Thanks for your insight!

@con-f-use
Copy link
Contributor Author

con-f-use commented Nov 26, 2020

Okay, I think I have followed all the suggestions. @jtojnar , please tell me if you now think it's ready to be merged, then I'll squash the commits again, and hopefully be done.

@jtojnar
Copy link
Contributor

jtojnar commented Nov 26, 2020

Yes it looks okay to me now. Thanks.

@con-f-use
Copy link
Contributor Author

con-f-use commented Nov 26, 2020

Okay, commits are squashed, what needs to happen now to get this thing merged?

@jtojnar
Copy link
Contributor

jtojnar commented Nov 26, 2020

I can merge this once CI finishes. Thanks.

@con-f-use
Copy link
Contributor Author

Thank you, I learned a lot. CI seems finished...

@jtojnar jtojnar merged commit bb368b7 into NixOS:master Nov 26, 2020
@jtojnar
Copy link
Contributor

jtojnar commented Nov 26, 2020

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Package mcomix3
8 participants