QDirStat MacOS Dev - shundhammer/qdirstat GitHub Wiki

Developing QDirStat on MacOS X

This is the collecting place for porting QDirStat to the MacOS X platform. Please feel free to add entries and comments - this is a tool to foster a community effort.

See also https://github.com/shundhammer/qdirstat/issues/141

2024-02-14: Binaries and Build Instructions by Jesus Herrera

Hacker Log - 2020/07/22 - Greg Fenton

NOTE: I am relatively new to Qt and have just returned to MacOS after a several years hiatus.

MacOS version: MacOS Catalina 10.15.5

The main instructions on the QDirStat README indicated that I need Qt and then it is a simple matter of qmake ; make.

So I went to Qt's open source page, deluged with the information re: OSS vs. commercial, I decided to download the Qt Online Installer (button at the bottom of that Qt page).

  • I'd be delighted if there is a simpler/better way to install Qt for MacOS. My concern with this approach is that the download is HUGE (many GBs). I wasn't sure what all I needed to have to run QDirStat, so I deselected a ton of stuff that brought the install down to about 1.2GB.
    • My other concern is that I seem to be required to sign up for a Qt account in order to get the installation. Can this be avoided without massive overhead? (i.e. someone have a documented way to get Qt installed (maybe build from source?) in a relatively straightforward way?)
    • Is there a way to determine what Qt parts have been installed after installation? Would be good to denote what we currently have installed, and see about getting down to a bare-bones installation.
    • Currently I see:
      $ cd ~/qt
      $ du -skh *
      453M	5.15.0
      457M	Docs
      175M	Examples
      1.8M	InstallationLog.txt
      148K	Licenses
       26M	MaintenanceTool.app
      352K	MaintenanceTool.dat
       12K	MaintenanceTool.ini
      518M	Qt Creator.app
      4.0K	Tools
       20K	components.xml
      4.0K	dist
      6.5M	installerResources
      4.0K	network.xml```
      
      _Holy cow_ is that a lot of disk space need to run a utility mainly used to free up disk space!
      

Once installed, I edited my ~/.zshrc with the following: bash export QT_HOME=$HOME/qt/ export QT_5_15_BIN=$QT_HOME/5.15.0/clang_64/bin export PATH=$PATH:$QT_5_15_BIN

Now update the shell's path (start a new shell, or run source ~/.zshrc). I successfully built the app using the instructions from the QDirStat README for MacOS:

  1. mkdir ~/work
  2. cd ~/work
  3. git clone https://github.com/shundhammer/qdirstat.git
  4. cd qdirstat
  5. qmake
  6. make Now there is a directory called qdirstat.app. That is your app!
  7. cd qdirstat.app
  8. open qdirstat.app (alternatively you could use Finder, I assume?)

I now have a running QDirStat!! While the app is running, I keep being prompted to allow it access to various folders (Documents, Downloads, Desktop). You can see the folders you gave permission to via: System Preferences >> Security & Privacy >> Files and Folders >> qdirstat.app

  • I notice that it is called qdirstat.app in this dialog, where other apps have "proper names" such as qBittorent (no ".app"), Backup and Sync from Google, and Terminal. Others seem to keep the .app moniker: iTerm.app, GIMP-2.10.app and others. IS THIS SOMETHING WE COULD RESOLVE (certainly not a screaming high priority)

Running the app, I selected the folder / for it to scan. The results came back with nearly twice the size of my hard drive. It seems that /System/Volumes/Data also points to /, and qdirstat saw shows '/' as 600GB and /System/Volumes/Data as 300GB ... my drive is 300GB.

ISSUES TO BETTER UNDERSTAND OR FIX

  1. Ease of installation of Qt for MacOS/QDirStat users
    • a less heavy installation, in terms of disk usage
    • forced(?) to create an account on qt.io
  2. Make qdirstat.app be more "native" to MacOS in terms of integration with UI (System Preferences >> Security & Privacy)
    • is there a "nice" app name configuration we can set (low priority)
    • is there something we can do to avoid multiple permissions dialogs?
  3. Document "best practices" in terms of:
    1. configuring the development/build environment
    2. how to "properly" install the app binary to a new Mac machine (could/should we build an installer?)
      • should this be done as a separate GitHub project just for the Mac? Or could it be in a separate folder within the existing GH project so as not to "pollute" the codebase for other platforms?
  4. How to deal with /System/Volume/Data vs. / ? Is this a change to the base code, or is there some POSIX-y way we could detect this situation (e.g. is this simply traversing a symlink it shouldn't be or something?)

Table of contents generated with markdown-toc

⚠️ **GitHub.com Fallback** ⚠️