diff --git a/desktop/package/linux/Haveno.AppDir/.DirIcon b/desktop/package/linux/Haveno.AppDir/.DirIcon new file mode 100644 index 00000000..681ac6ac Binary files /dev/null and b/desktop/package/linux/Haveno.AppDir/.DirIcon differ diff --git a/desktop/package/linux/Haveno.AppDir/Haveno.desktop b/desktop/package/linux/Haveno.AppDir/Haveno.desktop new file mode 100644 index 00000000..e1a90507 --- /dev/null +++ b/desktop/package/linux/Haveno.AppDir/Haveno.desktop @@ -0,0 +1,15 @@ +# If you want Haveno to appear in a Linux app launcher ("start menu"), install this by doing: +# sudo desktop-file-install electrum-ltc.desktop + +[Desktop Entry] +Comment=A decentralized monero exchange network. +Exec=sh -c "PATH=\"\\$HOME/.local/bin:\\$PATH\"; bin/Haveno %u" +GenericName[en_US]=Monero Exchange +GenericName=Monero Exchange +Icon=haveno +Categories=Office;Finance;Java; +Name[en_US]=Haveno +Name=Haveno +Terminal=false +Type=Application +MimeType= diff --git a/desktop/package/linux/Haveno.AppDir/haveno.svg b/desktop/package/linux/Haveno.AppDir/haveno.svg new file mode 100644 index 00000000..6c94a5b6 --- /dev/null +++ b/desktop/package/linux/Haveno.AppDir/haveno.svg @@ -0,0 +1 @@ +haveno_logo_icon \ No newline at end of file diff --git a/desktop/package/package.gradle b/desktop/package/package.gradle index fd1fc81f..0b6029f4 100644 --- a/desktop/package/package.gradle +++ b/desktop/package/package.gradle @@ -113,6 +113,8 @@ task getJavaBinariesDownloadURLs { } } + ext.osKey = osKey + ext.jdk21Binary_DownloadURL = jdk21Binaries[osKey] ext.jdk21Binary_SHA256Hash = jdk21Binaries[osKey + '-sha256'] } @@ -321,6 +323,69 @@ task packageInstallers { " --linux-deb-maintainer noreply@haveno.exchange" + " --type deb") + // Clean jpackage temp folder, needs to be empty for the next packaging step (AppImage) + jpackageTempDir.deleteDir() + jpackageTempDir.mkdirs() + + executeCmd(jPackageFilePath + commonOpts + + " --dest \"${jpackageTempDir}\"" + + " --type app-image") + + // Path to the app-image directory: THIS IS NOT THE ACTUAL .AppImage FILE. + // See JPackage documentation on --type app-image for more. + String appImagePath = new String( + "\"${binariesFolderPath}/${appNameAndVendor}\"" + ) + + // Which version of AppImageTool to use + String AppImageToolVersion = "13"; + + // Download AppImageTool + Map AppImageToolBinaries = [ + 'linux' : "https://github.com/AppImage/AppImageKit/releases/download/${AppImageToolVersion}/appimagetool-x86_64.AppImage", + 'linux-aarch64' : "https://github.com/AppImage/AppImageKit/releases/download/${AppImageToolVersion}/appimagetool-aarch64.AppImage", + ] + + String osKey = getJavaBinariesDownloadURLs.property('osKey') + + File appDir = new File("${jpackageTempDir}/Haveno") + File templateAppDir = new File("${project(':desktop').projectDir}/package/linux/Haveno.AppDir") + File jpackDir = appDir + + appDir.mkdirs() + + File AppImageToolBinary = new File("${jpackageTempDir}/appimagetool.AppImage") + + // Adding a platform to the AppImageToolBinaries essentially adds it to the "supported" list of platforms able to make AppImages + // However, be warned that any platform that doesn't support unix `ln` and `chmod` will not work with the current method. + if (AppImageToolBinaries.containsKey(osKey)) { + println "Downloading ${AppImageToolBinaries[osKey]}" + ant.get(src: AppImageToolBinaries[osKey], dest: AppImageToolBinary) + println 'Download saved to ' + jpackageTempDir + + project.exec { + commandLine('chmod', '+x', AppImageToolBinary) + } + + copy { + from templateAppDir + into appDir + boolean includeEmptyDirs = true + } + + project.exec { + workingDir appDir + commandLine 'ln', '-s', 'bin/Haveno', 'AppRun' + } + + project.exec { + commandLine "${AppImageToolBinary}", appDir, "${binariesFolderPath}/Haveno.AppImage" + } + } else { + println "Your platform does not support AppImageTool ${AppImageToolVersion}" + } + + // Clean jpackage temp folder, needs to be empty for the next packaging step (rpm) jpackageTempDir.deleteDir() jpackageTempDir.mkdirs() @@ -345,6 +410,7 @@ task packageInstallers { from binariesFolderPath into envVariableSharedFolder } + executeCmd("open " + envVariableSharedFolder) } }