Skip to content

Commit

Permalink
result/Elexis3 is built, but does not start
Browse files Browse the repository at this point in the history
  • Loading branch information
ngiger committed May 25, 2021
1 parent d424893 commit e8f62c7
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 0 deletions.
27 changes: 27 additions & 0 deletions elexis-master/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

59 changes: 59 additions & 0 deletions elexis-master/flake.nix
@@ -0,0 +1,59 @@
# https://github.com/nix-community/elexis-all/blob/master/flake.nix
# https://github.com/Mic92/nix-ld
{
description = "elexis-all - Eclipse RCP app with all opensource components";

inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";

outputs = { self, nixpkgs}: let
forAllSystems = nixpkgs.lib.genAttrs [ "x86_64-linux"]; # "x86_64-darwin" "i686-linux" "aarch64-linux" ];
in {
# Packages
packages = forAllSystems (system: let
pkgs = nixpkgs.legacyPackages."${system}";
version = "3.8";
in {
elexis-all = pkgs.stdenv.mkDerivation {
name = "elexis-all";
src = builtins.fetchurl {
url = "https://download.elexis.info/elexis/${version}/products/Elexis3-linux.gtk.x86_64.zip";
sha256 = "0vx1smknnmqid8n6yqlvd0xhr23cd6cm3kgyr7hlia9v714f5snf";
};

meta.description = "An Eclipse RCP application for all aspect of a Swiss German medical practice";
unpackPhase = "true";
nativeBuildInputs = [ pkgs.makeWrapper pkgs.unzip pkgs.stdenv pkgs.patchelf];
buildCommand = ''
# Unpack tarball.
mkdir -p $out
unzip -d $out $src
# Patch binaries.
interpreter=$(echo ${pkgs.stdenv.glibc.out}/lib/ld-linux*.so.2)
patchelf --set-interpreter $interpreter $out/Elexis3
makeWrapper $out/Elexis3 $out/bin/Elexis3 \
--prefix LD_LIBRARY_PATH : ${pkgs.lib.makeLibraryPath ([ pkgs.glib pkgs.gtk3 pkgs.gtk3-x11 pkgs.xorg.libXtst pkgs.webkitgtk ])} \
--prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH" \
--add-flags "-configuration \$HOME/.eclipse/''${productId}_$productVersion/configuration"
'';
};
});
defaultPackage = forAllSystems (system: self.packages."${system}".elexis-all);

devShell = forAllSystems (system: let
pkgs = nixpkgs.legacyPackages."${system}";
in pkgs.mkShell {
buildInputs = with pkgs; [ jq coreutils findutils ];
});

# Make it runnable with `nix app`
apps = forAllSystems (system: {
elexis3 = {
type = "app";
program = "${self.packages."${system}".elexis-all}/bin/elexis3";
};
});
defaultApp = forAllSystems (system: self.apps."${system}".elexis3);
};
}

0 comments on commit e8f62c7

Please sign in to comment.