diff options
| author | Lyes Saadi <mail@lyes.eu> | 2020-02-22 19:45:25 +0100 |
|---|---|---|
| committer | Lyes Saadi <mail@lyes.eu> | 2020-02-22 19:45:25 +0100 |
| commit | cccc5981e0a25c28db20b72b37a93d1aa05a976f (patch) | |
| tree | b767d09bad519e9fd762a012baea2f5e9bd5ee01 /dimension-code | |
| parent | d4dd4459343f0c0c2e89d4569e407951ca7af078 (diff) | |
Adding disease-propagation.
Diffstat (limited to 'dimension-code')
| -rw-r--r-- | dimension-code/cmake-remove-sfml-main.patch | 11 | ||||
| -rw-r--r-- | dimension-code/disease-propagation-data-path.patch | 40 | ||||
| -rw-r--r-- | dimension-code/disease-propagation-icon-path.patch | 18 | ||||
| -rw-r--r-- | dimension-code/disease-propagation.desktop | 9 | ||||
| -rw-r--r-- | dimension-code/disease-propagation.spec | 62 |
5 files changed, 140 insertions, 0 deletions
diff --git a/dimension-code/cmake-remove-sfml-main.patch b/dimension-code/cmake-remove-sfml-main.patch new file mode 100644 index 0000000..0137dff --- /dev/null +++ b/dimension-code/cmake-remove-sfml-main.patch @@ -0,0 +1,11 @@ +--- CMakeLists.txt 2020-02-22 18:14:34.415578750 +0100 ++++ CMakeListsPatched.txt 2020-02-22 18:15:26.054262587 +0100 +@@ -17,7 +17,7 @@ + find_package(SFML COMPONENTS system window graphics REQUIRED) + target_link_libraries(Disease_propagation PRIVATE + sfml-system +- sfml-main ++# sfml-main + sfml-window + sfml-graphics + ) diff --git a/dimension-code/disease-propagation-data-path.patch b/dimension-code/disease-propagation-data-path.patch new file mode 100644 index 0000000..a9e6e22 --- /dev/null +++ b/dimension-code/disease-propagation-data-path.patch @@ -0,0 +1,40 @@ +--- sources/menu.cpp 2020-02-22 18:58:06.505035837 +0100 ++++ menuPatched.cpp 2020-02-22 19:03:41.201259658 +0100 +@@ -468,7 +468,7 @@ + this->variables = variables; + this->background = background; + +- texts_font.loadFromFile("dependencies/resources/GoogleSans-Bold.ttf"); ++ texts_font.loadFromFile("/usr/share/disease-propagation/GoogleSans-Bold.ttf"); + } + + +@@ -559,8 +559,8 @@ + + void Menu::init_start(const double& start_size, const double& start_x_position, const double& start_y_position, const sf::Color& start_color) + { +- start_texture.loadFromFile("dependencies/resources/start_texture.png"); +- start_texture_grabbed.loadFromFile("dependencies/resources/start_texture_grabbed.png"); ++ start_texture.loadFromFile("/usr/share/disease-propagation/start_texture.png"); ++ start_texture_grabbed.loadFromFile("/usr/share/disease-propagation/start_texture_grabbed.png"); + + start_texture.setSmooth(true); + start_texture_grabbed.setSmooth(true); +@@ -724,8 +724,8 @@ + grabbed = false; + grab_forbiden = false; + +- texture.loadFromFile("dependencies/resources/restart_texture.png"); +- texture_grabbed.loadFromFile("dependencies/resources/restart_texture_grabbed.png"); ++ texture.loadFromFile("/usr/share/disease-propagation/restart_texture.png"); ++ texture_grabbed.loadFromFile("/usr/share/disease-propagation/restart_texture_grabbed.png"); + + texture.setSmooth(true); + texture_grabbed.setSmooth(true); +@@ -865,4 +865,4 @@ + } + + return text; +-} +\ Pas de fin de ligne à la fin du fichier ++} diff --git a/dimension-code/disease-propagation-icon-path.patch b/dimension-code/disease-propagation-icon-path.patch new file mode 100644 index 0000000..ae3ac60 --- /dev/null +++ b/dimension-code/disease-propagation-icon-path.patch @@ -0,0 +1,18 @@ +--- sources/main.cpp 2020-02-22 18:58:06.505035837 +0100 ++++ mainPatched.cpp 2020-02-22 19:04:02.281329017 +0100 +@@ -16,7 +16,7 @@ + sf::RenderWindow window(sf::VideoMode(WIDTH, HEIGHT), "Disease propagation", window_settings, settings); + + sf::Image icon; +- icon.loadFromFile("dependencies/resources/icon.png"); ++ icon.loadFromFile("/usr/share/disease-propagation/icon.png"); + + window.setIcon(icon.getSize().x, icon.getSize().y, icon.getPixelsPtr()); + +@@ -143,4 +143,4 @@ + } + + return 0; +-} +\ Pas de fin de ligne à la fin du fichier ++} diff --git a/dimension-code/disease-propagation.desktop b/dimension-code/disease-propagation.desktop new file mode 100644 index 0000000..d688c89 --- /dev/null +++ b/dimension-code/disease-propagation.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Name=Disease propagation +Type=Application +Categories=Education; +Comment=Basic simulation of disease propagation +Path=/usr/share/disease-propagation +Exec=/usr/bin/disease-propagation +Icon=/usr/share/disease-propagation/icon.png +Terminal=false
\ No newline at end of file diff --git a/dimension-code/disease-propagation.spec b/dimension-code/disease-propagation.spec new file mode 100644 index 0000000..5befc69 --- /dev/null +++ b/dimension-code/disease-propagation.spec @@ -0,0 +1,62 @@ +%global commit df9ee40be7fa7e14e40c5c59da97503e52bf8eaf +%global shortcommit %(c=%{commit}; echo ${c:0:7}) + +%global reponame Disease_propagation + +Name: disease-propagation +Version: 0 +Release: 1.%(date +%%Y%%m%%d)git%{shortcommit}%{?dist} +Summary: Basic simulation of disease propagation + +License: CC0 +URL: https://www.youtube.com/watch?v=hrLrEfP2Wjo +Source0: https://github.com/angeluriot/%{reponame}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz +Source1: disease-propagation.desktop + +Patch0: cmake-remove-sfml-main.patch +Patch1: disease-propagation-data-path.patch +Patch2: disease-propagation-icon-path.patch + +BuildRequires: SFML-devel + +%description +This is a project from the french Youtuber Dimension, where he tries to +simulate the propagation of a disease. + +The rule of the disease propagation are 100% customizable from the integrated +menu. Where you can change things like: +* Percentage of vaccinated +* Lethality of the disease +* Infectivity of the disease +* And more... + +%prep +%autosetup -p0 -n %{reponame}-%{commit} + +%build +rm -rf dependencies/SFML +%cmake . +%make_build + +# Rename the binary to a more common name +mv Disease_propagation disease-propagation + +%install +# Installing the binary +install -Dpm 0755 -t %{buildroot}%{_bindir}/ disease-propagation + +# Installing resources +install -Dpm 0644 -t %{buildroot}%{_datadir}/%{name} dependencies/resources/* + +# Installing desktop file +install -Dpm 0644 -t %{buildroot}%{_datadir}/applications %{SOURCE1} + +%files +%{_bindir}/disease-propagation +%{_datadir}/%{name} +%{_datadir}/applications/%{name}.desktop +%doc README.md + +%changelog +* Sat Feb 22 2020 Lyes Saadi <fedora@lyes.eu> - 0-1.20200222gitdf9ee40 +- Initial package. |
