summary refs log tree commit diff
diff options
context:
space:
mode:
authorhqurve <53281855+hqurve@users.noreply.github.com>2022-06-23 05:34:08 -0400
committerGitHub <noreply@github.com>2022-06-23 11:34:08 +0200
commit6cab8dd7be4c0bb6e0e49c1b30d07f457f4e8407 (patch)
treebfd3318a1c8be40e987b2c6c6c4959d8050c8eb4
parent49ac1c55719ab369dd6559cd3286e9a66a76c79f (diff)
downloadnixpkgs-6cab8dd7be4c0bb6e0e49c1b30d07f457f4e8407.tar
nixpkgs-6cab8dd7be4c0bb6e0e49c1b30d07f457f4e8407.tar.gz
nixpkgs-6cab8dd7be4c0bb6e0e49c1b30d07f457f4e8407.tar.bz2
nixpkgs-6cab8dd7be4c0bb6e0e49c1b30d07f457f4e8407.tar.lz
nixpkgs-6cab8dd7be4c0bb6e0e49c1b30d07f457f4e8407.tar.xz
nixpkgs-6cab8dd7be4c0bb6e0e49c1b30d07f457f4e8407.tar.zst
nixpkgs-6cab8dd7be4c0bb6e0e49c1b30d07f457f4e8407.zip
lorien: init at 0.5.0 (#164178)
-rw-r--r--pkgs/applications/graphics/lorien/default.nix124
-rw-r--r--pkgs/top-level/all-packages.nix2
2 files changed, 126 insertions, 0 deletions
diff --git a/pkgs/applications/graphics/lorien/default.nix b/pkgs/applications/graphics/lorien/default.nix
new file mode 100644
index 00000000000..e3e8daf8766
--- /dev/null
+++ b/pkgs/applications/graphics/lorien/default.nix
@@ -0,0 +1,124 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+
+, copyDesktopItems
+, makeDesktopItem
+
+, godot-export-templates
+, godot-headless
+
+, alsa-lib
+, libGL
+, libGLU
+, libX11
+, libXcursor
+, libXext
+, libXfixes
+, libXi
+, libXinerama
+, libXrandr
+, libXrender
+, zlib
+, udev # for libudev
+}:
+
+let
+  preset =
+    if stdenv.isLinux then "Linux/X11"
+    else if stdenv.isDarwin then "Mac OSX"
+    else throw "unsupported platform";
+in
+stdenv.mkDerivation rec {
+  pname = "lorien";
+  version = "0.5.0";
+
+  src = fetchFromGitHub {
+    owner = "mbrlabs";
+    repo = "Lorien";
+    rev = "v${version}";
+    sha256 = "sha256-x81Obana2BEGrYSoJHDdCkL6UaULfQGQ94tlrH5+kdY=";
+  };
+
+  nativeBuildInputs = [
+    copyDesktopItems
+    godot-headless
+  ];
+
+  buildInputs = [
+    alsa-lib
+    libGL
+    libGLU
+    libX11
+    libXcursor
+    libXext
+    libXfixes
+    libXi
+    libXinerama
+    libXrandr
+    libXrender
+    zlib
+    udev
+  ];
+
+  desktopItems = [
+    (makeDesktopItem {
+      name = "lorien";
+      exec = "lorien";
+      icon = "lorien";
+      desktopName = "Lorien";
+      genericName = "Whiteboard";
+      comment = meta.description;
+      categories = [ "Graphics" "Office" ];
+      keywords = [ "whiteboard" ];
+    })
+  ];
+
+  buildPhase = ''
+    runHook preBuild
+
+    # Cannot create file '/homeless-shelter/.config/godot/projects/...'
+    export HOME=$TMPDIR
+
+    # Link the export-templates to the expected location. The --export commands
+    # expects the template-file at .../templates/{godot-version}.stable/linux_x11_64_release
+    mkdir -p $HOME/.local/share/godot
+    ln -s ${godot-export-templates}/share/godot/templates $HOME/.local/share/godot
+
+    mkdir -p $out/share/lorien
+
+    godot-headless --path lorien --export "${preset}" $out/share/lorien/lorien
+
+    runHook postBuild
+  '';
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/bin
+    ln -s $out/share/lorien/lorien $out/bin
+
+    # Patch binaries.
+    interpreter=$(cat $NIX_CC/nix-support/dynamic-linker)
+    patchelf \
+      --set-interpreter $interpreter \
+      --set-rpath ${lib.makeLibraryPath buildInputs} \
+      $out/share/lorien/lorien
+
+    install -Dm644 images/lorien.png $out/share/pixmaps/lorien.png
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/mbrlabs/Lorien";
+    description = "An infinite canvas drawing/note-taking app";
+    longDescription = ''
+      An infinite canvas drawing/note-taking app that is focused on performance,
+      small savefiles and simplicity
+    '';
+    license = licenses.mit;
+    platforms   = platforms.unix;
+    maintainers = with maintainers; [ hqurve ];
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 40ba78f4908..daa41e5e4db 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -8230,6 +8230,8 @@ with pkgs;
 
   longview = callPackage ../servers/monitoring/longview { };
 
+  lorien = callPackage ../applications/graphics/lorien { };
+
   lout = callPackage ../tools/typesetting/lout { };
 
   lr = callPackage ../tools/system/lr { };