From 487300c6aa99dfb373df194013ceee8c7b3792e9 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Fri, 25 Jun 2021 10:41:59 +0300 Subject: [PATCH 1/4] imagej: reformat expression - Use 1 line per input argument. - Don't use let ... in if not needed. - Use ${version} in url string. - Run hooks in explicit installPhase. (cherry picked from commit e1d6051d81835079f0e37e1d5fc5f029f32df512) --- pkgs/applications/graphics/imagej/default.nix | 93 ++++++++++--------- 1 file changed, 48 insertions(+), 45 deletions(-) diff --git a/pkgs/applications/graphics/imagej/default.nix b/pkgs/applications/graphics/imagej/default.nix index 65d3c9735df..5050669c524 100644 --- a/pkgs/applications/graphics/imagej/default.nix +++ b/pkgs/applications/graphics/imagej/default.nix @@ -1,48 +1,51 @@ -{ lib, stdenv, fetchurl, jre, unzip, makeWrapper }: +{ lib +, stdenv +, fetchurl +, jre +, unzip +, makeWrapper +}: -# Note: -# - User config dir is hard coded by upstream to $HOME/.imagej on linux systems -# and to $HOME/Library/Preferences on macOS. -# (The current trend appears to be to use $HOME/.config/imagej -# on linux systems, but we here do not attempt to fix it.) +stdenv.mkDerivation { + pname = "imagej"; + version = "150"; -let - imagej150 = stdenv.mkDerivation { - pname = "imagej"; - version = "150"; - - src = fetchurl { - url = "https://wsr.imagej.net/distros/cross-platform/ij150.zip"; - sha256 = "97aba6fc5eb908f5160243aebcdc4965726693cb1353d9c0d71b8f5dd832cb7b"; - }; - nativeBuildInputs = [ makeWrapper unzip ]; - inherit jre; - - # JAR files that are intended to be used by other packages - # should go to $out/share/java. - # (Some uses ij.jar as a library not as a standalone program.) - installPhase = '' - mkdir -p $out/share/java - # Read permisssion suffices for the jar and others. - # Simple cp shall clear suid bits, if any. - cp ij.jar $out/share/java - cp -dR luts macros plugins $out/share - mkdir $out/bin - makeWrapper ${jre}/bin/java $out/bin/imagej \ - --add-flags "-jar $out/share/java/ij.jar -ijpath $out/share" - ''; - meta = with lib; { - homepage = "https://imagej.nih.gov/ij/"; - description = "Image processing and analysis in Java"; - longDescription = '' - ImageJ is a public domain Java image processing program - inspired by NIH Image for the Macintosh. - It runs on any computer with a Java 1.4 or later virtual machine. - ''; - license = licenses.publicDomain; - platforms = with platforms; linux ++ darwin; - maintainers = with maintainers; [ yuriaisaka ]; - }; + src = fetchurl { + url = "https://wsr.imagej.net/distros/cross-platform/ij${version}.zip"; + sha256 = "97aba6fc5eb908f5160243aebcdc4965726693cb1353d9c0d71b8f5dd832cb7b"; }; -in - imagej150 + nativeBuildInputs = [ makeWrapper unzip ]; + passthru = { + inherit jre; + }; + + # JAR files that are intended to be used by other packages + # should go to $out/share/java. + # (Some uses ij.jar as a library not as a standalone program.) + installPhase = '' + runHook preInstall + + mkdir -p $out/share/java $out/bin + # Read permisssion suffices for the jar and others. + # Simple cp shall clear suid bits, if any. + cp ij.jar $out/share/java + cp -dR luts macros plugins $out/share + makeWrapper ${jre}/bin/java $out/bin/imagej \ + --add-flags "-jar $out/share/java/ij.jar -ijpath $out/share" + + runHook postInstall + ''; + + meta = with lib; { + homepage = "https://imagej.nih.gov/ij/"; + description = "Image processing and analysis in Java"; + longDescription = '' + ImageJ is a public domain Java image processing program + inspired by NIH Image for the Macintosh. + It runs on any computer with a Java 1.4 or later virtual machine. + ''; + license = licenses.publicDomain; + platforms = platforms.unix; + maintainers = with maintainers; [ yuriaisaka ]; + }; +} From d16a1e9975e566e299ae9b561c41be1ecb858515 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Fri, 25 Jun 2021 10:44:59 +0300 Subject: [PATCH 2/4] imagej: Add desktop item and icon (cherry picked from commit 0750062126633db814ead9298902e845102ab1ba) --- pkgs/applications/graphics/imagej/default.nix | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/graphics/imagej/default.nix b/pkgs/applications/graphics/imagej/default.nix index 5050669c524..ac1ea9560ae 100644 --- a/pkgs/applications/graphics/imagej/default.nix +++ b/pkgs/applications/graphics/imagej/default.nix @@ -4,9 +4,16 @@ , jre , unzip , makeWrapper +, makeDesktopItem +, copyDesktopItems }: -stdenv.mkDerivation { +let + icon = fetchurl { + url = "https://imagej.net/media/icons/imagej.png"; + sha256 = "sha256-nU2nWI1wxZB/xlOKsZzdUjj+qiCTjO6GwEKYgZ5Risg="; + }; +in stdenv.mkDerivation rec { pname = "imagej"; version = "150"; @@ -14,7 +21,17 @@ stdenv.mkDerivation { url = "https://wsr.imagej.net/distros/cross-platform/ij${version}.zip"; sha256 = "97aba6fc5eb908f5160243aebcdc4965726693cb1353d9c0d71b8f5dd832cb7b"; }; - nativeBuildInputs = [ makeWrapper unzip ]; + nativeBuildInputs = [ copyDesktopItems makeWrapper unzip ]; + desktopItems = lib.optionals stdenv.isLinux [ + (makeDesktopItem { + name = "ImageJ"; + desktopName = "ImageJ"; + icon = "imagej"; + categories = "Science;Utility;Graphics;"; + exec = "imagej"; + }) + ]; + passthru = { inherit jre; }; @@ -36,6 +53,12 @@ stdenv.mkDerivation { runHook postInstall ''; + postFixup = lib.optionalString stdenv.isLinux '' + install -Dm644 ${icon} $out/share/icons/hicolor/128x128/apps/imagej.png + substituteInPlace $out/share/applications/ImageJ.desktop \ + --replace Exec=imagej Exec=$out/bin/imagej + ''; + meta = with lib; { homepage = "https://imagej.nih.gov/ij/"; description = "Image processing and analysis in Java"; From ce711cc113de9518b0201cbebd6b586835264a68 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Fri, 25 Jun 2021 10:57:17 +0300 Subject: [PATCH 3/4] imagej: 150 -> 153 (cherry picked from commit 796ae067c4b6348e900c1384ef3759dc90fef01c) --- pkgs/applications/graphics/imagej/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/graphics/imagej/default.nix b/pkgs/applications/graphics/imagej/default.nix index ac1ea9560ae..0dbc2d5d4e1 100644 --- a/pkgs/applications/graphics/imagej/default.nix +++ b/pkgs/applications/graphics/imagej/default.nix @@ -15,11 +15,11 @@ let }; in stdenv.mkDerivation rec { pname = "imagej"; - version = "150"; + version = "153"; src = fetchurl { url = "https://wsr.imagej.net/distros/cross-platform/ij${version}.zip"; - sha256 = "97aba6fc5eb908f5160243aebcdc4965726693cb1353d9c0d71b8f5dd832cb7b"; + sha256 = "sha256-MGuUdUDuW3s/yGC68rHr6xxzmYScUjdXRawDpc1UQqw="; }; nativeBuildInputs = [ copyDesktopItems makeWrapper unzip ]; desktopItems = lib.optionals stdenv.isLinux [ From d604d3ee9c22c6345580ec8e95bb79e8e38ac9e3 Mon Sep 17 00:00:00 2001 From: Michael Weiss Date: Sat, 25 Sep 2021 12:31:28 +0200 Subject: [PATCH 4/4] ungoogled-chromium: 94.0.4606.54 -> 94.0.4606.61 (cherry picked from commit d66e4eea8550cc10d2f579b4e821639d44deae01) --- .../networking/browsers/chromium/upstream-info.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/applications/networking/browsers/chromium/upstream-info.json b/pkgs/applications/networking/browsers/chromium/upstream-info.json index 0f0cc3437e9..c4c5d4f024b 100644 --- a/pkgs/applications/networking/browsers/chromium/upstream-info.json +++ b/pkgs/applications/networking/browsers/chromium/upstream-info.json @@ -44,9 +44,9 @@ } }, "ungoogled-chromium": { - "version": "94.0.4606.54", - "sha256": "0p8kfnyhykbv1cylsx4hj2qdzqr2xdql9rhpva8bfla2w9hr8g83", - "sha256bin64": "0lq34l00zrr92g882xzqwq1lf2vf12x1mwidrr2qh6fz7v5418d3", + "version": "94.0.4606.61", + "sha256": "1gxrxmd2almwf067zycilyxkmc0d62h99ln8wp3n3i02bi9xnik4", + "sha256bin64": "116xrf8hcprbdpdx6a4xysac2phyvw88vs3n1bs24ly6pxydsasz", "deps": { "gn": { "version": "2021-08-11", @@ -55,8 +55,8 @@ "sha256": "031znmkbm504iim5jvg3gmazj4qnkfc7zg8aymjsij18fhf7piz0" }, "ungoogled-patches": { - "rev": "94.0.4606.54-1", - "sha256": "0phy87fiqdgikgl60yap7n1mvyvsidgznqp06j86287iihml3z2m" + "rev": "94.0.4606.61-1", + "sha256": "1sb6n3dnp8d1bzhyl9d8yc0x9imyccnwxf1fqzv7vs3fd6dgcprp" } } }