Skip to content

Commit cea1459

Browse files
gimx: unstable-2021-08-31 -> 8.0 (#336754)
Co-authored-by: Sandro <[email protected]>
1 parent b3bbb65 commit cea1459

File tree

4 files changed

+42
-169
lines changed

4 files changed

+42
-169
lines changed

pkgs/games/gimx/conf.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ index 451fc48..ed45f4d 100644
77

88
snprintf(file_path, sizeof(file_path), "%s%s%s%s", gimx_params.homedir, GIMX_DIR, CONFIG_DIR, file);
99
-
10-
+ if(getenv("GIMXCONF")) { snprintf(file_path, sizeof(file_path), "%s", file); }
10+
+ snprintf(file_path, sizeof(file_path), "%s", file);
1111
if(read_file(file_path) == -1)
1212
{
1313
gerror("read_file failed\n");
@@ -20,7 +20,7 @@ index 700cae9..9143d8b 100755
2020

2121
snprintf(file_path, sizeof(file_path), "%s%s%s%s", gimx_params.homedir, GIMX_DIR, CONFIG_DIR, gimx_params.config_file);
2222
-
23-
+ if(getenv("GIMXCONF")) { snprintf(file_path, sizeof(file_path), "%s", gimx_params.config_file); }
23+
+ snprintf(file_path, sizeof(file_path), "%s", gimx_params.config_file);
2424
FILE * fp = gfile_fopen(file_path, "r");
2525
if (fp == NULL)
2626
{

pkgs/games/gimx/custom/Dualshock4.xml

Lines changed: 0 additions & 104 deletions
This file was deleted.

pkgs/games/gimx/default.nix

Lines changed: 14 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,103 +1,54 @@
1-
{ stdenv, lib, fetchFromGitHub, fetchpatch
2-
, makeWrapper, curl, libusb1, xorg, libxml2
3-
, ncurses5, bluez, libmhash, gimxPdpGamepad ? false }:
1+
{ stdenv, lib, fetchFromGitHub, makeWrapper, curl, libusb1, bluez, libxml2, ncurses5, libmhash, xorg }:
42

53
let
64
gimx-config = fetchFromGitHub {
75
owner = "matlo";
86
repo = "GIMX-configurations";
97
rev = "c20300f24d32651d369e2b27614b62f4b856e4a0";
10-
sha256 = "02wcjk8da188x7y0jf3p0arjdh9zbb0lla3fxdb28b1xyybfvx5p";
8+
hash = "sha256-t/Ttlvc9LCRW624oSsFaP8EmswJ3OAn86QgF1dCUjAs=";
119
};
1210

1311
in stdenv.mkDerivation rec {
1412
pname = "gimx";
15-
version = "unstable-2021-08-31";
13+
version = "8.0";
1614

1715
src = fetchFromGitHub {
1816
owner = "matlo";
1917
repo = "GIMX";
20-
rev = "58d2098dce75ed4c90ae649460d3a7a150f4ef0a";
18+
rev = "v${version}";
2119
fetchSubmodules = true;
22-
sha256 = "05kdv2qqr311c2p76hdlgvrq7b04vcpps5c80zn8b8l7p831ilgz";
20+
hash = "sha256-BcFLdQgEAi6Sxyb5/P9YAIkmeXNZXrKcOa/6g817xQg=";
2321
};
2422

25-
patches = [
26-
./conf.patch
27-
28-
# gcc-13 build fixes:
29-
# https://github.com/matlo/GIMX/pull/705
30-
(fetchpatch {
31-
name = "gcc-13-headers.patch";
32-
url = "https://github.com/matlo/GIMX/commit/4525dff4d9af672116d8c6c182707f2ad6295b2d.patch";
33-
hash = "sha256-LkswnFsxqADooa09yO7Yf0AbxTrGfjBObyv/6FQJvRs=";
34-
})
35-
(fetchpatch {
36-
name = "gcc-13-protos.patch";
37-
url = "https://github.com/matlo/GIMX/commit/f11855fcb8bd9d0cb9c94871b4111ddfd5b610df.patch";
38-
hash = "sha256-JL67UUsEyPcOuaimJtMviiGLGghuq9665Lg1QuiaWUU=";
39-
})
40-
];
23+
env.NIX_CFLAGS_COMPILE = "-Wno-error";
24+
patches = [ ./conf.patch ./gcc14.patch ];
4125

4226
nativeBuildInputs = [ makeWrapper ];
43-
buildInputs = [
44-
curl libusb1 bluez libxml2 ncurses5 libmhash
45-
xorg.libX11 xorg.libXi xorg.libXext
46-
];
47-
48-
postPatch = lib.optionals gimxPdpGamepad ''
49-
substituteInPlace ./shared/gimxcontroller/include/x360.h \
50-
--replace "0x045e" "0x0e6f" --replace "0x028e" "0x0213"
51-
substituteInPlace ./loader/firmware/EMU360.hex \
52-
--replace "1B210001" "1B211001" \
53-
--replace "09210001" "09211001" \
54-
--replace "5E048E021001" "6F0E13020001"
55-
'';
56-
27+
buildInputs = [ curl libusb1 bluez libxml2 ncurses5 libmhash xorg.libX11 xorg.libXi ];
5728
makeFlags = [ "build-core" ];
5829

59-
env.NIX_CFLAGS_COMPILE = toString [
60-
# Needed with GCC 12
61-
"-Wno-error=address"
62-
"-Wno-error=deprecated-declarations"
63-
"-Wno-error=use-after-free"
64-
];
65-
6630
installPhase = ''
6731
runHook preInstall
6832
6933
mkdir -p $out
70-
substituteInPlace ./core/Makefile --replace "chmod ug+s" "echo"
71-
34+
substituteInPlace ./core/Makefile --replace-fail "chmod ug+s" "echo"
7235
export DESTDIR="$out"
7336
make install-shared install-core
7437
mv $out/usr/lib $out/lib
7538
mv $out/usr/bin $out/bin
76-
rmdir $out/usr
39+
cp -r ${gimx-config}/Linux $out/share
7740
78-
runHook postInstall
79-
'';
80-
81-
postInstall = ''
82-
mkdir -p $out/share
83-
cp -r ./loader/firmware $out/share/firmware
84-
cp -r ${gimx-config}/Linux $out/share/config
85-
cp -r ${./custom} $out/share/custom
41+
makeWrapper $out/bin/gimx $out/bin/gimx-ds4 \
42+
--add-flags "--nograb" --add-flags "-p /dev/ttyUSB0" \
43+
--add-flags "-c $out/share/Dualshock4.xml"
8644
87-
makeWrapper $out/bin/gimx $out/bin/gimx-dualshock4 \
88-
--set GIMXCONF 1 --add-flags "--nograb" --add-flags "-p /dev/ttyUSB0" \
89-
--add-flags "-c $out/share/custom/Dualshock4.xml"
90-
91-
makeWrapper $out/bin/gimx $out/bin/gimx-xboxonepad \
92-
--set GIMXCONF 1 --add-flags "--nograb" --add-flags "-p /dev/ttyUSB0" \
93-
--add-flags "-c $out/share/config/XOnePadUsb.xml"
45+
runHook postInstall
9446
'';
9547

9648
meta = with lib; {
9749
homepage = "https://github.com/matlo/GIMX";
9850
description = "Game Input Multiplexer";
9951
license = licenses.gpl3Only;
10052
platforms = platforms.linux;
101-
maintainers = with maintainers; [ bb2020 ];
10253
};
10354
}

pkgs/games/gimx/gcc14.patch

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
diff --git a/core/config_reader.c b/core/config_reader.c
2+
index 451fc48..737d27c 100644
3+
--- a/core/config_reader.c
4+
+++ b/core/config_reader.c
5+
@@ -17,7 +17,7 @@
6+
#include "../directories.h"
7+
#include "macros.h"
8+
#include <errno.h>
9+
-
10+
+#include <stdlib.h>
11+
/*
12+
* These variables are used to read the configuration.
13+
*/
14+
diff --git a/core/gimx.c b/core/gimx.c
15+
index 700cae9..693f72f 100755
16+
--- a/core/gimx.c
17+
+++ b/core/gimx.c
18+
@@ -8,7 +8,7 @@
19+
#include <errno.h> //to print errors
20+
#include <string.h> //to print errors
21+
#include <limits.h> //PATH_MAX
22+
-
23+
+#include <stdlib.h>
24+
#ifndef WIN32
25+
#include <termios.h> //to disable/enable echo
26+
#include <unistd.h>

0 commit comments

Comments
 (0)