path-of-building: add desktop item
This commit is contained in:
parent
f3e3fe79ae
commit
30436ac0d7
@ -1,6 +1,21 @@
|
||||
{ stdenv, lib, fetchFromGitHub, unzip, meson, ninja, pkg-config, qtbase, qttools, wrapQtAppsHook, luajit }:
|
||||
{
|
||||
stdenv,
|
||||
lib,
|
||||
fetchFromGitHub,
|
||||
unzip,
|
||||
meson,
|
||||
ninja,
|
||||
pkg-config,
|
||||
qtbase,
|
||||
qttools,
|
||||
wrapQtAppsHook,
|
||||
icoutils,
|
||||
copyDesktopItems,
|
||||
makeDesktopItem,
|
||||
luajit,
|
||||
}:
|
||||
let
|
||||
data = stdenv.mkDerivation(finalAttrs: {
|
||||
data = stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "path-of-building-data";
|
||||
version = "2.42.0";
|
||||
|
||||
@ -42,12 +57,35 @@ stdenv.mkDerivation {
|
||||
hash = "sha256-zhw2PZ6ZNMgZ2hG+a6AcYBkeg7kbBHNc2eSt4if17Wk=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ meson ninja pkg-config qttools wrapQtAppsHook ];
|
||||
buildInputs = [ qtbase luajit luajit.pkgs.lua-curl ];
|
||||
nativeBuildInputs = [
|
||||
meson
|
||||
ninja
|
||||
pkg-config
|
||||
qttools
|
||||
wrapQtAppsHook
|
||||
icoutils
|
||||
] ++ lib.optional stdenv.isLinux copyDesktopItems;
|
||||
|
||||
buildInputs = [
|
||||
qtbase
|
||||
luajit
|
||||
luajit.pkgs.lua-curl
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
install -Dm555 pobfrontend $out/bin/pobfrontend
|
||||
|
||||
wrestool -x -t 14 ${data.src}/runtime/Path{space}of{space}Building.exe -o pathofbuilding.ico
|
||||
icotool -x pathofbuilding.ico
|
||||
|
||||
for size in 16 32 48 256; do
|
||||
mkdir -p $out/share/icons/hicolor/"$size"x"$size"/apps
|
||||
install -Dm 644 pathofbuilding*"$size"x"$size"*.png \
|
||||
$out/share/icons/hicolor/"$size"x"$size"/apps/pathofbuilding.png
|
||||
done
|
||||
rm pathofbuilding.ico
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
@ -59,6 +97,27 @@ stdenv.mkDerivation {
|
||||
)
|
||||
'';
|
||||
|
||||
desktopItems = [
|
||||
(makeDesktopItem {
|
||||
name = "path-of-building";
|
||||
desktopName = "Path of Building";
|
||||
comment = "Offline build planner for Path of Exile";
|
||||
exec = "pobfrontend %U";
|
||||
terminal = false;
|
||||
type = "Application";
|
||||
icon = "pathofbuilding";
|
||||
categories = [ "Game" ];
|
||||
keywords = [
|
||||
"poe"
|
||||
"pob"
|
||||
"pobc"
|
||||
"path"
|
||||
"exile"
|
||||
];
|
||||
mimeTypes = [ "x-scheme-handler/pob" ];
|
||||
})
|
||||
];
|
||||
|
||||
passthru.data = data;
|
||||
|
||||
meta = {
|
||||
@ -67,6 +126,6 @@ stdenv.mkDerivation {
|
||||
license = lib.licenses.mit;
|
||||
maintainers = [ lib.maintainers.k900 ];
|
||||
mainProgram = "pobfrontend";
|
||||
broken = stdenv.isDarwin; # doesn't find uic6 for some reason
|
||||
broken = stdenv.isDarwin; # doesn't find uic6 for some reason
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user