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

imhex: init at 1.11.1 #148646

Closed
wants to merge 1 commit into from
Closed

imhex: init at 1.11.1 #148646

wants to merge 1 commit into from

Conversation

Qubasa
Copy link
Contributor

@Qubasa Qubasa commented Dec 4, 2021

Motivation for this change

I packaged the hex editor imhex
and removed my own deprecated package rmount

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • 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/)
  • 22.05 Release Notes (or backporting 21.11 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
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@Qubasa Qubasa force-pushed the imhex branch 5 times, most recently from 1d9a84d to f1b9ae2 Compare December 4, 2021 23:21
@SuperSandro2000 SuperSandro2000 changed the title imhex: init at v1.11.1 imhex: init at 1.11.1 Dec 5, 2021
pkgs/tools/filesystems/rmount/default.nix Show resolved Hide resolved
version = "1.11.1";

src = fetchFromGitHub {
fetchSubmodules = true;
Copy link
Member

Choose a reason for hiding this comment

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

Do we have all the package that are vendored in nixpkgs? If so we can remove this.

pkgs/tools/security/imhex/default.nix Outdated Show resolved Hide resolved
pkgs/tools/security/imhex/default.nix Outdated Show resolved Hide resolved
pkgs/tools/security/imhex/default.nix Outdated Show resolved Hide resolved
Comment on lines +60 to +55
install -D plugins/builtin/builtin.hexplug $out/bin/plugins/builtin.hexplug
install -D plugins/libimhex/libimhex.so $out/lib/libimhex.so

cp -R ${patterns_src}/* $out/bin
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 want those files under /bin? They do not belong there and should probably go under /share/imhex/.

Suggested change
install -D plugins/builtin/builtin.hexplug $out/bin/plugins/builtin.hexplug
install -D plugins/libimhex/libimhex.so $out/lib/libimhex.so
cp -R ${patterns_src}/* $out/bin
install -D plugins/builtin/builtin.hexplug $out/share/imhex/plugins/builtin.hexplug
install -D plugins/libimhex/libimhex.so $out/lib/libimhex.so
cp -R ${patterns_src}/* $out/bin

pkgs/tools/security/imhex/default.nix Show resolved Hide resolved
pkgs/tools/security/imhex/default.nix Outdated Show resolved Hide resolved
pkgs/tools/security/imhex/default.nix Outdated Show resolved Hide resolved
pkgs/top-level/all-packages.nix Show resolved Hide resolved
@Qubasa
Copy link
Contributor Author

Qubasa commented Dec 5, 2021

ah @SuperSandro2000 I changed postFixup phase back to fixupPhase because the fixupPhase broke something

@SuperSandro2000
Copy link
Member

ah @SuperSandro2000 I changed postFixup phase back to fixupPhase because the fixupPhase broke something

What got broken exactly? We want to run fixupPhase and figure out what is broken. Maybe stripping? We could disable that with dontStrip.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 12, 2022
@djanatyn
Copy link
Contributor

djanatyn commented Jul 24, 2022

I was interested in running ImHex, I rebased this pull request on the latest main:

I was able to run the program successfully, but when I tried to open a file, I got a crash before the dialog displayed:

(imhex:340898): GLib-GIO-ERROR **: 13:57:52.857: No GSettings schemas are installed on the system

I tried to fix this issue using wrapGAppsHook and gobject-introspection, but I was unsuccessful (getting the same crash behavior with the same error message):

However, I was able to proceed by setting XDG_DATA_DIR before running:

❯ export XDG_DATA_DIRS=/nix/store/arysd09ka49dpdai09b83ndkqnilgnyh-gsettings-desktop-schemas-42.0/share/gsettings-schemas/gsettings-desktop-schemas-42.0:/nix/store/jws83dlza8fl5w9mvk5zjaj7mmcknaa3-gtk+3-3.24.34/share/gsettings-schemas/gtk+3-3.24.34
❯ ./result/bin/imhex
[INFO]  Welcome to ImHex!

After that I could open the file dialog successfully.

I used nix repl to figure out what paths I needed to set:

pkgs = legacyPackages.x86_64-linux;
schema-path = pkg: "${pkg}/share/gsettings-schemas/${pkg.name}";

output = lib.makeLibraryPath [
  (schema-path pkgs.gsettings-desktop-schemas)
  (schema-path pkgs.gtk3-x11)
];

I thought only gsettings-desktop-schemas was required, but you'll also need org.gtk.Settings.FileChooser (which I took from gtk3-x11):

(imhex:373180): GLib-GIO-ERROR **: 14:06:07.614: Settings schema 'org.gtk.Settings.FileChooser' is not installed

Hope this is helpful. Please let me know if you're aware of how to configure wrapGappsHook and gobject-introspection for this package, I always get stuck here.

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 24, 2022
@djanatyn
Copy link
Contributor

djanatyn commented Jul 25, 2022

I was unable to download the standard library from the Content Store to run patterns, so I bumped the version from v1.11.1 -> v.1.19.2:

I needed to switch to a newer version of GCC, and to add a dbus dependency.

After upgrading, I was able to pull down the standard library, and to evaluate patterns using <std/mem.pat>. However, I still had issues with the file dialog.

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.

None yet

5 participants