Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 24 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -160,27 +160,46 @@ dist/notarize:
package:
rm -rf dist
mkdir -p dist/activitywatch
# We use rsync to copy the files, preserving symlinks in a cross-platform way
# https://github.com/pyinstaller/pyinstaller/issues/8120#issuecomment-1825924706
for dir in $(PACKAGEABLES); do \
make --directory=$$dir package; \
cp -r $$dir/dist/$$dir dist/activitywatch; \
rsync -a $$dir/dist/$$dir dist/activitywatch; \
done
# Move aw-qt to the root of the dist folder
mv dist/activitywatch/aw-qt aw-qt-tmp
mv aw-qt-tmp/* dist/activitywatch
rmdir aw-qt-tmp
# Remove problem-causing binaries
rm -f dist/activitywatch/libdrm.so.2 # see: https://github.com/ActivityWatch/activitywatch/issues/161
rm -f dist/activitywatch/libharfbuzz.so.0 # see: https://github.com/ActivityWatch/activitywatch/issues/660#issuecomment-959889230
rm -f dist/activitywatch/_internal/libdrm.so.2 # see: https://github.com/ActivityWatch/activitywatch/issues/161
rm -f dist/activitywatch/_internal/libharfbuzz.so.0 # see: https://github.com/ActivityWatch/activitywatch/issues/660#issuecomment-959889230
# These should be provided by the distro itself
# Had to be removed due to otherwise causing the error:
# aw-qt: symbol lookup error: /opt/activitywatch/libQt5XcbQpa.so.5: undefined symbol: FT_Get_Font_Format
rm -f dist/activitywatch/libfontconfig.so.1
rm -f dist/activitywatch/libfreetype.so.6
rm -f dist/activitywatch/_internal/libfontconfig.so.1
rm -f dist/activitywatch/_internal/libfreetype.so.6
# Check
make package-check
# Remove unnecessary files
rm -rf dist/activitywatch/pytz
# Builds zips and setups
bash scripts/package/package-all.sh

BADLIBS := \
libdrm.so.2 \
libharfbuzz.so.0 \
libfontconfig.so.1 \
libfreetype.so.6

package-check:
# check that the libs are gone everywhere
@for lib in $(BADLIBS); do \
if [ -n "$$(find dist/activitywatch -name $$lib)" ]; then \
echo "Error: $$lib found in $$(find dist/activitywatch -name $$lib)" >&2; \
exit 1; \
fi \
done

clean:
rm -rf build dist

Expand Down
2 changes: 1 addition & 1 deletion aw-server
Submodule aw-server updated 1 files
+2 −0 Makefile
16 changes: 8 additions & 8 deletions aw.spec
Original file line number Diff line number Diff line change
Expand Up @@ -168,14 +168,14 @@ aw_notify_a = build_analysis(
# https://pythonhosted.org/PyInstaller/spec-files.html#multipackage-bundles
# MERGE takes a bit weird arguments, it wants tuples which consists of
# the analysis paired with the script name and the bin name
MERGE(
(aw_server_a, "aw-server", "aw-server"),
(aw_qt_a, "aw-qt", "aw-qt"),
(aw_watcher_afk_a, "aw-watcher-afk", "aw-watcher-afk"),
(aw_watcher_window_a, "aw-watcher-window", "aw-watcher-window"),
(aw_watcher_input_a, "aw-watcher-input", "aw-watcher-input"),
(aw_notify_a, "aw-notify", "aw-notify"),
)
# MERGE(
# (aw_server_a, "aw-server", "aw-server"),
# (aw_qt_a, "aw-qt", "aw-qt"),
# (aw_watcher_afk_a, "aw-watcher-afk", "aw-watcher-afk"),
# (aw_watcher_window_a, "aw-watcher-window", "aw-watcher-window"),
# (aw_watcher_input_a, "aw-watcher-input", "aw-watcher-input"),
# (aw_notify_a, "aw-notify", "aw-notify"),
# )


# aw-server
Expand Down
143 changes: 90 additions & 53 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ psutil = "*"
pywin32-ctypes = {version = "*", platform = "win32"}
pefile = {version = "*", platform = "win32"}

pyinstaller = "^5.13"
pyinstaller = "^6.1"
# releases are very infrequent, so good idea to use the master branch
# we need this unreleased commit: https://github.com/pyinstaller/pyinstaller-hooks-contrib/commit/0f40dc6e74086e5472aee75070b9077b4c17ab18
pyinstaller-hooks-contrib = {git = "https://github.com/pyinstaller/pyinstaller-hooks-contrib.git", branch="master"}
Expand Down
2 changes: 1 addition & 1 deletion scripts/package/package-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function build_zip() {
if [[ $platform == "windows"* ]]; then
7z a $filename activitywatch;
else
zip -r $filename activitywatch;
zip -r --symlinks $filename activitywatch;
fi
popd;
echo "Zip built!"
Expand Down
2 changes: 1 addition & 1 deletion scripts/package/package-appimage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ DIR="$(dirname "$(readlink -f "${0}")")"
chmod a+x ./activitywatch/AppRun

# build appimage
./linuxdeploy-x86_64.AppImage --appdir activitywatch --executable ./activitywatch/aw-qt --output appimage --desktop-file ./activitywatch/aw-qt.desktop --icon-file ./activitywatch/media/logo/logo.png --icon-filename activitywatch
./linuxdeploy-x86_64.AppImage --appdir activitywatch --executable ./activitywatch/aw-qt --output appimage --desktop-file ./activitywatch/_internal/aw-qt.desktop --icon-file ./activitywatch/_internal/media/logo/logo.png --icon-filename activitywatch
APPIMAGE_FILE=`ls -1 | grep AppImage| grep -i ActivityWatch`
cp -v $APPIMAGE_FILE ./dist/activitywatch-linux-x86_64.AppImage
6 changes: 3 additions & 3 deletions scripts/package/package-deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ jdupes -L -r -S -Xsize-:1K $PKGDIR/opt/
sudo chown -R root:root $PKGDIR

# Prepare the .desktop file
sudo sed -i 's!Exec=aw-qt!Exec=/opt/activitywatch/aw-qt!' $PKGDIR/opt/activitywatch/aw-qt.desktop
sudo cp $PKGDIR/opt/activitywatch/aw-qt.desktop $PKGDIR/etc/xdg/autostart/
sudo cp $PKGDIR/opt/activitywatch/aw-qt.desktop $PKGDIR/usr/share/applications/
sudo sed -i 's!Exec=aw-qt!Exec=/opt/activitywatch/aw-qt!' $PKGDIR/opt/activitywatch/_internal/aw-qt.desktop
sudo cp $PKGDIR/opt/activitywatch/_internal/aw-qt.desktop $PKGDIR/etc/xdg/autostart/
sudo cp $PKGDIR/opt/activitywatch/_internal/aw-qt.desktop $PKGDIR/usr/share/applications/

dpkg-deb --build $PKGDIR
sudo mv activitywatch_${VERSION_NUM}.deb dist/activitywatch-${VERSION}-linux-x86_64.deb