Created attachment 252180 [details] git path Hi. ghidra is currently fallout; the last version in the ports tree is 9.1, which is now 3 years old and, because version 9.1 contains an RCE, it is marked also as FORBIDDEN (for about 5 months now...) I have contributed some code directly upstream to make ghidra work in FreeBSD (unfortunately currently the debugger option is broken, but the decompilation is working wel) - the fixes are available now since 11.1.1. Now, I have updated the port the newest version (which to date is 11.1.2) and include a patch in attachment to do this update. In this patch, I switched to the official PUBLIC release of ghidra. Some reports (e.g #275383) ask the maintainer to update the port to a newer version. If the current maintainer is OK, I can take maintainership of this port. (NOTE: I did not change this in the proposed patch). :-)
Created attachment 252186 [details] git patch improvements to the Makefile...
Created attachment 252187 [details] git patch + minor improvements + make sure to compile the demangler
SHEBANG_FILES= ${WRKSRC}/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/local-gdb.sh Why not: SHEBANG_FILES= Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/local-gdb.sh ?
USE_GCC= 13 Can't build with clang from base?
This is incorrect: @${LN} -sf ${PREFIX}/bin/g++13 ${WRKDIR}/.bin/g++ @${LN} -sf ${PREFIX}/bin/gcc ${WRKDIR}/.bin/gcc ${PREFIX} => ${LOCALBASE} $ pkg which /usr/local/bin/gcc* /usr/local/bin/gcc was installed by package gcc-13_5 $ pkg which /usr/local/bin/g++13 /usr/local/bin/g++13 was installed by package gcc13-13.2.0_4 gcc-13_5 is "Meta-port for the default version of the GNU Compiler Collection" - it installed symlinks only: gcc@ -> gcc13 g++@ -> g++13 gfortran@ -> gfortran13 But after all - why do you need these symlinks?
@${CP} -r ${WRKSRC} ${STAGEDIR}${DATADIR} Use ${COPYTREE_SHARE} instead of ${CP}. You can find examples in other ports. Maybe: cd ${WRKSRC} && ${COPYTREE_SHARE} . ${STAGEDIR}${DATADIR} ${RM} -r ${STAGEDIR}${DATADIR}/Ghidra/Ghidra/.gradle Remove this from ${WRKSRC} before copy to ${STAGEDIR}. Also you can use .for loop instead of 8 lines, something like this: .for F in Ghidra/Ghidra/.gradle Ghidra/Features/Decompiler/build/objs \ Ghidra/Features/Decompiler/build/tmp <...cut...> ${RM} -r ${WRKSRC}/${F} .endfor
EXTRACT_DEPENDS= ${UNZIP_CMD}:archivers/unzip Try USES+=zip instead.
Created attachment 252290 [details] git patch Changes: - removed ${WRKSRC} from SHEBANG_FILES - removed dependency on gcc and switched to clang compilation - rewrote the do-install target, using for-loops - removed EXTRACT_DEPENDS - portlint / portfmt / portclippy - reduce openjdk required version to 17+
Created attachment 252291 [details] devel/ghidra as tgz Add the files in devel/ghidra as a TGZ archive also. NOTE: no changes compared to the git patch.
Comment on attachment 252291 [details] devel/ghidra as tgz This is 1024 bytes with chars 0 comressed with gzip…
Created attachment 252305 [details] devel_ghidra.tar.xz (In reply to Vladimir Druzenko from comment #10) OK, sorry, I guess there was a problem with my browser before. I am now re-uploading the file. No changes compared to the git patch. Forgotten to mention before: With this patch, I am also proposing to take maintainership of devel/ghidra.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=e2b8d2a6176627276e35eb607d81bf3e474e41f4 commit e2b8d2a6176627276e35eb607d81bf3e474e41f4 Author: gatekeeper <tiago.gasiba@gmail.com> AuthorDate: 2024-07-26 20:31:11 +0000 Commit: Vladimir Druzenko <vvd@FreeBSD.org> CommitDate: 2024-07-26 20:39:31 +0000 devel/ghidra: update 9.1 → 11.1.2, take maintainership Port was FORBIDDEN, updated last time in 2019, maintainer is innactive. Tamas Szakaly <sghctoma@gmail.com>, thanks for you work, hope you come back to FreeBSD porters team! Install share/ghidra/support/launch.properties as a @sample file. Changelogs: https://htmlpreview.github.io/?https://raw.githubusercontent.com/NationalSecurityAgency/ghidra/Ghidra_11.1.2_build/Ghidra/Configurations/Public_Release/src/global/docs/ChangeHistory.html PR: 280378 275383 244345 MFH: 2024Q3 devel/ghidra/Makefile | 133 +- devel/ghidra/distinfo | 16 +- .../files/patch-GPL_CabExtract_build.gradle (gone) | 18 - .../patch-GPL_DemanglerGnu_build.gradle (gone) | 31 - ...tch-GPL_GnuDisassembler_buildGdis.gradle (gone) | 32 - devel/ghidra/files/patch-GPL_gpl.gradle (gone) | 23 - .../files/patch-GPL_nativeBuildProperties.gradle | 31 +- ...draBuild_Skeleton_certification.manifest (gone) | 10 - ...raBuild_Skeleton_os_freebsd64_README.txt (gone) | 6 - ...-Ghidra_Features_Decompiler_build.gradle (gone) | 28 - ...es_Decompiler_src_decompile_cpp_Makefile (gone) | 13 - ...iler_src_decompile_cpp_loadimage__bfd.hh (gone) | 12 - ...res_Decompiler_src_decompile_cpp_types.h (gone) | 39 - ...-Ghidra_Features_FunctionID_build.gradle (gone) | 33 - ...main_java_ghidra_framework_Platform.java (gone) | 36 - ...va_ghidra_framework_OperatingSystem.java (gone) | 10 - ...a_RuntimeScripts_Linux_support_launch.sh (gone) | 10 - ...patch-Ghidra_RuntimeScripts_build.gradle (gone) | 11 - devel/ghidra/files/patch-README.txt (gone) | 6 - devel/ghidra/files/patch-build.gradle (gone) | 74 - .../patch-gradle_root_distribution.gradle (gone) | 10 - .../files/patch-gradle_support_ip.gradle (gone) | 11 - devel/ghidra/pkg-plist (new) | 4666 ++++++++++++++++++++ 23 files changed, 4731 insertions(+), 528 deletions(-)
A commit in branch 2024Q3 references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=a345c2f858e04f01d7c5d6c7c42af76a9898197a commit a345c2f858e04f01d7c5d6c7c42af76a9898197a Author: gatekeeper <tiago.gasiba@gmail.com> AuthorDate: 2024-07-26 20:31:11 +0000 Commit: Vladimir Druzenko <vvd@FreeBSD.org> CommitDate: 2024-07-26 20:43:34 +0000 devel/ghidra: update 9.1 → 11.1.2, take maintainership Port was FORBIDDEN, updated last time in 2019, maintainer is innactive. Tamas Szakaly <sghctoma@gmail.com>, thanks for you work, hope you come back to FreeBSD porters team! Install share/ghidra/support/launch.properties as a @sample file. Changelogs: https://htmlpreview.github.io/?https://raw.githubusercontent.com/NationalSecurityAgency/ghidra/Ghidra_11.1.2_build/Ghidra/Configurations/Public_Release/src/global/docs/ChangeHistory.html PR: 280378 275383 244345 MFH: 2024Q3 (cherry picked from commit e2b8d2a6176627276e35eb607d81bf3e474e41f4) devel/ghidra/Makefile | 133 +- devel/ghidra/distinfo | 16 +- .../files/patch-GPL_CabExtract_build.gradle (gone) | 18 - .../patch-GPL_DemanglerGnu_build.gradle (gone) | 31 - ...tch-GPL_GnuDisassembler_buildGdis.gradle (gone) | 32 - devel/ghidra/files/patch-GPL_gpl.gradle (gone) | 23 - .../files/patch-GPL_nativeBuildProperties.gradle | 31 +- ...draBuild_Skeleton_certification.manifest (gone) | 10 - ...raBuild_Skeleton_os_freebsd64_README.txt (gone) | 6 - ...-Ghidra_Features_Decompiler_build.gradle (gone) | 28 - ...es_Decompiler_src_decompile_cpp_Makefile (gone) | 13 - ...iler_src_decompile_cpp_loadimage__bfd.hh (gone) | 12 - ...res_Decompiler_src_decompile_cpp_types.h (gone) | 39 - ...-Ghidra_Features_FunctionID_build.gradle (gone) | 33 - ...main_java_ghidra_framework_Platform.java (gone) | 36 - ...va_ghidra_framework_OperatingSystem.java (gone) | 10 - ...a_RuntimeScripts_Linux_support_launch.sh (gone) | 10 - ...patch-Ghidra_RuntimeScripts_build.gradle (gone) | 11 - devel/ghidra/files/patch-README.txt (gone) | 6 - devel/ghidra/files/patch-build.gradle (gone) | 74 - .../patch-gradle_root_distribution.gradle (gone) | 10 - .../files/patch-gradle_support_ip.gradle (gone) | 11 - devel/ghidra/pkg-plist (new) | 4666 ++++++++++++++++++++ 23 files changed, 4731 insertions(+), 528 deletions(-)
Thanks!