2021-07-14 22:03:04 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, SDL2
|
2024-01-02 11:29:13 +00:00
|
|
|
, callPackage
|
2021-07-14 22:03:04 +00:00
|
|
|
, cmake
|
2024-01-02 11:29:13 +00:00
|
|
|
, espeak-ng
|
2021-07-14 22:03:04 +00:00
|
|
|
, 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
|
|
|
|
, makeWrapper
|
|
|
|
, mesa
|
2022-08-12 12:06:08 +00:00
|
|
|
, mupdf
|
2021-07-14 22:03:04 +00:00
|
|
|
, openal
|
2022-08-12 12:06:08 +00:00
|
|
|
, openjpeg
|
2023-10-19 13:55:26 +00:00
|
|
|
, pcre2
|
2021-07-14 22:03:04 +00:00
|
|
|
, pkg-config
|
2023-10-19 13:55:26 +00:00
|
|
|
, ruby
|
2021-07-14 22:03:04 +00:00
|
|
|
, sqlite
|
|
|
|
, tesseract
|
|
|
|
, valgrind
|
|
|
|
, wayland
|
|
|
|
, wayland-protocols
|
|
|
|
, xcbutil
|
|
|
|
, xcbutilwm
|
|
|
|
, xz
|
2023-10-19 13:55:26 +00:00
|
|
|
, buildManPages ? true
|
2021-12-06 16:07:01 +00:00
|
|
|
, useBuiltinLua ? true
|
2023-10-19 13:55:26 +00:00
|
|
|
, useEspeak ? !stdenv.isDarwin
|
|
|
|
, useStaticLibuvc ? true
|
2021-12-06 16:07:01 +00:00
|
|
|
, useStaticOpenAL ? true
|
2023-10-19 13:55:26 +00:00
|
|
|
, useStaticSqlite ? true
|
|
|
|
, useTracy ? true
|
2021-07-14 22:03:04 +00:00
|
|
|
}:
|
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
let
|
2023-10-19 13:55:26 +00:00
|
|
|
allSources = {
|
2024-01-02 11:29:13 +00:00
|
|
|
letoram-arcan = {
|
|
|
|
pname = "arcan";
|
|
|
|
version = "0.6.2.1-unstable-2023-11-18";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "letoram";
|
|
|
|
repo = "arcan";
|
|
|
|
rev = "0950ee236f96a555729498d0fdf91c16901037f5";
|
|
|
|
hash = "sha256-TxadRlidy4KRaQ4HunPO6ISJqm6JwnMRM8y6dX6vqJ4=";
|
|
|
|
};
|
2023-10-19 13:55:26 +00:00
|
|
|
};
|
|
|
|
letoram-openal-src = fetchFromGitHub {
|
|
|
|
owner = "letoram";
|
|
|
|
repo = "openal";
|
|
|
|
rev = "81e1b364339b6aa2b183f39fc16c55eb5857e97a";
|
|
|
|
hash = "sha256-X3C3TDZPiOhdZdpApC4h4KeBiWFMxkFsmE3gQ1Rz420=";
|
|
|
|
};
|
|
|
|
libuvc-src = fetchFromGitHub {
|
|
|
|
owner = "libuvc";
|
|
|
|
repo = "libuvc";
|
|
|
|
rev = "68d07a00e11d1944e27b7295ee69673239c00b4b";
|
|
|
|
hash = "sha256-IdV18mnPTDBODpS1BXl4ulkFyf1PU2ZmuVGNOIdQwzE=";
|
|
|
|
};
|
|
|
|
luajit-src = fetchFromGitHub {
|
|
|
|
owner = "LuaJIT";
|
|
|
|
repo = "LuaJIT";
|
|
|
|
rev = "656ecbcf8f669feb94e0d0ec4b4f59190bcd2e48";
|
|
|
|
hash = "sha256-/gGQzHgYuWGqGjgpEl18Rbh3Sx2VP+zLlx4N9/hbYLc=";
|
|
|
|
};
|
|
|
|
tracy-src = fetchFromGitHub {
|
|
|
|
owner = "wolfpld";
|
|
|
|
repo = "tracy";
|
|
|
|
rev = "93537dff336e0796b01262e8271e4d63bf39f195";
|
|
|
|
hash = "sha256-FNB2zTbwk8hMNmhofz9GMts7dvH9phBRVIdgVjRcyQM=";
|
|
|
|
};
|
|
|
|
};
|
2022-10-21 18:38:19 +00:00
|
|
|
in
|
2023-04-29 16:46:19 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2024-01-02 11:29:13 +00:00
|
|
|
inherit (allSources.letoram-arcan) pname version src;
|
2021-07-14 22:03:04 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
makeWrapper
|
|
|
|
pkg-config
|
2021-12-06 16:07:01 +00:00
|
|
|
] ++ lib.optionals buildManPages [
|
2021-07-14 22:03:04 +00:00
|
|
|
ruby
|
|
|
|
];
|
|
|
|
|
|
|
|
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
|
2023-10-19 13:55:26 +00:00
|
|
|
]
|
|
|
|
++ lib.optionals useEspeak [
|
2024-01-02 11:29:13 +00:00
|
|
|
espeak-ng
|
2021-12-06 16:07:01 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
# Emulate external/git/clone.sh
|
|
|
|
postUnpack = let
|
2023-10-19 13:55:26 +00:00
|
|
|
inherit (allSources)
|
|
|
|
letoram-openal-src libuvc-src luajit-src tracy-src;
|
|
|
|
prepareSource = flag: source: destination:
|
|
|
|
lib.optionalString flag ''
|
|
|
|
cp -va ${source}/ ${destination}
|
|
|
|
chmod --recursive 744 ${destination}
|
|
|
|
'';
|
2021-12-06 16:07:01 +00:00
|
|
|
in
|
|
|
|
''
|
|
|
|
pushd $sourceRoot/external/git/
|
|
|
|
''
|
2023-10-19 13:55:26 +00:00
|
|
|
+ prepareSource useStaticOpenAL letoram-openal-src "openal"
|
|
|
|
+ prepareSource useStaticLibuvc libuvc-src "libuvc"
|
|
|
|
+ prepareSource useBuiltinLua luajit-src "luajit"
|
|
|
|
+ prepareSource useTracy tracy-src "tracy"
|
|
|
|
+ ''
|
2021-12-06 16:07:01 +00:00
|
|
|
popd
|
|
|
|
'';
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace ./src/platform/posix/paths.c \
|
|
|
|
--replace "/usr/bin" "$out/bin" \
|
|
|
|
--replace "/usr/share" "$out/share"
|
2023-10-19 13:55:26 +00:00
|
|
|
substituteInPlace ./src/CMakeLists.txt \
|
|
|
|
--replace "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
|
|
|
'';
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
# The upstream project recommends tagging the distribution
|
2023-10-19 13:55:26 +00:00
|
|
|
(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)
|
2021-07-14 22:03:04 +00:00
|
|
|
"../src"
|
|
|
|
];
|
|
|
|
|
|
|
|
hardeningDisable = [
|
|
|
|
"format"
|
|
|
|
];
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
passthru = {
|
|
|
|
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.
|
|
|
|
'';
|
2023-10-19 13:55:26 +00:00
|
|
|
license = with lib.licenses; [ bsd3 gpl2Plus lgpl2Plus ];
|
|
|
|
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
|
|
|
})
|