nix-microscopy/pkgs/amlite/default.nix

87 lines
1.7 KiB
Nix
Raw Permalink Normal View History

2023-10-05 18:04:47 +02:00
{
fetchurl,
lib,
stdenv,
2023-10-15 15:26:37 +02:00
autoPatchelfHook,
glib,
glibcLocales,
libxcb,
freetype,
libGL,
libXrender,
libX11,
fontconfig,
qt5,
makeDesktopItem,
2023-10-05 18:04:47 +02:00
...
}:
stdenv.mkDerivation rec {
pname = "amlite";
version = "20232603";
src = fetchurl {
url = "https://storage.googleapis.com/software-download-d79bb.appspot.com/software/AmLite/Linux/${version}/AmScopeAmLite.x64.tar.bz2";
sha256 = "sha256-GyA3ogtpsNA/pTIa21ha9P1YtNE0reRDTAI7VOcdxnY=";
};
2023-10-15 15:26:37 +02:00
nativeBuildInputs = [
autoPatchelfHook
glib
glibcLocales
libxcb
freetype
libGL
libXrender
libX11
fontconfig
qt5.wrapQtAppsHook
];
2023-10-05 18:04:47 +02:00
# FIX: "unpacker appears to have produced no directories"
sourceRoot = ".";
postUnpack = ''
2023-10-15 15:26:37 +02:00
cd $sourceRoot
sed -n -e '1,/^exit 0$/!p' AmScopeAmLite.x64.sh > AmLite.tgz
2023-10-05 18:04:47 +02:00
tar -xzf AmLite.tgz
'';
2023-10-15 15:26:37 +02:00
preFixup = ''
makeWrapperArgs+=("''${qtWrapperArgs[@]}")
'';
2023-10-05 18:04:47 +02:00
installPhase = ''
runHook preInstall
mkdir -p $out/{lib,bin,share} \
$out/lib/udev/rules.d
cp AmLite $out/bin
cp *.so $out/lib
cp 99-amcam.rules $out/lib/udev/rules.d
cp -r i18n $out/share/
runHook postInstall
'';
2023-10-15 15:26:37 +02:00
desktopItems = [
(makeDesktopItem {
name = pname;
exec = "AmLite";
icon = "AmLite";
desktopName = meta.description;
genericName = meta.description;
comment = meta.description;
categories = ["Graphics" "Science" "Education"];
})
];
2023-10-05 18:04:47 +02:00
meta = with lib; {
description = "AmScope AmLite";
homepage = "https://amscope.com/";
license = licenses.unfree;
platforms = ["x86_64-linux"];
};
}