2024-07-01 15:47:52 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
SDL2,
|
|
|
|
callPackage,
|
|
|
|
cmake,
|
|
|
|
espeak-ng,
|
|
|
|
ffmpeg,
|
|
|
|
file,
|
|
|
|
freetype,
|
|
|
|
glib,
|
|
|
|
gumbo,
|
|
|
|
harfbuzz,
|
|
|
|
jbig2dec,
|
|
|
|
leptonica,
|
|
|
|
libGL,
|
|
|
|
libX11,
|
|
|
|
libXau,
|
|
|
|
libXcomposite,
|
|
|
|
libXdmcp,
|
|
|
|
libXfixes,
|
|
|
|
libdrm,
|
|
|
|
libffi,
|
|
|
|
libjpeg,
|
|
|
|
libusb1,
|
|
|
|
libuvc,
|
|
|
|
libvlc,
|
|
|
|
libvncserver,
|
|
|
|
libxcb,
|
|
|
|
libxkbcommon,
|
|
|
|
makeWrapper,
|
|
|
|
mesa,
|
|
|
|
mupdf,
|
|
|
|
openal,
|
|
|
|
openjpeg,
|
|
|
|
pcre2,
|
|
|
|
pkg-config,
|
|
|
|
ruby,
|
|
|
|
sqlite,
|
|
|
|
stdenv,
|
|
|
|
tesseract,
|
|
|
|
valgrind,
|
|
|
|
wayland,
|
|
|
|
wayland-protocols,
|
|
|
|
xcbutil,
|
|
|
|
xcbutilwm,
|
|
|
|
xz,
|
|
|
|
# Boolean flags
|
|
|
|
buildManPages ? true,
|
|
|
|
useBuiltinLua ? true,
|
|
|
|
useEspeak ? !stdenv.isDarwin,
|
|
|
|
useStaticLibuvc ? true,
|
|
|
|
useStaticOpenAL ? true,
|
|
|
|
useStaticSqlite ? true,
|
|
|
|
useTracy ? true,
|
|
|
|
# Configurable options
|
|
|
|
sources ? callPackage ./sources.nix { },
|
2021-07-14 22:03:04 +00:00
|
|
|
}:
|
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2024-07-01 15:47:52 +00:00
|
|
|
inherit (sources.letoram-arcan) pname version src;
|
2021-07-14 22:03:04 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
makeWrapper
|
|
|
|
pkg-config
|
2024-07-01 15:47:52 +00:00
|
|
|
] ++ lib.optionals buildManPages [ ruby ];
|
2021-07-14 22:03:04 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
SDL2
|
|
|
|
ffmpeg
|
|
|
|
file
|
|
|
|
freetype
|
2022-08-12 12:06:08 +00:00
|
|
|
glib
|
|
|
|
gumbo
|
2021-07-14 22:03:04 +00:00
|
|
|
harfbuzz
|
2022-08-12 12:06:08 +00:00
|
|
|
jbig2dec
|
2021-07-14 22:03:04 +00:00
|
|
|
leptonica
|
|
|
|
libGL
|
|
|
|
libX11
|
|
|
|
libXau
|
|
|
|
libXcomposite
|
|
|
|
libXdmcp
|
|
|
|
libXfixes
|
|
|
|
libdrm
|
|
|
|
libffi
|
2023-11-16 04:20:00 +00:00
|
|
|
libjpeg
|
2021-07-14 22:03:04 +00:00
|
|
|
libusb1
|
|
|
|
libuvc
|
|
|
|
libvlc
|
|
|
|
libvncserver
|
|
|
|
libxcb
|
|
|
|
libxkbcommon
|
|
|
|
mesa
|
2023-11-16 04:20:00 +00:00
|
|
|
mupdf
|
2021-07-14 22:03:04 +00:00
|
|
|
openal
|
2023-11-16 04:20:00 +00:00
|
|
|
openjpeg
|
2023-10-19 13:55:26 +00:00
|
|
|
pcre2
|
2021-07-14 22:03:04 +00:00
|
|
|
sqlite
|
|
|
|
tesseract
|
|
|
|
valgrind
|
|
|
|
wayland
|
|
|
|
wayland-protocols
|
|
|
|
xcbutil
|
|
|
|
xcbutilwm
|
|
|
|
xz
|
2024-07-01 15:47:52 +00:00
|
|
|
] ++ lib.optionals useEspeak [ espeak-ng ];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
# The upstream project recommends tagging the distribution
|
|
|
|
(lib.cmakeFeature "DISTR_TAG" "Nixpkgs")
|
|
|
|
(lib.cmakeFeature "ENGINE_BUILDTAG" finalAttrs.src.rev)
|
|
|
|
(lib.cmakeFeature "BUILD_PRESET" "everything")
|
|
|
|
(lib.cmakeBool "BUILTIN_LUA" useBuiltinLua)
|
|
|
|
(lib.cmakeBool "DISABLE_JIT" useBuiltinLua)
|
|
|
|
(lib.cmakeBool "STATIC_LIBUVC" useStaticLibuvc)
|
|
|
|
(lib.cmakeBool "STATIC_SQLite3" useStaticSqlite)
|
|
|
|
(lib.cmakeBool "ENABLE_TRACY" useTracy)
|
|
|
|
"../src"
|
2021-12-06 16:07:01 +00:00
|
|
|
];
|
|
|
|
|
2024-07-01 15:47:52 +00:00
|
|
|
outputs = [ "out" "dev" "lib" "man" ];
|
|
|
|
|
|
|
|
hardeningDisable = [ "format" ];
|
|
|
|
|
|
|
|
strictDeps = true;
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
# Emulate external/git/clone.sh
|
2024-07-01 15:47:52 +00:00
|
|
|
postUnpack =
|
|
|
|
let
|
|
|
|
inherit (sources)
|
|
|
|
letoram-openal
|
|
|
|
libuvc
|
|
|
|
luajit
|
|
|
|
tracy
|
|
|
|
;
|
|
|
|
prepareSource =
|
|
|
|
flag: source: destination:
|
|
|
|
lib.optionalString flag ''
|
|
|
|
cp -va ${source}/ ${destination}
|
|
|
|
chmod --recursive 744 ${destination}
|
|
|
|
'';
|
|
|
|
in
|
2021-12-06 16:07:01 +00:00
|
|
|
''
|
|
|
|
pushd $sourceRoot/external/git/
|
|
|
|
''
|
2024-07-01 15:47:52 +00:00
|
|
|
+ prepareSource useStaticOpenAL letoram-openal.src "openal"
|
|
|
|
+ prepareSource useStaticLibuvc libuvc.src "libuvc"
|
|
|
|
+ prepareSource useBuiltinLua luajit.src "luajit"
|
|
|
|
+ prepareSource useTracy tracy.src "tracy"
|
2023-10-19 13:55:26 +00:00
|
|
|
+ ''
|
2021-12-06 16:07:01 +00:00
|
|
|
popd
|
|
|
|
'';
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace ./src/platform/posix/paths.c \
|
2024-07-01 15:47:52 +00:00
|
|
|
--replace-fail "/usr/bin" "$out/bin" \
|
|
|
|
--replace-fail "/usr/share" "$out/share"
|
2023-10-19 13:55:26 +00:00
|
|
|
substituteInPlace ./src/CMakeLists.txt \
|
2024-07-01 15:47:52 +00:00
|
|
|
--replace-fail "SETUID" "# SETUID"
|
2021-12-06 16:07:01 +00:00
|
|
|
'';
|
|
|
|
|
2023-10-19 13:55:26 +00:00
|
|
|
# INFO: Arcan build scripts require the manpages to be generated *before* the
|
2022-10-21 18:38:19 +00:00
|
|
|
# `configure` phase
|
2021-12-06 16:07:01 +00:00
|
|
|
preConfigure = lib.optionalString buildManPages ''
|
|
|
|
pushd doc
|
2021-10-28 06:52:43 +00:00
|
|
|
ruby docgen.rb mangen
|
|
|
|
popd
|
2021-07-14 22:03:04 +00:00
|
|
|
'';
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
passthru = {
|
2024-07-01 15:47:52 +00:00
|
|
|
inherit sources;
|
2024-01-02 11:29:13 +00:00
|
|
|
wrapper = callPackage ./wrapper.nix { };
|
|
|
|
};
|
|
|
|
|
2023-10-19 13:55:26 +00:00
|
|
|
meta = {
|
2021-07-14 22:03:04 +00:00
|
|
|
homepage = "https://arcan-fe.com/";
|
|
|
|
description = "Combined Display Server, Multimedia Framework, Game Engine";
|
|
|
|
longDescription = ''
|
|
|
|
Arcan is a portable and fast self-sufficient multimedia engine for
|
|
|
|
advanced visualization and analysis work in a wide range of applications
|
|
|
|
e.g. game development, real-time streaming video, monitoring and
|
|
|
|
surveillance, up to and including desktop compositors and window managers.
|
|
|
|
'';
|
2024-07-01 15:47:52 +00:00
|
|
|
license = with lib.licenses; [
|
|
|
|
bsd3
|
|
|
|
gpl2Plus
|
|
|
|
lgpl2Plus
|
|
|
|
];
|
2023-10-19 13:55:26 +00:00
|
|
|
maintainers = with lib.maintainers; [ AndersonTorres ];
|
|
|
|
platforms = lib.platforms.unix;
|
2021-07-14 22:03:04 +00:00
|
|
|
};
|
2022-08-12 12:06:08 +00:00
|
|
|
})
|