unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: "Nguyễn Gia Phong via Bug reports for GNU Guix" <bug-guix@gnu.org>
To: 66699@debbugs.gnu.org, ekaitz@elenq.tech
Subject: bug#66699: zig: fail to link SDL2
Date: Mon, 23 Oct 2023 16:34:22 +0900	[thread overview]
Message-ID: <CWFN02XCWX0T.2T2PRVXKN89Y@guix> (raw)

[-- Attachment #1: Type: text/plain, Size: 1680 bytes --]

I am trying to package Mepo, an OpenStreetMap frontend written in Zig.
The currently packaged Zig fails to find transitive dependencies of SDL2:
https://paste.sr.ht/~cnx/db21e1ef9a6828f3ec898db43b790d71b5ef213a

Here's a minimal reproducible Zig project:

// main.zig
const c = @cImport(@cInclude("SDL2/SDL.h"));
pub fn main() !void {
    if (c.SDL_Init(c.SDL_INIT_VIDEO) != 0)
        return error.SDLInitializationFailed;
    c.SDL_Quit();
}

// build.zig
pub fn build(b: *@import("std").build.Builder) void {
    const exe = b.addExecutable("sdl2-smoke-test", "main.zig");
    exe.linkSystemLibrary("SDL2");
    exe.setTarget(b.standardTargetOptions(.{}));
    exe.setBuildMode(b.standardReleaseOptions());
    exe.install();
}

For convenience, here goes a manifest for use with guix build -f:

(use-modules (guix build-system zig)
             (guix gexp)
             (guix licenses)
             (guix packages)
             (gnu packages pkg-config)
             (gnu packages sdl))
(package
  (name "sdl2-smoke-test")
  (version "0.0.0")
  (source (local-file "." "sdl2-smoke-test" #:recursive? #t))
  (build-system zig-build-system)
  (arguments (list #:tests? #f
                   #:zig-release-type "safe"))
  (native-inputs (list pkg-config))
  (inputs (list sdl2))
  (synopsis "Zig build system SDL2 linkage failure reproducer")
  (description
    (string-append "This is a reproducer of zig-build-system"
                   " failing to link SDL2's transitive dependencies,"
                   " as seen when trying to package mepo."))
  (home-page "https://larkspur.one/notice/Ab24w1IMGVoZ72J9xg")
  (license zlib))

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 248 bytes --]

             reply	other threads:[~2023-10-26 21:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-23  7:34 Nguyễn Gia Phong via Bug reports for GNU Guix [this message]
2023-11-01 20:52 ` bug#66699: zig: fail to link SDL2 Ekaitz Zarraga
     [not found]   ` <CWUUZFWJPNL0.20MWDY132FY6E@guix>
2023-11-10  9:57     ` Ekaitz Zarraga
2023-11-11 13:23       ` Ekaitz Zarraga

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CWFN02XCWX0T.2T2PRVXKN89Y@guix \
    --to=bug-guix@gnu.org \
    --cc=66699@debbugs.gnu.org \
    --cc=cnx@loang.net \
    --cc=ekaitz@elenq.tech \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).