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,35 @@
{
lib,
buildDotnetModule,
fetchFromGitHub,
dotnetCorePackages,
}:
buildDotnetModule {
pname = "depotdownloader";
version = "2.7.4-unstable-2024-12-01";
src = fetchFromGitHub {
owner = "Iluhadesu";
repo = "DepotDownloader";
rev = "a9f58e5513b72bd00b623a83e1460b3c5db49248";
hash = "sha256-+QfwKQJzyXqUvTn8kKP7lYHvbtRtdJ7jc/W7E87tV7w=";
};
projectFile = "DepotDownloader.sln";
nugetDeps = ./deps.json;
dotnet-sdk = dotnetCorePackages.sdk_8_0;
dotnet-runtime = dotnetCorePackages.runtime_8_0;
meta = {
description = "Fork of DepotDownloader to be used by BSManager";
license = lib.licenses.gpl2Only;
platforms = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
mainProgram = "DepotDownloader";
};
}

View File

@@ -0,0 +1,67 @@
[
{
"pname": "Microsoft.NETCore.Platforms",
"version": "5.0.0",
"hash": "sha256-LIcg1StDcQLPOABp4JRXIs837d7z0ia6+++3SF3jl1c="
},
{
"pname": "Microsoft.Win32.Registry",
"version": "5.0.0",
"hash": "sha256-9kylPGfKZc58yFqNKa77stomcoNnMeERXozWJzDcUIA="
},
{
"pname": "Microsoft.Windows.CsWin32",
"version": "0.3.106",
"hash": "sha256-S1uQa684taPb6uh69784ebVpXoirMoX+pxBRA+Rrzlg="
},
{
"pname": "Microsoft.Windows.SDK.Win32Docs",
"version": "0.1.42-alpha",
"hash": "sha256-6DvzmNzrGVfWmNJNqooj+Ya+7bAQlyeg7pmyKaUlIws="
},
{
"pname": "Microsoft.Windows.SDK.Win32Metadata",
"version": "60.0.34-preview",
"hash": "sha256-KdRe73sXipzMvm2BLmwwBZGh+l9isZDC9l8WFyUR1zM="
},
{
"pname": "Microsoft.Windows.WDK.Win32Metadata",
"version": "0.11.4-experimental",
"hash": "sha256-b3oKUKbr+3Udfl7RWzUY9BR/XWNsN+VmEkBxk6KiFo0="
},
{
"pname": "protobuf-net",
"version": "3.2.30",
"hash": "sha256-keRy5OWT+/tlZt3D7x+9PEdjTvEJcZdYsf/i1ZBtciE="
},
{
"pname": "protobuf-net.Core",
"version": "3.2.30",
"hash": "sha256-GMpJNecoBfrV2VgpYOhcZnKZaLFDObNLcX2LBTThrwY="
},
{
"pname": "SteamKit2",
"version": "3.0.0-beta.4",
"hash": "sha256-7cXlpCuUD8ZuTMtqsT5MdklkZb+XIGBdoI28anjUXtg="
},
{
"pname": "System.Collections.Immutable",
"version": "7.0.0",
"hash": "sha256-9an2wbxue2qrtugYES9awshQg+KfJqajhnhs45kQIdk="
},
{
"pname": "System.IO.Hashing",
"version": "8.0.0",
"hash": "sha256-szOGt0TNBo6dEdC3gf6H+e9YW3Nw0woa6UnCGGGK5cE="
},
{
"pname": "System.Security.AccessControl",
"version": "5.0.0",
"hash": "sha256-ueSG+Yn82evxyGBnE49N4D+ngODDXgornlBtQ3Omw54="
},
{
"pname": "System.Security.Principal.Windows",
"version": "5.0.0",
"hash": "sha256-CBOQwl9veFkrKK2oU8JFFEiKIh/p+aJO+q9Tc2Q/89Y="
}
]

View File

@@ -0,0 +1,151 @@
{
lib,
stdenv,
callPackage,
nix-update-script,
buildNpmPackage,
fetchNpmDeps,
fetchFromGitHub,
makeDesktopItem,
autoPatchelfHook,
copyDesktopItems,
makeWrapper,
electron,
steam-run-free,
}:
buildNpmPackage (finalAttrs: {
pname = "bs-manager";
version = "1.5.4";
src = fetchFromGitHub {
owner = "Zagrios";
repo = "bs-manager";
tag = "v${finalAttrs.version}";
hash = "sha256-YitQjhnadQrpdBOV2CUedRNm/RW7/rpXtS9PJTa9kUU=";
};
postPatch = ''
# don't search for resources in electron's resource directory, but our own
substituteInPlace src/main/services/utils.service.ts \
--replace-fail "process.resourcesPath" "'$out/share/bs-manager/resources'"
# replace vendored DepotDownloader with our own
rm assets/scripts/DepotDownloader
ln -s ${finalAttrs.passthru.depotdownloader}/bin/DepotDownloader assets/scripts/DepotDownloader
'';
npmDepsHash = "sha256-3NMqYD7S4wYjwYuGJOmq2/C82qtG1mImsR4crjFLe30=";
extraNpmDeps = fetchNpmDeps {
name = "bs-manager-${finalAttrs.version}-extra-npm-deps";
inherit (finalAttrs) src;
sourceRoot = "${finalAttrs.src.name}/release/app";
hash = "sha256-UWsxty1kfxMr5fybtykrN2G+yiQ9dw/bbMwfcVLJgp4=";
};
makeCacheWritable = true;
env.ELECTRON_SKIP_BINARY_DOWNLOAD = "1";
npmRebuildFlags = [ "--ignore-scripts" ];
nativeBuildInputs = [
autoPatchelfHook # for some prebuilt node deps: query-process @resvg/resvg-js
copyDesktopItems
makeWrapper
];
buildInputs = [
stdenv.cc.cc
];
preBuild = ''
pushd release/app
rm -r "$npm_config_cache"
npmDeps="$extraNpmDeps" npmConfigHook
npm run postinstall
popd
'';
postBuild = ''
cp -r ${electron.dist} electron-dist
chmod -R u+w electron-dist
npm exec electron-builder -- \
--dir \
--config=electron-builder.config.js \
-c.electronDist=electron-dist \
-c.electronVersion=${electron.version}
'';
installPhase = ''
runHook preInstall
for icon in build/icons/png/*.png; do
install -Dm644 $icon $out/share/icons/hicolor/$(basename $icon .png)/apps/bs-manager.png
done
mkdir -p $out/share/bs-manager
cp -r release/build/*-unpacked/{locales,resources{,.pak}} $out/share/bs-manager
makeWrapper ${lib.getExe electron} $out/bin/bs-manager \
--set-default ELECTRON_FORCE_IS_PACKAGED 1 \
--add-flags $out/share/bs-manager/resources/app.asar \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" \
--prefix PATH : ${lib.makeBinPath [ steam-run-free ]} \
--inherit-argv0
runHook postInstall
'';
desktopItems = [
(makeDesktopItem {
desktopName = "BSManager";
name = "BSManager";
exec = "bs-manager";
terminal = false;
type = "Application";
icon = "bs-manager";
mimeTypes = [
"x-scheme-handler/bsmanager"
"x-scheme-handler/beatsaver"
"x-scheme-handler/bsplaylist"
"x-scheme-handler/modelsaber"
"x-scheme-handler/web+bsmap"
];
categories = [
"Utility"
"Game"
];
})
];
passthru = {
updateScript = nix-update-script { };
depotdownloader = callPackage ./depotdownloader { };
};
meta = {
changelog = "https://github.com/Zagrios/bs-manager/blob/${finalAttrs.src.rev}/CHANGELOG.md";
description = "Your Beat Saber Assistant";
homepage = "https://github.com/Zagrios/bs-manager";
license = lib.licenses.gpl3Only;
mainProgram = "bs-manager";
maintainers = with lib.maintainers; [
mistyttm
Scrumplex
ImSapphire
tomasajt
];
platforms = lib.platforms.linux;
sourceProvenance = with lib.sourceTypes; [
binaryNativeCode # prebuilt node deps
];
};
})

View File

@@ -0,0 +1,42 @@
{
lib,
stdenv,
fetchFromGitHub,
pkg-config,
python3,
wafHook,
libbs2b,
lv2,
}:
stdenv.mkDerivation rec {
pname = "bs2b-lv2";
version = "1.1.1";
src = fetchFromGitHub {
owner = "nilninull";
repo = "bs2b-lv2";
tag = "v${version}";
fetchSubmodules = true;
hash = "sha256-dOcDPtiKN9Kfs2cdaeDO/GkWrh5tfJSHfiHPBtxJXvc=";
};
nativeBuildInputs = [
pkg-config
python3
wafHook
];
buildInputs = [
libbs2b
lv2
];
meta = with lib; {
description = "LV2 plugin for using Bauer stereophonic-to-binaural DSP library";
homepage = "https://github.com/nilninull/bs2b-lv2";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ orivej ];
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,44 @@
{
lib,
stdenv,
fetchFromGitHub,
llvmPackages,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "bsc";
version = "3.3.6";
src = fetchFromGitHub {
owner = "IlyaGrebnov";
repo = "libbsc";
tag = "v${finalAttrs.version}";
hash = "sha256-iUFKTDSAg2/57TPvR0nlmfVN2Z6O9kZKIg+BQQKvr/o=";
};
enableParallelBuilding = true;
buildInputs = lib.optional stdenv.hostPlatform.isDarwin llvmPackages.openmp;
postPatch = lib.optional (!stdenv.hostPlatform.isx86) ''
substituteInPlace makefile \
--replace-fail "-mavx2" ""
substituteInPlace makefile.cuda \
--replace-fail "-mavx2" ""
'';
makeFlags = [
"CC=$(CXX)"
"PREFIX=${placeholder "out"}"
];
meta = {
description = "High performance block-sorting data compression library";
homepage = "http://libbsc.com/";
maintainers = with lib.maintainers; [ sigmanificient ];
license = lib.licenses.asl20;
platforms = lib.platforms.unix;
mainProgram = "bsc";
};
})

View File

@@ -0,0 +1,40 @@
{
lib,
stdenv,
fetchFromGitHub,
pkg-config,
cairo,
libX11,
lv2,
}:
stdenv.mkDerivation rec {
pname = "bschaffl";
version = "1.4.10";
src = fetchFromGitHub {
owner = "sjaehn";
repo = "bschaffl";
tag = version;
sha256 = "sha256-zfhPYH4eUNWHV27ZtX2IIvobyPdKs5yGr/ryJRQa6as=";
};
nativeBuildInputs = [ pkg-config ];
buildInputs = [
cairo
libX11
lv2
];
installFlags = [ "PREFIX=$(out)" ];
enableParallelBuilding = true;
meta = with lib; {
homepage = "https://github.com/sjaehn/BSchaffl";
description = "Pattern-controlled MIDI amp & time stretch LV2 plugin";
maintainers = [ maintainers.magnetophon ];
platforms = platforms.linux;
license = licenses.gpl3;
};
}

View File

@@ -0,0 +1,209 @@
{
lib,
stdenv,
fetchurl,
fetchpatch,
# Configurable options
buildProduct ? # can be "client" or "daemon"
if buildClient != null then
lib.warn ''
buildClient is deprecated;
use buildProduct instead
'' (if buildClient then "client" else "daemon")
else
"client",
# Deprecated options
# Remove them before next version of either Nixpkgs or bsd-finger itself
buildClient ? null,
}:
assert lib.elem buildProduct [
"client"
"daemon"
];
stdenv.mkDerivation (finalAttrs: {
pname = "bsd-finger" + lib.optionalString (buildProduct == "daemon") "d";
version = "0.17";
src = fetchurl {
url = "http://ftp.de.debian.org/debian/pool/main/b/bsd-finger/bsd-finger_${finalAttrs.version}.orig.tar.bz2";
hash = "sha256-KLNNYF0j6mh9eeD8SMA1q+gPiNnBVH56pGeW0QgcA2M=";
};
patches =
let
debianRevision = "17";
generateUrl =
patchName:
"https://sources.debian.org/data/main/b/bsd-finger/${finalAttrs.version}-${debianRevision}/debian/patches/${patchName}.patch";
in
[
# Patches original finger sources to make the programs more robust and
# compatible
(fetchpatch {
url = generateUrl "01-legacy";
hash = "sha256-84znJLXez4w6WB2nOW+PHK/0srE0iG9nGAjO1/AGczw=";
})
# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=518559
#
# Doesn't work with a non-iterable nsswitch source
#
# Currently, "finger tabbott" works by iterating through the list of users
# on the system using getpwent and checking if any of them match
# "tabbott".
#
# Some nsswitch backends (including Hesiod and LDAP[1]) do not support
# iterating through the complete list of users. These nsswitch backends
# instead only fully support looking up a user's information by username
# or uid.
#
# So, if tabbott is a user whose nsswitch information comes from LDAP,
# then "finger tabbott" will incorrectly report "finger: tabbott: no such
# user." "finger -m tabbott" does work correctly, however, because it
# looks up the matching username using getpwnam.
#
# A fix for this is to always look up an argument to finger for a username
# match, and having -m only control whether finger searches the entire
# user database for real name matches. Patch attached.
#
# This patch has the advantageous side effect that if there are some real
# name matches and a username match, finger will always display the
# username match first (rather than in some random place in the list).
#
# -Tim Abbott
#
# [1] with LDAP, it is typically the case that one can iterate through
# only the first 100 results from a query.
(fetchpatch {
url = generateUrl "02-518559-nsswitch-sources";
hash = "sha256-oBXJ/kr/czevWk0TcsutGINNwCoHnEStRT8Jfgp/lbM=";
})
# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=468454
# Implement IPv6 capacity for the server Fingerd.
(fetchpatch {
url = generateUrl "03-468454-fingerd-ipv6";
hash = "sha256-a5+qoy2UKa2nCJrwrfJ5VPZoACFXFQ1j/rweoMYW1Z0=";
})
# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=468454
# Implement IPv6 capability for the client Finger.
(fetchpatch {
url = generateUrl "04-468454-finger-ipv6";
hash = "sha256-cg93NL02lJm/5Freegb3EbjDAQVkurLEEJifcyQRRfk=";
})
# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=547014
# From: "Matthew A. Dunford" <mdunford@lbl.gov>
#
# finger segfaults when it comes across a netgroup entry in /etc/passwd.
# A netgroup entry doesn't include many of the fields in a normal passwd
# entry, so pw->pw_gecos is set to NULL, which causes finger to core dump.
#
# Here is part of a /etc/passwd file with a netgroup entry:
#
# nobody:x:65534:65534:nobody:/nonexistent:/bin/sh +@operator
#
# This patch sidesteps what finger considers a malformed passwd entry:
(fetchpatch {
url = generateUrl "05-547014-netgroup";
hash = "sha256-d+ufp7nPZwW+t+EWASzHrXT/O6zSzt6OOV12cKVo3P0=";
})
# Decrease timeout length during connect().
# In cases where a name server is answering with A as well as AAAA
# records, but the system to be queried has lost a corresponding address,
# the TCP handshake timeout will cause a long delay before allowing the
# query of the next address family, or the next address in general.
# .
# The use of a trivial signal handler for SIGALRM allows the reduction of
# this timeout, thus producing better responsiveness for the interactive
# user of the Finger service.
# Author: Mats Erik Andersson <debian@gisladisker.se>
(fetchpatch {
url = generateUrl "06-572211-decrease-timeout";
hash = "sha256-KtNGU5mmX1nnxQc7XnYoUuVW4We2cF81+x6EQrHF7g0=";
})
# Use cmake as build system
(fetchpatch {
url = generateUrl "use-cmake-as-buildsystem";
hash = "sha256-YOmkF6Oxowy15mCE1pCvHKnLEXglijWFG6eydnZJFhM=";
})
# Debian-specific changes to the cmake build system (that NixOS will also
# benefit from)
# Adds -D_GNU_SOURCE, which will enable many C extensions that finger
# benefits from
(fetchpatch {
url = generateUrl "use-cmake-as-buildsystem-debian-extras";
hash = "sha256-T3DWpyyz15JCiVJ41RrJEhsmicei8G3OaKpxvzOCcBU=";
})
# Fix typo at fingerd man page (Josue Ortega <josue@debian.org>)
(fetchpatch {
url = generateUrl "fix-fingerd-man-typo";
hash = "sha256-f59osGi0a8Tkm2Vxg2+H2brH8WproCDvbPf4jXwi6ag=";
})
];
env.NIX_CFLAGS_COMPILE = "-D_GNU_SOURCE";
preBuild =
let
subdir =
{
"client" = "finger";
"daemon" = "fingerd";
}
.${buildProduct};
in
''
cd ${subdir}
'';
preInstall =
let
bindir =
{
"client" = "bin";
"daemon" = "sbin";
}
.${buildProduct};
mandir =
{
"client" = "man1";
"daemon" = "man8";
}
.${buildProduct};
in
''
mkdir -p $out/${bindir} $out/man/${mandir}
'';
postInstall = lib.optionalString (buildProduct == "daemon") ''
pushd $out/sbin
ln -s in.fingerd fingerd
popd
'';
meta = {
description =
{
"client" = "User information lookup program";
"daemon" = "Remote user information server";
}
.${buildProduct};
license = lib.licenses.bsdOriginal;
mainProgram =
{
"client" = "finger";
"daemon" = "fingerd";
}
.${buildProduct};
maintainers = [ ];
platforms = lib.platforms.linux;
};
})

View File

@@ -0,0 +1,86 @@
{
lib,
stdenv,
fetchurl,
perl,
libtool,
pkg-config,
gettext,
mandoc,
ed,
}:
stdenv.mkDerivation rec {
pname = "bsdbuild";
version = "3.1";
src = fetchurl {
url = "http://stable.hypertriton.com/bsdbuild/${pname}-${version}.tar.gz";
sha256 = "1zrdjh7a6z4khhfw9zrp490afq306cpl5v8wqz2z55ys7k1n5ifl";
};
buildInputs = [
perl
mandoc
ed
];
nativeBuildInputs = [
pkg-config
libtool
gettext
];
prePatch = ''
#ignore unfamiliar flags
substituteInPlace configure \
--replace '--sbindir=*' '--sbindir=* | --includedir=* | --oldincludedir=*'
#same for packages using bsdbuild
substituteInPlace mkconfigure.pl \
--replace '--sbindir=*' '--sbindir=* | --includedir=* | --oldincludedir=*'
#insert header for missing NULL macro
for f in db4.pm sdl_ttf.pm mysql.pm uim.pm strlcpy.pm getpwuid.pm \
getaddrinfo.pm strtoll.pm free_null.pm getpwnam_r.pm \
gettimeofday.pm gethostbyname.pm xinerama.pm strsep.pm \
fontconfig.pm gettext.pm pthreads.pm strlcat.pm kqueue.pm wgl.pm \
alsa.pm crypt.pm cracklib.pm freesg-rg.pm edacious.pm mmap.pm \
agar.pm x11.pm x11.pm execvp.pm agar-core.pm dyld.pm getopt.pm \
strtold.pm sdl_image.pm shl_load.pm glx.pm percgi.pm timerfd.pm \
glob.pm dlopen.pm freesg.pm csidl.pm perl.pm select.pm \
portaudio.pm etubestore.pm;
do
ed -s -v BSDBuild/$f << EOF
/#include
i
#include <stddef.h>
.
w
EOF
done
'';
configureFlags = [
"--with-libtool=${libtool}/bin/libtool"
"--enable-nls=yes"
"--with-gettext=${gettext}"
"--with-manpages=yes"
];
meta = {
homepage = "http://bsdbuild.hypertriton.com";
description = "Cross-platform build system";
longDescription = ''
BSDBuild is a cross-platform build system. Derived from the
traditional 4.4BSD make libraries, BSDBuild allows BSD-style
Makefiles (without BSD make extensions), and works natively
under most operating systems and make flavors. Since BSDBuild
is implemented as a library (as opposed to a macro package),
Makefiles are edited directly, as opposed to being compiled
(however, if the build directory is separate from the source
directory, BSDBuild will produce the required Makefiles in place).
'';
license = lib.licenses.bsd3;
platforms = lib.platforms.linux;
};
}

View File

@@ -0,0 +1,111 @@
{
lib,
stdenv,
fetchurl,
ncurses,
openssl,
flex,
bison,
less,
miscfiles,
fetchpatch,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "bsd-games";
version = "2.17";
src = fetchurl {
url = "mirror://ibiblioPubLinux/games/bsd-games-${finalAttrs.version}.tar.gz";
hash = "sha256-Bm+SSu9sHF6pRvWI428wMCH138CTlEc48CXY7bxv/2A=";
};
buildInputs = [
ncurses
openssl
flex
bison
];
patches = [
# Follow All patches from http://t2sde.org/packages/bsd-games.html
# May be removed in the next version
(fetchpatch {
url = "http://svn.exactcode.de/t2/trunk/package/games/bsd-games/delay_output-sym.patch";
hash = "sha256-qbtp2cJVmEuxbTgpXM2gRHSNLE25OCmNxK+aeBBPRBw=";
})
(fetchpatch {
url = "http://svn.exactcode.de/t2/trunk/package/games/bsd-games/dm-noutmpx.patch";
hash = "sha256-oioJ5M7DAUVzX8k998p2h/APn8azw9Z8txmBuly2ouw=";
})
(fetchpatch {
url = "http://svn.exactcode.de/t2/trunk/package/games/bsd-games/hotfix-gcc43.patch";
hash = "sha256-9pkJmEOmM5vd/5nm3AlsbJNX0oX1kCtFrmciGpStvlA=";
})
(fetchpatch {
url = "http://svn.exactcode.de/t2/trunk/package/games/bsd-games/hotfix-glibc.patch";
hash = "sha256-yNL88XORTXl2qSYTlYCYDN2G++TzBxywBpYdK+ufwrA=";
})
(fetchpatch {
url = "http://svn.exactcode.de/t2/trunk/package/games/bsd-games/hotfix.patch";
hash = "sha256-UFXvtfVzJLRWvzbv0gaoVdt0vZOUj4UWWqoCZL/BDqE=";
})
(fetchpatch {
url = "http://svn.exactcode.de/t2/trunk/package/games/bsd-games/postfix-bsd.patch";
hash = "sha256-Noqq+FpSJb3heejGGHyLYYkHB3fC4qCv/p1XMfEGdx8=";
})
];
hardeningDisable = [ "format" ];
makeFlags = [ "STRIP=" ];
preConfigure = ''
cat > config.params << EOF
bsd_games_cfg_man6dir=$out/share/man/man6
bsd_games_cfg_man8dir=$out/share/man/man8
bsd_games_cfg_man5dir=$out/share/man/man5
bsd_games_cfg_wtf_acronymfile=$out/share/misc/acronyms
bsd_games_cfg_fortune_dir=$out/share/games/fortune
bsd_games_cfg_quiz_dir=$out/share/games/quiz
bsd_games_cfg_gamesdir=$out/bin
bsd_games_cfg_sbindir=$out/bin
bsd_games_cfg_usrbindir=$out/bin
bsd_games_cfg_libexecdir=$out/lib/games/dm
bsd_games_cfg_docdir=$out/share/doc/bsd-games
bsd_games_cfg_sharedir=$out/share/games
bsd_games_cfg_varlibdir=.
bsd_games_cfg_non_interactive=y
bsd_games_cfg_no_build_dirs="dab hack phantasia sail"
bsd_games_cfg_dictionary_src=${miscfiles}/share/web2
bsd_games_cfg_pager=${less}
EOF
sed -e '/sigpause/d' -i hunt/hunt/otto.c
'';
postConfigure = ''
sed -i -e 's,/usr,'$out, \
-e "s,-o root -g root, ," \
-e "s,-o root -g games, ," \
-e "s,.*chown.*,true," \
-e 's/install -c -m 2755/install -Dm755/' \
-e 's/INSTALL_VARDATA.*/INSTALL_VARDATA := true/' \
-e 's/INSTALL_HACKDIR.*/INSTALL_HACKDIR := true/' \
-e 's/INSTALL_DM.*/INSTALL_DM := true/' \
-e 's/INSTALL_SCORE_FILE.*/INSTALL_SCORE_FILE := true/' \
Makeconfig install-man
'';
preInstall = ''
mkdir -p $out/bin
'';
meta = {
homepage = "http://www.t2-project.org/packages/bsd-games.html";
description = "Ports of all the games from NetBSD-current that are free";
license = lib.licenses.free;
maintainers = with lib.maintainers; [ viric ];
platforms = with lib.platforms; linux;
};
})

View File

@@ -0,0 +1,384 @@
Description: patch for CVE-2020-14315
A memory corruption vulnerability is present in bspatch as shipped in
Colin Percivals bsdiff tools version 4.3. Insufficient checks when
handling external inputs allows an attacker to bypass the sanity checks
in place and write out of a dynamically allocated buffer boundaries.
Source: https://svnweb.freebsd.org/base/head/usr.bin/bsdiff/bspatch/bspatch.c?revision=352742&view=co
Author: tony mancill <tmancill@debian.org>
Comment: The patch was created by comparing the Debian sources to the
"Confirmed Patched Version" [1] documented in the
X41 D-SEC GmbH Security Advisory: X41-2020-006 [2].
References to FreeBSD capsicum have been dropped. Definitions for
TYPE_MINIMUM and TYPE_MAXIMUM have been borrowed from the Debian
coreutils package sources but originate in gnulib [3] and are used to
define OFF_MIN and OFF_MAX (limits of off_t). Whitespace changes from
the confirmed patched version are also included and keep the difference
between the Debian sources and the confirmed patched version minimal.
.
[1] https://svnweb.freebsd.org/base/head/usr.bin/bsdiff/bspatch/bspatch.c?revision=352742&view=co
[2] https://www.openwall.com/lists/oss-security/2020/07/09/2
[3] https://www.gnu.org/software/gnulib/
Last-Update: 2021-04-03
Forwarded: not-needed
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=964796
--- a/bspatch.c
+++ b/bspatch.c
@@ -1,4 +1,6 @@
/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
* Copyright 2003-2005 Colin Percival
* All rights reserved
*
@@ -24,56 +26,148 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include <sys/cdefs.h>
#if 0
-__FBSDID("$FreeBSD: src/usr.bin/bsdiff/bspatch/bspatch.c,v 1.1 2005/08/06 01:59:06 cperciva Exp $");
+__FBSDID("$FreeBSD$");
#endif
#include <bzlib.h>
-#include <stdlib.h>
+#include <err.h>
+#include <fcntl.h>
+#include <libgen.h>
+#include <limits.h>
+#include <stdint.h>
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
-#include <err.h>
#include <unistd.h>
-#include <fcntl.h>
+
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
+#define HEADER_SIZE 32
+
+/* TYPE_MINIMUM and TYPE_MAXIMUM taken from coreutils */
+#ifndef TYPE_MINIMUM
+#define TYPE_MINIMUM(t) \
+ ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t)))
+#endif
+#ifndef TYPE_MAXIMUM
+#define TYPE_MAXIMUM(t) \
+ ((t) ((t) 0 < (t) -1 \
+ ? (t) -1 \
+ : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
+#endif
+
+#ifndef OFF_MAX
+#define OFF_MAX TYPE_MAXIMUM(off_t)
+#endif
+
+#ifndef OFF_MIN
+#define OFF_MIN TYPE_MINIMUM(off_t)
+#endif
+
+static char *newfile;
+static int dirfd = -1;
+
+static void
+exit_cleanup(void)
+{
+
+ if (dirfd != -1 && newfile != NULL)
+ if (unlinkat(dirfd, newfile, 0))
+ warn("unlinkat");
+}
+
+static inline off_t
+add_off_t(off_t a, off_t b)
+{
+ off_t result;
+
+#if __GNUC__ >= 5
+ if (__builtin_add_overflow(a, b, &result))
+ errx(1, "Corrupt patch");
+#else
+ if ((b > 0 && a > OFF_MAX - b) || (b < 0 && a < OFF_MIN - b))
+ errx(1, "Corrupt patch");
+ result = a + b;
+#endif
+ return result;
+}
static off_t offtin(u_char *buf)
{
off_t y;
- y=buf[7]&0x7F;
- y=y*256;y+=buf[6];
- y=y*256;y+=buf[5];
- y=y*256;y+=buf[4];
- y=y*256;y+=buf[3];
- y=y*256;y+=buf[2];
- y=y*256;y+=buf[1];
- y=y*256;y+=buf[0];
+ y = buf[7] & 0x7F;
+ y = y * 256; y += buf[6];
+ y = y * 256; y += buf[5];
+ y = y * 256; y += buf[4];
+ y = y * 256; y += buf[3];
+ y = y * 256; y += buf[2];
+ y = y * 256; y += buf[1];
+ y = y * 256; y += buf[0];
- if(buf[7]&0x80) y=-y;
+ if (buf[7] & 0x80)
+ y = -y;
- return y;
+ return (y);
}
-int main(int argc,char * argv[])
+static void
+usage(void)
{
- FILE * f, * cpf, * dpf, * epf;
- BZFILE * cpfbz2, * dpfbz2, * epfbz2;
+
+ fprintf(stderr, "usage: bspatch oldfile newfile patchfile\n");
+ exit(1);
+}
+
+int main(int argc, char *argv[])
+{
+ FILE *f, *cpf, *dpf, *epf;
+ BZFILE *cpfbz2, *dpfbz2, *epfbz2;
+ char *directory, *namebuf;
int cbz2err, dbz2err, ebz2err;
- int fd;
- ssize_t oldsize,newsize;
- ssize_t bzctrllen,bzdatalen;
- u_char header[32],buf[8];
+ int newfd, oldfd;
+ off_t oldsize, newsize;
+ off_t bzctrllen, bzdatalen;
+ u_char header[HEADER_SIZE], buf[8];
u_char *old, *new;
- off_t oldpos,newpos;
+ off_t oldpos, newpos;
off_t ctrl[3];
- off_t lenread;
- off_t i;
+ off_t i, lenread, offset;
- if(argc!=4) errx(1,"usage: %s oldfile newfile patchfile\n",argv[0]);
+ if (argc != 4)
+ usage();
/* Open patch file */
- if ((f = fopen(argv[3], "r")) == NULL)
+ if ((f = fopen(argv[3], "rb")) == NULL)
+ err(1, "fopen(%s)", argv[3]);
+ /* Open patch file for control block */
+ if ((cpf = fopen(argv[3], "rb")) == NULL)
+ err(1, "fopen(%s)", argv[3]);
+ /* open patch file for diff block */
+ if ((dpf = fopen(argv[3], "rb")) == NULL)
err(1, "fopen(%s)", argv[3]);
+ /* open patch file for extra block */
+ if ((epf = fopen(argv[3], "rb")) == NULL)
+ err(1, "fopen(%s)", argv[3]);
+ /* open oldfile */
+ if ((oldfd = open(argv[1], O_RDONLY | O_BINARY, 0)) < 0)
+ err(1, "open(%s)", argv[1]);
+ /* open directory where we'll write newfile */
+ if ((namebuf = strdup(argv[2])) == NULL ||
+ (directory = dirname(namebuf)) == NULL ||
+ (dirfd = open(directory, O_DIRECTORY)) < 0)
+ err(1, "open %s", argv[2]);
+ free(namebuf);
+ if ((newfile = basename(argv[2])) == NULL)
+ err(1, "basename");
+ /* open newfile */
+ if ((newfd = openat(dirfd, newfile,
+ O_CREAT | O_TRUNC | O_WRONLY | O_BINARY, 0666)) < 0)
+ err(1, "open(%s)", argv[2]);
+ atexit(exit_cleanup);
/*
File format:
@@ -90,104 +185,104 @@
*/
/* Read header */
- if (fread(header, 1, 32, f) < 32) {
+ if (fread(header, 1, HEADER_SIZE, f) < HEADER_SIZE) {
if (feof(f))
- errx(1, "Corrupt patch\n");
+ errx(1, "Corrupt patch");
err(1, "fread(%s)", argv[3]);
}
/* Check for appropriate magic */
if (memcmp(header, "BSDIFF40", 8) != 0)
- errx(1, "Corrupt patch\n");
+ errx(1, "Corrupt patch");
/* Read lengths from header */
- bzctrllen=offtin(header+8);
- bzdatalen=offtin(header+16);
- newsize=offtin(header+24);
- if((bzctrllen<0) || (bzdatalen<0) || (newsize<0))
- errx(1,"Corrupt patch\n");
+ bzctrllen = offtin(header + 8);
+ bzdatalen = offtin(header + 16);
+ newsize = offtin(header + 24);
+ if (bzctrllen < 0 || bzctrllen > OFF_MAX - HEADER_SIZE ||
+ bzdatalen < 0 || bzctrllen + HEADER_SIZE > OFF_MAX - bzdatalen ||
+ newsize < 0 || newsize > SSIZE_MAX)
+ errx(1, "Corrupt patch");
/* Close patch file and re-open it via libbzip2 at the right places */
if (fclose(f))
err(1, "fclose(%s)", argv[3]);
- if ((cpf = fopen(argv[3], "r")) == NULL)
- err(1, "fopen(%s)", argv[3]);
- if (fseeko(cpf, 32, SEEK_SET))
- err(1, "fseeko(%s, %lld)", argv[3],
- (long long)32);
+ offset = HEADER_SIZE;
+ if (fseeko(cpf, offset, SEEK_SET))
+ err(1, "fseeko(%s, %jd)", argv[3], (intmax_t)offset);
if ((cpfbz2 = BZ2_bzReadOpen(&cbz2err, cpf, 0, 0, NULL, 0)) == NULL)
errx(1, "BZ2_bzReadOpen, bz2err = %d", cbz2err);
- if ((dpf = fopen(argv[3], "r")) == NULL)
- err(1, "fopen(%s)", argv[3]);
- if (fseeko(dpf, 32 + bzctrllen, SEEK_SET))
- err(1, "fseeko(%s, %lld)", argv[3],
- (long long)(32 + bzctrllen));
+ offset = add_off_t(offset, bzctrllen);
+ if (fseeko(dpf, offset, SEEK_SET))
+ err(1, "fseeko(%s, %jd)", argv[3], (intmax_t)offset);
if ((dpfbz2 = BZ2_bzReadOpen(&dbz2err, dpf, 0, 0, NULL, 0)) == NULL)
errx(1, "BZ2_bzReadOpen, bz2err = %d", dbz2err);
- if ((epf = fopen(argv[3], "r")) == NULL)
- err(1, "fopen(%s)", argv[3]);
- if (fseeko(epf, 32 + bzctrllen + bzdatalen, SEEK_SET))
- err(1, "fseeko(%s, %lld)", argv[3],
- (long long)(32 + bzctrllen + bzdatalen));
+ offset = add_off_t(offset, bzdatalen);
+ if (fseeko(epf, offset, SEEK_SET))
+ err(1, "fseeko(%s, %jd)", argv[3], (intmax_t)offset);
if ((epfbz2 = BZ2_bzReadOpen(&ebz2err, epf, 0, 0, NULL, 0)) == NULL)
errx(1, "BZ2_bzReadOpen, bz2err = %d", ebz2err);
- if(((fd=open(argv[1],O_RDONLY,0))<0) ||
- ((oldsize=lseek(fd,0,SEEK_END))==-1) ||
- ((old=malloc(oldsize+1))==NULL) ||
- (lseek(fd,0,SEEK_SET)!=0) ||
- (read(fd,old,oldsize)!=oldsize) ||
- (close(fd)==-1)) err(1,"%s",argv[1]);
- if((new=malloc(newsize+1))==NULL) err(1,NULL);
-
- oldpos=0;newpos=0;
- while(newpos<newsize) {
+ if ((oldsize = lseek(oldfd, 0, SEEK_END)) == -1 ||
+ oldsize > SSIZE_MAX ||
+ (old = malloc(oldsize)) == NULL ||
+ lseek(oldfd, 0, SEEK_SET) != 0 ||
+ read(oldfd, old, oldsize) != oldsize ||
+ close(oldfd) == -1)
+ err(1, "%s", argv[1]);
+ if ((new = malloc(newsize)) == NULL)
+ err(1, NULL);
+
+ oldpos = 0;
+ newpos = 0;
+ while (newpos < newsize) {
/* Read control data */
- for(i=0;i<=2;i++) {
+ for (i = 0; i <= 2; i++) {
lenread = BZ2_bzRead(&cbz2err, cpfbz2, buf, 8);
if ((lenread < 8) || ((cbz2err != BZ_OK) &&
(cbz2err != BZ_STREAM_END)))
- errx(1, "Corrupt patch\n");
- ctrl[i]=offtin(buf);
- };
+ errx(1, "Corrupt patch");
+ ctrl[i] = offtin(buf);
+ }
/* Sanity-check */
- if ((ctrl[0] < 0) || (ctrl[1] < 0))
- errx(1,"Corrupt patch\n");
+ if (ctrl[0] < 0 || ctrl[0] > INT_MAX ||
+ ctrl[1] < 0 || ctrl[1] > INT_MAX)
+ errx(1, "Corrupt patch");
/* Sanity-check */
- if(newpos+ctrl[0]>newsize)
- errx(1,"Corrupt patch\n");
+ if (add_off_t(newpos, ctrl[0]) > newsize)
+ errx(1, "Corrupt patch");
/* Read diff string */
lenread = BZ2_bzRead(&dbz2err, dpfbz2, new + newpos, ctrl[0]);
if ((lenread < ctrl[0]) ||
((dbz2err != BZ_OK) && (dbz2err != BZ_STREAM_END)))
- errx(1, "Corrupt patch\n");
+ errx(1, "Corrupt patch");
/* Add old data to diff string */
- for(i=0;i<ctrl[0];i++)
- if((oldpos+i>=0) && (oldpos+i<oldsize))
- new[newpos+i]+=old[oldpos+i];
+ for (i = 0; i < ctrl[0]; i++)
+ if (add_off_t(oldpos, i) < oldsize)
+ new[newpos + i] += old[oldpos + i];
/* Adjust pointers */
- newpos+=ctrl[0];
- oldpos+=ctrl[0];
+ newpos = add_off_t(newpos, ctrl[0]);
+ oldpos = add_off_t(oldpos, ctrl[0]);
/* Sanity-check */
- if(newpos+ctrl[1]>newsize)
- errx(1,"Corrupt patch\n");
+ if (add_off_t(newpos, ctrl[1]) > newsize)
+ errx(1, "Corrupt patch");
/* Read extra string */
lenread = BZ2_bzRead(&ebz2err, epfbz2, new + newpos, ctrl[1]);
if ((lenread < ctrl[1]) ||
((ebz2err != BZ_OK) && (ebz2err != BZ_STREAM_END)))
- errx(1, "Corrupt patch\n");
+ errx(1, "Corrupt patch");
/* Adjust pointers */
- newpos+=ctrl[1];
- oldpos+=ctrl[2];
- };
+ newpos = add_off_t(newpos, ctrl[1]);
+ oldpos = add_off_t(oldpos, ctrl[2]);
+ }
/* Clean up the bzip2 reads */
BZ2_bzReadClose(&cbz2err, cpfbz2);
@@ -197,12 +292,13 @@
err(1, "fclose(%s)", argv[3]);
/* Write the new file */
- if(((fd=open(argv[2],O_CREAT|O_TRUNC|O_WRONLY,0666))<0) ||
- (write(fd,new,newsize)!=newsize) || (close(fd)==-1))
- err(1,"%s",argv[2]);
+ if (write(newfd, new, newsize) != newsize || close(newfd) == -1)
+ err(1, "%s", argv[2]);
+ /* Disable atexit cleanup */
+ newfile = NULL;
free(new);
free(old);
- return 0;
+ return (0);
}

View File

@@ -0,0 +1,12 @@
diff --git a/bspatch.c b/bspatch.c
index 643c60b..543379c 100644
--- a/bspatch.c
+++ b/bspatch.c
@@ -28,6 +28,7 @@
__FBSDID("$FreeBSD: src/usr.bin/bsdiff/bspatch/bspatch.c,v 1.1 2005/08/06 01:59:06 cperciva Exp $");
#endif
+#include <sys/types.h>
#include <bzlib.h>
#include <stdlib.h>
#include <stdio.h>

View File

@@ -0,0 +1,64 @@
{
lib,
stdenv,
fetchurl,
fetchpatch,
bzip2,
}:
stdenv.mkDerivation rec {
pname = "bsdiff";
version = "4.3";
src = fetchurl {
url = "https://www.daemonology.net/bsdiff/${pname}-${version}.tar.gz";
sha256 = "0j2zm3z271x5aw63mwhr3vymzn45p2vvrlrpm9cz2nywna41b0hq";
};
buildInputs = [ bzip2 ];
patches = [
(fetchpatch {
url = "https://sources.debian.org/data/main/b/bsdiff/4.3-22/debian/patches/20-CVE-2014-9862.patch";
sha256 = "sha256-3UuUfNvShQ8fLqxCKUTb/n4BmjL4+Nl7aEqCxYrrERQ=";
})
./CVE-2020-14315.patch
./include-systypes.patch
]
++ lib.optionals stdenv.hostPlatform.isLinux [
(fetchpatch {
url = "https://sources.debian.org/data/main/b/bsdiff/4.3-22/debian/patches/30-bug-632585-mmap-src-file-instead-of-malloc-read-it.patch";
sha256 = "sha256-esbhz2/efUiuQDuF7LGfSeEn3/f1WbqCxQpTs2A0ulI=";
})
(fetchpatch {
url = "https://sources.debian.org/data/main/b/bsdiff/4.3-22/debian/patches/31-bug-632585-mmap-dst-file-instead-of-malloc-read-it.patch";
sha256 = "sha256-Of4aOcI0rsgdRzPqyw2VRn2p9wQuo3hdlgDTBdXGzoc=";
})
(fetchpatch {
url = "https://sources.debian.org/data/main/b/bsdiff/4.3-22/debian/patches/32-bug-632585-use-int32_t-instead-off_t-for-file-size.patch";
sha256 = "sha256-SooFnFK4uKNXvXQb/LEcH8GocnRtkryExI4b3BZTsAY=";
})
];
buildPhase = ''
$CC -O3 -lbz2 bspatch.c -o bspatch
$CC -O3 -lbz2 bsdiff.c -o bsdiff
'';
installPhase = ''
mkdir -p $out/bin
mkdir -p $out/share/man/man1
cp bsdiff $out/bin
cp bspatch $out/bin
cp bsdiff.1 $out/share/man/man1
cp bspatch.1 $out/share/man/man1
'';
meta = with lib; {
description = "Efficient binary diff/patch tool";
homepage = "https://www.daemonology.net/bsdiff/";
license = licenses.bsd2;
platforms = platforms.unix;
maintainers = [ maintainers.thoughtpolice ];
};
}

View File

@@ -0,0 +1,38 @@
{
lib,
stdenv,
fetchFromGitHub,
xorg,
cairo,
lv2,
pkg-config,
}:
stdenv.mkDerivation rec {
pname = "bsequencer";
version = "1.8.10";
src = fetchFromGitHub {
owner = "sjaehn";
repo = "BSEQuencer";
tag = version;
sha256 = "sha256-1PSICm5mw37nO3gkHA9MNUH+CFULeOZURjimYEA/dXA=";
};
nativeBuildInputs = [ pkg-config ];
buildInputs = [
xorg.libX11
cairo
lv2
];
installFlags = [ "PREFIX=$(out)" ];
meta = with lib; {
homepage = "https://github.com/sjaehn/BSEQuencer";
description = "Multi channel MIDI step sequencer LV2 plugin";
maintainers = [ maintainers.magnetophon ];
platforms = platforms.linux;
license = licenses.gpl3;
};
}

View File

@@ -0,0 +1,38 @@
{
lib,
stdenv,
fetchFromGitHub,
xorg,
cairo,
lv2,
pkg-config,
}:
stdenv.mkDerivation rec {
pname = "bshapr";
version = "0.13";
src = fetchFromGitHub {
owner = "sjaehn";
repo = "BShapr";
rev = "v${version}";
sha256 = "sha256-9I4DPRl6i/VL8Etw3qLGZkP45BGsbxFxNOvRy3B3I+M=";
};
nativeBuildInputs = [ pkg-config ];
buildInputs = [
xorg.libX11
cairo
lv2
];
installFlags = [ "PREFIX=$(out)" ];
meta = with lib; {
homepage = "https://github.com/sjaehn/BShapr";
description = "Beat / envelope shaper LV2 plugin";
maintainers = [ maintainers.magnetophon ];
platforms = platforms.linux;
license = licenses.gpl3;
};
}

View File

@@ -0,0 +1,46 @@
{
lib,
buildGoModule,
fetchFromGitHub,
libpcap,
versionCheckHook,
nix-update-script,
}:
buildGoModule (finalAttrs: {
pname = "bsky-cli";
version = "0.0.74";
src = fetchFromGitHub {
owner = "mattn";
repo = "bsky";
tag = "v${finalAttrs.version}";
hash = "sha256-pLgPQYL4+BErqRe09Pj94gLt/OoxEt9r4n+gZtZSS4Y=";
};
vendorHash = "sha256-f9LZHJ5yXWUUh6HdF2JPEBucWuVud3YX5l2MkHs6UXc=";
buildInputs = [
libpcap
];
ldflags = [
"-s"
"-w"
];
doInstallCheck = true;
versionCheckProgram = "${placeholder "out"}/bin/bsky";
versionCheckProgramArg = "--version";
nativeBuildInputs = [ versionCheckHook ];
passthru.updateScript = nix-update-script { };
meta = {
description = "Cli application for bluesky social";
homepage = "https://github.com/mattn/bsky";
changelog = "https://github.com/mattn/bsky/releases/tag/v${finalAttrs.version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ isabelroses ];
mainProgram = "bsky";
};
})

View File

@@ -0,0 +1,38 @@
{
lib,
stdenv,
fetchFromGitHub,
xorg,
cairo,
lv2,
pkg-config,
}:
stdenv.mkDerivation rec {
pname = "bslizr";
version = "1.2.16";
src = fetchFromGitHub {
owner = "sjaehn";
repo = "BSlizr";
tag = version;
sha256 = "sha256-5DvVkTz79CLvZMZ3XnI0COIfxnhERDSvzbVoJAcqNRI=";
};
nativeBuildInputs = [ pkg-config ];
buildInputs = [
xorg.libX11
cairo
lv2
];
installFlags = [ "PREFIX=$(out)" ];
meta = with lib; {
homepage = "https://github.com/sjaehn/BSlizr";
description = "Sequenced audio slicing effect LV2 plugin (step sequencer effect)";
maintainers = [ maintainers.magnetophon ];
platforms = platforms.linux;
license = licenses.gpl3;
};
}

View File

@@ -0,0 +1,107 @@
{
lib,
SDL2,
alsa-lib,
fetchFromGitHub,
gtk3,
gtksourceview3,
libX11,
libXv,
libao,
libicns,
libpulseaudio,
makeWrapper,
openal,
pkg-config,
stdenv,
udev,
unstableGitUpdater,
wrapGAppsHook3,
}:
stdenv.mkDerivation {
pname = "bsnes-hd";
version = "10.6-unstable-2024-10-21";
src = fetchFromGitHub {
owner = "DerKoun";
repo = "bsnes-hd";
rev = "0bb7b8645e22ea2476cabd58f32e987b14686601";
hash = "sha256-YzWSZMn6v5hWIHnp6KmmpevCsf35Vi2BCcmFMnrFPH0=";
};
patches = [
# Replace invocation of `sips` with an equivalent invocation of `png2icns`
# while assembling the .app directory hierarchy in the macos build. The
# `sips` executable isn't in our environment during the build, but
# `png2icns` is available by way of the dependency on libicns.
./patches/0000-macos-replace-sips-with-png2icns.patch
# During `make install` on macos the Makefile wants to move the .app into
# the current user's home directory. This patches the Makefile such that the
# .app ends up in $(prefix)/Applications. The $(prefix) variable will be set
# to $out, so this will result in the .app ending up in the Applications
# directory in the current nix profile.
./patches/0001-macos-copy-app-to-prefix.patch
];
nativeBuildInputs = [
pkg-config
]
++ lib.optionals stdenv.hostPlatform.isLinux [ wrapGAppsHook3 ]
++ lib.optionals stdenv.hostPlatform.isDarwin [
libicns
makeWrapper
];
buildInputs = [
SDL2
libao
]
++ lib.optionals stdenv.hostPlatform.isLinux [
libX11
libXv
udev
gtk3
gtksourceview3
alsa-lib
openal
libpulseaudio
];
makeFlags = [
"-C bsnes"
"prefix=$(out)"
]
++ lib.optionals stdenv.hostPlatform.isLinux [ "hiro=gtk3" ]
++ lib.optionals stdenv.hostPlatform.isDarwin [ "hiro=cocoa" ];
enableParallelBuilding = true;
postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
mkdir -p $out/bin
makeWrapper $out/{Applications/bsnes.app/Contents/MacOS,bin}/bsnes
'';
# https://github.com/bsnes-emu/bsnes/issues/107
preFixup = lib.optionalString stdenv.hostPlatform.isLinux ''
gappsWrapperArgs+=(
--prefix GDK_BACKEND : x11
)
'';
passthru = {
updateScript = unstableGitUpdater { };
};
meta = {
homepage = "https://github.com/DerKoun/bsnes-hd";
description = "Fork of bsnes that adds HD video features";
license = lib.licenses.gpl3Only;
mainProgram = "bsnes";
maintainers = with lib.maintainers; [
stevebob
];
platforms = lib.platforms.unix;
};
}

View File

@@ -0,0 +1,13 @@
diff --git a/bsnes/target-bsnes/GNUmakefile b/bsnes/target-bsnes/GNUmakefile
index 4c67bde..7a3ab9f 100644
--- a/bsnes/target-bsnes/GNUmakefile
+++ b/bsnes/target-bsnes/GNUmakefile
@@ -33,7 +33,7 @@ ifeq ($(platform),macos)
cp Database/* out/$(name).app/Contents/MacOS/Database/
cp -r ../shaders/* out/$(name).app/Contents/macOS/Shaders/
cp $(ui)/resource/$(name).plist out/$(name).app/Contents/Info.plist
- sips -s format icns $(ui)/resource/$(name).png --out out/$(name).app/Contents/Resources/$(name).icns
+ png2icns out/$(name).app/Contents/Resources/$(name).icns $(ui)/resource/$(name).png
endif
verbose: hiro.verbose ruby.verbose nall.verbose all;

View File

@@ -0,0 +1,18 @@
diff --git a/bsnes/target-bsnes/GNUmakefile b/bsnes/target-bsnes/GNUmakefile
index 7a3ab9f..ec8a1a4 100644
--- a/bsnes/target-bsnes/GNUmakefile
+++ b/bsnes/target-bsnes/GNUmakefile
@@ -43,11 +43,8 @@ ifeq ($(platform),windows)
else ifeq ($(shell id -un),root)
$(error "make install should not be run as root")
else ifeq ($(platform),macos)
- mkdir -p ~/Library/Application\ Support/$(name)/
- mkdir -p ~/Library/Application\ Support/$(name)/Database/
- mkdir -p ~/Library/Application\ Support/$(name)/Firmware/
- mkdir -p ~/Library/Application\ Support/$(name)/Shaders/
- cp -R out/$(name).app /Applications/$(name).app
+ mkdir -p $(prefix)/Applications
+ cp -R out/$(name).app $(prefix)/Applications
else ifneq ($(filter $(platform),linux bsd),)
mkdir -p $(prefix)/bin/
mkdir -p $(prefix)/share/applications/

View File

@@ -0,0 +1,51 @@
{
lib,
stdenv,
fetchFromGitHub,
makeWrapper,
git,
bc,
bspwm,
}:
stdenv.mkDerivation {
pname = "bsp-layout";
version = "unstable-2022-06-19";
src = fetchFromGitHub {
owner = "phenax";
repo = "bsp-layout";
rev = "9d60fc271454ea1bfca598575207a06d8d172d3e";
sha256 = "sha256-7bBVWJdgAnXLWzjQGZxVqhku2rsxX2kMxU4xkI9/DHE=";
};
nativeBuildInputs = [
makeWrapper
git
bc
];
buildInputs = [ bspwm ];
makeFlags = [ "PREFIX=$(out)" ];
postInstall = ''
substituteInPlace $out/lib/bsp-layout/layout.sh --replace 'bc ' '${bc}/bin/bc '
for layout in tall rtall wide rwide
do
substituteInPlace "$out/lib/bsp-layout/layouts/$layout.sh" --replace 'bc ' '${bc}/bin/bc '
done
'';
meta = with lib; {
description = "Manage layouts in bspwm";
longDescription = ''
bsp-layout is a dynamic layout manager for bspwm, written in bash.
It provides layout options to fit most workflows.
'';
homepage = "https://github.com/phenax/bsp-layout";
license = licenses.mit;
maintainers = with maintainers; [ totoroot ];
platforms = platforms.linux;
mainProgram = "bsp-layout";
};
}

View File

@@ -0,0 +1,48 @@
{
lib,
stdenv,
fetchFromGitHub,
libxcb,
libXinerama,
xcbutil,
xcbutilkeysyms,
xcbutilwm,
nixosTests,
}:
stdenv.mkDerivation rec {
pname = "bspwm";
version = "0.9.12";
src = fetchFromGitHub {
owner = "baskerville";
repo = "bspwm";
tag = version;
sha256 = "sha256-sEheWAZgKVDCEipQTtDLNfDSA2oho9zU9gK2d6W6WSU=";
};
buildInputs = [
libxcb
libXinerama
xcbutil
xcbutilkeysyms
xcbutilwm
];
makeFlags = [ "PREFIX=$(out)" ];
passthru.tests = {
inherit (nixosTests) startx;
};
meta = with lib; {
description = "Tiling window manager based on binary space partitioning";
homepage = "https://github.com/baskerville/bspwm";
maintainers = with maintainers; [
meisternu
ncfavier
];
license = licenses.bsd2;
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,46 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
sdl2-compat,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "bstone";
version = "1.2.16";
src = fetchFromGitHub {
owner = "bibendovsky";
repo = "bstone";
tag = "v${finalAttrs.version}";
hash = "sha256-6BNIMBbLBcQoVx5lnUz14viAvBcFjoZLY8c30EgcvKQ=";
};
nativeBuildInputs = [
cmake
];
buildInputs = [
sdl2-compat
];
postInstall = ''
mkdir -p $out/{bin,share/bibendovsky/bstone}
mv $out/bstone $out/bin
mv $out/*.txt $out/share/bibendovsky/bstone
'';
meta = {
description = "Unofficial source port for the Blake Stone series";
homepage = "https://github.com/bibendovsky/bstone";
changelog = "https://github.com/bibendovsky/bstone/blob/${finalAttrs.src.rev}/CHANGELOG.md";
license = with lib.licenses; [
gpl2Plus # Original game source code
mit # BStone
];
maintainers = with lib.maintainers; [ keenanweaver ];
mainProgram = "bstone";
platforms = lib.platforms.linux; # TODO: macOS / Darwin support
};
})

View File

@@ -0,0 +1,58 @@
{
lib,
fetchFromGitHub,
stdenv,
makeWrapper,
python3,
openssh,
rsync,
findutils,
which,
}:
stdenv.mkDerivation {
pname = "bsync";
version = "0-unstable-2023-12-21";
src = fetchFromGitHub {
owner = "dooblem";
repo = "bsync";
rev = "25f77730750720ad68b0ab2773e79d9ca98c3647";
hash = "sha256-k25MjLis0/dp1TTS4aFeJZq/c0T01LmNcWtC+dw/kKY=";
};
installPhase = ''
runHook preInstall
install -Dm555 bsync -t $out/bin
runHook postInstall
'';
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ python3 ];
fixupPhase = ''
runHook preFixup
patchShebangs $out/bin/bsync
wrapProgram $out/bin/bsync \
--prefix PATH ":" ${
lib.makeLibraryPath [
openssh
rsync
findutils
which
]
}
runHook postFixup
'';
meta = with lib; {
homepage = "https://github.com/dooblem/bsync";
description = "Bidirectional Synchronization using Rsync";
license = licenses.gpl3Only;
maintainers = with maintainers; [ dietmarw ];
platforms = platforms.unix;
mainProgram = "bsync";
};
}