[PR #608] [CLOSED] cargo: add features to choose origin of SDL3 #641

Closed
opened 2026-03-03 13:48:26 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/gopher64/gopher64/pull/608
Author: @PaulGrandperrin
Created: 11/4/2025
Status: Closed

Base: mainHead: feature-sdl-origin


📝 Commits (1)

  • adfee2f cargo: add features to choose origin of SDL3

📊 Changes

3 files changed (+13 additions, -3 deletions)

View changed files

📝 Cargo.lock (+2 -0)
📝 Cargo.toml (+7 -2)
📝 build.rs (+4 -1)

📄 Description

Hi!
gopher64 is packaged on NixOS but outdated (1.0.17) so I wanted to update it (and automate the process) but it is not as straightforward as it could be .

Like probably all linux distros, packaging vendored dependencies is forbidden or at least very heavily discouraged, which means packagers have to maintains software patches to force the use of system libs.

It is usually easy, but with rust/cargo, it means changes in the Cargo.lock (in addition to Cargo.toml) and since this lock file can changes heavily at each cargo update, it means the patch we need to maintain breaks all the time and needs to be recreated from scratch, which is annoying and can't be automated easily.

https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/by-name/go/gopher64/use-sdl3-via-pkg-config.patch

That's the reason why I'm suggesting you this PR to allow building gopher64 with SDL3 from the system, without using patches :)

I added two cargo features, one for SDL from source, and the other for taking it from pkg-config. The first one is enabled by default so the project works exactly as before by default.

If someone wants to use the system's SDL, they can run cargo build --no-default-features --features sdl-use-pkg-config.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/gopher64/gopher64/pull/608 **Author:** [@PaulGrandperrin](https://github.com/PaulGrandperrin) **Created:** 11/4/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feature-sdl-origin` --- ### 📝 Commits (1) - [`adfee2f`](https://github.com/gopher64/gopher64/commit/adfee2f185360892efbd68a150038c67b1e3649e) cargo: add features to choose origin of SDL3 ### 📊 Changes **3 files changed** (+13 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+2 -0) 📝 `Cargo.toml` (+7 -2) 📝 `build.rs` (+4 -1) </details> ### 📄 Description Hi! gopher64 is packaged on NixOS but outdated (1.0.17) so I wanted to update it (and automate the process) but it is not as straightforward as it could be . Like probably all linux distros, packaging vendored dependencies is forbidden or at least very heavily discouraged, which means packagers have to maintains software patches to force the use of system libs. It is usually easy, but with rust/cargo, it means changes in the `Cargo.lock` (in addition to `Cargo.toml`) and since this lock file can changes heavily at each cargo update, it means the patch we need to maintain breaks all the time and needs to be recreated from scratch, which is annoying and can't be automated easily. https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/by-name/go/gopher64/use-sdl3-via-pkg-config.patch That's the reason why I'm suggesting you this PR to allow building gopher64 with SDL3 from the system, without using patches :) I added two cargo features, one for SDL from source, and the other for taking it from pkg-config. The first one is enabled by default so the project works exactly as before by default. If someone wants to use the system's SDL, they can run `cargo build --no-default-features --features sdl-use-pkg-config`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 13:48:26 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/gopher64#641
No description provided.