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

detect-it-easy: init at 3.09 #349841

Merged
merged 2 commits into from
Oct 22, 2024

Conversation

hexadecimalDinosaur
Copy link
Member

@hexadecimalDinosaur hexadecimalDinosaur commented Oct 19, 2024

Program for determining types of files for Windows, Linux and MacOS. https://github.com/horsicq/Detect-It-Easy/

Used for reverse engineering and binary analysis work to identify compiler versions and other file information.

Note that there is support for aarch64-linux and aarch64-darwin was recently added to the DIE-engine repository but no support exists in the latest stable 3.09 version.

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/)
  • 24.11 Release Notes (or backporting 23.11 and 24.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.

@hexadecimalDinosaur hexadecimalDinosaur changed the title create detect-it-easy 3.09 package detect-it-easy: init at 3.09 Oct 19, 2024
Copy link
Contributor

@zi3m5f zi3m5f left a comment

Choose a reason for hiding this comment

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

Overall your PR looks good :)

Please reorder your commits, your maintainers commit has to be first:

nixpkgs/CONTRIBUTING.md

Lines 506 to 509 in bd95a9a

- When adding yourself as maintainer in the same pull request, make a separate
commit with the message `maintainers: add <handle>`.
Add the commit before those making changes to the package or module.
See [Nixpkgs Maintainers](./maintainers/README.md) for details.

pkgs/by-name/de/detect-it-easy/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/de/detect-it-easy/package.nix Outdated Show resolved Hide resolved
Signed-off-by: Ivy Fan-Chiang <dev@ivyfanchiang.ca>
@hexadecimalDinosaur
Copy link
Member Author

Thanks for the advice @zi3m5f, made the changes you requested

@hexadecimalDinosaur
Copy link
Member Author

cc @emilytrau

pkgs/by-name/de/detect-it-easy/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/de/detect-it-easy/package.nix Outdated Show resolved Hide resolved
@hexadecimalDinosaur
Copy link
Member Author

Thanks again @zi3m5f, didn't spot the issues in Detect It Easy's install.sh which led to me writing a postInstall phase. Seems to be working a lot better with the changes you suggested.

Copy link
Contributor

@zi3m5f zi3m5f left a comment

Choose a reason for hiding this comment

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

Seems to be working a lot better with the changes you suggested.

Unfortunately there are still problems:

$ nix shell nixpkgs#desktop-file-utils -c desktop-file-validate result/share/applications/die.desktop
> error: value "#VERSION#" for key "Version" in group "Desktop Entry" is not a known version

It seems die.desktop in $out differs from LINUX/die.desktop in $src.
Could you investigate why? Generally we have at least two options here:

  • fix copied/modified desktop file
  • remove and generate our own again

Also $out/lib/{bin,share/applications,icons} should be removed.

pkgs/by-name/de/detect-it-easy/package.nix Outdated Show resolved Hide resolved
@hexadecimalDinosaur
Copy link
Member Author

@zi3m5f the die.desktop file in $out matches the file in version 3.09. The file in the DIE-engine source however has this line:
https://github.com/horsicq/DIE-engine/blob/a9be908ffa5dab648710c3c354f33e31d2dd4e18/LINUX/die.desktop#L2
which is throwing the error you see
I can add a postInstall step to remove that line from the die.desktop file

@zi3m5f
Copy link
Contributor

zi3m5f commented Oct 20, 2024

I can add a postInstall step to remove that line from the die.desktop file

Another solution would be to use

  patches = [
    (fetchpatch {
      url = "https://github.com/horsicq/DIE-engine/commit/<commit>.patch";
      hash = "";
    })
  ];

for both install.sh and die.desktop fixes and remove preInstall.

Your choice ;)

@hexadecimalDinosaur
Copy link
Member Author

New errors 😭, will figure this out and push another commit
image

@hexadecimalDinosaur
Copy link
Member Author

hexadecimalDinosaur commented Oct 21, 2024

Looks like a patch of XOptions/xoptions.cpp in the XOptions::getApplicationDataPath() function is required, there are hard-coded paths referencing /usr in there.

Signed-off-by: Ivy Fan-Chiang <dev@ivyfanchiang.ca>
Copy link
Contributor

@zi3m5f zi3m5f left a comment

Choose a reason for hiding this comment

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

I didn't run/test any binaries but it compiles and result looks normal.

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 349841


x86_64-linux

✅ 1 package built:
  • detect-it-easy

@emilytrau emilytrau merged commit d75577c into NixOS:master Oct 22, 2024
28 of 29 checks passed
@hexadecimalDinosaur hexadecimalDinosaur deleted the detect-it-easy-3.09 branch October 22, 2024 21:41
@hexadecimalDinosaur
Copy link
Member Author

hexadecimalDinosaur commented Oct 22, 2024

Thank you so much for the advice on this first PR @emilytrau and @zi3m5f!!! ❤️

@hexadecimalDinosaur hexadecimalDinosaur added the backport release-24.05 Backport PR automatically label Oct 22, 2024
Copy link
Contributor

Successfully created backport PR for release-24.05:

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.

4 participants