Samples: gitchurn and gtk for Windows (#2434)
This commit is contained in:
committed by
Nikolay Igotti
parent
8fd7970119
commit
519e3960fc
@@ -1,7 +1,11 @@
|
||||
# GIT frequency analyzer
|
||||
|
||||
This example shows how one could perform statistics on Git repository.
|
||||
libgit2 is required for this to work (`apt-get install libgit2-dev`).
|
||||
|
||||
Install libgit2 development files.
|
||||
For Debian-like Linux - use `apt-get install libgit2-dev`.
|
||||
For Windows - `pacman -S mingw-w64-x86_64-libgit2` in MinGW64 console, if you do
|
||||
not have MSYS2-MinGW64 installed - install it first as described in http://www.msys2.org
|
||||
|
||||
To build use `../gradlew assemble`.
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ plugins {
|
||||
}
|
||||
|
||||
// Determine host preset.
|
||||
def hostPreset = MPPTools.defaultHostPreset(project, [kotlin.presets.macosX64, kotlin.presets.linuxX64])
|
||||
def hostPreset = MPPTools.defaultHostPreset(project)
|
||||
|
||||
kotlin {
|
||||
targets {
|
||||
@@ -19,13 +19,22 @@ kotlin {
|
||||
case presets.linuxX64:
|
||||
includeDirs.headerFilterOnly '/usr/include'
|
||||
break
|
||||
case presets.mingwX64:
|
||||
includeDirs.headerFilterOnly "${MPPTools.mingwPath()}/include"
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
if (presets.mingwX64 == hostPreset) {
|
||||
compilations.main.linkerOpts "-L${MPPTools.mingwPath()}/lib"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MPPTools.createRunTask(project, 'runProgram', kotlin.targets.gitChurn) {
|
||||
if (kotlin.presets.mingwX64 == hostPreset) {
|
||||
environment 'PATH': "${MPPTools.mingwPath()}/bin"
|
||||
}
|
||||
args project.getRootProject().getRootDir().toString() + '/..'
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
headers = git2.h
|
||||
headerFilter = git2/** git2.h
|
||||
linkerOpts.osx = -L/opt/local/lib -L/usr/local/lib -lgit2
|
||||
linkerOpts.linux = -L/usr/lib64 -L/usr/lib/x86_64-linux-gnu -lgit2
|
||||
headerFilter = git2/** git2.h
|
||||
linkerOpts.mingw = -lgit2
|
||||
|
||||
@@ -32,3 +32,8 @@ on Debian flavours of Linux
|
||||
on Fedora
|
||||
|
||||
sudo dnf install gtk3-devel
|
||||
|
||||
on Windows in MinGW64 console, if you do
|
||||
not have MSYS2-MinGW64 installed - install it first as described in http://www.msys2.org
|
||||
|
||||
pacman -S mingw-w64-x86_64-gtk3
|
||||
|
||||
@@ -3,7 +3,7 @@ plugins {
|
||||
}
|
||||
|
||||
// Determine host preset.
|
||||
def hostPreset = MPPTools.defaultHostPreset(project, [kotlin.presets.macosX64, kotlin.presets.linuxX64])
|
||||
def hostPreset = MPPTools.defaultHostPreset(project)
|
||||
|
||||
kotlin {
|
||||
targets {
|
||||
@@ -12,14 +12,45 @@ kotlin {
|
||||
compilations.main.entryPoint 'sample.gtk.main'
|
||||
compilations.main.cinterops {
|
||||
gtk3 {
|
||||
['/opt/local/include', '/usr/include', '/usr/local/include'].each {
|
||||
includeDirs "$it/atk-1.0", "$it/gdk-pixbuf-2.0", "$it/cairo", "$it/pango-1.0", "$it/gtk-3.0", "$it/glib-2.0"
|
||||
switch (hostPreset) {
|
||||
case presets.macosX64:
|
||||
case presets.linuxX64:
|
||||
['/opt/local/include',
|
||||
'/usr/include',
|
||||
'/usr/local/include'
|
||||
].each {
|
||||
includeDirs "$it/atk-1.0",
|
||||
"$it/gdk-pixbuf-2.0",
|
||||
"$it/cairo",
|
||||
"$it/pango-1.0",
|
||||
"$it/gtk-3.0",
|
||||
"$it/glib-2.0"
|
||||
}
|
||||
includeDirs '/opt/local/lib/glib-2.0/include',
|
||||
'/usr/lib/x86_64-linux-gnu/glib-2.0/include',
|
||||
'/usr/local/lib/glib-2.0/include'
|
||||
break
|
||||
case presets.mingwX64:
|
||||
includeDirs "${MPPTools.mingwPath()}/include/atk-1.0",
|
||||
"${MPPTools.mingwPath()}/include/gdk-pixbuf-2.0",
|
||||
"${MPPTools.mingwPath()}/include/cairo",
|
||||
"${MPPTools.mingwPath()}/include/pango-1.0",
|
||||
"${MPPTools.mingwPath()}/include/gtk-3.0",
|
||||
"${MPPTools.mingwPath()}/include/glib-2.0",
|
||||
"${MPPTools.mingwPath()}/lib/glib-2.0/include"
|
||||
break
|
||||
}
|
||||
includeDirs '/opt/local/lib/glib-2.0/include', '/usr/lib/x86_64-linux-gnu/glib-2.0/include', '/usr/local/lib/glib-2.0/include'
|
||||
}
|
||||
}
|
||||
if (presets.mingwX64 == hostPreset) {
|
||||
compilations.main.linkerOpts "-L${MPPTools.mingwPath()}/lib"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MPPTools.createRunTask(project, 'runProgram', kotlin.targets.gtk)
|
||||
MPPTools.createRunTask(project, 'runProgram', kotlin.targets.gtk) {
|
||||
if (kotlin.presets.mingwX64 == hostPreset) {
|
||||
environment 'PATH': "${MPPTools.mingwPath()}/bin"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,3 +6,4 @@ compilerOpts.osx = -I/usr/local/include/gtk-3.0 -I/usr/local/include/glib-2.0 -I
|
||||
compilerOpts.linux = -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/local/lib/glib-2.0/include -I/usr/lib64/glib-2.0/include
|
||||
linkerOpts.osx = -L/opt/local/lib -L/usr/local/lib -lglib-2.0 -lgdk-3.0 -lgtk-3 -lgio-2.0 -lgobject-2.0
|
||||
linkerOpts.linux = -L/usr/lib64 -L/usr/lib/x86_64-linux-gnu -lglib-2.0 -lgdk-3 -lgtk-3 -lgio-2.0 -lgobject-2.0
|
||||
linkerOpts.mingw = -lglib-2.0 -lgdk-3 -lgtk-3 -lgio-2.0 -lgobject-2.0
|
||||
|
||||
@@ -23,7 +23,9 @@ if (MPPTools.isMacos() || MPPTools.isLinux() || MPPTools.isWindows()) {
|
||||
include ':csvparser'
|
||||
include ':curl'
|
||||
include ':echoServer'
|
||||
include ':gitchurn'
|
||||
include ':globalState'
|
||||
include ':gtk'
|
||||
include ':html5Canvas'
|
||||
include ':libcurl'
|
||||
include ':tetris'
|
||||
@@ -32,8 +34,6 @@ if (MPPTools.isMacos() || MPPTools.isLinux() || MPPTools.isWindows()) {
|
||||
}
|
||||
|
||||
if (MPPTools.isMacos() || MPPTools.isLinux()) {
|
||||
include ':gitchurn'
|
||||
include ':gtk'
|
||||
include ':nonBlockingEchoServer'
|
||||
include ':tensorflow'
|
||||
include ':torch'
|
||||
|
||||
Reference in New Issue
Block a user