push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,83 @@
{
stdenv,
lib,
requireFile,
writeText,
fetchFromGitHub,
haskellPackages,
}:
let
makeSpin =
num:
let
padded = (lib.optionalString (lib.lessThan num 10) "0") + toString num;
in
"slides.spins.${padded} = 3DOVID:"
+ "addons/3dovideo/spins/ship${padded}.duk:"
+ "addons/3dovideo/spins/spin.aif:"
+ "addons/3dovideo/spins/ship${padded}.aif:89";
videoRMP = writeText "3dovideo.rmp" (
''
slides.ending = 3DOVID:addons/3dovideo/ending/victory.duk
slides.intro = 3DOVID:addons/3dovideo/intro/intro.duk
''
+ lib.concatMapStrings makeSpin (lib.range 0 24)
);
helper =
with haskellPackages;
mkDerivation rec {
pname = "uqm3donix";
version = "0.1.0.0";
src = fetchFromGitHub {
owner = "aszlig";
repo = "uqm3donix";
rev = "v${version}";
hash = "sha256-rK30u2PBysiSGSA9829F1Nom/wtoVN6rGTBneRKeWEw=";
};
isLibrary = false;
isExecutable = true;
buildDepends = [
base
binary
bytestring
filepath
tar
];
description = "Extract video files from a Star Control II 3DO image";
license = lib.licenses.bsd3;
};
in
stdenv.mkDerivation {
name = "uqm-3dovideo";
src = requireFile rec {
name = "videos.tar";
sha256 = "044h0cl69r0kc43vk4n0akk0prwzb7inq324h5yfqb38sd4zkds1";
message = ''
In order to get the intro and ending sequences from the 3DO version, you
need to have the original 3DO Star Control II CD. Create an image from
the CD and use uqm3donix* to extract a tarball with the videos from it.
The reason for this is because the 3DO uses its own proprietary disk
format.
Save the file as videos.tar and use "nix-prefetch-url file://\$PWD/${name}" to
add it to the Nix store.
[*] ${helper}/bin/uqm3donix CDIMAGE ${name}
'';
};
buildCommand = ''
mkdir -vp "$out"
tar xf "$src" -C "$out" --strip-components=3
cp "${videoRMP}" "$out/3dovideo.rmp"
'';
}

View File

@@ -0,0 +1,155 @@
{
stdenv,
lib,
fetchurl,
fetchFromGitHub,
pkg-config,
libGLU,
libGL,
SDL2,
libpng,
libvorbis,
libogg,
libmikmod,
use3DOVideos ? false,
requireFile ? null,
writeText ? null,
haskellPackages ? null,
useRemixPacks ? false,
}:
assert use3DOVideos -> requireFile != null && writeText != null && haskellPackages != null;
let
videos = import ./3dovideo.nix {
inherit
stdenv
lib
requireFile
writeText
fetchFromGitHub
haskellPackages
;
};
remixPacks =
lib.imap1
(
num: sha256:
fetchurl rec {
name = "uqm-remix-disc${toString num}.uqm";
url = "mirror://sourceforge/sc2/${name}";
inherit sha256;
}
)
[
"1s470i6hm53l214f2rkrbp111q4jyvnxbzdziqg32ffr8m3nk5xn"
"1pmsq65k8gk4jcbyk3qjgi9yqlm0dlaimc2r8hz2fc9f2124gfvz"
"07g966ylvw9k5q9jdzqdczp7c5qv4s91xjlg4z5z27fgcs7rzn76"
"1l46k9aqlcp7d3fjkjb3n05cjfkxx8rjlypgqy0jmdx529vikj54"
];
in
stdenv.mkDerivation rec {
pname = "uqm";
version = "0.8.0";
src = fetchurl {
url = "mirror://sourceforge/sc2/uqm-${version}-src.tgz";
sha256 = "JPL325z3+vU7lfniWA5vWWIFqY7QwzXP6DTGR4WtT1o=";
};
content = fetchurl {
url = "mirror://sourceforge/sc2/uqm-${version}-content.uqm";
sha256 = "d9dawl5vt1WjPEujs4p7e8Qfy8AolokbDMmskhS3Lu8=";
};
voice = fetchurl {
url = "mirror://sourceforge/sc2/uqm-${version}-voice.uqm";
sha256 = "ntv1HXfYtTM5nF86+1STFKghDXqrccosUbTySDIzekU=";
};
music = fetchurl {
url = "mirror://sourceforge/sc2/uqm-${version}-3domusic.uqm";
sha256 = "RM087H6VabQRettNd/FSKJCXJWYmc5GuCWMUhdIx2Lk=";
};
nativeBuildInputs = [ pkg-config ];
buildInputs = [
SDL2
libpng
libvorbis
libogg
libmikmod
libGLU
libGL
];
postUnpack = ''
mkdir -p uqm-${version}/content/packages
mkdir -p uqm-${version}/content/addons
ln -s "$content" "uqm-${version}/content/packages/uqm-${version}-content.uqm"
ln -s "$music" "uqm-${version}/content/addons/uqm-${version}-3domusic.uqm"
ln -s "$voice" "uqm-${version}/content/addons/uqm-${version}-voice.uqm"
''
+ lib.optionalString useRemixPacks (
lib.concatMapStrings (disc: ''
ln -s "${disc}" "uqm-$version/content/addons/${disc.name}"
'') remixPacks
)
+ lib.optionalString use3DOVideos ''
ln -s "${videos}" "uqm-${version}/content/addons/3dovideo"
'';
postPatch = ''
# Using _STRINGS_H as include guard conflicts with glibc.
sed -i -e '/^#/s/_STRINGS_H/_UQM_STRINGS_H/g' src/uqm/comm/*/strings.h
# See https://github.com/NixOS/nixpkgs/pull/93560
sed -i -e 's,/tmp/,$TMPDIR/,' build/unix/config_functions
'';
# uqm has a 'unique' build system with a root script incidentally called
# 'build.sh'.
configurePhase = ''
runHook preConfigure
echo "INPUT_install_prefix_VALUE='$out'" >> config.state
echo "INPUT_install_bindir_VALUE='$out/bin'" >> config.state
echo "INPUT_install_libdir_VALUE='$out/lib'" >> config.state
echo "INPUT_install_sharedir_VALUE='$out/share'" >> config.state
PREFIX=$out ./build.sh uqm config
runHook postConfigure
'';
buildPhase = ''
./build.sh uqm
'';
installPhase = ''
./build.sh uqm install
sed -i $out/bin/uqm -e "s%/usr/local/games/%$out%g"
'';
meta = {
description = "Remake of Star Control II";
mainProgram = "uqm";
longDescription = ''
The goals for the The Ur-Quan Masters project are:
- to bring Star Control II to modern platforms, thereby making a lot of
people happy
- to make game translations easy, thereby making even more people happy
- to adapt the code so that people can more easily make their own
spin-offs, thereby making zillions more people happy!
'';
homepage = "https://sc2.sourceforge.net/";
license = lib.licenses.gpl2Plus;
maintainers = with lib.maintainers; [
jcumming
aszlig
];
platforms = with lib.platforms; linux;
};
}

View File

@@ -0,0 +1,57 @@
{
stdenv,
lib,
fetchgit,
cmake,
perl,
libubox,
json_c,
}:
stdenv.mkDerivation {
pname = "uqmi";
version = "unstable-2024-01-16";
src = fetchgit {
url = "https://git.openwrt.org/project/uqmi.git";
rev = "c3488b831ce6285c8107704156b9b8ed7d59deb3";
hash = "sha256-O5CeLk0WYuBs3l5xBUk9kXDRMzFvYSRoqP28KJ5Ztos=";
};
postPatch = ''
substituteInPlace data/gen-header.pl --replace /usr/bin/env ""
patchShebangs .
'';
nativeBuildInputs = [
cmake
perl
];
buildInputs = [
libubox
json_c
];
env.NIX_CFLAGS_COMPILE = toString (
lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [
# Needed with GCC 12 but breaks on darwin (with clang) or older gcc
"-Wno-error=dangling-pointer"
"-Wno-error=maybe-uninitialized"
]
++ lib.optionals stdenv.cc.isClang [
"-Wno-error=sometimes-uninitialized"
]
);
meta = with lib; {
description = "Tiny QMI command line utility";
homepage = "https://git.openwrt.org/?p=project/uqmi.git;a=summary";
license = licenses.gpl2Plus;
platforms = platforms.all;
maintainers = with maintainers; [
fpletz
mkg20001
];
mainProgram = "uqmi";
};
}