92 lines
2.0 KiB
Nix
92 lines
2.0 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
fetchurl,
|
|
dpkg,
|
|
autoPatchelfHook,
|
|
nss,
|
|
nspr,
|
|
alsa-lib,
|
|
openssl,
|
|
webkitgtk_4_1,
|
|
udev,
|
|
libayatana-appindicator,
|
|
libGL,
|
|
}:
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
pname = "mihomo-party";
|
|
version = "1.8.4";
|
|
|
|
src =
|
|
let
|
|
selectSystem =
|
|
attrs:
|
|
attrs.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
|
|
arch = selectSystem {
|
|
x86_64-linux = "amd64";
|
|
aarch64-linux = "arm64";
|
|
};
|
|
in
|
|
fetchurl {
|
|
url = "https://github.com/mihomo-party-org/mihomo-party/releases/download/v${finalAttrs.version}/mihomo-party-linux-${finalAttrs.version}-${arch}.deb";
|
|
hash = selectSystem {
|
|
x86_64-linux = "sha256-bbKW4kz1v+yF0ZsH9Ew+c780LCdyJUi8tIiHV09An8s=";
|
|
aarch64-linux = "sha256-72NAoFCt+Uwbt1blwHNM7FePUX0D6AZoqW3XF0NkT28=";
|
|
};
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
dpkg
|
|
autoPatchelfHook
|
|
];
|
|
|
|
buildInputs = [
|
|
nss
|
|
nspr
|
|
alsa-lib
|
|
openssl
|
|
webkitgtk_4_1
|
|
(lib.getLib stdenv.cc.cc)
|
|
];
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
|
|
mkdir -p $out/bin
|
|
cp -r opt $out/opt
|
|
cp -r usr/share $out/share
|
|
substituteInPlace $out/share/applications/mihomo-party.desktop \
|
|
--replace-fail "/opt/mihomo-party/mihomo-party" "mihomo-party"
|
|
ln -s $out/opt/mihomo-party/mihomo-party $out/bin/mihomo-party
|
|
|
|
runHook postInstall
|
|
'';
|
|
|
|
preFixup = ''
|
|
patchelf --add-needed libGL.so.1 \
|
|
--add-rpath ${
|
|
lib.makeLibraryPath [
|
|
libGL
|
|
udev
|
|
libayatana-appindicator
|
|
]
|
|
} $out/opt/mihomo-party/mihomo-party
|
|
'';
|
|
|
|
passthru.updateScript = ./update.sh;
|
|
|
|
meta = {
|
|
description = "Another Mihomo GUI";
|
|
homepage = "https://github.com/mihomo-party-org/mihomo-party";
|
|
mainProgram = "mihomo-party";
|
|
platforms = [
|
|
"aarch64-linux"
|
|
"x86_64-linux"
|
|
];
|
|
license = lib.licenses.gpl3Plus;
|
|
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
|
|
maintainers = with lib.maintainers; [ ];
|
|
};
|
|
})
|