depot/third_party/nixpkgs/pkgs/applications/editors/tiled/default.nix
Default email a66bca1520 Project import generated by Copybara.
GitOrigin-RevId: 40f79f003b6377bd2f4ed4027dde1f8f922995dd
2022-12-17 11:02:37 +01:00

74 lines
1.4 KiB
Nix

{ lib
, stdenv
, env
, fetchFromGitHub
, pkg-config
, qbs
, wrapQtAppsHook
, qtbase
, qtdeclarative
, qttools
, qtsvg
, zlib
, libGL
}:
let
qtEnv = env "tiled-qt-env" [ qtbase qtdeclarative qtsvg qttools ];
in
stdenv.mkDerivation rec {
pname = "tiled";
version = "1.9.2";
src = fetchFromGitHub {
owner = "bjorn";
repo = pname;
rev = "v${version}";
sha256 = "sha256-026OO7r8n1BUapUtKRHvqKdSZiClTQIiYfajiC2TAcQ=";
};
nativeBuildInputs = [ pkg-config qbs wrapQtAppsHook ];
buildInputs = [ qtEnv zlib libGL ];
outputs = [ "out" "dev" ];
strictDeps = true;
configurePhase = ''
runHook preConfigure
qbs setup-qt --settings-dir . ${qtEnv}/bin/qmake qtenv
qbs config --settings-dir . defaultProfile qtenv
qbs resolve --settings-dir . config:release qbs.installPrefix:/ projects.Tiled.installHeaders:true
runHook postConfigure
'';
buildPhase = ''
runHook preBuild
qbs build --settings-dir . config:release
runHook postBuild
'';
installPhase = ''
runHook preInstall
qbs install --settings-dir . --install-root $out config:release
runHook postInstall
'';
meta = with lib; {
description = "Free, easy to use and flexible tile map editor";
homepage = "https://www.mapeditor.org/";
license = with licenses; [
bsd2 # libtiled and tmxviewer
gpl2Plus # all the rest
];
maintainers = with maintainers; [ dywedir ];
platforms = platforms.linux;
};
}