Files
nixpkgs/pkgs/by-name/_0/_010editor/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

122 lines
3.0 KiB
Nix

{
lib,
stdenv,
fetchzip,
fetchurl,
autoPatchelfHook,
makeWrapper,
makeDesktopItem,
cups,
qt6,
undmg,
xorg,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "010editor";
version = "16.0.1";
src = finalAttrs.passthru.srcs.${stdenv.hostPlatform.system};
sourceRoot = ".";
strictDeps = true;
dontBuild = true;
dontConfigure = true;
nativeBuildInputs =
lib.optionals stdenv.hostPlatform.isLinux [
autoPatchelfHook
makeWrapper
qt6.wrapQtAppsHook
]
++ lib.optionals stdenv.hostPlatform.isDarwin [ undmg ];
buildInputs = lib.optionals stdenv.hostPlatform.isLinux [
cups
qt6.qtbase
qt6.qtwayland
xorg.xkeyboardconfig
];
installPhase =
let
darwinInstall = ''
mkdir -p $out/Applications
cp -R *.app $out/Applications
'';
linuxInstall = ''
mkdir -p $out/opt && cp -ar source/* $out/opt
# Wrap binary: clean env, fix XKB lookup
makeWrapper $out/opt/010editor $out/bin/010editor \
--unset QT_PLUGIN_PATH \
--set XKB_CONFIG_ROOT ${xorg.xkeyboardconfig}/share/X11/xkb
# Install icon + desktop entry
install -D $out/opt/010_icon_128x128.png $out/share/icons/hicolor/128x128/apps/010.png
install -D $desktopItem/share/applications/* -t $out/share/applications/
'';
in
''
runHook preInstall
${
if stdenv.hostPlatform.isDarwin then
darwinInstall
else if stdenv.hostPlatform.isLinux then
linuxInstall
else
"echo 'Unsupported Platform' && exit 1"
}
runHook postInstall
'';
desktopItem = makeDesktopItem {
name = "010editor";
exec = "010editor %f";
icon = "010";
desktopName = "010 Editor";
genericName = "Text and hex editor";
categories = [ "Development" ];
mimeTypes = [
"text/html"
"text/plain"
"text/x-c++hdr"
"text/x-c++src"
"text/xml"
];
};
passthru.srcs = {
x86_64-linux = fetchzip {
url = "https://download.sweetscape.com/010EditorLinux64Installer${finalAttrs.version}.tar.gz";
hash = "sha256-fPQCVA9VrpNBTA7PiOsHwIiaZLKKoK817PtWNX8uHBQ=";
};
x86_64-darwin = fetchurl {
url = "https://download.sweetscape.com/010EditorMac64Installer${finalAttrs.version}.dmg";
hash = "sha256-q/lfe4IWYJbxoGVBQju+t/w13UI3XHaVNPdTjnIQFw8=";
};
aarch64-darwin = fetchurl {
url = "https://download.sweetscape.com/010EditorMacARM64Installer${finalAttrs.version}.dmg";
hash = "sha256-kBrYSxTNz01pPaRfKZWE6dDoACgs5tlfb+M6A7R0Vo4=";
};
};
meta = {
description = "Text and hex editor";
homepage = "https://www.sweetscape.com/010editor/";
license = lib.licenses.unfree;
maintainers = with lib.maintainers; [ eljamm ];
platforms = [
"aarch64-darwin"
"x86_64-darwin"
"x86_64-linux"
];
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
mainProgram = "010editor";
};
})