Skip to content

Commit

Permalink
Some cleanup (#338)
Browse files Browse the repository at this point in the history
* Upgrade sentry to 0.7.0 and do some cleanup

* Fix install and crash
  • Loading branch information
Eeems authored Jan 15, 2024
1 parent f4b81ed commit b838506
Show file tree
Hide file tree
Showing 2,620 changed files with 57,639 additions and 28,203 deletions.
98 changes: 50 additions & 48 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,37 +11,76 @@ MAKEFLAGS := --jobs=$(shell nproc)
DIST=$(CURDIR)/release
BUILD=$(CURDIR)/.build


ifneq ($(filter sentry,$(FEATURES)),)
OBJ += sentry
RELOBJ += $(DIST)/opt/lib/libsentry.so
DEFINES += 'DEFINES+="SENTRY"'
DEFINES += DEFINES+="SENTRY"
endif

OBJ += $(BUILD)/oxide/Makefile

clean:
rm -rf $(DIST) $(BUILD)
clean-base:
rm -rf $(DIST) $(BUILD)/oxide

release: clean build $(RELOBJ)
mkdir -p $(DIST)
clean: clean-base
rm -rf $(BUILD)

release: clean-base build $(DIST)
# Force sentry makefile to regenerate so that install targets get when being build in toltecmk
cd $(BUILD)/oxide/shared/sentry && make qmake
# Force liboxide makefile to regenerate so that install targets get when being build in toltecmk
cd $(BUILD)/oxide/shared/liboxide && make qmake
INSTALL_ROOT=$(DIST) $(MAKE) --output-sync=target -C $(BUILD)/oxide install

build: $(BUILD) $(OBJ)
build: $(OBJ)
$(MAKE) --output-sync=target -C $(BUILD)/oxide all

package: REV="~r$(shell git rev-list --count HEAD).$(shell git rev-parse --short HEAD)"
package:
package: version.txt $(DIST) $(BUILD)/package/oxide.tar.gz
toltecmk \
--verbose \
-w $(BUILD)/package/build \
-d $(BUILD)/package/dist \
$(BUILD)/package
cp -a $(BUILD)/package/dist/rmall/*.ipk $(DIST)

version.txt:
if [ -d .git ];then \
echo $(REV) > version.txt; \
else \
echo "~manual" > version.txt; \
fi;

$(DIST):
mkdir -p $(DIST)

$(BUILD):
mkdir -p $(BUILD)

$(BUILD)/.nobackup: $(BUILD)
touch $(BUILD)/.nobackup

$(BUILD)/oxide: $(BUILD)/.nobackup
mkdir -p $(BUILD)/oxide

$(BUILD)/oxide/Makefile: $(BUILD)/oxide
cd $(BUILD)/oxide && qmake -r $(DEFINES) $(CURDIR)

$(BUILD)/package:
mkdir -p $(BUILD)/package
rm -rf $(BUILD)/package/build

$(BUILD)/package/package: $(BUILD)/package
sed "s/~VERSION~/`cat version.txt`/" ./package > $(BUILD)/package/package

PKG_OBJ = oxide.pro Makefile
PKG_OBJ += $(wildcard applications/**)
PKG_OBJ += $(wildcard assets/**)
PKG_OBJ += $(wildcard interfaces/**)
PKG_OBJ += $(wildcard qmake/**)
PKG_OBJ += $(wildcard shared/**)
PKG_OBJ += $(wildcard tests/**)

$(BUILD)/package/oxide.tar.gz: $(BUILD)/package/package $(PKG_OBJ)
rm -f $(BUILD)/package/oxide.tar.gz
tar \
--exclude='$(CURDIR)/.git' \
--exclude='$(BUILD)' \
Expand All @@ -53,43 +92,6 @@ package:
interfaces \
qmake \
shared \
tests \
oxide.pro \
Makefile
toltecmk \
--verbose \
-w $(BUILD)/package/build \
-d $(BUILD)/package/dist \
$(BUILD)/package
mkdir -p $(DIST)
cp -a $(BUILD)/package/dist/rmall/*.ipk $(DIST)

sentry: $(BUILD)/sentry/libsentry.so

$(BUILD):
mkdir -p $(BUILD)

$(BUILD)/.nobackup: $(BUILD)
touch $(BUILD)/.nobackup

$(BUILD)/oxide: $(BUILD)/.nobackup
mkdir -p $(BUILD)/oxide

$(BUILD)/oxide/Makefile: $(BUILD)/oxide
cd $(BUILD)/oxide && qmake -r $(DEFINES) $(CURDIR)/oxide.pro

$(BUILD)/sentry/libsentry.so: $(BUILD)/.nobackup
cd shared/sentry && cmake -B $(BUILD)/sentry/src \
-DBUILD_SHARED_LIBS=ON \
-DSENTRY_INTEGRATION_QT=ON \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DSENTRY_PIC=OFF \
-DSENTRY_BACKEND=breakpad \
-DSENTRY_BREAKPAD_SYSTEM=OFF \
-DSENTRY_EXPORT_SYMBOLS=ON \
-DSENTRY_PTHREAD=ON
cd shared/sentry && cmake --build $(BUILD)/sentry/src --parallel
cd shared/sentry && cmake --install $(BUILD)/sentry/src --prefix $(BUILD)/sentry --config RelWithDebInfo

$(DIST)/opt/lib/libsentry.so: sentry
mkdir -p $(DIST)/opt/lib
cp -a $(BUILD)/sentry/lib/libsentry.so $(DIST)/opt/lib/
1 change: 0 additions & 1 deletion applications/desktop-file-edit/desktop-file-edit.pro
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ target.path = /opt/bin
INSTALLS += target

include(../../qmake/liboxide.pri)
include(../../qmake/sentry.pri)
1 change: 0 additions & 1 deletion applications/desktop-file-install/desktop-file-install.pro
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ target.path = /opt/bin
INSTALLS += target

include(../../qmake/liboxide.pri)
include(../../qmake/sentry.pri)
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@ target.path = /opt/bin
INSTALLS += target

include(../../qmake/liboxide.pri)
include(../../qmake/sentry.pri)
1 change: 0 additions & 1 deletion applications/gio/gio.pro
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,3 @@ target.path = /opt/bin
INSTALLS += target

include(../../qmake/liboxide.pri)
include(../../qmake/sentry.pri)
1 change: 0 additions & 1 deletion applications/inject_evdev/inject_evdev.pro
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@ target.path = /opt/bin
INSTALLS += target

include(../../qmake/liboxide.pri)
include(../../qmake/sentry.pri)
1 change: 0 additions & 1 deletion applications/launcher/launcher.pro
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,3 @@ PRECOMPILED_HEADER = \
oxide_stable.h

include(../../qmake/liboxide.pri)
include(../../qmake/sentry.pri)
1 change: 0 additions & 1 deletion applications/lockscreen/lockscreen.pro
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,3 @@ RESOURCES += \
qml.qrc

include(../../qmake/liboxide.pri)
include(../../qmake/sentry.pri)
1 change: 0 additions & 1 deletion applications/notify-send/notify-send.pro
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@ target.path = /opt/bin
INSTALLS += target

include(../../qmake/liboxide.pri)
include(../../qmake/sentry.pri)
1 change: 0 additions & 1 deletion applications/process-manager/process-manager.pro
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,3 @@ PRECOMPILED_HEADER = \
LIBS += -lsystemd

include(../../qmake/liboxide.pri)
include(../../qmake/sentry.pri)
1 change: 0 additions & 1 deletion applications/screenshot-tool/screenshot-tool.pro
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ applications.path = /opt/usr/share/applications/
INSTALLS += applications

include(../../qmake/liboxide.pri)
include(../../qmake/sentry.pri)
3 changes: 1 addition & 2 deletions applications/screenshot-viewer/controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
#include <QImage>
#include <QQuickItem>
#include <liboxide.h>

#include "epframebuffer.h"
#include <epframebuffer.h>

#include "screenshotlist.h"

Expand Down
1 change: 0 additions & 1 deletion applications/screenshot-viewer/screenshot-viewer.pro
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,3 @@ PRECOMPILED_HEADER = \
anxiety_stable.h

include(../../qmake/liboxide.pri)
include(../../qmake/sentry.pri)
1 change: 0 additions & 1 deletion applications/settings-manager/settings-manager.pro
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@ target.path = /opt/bin
INSTALLS += target

include(../../qmake/liboxide.pri)
include(../../qmake/sentry.pri)
8 changes: 8 additions & 0 deletions applications/system-service/apibase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,12 @@ int APIBase::hasPermission(QString permission, const char* sender){
return true;
}

int APIBase::getSenderPid() {
if (!calledFromDBus()) {
return getpid();
}
return connection().interface()->servicePid(message().service());
}
int APIBase::getSenderPgid() { return getpgid(getSenderPid()); }

#include "moc_apibase.cpp"
11 changes: 3 additions & 8 deletions applications/system-service/apibase.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,9 @@ class APIBase : public QObject, protected QDBusContext {
virtual void setEnabled(bool enabled) = 0;
int hasPermission(QString permission, const char* sender = __builtin_FUNCTION());

protected:
int getSenderPid(){
if(!calledFromDBus()){
return getpid();
}
return connection().interface()->servicePid(message().service());
}
int getSenderPgid(){ return getpgid(getSenderPid()); }
protected:
int getSenderPid();
int getSenderPgid();
};

#endif // APIBASE_H
Loading

0 comments on commit b838506

Please sign in to comment.