updated nix flake and package wrap

This commit is contained in:
Sebastian Wendel 2023-10-15 15:26:37 +02:00
parent 4e0acca4cc
commit 7a205c4120
2 changed files with 42 additions and 9 deletions

View file

@ -63,12 +63,5 @@
amlite = self.pkgs.${system}.callPackage ./pkgs/amlite inputs;
default = self.packages.${system}.amlite;
};
apps = {
amlite = {
type = "app";
program = "${self.packages.${system}.amlite}/bin/AmLite";
};
};
});
}

View file

@ -2,6 +2,17 @@
fetchurl,
lib,
stdenv,
autoPatchelfHook,
glib,
glibcLocales,
libxcb,
freetype,
libGL,
libXrender,
libX11,
fontconfig,
qt5,
makeDesktopItem,
...
}:
stdenv.mkDerivation rec {
@ -13,15 +24,32 @@ stdenv.mkDerivation rec {
sha256 = "sha256-GyA3ogtpsNA/pTIa21ha9P1YtNE0reRDTAI7VOcdxnY=";
};
nativeBuildInputs = [
autoPatchelfHook
glib
glibcLocales
libxcb
freetype
libGL
libXrender
libX11
fontconfig
qt5.wrapQtAppsHook
];
# FIX: "unpacker appears to have produced no directories"
sourceRoot = ".";
postUnpack = ''
sed -n -e '1,/^exit 0$/!p' $sourceRoot/AmScopeAmLite.x64.sh > $sourceRoot/AmLite.tgz
cd $sourceRoot/
cd $sourceRoot
sed -n -e '1,/^exit 0$/!p' AmScopeAmLite.x64.sh > AmLite.tgz
tar -xzf AmLite.tgz
'';
preFixup = ''
makeWrapperArgs+=("''${qtWrapperArgs[@]}")
'';
installPhase = ''
runHook preInstall
@ -37,6 +65,18 @@ stdenv.mkDerivation rec {
runHook postInstall
'';
desktopItems = [
(makeDesktopItem {
name = pname;
exec = "AmLite";
icon = "AmLite";
desktopName = meta.description;
genericName = meta.description;
comment = meta.description;
categories = ["Graphics" "Science" "Education"];
})
];
meta = with lib; {
description = "AmScope AmLite";
homepage = "https://amscope.com/";