summary refs log tree commit diff
path: root/pkgs/desktops
diff options
context:
space:
mode:
authorAndersonTorres <torres.anderson.85@protonmail.com>2021-07-02 06:01:46 -0300
committerAndersonTorres <torres.anderson.85@protonmail.com>2021-07-07 22:56:08 -0300
commit09eacdb0dfb4d8eba59466dacf7714f7e5150f3f (patch)
tree335a9aca637428245ed9eaaa1382d77ff0cf0ad4 /pkgs/desktops
parentc23b5bd4126c1abb0227399ab0d113f5a6bb0565 (diff)
downloadnixpkgs-09eacdb0dfb4d8eba59466dacf7714f7e5150f3f.tar
nixpkgs-09eacdb0dfb4d8eba59466dacf7714f7e5150f3f.tar.gz
nixpkgs-09eacdb0dfb4d8eba59466dacf7714f7e5150f3f.tar.bz2
nixpkgs-09eacdb0dfb4d8eba59466dacf7714f7e5150f3f.tar.lz
nixpkgs-09eacdb0dfb4d8eba59466dacf7714f7e5150f3f.tar.xz
nixpkgs-09eacdb0dfb4d8eba59466dacf7714f7e5150f3f.tar.zst
nixpkgs-09eacdb0dfb4d8eba59466dacf7714f7e5150f3f.zip
arcan.arcan: init at 0.6.1pre1+unstable=2021-07-07
Diffstat (limited to 'pkgs/desktops')
-rw-r--r--pkgs/desktops/arcan/arcan.nix157
-rw-r--r--pkgs/desktops/arcan/default.nix9
2 files changed, 166 insertions, 0 deletions
diff --git a/pkgs/desktops/arcan/arcan.nix b/pkgs/desktops/arcan/arcan.nix
new file mode 100644
index 00000000000..8a30da9e81f
--- /dev/null
+++ b/pkgs/desktops/arcan/arcan.nix
@@ -0,0 +1,157 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, SDL2
+, cmake
+, espeak
+, ffmpeg
+, file
+, freetype
+, harfbuzz
+, leptonica
+, libGL
+, libX11
+, libXau
+, libXcomposite
+, libXdmcp
+, libXfixes
+, libdrm
+, libffi
+, libusb1
+, libuvc
+, libvlc
+, libvncserver
+, libxcb
+, libxkbcommon
+, luajit
+, makeWrapper
+, mesa
+, openal
+, pkg-config
+, sqlite
+, tesseract
+, valgrind
+, wayland
+, wayland-protocols
+, xcbutil
+, xcbutilwm
+, xz
+, buildManPages ? true, ruby
+}:
+
+let
+  # TODO: investigate vendoring, especially OpenAL
+  # WARN: vendoring of OpenAL is required for running arcan_lwa
+  # INFO: maybe it needs leaveDotGit, but it is dangerous/impure
+  letoram-openal-src = fetchFromGitHub {
+    owner = "letoram";
+    repo = "openal";
+    rev = "1c7302c580964fee9ee9e1d89ff56d24f934bdef";
+    hash = "sha256-InqU59J0zvwJ20a7KU54xTM7d76VoOlFbtj7KbFlnTU=";
+  };
+in
+stdenv.mkDerivation rec {
+  pname = "arcan";
+  version = "0.6.1pre1+unstable=2021-07-07";
+
+  src = fetchFromGitHub {
+    owner = "letoram";
+    repo = "arcan";
+    rev = "f3341ab94b32d02f3d15c3b91a512b2614e950a5";
+    hash = "sha256-YBtRA5uCk4tjX3Bsu5vMkaNaCLRlM6HVQ53sna3gDsY=";
+  };
+
+  postUnpack = ''
+    (
+     cd $sourceRoot/external/git/
+     cp -a ${letoram-openal-src}/ openal/
+     chmod --recursive 744 openal/
+    )
+  '';
+
+  # TODO: work with upstream in order to get rid of these hardcoded paths
+  postPatch = ''
+    substituteInPlace ./src/platform/posix/paths.c \
+      --replace "/usr/bin" "$out/bin" \
+      --replace "/usr/share" "$out/share"
+
+    substituteInPlace ./src/CMakeLists.txt --replace "SETUID" "# SETUID"
+  '';
+
+  nativeBuildInputs = [
+    cmake
+    makeWrapper
+    pkg-config
+  ] ++ lib.optionals buildManPages [
+    ruby
+  ];
+
+  buildInputs = [
+    SDL2
+    espeak
+    ffmpeg
+    file
+    freetype
+    harfbuzz
+    leptonica
+    libGL
+    libX11
+    libXau
+    libXcomposite
+    libXdmcp
+    libXfixes
+    libdrm
+    libffi
+    libusb1
+    libuvc
+    libvlc
+    libvncserver
+    libxcb
+    libxkbcommon
+    luajit
+    mesa
+    openal
+    sqlite
+    tesseract
+    valgrind
+    wayland
+    wayland-protocols
+    xcbutil
+    xcbutilwm
+    xz
+  ];
+
+  # INFO: According to the source code, the manpages need to be generated before
+  # the configure phase
+  preConfigure = lib.optionalString buildManPages ''
+    (cd doc; ruby docgen.rb mangen)
+  '';
+
+  cmakeFlags = [
+    "-DBUILD_PRESET=everything"
+    # The upstream project recommends tagging the distribution
+    "-DDISTR_TAG=Nixpkgs"
+    "-DENGINE_BUILDTAG=${version}"
+    "-DHYBRID_SDL=on"
+    "-DSTATIC_OPENAL=off"
+    "../src"
+  ];
+
+  hardeningDisable = [
+    "format"
+  ];
+
+  meta = with lib; {
+    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.
+    '';
+    license = with licenses; [ bsd3 gpl2Plus lgpl2Plus ];
+    maintainers = with maintainers; [ AndersonTorres ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/pkgs/desktops/arcan/default.nix b/pkgs/desktops/arcan/default.nix
index 5f26ee033c8..62a8546c844 100644
--- a/pkgs/desktops/arcan/default.nix
+++ b/pkgs/desktops/arcan/default.nix
@@ -1,4 +1,13 @@
 { callPackage, lib, pkgs }:
 
 rec {
+  # Dependencies
+
+  espeak = pkgs.espeak-ng;
+  ffmpeg = pkgs.ffmpeg-full;
+  harfbuzz = pkgs.harfbuzzFull;
+
+  # Arcan
+
+  arcan = callPackage ./arcan.nix { };
 }