Skip to content

Commit

Permalink
Prepared windows release
Browse files Browse the repository at this point in the history
  • Loading branch information
kozec committed Nov 26, 2018
1 parent f289b81 commit 15aaafd
Show file tree
Hide file tree
Showing 14 changed files with 49 additions and 28 deletions.
20 changes: 2 additions & 18 deletions .gitignore
@@ -1,21 +1,4 @@
# - old -
*.pyc
.*
*~
*.so
*.patch
!scc/*tester*
build/
.atomignore
commit*
profiles
.idea/
out.svg
*.AppImage
*.cpp
*.vdf

# - c -
# Binaries for programs and plugins
*.exe
*.dll
*.so
Expand All @@ -26,3 +9,4 @@ bin/
build/
build-win32/
build-w10/
release-win32/
Expand Up @@ -21,9 +21,7 @@
"gyro": {},

"stick" : {
"X" : { "action" : "axis(Axes.ABS_X)" },
"Y" : { "action" : "raxis(Axes.ABS_Y)" },
"sensitivity": [1.2, 1.2, 1.0]
"action": "XY(axis(Axes.ABS_X), raxis(Axes.ABS_Y))"
},

"pad_left" : {
Expand Down
4 changes: 1 addition & 3 deletions default_profiles/XBox Controller.sccprofile
Expand Up @@ -21,9 +21,7 @@
"gyro": {},

"stick" : {
"X" : { "action" : "axis(Axes.ABS_X)" },
"Y" : { "action" : "raxis(Axes.ABS_Y)" },
"sensitivity": [1.2, 1.2, 1.0]
"action": "XY(axis(Axes.ABS_X), raxis(Axes.ABS_Y))"
},

"pad_left" : {
Expand Down
34 changes: 34 additions & 0 deletions make-win32-release.sh
@@ -0,0 +1,34 @@
#!/bin/bash
LIBS=(libwinpthread-1.dll libsystre-0.dll libtre-5.dll libusb-1.0.dll libintl-8.dll
libgcc_s_dw2-1.dll libiconv-2.dll libstdc++-6.dll)
GTK_LIBS=(libgtk-3-0.dll libgdk-3-0.dll libharfbuzz-0.dll libfreetype-6.dll
libepoxy-0.dll libcairo-gobject-2.dll libpng16-16.dll
libgraphite2.dll libbz2-1.dll libcairo-2.dll libatk-1.0-0.dll
libfontconfig-1.dll libgdk_pixbuf-2.0-0.dll libgio-2.0-0.dll
libglib-2.0-0.dll libgmodule-2.0-0.dll libgobject-2.0-0.dll
libpango-1.0-0.dll libpangocairo-1.0-0.dll libpangoft2-1.0-0.dll
libpangowin32-1.0-0.dll libpixman-1-0.dll zlib1.dll libexpat-1.dll
libffi-6.dll libfribidi-0.dll libpcre-1.dll libthai-0.dll libdatrie-1.dll
)
DRIVERS=(sc_by_cable sc_dongle)

meson build-win32
ninja -C build-win32 || exit 1

mkdir -p release-win32
for d in default_profiles default_menus osd_styles ; do
cp -vr $d release-win32/
done

cp -v build-win32/src/daemon/scc-daemon.exe release-win32/
cp -v build-win32/src/osd/scc-osd-menu.exe release-win32/
cp -v build-win32/src/daemon/libvigemclient.dll release-win32/

mkdir -p release-win32/drivers/
for i in "${DRIVERS[@]}" ; do
cp -v "build-win32/src/daemon/drivers/libscc_drv_$i.dll" release-win32/drivers/
done

for i in "${LIBS[@]}" "${GTK_LIBS[@]}" ; do
[ -e release-win32/$i ] || cp -v $(whereis "$i" | cut -d ":" -f 2) release-win32/
done
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 6 additions & 3 deletions src/daemon/drivers.c
Expand Up @@ -2,6 +2,7 @@
#include "scc/utils/logging.h"
#include "scc/utils/assert.h"
#include "scc/utils/list.h"
#include "scc/tools.h"
#include "daemon.h"
#include <string.h>
#include <dirent.h>
Expand All @@ -10,12 +11,10 @@
#include <windows.h>
#define FILENAME_PREFIX "libscc_drv_"
#define FILENAME_SUFFIX ".dll"
#define DRIVERS_PATH "build-win32/src/daemon/drivers";
#else
#include <dlfcn.h>
#define FILENAME_PREFIX "libscc_drv_"
#define FILENAME_SUFFIX ".so"
#define DRIVERS_PATH "build/src/daemon/drivers";
#endif


Expand Down Expand Up @@ -79,7 +78,11 @@ void sccd_drivers_init() {
Daemon* d = get_daemon();
INFO("Initializing drivers...");
// TODO: This path should be somehow configurable or determined on runtime
const char* path = DRIVERS_PATH;
#ifdef _WIN32
const char* path = strbuilder_fmt("%s\\drivers", scc_get_share_path());
#else
const char* path = "build/src/daemon/drivers";
#endif
DIR *dir;
struct dirent *ent;
if ((dir = opendir (path)) == NULL) {
Expand Down
4 changes: 4 additions & 0 deletions src/daemon/mapper.c
Expand Up @@ -176,6 +176,10 @@ static bool special_action(Mapper* m, unsigned int sa_action_type, void* sa_data
SAMenuActionData* sa_menu_data = (SAMenuActionData*)sa_data;
char* scc_osd_menu = scc_find_binary("scc-osd-menu");
char* menu = scc_find_menu(sa_menu_data->menu_id);
if (scc_osd_menu == NULL)
LERROR("Could not find 'scc-osd-menu'");
if (menu == NULL)
LERROR("Could not find menu '%s'", sa_menu_data->menu_id);
if ((scc_osd_menu != NULL) && (menu != NULL)) {
#ifndef _WIN32
char* argv[] = { scc_osd_menu, "-f", menu, NULL };
Expand Down
2 changes: 1 addition & 1 deletion src/osd/css_magic.c
Expand Up @@ -28,7 +28,7 @@ void install_css_provider() {
StrBuilder* b = NULL;
if (config == NULL) goto install_css_provider_fail;

char* css_path = strbuilder_fmt("%s/osd-styles/%s", scc_get_share_path(), config_get(config, "osd_style"));
char* css_path = strbuilder_fmt("%s/osd_styles/%s", scc_get_share_path(), config_get(config, "osd_style"));
if (css_path == NULL) goto install_css_provider_fail;
DDEBUG("Loading css_provider %s", css_path);

Expand Down

0 comments on commit 15aaafd

Please sign in to comment.