diff options
author | Jörg Thalheim <Mic92@users.noreply.github.com> | 2018-10-30 12:07:51 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-30 12:07:51 +0000 |
commit | d23d25ebbba59c34127c50817b396425c229d0b7 (patch) | |
tree | 92e1cbe206973415c4815386bbc095cca24ff15f | |
parent | be08e693726a892a8916462bd1cc26c34f932091 (diff) | |
parent | 444ce2dbdf9932d563ac4be0c634b7c3a8997f91 (diff) | |
download | nixlib-d23d25ebbba59c34127c50817b396425c229d0b7.tar nixlib-d23d25ebbba59c34127c50817b396425c229d0b7.tar.gz nixlib-d23d25ebbba59c34127c50817b396425c229d0b7.tar.bz2 nixlib-d23d25ebbba59c34127c50817b396425c229d0b7.tar.lz nixlib-d23d25ebbba59c34127c50817b396425c229d0b7.tar.xz nixlib-d23d25ebbba59c34127c50817b396425c229d0b7.tar.zst nixlib-d23d25ebbba59c34127c50817b396425c229d0b7.zip |
Merge pull request #47594 from midchildan/add-sourcetrail
sourcetrail: init at 2018.3.55
-rw-r--r-- | pkgs/development/tools/sourcetrail/default.nix | 75 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 2 |
2 files changed, 77 insertions, 0 deletions
diff --git a/pkgs/development/tools/sourcetrail/default.nix b/pkgs/development/tools/sourcetrail/default.nix new file mode 100644 index 000000000000..2182f8697aab --- /dev/null +++ b/pkgs/development/tools/sourcetrail/default.nix @@ -0,0 +1,75 @@ +{ stdenv, fetchurl, autoPatchelfHook +, icu, zlib, expat, dbus, libheimdal, openssl}: + +stdenv.mkDerivation rec { + name = "sourcetrail-${version}"; + version = "2018.3.55"; + + src = fetchurl { + name = "sourtrail.tar.gz"; + url = "https://www.sourcetrail.com/downloads/${version}/linux/64bit"; + sha256 = "6f5fbbecc221e7165ecbf1c4d208e302dade4feea9d43eb3265521efc0a376e2"; + }; + + nativeBuildInputs = [ autoPatchelfHook ]; + buildInputs = [ zlib expat dbus stdenv.cc.cc openssl ]; + + installPhase = '' + runHook preInstall + + mkdir -p $out/bin $out/opt + + mv -v setup/share $out + mv -v data/gui/icon/logo_1024_1024.png $out/share/icons/sourcetrail.png + mv -v data/gui/icon/project_256_256.png $out/share/icons/project-sourcetrail.png + + mkdir -p $out/share/sourcetrail/doc + mv -v README EULA.txt $out/share/sourcetrail/doc + mv -v plugin $out/share/sourcetrail + + cp -rv . $out/opt + + rm $out/opt/lib/libssl.so + rm $out/opt/lib/platforms/{libqeglfs.so,libqwebgl.so} + ln -s ${openssl}/lib/libssl.so $out/opt/lib/libssl.so + + substituteInPlace \ + $out/share/applications/sourcetrail.desktop \ + --replace /usr/bin/ $out/bin/ + + cat <<EOF > $out/bin/sourcetrail + #! ${stdenv.shell} -e + + # XXX: Sourcetrail somehow copies the initial config files into the home + # directory without write permissions. We currently just copy them + # ourselves to work around this problem. + setup_config() { + local src dst + + [ ! -d ~/.config/sourcetrail ] && mkdir -p ~/.config/sourcetrail + for src in $out/opt/data/fallback/*; do + dst=~/.config/sourcetrail/"\$(basename "\$src")" + if [ ! -e "\$dst" ]; then + cp -r "\$src" "\$dst" + fi + done + + chmod -R u+w ~/.config/sourcetrail + } + + [ -d "\$HOME" ] && setup_config + exec "$out/opt/Sourcetrail.sh" "\$@" + EOF + chmod +x $out/bin/sourcetrail + + runHook postInstall + ''; + + meta = with stdenv.lib; { + homepage = https://www.sourcetrail.com; + description = "A cross-platform source explorer for C/C++ and Java"; + platforms = [ "x86_64-linux" ]; + license = licenses.unfree; + maintainers = with maintainers; [ midchildan ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 80864ab1ce6d..130a3495c6d2 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -19040,6 +19040,8 @@ with pkgs; apiKey = config.libspotify.apiKey or null; }; + sourcetrail = callPackage ../development/tools/sourcetrail { }; + spotifywm = callPackage ../applications/audio/spotifywm { }; squeezelite = callPackage ../applications/audio/squeezelite { }; |