lol

bytecode-viewer: init at 2.12

authored by

D3vil0p3r and committed by
D3vil0p3r
c1a4483d 3489e424

+154
+73
pkgs/by-name/by/bytecode-viewer/make-deterministic.patch
··· 1 + --- a/pom.xml 2024-01-08 09:44:10.495320111 +0100 2 + +++ b/pom.xml 2024-01-08 21:31:07.529336715 +0100 3 + @@ -394,6 +394,15 @@ 4 + </configuration> 5 + </plugin> 6 + <plugin> 7 + + <artifactId>maven-jar-plugin</artifactId> 8 + + <version>3.3.0</version> 9 + + <executions> 10 + + <execution> 11 + + <id>default-jar</id> 12 + + </execution> 13 + + </executions> 14 + + </plugin> 15 + + <plugin> 16 + <groupId>org.apache.maven.plugins</groupId> 17 + <artifactId>maven-javadoc-plugin</artifactId> 18 + <version>3.5.0</version> 19 + @@ -464,6 +473,55 @@ 20 + </transformers> 21 + </configuration> 22 + </plugin> 23 + + <plugin> 24 + + <groupId>org.apache.maven.plugins</groupId> 25 + + <artifactId>maven-enforcer-plugin</artifactId> 26 + + <version>3.3.0</version> 27 + + <executions> 28 + + <execution> 29 + + <id>require-all-plugin-version-to-be-set</id> 30 + + <phase>validate</phase> 31 + + <goals> 32 + + <goal>enforce</goal> 33 + + </goals> 34 + + <configuration> 35 + + <rules> 36 + + <requirePluginVersions /> 37 + + </rules> 38 + + </configuration> 39 + + </execution> 40 + + </executions> 41 + + </plugin> 42 + + <plugin> 43 + + <groupId>org.apache.maven.plugins</groupId> 44 + + <artifactId>maven-deploy-plugin</artifactId> 45 + + <version>3.1.1</version> 46 + + </plugin> 47 + + <plugin> 48 + + <groupId>org.apache.maven.plugins</groupId> 49 + + <artifactId>maven-resources-plugin</artifactId> 50 + + <version>3.3.1</version> 51 + + </plugin> 52 + + <plugin> 53 + + <groupId>org.apache.maven.plugins</groupId> 54 + + <artifactId>maven-site-plugin</artifactId> 55 + + <version>4.0.0-M9</version> 56 + + </plugin> 57 + + <plugin> 58 + + <groupId>org.apache.maven.plugins</groupId> 59 + + <artifactId>maven-install-plugin</artifactId> 60 + + <version>3.1.1</version> 61 + + </plugin> 62 + + <plugin> 63 + + <groupId>org.apache.maven.plugins</groupId> 64 + + <artifactId>maven-clean-plugin</artifactId> 65 + + <version>3.3.1</version> 66 + + </plugin> 67 + + <plugin> 68 + + <groupId>org.apache.maven.plugins</groupId> 69 + + <artifactId>maven-surefire-plugin</artifactId> 70 + + <version>3.1.2</version> 71 + + </plugin> 72 + </plugins> 73 + </build>
+81
pkgs/by-name/by/bytecode-viewer/package.nix
··· 1 + { lib 2 + , fetchFromGitHub 3 + , jre 4 + , makeWrapper 5 + , maven 6 + , icoutils 7 + , copyDesktopItems 8 + , makeDesktopItem 9 + }: 10 + 11 + maven.buildMavenPackage rec { 12 + pname = "bytecode-viewer"; 13 + version = "2.12"; 14 + 15 + src = fetchFromGitHub { 16 + owner = "Konloch"; 17 + repo = "bytecode-viewer"; 18 + rev = "v${version}"; 19 + hash = "sha256-opAUmkEcWPOrcxAL+I1rBQXwHmvzbu0+InTnsg9r+z8="; 20 + }; 21 + 22 + desktopItems = [ 23 + (makeDesktopItem { 24 + name = "bytecode-viewer"; 25 + desktopName = "Bytecode-Viewer"; 26 + exec = meta.mainProgram; 27 + icon = "bytecode-viewer"; 28 + comment = "A lightweight user-friendly Java/Android Bytecode Viewer, Decompiler & More."; 29 + categories = [ "Security" ]; 30 + startupNotify = false; 31 + }) 32 + ]; 33 + 34 + patches = [ 35 + # Make vendoring deterministic by pinning Maven plugin dependencies 36 + ./make-deterministic.patch 37 + ]; 38 + 39 + mvnHash = "sha256-iAxzFq8nR9UiH8y3ZWmGuChZEMwQBAkN8wD+t9q/RWY="; 40 + 41 + mvnParameters = "-Dproject.build.outputTimestamp=1980-01-01T00:00:02Z"; 42 + 43 + nativeBuildInputs = [ 44 + icoutils 45 + makeWrapper 46 + copyDesktopItems 47 + ]; 48 + 49 + installPhase = '' 50 + runHook preInstall 51 + 52 + install -Dm644 target/Bytecode-Viewer-${version}.jar $out/share/bytecode-viewer/bytecode-viewer.jar 53 + 54 + mv "BCV Icon.ico" bytecode-viewer.ico 55 + icotool -x bytecode-viewer.ico 56 + 57 + for size in 16 32 48 58 + do 59 + install -Dm644 bytecode-viewer_*_$size\x$size\x32.png $out/share/icons/hicolor/$size\x$size/apps/bytecode-viewer.png 60 + done 61 + 62 + mkdir $out/bin 63 + makeWrapper ${lib.getExe jre} $out/bin/${meta.mainProgram} \ 64 + --add-flags "-jar $out/share/bytecode-viewer/bytecode-viewer.jar" 65 + 66 + runHook postInstall 67 + ''; 68 + 69 + meta = with lib; { 70 + homepage = "https://bytecodeviewer.com"; 71 + description = "A lightweight user-friendly Java/Android Bytecode Viewer, Decompiler & More"; 72 + mainProgram = "bytecode-viewer"; 73 + maintainers = with maintainers; [ shard7 d3vil0p3r ]; 74 + platforms = platforms.unix; 75 + sourceProvenance = with sourceTypes; [ 76 + fromSource 77 + binaryBytecode # deps 78 + ]; 79 + license = with licenses; [ gpl3Only ]; 80 + }; 81 + }