From 2e0e9de80c9dd47780ec34db4074f942da1befb6 Mon Sep 17 00:00:00 2001 From: Patryk Niedźwiedziński Date: Mon, 9 Nov 2020 10:45:22 +0100 Subject: Add gurl --- default.nix | 1 + pkgs/gurl/default.nix | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 pkgs/gurl/default.nix diff --git a/default.nix b/default.nix index 6f83bba..a684f70 100644 --- a/default.nix +++ b/default.nix @@ -25,6 +25,7 @@ gemget = pkgs.callPackage ./pkgs/gemget { }; kaiosrt = pkgs.callPackage ./pkgs/kaiosrt { }; kaios-devenv = pkgs.callPackage ./pkgs/kaiosrt/devenv.nix { }; + gurl = pkgs.callPackage ./pkgs/gurl { }; st = pkgs.callPackage ./pkgs/larbs/st { }; dwm = pkgs.callPackage ./pkgs/larbs/dwm { }; diff --git a/pkgs/gurl/default.nix b/pkgs/gurl/default.nix new file mode 100644 index 0000000..e37d662 --- /dev/null +++ b/pkgs/gurl/default.nix @@ -0,0 +1,66 @@ +{ stdenv, fetchurl, fetchFromGitHub, zig }: + +## Build +# stdenv.mkDerivation { +# pname = "gurl"; +# version = "0.1"; + +# src = fetchFromGitHub { +# owner = "MasterQ32"; +# repo = "gurl"; +# rev = "v0.1"; +# sha256 = "1prg7ywsd78h486lfcqhzxmnx2wai7rr3qzxldw9ggjv1mjf5laq"; +# fetchSubmodules = true; +# }; + +# nativeBuildInputs = [ zig ]; + +# buildPhase = '' +# export XDG_CACHE_HOME=$(mktemp -d) +# zig build +# rm -rf $XDG_CACHE_HOME +# ''; + +# installPhase = '' +# mkdir -p $out/bin +# cp zig-cache/bin/gurl $out/bin +# ''; +# } + +## Prebuilt +let + inherit (stdenv.hostPlatform) system; + throwSystem = throw "Unsupported system: ${system}"; + + version = "0.1"; + + prebuilts = let + base = "https://github.com/MasterQ32/gurl/releases/download"; + in + { + x86_64-linux = { + url = "${base}/v${version}/gurl-x86_64-linux"; + sha256 = "0yz3w5mqgl1spszndpbrmy6jvxpfx2n3qlmv4v8f5mp1my6kgysy"; + }; + aarch64-linux = { + url = "${base}/v${version}/gurl-aarch64-linux"; + sha256 = "0rwscrnzl29rmg2xpzabv0ww9rc4xsj12ddiw2rn005wag9an1ci"; + }; + }; + + source = prebuilts.${system} or throwSystem; + bin = fetchurl source; + +in + stdenv.mkDerivation { + inherit version; + pname = "gurl"; + unpackPhase = "true"; + + installPhase = '' + mkdir -p $out/bin + cp ${bin} $out/bin/gurl + chmod +x $out/bin/gurl + ''; + + } -- cgit 1.4.1