nixpkgs/pkgs/by-name/ip/ipscan/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

69 lines
1.7 KiB
Nix
Raw Normal View History

2022-12-31 12:10:26 +00:00
{
lib,
stdenv,
fetchurl,
jdk,
jre,
swt,
makeWrapper,
xorg,
dpkg,
angryipscanner: Fix to patch swt error Without patch it gives the following error: This is similar to the fix for dbeaver in #335633 SWT OS.java Error: Failed to load swt-pi3, loading swt-pi4 as fallback. java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: no swt-pi4-gtk-4956r13 in java.library.path: /nix/store/xfw3cclmcbwq94l46n1qlkq1sdg2mss8-ipscan-3.9.1/lib/:/nix/store/kdnmlrnhb1nz2p79braw5s4g1marf0jg-swt-4.5/lib:/nix/store/qqqh9hpg76q3mgaphgvkly54gkq0k3sy-libXtst-1.2.4/lib:/etc/sane-libs:/nix/store/lf74q3c06wr7c0mcb4zcl9n27hqvq2wv-gpaste-45.1/lib:/usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib no swt-pi4-gtk in java.library.path: /nix/store/xfw3cclmcbwq94l46n1qlkq1sdg2mss8-ipscan-3.9.1/lib/:/nix/store/kdnmlrnhb1nz2p79braw5s4g1marf0jg-swt-4.5/lib:/nix/store/qqqh9hpg76q3mgaphgvkly54gkq0k3sy-libXtst-1.2.4/lib:/etc/sane-libs:/nix/store/lf74q3c06wr7c0mcb4zcl9n27hqvq2wv-gpaste-45.1/lib:/usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib no swt-pi4 in java.library.path: /nix/store/xfw3cclmcbwq94l46n1qlkq1sdg2mss8-ipscan-3.9.1/lib/:/nix/store/kdnmlrnhb1nz2p79braw5s4g1marf0jg-swt-4.5/lib:/nix/store/qqqh9hpg76q3mgaphgvkly54gkq0k3sy-libXtst-1.2.4/lib:/etc/sane-libs:/nix/store/lf74q3c06wr7c0mcb4zcl9n27hqvq2wv-gpaste-45.1/lib:/usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib Can't load library: /home/maciej/.swt/lib/linux/x86_64/libswt-pi4-gtk-4956r13.so Can't load library: /home/maciej/.swt/lib/linux/x86_64/libswt-pi4-gtk.so Can't load library: /home/maciej/.swt/lib/linux/x86_64/libswt-pi4.so at org.eclipse.swt.internal.Library.loadLibrary(Library.java:346) at org.eclipse.swt.internal.Library.loadLibrary(Library.java:255) at org.eclipse.swt.internal.gtk.OS.<clinit>(OS.java:97) at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:209) at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:155) at org.eclipse.swt.widgets.Display.<clinit>(Display.java:169) at net.azib.ipscan.gui.GUI.<init>(GUI.java:29) at net.azib.ipscan.Main.main(Main.java:50)
2024-08-29 17:37:07 +00:00
gtk3,
glib,
2022-12-31 12:10:26 +00:00
}:
stdenv.mkDerivation rec {
pname = "ipscan";
2023-08-30 14:09:38 +00:00
version = "3.9.1";
src = fetchurl {
2023-08-30 14:03:17 +00:00
url = "https://github.com/angryip/ipscan/releases/download/${version}/ipscan_${version}_amd64.deb";
2023-08-30 14:09:38 +00:00
hash = "sha256-UPkUwZV3NIeVfL3yYvqOhm4X5xW+40GOlZGy8WGhYmk=";
};
2024-11-26 20:00:18 +00:00
nativeBuildInputs = [
dpkg
makeWrapper
];
2022-12-31 12:10:26 +00:00
buildInputs = [ jdk ];
installPhase = ''
mkdir -p $out/share
2023-08-30 14:03:17 +00:00
cp usr/lib/ipscan/ipscan-linux64-${version}.jar $out/share/${pname}-${version}.jar
makeWrapper ${jre}/bin/java $out/bin/ipscan \
angryipscanner: Fix to patch swt error Without patch it gives the following error: This is similar to the fix for dbeaver in #335633 SWT OS.java Error: Failed to load swt-pi3, loading swt-pi4 as fallback. java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: no swt-pi4-gtk-4956r13 in java.library.path: /nix/store/xfw3cclmcbwq94l46n1qlkq1sdg2mss8-ipscan-3.9.1/lib/:/nix/store/kdnmlrnhb1nz2p79braw5s4g1marf0jg-swt-4.5/lib:/nix/store/qqqh9hpg76q3mgaphgvkly54gkq0k3sy-libXtst-1.2.4/lib:/etc/sane-libs:/nix/store/lf74q3c06wr7c0mcb4zcl9n27hqvq2wv-gpaste-45.1/lib:/usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib no swt-pi4-gtk in java.library.path: /nix/store/xfw3cclmcbwq94l46n1qlkq1sdg2mss8-ipscan-3.9.1/lib/:/nix/store/kdnmlrnhb1nz2p79braw5s4g1marf0jg-swt-4.5/lib:/nix/store/qqqh9hpg76q3mgaphgvkly54gkq0k3sy-libXtst-1.2.4/lib:/etc/sane-libs:/nix/store/lf74q3c06wr7c0mcb4zcl9n27hqvq2wv-gpaste-45.1/lib:/usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib no swt-pi4 in java.library.path: /nix/store/xfw3cclmcbwq94l46n1qlkq1sdg2mss8-ipscan-3.9.1/lib/:/nix/store/kdnmlrnhb1nz2p79braw5s4g1marf0jg-swt-4.5/lib:/nix/store/qqqh9hpg76q3mgaphgvkly54gkq0k3sy-libXtst-1.2.4/lib:/etc/sane-libs:/nix/store/lf74q3c06wr7c0mcb4zcl9n27hqvq2wv-gpaste-45.1/lib:/usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib Can't load library: /home/maciej/.swt/lib/linux/x86_64/libswt-pi4-gtk-4956r13.so Can't load library: /home/maciej/.swt/lib/linux/x86_64/libswt-pi4-gtk.so Can't load library: /home/maciej/.swt/lib/linux/x86_64/libswt-pi4.so at org.eclipse.swt.internal.Library.loadLibrary(Library.java:346) at org.eclipse.swt.internal.Library.loadLibrary(Library.java:255) at org.eclipse.swt.internal.gtk.OS.<clinit>(OS.java:97) at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:209) at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:155) at org.eclipse.swt.widgets.Display.<clinit>(Display.java:169) at net.azib.ipscan.gui.GUI.<init>(GUI.java:29) at net.azib.ipscan.Main.main(Main.java:50)
2024-08-29 17:37:07 +00:00
--prefix LD_LIBRARY_PATH : "$out/lib/:${
lib.makeLibraryPath [
swt
xorg.libXtst
gtk3
glib
]
}" \
--add-flags "-Xmx256m -cp $out/share/${pname}-${version}.jar:${swt}/jars/swt.jar net.azib.ipscan.Main"
mkdir -p $out/share/applications
cp usr/share/applications/ipscan.desktop $out/share/applications/ipscan.desktop
substituteInPlace $out/share/applications/ipscan.desktop --replace "/usr/bin" "$out/bin"
mkdir -p $out/share/pixmaps
cp usr/share/pixmaps/ipscan.png $out/share/pixmaps/ipscan.png
'';
meta = with lib; {
description = "Angry IP Scanner - fast and friendly network scanner";
mainProgram = "ipscan";
2020-03-18 07:20:53 +00:00
homepage = "https://angryip.org";
downloadPage = "https://github.com/angryip/ipscan/releases/tag/${version}";
2022-12-31 12:10:26 +00:00
changelog = "https://github.com/angryip/ipscan/blob/${version}/CHANGELOG";
sourceProvenance = with sourceTypes; [ binaryBytecode ];
2022-12-31 12:10:26 +00:00
license = licenses.gpl2Only;
platforms = [ "x86_64-linux" ];
maintainers = with maintainers; [
kylesferrazza
totoroot
];
};
}