diff --git a/CraftSettings.ini.template b/CraftSettings.ini.template index 545ea9123..e15848769 100644 --- a/CraftSettings.ini.template +++ b/CraftSettings.ini.template @@ -1,235 +1,236 @@ ## You can use cmake like variables for values in the same section ${Variable} ## or for variables from a different section ${Section:Variable}. ## See Paths/${DOWNLOADDIR} [General] ## Here you set the ABI to be used. ## #platform-#abi-#compiler ## Valid combinations are: ## windows-msvc[2015, 2017]_[32, 64]-[cl, clang] ## windows-mingw_[32, 64]-[gcc, clang] ## linux-[32, 64]-[gcc, clang] ## macos-[32, 64]-clang ## freebsd-[32, 64]-clang ABI = windows-msvc2015_64-cl ## This option should be set to False if you use the msvc 201X Express Edition 64bit compiler ## in all other cases, simply keep this option commented out #Native=False ## This option can be used to enable a notification backend. ## As soon as the buildprocess of a project has finished a notification will be displayed. ## Possible Backends: -## Snore https://commits.kde.org/snorenotify. Snore supports multiple backends. -## Just 'craft snorenotify' -## To configure snorenotify for craft call 'snoresettings --appName snoresend' -#Notify = Snore +## Snore: https://commits.kde.org/snorenotify. Snore supports multiple backends. +## Just 'craft snorenotify' +## To configure snorenotify for craft call 'snoresettings --appName snoresend' +## SnoreToast: simple command line util for Windows notifications +Notify = SnoreToast ## Speed up the merging of packages by using hard links UseHardlinks = True [Variables] ## Values here are usually set by craft and can be used for dynamic values ## To override the variables, uncomment them ## The working directory of Craft #CraftRoot = ## The directory of the Craft clone #CraftDir = [Paths] ## This is the location of your python installation. ## This value must be set. Python = C:\PROGRA~1\Python36 ## Some applications may need python 2.7 #Python27 = C:\python27 ## Craft ist able to fetch and install Msys itself, but if you prefer to use ## your own installation specify it here #Msys = C:\msys ## Here you change the download directory. ## If you want, so you can share the same download directory between ## mingw and msvc. ## The default value is craft/../download #DownloadDir = C:\kde\download ## This option defines the location for git checkouts. ## The default value is craft/../download/git #KDEGitDir = ${DOWNLOADDIR}\git ## This option defines the location for svn checkouts. ## The default value is craft/../download/svn #KDESVNDir = ${DOWNLOADDIR}\svn ## This option defines the location where the ccache files are stored. ## The default location is KDEROOT/build/ccache #CCACHE_DIR = C:\CCACHE\kf5 [Compile] ## the buildtype of this installation ## Possible Values: ## Release ## RelWithDebInfo ## Debug ## MinSizeRel BuildType = RelWithDebInfo ## Whether to use ninja (default: False) UseNinja = True ## Whether to use ccache (only avalible with mingw compiler) #UseCCache = True ## This option can be used to override the default make program ## change the value to the path of the executable you want to use instead. MakeProgram = jom [CMake] ## Fetch the translations for KDE projects when build from git KDE_L10N_AUTO_TRANSLATIONS = OFF [ShortPath] ## substitute pathes by drives ## This option is needed to avoid path limit problems in case of long base paths ## and compiling big packages like qt ## If you disable it do _not_ use any paths longer than 6 letters in the ## directory settings Enabled = True ## each drive could be commented out to skip substitution RootDrive = R: GitDrive = Q: #DownloadDrive = T: ## Experimental!!! ## Use Junctions to work around long paths. #EnableJunctions = True ## The directory where the junctions are created. #JunctionDir= ## A drive letter where JunctionDir is mounted to. ## When this variable is defined craft will mount the drive even if [ShortPath]Enabled == False #JunctionDrive = Z: [Blueprints] ## The location where the default blueprints are stored ## This is especially useful when using multiple Craft setups #BlueprintRoot = ${Variables:CraftRoot}/etc/blueprints/locations ## The locations of the recipes ## You can specify additional external locations in ; separated list #Locations = C:\blueprints # Customer settings Settings = ${Variables:CraftRoot}/etc/BlueprintSettings.ini [BlueprintVersions] ## Allow to automatically update certain recipes once a day. EnableDailyUpdates = True [Packager] ## The location where generated installers are placed #Destination = ${Variables:CraftRoot}/tmp ## The archive type for packages. ## Possible values are: zip, 7z ## Todo: rename #7ZipArchiveType = 7z # id assigned to you by the Windows Store #AppxPublisherId = CN=98B52D9A-DF7C-493E-BADC-37004A92EFC8 ## If set this will override the default package type. ## Possible values are: ### SevenZipPackager: An image of the files installed by the package ### MSIFragmentPackager ### NullsoftInstallerPackager: A nsis based installer including all dependencies ### CreateArchivePackager: An image including all dependencies #PackageType = SevenZipPackager ## Package the Source files too. PackageSrc = False ## Whether to package debug symbols ### by default debug symbols are stripped/removed from the package ### If PackageDebugSymbols is set to True, a separate archive with the symbols is created. PackageDebugSymbols = False ## A url to a Craft cache repository ## Sets a custom repository for the binary cache #RepositoryUrl = https://files.kde.org/craft/master/ ## Enable to fatch packages from a Craft cache repository ## See --use-cache and --no-cache in the Craft help. UseCache = True [CraftDebug] ## If you want to have verbose output, uncomment the following option ## and set it to positive integer for verbose output and to 0 ## (or disable it) for normal output. Currently the highest verbosity level ## is 3 (equal to 'craft -v -v -v'). level -1 equals 'craft -q' ## Default is Verbose = 0 #Verbose = 1 # Log environment, prints the current state of the environment before an application is run LogEnvironment = True ## Prints time spend on various craft tasks MeasureTime = False ## Dump internal state of craftSettings to kdesettings.ini.dump #DumpSettings = True ## Print function Deprecation messages LogDeprecated = True [Environment] ## All values defined here will be populated to the environment #GIT_COMMITTER_EMAIL = foo@bar.com ## Set the ssh client for git and svn. #GIT_SSH = plink #SVN_SSH = plink [QtSDK] ## For advanced users only ## Whether to use prebuild Qt binaries. Enabled = False ## The path to the Qt sdk. Path = D:\Qt ## The version of Qt. Version = 5.11.1 ## The compiler version, if you are not sure what to use, have a look into the directory set in QtSDK/Path. ## The compiler must be of the same type as General/KDECOMPILER. ## If you are using mingw please make sure you have installed the mingw using the Qt installer. Compiler = mingw482_32 [ContinuousIntegration] ## Changes the verbosity of some sub processes. ## Installed versions must match. ## Don't write to stderr Enabled = False ## Delete the build folder after the install ClearBuildFolder = False [CodeSigning] Enabled = False CommonName = K Desktop Environment e.V. Organization = K Desktop Environment e.V. Locality = Berlin Country = DE State = [Version] ConfigVersion = 6 diff --git a/bin/Notifier/Backends/SnoreToast.py b/bin/Notifier/Backends/SnoreToast.py new file mode 100644 index 000000000..16af8251c --- /dev/null +++ b/bin/Notifier/Backends/SnoreToast.py @@ -0,0 +1,28 @@ +import ctypes +import os +import subprocess + +from CraftOS.osutils import OsUtils +from Notifier.NotificationInterface import * +from CraftCore import CraftCore +import utils + +class SnoreToast(NotificationInterface): + def __init__(self): + NotificationInterface.__init__(self, "Snore") + self.icon = os.path.join(CraftCore.standardDirs.craftBin(), "data", "icons", "craftyBENDER.png") + + def notify(self, title, message, alertClass): + try: + snore = CraftCore.cache.findApplication("snoretoast") + if not snore: + return + command = [snore, "-t", title, "-m", message, "-p", self.icon] + CraftCore.log.debug(command) + subprocess.Popen(command, + stdout=subprocess.DEVNULL, + stderr=subprocess.DEVNULL, + cwd=CraftCore.standardDirs.craftRoot()) # make sure that nothing is spawned in a build dir + except Exception as e: + CraftCore.log.debug(e) + return diff --git a/blueprints/dev-utils/_windows/snoretoast/snoretoast.py b/blueprints/dev-utils/_windows/snoretoast/snoretoast.py new file mode 100644 index 000000000..1f8f383e9 --- /dev/null +++ b/blueprints/dev-utils/_windows/snoretoast/snoretoast.py @@ -0,0 +1,25 @@ +import info + + +class subinfo(info.infoclass): + def setTargets(self): + for ver in ["0.5.2"]: + self.targets[ver] = "https://download.kde.org/stable/snoretoast/0.5.2/bin/snoretoast_v0.5.2-x64.7z" + self.targetInstSrc[ver] = "snoretoast_v0.5.2-x64" + self.targetInstallPath[ver] = "dev-utils" + self.targetDigests["0.5.2"] = (["94209bbf777265bfbd5b77fde4e0ff5801509db043e0575ee00ba5736d2e946f"], CraftHash.HashAlgorithm.SHA256) + self.description = "A command line application capable of creating Windows Toast notifications." + self.webpage = "https://phabricator.kde.org/source/snoretoast/" + self.displayName = "SnoreToast" + self.defaultTarget = "0.5.2" + + def setDependencies(self): + self.runtimeDependencies["virtual/bin-base"] = None + + +from Package.BinaryPackageBase import * + + +class Package(BinaryPackageBase): + def __init__(self): + BinaryPackageBase.__init__(self) diff --git a/blueprints/virtual/base/base.py b/blueprints/virtual/base/base.py index 4d2394119..5fa482634 100644 --- a/blueprints/virtual/base/base.py +++ b/blueprints/virtual/base/base.py @@ -1,53 +1,55 @@ import info from Package.VirtualPackageBase import * class subinfo(info.infoclass): def setTargets(self): self.targets['0.2'] = "" self.defaultTarget = '0.2' def setDependencies(self): # The order is important self.buildDependencies["core/cacert"] = None if CraftCore.compiler.isWindows: self.buildDependencies["dev-utils/7zip"] = None self.buildDependencies["dev-utils/wget"] = None self.buildDependencies["dev-utils/git"] = None self.buildDependencies["dev-utils/shimgen"] = None self.buildDependencies["dev-utils/cmake"] = None + if CraftCore.settings.get("General", "Notify", "") == "SnoreToast": + self.buildDependencies["dev-utils/snoretoast"] = None else: self.buildDependencies["dev-utils/cmake"] = None self.buildDependencies["dev-utils/7zip"] = None self.buildDependencies["dev-utils/patch"] = None self.buildDependencies["dev-utils/sed"] = None self.buildDependencies["dev-utils/automake"] = None self.buildDependencies["dev-utils/libtool"] = None if CraftCore.compiler.isMacOS: self.buildDependencies["dev-utils/create-dmg"] = None if CraftCore.compiler.isMinGW(): self.buildDependencies["dev-utils/mingw-w64"] = None if CraftCore.settings.get("Compile", "MakeProgram", "") == "jom": self.buildDependencies["dev-utils/jom"] = None if CraftCore.settings.getboolean("Compile", "UseNinja", False): self.buildDependencies["dev-utils/ninja"] = None if CraftCore.settings.getboolean("Compile", "UseCCache", False): self.buildDependencies["dev-utils/ccache"] = None # needed by CollectionPackagerBase if (CraftCore.settings.getboolean("QtSDK", "Enabled", False) and CraftCore.settings.getboolean("QtSDK","PackageQtSDK",True)): self.buildDependencies["dev-utils/dependencies"] = None self.buildDependencies["craft/craft-blueprints-kde"] = None self.buildDependencies["craft/craft-core"] = None self.runtimeDependencies["libs/runtime"] = None class Package(VirtualPackageBase): def __init__(self): VirtualPackageBase.__init__(self)