Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gentoo support, NVMe disks as HDRIVE, Desktop specification fixes #207

Merged
merged 4 commits into from Mar 23, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
40 changes: 21 additions & 19 deletions OS-detect.pri
Expand Up @@ -2,9 +2,9 @@
# Subroutine for project files to detect which OS is compiling the project
# Generic variables it sets for internal use: OS, LINUX_DISTRO (if OS=="Linux")
# =============================================
# Main Build Variables (generally for finding existing files):
# Main Build Variables (generally for finding existing files):
# PREFIX: Base install directory (${PREFIX}/[bin/share/etc/include] will be used)
# LIBPREFIX: Base install directory for libraries (usually ${PREFIX}/lib)
# LIBPREFIX: Base install directory for libraries (usually ${PREFIX}/lib)
# Automated build variables (for pkg builders and such)
# DESTDIR: Prepended to the install location of all files (such as a temporary working directory)
# - Note that the Lumina will probably not run properly from this dir (not final install dir)
Expand All @@ -21,60 +21,62 @@
# =============================================
isEmpty(OS){
message("Build OS Info: $${QMAKE_HOST.os}, $${QMAKE_HOST.arch}, $${QMAKE_HOST.version_string}")

#Load the initial library/includefile search locations (more can be added in the OS-specific sections below)
LIBS = -L$${PWD}/libLumina -L$$[QT_INSTALL_LIBS]
INCLUDEPATH = $${PWD}/libLumina $$[QT_INSTALL_HEADERS] $$[QT_INSTALL_PREFIX]
QMAKE_LIBDIR = $${PWD}/libLumina $$[QT_INSTALL_LIBS] $$LIBPREFIX/qt5 $$LIBPREFIX

#Setup the default values for build settings (if not explicitly set previously)
isEmpty(PREFIX){ PREFIX=/usr/local }
isEmpty(LIBPREFIX){ LIBPREFIX=$${PREFIX}/lib }

#Now go through and setup any known OS build settings
# which are different from the defaults
equals(QMAKE_HOST.os, "DragonFly"){
#Note: DragonFly BSD gets detected as FreeBSD with compiler flags ?
OS = DragonFly
LIBS += -L/usr/local/lib -L/usr/lib

}else : freebsd-*{
OS = FreeBSD
LIBS += -L/usr/local/lib -L/usr/lib
#Use the defaults for everything else

}else : openbsd-*{
OS = OpenBSD
LIBS += -L/usr/local/lib -L/usr/lib
#Use the defaults for everything else

}else : netbsd-*{
OS = NetBSD
LIBS += -L/usr/local/lib -L/usr/lib
#Use the defaults for everything else

}else : linux-*{
L_SESSDIR=/usr/share/xsessions
OS=Linux
LIBS += -L/usr/local/lib -L/usr/lib -L/lib

exists(/bin/lsb_release){
LINUX_DISTRO = $$system(lsb_release -si)
} else:exists(/usr/bin/lsb_release){
LINUX_DISTRO = $$system(lsb_release -si)
} else:exists(/etc/gentoo-release){
LINUX_DISTRO = Gentoo
}
}else{
OS="Unknown";

}else{
OS="Unknown";
}

MSG="Build Settings Loaded: $${OS}"
equals(OS,"Linux"){ MSG+="-$${LINUX_DISTRO}" }
message( $$MSG )

# Setup the dirs needed to find/load libraries
INCLUDEPATH +=$${PREFIX}/include

# If the detailed install variables are not set - create them from the general vars
isEmpty(L_BINDIR){ L_BINDIR = $${PREFIX}/bin }
isEmpty(L_LIBDIR){ L_LIBDIR = $${PREFIX}/lib }
Expand All @@ -83,14 +85,14 @@ isEmpty(OS){
isEmpty(L_INCLUDEDIR){ L_INCLUDEDIR = $${PREFIX}/include }
isEmpty(L_SESSDIR){ L_SESSDIR = $${L_SHAREDIR}/xsessions }
isEmpty(LRELEASE){ LRELEASE = $$[QT_INSTALL_BINS]/lrelease }

!exists(LRELEASE){ NO_I18N=true } #translations unavailable

#Now convert any of these install path variables into defines for C++ usage
DEFINES += PREFIX="QString\\\(\\\"$${PREFIX}\\\"\\\)"
DEFINES += L_ETCDIR="QString\\\(\\\"$${L_ETCDIR}\\\"\\\)"
DEFINES += L_SHAREDIR="QString\\\(\\\"$${L_SHAREDIR}\\\"\\\)"

#If this is being installed to a temporary directory, change the paths where things get placed
!isEmpty(DESTDIR){
L_BINDIR = $$DESTDIR$${L_BINDIR}
Expand Down
4 changes: 2 additions & 2 deletions libLumina/LuminaOS-Debian.cpp
Expand Up @@ -40,7 +40,7 @@ QStringList LOS::ExternalDevicePaths(){
QString type = devs[i].section(" on ",0,0);
type.remove("/dev/");
//Determine the type of hardware device based on the dev node
if(type.startsWith("sd")){ type = "HDRIVE"; }
if(type.startsWith("sd") || type.startsWith("nvme"){ type = "HDRIVE"; }
else if(type.startsWith("sr")){ type="DVD"; }
else if(type.contains("mapper")){ type="LVM"; }
else{ type = "UNKNOWN"; }
Expand Down Expand Up @@ -288,7 +288,7 @@ QStringList LOS::DiskUsage(){ //Returns: List of current read/write stats for ea
info[i].replace("\t"," ");
if(info[i].startsWith("Device:")){ labs = info[i].split(" ", QString::SkipEmptyParts); }//the labels for each column
else{
QStringList data = info[i].split(" ",QString::SkipEmptyParts); //data[0] is always the device
QStringList data = info[i].split(" ",QString::SkipEmptyParts); //data[0] is always the device
if(data.length()>2 && labs.length()>2){
out << fmt.arg(data[0], data[3]+" "+labs[3], data[4]+" "+labs[4]);
}
Expand Down