diff --git a/k/default.nix b/k/default.nix new file mode 100644 index 0000000..76acd1d --- /dev/null +++ b/k/default.nix @@ -0,0 +1,34 @@ +{ stdenv, fetchurl }: + +assert stdenv.is64bit; +assert stdenv.isLinux || stdenv.isDarwin; + +let + osdir = if stdenv.isDarwin then "osx-64" else "linux-64"; + sha256 = if stdenv.isDarwin + then "e50e84a017a585f9459302ce2670c04385e1f59adcacc3ecdecad79edce6ed07" + else "6c4b776e85fe04d8efb178ccc9278bd5ee31d57b11e23886226564cdc8677d06"; +in stdenv.mkDerivation rec { + name = "k"; + version = "2019.03.21-1047_g7948682"; + src = fetchurl { + inherit sha256; + url = "https://anaconda.org/shaktidb/shakti/${builtins.substring 0 10 version}/download/${osdir}/shakti-${version}.tar.bz2"; + }; + phases = [ "installPhase" ]; + installPhase = '' + mkdir -p "$out" + tar -xf "${src}" -C "$out" "bin/${name}" + chmod +x "$out/bin/${name}" + ''; + meta = with stdenv.lib; { + description = "An interpreter for the k7 language."; + license = { + fullName = "Evaluation Agreement"; + url = https://shakti.com/license; + free = false; + }; + homepage = https://shakti.com/; + platforms = with platforms; linux ++ darwin; + }; +} diff --git a/sourcetrail/default.nix b/sourcetrail/default.nix deleted file mode 100644 index 9aa8cf0..0000000 --- a/sourcetrail/default.nix +++ /dev/null @@ -1,50 +0,0 @@ -{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"; - - meta = with lib; { - description = "A cross-platform source explorer for C/C++ and Java."; - homepage = https://www.sourcetrail.com; - license = licenses.unfree; # :( - }; -}