diff --git a/x11/lumina-core/Makefile b/x11/lumina-core/Makefile index 561f15426077..ad734e3c8e94 100644 --- a/x11/lumina-core/Makefile +++ b/x11/lumina-core/Makefile @@ -1,61 +1,61 @@ # Created by: Ken Moore PORTNAME= lumina-core DISTVERSIONPREFIX= v DISTVERSION= 1.6.2 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= x11 MAINTAINER= lbartoletti@FreeBSD.org COMMENT= Lumina Desktop Environment LICENSE= BSD3CLAUSE LICENSE_FILE= ${WRKSRC}/../../LICENSE RUN_DEPENDS= fluxbox>=0:x11-wm/fluxbox \ fluxbox-tenr-styles-pack>=0:x11-themes/fluxbox-tenr-styles-pack \ xscreensaver>=0:x11/xscreensaver \ xbrightness>=0:x11/xbrightness \ compton>=0:x11-wm/compton \ xrandr>=0:x11/xrandr \ numlockx>=0:x11/numlockx \ ${LOCALBASE}/share/icons/La-Capitaine/index.theme:x11-themes/la-capitaine-icon-theme LIB_DEPENDS+= libxcb-ewmh.so:x11/xcb-util-wm \ libxcb-icccm.so:x11/xcb-util-wm \ libxcb-image.so:x11/xcb-util-image \ libxcb-util.so:x11/xcb-util \ libXcursor.so:x11/libXcursor USES= compiler:c++11-lang gl qmake qt:5 xorg USE_GL= gl USE_XORG= x11 xdamage xcb USE_LDCONFIG= yes USE_QT= buildtools_build concurrent core dbus declarative gui \ imageformats multimedia network svg widgets x11extras USE_GITHUB= yes GH_ACCOUNT= lumina-desktop GH_PROJECT= lumina OPTIONS_DEFINE= MULTIMEDIA TRUEOS NLS OPTIONS_DEFAULT= MULTIMEDIA OPTIONS_SUB= yes MULTIMEDIA_DESC= Install multimedia support backend (gstreamer) TRUEOS_DESC= Use the TrueOS system interface settings. TRUEOS_QMAKE_ON= DEFAULT_SETTINGS=TrueOS MULTIMEDIA_RUN_DEPENDS= gstreamer1-plugins-core>=0:multimedia/gstreamer1-plugins-core NLS_USE= QT=linguist_build NLS_QMAKE_ON= CONFIG+=WITH_I18N WRKSRC_SUBDIR= src-qt5/core CONFIGURE_ENV+= DESTDIR=${STAGEDIR} CONFLICTS_INSTALL= lumina-1.2.* post-install: ${FIND} ${STAGEDIR}${PREFIX}/share -name "ecp.*" -delete .include diff --git a/x11/lumina-core/files/patch-libLumina_LuminaOS-FreeBSD.cpp b/x11/lumina-core/files/patch-libLumina_LuminaOS-FreeBSD.cpp new file mode 100644 index 000000000000..9b27e4817de2 --- /dev/null +++ b/x11/lumina-core/files/patch-libLumina_LuminaOS-FreeBSD.cpp @@ -0,0 +1,72 @@ +--- libLumina/LuminaOS-FreeBSD.cpp.orig 2021-12-26 02:33:45 UTC ++++ libLumina/LuminaOS-FreeBSD.cpp +@@ -9,6 +9,7 @@ + #include + #include + #include ++#include + + #include + //can't read xbrightness settings - assume invalid until set +@@ -289,31 +290,53 @@ void LOS::systemSuspend(){ + } + + //Battery Availability ++// apm command is not available on powerpc or arm + bool LOS::hasBattery(){ + static int hasbat = -1; ++ int life; ++ size_t len = sizeof(life); + if(hasbat < 0 ){ +- int val = batteryCharge(); +- if(val >= 0 && val <= 100){ hasbat = 1; } +- else{ hasbat = 0; } ++ if ( sysctlbyname("hw.acpi.battery.life", &life, &len, NULL, 0) == 0 ) ++ hasbat = 1; ++ else ++ hasbat = 0; + } + return (hasbat==1); + } + + //Battery Charge Level ++// apm command is not available on powerpc or arm + int LOS::batteryCharge(){ //Returns: percent charge (0-100), anything outside that range is counted as an error +- int charge = LUtils::getCmdOutput("apm -l").join("").toInt(); +- if(charge > 100){ charge = -1; } //invalid charge +- return charge; ++ int life; // sysctl name ++ size_t len = sizeof(life); ++ if ( (sysctlbyname("hw.acpi.battery.life", &life, &len, NULL, 0) != 0) || ++ (life > 100) ) ++ life = -1; //invalid charge ++ return life; + } + + //Battery Charging State ++// apm command is not available on powerpc or arm + bool LOS::batteryIsCharging(){ +- return (LUtils::getCmdOutput("apm -a").join("").simplified() == "1"); ++ int state; ++ size_t len = sizeof(state); ++ if ( (sysctlbyname("hw.acpi.battery.state", &state, &len, NULL, 0) == 0) && ++ (state == ACPI_BATT_STAT_CHARGING) ) ++ return true; ++ else ++ return false; + } + + //Battery Time Remaining ++// apm command is not available on powerpc or arm + int LOS::batterySecondsLeft(){ //Returns: estimated number of seconds remaining +- return LUtils::getCmdOutput("apm -t").join("").toInt(); ++ int min; ++ size_t len = sizeof(min); ++ if ( LOS::batteryIsCharging() || ++ (sysctlbyname("hw.acpi.battery.time", &min, &len, NULL, 0) != 0) ) ++ return -1; ++ else ++ return min * 60; + } + + //File Checksums