elouan660
(Elouan Deschamps)
August 3, 2023, 5:24pm
1
Hello, I’m trying to create an rpm for the open-source solarus game engine , but I got the same error when I try to use one the solarus commands: solarus-run
and solarus-launcher
. Can you help me to solve it please? This is the very first rpm I create
elouan660@fedora-elouan:~/Téléchargements$ solarus-run zsdx-v1.12.3.solarus
solarus-run: error while loading shared libraries: libsolarus.so.1: cannot open shared object file: No such file or directory
Here are:
The git repo of the version I want to compile: Files · v1.6.5 · Solarus Games / Solarus · GitLab ,
The rpm package: Proton Drive ,
And the spec file I written (solarus.spec):
Name: solarus
Version: v1.6.5
Release: 1%{?dist}
Summary: The Solarus Game Engine
License: GPLv3+
URL: https://www.solarus-games.org/fr/
Source: %{_sourcedir}/solarus-v1.6.5.tar.gz
BuildRequires: cmake gcc pkgconf-pkg-config luajit-devel physfs-devel libmodplug-devel libvorbis-devel openal-soft-devel glm-devel SDL2_image-devel SDL2_ttf-devel SDL2_gfx-devel SDL2 qt5-qtbase qt5-qtbase-devel qt5-qttools qt5-qttools-devel qt5-qtdeclarative qt5-qtdeclarative-devel qt5-qtquickcontrols2 qt5-qtquickcontrols2-devel
Requires: SDL2 SDL2_image SDL2_ttf openal-soft libvorbis libogg libmodplug luajit physfs
ExclusiveArch: x86_64
%description
A lightweight, multiplatform, free and open-source 2D game engine
%prep
%autosetup
%build
mkdir build
cd ./build
cmake ..
%install
cd ./build
echo "\n ls \n"
%make_install
%files
/usr/local/lib64/libsolarus.so.1.6.5
/usr/local/lib64/libsolarus.so.1
/usr/local/lib64/libsolarus.so
/usr/local/lib64/libsolarus-gui.so
/usr/local/lib64/libsolarus-gui.so.1
/usr/local/lib64/libsolarus-gui.so.1.6.5
/usr/local/bin/solarus-run
/usr/local/bin/solarus-launcher
/usr/local/include/solarus/
/usr/local/share/icons/hicolor/16x16/apps/org.solarus_games.solarus.Launcher.png
/usr/local/share/icons/hicolor/20x20/apps/org.solarus_games.solarus.Launcher.png
/usr/local/share/icons/hicolor/24x24/apps/org.solarus_games.solarus.Launcher.png
/usr/local/share/icons/hicolor/32x32/apps/org.solarus_games.solarus.Launcher.png
/usr/local/share/icons/hicolor/40x40/apps/org.solarus_games.solarus.Launcher.png
/usr/local/share/icons/hicolor/48x48/apps/org.solarus_games.solarus.Launcher.png
/usr/local/share/pixmaps/org.solarus_games.solarus.Launcher.png
/usr/local/share/icons/hicolor/scalable/apps/org.solarus_games.solarus.Launcher.svg
/usr/local/share/icons/hicolor/symbolic/apps/org.solarus_games.solarus.Launcher-symbolic.svg
/usr/local/share/icons/hicolor/16x16/apps/org.solarus_games.solarus.Runner.png
/usr/local/share/icons/hicolor/20x20/apps/org.solarus_games.solarus.Runner.png
/usr/local/share/icons/hicolor/24x24/apps/org.solarus_games.solarus.Runner.png
/usr/local/share/icons/hicolor/32x32/apps/org.solarus_games.solarus.Runner.png
/usr/local/share/icons/hicolor/40x40/apps/org.solarus_games.solarus.Runner.png
/usr/local/share/icons/hicolor/48x48/apps/org.solarus_games.solarus.Runner.png
/usr/local/share/pixmaps/org.solarus_games.solarus.Runner.png
/usr/local/share/icons/hicolor/scalable/apps/org.solarus_games.solarus.Runner.svg
/usr/local/share/icons/hicolor/symbolic/apps/org.solarus_games.solarus.Runner-symbolic.svg
/usr/local/share/applications/org.solarus_games.solarus.Launcher.desktop
/usr/local/share/metainfo/org.solarus_games.solarus.appdata.xml
/usr/local/share/man/man6/solarus-launcher.6
/usr/local/share/man/man6/solarus-run.6
/usr/local/share/solarus-gui/translations/solarus_es.qm
/usr/local/share/solarus-gui/translations/solarus_fr.qm
/usr/lib/debug/usr/local/bin/solarus-launcher-v1.6.5-1.fc38.x86_64.debug
/usr/lib/debug/usr/local/lib64/libsolarus-gui.so.1.6.5-v1.6.5-1.fc38.x86_64.debug
%changelog
* Sun Jul 30 2023 elouan660 <95432031+elouan660@users.noreply.github.com>
-
glb
(Gregory Lee Bartholomew)
August 3, 2023, 9:35pm
2
I’m not a packager, but I would guess you’d need to include a /etc/ld.so.conf.d/solarus-x86_64.conf
containing:
/usr/local/lib64
and add %post -p /sbin/ldconfig
and %postun -p /sbin/ldconfig
to your spec file to get it to “work”. However, I’m sure you shouldn’t do it that way because of the potential side effects of adding all of /usr/local/lib64
to the default library search path. You probably need to allocate a unique namespace for your program’s libraries.
See https://fedoraproject.org/wiki/Changes/Removing_ldconfig_scriptlets
See also How to set the environmental variable LD_LIBRARY_PATH in linux - Stack Overflow
1 Like
eclipseo
(Robert André Mauchin)
August 3, 2023, 9:43pm
3
SPEC is no good at all if you actually want to package for Fedora.
I suggest you to read the extensive Guidelines here : Fedora Packaging Guidelines :: Fedora Docs
Here’s what a good SPEC would look like :
%global commit 3aec70b0556a8d7aed7903d1a3e4d9a18c5d1649
Name: solarus
Version: 1.6.5
Release: %autorelease
Summary: The Solarus Game Engine
# Main program: GPL-3.0-or-later
#
# CC-BY-SA-4.0 Author: Olivier Cléro (Solarus team)
# gui/resources/images/icon/*.png
# gui/resources/images/default_icon.png
# gui/resources/images/solarus_logo_128.png
# gui/resources/images/no_logo.png
# images/solarus_logo.png
#
# CC-BY-SA-3.0 Author: Yusuke Kamiyamane: http://p.yusukekamiyamane.com
# gui/resources/images/icon_add.png
# gui/resources/images/icon_open.png
# gui/resources/images/icon_remove.png
# gui/resources/images/icon_start.png
# gui/resources/images/icon_stop.png
License: GPL-3.0-or-later AND CC-BY-SA-4.0
URL: https://www.solarus-games.org/
VCS: https://gitlab.com/solarus-games/solarus
Source: %VCS/-/archive/v%{version}/%{name}-%{version}.tar.gz
BuildRequires: cmake
BuildRequires: cmake(glm)
BuildRequires: desktop-file-utils
BuildRequires: gcc
BuildRequires: libappstream-glib
BuildRequires: pkgconfig(libmodplug)
BuildRequires: pkgconfig(lua)
BuildRequires: pkgconfig(luajit)
BuildRequires: pkgconfig(ogg)
BuildRequires: pkgconfig(opengl)
BuildRequires: pkgconfig(physfs)
BuildRequires: pkgconfig(openal)
BuildRequires: pkgconfig(Qt5)
BuildRequires: pkgconfig(Qt5Designer)
BuildRequires: pkgconfig(Qt5Qml)
BuildRequires: pkgconfig(Qt5QuickControls2)
BuildRequires: pkgconfig(SDL2_gfx)
BuildRequires: pkgconfig(SDL2_image)
BuildRequires: pkgconfig(SDL2_ttf)
BuildRequires: pkgconfig(sdl2)
BuildRequires: pkgconfig(vorbis)
BuildRequires: pkgconfig(vorbisfile)
ExclusiveArch: x86_64
%description
A lightweight, multiplatform, free and open-source 2D game engine.
%package devel
Summary: Development files for Solarus
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
Development files for Solarus.
%prep
%autosetup -p1 -n %{name}-v%{version}-%{commit}
%build
%cmake
%cmake_build
%install
%cmake_install
%find_lang %{name} --with-qt
%check
desktop-file-validate %{buildroot}/%{_datadir}/applications/org.solarus_games.solarus.Launcher.desktop
appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/org.solarus_games.solarus.appdata.xml
%files -f %{name}.lang
%doc changelog.md compilation.md readme.md
%license license.txt license_gpl.txt
%{_bindir}/solarus-run
%{_bindir}/solarus-launcher
%{_libdir}/libsolarus.so.1*
%{_libdir}/libsolarus-gui.so.1*
%{_datadir}/icons/hicolor/*/apps/org.solarus_games.solarus.Launcher.*
%{_datadir}/icons/hicolor/*/apps/org.solarus_games.solarus.Launcher-symbolic.svg
%{_datadir}/icons/hicolor/*/apps/org.solarus_games.solarus.Runner.*
%{_datadir}/icons/hicolor/*/apps/org.solarus_games.solarus.Runner-symbolic.svg
%{_datadir}/pixmaps/org.solarus_games.solarus.Launcher.png
%{_datadir}/pixmaps/org.solarus_games.solarus.Runner.png
%{_datadir}/applications/org.solarus_games.solarus.Launcher.desktop
%{_metainfodir}/org.solarus_games.solarus.appdata.xml
%{_mandir}/man6/solarus-launcher.6*
%{_mandir}/man6/solarus-run.6*
%files devel
%{_includedir}/solarus/
%{_libdir}/libsolarus.so
%{_libdir}/libsolarus-gui.so
%changelog
%autochangelog
→ Key points :
use of url for source
use of macros for the directories in %files
use of a devel subpackage for the unversioned libraries and includes
use of cmake macros for buidling
use of pkgconfig/cmake for the devel buildrequires
proper licensing breakdown, using SPDX
autorelease/autochangelog
mandatory validation of the desktop and metainfo files
Link to a COPR of the build : eclipseo/solarus Copr
Note that RPM packaging might be not needed, there is a Flatpak for it :
flatpak search solarus
flatpak install org.solarus_games.solarus.Launcher
1 Like
elouan660
(Elouan Deschamps)
August 3, 2023, 9:58pm
4
Thanks for this constructive message, I will rewrite the SPEC file. Unfortunately the flatpak version of solarus has been dropped in favour of the snap version.
eclipseo
(Robert André Mauchin)
August 3, 2023, 10:00pm
5
The flatpak version is 1.6.5, which is the latest version. It has seen no release for the past 2 years.
vekruse
(Villy Kruse)
August 4, 2023, 5:03am
6
You can install snap packages as well on Fedora after installing the snapd
packages from the Fedora repository.
[vek@newbox ~]$ snap search solarus
Name Version Publisher Notes Summary
solarus 1.6.5 solarusgames - A lightweight, free and open-source game engine for Action-RPGs.
[vek@newbox ~]$
casey128
(Casey)
August 4, 2023, 10:10am
7
N.B. snap packages are unsandboxed on Fedora b/c it relies on AppArmor
vekruse
(Villy Kruse)
August 4, 2023, 11:20am
8
That is not entirely correct. The snap packages runs with its own root file system which is bind mounted on top of the Fedora root file system, which means that the snap programs do not have access to the Fedora files. A few configuration files can then be made available in a read-only mode by specifically bind mount them on top of the corresponding file in the snap root file system. The snap root file system is a non-modifiable squashfs file system.
1 Like
elouan660
(Elouan Deschamps)
August 5, 2023, 12:08pm
9
My final goal is to compile also the solarus quest editor
salimma
(Michel Lind (né Salim))
August 5, 2023, 2:56pm
10
This part has caused issues in the past, which is why I tend to avoid Snaps
eclipseo
(Robert André Mauchin)
August 5, 2023, 10:09pm
11
Same shenanigans:
%global commit c8d0835c3a62a0e60cdb32d26be8b75485a23a96
Name: solarus-quest-editor
Version: 1.6.5
Release: %autorelease
Summary: The Solarus Quest Editor
# Main program: GPL-3.0-or-later
#
# CC-BY-SA-3.0 Author: Yusuke Kamiyamane: http://p.yusukekamiyamane.com
# resources/images/entity_custom_entity.png
# resources/images/entity_tile.png
# resources/images/icon_add.png
# resources/images/icon_camera.png
# resources/images/icon_copy.png
# resources/images/icon_cross.png
# resources/images/icon_cross_small.png
# resources/images/icon_cut.png
# resources/images/icon_delete.png
# resources/images/icon_edit.png
# resources/images/icon_error.png
# resources/images/icon_folder_closed.png
# resources/images/icon_folder_open.png
# resources/images/icon_folder_open_music.png
# resources/images/icon_file.png
# resources/images/icon_first.png
# resources/images/icon_glasses.png
# resources/images/icon_image.png
# resources/images/icon_inside.png
# resources/images/icon_last.png
# resources/images/icon_next.png
# resources/images/icon_open.png
# resources/images/icon_outside.png
# resources/images/icon_paste.png
# resources/images/icon_pause.png
# resources/images/icon_previous.png
# resources/images/icon_redo.png
# resources/images/icon_refresh.png
# resources/images/icon_remove.png
# resources/images/icon_rename.png
# resources/images/icon_resource_enemy.png
# resources/images/icon_resource_entity.png
# resources/images/icon_resource_font.png
# resources/images/icon_resource_item.png
# resources/images/icon_resource_map.png
# resources/images/icon_resource_music.png
# resources/images/icon_resource_shader.png
# resources/images/icon_resource_sound.png
# resources/images/icon_resource_sprite.png
# resources/images/icon_resource_tileset.png
# resources/images/icon_resize_all.png
# resources/images/icon_resize_horizontal.png
# resources/images/icon_resize_none.png
# resources/images/icon_resize_vertical.png
# resources/images/icon_save.png
# resources/images/icon_script.png
# resources/images/icon_start.png
# resources/images/icon_stop.png
# resources/images/icon_undo.png
# resources/images/icon_web.png
# resources/images/icon_doc.png
# resources/images/icon_string.png
# resources/images/icon_strings.png
# resources/images/icon_dialog.png
# resources/images/icon_dialogs.png
# resources/images/icon_property.png
# resources/images/icon_up.png
# resources/images/icon_down.png
#
# CC-BY-SA-3.0 Author: Christopho, adapted from Yusuke Kamiyamane's icons
# resources/images/entity_tile_missing.png
# resources/images/icon_dialog_missing.png
# resources/images/icon_dialogs_missing.png
# resources/images/icon_file_unknown.png
# resources/images/icon_folder_open_enemy.png
# resources/images/icon_folder_open_entity.png
# resources/images/icon_folder_open_font.png
# resources/images/icon_folder_open_item.png
# resources/images/icon_folder_open_language.png
# resources/images/icon_folder_open_map.png
# resources/images/icon_folder_open_missing.png
# resources/images/icon_folder_open_shader.png
# resources/images/icon_folder_open_sound.png
# resources/images/icon_folder_open_sprite.png
# resources/images/icon_folder_open_tileset.png
# resources/images/icon_image_language.png
# resources/images/icon_image_tileset.png
# resources/images/icon_layer_0.png
# resources/images/icon_layer_1.png
# resources/images/icon_layer_2.png
# resources/images/icon_missing.png
# resources/images/icon_pause_music.png
# resources/images/icon_play_music.png
# resources/images/icon_property_missing.png
# resources/images/icon_resource_enemy_missing.png
# resources/images/icon_resource_entity_missing.png
# resources/images/icon_resource_font_missing.png
# resources/images/icon_resource_item_missing.png
# resources/images/icon_resource_language.png
# resources/images/icon_resource_language_missing.png
# resources/images/icon_resource_map_missing.png
# resources/images/icon_resource_music_missing.png
# resources/images/icon_resource_shader_missing.png
# resources/images/icon_resource_sound_missing.png
# resources/images/icon_resource_sprite_missing.png
# resources/images/icon_resource_tileset_missing.png
# resources/images/icon_script_map.png
# resources/images/icon_stop_music.png
# resources/images/icon_string_missing.png
# resources/images/icon_strings_missing.png
#
# CC-BY-SA-4.0 other data files
License: GPL-3.0-or-later AND CC-BY-SA-3.0 AND CC-BY-SA-4.0
URL: https://www.solarus-games.org/
VCS: https://gitlab.com/solarus-games/solarus-quest-editor
Source: %VCS/-/archive/v%{version}/%{name}-%{version}.tar.gz
BuildRequires: cmake
BuildRequires: cmake(glm)
BuildRequires: cmake(Qt5LinguistTools)
BuildRequires: desktop-file-utils
BuildRequires: gcc
BuildRequires: pkgconfig(libmodplug)
BuildRequires: pkgconfig(lua)
BuildRequires: pkgconfig(luajit)
BuildRequires: pkgconfig(opengl)
BuildRequires: pkgconfig(physfs)
BuildRequires: pkgconfig(ogg)
BuildRequires: pkgconfig(openal)
BuildRequires: pkgconfig(Qt5)
BuildRequires: pkgconfig(SDL2_image)
BuildRequires: pkgconfig(SDL2_ttf)
BuildRequires: pkgconfig(sdl2)
BuildRequires: pkgconfig(vorbis)
BuildRequires: pkgconfig(vorbisfile)
BuildRequires: solarus-devel
Requires: %{name}-assets = %{version}-%{release}
ExclusiveArch: x86_64
%description
Solarus Quest Editor is a graphical user interface to create and modify quests
for the Solarus engine.
%package assets
Summary: Assets for Solarus Quest Editor
BuildArch: noarch
Requires: %{name} = %{version}-%{release}
%description assets
Assets for Solarus Quest Editor.
%prep
%autosetup -p1 -n %{name}-v%{version}-%{commit}
%build
%cmake
%cmake_build
%install
%cmake_install
%find_lang solarus_editor --with-qt
%check
desktop-file-validate %{buildroot}/%{_datadir}/applications/%{name}.desktop
%files -f solarus_editor.lang
%doc changelog.md readme.md
%license license.txt license_gpl.txt
%{_bindir}/%{name}
%{_datadir}/icons/hicolor/*/apps/%{name}.*
%{_datadir}/icons/hicolor/*/apps/%{name}-symbolic.svg
%{_datadir}/pixmaps/%{name}.png
%{_datadir}/applications/%{name}.desktop
%files assets
%{_datadir}/%{name}/
%changelog
%autochangelog
Here we split the assets in a separate noarched packages in order not to have 55 MB of redundant data in each arched packages.
Built on eclipseo/solarus Copr too.