about summary refs log tree commit diff
path: root/nixpkgs/pkgs/by-name/by
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/by-name/by')
-rw-r--r--nixpkgs/pkgs/by-name/by/bytecode-viewer/make-deterministic.patch73
-rw-r--r--nixpkgs/pkgs/by-name/by/bytecode-viewer/package.nix81
2 files changed, 154 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/by-name/by/bytecode-viewer/make-deterministic.patch b/nixpkgs/pkgs/by-name/by/bytecode-viewer/make-deterministic.patch
new file mode 100644
index 000000000000..94107b589c36
--- /dev/null
+++ b/nixpkgs/pkgs/by-name/by/bytecode-viewer/make-deterministic.patch
@@ -0,0 +1,73 @@
+--- a/pom.xml	2024-01-08 09:44:10.495320111 +0100
++++ b/pom.xml	2024-01-08 21:31:07.529336715 +0100
+@@ -394,6 +394,15 @@
+                 </configuration>
+             </plugin>
+             <plugin>
++                <artifactId>maven-jar-plugin</artifactId>
++                <version>3.3.0</version>
++                <executions>
++                    <execution>
++                        <id>default-jar</id>
++                    </execution>
++                </executions>
++            </plugin>
++            <plugin>
+                 <groupId>org.apache.maven.plugins</groupId>
+                 <artifactId>maven-javadoc-plugin</artifactId>
+                 <version>3.5.0</version>
+@@ -464,6 +473,55 @@
+                     </transformers>
+                 </configuration>
+             </plugin>
++            <plugin>
++                <groupId>org.apache.maven.plugins</groupId>
++                <artifactId>maven-enforcer-plugin</artifactId>
++                <version>3.3.0</version>
++                <executions>
++                    <execution>
++                        <id>require-all-plugin-version-to-be-set</id>
++                        <phase>validate</phase>
++                        <goals>
++                            <goal>enforce</goal>
++                        </goals>
++                        <configuration>
++                            <rules>
++                                <requirePluginVersions />
++                            </rules>
++                        </configuration>
++                    </execution>
++                </executions>
++                </plugin>
++            <plugin>
++                <groupId>org.apache.maven.plugins</groupId>
++                <artifactId>maven-deploy-plugin</artifactId>
++                <version>3.1.1</version>
++            </plugin>
++            <plugin>
++                <groupId>org.apache.maven.plugins</groupId>
++                <artifactId>maven-resources-plugin</artifactId>
++                <version>3.3.1</version>
++            </plugin>
++            <plugin>
++                <groupId>org.apache.maven.plugins</groupId>
++                <artifactId>maven-site-plugin</artifactId>
++                <version>4.0.0-M9</version>
++            </plugin>
++            <plugin>
++                <groupId>org.apache.maven.plugins</groupId>
++                <artifactId>maven-install-plugin</artifactId>
++                <version>3.1.1</version>
++            </plugin>
++            <plugin>
++                <groupId>org.apache.maven.plugins</groupId>
++                <artifactId>maven-clean-plugin</artifactId>
++                <version>3.3.1</version>
++            </plugin>
++            <plugin>
++                <groupId>org.apache.maven.plugins</groupId>
++                <artifactId>maven-surefire-plugin</artifactId>
++                <version>3.1.2</version>
++            </plugin>
+         </plugins>
+     </build>
diff --git a/nixpkgs/pkgs/by-name/by/bytecode-viewer/package.nix b/nixpkgs/pkgs/by-name/by/bytecode-viewer/package.nix
new file mode 100644
index 000000000000..1e2a7e568db9
--- /dev/null
+++ b/nixpkgs/pkgs/by-name/by/bytecode-viewer/package.nix
@@ -0,0 +1,81 @@
+{ lib
+, fetchFromGitHub
+, jre
+, makeWrapper
+, maven
+, icoutils
+, copyDesktopItems
+, makeDesktopItem
+}:
+
+maven.buildMavenPackage rec {
+  pname = "bytecode-viewer";
+  version = "2.12";
+
+  src = fetchFromGitHub {
+    owner = "Konloch";
+    repo = "bytecode-viewer";
+    rev = "v${version}";
+    hash = "sha256-opAUmkEcWPOrcxAL+I1rBQXwHmvzbu0+InTnsg9r+z8=";
+  };
+
+  desktopItems = [
+    (makeDesktopItem {
+      name = "bytecode-viewer";
+      desktopName = "Bytecode-Viewer";
+      exec = meta.mainProgram;
+      icon = "bytecode-viewer";
+      comment = "A lightweight user-friendly Java/Android Bytecode Viewer, Decompiler & More.";
+      categories = [ "Security" ];
+      startupNotify = false;
+    })
+  ];
+
+  patches = [
+    # Make vendoring deterministic by pinning Maven plugin dependencies
+    ./make-deterministic.patch
+  ];
+
+  mvnHash = "sha256-iAxzFq8nR9UiH8y3ZWmGuChZEMwQBAkN8wD+t9q/RWY=";
+
+  mvnParameters = "-Dproject.build.outputTimestamp=1980-01-01T00:00:02Z";
+
+  nativeBuildInputs = [
+    icoutils
+    makeWrapper
+    copyDesktopItems
+  ];
+
+  installPhase = ''
+    runHook preInstall
+
+    install -Dm644 target/Bytecode-Viewer-${version}.jar $out/share/bytecode-viewer/bytecode-viewer.jar
+
+    mv "BCV Icon.ico" bytecode-viewer.ico
+    icotool -x bytecode-viewer.ico
+
+    for size in 16 32 48
+    do
+      install -Dm644 bytecode-viewer_*_$size\x$size\x32.png $out/share/icons/hicolor/$size\x$size/apps/bytecode-viewer.png
+    done
+
+    mkdir $out/bin
+    makeWrapper ${lib.getExe jre} $out/bin/${meta.mainProgram} \
+      --add-flags "-jar $out/share/bytecode-viewer/bytecode-viewer.jar"
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    homepage = "https://bytecodeviewer.com";
+    description = "A lightweight user-friendly Java/Android Bytecode Viewer, Decompiler & More";
+    mainProgram = "bytecode-viewer";
+    maintainers = with maintainers; [ shard7 d3vil0p3r ];
+    platforms = platforms.unix;
+    sourceProvenance = with sourceTypes; [
+      fromSource
+      binaryBytecode  # deps
+    ];
+    license = with licenses; [ gpl3Only ];
+  };
+}