2024-05-15 15:35:15 +00:00
|
|
|
{ lib, stdenv, autoPatchelfHook, makeDesktopItem, copyDesktopItems, wrapGAppsHook3, fetchurl
|
2021-12-06 16:07:01 +00:00
|
|
|
, alsa-lib, at-spi2-atk, at-spi2-core, atk, cairo, cups
|
2024-07-27 06:49:29 +00:00
|
|
|
, gtk3, nss, glib, nspr, gdk-pixbuf, libdrm, mesa
|
2021-12-06 16:07:01 +00:00
|
|
|
, libX11, libXScrnSaver, libXcomposite, libXcursor, libXdamage, libXext
|
2023-10-09 19:29:22 +00:00
|
|
|
, libXfixes, libXi, libXrandr, libXrender, libXtst, libxcb, libxshmfence, pango
|
2021-12-06 16:07:01 +00:00
|
|
|
, gcc-unwrapped, udev
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "snapmaker-luban";
|
2024-02-29 20:09:43 +00:00
|
|
|
version = "4.10.2";
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/Snapmaker/Luban/releases/download/v${version}/snapmaker-luban-${version}-linux-x64.tar.gz";
|
2024-02-29 20:09:43 +00:00
|
|
|
sha256 = "sha256-unxI0L8pcF6iWWa57GpYv/aYsApKAKfRaes3uXE7izM=";
|
2021-12-06 16:07:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
autoPatchelfHook
|
2024-05-15 15:35:15 +00:00
|
|
|
wrapGAppsHook3
|
2021-12-06 16:07:01 +00:00
|
|
|
copyDesktopItems
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
alsa-lib
|
|
|
|
at-spi2-atk
|
|
|
|
at-spi2-core
|
|
|
|
cairo
|
|
|
|
cups
|
|
|
|
gcc-unwrapped
|
|
|
|
gtk3
|
2022-09-22 12:36:57 +00:00
|
|
|
libdrm
|
2021-12-06 16:07:01 +00:00
|
|
|
libXdamage
|
|
|
|
libX11
|
|
|
|
libXScrnSaver
|
|
|
|
libXtst
|
|
|
|
libxcb
|
2023-10-09 19:29:22 +00:00
|
|
|
libxshmfence
|
2022-09-22 12:36:57 +00:00
|
|
|
mesa # Required for libgbm
|
2021-12-06 16:07:01 +00:00
|
|
|
nspr
|
|
|
|
nss
|
|
|
|
];
|
|
|
|
|
|
|
|
libPath = lib.makeLibraryPath [
|
|
|
|
stdenv.cc.cc alsa-lib atk at-spi2-atk at-spi2-core cairo cups
|
2023-10-09 19:29:22 +00:00
|
|
|
gdk-pixbuf glib gtk3 libX11 libXcomposite libxshmfence
|
2021-12-06 16:07:01 +00:00
|
|
|
libXcursor libXdamage libXext libXfixes libXi libXrandr libXrender
|
|
|
|
libXtst nspr nss libxcb pango libXScrnSaver udev
|
|
|
|
];
|
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
autoPatchelfIgnoreMissingDeps = [
|
|
|
|
"libc.musl-x86_64.so.1"
|
|
|
|
];
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
dontWrapGApps = true;
|
2023-04-12 12:48:02 +00:00
|
|
|
dontConfigure = true;
|
|
|
|
dontBuild = true;
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $out/{bin,opt,share/pixmaps}/
|
|
|
|
mv * $out/opt/
|
|
|
|
|
|
|
|
patchelf --set-interpreter ${stdenv.cc.bintools.dynamicLinker} \
|
|
|
|
$out/opt/snapmaker-luban
|
|
|
|
|
|
|
|
wrapProgram $out/opt/snapmaker-luban \
|
|
|
|
"''${gappsWrapperArgs[@]}" \
|
|
|
|
--prefix XDG_DATA_DIRS : "${gtk3}/share/gsettings-schemas/${gtk3.name}/" \
|
|
|
|
--prefix LD_LIBRARY_PATH : ${libPath}:$out/snapmaker-luban
|
|
|
|
|
|
|
|
ln -s $out/opt/snapmaker-luban $out/bin/snapmaker-luban
|
|
|
|
ln -s $out/opt/resources/app/app/resources/images/snap-luban-logo-64x64.png $out/share/pixmaps/snapmaker-luban.png
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
desktopItems = [
|
|
|
|
(makeDesktopItem {
|
|
|
|
name = pname;
|
|
|
|
exec = "snapmaker-luban";
|
|
|
|
icon = "snapmaker-luban";
|
|
|
|
desktopName = "Snapmaker Luban";
|
|
|
|
genericName = meta.description;
|
2022-03-05 16:20:37 +00:00
|
|
|
categories = [ "Office" "Printing" ];
|
2021-12-06 16:07:01 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Snapmaker Luban is an easy-to-use 3-in-1 software tailor-made for Snapmaker machines";
|
|
|
|
homepage = "https://github.com/Snapmaker/Luban";
|
2022-06-26 10:26:21 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
2021-12-06 16:07:01 +00:00
|
|
|
license = licenses.gpl3;
|
|
|
|
maintainers = [ maintainers.simonkampe ];
|
|
|
|
platforms = [ "x86_64-linux" ];
|
2023-10-09 19:29:22 +00:00
|
|
|
knownVulnerabilities = [ "CVE-2023-5217" ];
|
2021-12-06 16:07:01 +00:00
|
|
|
};
|
|
|
|
}
|