structorizer: init at 3.32-11

Co-authored-by: laalsaas <43275254+laalsaas@users.noreply.github.com>

+191
+104
pkgs/applications/graphics/structorizer/default.nix
··· 1 + { stdenv 2 + , lib 3 + , fetchFromGitHub 4 + , jdk11 5 + , makeDesktopItem 6 + , makeWrapper 7 + , copyDesktopItems 8 + }: 9 + 10 + stdenv.mkDerivation rec { 11 + pname = "structorizer"; 12 + version = "3.32-11"; 13 + 14 + desktopItems = [ 15 + (makeDesktopItem { 16 + type = "Application"; 17 + name = "Structorizer"; 18 + desktopName = "Structorizer"; 19 + genericName = "Diagram creator"; 20 + comment = meta.description; 21 + icon = pname; 22 + exec = pname; 23 + terminal = false; 24 + mimeTypes = [ "application/nsd" ]; 25 + categories = [ 26 + "Development" 27 + "Graphics" 28 + "VectorGraphics" 29 + "RasterGraphics" 30 + "ComputerScience" 31 + ]; 32 + keywords = [ "nsd" "diagrams" ]; 33 + }) 34 + ]; 35 + 36 + src = fetchFromGitHub { 37 + owner = "fesch"; 38 + repo = "Structorizer.Desktop"; 39 + rev = version; 40 + hash = "sha256-rGyeOcGm6uBplgTjMIOy/xRekfHacwDy9kkMigmRSdk="; 41 + }; 42 + 43 + patches = [ ./makeStructorizer.patch ./makeBigJar.patch ]; 44 + 45 + strictDeps = true; 46 + 47 + nativeBuildInputs = [ jdk11 makeWrapper copyDesktopItems ]; 48 + 49 + buildInputs = [ jdk11 ]; 50 + 51 + postPatch = '' 52 + chmod +x makeStructorizer 53 + chmod +x makeBigJar 54 + 55 + patchShebangs --build makeStructorizer 56 + patchShebangs --build makeBigJar 57 + ''; 58 + 59 + buildPhase = '' 60 + runHook preBuild 61 + 62 + ./makeStructorizer 63 + ./makeBigJar 64 + 65 + runHook postBuild 66 + ''; 67 + 68 + installPhase = '' 69 + runHook preInstall 70 + 71 + install -d $out/bin $out/share/mime/packages 72 + 73 + install -D ${pname}.jar -t $out/share/java/ 74 + makeWrapper ${jdk11}/bin/java $out/bin/${pname} \ 75 + --add-flags "-jar $out/share/java/${pname}.jar" 76 + 77 + cat << EOF > $out/share/mime/packages/structorizer.xml 78 + <?xml version="1.0" encoding="UTF-8"?> 79 + <mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info"> 80 + <mime-type type="application/nsd"> 81 + <comment xml:lang="en">Nassi-Shneiderman diagram</comment> 82 + <comment xml:lang="de">Nassi-Shneiderman-Diagramm</comment> 83 + <glob pattern="*.nsd"/> 84 + </mime-type> 85 + </mime-info> 86 + EOF 87 + 88 + cd src/lu/fisch/${pname}/gui 89 + install -vD icons/000_${pname}.png $out/share/icons/hicolor/16x16/apps/${pname}.png 90 + for icon_width in 24 32 48 64 128 256; do 91 + install -vD icons_"$icon_width"/000_${pname}.png $out/share/icons/hicolor/"$icon_width"x"$icon_width"/apps/${pname}.png 92 + done 93 + 94 + runHook postInstall 95 + ''; 96 + 97 + meta = with lib; { 98 + description = "Create Nassi-Shneiderman diagrams (NSD)"; 99 + homepage = "https://structorizer.fisch.lu"; 100 + license = licenses.gpl3Plus; 101 + platforms = platforms.all; 102 + maintainers = with maintainers; [ annaaurora ]; 103 + }; 104 + }
+31
pkgs/applications/graphics/structorizer/makeBigJar.patch
··· 1 + Reason: Running the program in a headless environment fails. Besides, tests should be conducted in passthru.tests anyway. There is also no AppleStructorizerApplication.class, only the jar. 2 + 3 + diff --git a/makeBigJar b/makeBigJar 4 + index 25547020..c34d0d9c 100644 5 + --- a/makeBigJar 6 + +++ b/makeBigJar 7 + @@ -75,9 +75,8 @@ jars="bsh-2.1.0 \ 8 + freehep-xml-2.1.1 \ 9 + freehep" 10 + 11 + -# Apple specific stuff is only used if it exists and the compiled class is available 12 + -if test -f ../bin/lu/fisch/structorizer/application/AppleStructorizerApplication.class -a \ 13 + - -f AppleJavaExtensions.jar; then 14 + +# Apple specific stuff is only used if the jar is available 15 + +if test -f lib/AppleJavaExtensions.jar; then 16 + jars="$jars AppleJavaExtensions" 17 + fi 18 + 19 + @@ -114,12 +113,3 @@ echo "Done" 20 + # remove the jar-directory 21 + rm -R jar/ 22 + 23 + -if test -n "$start_compiled"; then 24 + - # execute the archive 25 + - echo; echo "Running Structorizer from all-in-one jar" 26 + - if test "$start_compiled" = "s"; then 27 + - java -jar structorizer.jar 28 + - else 29 + - java -jar structorizer.jar & 30 + - fi 31 + -fi # start block end
+54
pkgs/applications/graphics/structorizer/makeStructorizer.patch
··· 1 + Reason: There is no StructorizerApplet.java anywhere in the source, no .cgt files and running the program in a headless environment fails. Besides, tests should be conducted in passthru.tests anyway. There is also no AppleStructorizerApplication.java, only the jar. 2 + 3 + diff --git a/makeStructorizer b/makeStructorizer 4 + index 99a5e8d3..e954be13 100644 5 + --- a/makeStructorizer 6 + +++ b/makeStructorizer 7 + @@ -117,18 +117,6 @@ echo "Done" 8 + echo; echo "Compiling Structorizer..." 9 + javac $str_javac_opts -classpath "$str_classpath" Structorizer.java 10 + echo "Done" 11 + -echo; echo "Compiling Structorizer Applet..." 12 + -javac $str_javac_opts -classpath "$str_classpath" StructorizerApplet.java 13 + -echo "Done" 14 + - 15 + -# OS specific classes 16 + -if test -n "$do_apple"; then 17 + - echo; echo "Compiling Apple specific code..." 18 + - javac $str_javac_opts -classpath "$str_classpath" lu/fisch/structorizer/application/AppleStructorizerApplication.java 19 + - echo "Done" 20 + -else 21 + - echo; echo "Apple specific code skipped" 22 + -fi 23 + 24 + # copying some other files to binary tree 25 + echo; echo "Copying resources..." 26 + @@ -147,7 +135,6 @@ cp lu/fisch/structorizer/gui/*.txt ../bin/lu/fisch/structorizer/gui/ 27 + cp lu/fisch/structorizer/gui/*.xml ../bin/lu/fisch/structorizer/gui/ 28 + cp lu/fisch/structorizer/locales/*.txt ../bin/lu/fisch/structorizer/locales/ 29 + cp lu/fisch/structorizer/generators/*.txt ../bin/lu/fisch/structorizer/generators/ 30 + -cp lu/fisch/structorizer/parsers/*.cgt ../bin/lu/fisch/structorizer/parsers/ 31 + cp lu/fisch/structorizer/parsers/*.egt ../bin/lu/fisch/structorizer/parsers/ 32 + cp lu/fisch/structorizer/parsers/*.grm ../bin/lu/fisch/structorizer/parsers/ 33 + cp lu/fisch/structorizer/parsers/*.xsd ../bin/lu/fisch/structorizer/parsers/ 34 + @@ -155,20 +142,5 @@ cp lu/fisch/structorizer/parsers/*.nsd ../bin/lu/fisch/structorizer/parsers/ 35 + cp lu/fisch/structorizer/*.properties ../bin/lu/fisch/structorizer/ 36 + echo "Done" 37 + 38 + -if test -n "$start_compiled"; then 39 + - 40 + - # changing into binary directory 41 + - cd ../bin/ 42 + - 43 + - # run the application 44 + - echo; echo "Running Structorizer from compiled class files" 45 + - if test "$start_compiled" = "s"; then 46 + - java -cp $str_classpath Structorizer 47 + - else 48 + - java -cp $str_classpath Structorizer & 49 + - fi 50 + - 51 + -fi # start block end 52 + - 53 + # move back into the folder where we started 54 + popd >/dev/null
+2
pkgs/top-level/all-packages.nix
··· 12144 12144 12145 12145 strip-nondeterminism = perlPackages.strip-nondeterminism; 12146 12146 12147 + structorizer = callPackage ../applications/graphics/structorizer { }; 12148 + 12147 12149 structure-synth = callPackage ../tools/graphics/structure-synth { }; 12148 12150 12149 12151 su-exec = callPackage ../tools/security/su-exec {};