Bug 421686 - Skrooge Homebrew formula build error
Summary: Skrooge Homebrew formula build error
Status: RESOLVED NOT A BUG
Alias: None
Product: skrooge
Classification: Applications
Component: general (show other bugs)
Version: 2.20.0
Platform: Homebrew (macOS) macOS
: NOR normal
Target Milestone: 25.1.0
Assignee: Stephane MANKOWSKI
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-17 19:01 UTC by Bob
Modified: 2020-11-28 17:16 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bob 2020-05-17 19:01:03 UTC
SUMMARY
I am trying to create a Homebrew formula for Skrooge on Mac. The Macports version is out of date and Macports itself seems to be in decline. However the build currently fails.

STEPS TO REPRODUCE
1. Install homebrew on Mac.
2. Add the following local formula

desc "Skrooge is a personal finance manager powered by KDE that aims to be simple and intuitive. Skrooge allows you to keep track of your expenses and income, categorize them, and build reports of them."
  homepage "https://skrooge.org/"
  url "https://download.kde.org/stable/skrooge/skrooge-2.20.0.tar.xz"
  sha256 "3c58c54ad048b03608fde0b794de0cd3a83d0b5bd43c1d033c5dc8739f755365"
  head "git://anongit.kde.org/skrooge.git"

  depends_on "cmake" => :build
  depends_on "kf5-extra-cmake-modules" => :build
  depends_on "ninja" => :build

  depends_on "qt"
  depends_on "KDE-mac/kde/kf5-breeze-icons"
  depends_on "KDE-mac/kde/kf5-kdesignerplugin"
  depends_on "KDE-mac/kde/kf5-knewstuff"
  depends_on "KDE-mac/kde/kf5-knotifyconfig"  
  depends_on "sqlcipher"
  depends_on "pkg-config"
  depends_on "qca"  
  depends_on "grantlee"
  depends_on "libofx"

  depends_on "KDE-mac/kde/kf5-kross" => :optional

  def install
    args = std_cmake_args
    args << "-DBUILD_TESTING=OFF"
    args << "-DKDE_INSTALL_QMLDIR=lib/qt5/qml"
    args << "-DKDE_INSTALL_PLUGINDIR=lib/qt5/plugins"
    args << "-DCMAKE_INSTALL_BUNDLEDIR=#{bin}"
    args << "-DSKG_WEBENGINE=ON"

    mkdir "build" do
      system "cmake", "-G", "Ninja", "..", *args
      system "ninja"
      system "ninja", "install"
      prefix.install "install_manifest.txt"
    end
    # Extract Qt plugin path
    qtpp = `#{Formula["qt"].bin}/qtpaths --plugin-dir`.chomp
    system "/usr/libexec/PlistBuddy",
      "-c", "Add :LSEnvironment:QT_PLUGIN_PATH string \"#{qtpp}\:#{HOMEBREW_PREFIX}/lib/qt5/plugins\"",
      "#{bin}/skrooge.app/Contents/Info.plist"
  end

  def post_install
    system HOMEBREW_PREFIX/"bin/update-mime-database", HOMEBREW_PREFIX/"share/mime"
    mkdir_p HOMEBREW_PREFIX/"share/skrooge"
    ln_sf HOMEBREW_PREFIX/"share/icons/breeze/breeze-icons.rcc", HOMEBREW_PREFIX/"share/skrooge/icontheme.rcc"
  end

  def caveats
    <<~EOS
      You need to take some manual steps in order to make this formula work:
        "$(brew --repo kde-mac/kde)/tools/do-caveats.sh"
    EOS
  end

  test do
    assert `"#{bin}/skrooge.app/Contents/MacOS/skrooge" --help | grep -- --help` =~ /--help/
  end
end

3. Install the formula with 'brew install skrooge'

OBSERVED RESULT

==> Downloading https://download.kde.org/stable/skrooge/skrooge-2.20.0.tar.xz
Already downloaded: /Users/bob/Library/Caches/Homebrew/downloads/3326bdb6158519a6a569fd3ff6e43a4ae34309244126d4d91ebb3de6be4fb86e--skrooge-2.20.0.tar.xz
==> cmake -G Ninja .. -DBUILD_TESTING=OFF -DKDE_INSTALL_QMLDIR=lib/qt5/qml -DKDE_INSTALL_PLUGINDIR=lib/qt5/plugins -DCMAKE_INSTALL_BUNDLEDIR=/usr/local/Cellar/skrooge/2.20.0/bin 
==> ninja
Last 15 lines from /Users/bob/Library/Logs/Homebrew/skrooge/02.ninja:
class QMetaProperty;
      ^
../plugins/generic/skg_monthly/grantlee_filters/skgdocumentfilter.cpp:142:67: error: calling 'property' with incomplete return type 'QMetaProperty'
                table += QStringLiteral("<tr><td>") % metaObject->property(i).name() % "</td><td>" % val.toString() % "</td></tr>";
                                                      ~~~~~~~~~~~~^~~~~~~~~~~
/usr/local/opt/qt/include/QtCore/qobjectdefs.h:373:19: note: 'property' declared here
    QMetaProperty property(int index) const;
                  ^
/usr/local/opt/qt/include/QtCore/qobjectdefs.h:285:7: note: forward declaration of 'QMetaProperty'
class QMetaProperty;
      ^
2 errors generated.
[193/725] Automatic MOC for target skg_statistic
[194/725] Building CXX object plugins/generic/skg_monthly/grantlee_filters/CMakeFiles/grantlee_skgfilters.dir/skgobjectfilter.cpp.o
ninja: build stopped: subcommand failed.

EXPECTED RESULT

Skrooge built and installed.

SOFTWARE/OS VERSIONS
macOS: 10.15.1
KDE Plasma (homebrew-kde):
KDE Plasma Version: 5.70.0
KDE Frameworks Version: 5.70.0
Qt Version: 5.14.2
Comment 1 Stephane MANKOWSKI 2020-05-17 19:20:40 UTC
Hi,
Could you try with this ?
depends_on "cmake" => :build
depends_on "KDE-mac/kde/kf5-extra-cmake-modules" => :build
depends_on "KDE-mac/kde/kf5-kdoctools" => :build
depends_on "ninja" => :build

depends_on "KDE-mac/kde/kf5-breeze-icons"
depends_on "KDE-mac/kde/kf5-khtml"
depends_on "KDE-mac/kde/kf5-kparts"
depends_on "KDE-mac/kde/kf5-kdesignerplugin"
depends_on "KDE-mac/kde/kf5-knewstuff"
depends_on "KDE-mac/kde/kf5-knotifyconfig"
depends_on "KDE-mac/kde/kf5-kwallet"
depends_on "KDE-mac/kde/kf5-kdelibs4support"
depends_on "KDE-mac/kde/kf5-kdewebkit"
depends_on "KDE-mac/kde/kf5-knotifications"
depends_on "sqlcipher"
depends_on "pkg-config"
depends_on "qca"
depends_on "grantlee"
depends_on "libofx"

and remove
depends_on "qt"
Comment 2 Stephane MANKOWSKI 2020-07-06 09:52:29 UTC
Did you progress on this topic ?
Comment 3 Bob 2020-07-15 19:52:19 UTC
I'm afraid I didn't - please see my updates here:

https://www.reddit.com/r/kde/comments/gldjml/skrooge_formula_for_homebrew/

Currently I'm working around this by running Skrooge in a Docker image, with connection through a browser using XPRA.
Comment 4 Stephane MANKOWSKI 2020-11-28 17:16:23 UTC
I don't know Mac environment.
So, I can not help.
Sorry.