Index: head/devel/ghidra/Makefile =================================================================== --- head/devel/ghidra/Makefile (revision 518004) +++ head/devel/ghidra/Makefile (revision 518005) @@ -1,123 +1,115 @@ # $FreeBSD$ PORTNAME= ghidra DISTVERSIONPREFIX= Ghidra_ -DISTVERSION= 9.0.4 +DISTVERSION= 9.1 DISTVERSIONSUFFIX= _build -CATEGORIES= devel security +CATEGORIES= devel security java MASTER_SITES= SF/yajsw/yajsw/yajsw-stable-12.12/:yajsw \ SF/catacombae/HFSExplorer/0.21/:hfsexplorer \ https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/android4me/:axml2printer \ https://github.com/pxb1988/dex2jar/releases/download/2.0/:dex2jar DISTFILES= yajsw-stable-12.12.zip:yajsw \ hfsexplorer-0_21-bin.zip:hfsexplorer \ AXMLPrinter2.jar:axml2printer \ dex-tools-2.0.zip:dex2jar DIST_SUBDIR= ${PORTNAME} EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX} MAINTAINER= sghctoma@gmail.com COMMENT= Software reverse engineering (SRE) framework LICENSE= APACHE20 LICENSE_FILE= ${WRKSRC}/LICENSE ONLY_FOR_ARCHS= amd64 EXTRACT_DEPENDS= ${UNZIP_CMD}:archivers/unzip BUILD_DEPENDS= gradle5>=5.0:devel/gradle5 \ bash:shells/bash \ flex:textproc/flex \ fop:textproc/fop \ ${LOCALBASE}/share/xsl/docbook/html/docbook.xsl:textproc/docbook-xsl RUN_DEPENDS= bash:shells/bash USES= bison shebangfix -OPTIONS_RADIO= JDK -OPTIONS_RADIO_JDK= JDK11 JDK12 -OPTIONS_DEFAULT= JDK11 - -JDK11_BUILD_DEPENDS= ${LOCALBASE}/openjdk11/bin/java:java/openjdk11 -JDK11_RUN_DEPENDS= ${LOCALBASE}/openjdk11/bin/java:java/openjdk11 -JDK12_BUILD_DEPENDS= ${LOCALBASE}/openjdk12/bin/java:java/openjdk12 -JDK12_RUN_DEPENDS= ${LOCALBASE}/openjdk12/bin/java:java/openjdk12 - SHEBANG_FILES= Ghidra/RuntimeScripts/Linux/* \ Ghidra/RuntimeScripts/Linux/support/* \ - Ghidra/RuntimeScripts/Linux/server/* + Ghidra/RuntimeScripts/Linux/server/* \ + Ghidra/RuntimeScripts/Common/server/jaas_external_program.example.sh USE_GITHUB= yes GH_ACCOUNT= NationalSecurityAgency +USE_JAVA= yes +JAVA_BUILD= yes +JAVA_RUN= yes +JAVA_VERSION= 11+ + GRADLE_HOME_BASE= /tmp # Gradle cache path must be absolute (see https://github.com/gradle/gradle/issues/1338) GRADLE_RUN= ${SETENV} ${MAKE_ENV} gradle5 \ --gradle-user-home ${GRADLE_HOME_BASE}/gradle-${PORTNAME} \ --no-daemon # to rebuild the deps archive: # 1. set DEV_UPDATE_MODE=yes # 2. make makesum build # 3. upload the *-deps archive # 4. set DEV_UPDATE_MODE=no # 5. make clean makesum DEV_UPDATE_MODE= no .if (${DEV_UPDATE_MODE} == "yes") post-build: - @cd ${GRADLE_HOME_BASE} && ${TAR} czf ${DISTDIR}/${DIST_SUBDIR}/${PORTNAME}-${DISTVERSION}-deps${EXTRACT_SUFX} gradle-${PORTNAME} + cd ${GRADLE_HOME_BASE} && ${TAR} czf ${DISTDIR}/${DIST_SUBDIR}/${PORTNAME}-${DISTVERSION}-deps${EXTRACT_SUFX} gradle-${PORTNAME} @${ECHO} "(!!!) Please upload the Gradle deps archive: ${DISTDIR}/${DIST_SUBDIR}/${PORTNAME}-${DISTVERSION}-deps${EXTRACT_SUFX}" + @${RM} -r ${GRADLE_HOME_BASE}/gradle-${PORTNAME} .else MASTER_SITES+= https://github.com/sghctoma/ghidra-deps/raw/master/:gradle DISTFILES+= ${PORTNAME}-${DISTVERSION}-deps${EXTRACT_SUFX}:gradle EXTRACT_ONLY+= ${PORTNAME}-${DISTVERSION}-deps${EXTRACT_SUFX} GRADLE_RUN+= --offline .endif post-extract: @${MKDIR} ${WRKDIR}/flatrepo @${MKDIR} ${WRKDIR}/dummy.home @${CP} ${DISTDIR}/${DIST_SUBDIR}/AXMLPrinter2.jar ${WRKDIR}/flatrepo @${UNZIP_CMD} -j -d ${WRKDIR}/flatrepo ${DISTDIR}/${DIST_SUBDIR}/hfsexplorer-0_21-bin.zip \ lib/csframework.jar lib/hfsx_dmglib.jar lib/hfsx.jar lib/iharder-base64.jar @${UNZIP_CMD} -j -d ${WRKDIR}/flatrepo ${DISTDIR}/${DIST_SUBDIR}/dex-tools-2.0.zip "dex2jar-2.0/lib/dex-*.jar" @${MKDIR} ${WRKDIR}/ghidra.bin/Ghidra/Features/GhidraServer/ @${CP} ${DISTDIR}/${DIST_SUBDIR}/yajsw-stable-12.12.zip ${WRKDIR}/ghidra.bin/Ghidra/Features/GhidraServer/ .if (${DEV_UPDATE_MODE} == "no") @${LN} -sf ${WRKDIR}/gradle-${PORTNAME} ${GRADLE_HOME_BASE} .endif post-patch: @${REINPLACE_CMD} -e "s|/usr/share/sgml/docbook/xsl-stylesheets|${LOCALBASE}/share/xsl/docbook/|g" \ ${WRKSRC}/Ghidra/Features/Decompiler/src/main/doc/*.xsl \ ${WRKSRC}/Ghidra/Features/FunctionID/src/main/doc/*.xsl + @${REINPLACE_CMD} -e "s|JAVA_HOME_PLACEHOLDER|${JAVA_HOME}|" \ + ${WRKSRC}/Ghidra/RuntimeScripts/Linux/support/launch.sh + @${ECHO_CMD} "org.gradle.java.home=${JAVA_HOME}" > ${WRKSRC}/gradle.properties -post-patch-JDK11-on: - @${ECHO_CMD} "org.gradle.java.home=${LOCALBASE}/openjdk11" > ${WRKSRC}/gradle.properties - -post-patch-JDK12-on: - @${ECHO_CMD} "org.gradle.java.home=${LOCALBASE}/openjdk12" > ${WRKSRC}/gradle.properties - do-build: - cd ${WRKSRC} && ${GRADLE_RUN} yajswDevUnpack buildGhidra - -post-build: - @${RM} ${GRADLE_HOME_BASE}/gradle-${PORTNAME} + @cd ${WRKSRC} && ${GRADLE_RUN} yajswDevUnpack buildGhidra do-install: @${UNZIP_CMD} -d ${STAGEDIR} ${WRKSRC}/build/dist/*.zip @${MV} ${STAGEDIR}/ghidra* ${STAGEDIR}${DATADIR} @${RLN} ${STAGEDIR}/${DATADIR}/ghidraRun ${STAGEDIR}${PREFIX}/bin/ghidra @${RLN} ${STAGEDIR}/${DATADIR}/server/ghidraSvr ${STAGEDIR}${PREFIX}/bin/ghidra-server @${STRIP_CMD} ${STAGEDIR}/${DATADIR}/GPL/DemanglerGnu/os/freebsd64/demangler_gnu @${STRIP_CMD} ${STAGEDIR}/${DATADIR}/Ghidra/Features/Decompiler/os/freebsd64/decompile @${STRIP_CMD} ${STAGEDIR}/${DATADIR}/Ghidra/Features/Decompiler/os/freebsd64/sleigh post-install: @${FIND} ${STAGEDIR} ! -type d | \ ${SED} 's,${STAGEDIR}${PREFIX}/,,' >> ${TMPPLIST} @${FIND} -ds ${STAGEDIR}${DATADIR} -type d -empty | \ ${SED} 's,${STAGEDIR}${PREFIX}/,, ; s,^,@dir ,' >> ${TMPPLIST} .include Index: head/devel/ghidra/distinfo =================================================================== --- head/devel/ghidra/distinfo (revision 518004) +++ head/devel/ghidra/distinfo (revision 518005) @@ -1,13 +1,13 @@ -TIMESTAMP = 1561351901 +TIMESTAMP = 1572919336 SHA256 (ghidra/yajsw-stable-12.12.zip) = 1398fcb1e93abb19992c4fa06d7fe5758aabb4c45781d7ef306c6f57ca7a7321 SIZE (ghidra/yajsw-stable-12.12.zip) = 25051676 SHA256 (ghidra/hfsexplorer-0_21-bin.zip) = 90c9b54798abca5b12f4a678db7d0a4c970f4702cb153c11919536d0014dedbf SIZE (ghidra/hfsexplorer-0_21-bin.zip) = 1473278 SHA256 (ghidra/AXMLPrinter2.jar) = 00ed038eb6abaf6ddec8d202a3ed7a81b521458f4cd459948115cfd02ff59d6d SIZE (ghidra/AXMLPrinter2.jar) = 24552 SHA256 (ghidra/dex-tools-2.0.zip) = 7907eb4d6e9280b6e17ddce7ee0507eae2ef161ee29f70a10dbc6944fdca75bc SIZE (ghidra/dex-tools-2.0.zip) = 2362460 -SHA256 (ghidra/ghidra-9.0.4-deps.tar.gz) = 740f48fb112690a9cfe64993052fc291728b37ee238efdee21234323bf00edb2 -SIZE (ghidra/ghidra-9.0.4-deps.tar.gz) = 58437917 -SHA256 (ghidra/NationalSecurityAgency-ghidra-Ghidra_9.0.4_build_GH0.tar.gz) = e24593fb4cf3e1d1b7a8dfeae85edfba9fd9d446b360c7a5d12e9640438735e3 -SIZE (ghidra/NationalSecurityAgency-ghidra-Ghidra_9.0.4_build_GH0.tar.gz) = 59223815 +SHA256 (ghidra/ghidra-9.1-deps.tar.gz) = 8ba91101c365bbd180884721a9e329a804d4e12c5cec51e7fa275c88d8e8ba02 +SIZE (ghidra/ghidra-9.1-deps.tar.gz) = 57584763 +SHA256 (ghidra/NationalSecurityAgency-ghidra-Ghidra_9.1_build_GH0.tar.gz) = 1cead115fce1e06ce3646ba3df7eb06a221405322ba2cda6197a6a5ae45dd0e0 +SIZE (ghidra/NationalSecurityAgency-ghidra-Ghidra_9.1_build_GH0.tar.gz) = 59599279 Index: head/devel/ghidra/files/patch-GPL_build.gradle =================================================================== --- head/devel/ghidra/files/patch-GPL_build.gradle (revision 518004) +++ head/devel/ghidra/files/patch-GPL_build.gradle (nonexistent) @@ -1,21 +0,0 @@ ---- GPL/build.gradle.orig 2019-04-03 17:38:23 UTC -+++ GPL/build.gradle -@@ -1,5 +1,5 @@ - project.ext.BIN_REPO = file("${projectDir}/../../ghidra.bin").absolutePath --project.ext.set("OS_NAMES", ["osx64", "win32", "win64", "linux64"]) -+project.ext.set("OS_NAMES", ["osx64", "win32", "win64", "linux64", "freebsd64"]) - - /********************************************************************************* - * Returns the local platform name. -@@ -28,6 +28,11 @@ String getCurrentPlatformName() { - else if (osName.startsWith("Mac OS X")) { - if (isX86_64) { - return 'osx64' -+ } -+ } -+ else if (osName.startsWith("FreeBSD")) { -+ if (isX86_64) { -+ return 'freebsd64' - } - } - throw new GradleException("Unrecognized current platform -> osName = $osName, archName = $archName") Property changes on: head/devel/ghidra/files/patch-GPL_build.gradle ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/devel/ghidra/files/patch-gradleScripts_distribution.gradle =================================================================== --- head/devel/ghidra/files/patch-gradleScripts_distribution.gradle (revision 518004) +++ head/devel/ghidra/files/patch-gradleScripts_distribution.gradle (nonexistent) @@ -1,37 +0,0 @@ ---- gradleScripts/distribution.gradle.orig 2019-05-16 19:36:27 UTC -+++ gradleScripts/distribution.gradle -@@ -526,7 +526,7 @@ project.OS_NAMES.each { platform -> - ///////////////// - // SUPPORT SCRIPTS - ///////////////// -- if( isLinux(platform) || isMac(platform) ) { -+ if( isLinux(platform) || isMac(platform) || isFreeBSD(platform) ) { - with getMultiRepoCopySpec( "Ghidra/RuntimeScripts/Linux/support", "support" ) - } - if( isWindows(platform) ) { -@@ -536,7 +536,7 @@ project.OS_NAMES.each { platform -> - ///////////////// - // SERVER SCRIPTS - ///////////////// -- if( isLinux(platform) || isMac(platform) ) { -+ if( isLinux(platform) || isMac(platform) || isFreeBSD(platform) ) { - from (ROOT_PROJECT_DIR + "/Ghidra/RuntimeScripts/Linux/server") { - into "server" - } -@@ -550,7 +550,7 @@ project.OS_NAMES.each { platform -> - ///////////////// - // GHIDRA RUN SCRIPT - ///////////////// -- if( isLinux(platform) || isMac(platform) ) { -+ if( isLinux(platform) || isMac(platform) || isFreeBSD(platform) ) { - from (ROOT_PROJECT_DIR + "/Ghidra/RuntimeScripts/Linux") { - include "ghidraRun" - } -@@ -987,6 +987,7 @@ task createMultiPlatformInstallationZip(type: Zip) { t - dependsOn ":assemblewin64" - dependsOn ":assemblelinux64" - dependsOn ":assembleosx64" -+ dependsOn ":assemblefreebsd64" - dependsOn ":assembleSourceCommon" - - addDecompilerPdfsToZip(t) Property changes on: head/devel/ghidra/files/patch-gradleScripts_distribution.gradle ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/devel/ghidra/files/patch-gradleScripts_ip.gradle =================================================================== --- head/devel/ghidra/files/patch-gradleScripts_ip.gradle (revision 518004) +++ head/devel/ghidra/files/patch-gradleScripts_ip.gradle (nonexistent) @@ -1,11 +0,0 @@ ---- gradleScripts/ip.gradle.orig 2019-04-11 17:48:14 UTC -+++ gradleScripts/ip.gradle -@@ -125,6 +125,8 @@ def Map> getIpForModule(Project p - exclude "**/.settings/**" - exclude "**/.vs/**" - exclude "**/*.vcxproj.user" -+ exclude "**/*.orig" -+ exclude "**/*.bak" - } - tree.each { file -> - String ip = getIp(p.projectDir, file) Property changes on: head/devel/ghidra/files/patch-gradleScripts_ip.gradle ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/devel/ghidra/files/patch-GPL_CabExtract_build.gradle =================================================================== --- head/devel/ghidra/files/patch-GPL_CabExtract_build.gradle (revision 518004) +++ head/devel/ghidra/files/patch-GPL_CabExtract_build.gradle (revision 518005) @@ -1,11 +1,18 @@ ---- GPL/CabExtract/build.gradle.orig 2019-04-03 17:38:23 UTC +--- GPL/CabExtract/build.gradle.orig 2019-11-04 12:59:19 UTC +++ GPL/CabExtract/build.gradle -@@ -40,7 +40,7 @@ project.ext.cabextract = "cabextract-1.6" - * +@@ -58,7 +58,7 @@ task configureCabExtract (type: Exec) { * The cabextract tool requires that its 'configure' script is called before make. *********************************************************************************/ --['linux64', 'osx64'].each { platform -> -+['linux64', 'osx64', 'freebsd64'].each { platform -> + def currentPlatform = getCurrentPlatformName() +-if (['linux64', 'osx64'].contains(currentPlatform)) { ++if (['linux64', 'osx64', 'freebsd64'].contains(currentPlatform)) { - def configureName = "${platform}CabExtractConfigure" - def makeName = "${platform}CabExtractMake" // native Make task found automatically + def makeName = "${currentPlatform}CabExtractMake" // native Make task found automatically + +@@ -75,4 +75,4 @@ if (['linux64', 'osx64'].contains(currentPlatform)) { + delete file("build/unpack/${cabextract}") + } + } +-} +\ No newline at end of file ++} Index: head/devel/ghidra/files/patch-GPL_DemanglerGnu_build.gradle =================================================================== --- head/devel/ghidra/files/patch-GPL_DemanglerGnu_build.gradle (revision 518004) +++ head/devel/ghidra/files/patch-GPL_DemanglerGnu_build.gradle (revision 518005) @@ -1,31 +1,31 @@ ---- GPL/DemanglerGnu/build.gradle.orig 2019-04-03 17:38:23 UTC +--- GPL/DemanglerGnu/build.gradle.orig 2019-10-23 20:54:54 UTC +++ GPL/DemanglerGnu/build.gradle -@@ -24,6 +24,10 @@ model { +@@ -32,6 +32,10 @@ model { architecture 'x86_64' operatingSystem 'osx' } + freebsd64 { + architecture 'x86_64' + operatingSystem 'freebsd' + } } } -@@ -64,6 +68,7 @@ model { +@@ -72,6 +76,7 @@ model { targetPlatform "win64" targetPlatform "linux64" targetPlatform "osx64" + targetPlatform "freebsd64" sources { c { source { -@@ -80,6 +85,9 @@ model { +@@ -88,6 +93,9 @@ model { } model { + toolChains { + clang(Clang) + } binaries { all{ b -> if (toolChain in Gcc) { Index: head/devel/ghidra/files/patch-GPL_GnuDisassembler_buildGdis.gradle =================================================================== --- head/devel/ghidra/files/patch-GPL_GnuDisassembler_buildGdis.gradle (nonexistent) +++ head/devel/ghidra/files/patch-GPL_GnuDisassembler_buildGdis.gradle (revision 518005) @@ -0,0 +1,32 @@ +--- GPL/GnuDisassembler/buildGdis.gradle.orig 2019-11-04 13:11:50 UTC ++++ GPL/GnuDisassembler/buildGdis.gradle +@@ -6,7 +6,7 @@ + + defaultTasks 'assemble' + +-ext.supportedPlatforms = ['osx64', 'linux64'] ++ext.supportedPlatforms = ['osx64', 'linux64', 'freebsd64'] + + ext.binutilsResource = new File("${binutilsLocation}/${binutils}.tar.bz2") + +@@ -31,6 +31,10 @@ model { + architecture 'x86_64' + operatingSystem 'osx' + } ++ freebsd64 { ++ architecture 'x86_64' ++ operatingSystem 'freebsd' ++ } + } + + components { +@@ -65,6 +69,9 @@ model { + } + tasks.compileGdisLinux64ExecutableGdisC { + dependsOn 'copyBinutilsArtifcats_linux64' ++ } ++ tasks.compileGdisFreeBSD64ExecutableGdisC { ++ dependsOn 'copyBinutilsArtifcats_freebsd64' + } + + } Property changes on: head/devel/ghidra/files/patch-GPL_GnuDisassembler_buildGdis.gradle ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/devel/ghidra/files/patch-GPL_gpl.gradle =================================================================== --- head/devel/ghidra/files/patch-GPL_gpl.gradle (nonexistent) +++ head/devel/ghidra/files/patch-GPL_gpl.gradle (revision 518005) @@ -0,0 +1,23 @@ +--- GPL/gpl.gradle.orig 2019-11-04 13:00:14 UTC ++++ GPL/gpl.gradle +@@ -6,7 +6,7 @@ project.ext.BIN_REPO = file("../../../ghidra.bin").abs + * Create a set containing all the platforms we need when building native + * artifacts. + ****************************************************************************/ +-project.ext.set("OS_NAMES", ["osx64", "win32", "win64", "linux64"]) ++project.ext.set("OS_NAMES", ["osx64", "win32", "win64", "linux64", "freebsd64"]) + + /**************************************************************************** + * Establish Visual Studio configuration environment for Windows native builds +@@ -43,6 +43,11 @@ ext.getCurrentPlatformName = { + return 'osx64' + } + } ++ else if (osName.startsWith("FreeBSD")) { ++ if (isX86_64) { ++ return 'freebsd64' ++ } ++ } + throw new GradleException("Unrecognized current platform -> osName = $osName, archName = $archName") + } + /****************************************************************************************** Property changes on: head/devel/ghidra/files/patch-GPL_gpl.gradle ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/devel/ghidra/files/patch-GPL_nativeBuildProperties.gradle =================================================================== --- head/devel/ghidra/files/patch-GPL_nativeBuildProperties.gradle (revision 518004) +++ head/devel/ghidra/files/patch-GPL_nativeBuildProperties.gradle (revision 518005) @@ -1,13 +1,13 @@ ---- GPL/nativeBuildProperties.gradle.orig 2019-05-16 19:36:27 UTC +--- GPL/nativeBuildProperties.gradle.orig 2019-10-23 20:54:54 UTC +++ GPL/nativeBuildProperties.gradle -@@ -75,6 +75,10 @@ model { +@@ -39,6 +39,10 @@ model { architecture 'x86_64' operatingSystem 'osx' } + freebsd64 { + architecture 'x86_64' + operatingSystem 'freebsd' + } } } Index: head/devel/ghidra/files/patch-GhidraBuild_Skeleton_certification.manifest =================================================================== --- head/devel/ghidra/files/patch-GhidraBuild_Skeleton_certification.manifest (revision 518004) +++ head/devel/ghidra/files/patch-GhidraBuild_Skeleton_certification.manifest (revision 518005) @@ -1,10 +1,10 @@ ---- GhidraBuild/Skeleton/certification.manifest.orig 2019-04-03 17:38:23 UTC +--- GhidraBuild/Skeleton/certification.manifest.orig 2019-10-23 20:54:54 UTC +++ GhidraBuild/Skeleton/certification.manifest -@@ -17,6 +17,7 @@ extension.properties||GHIDRA||||END| +@@ -15,6 +15,7 @@ extension.properties||GHIDRA||||END| ghidra_scripts/README.txt||GHIDRA||||END| lib/README.txt||GHIDRA||||END| os/linux64/README.txt||GHIDRA||||END| +os/freebsd64/README.txt||GHIDRA||||END| os/osx64/README.txt||GHIDRA||||END| os/win64/README.txt||GHIDRA||||END| src/main/help/help/TOC_Source.xml||GHIDRA||||END| Index: head/devel/ghidra/files/patch-Ghidra_Features_Decompiler_build.gradle =================================================================== --- head/devel/ghidra/files/patch-Ghidra_Features_Decompiler_build.gradle (revision 518004) +++ head/devel/ghidra/files/patch-Ghidra_Features_Decompiler_build.gradle (revision 518005) @@ -1,30 +1,28 @@ ---- Ghidra/Features/Decompiler/build.gradle.orig 2019-04-03 17:38:23 UTC +--- Ghidra/Features/Decompiler/build.gradle.orig 2019-10-23 20:54:54 UTC +++ Ghidra/Features/Decompiler/build.gradle -@@ -75,8 +75,9 @@ task buildDecompilerDocumentationPdfs(type: Exec) { - - // Check the OS before enabling task. - if (!(org.gradle.internal.os.OperatingSystem.current().isLinux() -- || org.gradle.internal.os.OperatingSystem.current().isMacOsX())) { -- println "The '$it.name' task only works on Linux or Mac Os X and is therefore disabled." -+ || org.gradle.internal.os.OperatingSystem.current().isMacOsX() -+ || org.gradle.internal.os.OperatingSystem.current().getName().contains("FreeBSD"))) { -+ println "The '$it.name' task only works on Linux, FreeBSD or Mac Os X and is therefore disabled." - it.enabled = false - } - -@@ -245,6 +246,7 @@ model { +@@ -210,7 +210,8 @@ task buildDecompilerDocumentationHtml(type: Exec) { + // Check the OS before executing command. + doFirst { + if ( !(org.gradle.internal.os.OperatingSystem.current().isLinux() +- || org.gradle.internal.os.OperatingSystem.current().isMacOsX())) { ++ || org.gradle.internal.os.OperatingSystem.current().isMacOsX() ++ || org.gradle.internal.os.OperatingSystem.current().getName().contains("FreeBSD"))) { + throw new TaskExecutionException( it, + new Exception( "The '$it.name' task only works on Linux or Mac Os X" )) + } +@@ -248,6 +249,7 @@ model { targetPlatform "win64" targetPlatform "linux64" targetPlatform "osx64" + targetPlatform "freebsd64" sources { cpp { source { -@@ -342,6 +344,7 @@ model { +@@ -345,6 +347,7 @@ model { targetPlatform "win64" targetPlatform "linux64" targetPlatform "osx64" + targetPlatform "freebsd64" sources { cpp { source { Index: head/devel/ghidra/files/patch-Ghidra_Features_Decompiler_src_decompile_cpp_Makefile =================================================================== --- head/devel/ghidra/files/patch-Ghidra_Features_Decompiler_src_decompile_cpp_Makefile (revision 518004) +++ head/devel/ghidra/files/patch-Ghidra_Features_Decompiler_src_decompile_cpp_Makefile (revision 518005) @@ -1,13 +1,13 @@ ---- Ghidra/Features/Decompiler/src/decompile/cpp/Makefile.orig 2019-04-03 17:38:23 UTC +--- Ghidra/Features/Decompiler/src/decompile/cpp/Makefile.orig 2019-11-04 12:40:52 UTC +++ Ghidra/Features/Decompiler/src/decompile/cpp/Makefile @@ -33,8 +33,8 @@ ifeq ($(OS),Darwin) OSDIR=osx64 endif -CC=gcc -CXX=g++ +CC?=cc +CXX?=c++ # Debug flags DBG_CXXFLAGS=-g -Wall -Wno-sign-compare Index: head/devel/ghidra/files/patch-Ghidra_Features_Decompiler_src_decompile_cpp_loadimage__bfd.hh =================================================================== --- head/devel/ghidra/files/patch-Ghidra_Features_Decompiler_src_decompile_cpp_loadimage__bfd.hh (revision 518004) +++ head/devel/ghidra/files/patch-Ghidra_Features_Decompiler_src_decompile_cpp_loadimage__bfd.hh (revision 518005) @@ -1,12 +1,12 @@ ---- Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_bfd.hh.orig 2019-04-03 17:38:23 UTC +--- Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_bfd.hh.orig 2019-11-04 12:39:57 UTC +++ Ghidra/Features/Decompiler/src/decompile/cpp/loadimage_bfd.hh @@ -21,6 +21,9 @@ #define __LOADIMAGE_BFD__ #include "loadimage.hh" + +#define PACKAGE +#define PACKAGE_VERSION #include struct ImportRecord { Index: head/devel/ghidra/files/patch-Ghidra_Features_Decompiler_src_decompile_cpp_types.h =================================================================== --- head/devel/ghidra/files/patch-Ghidra_Features_Decompiler_src_decompile_cpp_types.h (revision 518004) +++ head/devel/ghidra/files/patch-Ghidra_Features_Decompiler_src_decompile_cpp_types.h (revision 518005) @@ -1,39 +1,39 @@ ---- Ghidra/Features/Decompiler/src/decompile/cpp/types.h.orig 2019-04-03 17:38:23 UTC +--- Ghidra/Features/Decompiler/src/decompile/cpp/types.h.orig 2019-10-23 20:54:54 UTC +++ Ghidra/Features/Decompiler/src/decompile/cpp/types.h @@ -101,6 +101,36 @@ typedef char int1; typedef uint8 uintp; #endif +#if defined (__FreeBSD__) && defined (__i386__) +#define HOST_ENDIAN 0 +typedef unsigned long uintm; +typedef long intm; +typedef unsigned long long uint8; +typedef long long int8; +typedef unsigned int uint4; +typedef int int4; +typedef unsigned short uint2; +typedef short int2; +typedef unsigned char uint1; +typedef char int1; +typedef uint4 uintp; +#endif + +#if defined (__FreeBSD__) && defined (__x86_64__) +#define HOST_ENDIAN 0 +typedef unsigned int uintm; +typedef int intm; +typedef unsigned long uint8; +typedef long int8; +typedef unsigned int uint4; +typedef int int4; +typedef unsigned short uint2; +typedef short int2; +typedef unsigned char uint1; +typedef char int1; +typedef uint8 uintp; +#endif + #if defined(_WINDOWS) #if defined(_WIN64) Index: head/devel/ghidra/files/patch-Ghidra_Features_FunctionID_build.gradle =================================================================== --- head/devel/ghidra/files/patch-Ghidra_Features_FunctionID_build.gradle (revision 518004) +++ head/devel/ghidra/files/patch-Ghidra_Features_FunctionID_build.gradle (revision 518005) @@ -1,33 +1,33 @@ ---- Ghidra/Features/FunctionID/build.gradle.orig 2019-04-03 17:38:23 UTC +--- Ghidra/Features/FunctionID/build.gradle.orig 2019-10-23 20:54:54 UTC +++ Ghidra/Features/FunctionID/build.gradle -@@ -71,7 +71,7 @@ task buildFidDocumentationPdf(type: Exec) { +@@ -75,7 +75,7 @@ task buildFidDocumentationPdf(type: Exec) { cp $installPoint/topics/FunctionID/images/*.png $buildDir/images echo '** Building FunctionID.fo **' - xsltproc --output $buildDir/fid_withscaling.xml --stringparam profile.condition "withscaling" /usr/share/sgml/docbook/xsl-stylesheets/profiling/profile.xsl fid.xml 2>&1 + xsltproc --output $buildDir/fid_withscaling.xml --stringparam profile.condition "withscaling" /usr/local/share/xsl/docbook/profiling/profile.xsl fid.xml 2>&1 xsltproc --output $buildDir/FunctionID.fo fid_pdf.xsl $buildDir/fid_withscaling.xml 2>&1 echo '** Building FunctionID.pdf **' -@@ -94,9 +94,10 @@ task buildFidDocumentationPdf(type: Exec) { +@@ -98,9 +98,10 @@ task buildFidDocumentationPdf(type: Exec) { // Check the OS before executing command. doFirst { if ( !(org.gradle.internal.os.OperatingSystem.current().isLinux() - || org.gradle.internal.os.OperatingSystem.current().isMacOsX())) { + || org.gradle.internal.os.OperatingSystem.current().isMacOsX() + || org.gradle.internal.os.OperatingSystem.current().getName().contains("FreeBSD"))) { throw new TaskExecutionException( it, - new Exception( "The '$it.name' task only works on Linux or Mac Os X" )) + new Exception( "The '$it.name' task only works on Linux, FreeBSD or Mac Os X" )) } } -@@ -138,7 +139,7 @@ task buildFidDocumentationHtml(type: Exec) { +@@ -142,7 +143,7 @@ task buildFidDocumentationHtml(type: Exec) { rm -f $installPoint/topics/FunctionID/*.html echo '** Building html files **' - xsltproc --output $buildDir/fid_noscaling.xml --stringparam profile.condition "noscaling" /usr/share/sgml/docbook/xsl-stylesheets/profiling/profile.xsl fid.xml 2>&1 + xsltproc --output $buildDir/fid_noscaling.xml --stringparam profile.condition "noscaling" /usr/local/share/xsl/docbook/profiling/profile.xsl fid.xml 2>&1 xsltproc --stringparam base.dir ${installPoint}/topics/FunctionID/ fid_html.xsl $buildDir/fid_noscaling.xml 2>&1 sed -i -e '/Frontpage.css/ { p; s/Frontpage.css/languages.css/; }' ${installPoint}/topics/FunctionID/*.html Index: head/devel/ghidra/files/patch-Ghidra_Framework_Generic_src_main_java_ghidra_framework_Platform.java =================================================================== --- head/devel/ghidra/files/patch-Ghidra_Framework_Generic_src_main_java_ghidra_framework_Platform.java (revision 518004) +++ head/devel/ghidra/files/patch-Ghidra_Framework_Generic_src_main_java_ghidra_framework_Platform.java (revision 518005) @@ -1,36 +1,36 @@ ---- Ghidra/Framework/Generic/src/main/java/ghidra/framework/Platform.java.orig 2019-04-03 17:38:23 UTC +--- Ghidra/Framework/Generic/src/main/java/ghidra/framework/Platform.java.orig 2019-10-23 20:54:54 UTC +++ Ghidra/Framework/Generic/src/main/java/ghidra/framework/Platform.java @@ -70,7 +70,17 @@ public enum Platform { */ MAC_UNKNOWN(OperatingSystem.MAC_OS_X, Architecture.UNKNOWN, "osx64", ".dylib", ""), + /** + * Identifies a FreeBSD OS. + */ + FREEBSD_32(OperatingSystem.FREEBSD, Architecture.X86, "freebsd32", ".so", ""), + /** + * Identifies a FreeBSD OS. + */ + FREEBSD_64(OperatingSystem.FREEBSD, Architecture.X86_64, "freebsd64", ".so", ""), + + /** * Identifies an unsupported OS. */ UNSUPPORTED(OperatingSystem.UNSUPPORTED, Architecture.UNKNOWN, null, null, ""); @@ -144,6 +154,15 @@ public enum Platform { paths.add("/usr/lib"); paths.add("/usr/X11R6/bin"); paths.add("/usr/X11R6/lib"); + } + else if (operatingSystem == OperatingSystem.FREEBSD) { + paths.add("/bin"); + paths.add("/lib"); + paths.add("/usr/bin"); + paths.add("/usr/lib"); + paths.add("/usr/local/bin"); + paths.add("/usr/local/lib"); + paths.add("/usr/local/lib/compat"); } else if (CURRENT_PLATFORM == WIN_64) { String windir = System.getenv("SystemRoot"); Index: head/devel/ghidra/files/patch-Ghidra_Framework_Utility_src_main_java_ghidra_framework_OperatingSystem.java =================================================================== --- head/devel/ghidra/files/patch-Ghidra_Framework_Utility_src_main_java_ghidra_framework_OperatingSystem.java (revision 518004) +++ head/devel/ghidra/files/patch-Ghidra_Framework_Utility_src_main_java_ghidra_framework_OperatingSystem.java (revision 518005) @@ -1,10 +1,10 @@ ---- Ghidra/Framework/Utility/src/main/java/ghidra/framework/OperatingSystem.java.orig 2019-04-03 17:38:23 UTC +--- Ghidra/Framework/Utility/src/main/java/ghidra/framework/OperatingSystem.java.orig 2019-10-23 20:54:54 UTC +++ Ghidra/Framework/Utility/src/main/java/ghidra/framework/OperatingSystem.java @@ -20,6 +20,7 @@ public enum OperatingSystem { WINDOWS("Windows"), LINUX("Linux"), MAC_OS_X("Mac OS X"), + FREEBSD("FreeBSD"), UNSUPPORTED("Unsupported Operating System"); /** Index: head/devel/ghidra/files/patch-Ghidra_RuntimeScripts_Linux_support_launch.sh =================================================================== --- head/devel/ghidra/files/patch-Ghidra_RuntimeScripts_Linux_support_launch.sh (revision 518004) +++ head/devel/ghidra/files/patch-Ghidra_RuntimeScripts_Linux_support_launch.sh (revision 518005) @@ -1,10 +1,10 @@ ---- Ghidra/RuntimeScripts/Linux/support/launch.sh.orig 2019-04-10 09:13:14 UTC +--- Ghidra/RuntimeScripts/Linux/support/launch.sh.orig 2019-11-05 09:27:57 UTC +++ Ghidra/RuntimeScripts/Linux/support/launch.sh @@ -88,6 +88,7 @@ else DEBUG_LOG4J="${INSTALL_DIR}/Ghidra/RuntimeScripts/Common/support/debug.log4j.xml" fi -+PATH="/usr/local/openjdk12/bin:/usr/local/openjdk11:"$PATH ++PATH="JAVA_HOME_PLACEHOLDER/bin:$PATH" # Make sure some kind of java is on the path. It's required to run the LaunchSupport program. if ! [ -x "$(command -v java)" ] ; then echo "Java runtime not found. Please refer to the Ghidra Installation Guide's Troubleshooting section." Index: head/devel/ghidra/files/patch-Ghidra_RuntimeScripts_build.gradle =================================================================== --- head/devel/ghidra/files/patch-Ghidra_RuntimeScripts_build.gradle (nonexistent) +++ head/devel/ghidra/files/patch-Ghidra_RuntimeScripts_build.gradle (revision 518005) @@ -0,0 +1,11 @@ +--- Ghidra/RuntimeScripts/build.gradle.orig 2019-11-05 09:19:07 UTC ++++ Ghidra/RuntimeScripts/build.gradle +@@ -17,7 +17,7 @@ rootProject.OS_NAMES.each { platform -> + rootProject.tasks.findAll {it.name == "assembleDistribution_$platform"}.each { t -> + def p = this.project + +- if (isLinux(platform) || isMac(platform)) { ++ if (isLinux(platform) || isMac(platform) || isFreeBSD(platform)) { + t.from ("${p.projectDir}/Linux/support") { + into "support" + } Property changes on: head/devel/ghidra/files/patch-Ghidra_RuntimeScripts_build.gradle ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/devel/ghidra/files/patch-README.txt =================================================================== --- head/devel/ghidra/files/patch-README.txt (nonexistent) +++ head/devel/ghidra/files/patch-README.txt (revision 518005) @@ -0,0 +1,6 @@ +--- README.txt.orig 2019-11-04 12:52:32 UTC ++++ README.txt +@@ -0,0 +1,3 @@ ++The "os/freebsd64" directory is intended to hold FreeBSD native binaries ++which this module is dependent upon. This directory may be eliminated for a specific ++module if native binaries are not provided for the corresponding platform. Property changes on: head/devel/ghidra/files/patch-README.txt ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/devel/ghidra/files/patch-build.gradle =================================================================== --- head/devel/ghidra/files/patch-build.gradle (revision 518004) +++ head/devel/ghidra/files/patch-build.gradle (revision 518005) @@ -1,75 +1,74 @@ ---- build.gradle.orig 2019-05-16 19:36:27 UTC +--- build.gradle.orig 2019-10-23 20:54:54 UTC +++ build.gradle -@@ -30,14 +30,31 @@ project.ext.BIN_REPO_PATH = BIN_REPO // TODO make path +@@ -42,22 +42,28 @@ project.ext.BIN_REPO_PATH = BIN_REPO // TODO make path /********************************************************************************* * Prevent forked Java processes from stealing focus + * Prevent writing to the actual home directory *********************************************************************************/ +ext.DUMMY_HOME = file("${projectDir}/../dummy.home").absolutePath allprojects { tasks.withType(JavaForkOptions) { jvmArgs '-Djava.awt.headless=true' } + tasks.withType(JavaExec) { + jvmArgs "-Duser.home=${DUMMY_HOME}" + } } /********************************************************************************* -+ * Set Gradle repositories -+ *********************************************************************************/ -+ext.FLATREPO = file("${projectDir}/../flatrepo").absolutePath -+allprojects { -+ repositories { -+ mavenCentral() -+ jcenter() -+ flatDir name:'flat', dirs:["${FLATREPO}"] -+ } -+} -+ -+/********************************************************************************* - * load properties from Ghidra/application.properties file + * Use flat directory-style repository if flatRepo directory is present. *********************************************************************************/ - -@@ -58,7 +75,7 @@ apply from: "gradleScripts/setupJacoco.gradle" // Has +-if (file("flatRepo").isDirectory()) { ++ext.FLATREPO = file("${projectDir}/../flatrepo").absolutePath ++if (file("${FLATREPO}").isDirectory()) { + allprojects { + repositories { + mavenCentral() + jcenter() +- flatDir name: "flat", dirs:["$rootProject.projectDir/flatRepo"] ++ flatDir name: "flat", dirs:["${FLATREPO}"] + } + } + } +@@ -77,7 +83,7 @@ else { * project.OS_NAMES.each {...} ****************************************************************************/ -project.ext.set("OS_NAMES", ["osx64", "win32", "win64", "linux64"]) +project.ext.set("OS_NAMES", ["osx64", "win32", "win64", "linux64", "freebsd64"]) - /********************************************************************************* - * Imports -@@ -134,6 +151,19 @@ def isWindows(String platformName) { - } + /**************************************************************************** + * Establish Visual Studio configuration environment for Windows native builds +@@ -137,6 +143,19 @@ def isWindows(String platformName) { + return platformName.startsWith("win") } +/********************************************************************************* + * Returns true if the platform is a FreeBSD machine. + *********************************************************************************/ +def isFreeBSD(String platformName) { + + if (platformName.startsWith("freebsd")) { + return true + } + else { + return false + } +} + /****************************************************************************************** * Helper method that returns a file that is the same relative location in the bin repo * as the given project is in its repo. -@@ -278,6 +308,11 @@ String getCurrentPlatformName() { - else if (osName.startsWith("Mac OS X")) { - if (isX86_64) { +@@ -283,6 +302,11 @@ String getCurrentPlatformName() { return 'osx64' -+ } -+ } + } + } + else if (osName.startsWith("FreeBSD")) { + if (isX86_64) { + return 'freebsd64' - } - } ++ } ++ } throw new GradleException("Unrecognized current platform -> osName = $osName, archName = $archName") + } + Index: head/devel/ghidra/files/patch-gradle_root_distribution.gradle =================================================================== --- head/devel/ghidra/files/patch-gradle_root_distribution.gradle (nonexistent) +++ head/devel/ghidra/files/patch-gradle_root_distribution.gradle (revision 518005) @@ -0,0 +1,10 @@ +--- gradle/root/distribution.gradle.orig 2019-11-04 13:01:27 UTC ++++ gradle/root/distribution.gradle +@@ -382,6 +382,7 @@ task createInstallationZip(type: Zip) { t -> + dependsOn ":assembleDistribution_win64" + dependsOn ":assembleDistribution_linux64" + dependsOn ":assembleDistribution_osx64" ++ dependsOn ":assembleDistribution_freebsd64" + dependsOn ":assembleSource" + } + Property changes on: head/devel/ghidra/files/patch-gradle_root_distribution.gradle ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/devel/ghidra/files/patch-gradle_support_ip.gradle =================================================================== --- head/devel/ghidra/files/patch-gradle_support_ip.gradle (nonexistent) +++ head/devel/ghidra/files/patch-gradle_support_ip.gradle (revision 518005) @@ -0,0 +1,11 @@ +--- gradle/support/ip.gradle.orig 2019-11-04 12:56:00 UTC ++++ gradle/support/ip.gradle +@@ -119,6 +119,8 @@ def Map> getIpForModule(Project p + exclude "**/data/build.xml" // language build file (generated for dev only) + exclude "**/.vs/**" + exclude "**/*.vcxproj.user" ++ exclude "**/*.orig" ++ exclude "**/*.bak" + } + tree.each { file -> + String ip = getIp(p.projectDir, file) Property changes on: head/devel/ghidra/files/patch-gradle_support_ip.gradle ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property