Skip to content

Conversation

@UlyssesZh
Copy link
Member

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Apr 17, 2025
@0xda157
Copy link
Contributor

0xda157 commented Apr 19, 2025

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 399610


x86_64-linux

✅ 1 package built:
  • zlibrary-desktop

@nadir-ishiguro
Copy link
Contributor

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 399610


x86_64-linux

✅ 1 package built:
  • zlibrary-desktop

@nadir-ishiguro
Copy link
Contributor

Didn't even know about this. Thank your packaging this.

During testing, I couldn't download books:

(z-library:34490): GLib-GIO-ERROR **: 14:32:44.522: Settings schema 'org.gtk.Settings.FileChooser' is not installed

The FileChooser is definitely available, so I assume this is somehow due to the testing environment, but I thought I'd mention it, as I don't remember having that issue with other graphical applications in nixpkgs-review.

@nadir-ishiguro
Copy link
Contributor

Okay, narrowed it down a bit.

I forgot to mention that the original test was in a Niri session.

Just installed it in an Archlinux distrobox via the AUR and yep, FileChooser works as expected.

In GNOME it works with both this derivation, started from the nixpkgs-review environment, and with the distrobox/Arch package.

@UlyssesZh UlyssesZh changed the title zlibrary-desktop: init at 2.4.1 zlibrary-desktop: init at 2.4.2 Jun 5, 2025
@UlyssesZh
Copy link
Member Author

Updated: 2.4.1 -> 2.4.2.

Added an update script. The scripts find the latest URL of Z-Library (which is always changing) by reading from a Wikipedia article. It also makes an HTTP request to Wayback Machine to get an archive link.

@UlyssesZh UlyssesZh changed the title zlibrary-desktop: init at 2.4.2 z-library-desktop: init at 2.4.3 Aug 7, 2025
@UlyssesZh
Copy link
Member Author

Updated: 2.4.2 -> 2.4.3.

Changed the package name from zlibrary-desktop to z-library-desktop just for fun.

@UlyssesZh UlyssesZh force-pushed the zlibrary-desktop branch 2 times, most recently from 59d5b19 to f995c3c Compare August 8, 2025 04:01
@UlyssesZh
Copy link
Member Author

UlyssesZh commented Aug 8, 2025

Use electron from nixpkgs to significantly reduce package size and also make it available for more platforms. However it cannot build on darwin because dpkg is marked broken (#370245 (comment)).

The original software is distributed with Electron 34.1.1, but it seems to run perfectly with Electron 37 (current version of electron packaged in nixpkgs) too.

@UlyssesZh UlyssesZh mentioned this pull request Aug 25, 2025
13 tasks
@UlyssesZh UlyssesZh changed the title z-library-desktop: init at 2.4.3 z-library-desktop: init at 3.0.0 Sep 22, 2025
@UlyssesZh
Copy link
Member Author

UlyssesZh commented Sep 22, 2025

Updated to 3.0.0. Also added something specifically for darwin, but I still cannot test it because dpkg is still broken.

Copy link
Contributor

@marcin-serwin marcin-serwin left a comment

Choose a reason for hiding this comment

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

Builds and runs on x86_64-linux.

@nixpkgs-ci nixpkgs-ci bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Sep 22, 2025
@UlyssesZh UlyssesZh force-pushed the zlibrary-desktop branch 2 times, most recently from 011b238 to 32819b3 Compare September 26, 2025 04:34
@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. and removed 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. labels Sep 26, 2025
@UlyssesZh
Copy link
Member Author

Tested that it is usable on darwin too now.

@UlyssesZh
Copy link
Member Author

nixpkgs-review result

Generated using nixpkgs-review-gha

Command: nixpkgs-review pr 399610
Commit: 32819b35b22905503df85a6a112a24b017157c81 (subsequent changes)
Merge: 684a277ae91bb84ee2d46b2d7987d74c118521e6

Logs: https://github.com/UlyssesZh/nixpkgs-review-gha/actions/runs/18027988941


x86_64-linux

✅ 1 package built:
  • z-library-desktop

aarch64-linux

✅ 1 package built:
  • z-library-desktop

x86_64-darwin (sandbox = true)

✅ 1 package built:
  • z-library-desktop

aarch64-darwin (sandbox = true)

✅ 1 package built:
  • z-library-desktop

@UlyssesZh
Copy link
Member Author

Updated in accordance with #422938.

@@ -0,0 +1,79 @@
#!/usr/bin/env nix-shell
#!nix-shell -i ruby -p ruby ruby.gems.nokogiri
Copy link
Member

Choose a reason for hiding this comment

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

Can we use shell to be similar to the standard update scripts?

Copy link
Member Author

@UlyssesZh UlyssesZh Oct 29, 2025

Choose a reason for hiding this comment

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

Nokogiri is a very nice API for HTML scraping. In theory it can be written in a shell script, but it will be lengthy and hard to write and maintain.

Comment on lines +46 to +50
wikipedia = Nokogiri::HTML Net::HTTP.get URI 'https://en.wikipedia.org/wiki/Z-Library'
url = wikipedia.at_css('.infobox th.infobox-label:contains("URL") + td.infobox-data a[href^="https://"]')&.[] 'href'
abort 'Could not find Z-Library URL on Wikipedia page.' unless url
abort "Could not update homepage #{current_homepage} -> #{url}" unless nix.sub! current_homepage, url
log "Z-Library URL: #{url}"
Copy link
Member

Choose a reason for hiding this comment

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

Why do we parse the wikipedia page here? Can we just hardcode the website?

Copy link
Member Author

Choose a reason for hiding this comment

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

It is constantly changing. Wikipedia is quite reliable in giving the latest working URL.

finish 'Version is up to date.' if version == current_version
abort "Could not update version: #{current_version} -> #{version}" unless nix.sub! current_version, version

download = item.at_css('a.za-download-href-link[href$=".deb"]')&.[] 'href'
Copy link
Member

Choose a reason for hiding this comment

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

This might be a stupid question but wouldn't it be easier to use regex to find the link? The page might change easily over time especially in the html layout.

Copy link
Member Author

Choose a reason for hiding this comment

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

If you consider that the page may change, using regex is just as unreliable (if not more) as CSS selectors. They are also less readable and maintainable than CSS selectors in my opinion.

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

Labels

10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants