@@ -0,0 +1,44 @@
1+{ stdenv
2+, lib
3+, fetchFromGitHub
4+, cmake
5+, pkg-config
6+, libunistring
7+, openssl
8+, pcre
9+, SDL2
10+, AppKit
11+}:
12+
13+stdenv.mkDerivation rec {
14+ pname = "lagrange";
15+ version = "1.0.3";
16+
17+ src = fetchFromGitHub {
18+ owner = "skyjake";
19+ repo = "lagrange";
20+ rev = "v${version}";
21+ sha256 = "1l9qcymjwg3wzbbi4hcyzfrxyqgz2xdy4ab3lr0zq38v025d794n";
22+ fetchSubmodules = true;
23+ };
24+
25+ nativeBuildInputs = [ cmake pkg-config ];
26+
27+ buildInputs = [ libunistring openssl pcre SDL2 ]
28+ ++ lib.optional stdenv.isDarwin AppKit;
29+
30+ hardeningDisable = lib.optional (!stdenv.cc.isClang) "format";
31+
32+ installPhase = if stdenv.isDarwin then ''
33+ mkdir -p $out/Applications
34+ mv Lagrange.app $out/Applications
35+ '' else null;
36+
37+ meta = with lib; {
38+ description = "A Beautiful Gemini Client";
39+ homepage = "https://gmi.skyjake.fi/lagrange/";
40+ license = licenses.bsd2;
41+ maintainers = with maintainers; [ sikmir ];
42+ platforms = platforms.unix;
43+ };
44+}