Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d465db0055 | ||
|
|
2eb48907a0 | ||
|
|
479c77d251 | ||
|
|
e32cac5666 | ||
|
|
93a967ec15 | ||
|
|
db6b5b027c | ||
|
|
76b7d4dafc | ||
|
|
f7df9ab90e | ||
|
|
5781518f44 | ||
|
|
ce05f0d78b | ||
|
|
7415ecf85f | ||
|
|
6b84a85639 | ||
|
|
38e13be623 | ||
|
|
2433417cf6 | ||
|
|
5b1ac7c74a | ||
|
|
24a5811b07 | ||
|
|
00a177fd2f | ||
|
|
acd52f78dd | ||
|
|
0b1014763e | ||
|
|
37c8fb94d4 | ||
|
|
ec1690b49d | ||
|
|
7478e4e010 | ||
|
|
bcb633e774 | ||
|
|
ac6c996602 | ||
|
|
fb0ab4b96b | ||
|
|
7cde3b39fa | ||
|
|
270bf256b7 | ||
|
|
70f0ca1b50 |
@@ -2,16 +2,13 @@ name: Make Packages
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "master" ]
|
||||
tags: [ "*" ]
|
||||
pull_request:
|
||||
branches: [ "master" ]
|
||||
|
||||
jobs:
|
||||
build-monocoque:
|
||||
build-monocoque-debs:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, debian-latest]
|
||||
os: [ubuntu-latest, debian-latest, debian-stable]
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
|
||||
@@ -19,9 +16,7 @@ jobs:
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- uses: kenchan0130/actions-system-info@master
|
||||
id: system-info
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v1
|
||||
- name: Checkout submodules
|
||||
run: git submodule update --init --recursive
|
||||
- name: Update apt
|
||||
@@ -52,7 +47,7 @@ jobs:
|
||||
mkdir PKG_SOURCE
|
||||
mkdir -p PKG_SOURCE/DEBIAN
|
||||
mkdir -p PKG_SOURCE/usr/bin/
|
||||
cp ./tools/distro/debian/dpkg/control ./PKG_SOURCE/DEBIAN/control
|
||||
cp ./tools/distro/debian/dpkg/${{ matrix.os }}/control ./PKG_SOURCE/DEBIAN/control
|
||||
cp ./build/monocoque ./PKG_SOURCE/usr/bin/monocoque
|
||||
dpkg-deb --build PKG_SOURCE monocoque-${{ matrix.os }}.deb
|
||||
|
||||
@@ -60,3 +55,27 @@ jobs:
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
files: monocoque-${{ matrix.os }}.deb
|
||||
|
||||
|
||||
build-monocoque-rpms:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [fedora-43]
|
||||
runs-on: ${{ matrix.os }}
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
|
||||
- name: create rpmbuild dirs
|
||||
run: mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
|
||||
- name: get spec file
|
||||
run: curl -o ~/fedora.spec https://raw.githubusercontent.com/Spacefreak18/monocoque/refs/heads/master/tools/distro/fedora/rpm/fedora.spec
|
||||
- name: run spec file
|
||||
run: rpmbuild -ba ~/fedora.spec
|
||||
- name: rename file
|
||||
run: cp ~/rpmbuild/RPMS/x86_64/monocoque-0.0.5-1.x86_64.rpm $GITHUB_WORKSPACE/monocoque-${{ matrix.os }}.rpm
|
||||
- name: Release the Package
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
files: monocoque-${{ matrix.os }}.rpm
|
||||
|
||||
|
||||
@@ -21,6 +21,10 @@ Cross Platform device manager for driving and flight simulators, for use with co
|
||||
- Convincing shaker effects for noise tranducers for wheel slip, wheel lock, and abs, as well as engine rpm and gear shifts.
|
||||
- Support for many [wheels and pedals](https://spacefreak18.github.io/simapi/thirdpartydevices) including Clubsport Elite V3, [Logitech G29](https://spacefreak18.github.io/simapi/logitechg29), and Moza R5.
|
||||
|
||||
## Adding More Devices
|
||||
- If a device isn't already supported, feel free to assist in the reverse engineering process by submitting a pcap or even better working code in a pull request!
|
||||
https://santeri.pikarinen.com/pages/usb_hid_reverse_engineering/
|
||||
|
||||
## Quick Install
|
||||
|
||||
**One-Line Installation:**
|
||||
|
||||
@@ -26,6 +26,7 @@ configs = (
|
||||
modulation = "frequency";
|
||||
frequency = 17;
|
||||
frequencyMax = 37;
|
||||
noise = 10; // additive noise in Hz
|
||||
},
|
||||
{
|
||||
device = "Sound";
|
||||
|
||||
@@ -30,11 +30,11 @@ bool hasTyreDiameter(SimData* simdata)
|
||||
return true;
|
||||
}
|
||||
|
||||
int loadtyreconfig(SimData* simdata, char* configfile)
|
||||
int loadtyreconfig(SimData* simdata, char* configfile, bool setDiameters)
|
||||
{
|
||||
config_t cfg;
|
||||
config_init(&cfg);
|
||||
config_setting_t* config_cars = NULL;
|
||||
const config_setting_t* config_cars = NULL;
|
||||
|
||||
if (!config_read_file(&cfg, configfile))
|
||||
{
|
||||
@@ -53,8 +53,9 @@ int loadtyreconfig(SimData* simdata, char* configfile)
|
||||
}
|
||||
slogt("parsing diameters config file");
|
||||
|
||||
int cars = config_setting_length(config_cars);
|
||||
const int cars = config_setting_length(config_cars);
|
||||
|
||||
bool foundCar = false;
|
||||
int i = 0;
|
||||
while (i<cars)
|
||||
{
|
||||
@@ -94,10 +95,15 @@ int loadtyreconfig(SimData* simdata, char* configfile)
|
||||
if (strcicmp(car, simdata->car) == 0 && sim == simdata->simexe)
|
||||
{
|
||||
slogi("found saved car %s with tyre diameters %f %f %f %f", car, tyre0, tyre1, tyre2, tyre3);
|
||||
simdata->tyrediameter[0] = tyre0;
|
||||
simdata->tyrediameter[1] = tyre1;
|
||||
simdata->tyrediameter[2] = tyre2;
|
||||
simdata->tyrediameter[3] = tyre3;
|
||||
foundCar = true;
|
||||
if(setDiameters == true)
|
||||
{
|
||||
simdata->tyrediameter[0] = tyre0;
|
||||
simdata->tyrediameter[1] = tyre1;
|
||||
simdata->tyrediameter[2] = tyre2;
|
||||
simdata->tyrediameter[3] = tyre3;
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -113,7 +119,11 @@ int loadtyreconfig(SimData* simdata, char* configfile)
|
||||
|
||||
config_destroy(&cfg);
|
||||
|
||||
return 0;
|
||||
if(foundCar == true)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
int savetyreconfig(SimData* simdata, char* configfile)
|
||||
@@ -194,11 +204,6 @@ double slipeffect(SimData* simdata, int effecttype, int tyre, double threshold,
|
||||
wheelslip[2] = 0;
|
||||
wheelslip[3] = 0;
|
||||
|
||||
if(simdata->car == NULL || simdata->car[0] == 0)
|
||||
{
|
||||
useconfig = 0;
|
||||
}
|
||||
|
||||
slogt("wheel vibration calculation with wheel config set to %i configchecked %i configfile %s car %s sim %i", useconfig, *configcheck, configfile, simdata->car, simdata->simexe);
|
||||
|
||||
switch (effecttype)
|
||||
@@ -207,31 +212,7 @@ double slipeffect(SimData* simdata, int effecttype, int tyre, double threshold,
|
||||
case (EFFECT_TYRELOCK):
|
||||
case (EFFECT_ABSBRAKES):
|
||||
|
||||
if(useconfig == 1 && configfile != NULL)
|
||||
{
|
||||
// check for saved tyre diameter in config file
|
||||
// if not saved version exists get tyre diameter and save it
|
||||
// use config check variable to track if the config check has been performed
|
||||
// avoid many opens of the same file
|
||||
int error = 0;
|
||||
if(hasTyreDiameter(simdata)==false && *configcheck == 0)
|
||||
{
|
||||
slogi("attempting load of tyre diameter config");
|
||||
error = loadtyreconfig(simdata, configfile);
|
||||
*configcheck = 1;
|
||||
}
|
||||
|
||||
if(hasTyreDiameter(simdata)==false)
|
||||
{
|
||||
slogt("could not find tyre diameter in config file, attempting to calculate new");
|
||||
getTyreDiameter(simdata);
|
||||
if(hasTyreDiameter(simdata)==true)
|
||||
{
|
||||
slogi("saving tyre config");
|
||||
error = savetyreconfig(simdata, configfile);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(hasTyreDiameter(simdata)==true)
|
||||
{
|
||||
double Speedms = kmhtoms * simdata->velocity;
|
||||
|
||||
@@ -17,5 +17,9 @@ typedef struct
|
||||
HapticEffect;
|
||||
|
||||
double slipeffect(SimData* simdata, int effecttype, int tyre, double threshold, int useconfig, int* configcheck, char* configfile);
|
||||
bool hasTyreDiameter(SimData* simdata);
|
||||
int loadtyreconfig(SimData* simdata, char* configfile, bool setDiameters);
|
||||
int savetyreconfig(SimData* simdata, char* configfile);
|
||||
void getTyreDiameter(SimData* simdata);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -19,10 +19,8 @@ int setupsound()
|
||||
slogi("connecting pulseaudio...");
|
||||
// Get a mainloop and its context
|
||||
mainloop = pa_threaded_mainloop_new();
|
||||
assert(mainloop);
|
||||
mainloop_api = pa_threaded_mainloop_get_api(mainloop);
|
||||
context = pa_context_new(mainloop_api, "Monocoque");
|
||||
assert(context);
|
||||
|
||||
pa_context_set_state_callback(context, &context_state_cb, mainloop);
|
||||
|
||||
@@ -30,13 +28,12 @@ int setupsound()
|
||||
pa_threaded_mainloop_lock(mainloop);
|
||||
|
||||
// Start the mainloop
|
||||
assert(pa_threaded_mainloop_start(mainloop) == 0);
|
||||
assert(pa_context_connect(context, NULL, PA_CONTEXT_NOAUTOSPAWN, NULL) == 0);
|
||||
pa_threaded_mainloop_start(mainloop);
|
||||
pa_context_connect(context, NULL, 0, NULL);
|
||||
|
||||
// Wait for the context to be ready
|
||||
for(;;) {
|
||||
pa_context_state_t context_state = pa_context_get_state(context);
|
||||
assert(PA_CONTEXT_IS_GOOD(context_state));
|
||||
if (context_state == PA_CONTEXT_READY) break;
|
||||
pa_threaded_mainloop_wait(mainloop);
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ int patestCallbackGearShift(const void* inputBuffer,
|
||||
data->curr_duration += 1.0 / SAMPLE_RATE;
|
||||
if (data->curr_duration >= data->duration) {
|
||||
data->curr_duration = 0.0;
|
||||
data->curr_frequency = 0;
|
||||
data->curr_frequency = 0.0;
|
||||
}
|
||||
|
||||
*out++ = sample;
|
||||
|
||||
@@ -16,6 +16,15 @@
|
||||
#define M_PI (3.14159265)
|
||||
#endif
|
||||
|
||||
static double apply_noise(double base_freq, double noise_amount) {
|
||||
if (noise_amount > 0.0) {
|
||||
double r = (double) rand() / RAND_MAX * 2.0 - 1.0;
|
||||
return base_freq + r * noise_amount;
|
||||
} else {
|
||||
return base_freq;
|
||||
}
|
||||
}
|
||||
|
||||
void gear_sound_stream(pa_stream *s, size_t length, void *userdata) {
|
||||
|
||||
SoundData* data = (SoundData*)userdata;
|
||||
@@ -24,59 +33,75 @@ void gear_sound_stream(pa_stream *s, size_t length, void *userdata) {
|
||||
|
||||
|
||||
for (size_t i = 0; i < num_samples; i++) {
|
||||
static double t = 0.0;
|
||||
double sample = 0;
|
||||
if (data->frequency>0)
|
||||
{
|
||||
sample = ((double)data->curr_amplitude/100) * 32767.0 * sin(2.0 * M_PI * data->curr_frequency * data->curr_duration);
|
||||
}
|
||||
|
||||
double sample = 0;
|
||||
|
||||
if (data->curr_frequency>0.0)
|
||||
{
|
||||
double t = data->phase;
|
||||
double a = (double)data->curr_amplitude/100;
|
||||
|
||||
// fade-out 5ms to prevent discontinuity
|
||||
static double fade_out_duration = 0.005;
|
||||
|
||||
double remaining = data->duration - data->curr_duration;
|
||||
if (remaining < fade_out_duration) {
|
||||
a *= remaining / fade_out_duration;
|
||||
}
|
||||
|
||||
sample = a * 32767.0 * sin(2.0 * M_PI * t);
|
||||
|
||||
double f = apply_noise(data->curr_frequency, data->noise);
|
||||
|
||||
t += f / SAMPLE_RATE;
|
||||
if (t >= 1.0) {
|
||||
t -= floor(t);
|
||||
}
|
||||
|
||||
data->phase = t;
|
||||
|
||||
data->curr_duration += 1.0 / SAMPLE_RATE;
|
||||
if (data->curr_duration >= data->duration) {
|
||||
data->curr_duration = 0.0;
|
||||
data->curr_frequency = 0.0;
|
||||
data->phase = 0.0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
buffer[i] = (int16_t)sample;
|
||||
|
||||
data->curr_duration += 1.0 / SAMPLE_RATE;
|
||||
if (data->curr_duration >= data->duration) {
|
||||
data->curr_duration = 0.0;
|
||||
data->curr_frequency = 0;
|
||||
}
|
||||
}
|
||||
pa_stream_write(s, buffer, length, NULL, 0LL, PA_SEEK_RELATIVE);
|
||||
}
|
||||
|
||||
double get_closest_frequency(size_t num_samples, double input_frequency) {
|
||||
|
||||
double samples_per_cycle = SAMPLE_RATE / input_frequency;
|
||||
|
||||
double adjusted_frequency = SAMPLE_RATE / (num_samples / floor(num_samples/samples_per_cycle) );
|
||||
|
||||
return adjusted_frequency;
|
||||
}
|
||||
|
||||
void engine_sound_stream(pa_stream *s, size_t length, void *userdata) {
|
||||
|
||||
SoundData* data = (SoundData*)userdata;
|
||||
double freq = data->curr_frequency;
|
||||
|
||||
size_t num_samples = length / sizeof(int16_t);
|
||||
freq = get_closest_frequency( num_samples, freq );
|
||||
|
||||
//size_t num_samples = (size_t) (DURATION * SAMPLE_RATE);
|
||||
int16_t buffer[num_samples];
|
||||
|
||||
//double t = 0;
|
||||
for (size_t i = 0; i < num_samples; i++) {
|
||||
|
||||
double t = data->phase;
|
||||
|
||||
double sample = ((double)data->curr_amplitude/100) * 32767.0 * sin( 2.0 * M_PI * freq * t );
|
||||
double sample = ((double)data->curr_amplitude/100) * 32767.0 * sin( 2.0 * M_PI * t );
|
||||
|
||||
buffer[i] = (int16_t)sample;
|
||||
|
||||
t += 1.0 / SAMPLE_RATE;
|
||||
if (t >= SAMPLE_RATE) {
|
||||
t = 0;
|
||||
double f = apply_noise(data->curr_frequency, data->noise);
|
||||
|
||||
t += f / SAMPLE_RATE;
|
||||
if (t >= 1.0) {
|
||||
t -= floor(t);
|
||||
}
|
||||
|
||||
data->phase = t;
|
||||
}
|
||||
data->phase = round(data->phase);
|
||||
|
||||
pa_stream_write(s, buffer, length, NULL, 0LL, PA_SEEK_RELATIVE);
|
||||
}
|
||||
@@ -166,7 +191,7 @@ int usb_generic_shaker_init(SoundDevice* sounddevice, pa_threaded_mainloop* main
|
||||
// recommended settings, i.e. server uses sensible values
|
||||
pa_buffer_attr buffer_attr;
|
||||
buffer_attr.maxlength = (uint32_t) 32767;
|
||||
buffer_attr.tlength = (uint32_t) -1;
|
||||
buffer_attr.tlength = (uint32_t) 2048;
|
||||
buffer_attr.prebuf = (uint32_t) -1;
|
||||
buffer_attr.minreq = (uint32_t) -1;
|
||||
|
||||
@@ -182,14 +207,14 @@ int usb_generic_shaker_init(SoundDevice* sounddevice, pa_threaded_mainloop* main
|
||||
// for now i'm only supporting playing on one specified channel which is the concept you should build your setups around
|
||||
cv.values[pan] = channel_volume;
|
||||
|
||||
assert(pa_stream_connect_playback(stream, devname, &buffer_attr, stream_flags, &cv, NULL) == 0);
|
||||
pa_stream_connect_playback(stream, devname, &buffer_attr, stream_flags, &cv, NULL);
|
||||
//pa_stream_connect_playback(stream, devname, &buffer_attr, stream_flags, &cv, NULL);
|
||||
|
||||
// Wait for the stream to be ready
|
||||
for(;;)
|
||||
{
|
||||
pa_stream_state_t stream_state = pa_stream_get_state(stream);
|
||||
assert(PA_STREAM_IS_GOOD(stream_state));
|
||||
PA_STREAM_IS_GOOD(stream_state);
|
||||
//PA_STREAM_IS_GOOD(stream_state);
|
||||
if (stream_state == PA_STREAM_READY) break;
|
||||
pa_threaded_mainloop_wait(mainloop);
|
||||
|
||||
@@ -26,7 +26,7 @@ int gear_sound_set(SoundDevice* sounddevice, SimData* simdata)
|
||||
}
|
||||
sounddevice->sounddata.last_gear = simdata->gear;
|
||||
|
||||
slogt("set gear frequency to %i", sounddevice->sounddata.curr_frequency);
|
||||
slogt("set gear frequency to %f", sounddevice->sounddata.curr_frequency);
|
||||
}
|
||||
|
||||
|
||||
@@ -37,9 +37,9 @@ double modulate(SoundDevice* sounddevice, double raw_effect, SoundEffectModulati
|
||||
{
|
||||
case SOUND_EFFECT_MODULATION_FREQUENCY:
|
||||
modulated_effect = ((sounddevice->sounddata.frequencyMax - sounddevice->sounddata.frequency) * raw_effect) + sounddevice->sounddata.frequency;
|
||||
sounddevice->sounddata.curr_frequency = trunc(modulated_effect);
|
||||
sounddevice->sounddata.curr_frequency = modulated_effect;
|
||||
sounddevice->sounddata.curr_amplitude = sounddevice->sounddata.amplitude;
|
||||
slogt("set curr frequency to %i from raw effect %f and base frequency %i", sounddevice->sounddata.curr_frequency, raw_effect, sounddevice->sounddata.frequency);
|
||||
slogt("set curr frequency to %f from raw effect %f and base frequency %i", sounddevice->sounddata.curr_frequency, raw_effect, sounddevice->sounddata.frequency);
|
||||
break;
|
||||
case SOUND_EFFECT_MODULATION_AMPLIFY:
|
||||
modulated_effect = ((sounddevice->sounddata.amplitudeMax - sounddevice->sounddata.amplitude) * raw_effect) + sounddevice->sounddata.amplitude;
|
||||
@@ -80,7 +80,7 @@ int sounddev_tyreslip_update(SimDevice* this, SimData* simdata)
|
||||
}
|
||||
else
|
||||
{
|
||||
sounddevice->sounddata.curr_frequency = 0;
|
||||
sounddevice->sounddata.curr_frequency = 0.0;
|
||||
sounddevice->sounddata.curr_amplitude = 0;
|
||||
sounddevice->sounddata.curr_duration = 0;
|
||||
}
|
||||
@@ -100,7 +100,7 @@ int sounddev_tyrelock_update(SimDevice* this, SimData* simdata)
|
||||
}
|
||||
else
|
||||
{
|
||||
sounddevice->sounddata.curr_frequency = 0;
|
||||
sounddevice->sounddata.curr_frequency = 0.0;
|
||||
sounddevice->sounddata.curr_amplitude = 0;
|
||||
sounddevice->sounddata.curr_duration = 0;
|
||||
}
|
||||
@@ -118,7 +118,7 @@ int sounddev_absbrakes_update(SimDevice* this, SimData* simdata)
|
||||
}
|
||||
else
|
||||
{
|
||||
sounddevice->sounddata.curr_frequency = 0;
|
||||
sounddevice->sounddata.curr_frequency = 0.0;
|
||||
sounddevice->sounddata.curr_amplitude = 0;
|
||||
sounddevice->sounddata.curr_duration = 0;
|
||||
}
|
||||
@@ -138,7 +138,7 @@ int sounddev_suspension_update(SimDevice* this, SimData* simdata)
|
||||
}
|
||||
else
|
||||
{
|
||||
sounddevice->sounddata.curr_frequency = 0;
|
||||
sounddevice->sounddata.curr_frequency = 0.0;
|
||||
sounddevice->sounddata.curr_amplitude = 0;
|
||||
sounddevice->sounddata.curr_duration = 0;
|
||||
}
|
||||
@@ -177,6 +177,7 @@ int sounddev_init(SoundDevice* sounddevice, const char* devname, MonocoqueTyreId
|
||||
slogi("pan is: %i", sds.pan);
|
||||
slogi("channels is: %i", sds.channels);
|
||||
slogi("duration is: %f", sds.duration);
|
||||
slogi("noise is: %i", sds.noise);
|
||||
|
||||
|
||||
sounddevice->modulationType = sds.modulation;
|
||||
@@ -184,12 +185,13 @@ int sounddev_init(SoundDevice* sounddevice, const char* devname, MonocoqueTyreId
|
||||
sounddevice->sounddata.frequencyMax = sds.frequencyMax;
|
||||
sounddevice->sounddata.amplitude = sds.amplitude;
|
||||
sounddevice->sounddata.amplitudeMax = sds.amplitudeMax;
|
||||
sounddevice->sounddata.noise = (double)sds.noise;
|
||||
sounddevice->sounddata.curr_duration = 0;
|
||||
|
||||
sounddevice->sounddata.phase = 0;
|
||||
|
||||
sounddevice->sounddata.curr_amplitude = 0;
|
||||
sounddevice->sounddata.curr_frequency = 0;
|
||||
sounddevice->sounddata.curr_frequency = 0.0;
|
||||
|
||||
|
||||
const char* streamname= "Engine";
|
||||
|
||||
@@ -26,10 +26,11 @@ typedef struct
|
||||
uint32_t amplitude;
|
||||
uint32_t amplitudeMax;
|
||||
double duration;
|
||||
uint32_t curr_frequency;
|
||||
double curr_frequency;
|
||||
uint32_t curr_amplitude;
|
||||
double curr_duration;
|
||||
double phase;
|
||||
double noise;
|
||||
}
|
||||
SoundData;
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "loopdata.h"
|
||||
#include "../helper/confighelper.h"
|
||||
#include "../devices/simdevice.h"
|
||||
#include "../devices/hapticeffect.h"
|
||||
#include "../simulatorapi/simapi/simapi/simdata.h"
|
||||
#include "../simulatorapi/simapi/simapi/simmapper.h"
|
||||
#include "../slog/slog.h"
|
||||
@@ -38,6 +39,15 @@ void showstatscallback(uv_timer_t* handle);
|
||||
void datacheckcallback(uv_timer_t* handle);
|
||||
void startdatalogger(MonocoqueSettings* ms, loop_data* l);
|
||||
|
||||
static void close_walk_cb(uv_handle_t* handle, void* arg)
|
||||
{
|
||||
if (!uv_is_closing(handle))
|
||||
{
|
||||
uv_close(handle, NULL);
|
||||
}
|
||||
}
|
||||
#define ASSERT(expr) expr
|
||||
|
||||
int showstats(SimData* simdata)
|
||||
{
|
||||
printf("\r");
|
||||
@@ -298,6 +308,30 @@ void looprun(MonocoqueSettings* ms, loop_data* f, SimData* simdata)
|
||||
// devices[x].update(&devices[x], simdata);
|
||||
// }
|
||||
//}
|
||||
|
||||
if(f->ms->useconfig == 1 && f->ms->tyre_diameter_config != NULL)
|
||||
{
|
||||
if(simdata->car != NULL || simdata->car[0] != 0)
|
||||
{
|
||||
// check for saved tyre diameter in config file
|
||||
// if not saved version exists get tyre diameter and save it
|
||||
// use config check variable to track if the config check has been performed
|
||||
// avoid many opens of the same file
|
||||
int error = 0;
|
||||
if(hasTyreDiameter(simdata)==false && f->ms->configcheck == 0)
|
||||
{
|
||||
slogi("attempting load of tyre diameter config");
|
||||
error = loadtyreconfig(simdata, f->ms->tyre_diameter_config, true);
|
||||
f->ms->configcheck = 1;
|
||||
}
|
||||
|
||||
if(hasTyreDiameter(simdata)==false)
|
||||
{
|
||||
slogt("could not find tyre diameter in config file, attempting to calculate new");
|
||||
getTyreDiameter(simdata);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -314,14 +348,34 @@ void showstatscallback(uv_timer_t* handle)
|
||||
|
||||
void releaseloop(loop_data* f, SimData* simdata, SimMap* simmap)
|
||||
{
|
||||
|
||||
slogi("release loop");
|
||||
if(f->releasing == false)
|
||||
{
|
||||
f->releasing = true;
|
||||
uv_udp_recv_stop(&recv_socket);
|
||||
uv_timer_stop(&datamaptimer);
|
||||
uv_timer_stop(&showstatstimer);
|
||||
if (uv_is_active((uv_handle_t*)&recv_socket))
|
||||
{
|
||||
uv_udp_recv_stop(&recv_socket);
|
||||
}
|
||||
// Close the socket handle so it can be reinitialized with a different port
|
||||
//if (!uv_is_closing((uv_handle_t*)&recv_socket))
|
||||
//{
|
||||
// uv_close((uv_handle_t*)&recv_socket, NULL);
|
||||
//}
|
||||
slogi("releasing devices, please wait");
|
||||
|
||||
//attempt tyre diameter saving
|
||||
if(hasTyreDiameter(simdata) == true)
|
||||
{
|
||||
int a = loadtyreconfig(simdata, f->ms->tyre_diameter_config, false);
|
||||
if(a < 0)
|
||||
{
|
||||
slogi("saving new tyre diameter config");
|
||||
savetyreconfig(simdata, f->ms->tyre_diameter_config);
|
||||
}
|
||||
}
|
||||
|
||||
f->uion = false;
|
||||
SimDevice* devices = f->simdevices;
|
||||
int numdevices = f->numdevices;
|
||||
@@ -371,7 +425,8 @@ void releaseloop(loop_data* f, SimData* simdata, SimMap* simmap)
|
||||
|
||||
if(appstate > 0)
|
||||
{
|
||||
uv_timer_start(&datachecktimer, datacheckcallback, 3000, 1000);
|
||||
slogi("restarting checking for data...");
|
||||
uv_timer_start(&datachecktimer, datacheckcallback, 0, 1000);
|
||||
}
|
||||
f->releasing = false;
|
||||
if(appstate > 1)
|
||||
@@ -456,7 +511,6 @@ void udpstart(MonocoqueSettings* sms, loop_data* f, SimData* simdata, SimMap* si
|
||||
{
|
||||
if (appstate == 2)
|
||||
{
|
||||
fprintf(stderr, "udpstart\n");
|
||||
simdatamap(simdata, simmap, NULL, f->sim, true, NULL);
|
||||
if (doui == true)
|
||||
{
|
||||
@@ -503,6 +557,7 @@ void datacheckcallback(uv_timer_t* handle)
|
||||
udpstart(f->ms, f, simdata, simmap);
|
||||
uv_udp_recv_start(&recv_socket, on_alloc, on_udp_recv);
|
||||
slogt("udp receive loop started");
|
||||
uv_timer_stop(handle);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -510,7 +565,7 @@ void datacheckcallback(uv_timer_t* handle)
|
||||
slogd("starting telemetry mapping at %i fps (%i ms ticks)", f->ms->fps, interval);
|
||||
uv_timer_start(&datamaptimer, shmdatamapcallback, 2000, interval);
|
||||
}
|
||||
//uv_timer_stop(handle);
|
||||
//uv_timer_start(&datachecktimer, datacheckcallback, 0, 3000);
|
||||
}
|
||||
if(appstate == 2)
|
||||
{
|
||||
@@ -525,7 +580,7 @@ void datacheckcallback(uv_timer_t* handle)
|
||||
|
||||
if (appstate == 0)
|
||||
{
|
||||
slogi("stopping checking for data");
|
||||
slogi("stopped checking for data");
|
||||
uv_timer_stop(handle);
|
||||
}
|
||||
}
|
||||
@@ -550,6 +605,10 @@ void cb(uv_poll_t* handle, int status, int events)
|
||||
if (appstate == 0)
|
||||
{
|
||||
slogi("Monocoque is exiting...");
|
||||
uv_udp_recv_stop(&recv_socket);
|
||||
uv_timer_stop(&datamaptimer);
|
||||
uv_timer_stop(&showstatstimer);
|
||||
// at this point these below should be the only active threads
|
||||
uv_timer_stop(&datachecktimer);
|
||||
uv_poll_stop(handle);
|
||||
}
|
||||
@@ -584,36 +643,43 @@ int monocoque_mainloop(MonocoqueSettings* ms)
|
||||
baton->releasing = false;
|
||||
baton->sim = 0;
|
||||
baton->req.data = (void*) baton;
|
||||
uv_handle_set_data((uv_handle_t*) &datachecktimer, (void*) baton);
|
||||
uv_handle_set_data((uv_handle_t*) &datamaptimer, (void*) baton);
|
||||
uv_handle_set_data((uv_handle_t*) &showstatstimer, (void*) baton);
|
||||
uv_handle_set_data((uv_handle_t*) &recv_socket, (void*) baton);
|
||||
uv_handle_set_data((uv_handle_t*) poll, (void*) baton);
|
||||
appstate = 1;
|
||||
slogd("setting initial app state");
|
||||
uv_timer_init(uv_default_loop(), &datachecktimer);
|
||||
uv_timer_init(uv_default_loop(), &showstatstimer);
|
||||
fprintf(stdout, "Searching for sim data... Press q to quit...\n");
|
||||
uv_timer_start(&datachecktimer, datacheckcallback, 1000, 1000);
|
||||
|
||||
set_simapi_log_info(simapilib_loginfo);
|
||||
set_simapi_log_debug(simapilib_logdebug);
|
||||
set_simapi_log_trace(simapilib_logtrace);
|
||||
|
||||
|
||||
if (0 != uv_poll_init(uv_default_loop(), poll, 0))
|
||||
{
|
||||
return 1;
|
||||
};
|
||||
uv_timer_init(uv_default_loop(), &datachecktimer);
|
||||
uv_timer_init(uv_default_loop(), &showstatstimer);
|
||||
uv_timer_init(uv_default_loop(), &datamaptimer);
|
||||
slogd("setting initial app state");
|
||||
appstate = 1;
|
||||
|
||||
uv_handle_set_data((uv_handle_t*) &datachecktimer, (void*) baton);
|
||||
uv_handle_set_data((uv_handle_t*) &datamaptimer, (void*) baton);
|
||||
uv_handle_set_data((uv_handle_t*) &showstatstimer, (void*) baton);
|
||||
uv_handle_set_data((uv_handle_t*) &recv_socket, (void*) baton);
|
||||
uv_handle_set_data((uv_handle_t*) poll, (void*) baton);
|
||||
|
||||
if (0 != uv_poll_start(poll, UV_READABLE, cb))
|
||||
{
|
||||
return 2;
|
||||
};
|
||||
uv_timer_start(&datachecktimer, datacheckcallback, 1000, 1000);
|
||||
|
||||
|
||||
uv_timer_init(uv_default_loop(), &datamaptimer);
|
||||
|
||||
fprintf(stdout, "Searching for sim data... Press q to quit...\n");
|
||||
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
|
||||
|
||||
uv_stop(uv_default_loop());
|
||||
//uv_walk(uv_default_loop(), close_walk_cb, NULL);
|
||||
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
|
||||
uv_loop_close(uv_default_loop());
|
||||
uv_library_shutdown();
|
||||
slogi("All threads stopped...");
|
||||
|
||||
fprintf(stdout, "\n");
|
||||
fflush(stdout);
|
||||
tcsetattr(0, TCSANOW, &canonicalmode);
|
||||
@@ -660,7 +726,35 @@ int tester(SimDevice* devices, int numdevices)
|
||||
simdata->Yvelocity = 100;
|
||||
simdata->Zvelocity = 0;
|
||||
|
||||
sleep(3);
|
||||
sleep(1);
|
||||
|
||||
fprintf(stdout, "Revving rpm from 1000 to 8000 and back\n");
|
||||
|
||||
for (int r = 0; r < 8000; r += 3)
|
||||
{
|
||||
simdata->rpms = 1000 + r;
|
||||
for (int x = 0; x < numdevices; x++)
|
||||
{
|
||||
if (devices[x].initialized == true)
|
||||
{
|
||||
devices[x].update(&devices[x], simdata);
|
||||
}
|
||||
}
|
||||
usleep(1000);
|
||||
}
|
||||
|
||||
for (int r = 0; r < 8000; r += 3)
|
||||
{
|
||||
simdata->rpms = 9000 - r;
|
||||
for (int x = 0; x < numdevices; x++)
|
||||
{
|
||||
if (devices[x].initialized == true)
|
||||
{
|
||||
devices[x].update(&devices[x], simdata);
|
||||
}
|
||||
}
|
||||
usleep(1000);
|
||||
}
|
||||
|
||||
fprintf(stdout, "Setting rpms to 1000\n");
|
||||
simdata->rpms = 1000;
|
||||
|
||||
@@ -747,6 +747,7 @@ int devsetup(const char* device_type, const char* device_subtype, const char* co
|
||||
ds->sounddevsettings.pan = 0;
|
||||
ds->sounddevsettings.channels = 1;
|
||||
ds->sounddevsettings.duration = 2.0;
|
||||
ds->sounddevsettings.noise = 0;
|
||||
if (ds->effect_type == EFFECT_GEARSHIFT)
|
||||
{
|
||||
ds->sounddevsettings.duration = .125;
|
||||
@@ -762,6 +763,7 @@ int devsetup(const char* device_type, const char* device_subtype, const char* co
|
||||
config_setting_lookup_int(device_settings, "pan", &ds->sounddevsettings.pan);
|
||||
config_setting_lookup_int(device_settings, "channels", &ds->sounddevsettings.channels);
|
||||
config_setting_lookup_float(device_settings, "duration", &ds->sounddevsettings.duration);
|
||||
config_setting_lookup_int(device_settings, "noise", &ds->sounddevsettings.noise);
|
||||
|
||||
const char* temp = NULL;
|
||||
int found = 0;
|
||||
|
||||
@@ -185,6 +185,7 @@ typedef struct
|
||||
double duration;
|
||||
char* dev;
|
||||
SoundEffectModulationType modulation;
|
||||
int noise;
|
||||
}
|
||||
SoundDeviceSettings;
|
||||
|
||||
|
||||
@@ -67,10 +67,10 @@ ConfigError getParameters(int argc, char** argv, Parameters* p)
|
||||
struct arg_file* arg_log = arg_filen("l", "log", "<log_file>", 0, 1, NULL);
|
||||
struct arg_str* arg_confdir = arg_str1(NULL, NULL, "configdir", "<config_dir>");
|
||||
struct arg_int* arg_fps = arg_int0("f", "fps", "fps", "main data refresh rate");
|
||||
struct arg_lit* help = arg_litn(NULL,"help", 0, 1, "print this help and exit");
|
||||
struct arg_lit* help1 = arg_litn(NULL,"help", 0, 1, "print this help and exit");
|
||||
struct arg_lit* vers = arg_litn(NULL,"version", 0, 1, "print version information and exit");
|
||||
struct arg_end* end1 = arg_end(20);
|
||||
void* argtable1[] = {cmd1,arg_log,arg_conf,arg_fps,arg_udp,arg_audio1,arg_verbosity1,help,vers,end1};
|
||||
void* argtable1[] = {cmd1,arg_log,arg_conf,arg_fps,arg_udp,arg_audio1,arg_verbosity1,help1,vers,end1};
|
||||
int nerrors1;
|
||||
|
||||
struct arg_rex* cmd2a = arg_rex1(NULL, NULL, "config", NULL, REG_ICASE, NULL);
|
||||
@@ -121,6 +121,14 @@ ConfigError getParameters(int argc, char** argv, Parameters* p)
|
||||
|
||||
if (nerrors1==0)
|
||||
{
|
||||
if (help1->count > 0)
|
||||
{
|
||||
arg_print_errors(stdout,end1,progname);
|
||||
printf("Usage: %s ", progname);
|
||||
arg_print_syntax(stdout,argtable1,"\n");
|
||||
exitcode = E_SUCCESS_AND_EXIT;
|
||||
goto cleanup;
|
||||
}
|
||||
p->program_action = A_PLAY;
|
||||
p->verbosity_count = arg_verbosity1->count;
|
||||
|
||||
@@ -154,64 +162,75 @@ ConfigError getParameters(int argc, char** argv, Parameters* p)
|
||||
}
|
||||
exitcode = E_SUCCESS_AND_DO;
|
||||
}
|
||||
else
|
||||
if (nerrors2==0)
|
||||
else if (nerrors2==0)
|
||||
{
|
||||
if (help2->count > 0)
|
||||
{
|
||||
p->program_action = A_CONFIG_TACH;
|
||||
p->max_revs = arg_max_revs->ival[0];
|
||||
p->granularity = 1;
|
||||
if (arg_granularity->ival[0] > 0 && arg_granularity->ival[0] < 5 && arg_granularity->ival[0] != 3)
|
||||
{
|
||||
p->granularity=arg_granularity->ival[0];
|
||||
}
|
||||
p->save_file = *arg_save->filename;
|
||||
p->verbosity_count = arg_verbosity2->count;
|
||||
exitcode = E_SUCCESS_AND_DO;
|
||||
}
|
||||
else if (nerrors3==0)
|
||||
{
|
||||
p->program_action = A_TEST;
|
||||
p->verbosity_count = arg_verbosity3->count;
|
||||
if (arg_audio2->count > 0)
|
||||
{
|
||||
p->disable_audio = true;
|
||||
}
|
||||
exitcode = E_SUCCESS_AND_DO;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (cmd1->count > 0)
|
||||
{
|
||||
arg_print_errors(stdout,end1,progname);
|
||||
printf("Usage: %s ", progname);
|
||||
arg_print_syntax(stdout,argtable1,"\n");
|
||||
}
|
||||
else
|
||||
if (cmd2a->count > 0)
|
||||
{
|
||||
arg_print_errors(stdout,end2,progname);
|
||||
printf("Usage: %s ", progname);
|
||||
arg_print_syntax(stdout,argtable2,"\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (help->count==0 && vers->count==0)
|
||||
{
|
||||
printf("%s: missing <play|config|test> command.\n",progname);
|
||||
printf("Usage 1: %s ", progname);
|
||||
arg_print_syntax(stdout,argtable1,"\n");
|
||||
printf("Usage 2: %s ", progname);
|
||||
arg_print_syntax(stdout,argtable2,"\n");
|
||||
printf("Usage 3: %s ", progname);
|
||||
arg_print_syntax(stdout,argtable3,"\n");
|
||||
}
|
||||
}
|
||||
arg_print_errors(stdout,end2,progname);
|
||||
printf("Usage: %s ", progname);
|
||||
arg_print_syntax(stdout,argtable2,"\n");
|
||||
exitcode = E_SUCCESS_AND_EXIT;
|
||||
goto cleanup;
|
||||
}
|
||||
p->program_action = A_CONFIG_TACH;
|
||||
p->max_revs = arg_max_revs->ival[0];
|
||||
p->granularity = 1;
|
||||
if (arg_granularity->ival[0] > 0 && arg_granularity->ival[0] < 5 && arg_granularity->ival[0] != 3)
|
||||
{
|
||||
p->granularity=arg_granularity->ival[0];
|
||||
}
|
||||
p->save_file = *arg_save->filename;
|
||||
p->verbosity_count = arg_verbosity2->count;
|
||||
exitcode = E_SUCCESS_AND_DO;
|
||||
}
|
||||
else if (nerrors3==0)
|
||||
{
|
||||
if (help3->count > 0)
|
||||
{
|
||||
arg_print_errors(stdout,end3,progname);
|
||||
printf("Usage: %s ", progname);
|
||||
arg_print_syntax(stdout,argtable3,"\n");
|
||||
exitcode = E_SUCCESS_AND_EXIT;
|
||||
goto cleanup;
|
||||
}
|
||||
p->program_action = A_TEST;
|
||||
p->verbosity_count = arg_verbosity3->count;
|
||||
if (arg_audio2->count > 0)
|
||||
{
|
||||
p->disable_audio = true;
|
||||
}
|
||||
exitcode = E_SUCCESS_AND_DO;
|
||||
}
|
||||
else
|
||||
{
|
||||
// hit this if you typed wrong parameters
|
||||
if (cmd1->count > 0)
|
||||
{
|
||||
arg_print_errors(stdout,end1,progname);
|
||||
printf("Usage: %s ", progname);
|
||||
arg_print_syntax(stdout,argtable1,"\n");
|
||||
exitcode = E_SUCCESS_AND_EXIT;
|
||||
goto cleanup;
|
||||
}
|
||||
if (cmd2a->count > 0)
|
||||
{
|
||||
arg_print_errors(stdout,end2,progname);
|
||||
printf("Usage: %s ", progname);
|
||||
arg_print_syntax(stdout,argtable2,"\n");
|
||||
exitcode = E_SUCCESS_AND_EXIT;
|
||||
goto cleanup;
|
||||
}
|
||||
if (cmd3->count > 0)
|
||||
{
|
||||
arg_print_errors(stdout,end3,progname);
|
||||
printf("Usage: %s ", progname);
|
||||
arg_print_syntax(stdout,argtable3,"\n");
|
||||
exitcode = E_SUCCESS_AND_EXIT;
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
// interpret some special cases before we go through trouble of reading the config file
|
||||
if (help->count > 0)
|
||||
if (help0->count > 0 || (cmd3->count == 0 && cmd1->count == 0 && cmd2a->count == 0))
|
||||
{
|
||||
printf("Usage: %s\n", progname);
|
||||
printf("Usage 1: %s ", progname);
|
||||
|
||||
@@ -173,7 +173,8 @@ int main(int argc, char** argv)
|
||||
config_setting_t* config_devices = NULL;
|
||||
if (!config_read_file(&cfg, ms->config_str))
|
||||
{
|
||||
fprintf(stderr, "%s:%d - %s\n", config_error_file(&cfg), config_error_line(&cfg), config_error_text(&cfg));
|
||||
sloge("Issue with monocoque config file: %s:%d - %s", config_error_file(&cfg), config_error_line(&cfg), config_error_text(&cfg));
|
||||
fprintf(stderr, "Issue with monocoque config file: %s:%d - %s\n", config_error_file(&cfg), config_error_line(&cfg), config_error_text(&cfg));
|
||||
config_destroy(&cfg);
|
||||
slog_destroy();
|
||||
goto cleanup_final;
|
||||
|
||||
@@ -9,6 +9,11 @@ set(simulatorapi_source_files
|
||||
simapi/include/dirt2data.h
|
||||
simapi/include/scs2data.h
|
||||
simapi/include/outgauge.h
|
||||
simapi/include/f12018.h
|
||||
simapi/include/rbrdata.h
|
||||
simapi/include/r3e.h
|
||||
simapi/include/wreckfest2data.h
|
||||
simapi/include/forza.h
|
||||
simapi/simmap/basicmap.h
|
||||
simapi/simmap/mapacdata.c
|
||||
simapi/simmap/mapacdata.h
|
||||
@@ -18,12 +23,22 @@ set(simulatorapi_source_files
|
||||
simapi/simapi/pcars2.h
|
||||
simapi/simapi/scs2.h
|
||||
simapi/simapi/outgauge.h
|
||||
simapi/simapi/wreckfest2.h
|
||||
simapi/simapi/f1.h
|
||||
simapi/simapi/rbr.h
|
||||
simapi/simapi/forzadef.h
|
||||
simapi/simapi/r3edef.h
|
||||
simapi/simapi/mapping/acmapper.c
|
||||
simapi/simapi/mapping/rf2mapper.c
|
||||
simapi/simapi/mapping/r3emapper.c
|
||||
simapi/simapi/mapping/pcars2mapper.c
|
||||
simapi/simapi/mapping/dirt2mapper.c
|
||||
simapi/simapi/mapping/scs2mapper.c
|
||||
simapi/simapi/mapping/outgaugemapper.c
|
||||
simapi/simapi/mapping/f12018mapper.c
|
||||
simapi/simapi/mapping/rbrmapper.c
|
||||
simapi/simapi/mapping/wreckfest2mapper.c
|
||||
simapi/simapi/mapping/forzamapper.c
|
||||
simapi/simapi/getpid.c
|
||||
simapi/simapi/getpid.h
|
||||
)
|
||||
|
||||
Submodule src/monocoque/simulatorapi/simapi updated: 3410864cc9...9106c64434
@@ -0,0 +1,8 @@
|
||||
Package: monocoque
|
||||
Version: 1
|
||||
Section: misc
|
||||
Priority: optional
|
||||
Architecture: amd64
|
||||
Maintainer: Paul Jones <paul@spacefreak18.xyz>
|
||||
Description: Racing Simulator Device Manager
|
||||
Depends: libpulse0,libconfig11,libargtable2-0,liblua5.4-0,libuv1t64,libserialport0,libxml2,libxdg-basedir1,libhidapi-hidraw0
|
||||
@@ -0,0 +1,8 @@
|
||||
Package: monocoque
|
||||
Version: 1
|
||||
Section: misc
|
||||
Priority: optional
|
||||
Architecture: amd64
|
||||
Maintainer: Paul Jones <paul@spacefreak18.xyz>
|
||||
Description: Racing Simulator Device Manager
|
||||
Depends: libpulse0,libconfig9,libargtable2-0,liblua5.4-0,libuv1t64,libserialport0,libxml2,libxdg-basedir1,libhidapi-hidraw0
|
||||
@@ -0,0 +1,39 @@
|
||||
#dnf install pulseaudio-libs-devel argtable-devel libconfig-devel hidapi-devel libserialport-devel lua-devel libuv-devel libxdg-basedir-devel libxml2-devel
|
||||
Summary: A device manager for racing sims
|
||||
Name: monocoque
|
||||
Version: 0.0.5
|
||||
Release: 1
|
||||
License: GPL
|
||||
Group: Applications/Sound
|
||||
Source: https://github.com/monocoque
|
||||
URL: https://spacefreak18.github.io/simapi
|
||||
Distribution: Fedora Linux
|
||||
Vendor: spacefreak18
|
||||
Packager: Paul Jones <paul@spacefreak18.xyz>
|
||||
Requires: pulseaudio-libs argtable libconfig hidapi libserialport libuv libxdg-basedir lua-libs libxml2
|
||||
|
||||
%description
|
||||
A device manager for Racing sims
|
||||
|
||||
%prep
|
||||
rm -rf $RPM_BUILD_DIR/monocoque
|
||||
rm -rf $RPM_SOURCE_DIR/monocoque
|
||||
cd $RPM_SOURCE_DIR
|
||||
git clone https://github.com/spacefreak18/monocoque
|
||||
cd monocoque
|
||||
git submodule update --init --recursive
|
||||
cd ..
|
||||
cp -r $RPM_SOURCE_DIR/monocoque $RPM_BUILD_DIR/
|
||||
|
||||
%build
|
||||
cd $RPM_BUILD_DIR/monocoque
|
||||
cmake -B build
|
||||
cd build
|
||||
make
|
||||
|
||||
%install
|
||||
mkdir -p $RPM_BUILD_ROOT/usr/bin
|
||||
cp $RPM_BUILD_DIR/monocoque/build/monocoque $RPM_BUILD_ROOT/usr/bin/monocoque
|
||||
|
||||
%files
|
||||
/usr/bin/monocoque
|
||||
Reference in New Issue
Block a user