Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Add an 'iconsdir' option. #202

Merged
merged 1 commit into from
Oct 23, 2024

Conversation

Apteryks
Copy link
Contributor

This fixes the icon not being found for XDG systems such as GNU/Linux, partially addressing #180.

It should be applied the following patch to the vdrift-data SVN repo:

Index: vdrift-data/SConscript
===================================================================
--- vdrift-data/SConscript	(revision 1460)
+++ vdrift-data/SConscript	(working copy)
@@ -10,6 +10,7 @@
 #---------#
 src = []
 
+# Install every single file to the data directory.
 for root, dirs, files in os.walk("."):
   if root.find('.svn') == -1:
     for file in [f for f in files if not f.endswith('~')]:
@@ -40,3 +41,6 @@
     env.MoBuild(mo_file, po_file)
     install = env.InstallAs(os.path.join(env.subst('$locale_directory'), mo_tgt_file), mo_file)
     env.Alias("install", install)
+
+# Also copy the icons to a suitable location for the system.
+SConscript('textures/icons/SConscript')
Index: vdrift-data/textures/icons/SConscript
===================================================================
--- vdrift-data/textures/icons/SConscript	(revision 1460)
+++ vdrift-data/textures/icons/SConscript	(working copy)
@@ -19,5 +19,10 @@
 #--------------------#
 # Install data files #
 #--------------------#
-install = env.Install(Dir(env.subst('$data_directory/textures/icons')), src)
-env.Alias('install', install)
+# Install the icons per the Icon Theme Specification (see:
+# https://specifications.freedesktop.org/icon-theme-spec/)
+iconsdir = Dir(env.subst('$icons_directory')).abspath
+install1 = env.InstallAs(iconsdir + '/16x16/apps/vdrift.png', 'vdrift-16x16.png')
+install2 = env.InstallAs(iconsdir + '/32x32/apps/vdrift.png', 'vdrift-32x32.png')
+install3 = env.InstallAs(iconsdir + '/64x64/apps/vdrift.png', 'vdrift-64x64.png')
+env.Alias('install', [install1, install2, install3])

This fixes the icon not being found for XDG systems such as GNU/Linux,
partially addressing <VDrift#180>.
@Apteryks
Copy link
Contributor Author

This for example makes the icon for the VDrift menu entry work in GNOME (and other desktop environment) as part of the standard installation (previously packagers would have had to add a manual phase or some patching of their own).

@logzero
Copy link
Member

logzero commented Oct 22, 2024

Thanks.

@logzero logzero closed this Oct 22, 2024
@Apteryks
Copy link
Contributor Author

That was quick, thank you!

@Apteryks
Copy link
Contributor Author

@logzero I think the part on this repository (vdrift itself) hasn't been merged, right? Was this an oversight?

@logzero logzero reopened this Oct 23, 2024
@logzero logzero merged commit 120ae28 into VDrift:master Oct 23, 2024
1 check passed
@Apteryks
Copy link
Contributor Author

Thanks, it works better now:

$ find /gnu/store/ir3pqnp2xza3yzxb2i02mrn3hvfy62vf-vdrift-2014-10-20-0.120ae28/share/icons
/gnu/store/ir3pqnp2xza3yzxb2i02mrn3hvfy62vf-vdrift-2014-10-20-0.120ae28/share/icons
/gnu/store/ir3pqnp2xza3yzxb2i02mrn3hvfy62vf-vdrift-2014-10-20-0.120ae28/share/icons/hicolor
/gnu/store/ir3pqnp2xza3yzxb2i02mrn3hvfy62vf-vdrift-2014-10-20-0.120ae28/share/icons/hicolor/16x16
/gnu/store/ir3pqnp2xza3yzxb2i02mrn3hvfy62vf-vdrift-2014-10-20-0.120ae28/share/icons/hicolor/16x16/apps
/gnu/store/ir3pqnp2xza3yzxb2i02mrn3hvfy62vf-vdrift-2014-10-20-0.120ae28/share/icons/hicolor/16x16/apps/vdrift.png
/gnu/store/ir3pqnp2xza3yzxb2i02mrn3hvfy62vf-vdrift-2014-10-20-0.120ae28/share/icons/hicolor/32x32
/gnu/store/ir3pqnp2xza3yzxb2i02mrn3hvfy62vf-vdrift-2014-10-20-0.120ae28/share/icons/hicolor/32x32/apps
/gnu/store/ir3pqnp2xza3yzxb2i02mrn3hvfy62vf-vdrift-2014-10-20-0.120ae28/share/icons/hicolor/32x32/apps/vdrift.png
/gnu/store/ir3pqnp2xza3yzxb2i02mrn3hvfy62vf-vdrift-2014-10-20-0.120ae28/share/icons/hicolor/64x64
/gnu/store/ir3pqnp2xza3yzxb2i02mrn3hvfy62vf-vdrift-2014-10-20-0.120ae28/share/icons/hicolor/64x64/apps
/gnu/store/ir3pqnp2xza3yzxb2i02mrn3hvfy62vf-vdrift-2014-10-20-0.120ae28/share/icons/hicolor/64x64/apps/vdrift.png

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants