From 9062c1ecffe7b34bf5329601edc3869be522a31a Mon Sep 17 00:00:00 2001 From: David Terry Date: Wed, 2 Dec 2020 10:15:03 +0100 Subject: [PATCH] radicle-upstream: init at 0.1.5 --- .../radicle-upstream/default.nix | 64 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 66 insertions(+) create mode 100644 pkgs/applications/version-management/git-and-tools/radicle-upstream/default.nix diff --git a/pkgs/applications/version-management/git-and-tools/radicle-upstream/default.nix b/pkgs/applications/version-management/git-and-tools/radicle-upstream/default.nix new file mode 100644 index 000000000000..f7b6aa153140 --- /dev/null +++ b/pkgs/applications/version-management/git-and-tools/radicle-upstream/default.nix @@ -0,0 +1,64 @@ +{ stdenv, appimageTools, gsettings-desktop-schemas, gtk3, autoPatchelfHook, zlib, fetchurl }: + +let + pname = "radicle-upstream"; + version = "0.1.5"; + name = "${pname}-${version}"; + + src = fetchurl { + url = "https://releases.radicle.xyz/radicle-upstream-${version}.AppImage"; + sha256 = "1q5p6bvzi5awxd9a3xvvdhy26bz0dx8drb1z0zzqdvqqcxxyydq7"; + }; + + contents = appimageTools.extractType2 { inherit name src; }; + + git-remote-rad = stdenv.mkDerivation rec { + pname = "git-remote-rad"; + inherit version; + src = contents; + + nativeBuildInputs = [ autoPatchelfHook ]; + buildInputs = [ zlib ]; + + installPhase = '' + mkdir -p $out/bin/ + cp ${contents}/resources/git-remote-rad $out/bin/git-remote-rad + ''; + }; +in + +# FIXME: a dependency of the `proxy` component of radicle-upstream (radicle-macros +# v0.1.0) uses unstable rust features, making a from source build impossible at +# this time. See this PR for discussion: https://github.com/NixOS/nixpkgs/pull/105674 +appimageTools.wrapType2 { + inherit name src; + + profile = '' + export XDG_DATA_DIRS=${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}:${gtk3}/share/gsettings-schemas/${gtk3.name}:$XDG_DATA_DIRS + ''; + + extraInstallCommands = '' + mv $out/bin/${name} $out/bin/${pname} + + # this automatically adds the git-remote-rad binary to the users `PATH` so + # they don't need to mess around with shell profiles... + ln -s ${git-remote-rad}/bin/git-remote-rad $out/bin/git-remote-rad + + # desktop item + install -m 444 -D ${contents}/${pname}.desktop $out/share/applications/${pname}.desktop + substituteInPlace $out/share/applications/${pname}.desktop \ + --replace 'Exec=AppRun' 'Exec=${pname}' + + # icon + install -m 444 -D ${contents}/${pname}.png \ + $out/share/icons/hicolor/512x512/apps/${pname}.png + ''; + + meta = with stdenv.lib; { + description = "A decentralized app for code collaboration"; + homepage = "https://radicle.xyz/"; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ xwvvvvwx ]; + platforms = [ "x86_64-linux" ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9e336517b32a..de9f256ca63f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -17628,6 +17628,8 @@ in radicale = radicale3; + radicle-upstream = callPackage ../applications/version-management/git-and-tools/radicle-upstream {}; + rake = callPackage ../development/tools/build-managers/rake { }; redis = callPackage ../servers/nosql/redis { };