diff --git a/pkgs/applications/office/mmex/default.nix b/pkgs/applications/office/mmex/default.nix index 14b97a0b7adb..53d4dc4261ef 100644 --- a/pkgs/applications/office/mmex/default.nix +++ b/pkgs/applications/office/mmex/default.nix @@ -1,33 +1,73 @@ -{ lib, stdenv, fetchFromGitHub, sqlite, wxGTK30, gettext, wrapGAppsHook }: +{ lib +, stdenv +, fetchFromGitHub +, cmake +, gettext +, git +, makeWrapper +, lsb-release +, pkg-config +, wrapGAppsHook +, curl +, sqlite +, wxGTK +, gtk3 +, libobjc +}: stdenv.mkDerivation rec { pname = "money-manager-ex"; - version = "1.3.3"; + version = "1.6.0"; src = fetchFromGitHub { owner = "moneymanagerex"; repo = "moneymanagerex"; - rev = "refs/tags/v${version}"; - sha256 = "sha256-5NgkP9gY4eDBoKSC/IaXiHoiz+ZdU4c/iGAzPf5IlmQ="; + rev = "v${version}"; + fetchSubmodules = true; + sha256 = "sha256-ADhTz6OMntgDg3TcAlf3lGBFb+fdZ0Lw7+UYYY1RD8M="; }; + postPatch = lib.optionalString (stdenv.isDarwin && stdenv.isx86_64) '' + substituteInPlace src/platfdep_mac.mm \ + --replace "appearance.name == NSAppearanceNameDarkAqua" "NO" + ''; + nativeBuildInputs = [ + cmake + gettext + git + makeWrapper + pkg-config wrapGAppsHook + ] ++ lib.optionals stdenv.isLinux [ + lsb-release ]; buildInputs = [ - gettext + curl sqlite - wxGTK30 - wxGTK30.gtk + wxGTK + gtk3 + ] ++ lib.optionals stdenv.isDarwin [ + libobjc ]; + NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.cc.isClang [ + "-Wno-old-style-cast" + ]); + + postInstall = lib.optionalString stdenv.isDarwin '' + mkdir -p $out/{Applications,bin} + mv $out/mmex.app $out/Applications + makeWrapper $out/{Applications/mmex.app/Contents/MacOS,bin}/mmex + ''; + meta = { description = "Easy-to-use personal finance software"; homepage = "https://www.moneymanagerex.org/"; license = lib.licenses.gpl2Plus; - maintainers = with lib.maintainers; [viric]; - platforms = with lib.platforms; linux; - broken = true; # at 2022-11-23 + maintainers = with lib.maintainers; [ viric ]; + platforms = with lib.platforms; unix; + mainProgram = "mmex"; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c3c9c67492fd..f75ac073ef86 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -30154,9 +30154,9 @@ with pkgs; MMA = callPackage ../applications/audio/MMA { }; mmex = callPackage ../applications/office/mmex { - wxGTK30 = wxGTK30.override { + inherit (darwin) libobjc; + wxGTK = wxGTK32.override { withWebKit = true; - withGtk2 = false; }; };