NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.38k stars 13.6k forks source link

dosbox-staging fails to build at final linking stage #211676

Closed Zaechus closed 1 year ago

Zaechus commented 1 year ago

Steps To Reproduce

Steps to reproduce the behavior:

  1. build dosbox-staging

Build log

https://gist.github.com/Zaechus/acae0ae3a86558e77ee824d7caa6b750

Notify maintainers

@JoshuaFern @AndersonTorres

Metadata

 - system: `"x86_64-linux"`
 - host os: `Linux 5.15.86, NixOS, 23.05 (Stoat), 23.05.20230111.6c8644f`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.12.0`
 - channels(root): `"nixos-22.05"`
 - channels(zaechus): `""`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
keenanweaver commented 1 year ago

Staging recently added sdl2_image to the build dependencies.

AndersonTorres commented 1 year ago

Unscramble this will take a longer time than I expected. There are at least 10 subprojects to grab.

Zaechus commented 1 year ago

In the meantime I have a custom package of a newer dosbox-staging version that builds properly:

pkgs/dosbox-staging/default.nix:

{ stdenv
, fetchFromGitHub
, gtest
, makeWrapper
, meson
, ninja
, pkg-config
, alsa-lib
, fluidsynth
, glib
, libmt32emu
, libogg
, libpng
, libslirp
, opusfile
, SDL2
, SDL2_image
, SDL2_net
, speexdsp
, my
}:

stdenv.mkDerivation rec {
  pname = "dosbox-staging";
  version = "0.80.1";

  src = fetchFromGitHub {
    owner = pname;
    repo = pname;
    rev = "v${version}";
    hash = "sha256-I90poBeLSq1c8PXyjrx7/UcbfqFNnnNiXfJdWhLPGMc=";
  };

  nativeBuildInputs = [
    gtest
    makeWrapper
    meson
    ninja
    pkg-config
  ];

  buildInputs = [
    alsa-lib
    fluidsynth
    glib
    libmt32emu
    libogg
    libpng
    libslirp
    opusfile
    SDL2
    SDL2_image
    SDL2_net
    speexdsp
    my.iir1
  ];

  NIX_CFLAGS_COMPILE = [
    "-I${SDL2_image}/include/SDL2"
    "-I${SDL2_net}/include/SDL2"
  ];

  enableParallelBuilding = true;

  postFixup = ''
    mv $out/bin/dosbox $out/bin/${pname}
    makeWrapper $out/bin/dosbox-staging $out/bin/dosbox
  '';
}

pkgs/iir1/default.nix:

{ stdenv
, fetchFromGitHub
, cmake
}:

stdenv.mkDerivation rec {
  pname = "iir1";
  version = "1.9.4";

  src = fetchFromGitHub {
    owner = "berndporr";
    repo = pname;
    rev = "${version}";
    hash = "sha256-T8gl51IkZIGq+6D5ge4Kb3wm5aw7Rhphmnf6TTGwHbs=";
  };

  nativeBuildInputs = [
    cmake
  ];
}
Zaechus commented 1 year ago

This should be fixed by #215686.