File fix-packaging.patch of Package audiveris

Index: packaging/build.gradle
===================================================================
--- packaging/build.gradle.orig
+++ packaging/build.gradle
@@ -32,10 +32,10 @@ plugins {
     id 'base'
 
     // Plugin which provides the jpackage task
-    id 'org.panteleyev.jpackageplugin' version '1.7.3'
+    // id 'org.panteleyev.jpackageplugin' version '1.7.3'
 }
 
-import org.panteleyev.jpackage.ImageType
+// import org.panteleyev.jpackage.ImageType
 import java.nio.file.Paths
 
 def pkg = project(':packaging')
@@ -175,122 +175,3 @@ tasks.register('macConvertIcons', Exec)
             "--output", "build/Audiveris.icns",\
             "build/macos.iconset"
 }
-
-// Configure the jpackage task
-tasks.jpackage {
-    dependsOn 'customJre'
-    dependsOn 'collectJars'
-
-    input               = layout.buildDirectory.dir("jars")
-    destination         = layout.buildDirectory.dir("dist")
-
-    verbose             = true
-
-    runtimeImage        = layout.buildDirectory.dir("custom-jre")
-
-    appName             = app.ext.programName
-    vendor              = "audiveris.org"
-    licenseFile         = file(rootDir.toPath().resolve('LICENSE'))
-    appDescription      = "Optical Music Recognition"
-    appVersion          = app.version
-    mainJar             = "${app.ext.programId}.jar"
-    mainClass           = app.ext.mainClass
-
-    fileAssociations    = files(layout.projectDirectory.file("dev/omr.properties"))
-
-    // REMINDER: Check consistency with "applicationDefaultJvmArgs" in file app/build.gradle
-    javaOptions         = ["--add-exports=java.desktop/sun.awt.image=ALL-UNNAMED",
-                           "--enable-native-access=ALL-UNNAMED",
-                           "-Dfile.encoding=UTF-8",
-                           "-Xms512m",
-                           "-Xmx8G"]
-
-    // Chosen installer type, if any
-    ImageType installerType = null
-    if (project.hasProperty('installerType')) {
-        try {
-            installerType = ImageType.valueOf(project.property('installerType').toString().toUpperCase())
-            println "installerType: " + installerType
-        } catch (IllegalArgumentException ex) {
-            println "Illegal installerType: " + project.property('installerType')
-            throw new RuntimeException("Error: installerType should be one of " + ImageType.values())
-        }
-    }
-
-    windows {
-        icon = file("$appDir/res/icon-256.ico")   // Path to the icon of the application package
-        winDirChooser = true                // Let the user choose the installation directory
-        winMenu = true                      // Add a Start Menu shortcut
-        winShortcutPrompt = true            // Let the user decide on shortcuts
-        winShortcut = true                  // Create a desktop shortcut
-        ///winPerUserInstall = true            // Perform an install on a per-user basis (vs system basis)
-
-        // Create a console launcher? (Useful only for errors)
-        pkg.ext.option = project(':').findProperty('option')?:''
-        println "Windows option: ${pkg.ext.option}"
-        winConsole = (pkg.ext.option == "Console")
-
-        // Check validity of installerType for Windows
-        if (installerType != null) {
-            if (installerType != ImageType.DEFAULT && installerType != ImageType.EXE && installerType != ImageType.MSI) {
-                throw new RuntimeException("Error: Illegal installerType for Windows: " + installerType)
-            }
-            type = installerType
-        } else {
-            type = ImageType.MSI
-        }
-    }
-
-    mac {
-        dependsOn 'macConvertIcons'
-        icon = layout.buildDirectory.file("Audiveris.icns")
-
-        macPackageIdentifier = "org.audiveris.app"
-        macPackageName = app.ext.programName
-
-        // Check validity of installerType for macOS
-        if (installerType != null) {
-            if (installerType != ImageType.DEFAULT && installerType != ImageType.DMG && installerType != ImageType.PKG) {
-                throw new RuntimeException("Error: Illegal installerType for macOS: " + installerType)
-            }
-            type = installerType
-        }
-    }
-
-    linux {
-        dependsOn 'linuxGetName'
-        dependsOn 'linuxGetVersion'
-        icon = file("$appDir/res/icon-256.png")   // Path to the icon of the application package
-        linuxShortcut = true                // Create a shortcut for the application
-
-        // Check validity of installerType for Linux
-        if (installerType != null) {
-            if (installerType != ImageType.DEFAULT && installerType != ImageType.DEB && installerType != ImageType.RPM) {
-                throw new RuntimeException("Error: Illegal installerType for Linux: " + installerType)
-            }
-            type = installerType
-        }
-    }
-
-    doLast {
-        // Rename artifact as: program name + version + host name + option? + architecture + .ext
-        def dest = destination.get().asFile
-        
-        fileTree(destination).each { file ->
-            println "oldFile: ${file}"
-
-            // Retrieve suffix
-            def oldName = "${file.name}"
-            def dot = oldName.lastIndexOf('.');
-            def suffix = oldName.substring(dot)
-
-            // Forge artifact new file
-            def newName = "${app.ext.programName}-${app.version}-${pkg.ext.osname}${pkg.ext.option}-${app.ext.hostOSArch}$suffix"
-            def newFile = Paths.get("$dest", newName).toFile()
-            println "newFile: ${newFile}"
-
-            def result = file.renameTo(newFile)
-            println "Success: $result"
-        }
-    }
-}
openSUSE Build Service is sponsored by