This is slowly starting to be more realistic.

This commit is contained in:
zgrep 2018-07-21 08:50:01 -04:00
parent 2af1cd9dd5
commit ca7eb54a9f
2 changed files with 58 additions and 0 deletions

14
default.nix Normal file
View File

@ -0,0 +1,14 @@
{ pkgs ? import <nixpkgs> {} }:
let
inherit (pkgs) callPackage;
inherit (pkgs.lib) filterAttrs mapAttrs;
inherit (builtins) substring readDir;
here = ./.;
want = filterAttrs (name: type:
type == "directory" && (substring 0 1 name) != "."
) (readDir here);
in mapAttrs (name: type:
callPackage (import here/name)
) want

44
sourcetrail/default.nix Normal file
View File

@ -0,0 +1,44 @@
{lib, stdenv, pkgs, fetchurl, buildFHSUserEnv}:
let
libPath = lib.makeLibraryPath (with pkgs; [
zlib
expat
]);
sourcetrail = stdenv.mkDerivation rec {
name = "sourcetrail-${version}";
version = "2018.2.77";
src = fetchurl {
name = "${name}.tar.gz";
url = "https://www.sourcetrail.com/downloads/${version}/linux/64bit";
sha256 = "1edfe95818f656840640d360df0cee72944af668d09b1a83cb6cb967ccaee719";
sha512 = "667b45449689d8f22a2a3ab2b9ad5d7d0c919fa61701e164927624df8843804b7b3f4c19e38e41da4afcff892a464157bea4cbffaa38e529bda364d1c284ee52";
};
phases = [ "unpackPhase" "installPhase" ];
installPhase = ''
mkdir -p $out/{opt/sourcetrail,usr,bin}
rm install.sh uninstall.sh
mv setup/share $out/usr/
mv * $out/opt/sourcetrail/
substituteInPlace $out/usr/share/applications/sourcetrail.desktop --replace '/usr/bin' "$out/bin"
for exe in $out/opt/sourcetrail/{Sourcetrail,sourcetrail_indexer}; do
patchelf \
--set-interpreter "${stdenv.cc.bintools.dynamicLinker}" \
$exe
done
ln -s $out/opt/sourcetrail/Sourcetrail.sh $out/bin/sourcetrail
'';
};
in buildFHSUserEnv rec {
name = sourcetrail.name;
profile = "LD_LIBRARY_PATH=${libPath}:$LD_LIBRARY_PATH";
targetPkgs = pkgs: [ sourcetrail ];
runScript = "sourcetrail";
}