--- CMakeLists.txt.orig	2025-06-28 19:11:31 UTC
+++ CMakeLists.txt
@@ -100,8 +100,7 @@ else()
 		find_package(PkgConfig REQUIRED PkgConfig PkgConf)
 		pkg_check_modules(MINIZIP REQUIRED minizip)
 	else()
-		cmake_pkg_config(EXTRACT minizip REQUIRED)
-		set(MINIZIP_LIBRARIES "minizip")
+		find_library(MINIZIP_LIBRARIES NAMES minizip)
 	endif()
 endif()
 
@@ -311,19 +310,21 @@ elseif(UNIX)
 		"RMDir /r $INSTDIR")
 	include(CPack)
 elseif(UNIX)
+	include(GNUInstallDirs)
+
 	# Install the binary.
-	install(TARGETS EndlessSky CONFIGURATIONS Release RUNTIME DESTINATION games)
+	install(TARGETS EndlessSky CONFIGURATIONS Release RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
 
 	# Install the desktop file.
-	install(FILES io.github.endless_sky.endless_sky.desktop DESTINATION share/applications)
+	install(FILES io.github.endless_sky.endless_sky.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
 
 	# Install app center metadata.
-	install(FILES io.github.endless_sky.endless_sky.appdata.xml DESTINATION share/metainfo)
+	install(FILES io.github.endless_sky.endless_sky.appdata.xml DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/metainfo)
 
 	# Install icons, keeping track of all the paths.
 	# Most Ubuntu apps supply 16, 22, 24, 32, 48, and 256, and sometimes others.
 	foreach(size "16x16" "22x22" "24x24" "32x32" "48x48" "128x128" "256x256" "512x512")
-		install(FILES "icons/icon_${size}.png" DESTINATION "share/icons/hicolor/${size}/apps"
+		install(FILES "icons/icon_${size}.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${size}/apps"
 			RENAME endless-sky.png)
 	endforeach()
 
@@ -335,18 +336,18 @@ elseif(UNIX)
 		WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
 		VERBATIM)
 	target_sources(EndlessSky PRIVATE endless-sky.6.gz)
-	install(FILES ${CMAKE_CURRENT_BINARY_DIR}/endless-sky.6.gz DESTINATION share/man/man6)
+	install(FILES ${CMAKE_CURRENT_BINARY_DIR}/endless-sky.6.gz DESTINATION ${CMAKE_INSTALL_MANDIR}/man6)
 
 	# Install the resource files.
-	install(DIRECTORY data DESTINATION share/games/endless-sky)
-	install(DIRECTORY images DESTINATION share/games/endless-sky)
-	install(DIRECTORY shaders DESTINATION share/games/endless-sky)
-	install(DIRECTORY sounds DESTINATION share/games/endless-sky)
-	install(FILES credits.txt DESTINATION share/games/endless-sky)
-	install(FILES keys.txt DESTINATION share/games/endless-sky)
-	install(FILES copyright DESTINATION share/doc/endless-sky)
-	install(FILES changelog DESTINATION share/doc/endless-sky)
-	install(FILES license.txt DESTINATION share/doc/endless-sky)
+	install(DIRECTORY data DESTINATION ${CMAKE_INSTALL_DATADIR}/endless-sky)
+	install(DIRECTORY images DESTINATION ${CMAKE_INSTALL_DATADIR}/endless-sky)
+	install(DIRECTORY shaders DESTINATION ${CMAKE_INSTALL_DATADIR}/endless-sky)
+	install(DIRECTORY sounds DESTINATION ${CMAKE_INSTALL_DATADIR}/endless-sky)
+	install(FILES credits.txt DESTINATION ${CMAKE_INSTALL_DATADIR}/endless-sky)
+	install(FILES keys.txt DESTINATION ${CMAKE_INSTALL_DATADIR}/endless-sky)
+	#install(FILES copyright DESTINATION ${CMAKE_INSTALL_DOCDIR}/endless-sky)
+	install(FILES changelog DESTINATION ${CMAKE_INSTALL_DOCDIR}/endless-sky)
+	#install(FILES license.txt DESTINATION ${CMAKE_INSTALL_DOCDIR}/endless-sky)
 endif()
 
 # Create symlink to compile_commands.json from build/ so it's LSP-discoverable.
